probemon
probemon copied to clipboard
wrong RSSI value
When I use the -r or --rssi switch I got big negative value that are non sense.
I found out that I must replace the line 56 with this one:
rssi_val = -(256-ord(packet.notdecoded[-2:-1]))
to get the correct value
I don't know if it's universal.
Hi, I am also getting the same value. Did you solve the issue?
YES. I have shown the fix above. it's line 56
A more general fix is to use the offical radiotap library to parse the RSSI value
Something like this:
from radiotap import radiotap_parse
offset, headers = radiotap_parse(str(packet))
rssi = headers['dbm_antsignal']
This adds a dependancy but it is a more robust fix.
So before I make the fix I am unable to run Probemon. After I make: rssi_val = -(256-ord(packet.notdecoded[-2:-1])) it works, but the rssi value is always -256. How do I fix?
I am having the same issue. If we use the above where would this get placed in the coding?
A more general fix is to use the offical radiotap library to parse the RSSI value
Something like this:
from radiotap import radiotap_parse offset, headers = radiotap_parse(str(packet)) rssi = headers['dbm_antsignal']This adds a dependancy but it is a more robust fix.
this worked for me.
So instead of importing a new dependancy with python-radiotap, one can use the following function (this is a stripped down version of the python-radiotap parsing module)
def parse_rssi(packet):
# parse dbm_antsignal from radiotap header
# borrowed from python-radiotap module
radiotap_header_fmt = '<BBHI'
radiotap_header_len = struct.calcsize(radiotap_header_fmt)
version, pad, radiotap_len, present = struct.unpack_from(radiotap_header_fmt, packet)
start = radiotap_header_len
bits = [int(b) for b in bin(present)[2:].rjust(32, '0')]
bits.reverse()
if bits[5] == 0:
return 0
while present & (1 << 31):
present, = struct.unpack_from('<I', packet, start)
start += 4
offset = start
if bits[0] == 1:
offset = (offset + 8 -1) & ~(8-1)
offset += 8
if bits[1] == 1:
offset += 1
if bits[2] == 1:
offset += 1
if bits[3] == 1:
offset = (offset + 2 -1) & ~(2-1)
offset += 4
if bits[4] == 1:
offset += 2
dbm_antsignal, = struct.unpack_from('<b', packet, offset)
return dbm_antsignal
So, for example replace line 56 with
rssi_val = parse_rssi(buffer(str(packet)))
You will need to import struct module
With latest scapy you can just use:
rssi_val = packet.dBm_AntSignal