```from Crypto.PublicKey import RSAfrom Crypto.Util.number import inverse,long_to_bytes
# I tried to use tools to visualize Bluetooth communications but there is no good ones# so I decided to stick with Wireshark# getting public key from protocols ATT Rcvd handle notification# packets number 213 and 223key = RSA.importKey(open('key.pem').read())
# logic: after getting the key, we get the cipher text# so the next packet will be the cipher text# packet number 233 ATT: sent write request# removing null bytes at the end :pc = ...c = int(c,16)
# and the remaining is RSA :pn = key.np = ... #from factordbq = n // pe = key.ed = inverse(e,(p-1)*(q-1))m = pow(c,d,n)
print(long_to_bytes(m).split(b"\x00")[1])```
```> Flag: CHTB{5p34k_fr13nd_4nd_3n73r}```