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: bad magic number in net disco #39

Closed
ggmartins opened this issue Dec 6, 2019 · 9 comments
Closed

error: bad magic number in net disco #39

ggmartins opened this issue Dec 6, 2019 · 9 comments

Comments

@ggmartins
Copy link

Hey there folks, I've got this error after running iot inpector for the second time today (I see that the latest code was updated/pulled from git right after I ctrl-c. This is in a raspberry pi 4. Also, I had to manually install netifaces using pip3 to make it (almost) work.

Traceback (most recent call last):
  File "start_inspector.py", line 2, in <module>
    import inspector
  File "/root/princeton-iot-inspector/iot-inspector-client/v2-src/inspector.py", line 12, in <module>
    from netdisco_wrapper import NetdiscoWrapper
  File "/root/princeton-iot-inspector/iot-inspector-client/v2-src/netdisco_wrapper.py", line 13, in <module>
    from netdisco.discovery import NetworkDiscovery
ImportError: bad magic number in 'netdisco': b'\x03\xf3\r\n'
@crazyideas21
Copy link
Contributor

Can you clone the latest code into a brand new directory and try again? This problem could be related to stale pyc files, especially given we recently bumped the python version from 2 to 3.

See:

@ggmartins
Copy link
Author

looks like a different problem now (after cloning the entire repo again):

./linux-start-inspector.sh 
Starting IoT Inspector...
Traceback (most recent call last):
  File "start_inspector.py", line 2, in <module>
    import inspector
  File "/root/princeton-iot-inspector/iot-inspector-client/v2-src/inspector.py", line 5, in <module>
    import utils
  File "/root/princeton-iot-inspector/iot-inspector-client/v2-src/utils.py", line 21, in <module>
    from scapy.arch.windows import NetworkInterface
  File "/usr/local/lib/python3.7/dist-packages/scapy/arch/windows/__init__.py", line 21, in <module>
    from scapy.arch.windows.structures import _windows_title, \
  File "/usr/local/lib/python3.7/dist-packages/scapy/arch/windows/structures.py", line 15, in <module>
    import ctypes.wintypes
  File "/usr/lib/python3.7/ctypes/wintypes.py", line 20, in <module>
    class VARIANT_BOOL(ctypes._SimpleCData):
ValueError: _type_ 'v' not supported
Updating software...
Already up to date.

@ggmartins
Copy link
Author

FYI

commit cb84ec48ca3b36f736887f7e3861750d3a4ac3b0 (HEAD -> master, origin/master, origin/HEAD)
Author: Danny Y. Huang <[email protected]>
Date:   Tue Dec 17 15:07:09 2019 -0500

    Update README.md
    
    Added description on Windows 10 support.

commit 393bf81b159bbc0c7a13c2262cd5387938de4ab0
Merge: 17bd533 6a56351
Author: Danny Y. Huang <[email protected]>
Date:   Tue Dec 17 15:06:08 2019 -0500

    Merge pull request #40 from noise-lab/kumarde/add_windows_support
    
    Add windows support. Independently tested by @kumarde and @crazyideas21 on their Windows 10 installations. In the case of @crazyideas21, his Windows 10 runs on a bare metal Lenovo laptop.

@kumarde
Copy link
Collaborator

kumarde commented Dec 17, 2019

@ggmartins good catch, thanks! I will update this – I know the fix.

@kumarde
Copy link
Collaborator

kumarde commented Dec 17, 2019

@ggmartins mind giving the latest master a try? Fixed here: #46

@ggmartins
Copy link
Author

it works now after installing tcpdump. Thanks!

@crazyideas21
Copy link
Contributor

it works now after installing tcpdump

@ggmartins What do you mean by "after installing tcpdump"? Did you have to install additional software?

@ggmartins
Copy link
Author

yes, some library, possibly scapy was complaining about missing tcpdump and dumping a stack trace every second. I can purge tcpdump and see if I can get the exact output for that if that helps.

@crazyideas21
Copy link
Contributor

I can purge tcpdump and see if I can get the exact output for that if that helps.

@ggmartins That'd be great. Thanks! The users are not expected to install any missing packets; the installation process should be as easy as possible.

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

3 participants