-
Notifications
You must be signed in to change notification settings - Fork 7
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
'scapy.all' has no attribute 'get_if_raw_hwaddr' #3
Comments
Here's the pull request. |
There's a problem: Wireshark sees the packets but the esp8266 doesn't receive them. That's weird.
And here's the esp8266 code:
The receiver mac and channel is right (1) |
Must be some differences in the scapy versions, I'll do some testing when I have some time and get back to you on this and the PR. |
Is your Linux setup receiving messages with your changes? |
I tried running the code on a laptop and a desktop which both have interfaces that support monitor mode and packet injection (I tested them with airplay and they work). |
A couple things to check: What is the output (if any) from prep.sh being run with the correct interface and channel set? Try adding adding accept_all Can you describe your setup? |
I also enabled the accept_all flag and it now somehow works: When either computer sends a message to the other one, the library on the recipient side sees the packet! To sum up, I now used the prep script and enabled that accept_all flag. I can now receive the packets but not the messages. Also, if I turn off the accept_all flag the program stops outputting data (even though its the right receiver mac). Edit: Wireshark on the sender side shows that each packet gets retransmitted a few times and only the first transmission contains the intended message. |
accept_all should only mean it will accept any message no matter the recipient MAC. Sound like there may be a MAC address mismatch. As for the missing function, I used/use scapy version 2.5.0 for development, so the function must be removed for version 2.6.0. I'll take a look. There was a reason for the strange method of gathering the local MAC, I'll have to try and track down why I did it like that initially. It may be related to local MAC spoofing. I'll keeping looking. |
Hi guys, lp4s0 IEEE 802.11 Mode:Monitor Frequency:2.447 GHz Tx-Power=3 dBm
Retry short limit:7 RTS thr:off Fragment thr:off
Power Management:on And lshw command show: capabilities: pciexpress msi pm bus_master cap_list logical wireless
configuration: broadcast=yes driver=mt7921e driverversion=6.1.0-0.deb11.17-amd6 Also I did the steps for run this with privileges. But I have some doubts with this step: sudo setcap cap_net_raw=eip env/bin/python_netraw One question, I was trying it with a esp32 that is sending packages from C++, don't matter right? |
What does your python code look like? What does your ESP code look like? |
Hi again, I found the solution in my case, following the next steps:
And I have messages with the sniffer sample like this: ESP-NOW message from 74:4D:BD:81:4E:FC to FF:FF:FF:FF:FF:FF: b'\xec\x13\x12d\x16\x8a))\x80\xb4~4\x94\xb9\xa0\x02\x8a(\xa0\x02\x92\x96\x92\x80\x1ai\r8\xd2\x11Lci)i(\x00\xa2\x8a(\x00\xa2\x8a(\x00\xa2\x8a(\x00\xa2\x92\x8a`\x14\xb4RP\x01E\x14R\x00\xa2\x8a(\x01E-6\x94P\x03\xa9i\xb4\xb4\x00\xb4RR\xd2\x01)\xc2\x9b\xde\x94\x1a\x00u%\x14P \xa2\x8a(\x00\xa2\x8aJ\x00\xff\xd9' One question please, is possible use nanopb (protocol buffers) with this Python package? I'm coding the messages from the ESP32 using nanopb. Thanks, pretty nice Python package. |
Sorry, I didn't reload the page and I didn't seen this question. My Python code is the sample sniffer code without any change, but using the PR #4 |
Hey everybody, I first of all want to let you all know how awesome this module is!!
Anyways, I had to work a bit to get it working.
I am using python 3.9.5 with scapy 2.6.0 and, when running the first example in the readme, it fails.
Here's the code:
And, when ran with
sudo python test.py
, it fails with:I think I got it to work with my pull request:
Line 247 defines the function
hw_mac_as_str
in a pretty weird way (it's got an unused argument(interface) and reconstructs the string version of the interface's mac address. What's the point of that if there's scapy'sget_if_hwaddr
function for it?I fixed it (now there are no errors and Wireshark detects the packets) and am about to open a PR, once I figure out how to upload the fix...
Give me a few minutes so I can feel the glory of publishing my first PR please :-)
The text was updated successfully, but these errors were encountered: