Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error in /usr/lib/python3/dist-packages/above.py for key --import xxx.pcap #8

Closed
MAKASHIIII opened this issue May 30, 2024 · 1 comment

Comments

@MAKASHIIII
Copy link

Hi ! When I am run above --import xxx.pcap that see :

[+] Detected LLDP Frame
[] Attack Impact: Information Gathering
[
] Tools: Wireshark
Traceback (most recent call last):
File "/usr/bin/above", line 33, in
sys.exit(load_entry_point('above==2.6', 'console_scripts', 'above')())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/above.py", line 812, in main
analyze_pcap(args.input)
File "/usr/lib/python3/dist-packages/above.py", line 74, in analyze_pcap
packet_detection(packet)
File "/usr/lib/python3/dist-packages/above.py", line 579, in packet_detection
port_id = packet[LLDPDUPortID].id.decode() if packet.haslayer(LLDPDUPortID) else "Not Found"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?

@casterbyte
Copy link
Owner

Hi. I made adjustments to the Above code, now, before decoding, each of these lines checks if the value is a byte object using isinstance(variable, bytes). If it is, decoding is performed. Otherwise, the original value is used. This prevents the error that occurred when trying to decode a string object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants