Rating: 5.0

Bluetooth pcap with the flag written on the low energy BT device. Parse the packets and get the write queries or answer, reconstruct the string and decode the flag.

See more details in full writeup

```python
from scapy.all import *

current = []
for packet in rdpcap('btle.pcap'):
if "Prepare Write Response" in packet:
offset = packet["Prepare Write Response"].offset
data = bytes(packet["Prepare Write Response"].data)
if offset + len(data) > len(current):
current = current + ([0] * (offset + len(data) - len(current)))
for i in range(offset, offset + len(data)):
current[i] = data[i - offset]
print(current)
print("".join([chr(x) for x in current]))
```

Original writeup (https://github.com/apoirrier/CTFs-writeups/blob/master/PBCTF2021/Misc/BTLE.md).