Layer 2 packet constructor and sender using Python
- Ubuntu Desktop 20.04 with linux kernel
5.4.0-58-generic - Python 3.8.5
- builtin
socketlibrary netifaces: get local IP and MAC addressPySide2: official python library of Qt
- Install requirements inside a virtual environment
nick@nick:~/packet-sender$ sudo pip3 install virtualenv
nick@nick:~/packet-sender$ virtualenv venv
nick@nick:~/packet-sender$ source ./venv/bin/activate
(venv) nick@nick:~/packet-sender$ pip3 install PySide2 netifaces
(venv) nick@nick:~/packet-sender$ deactivate- Run
./main.pywithsudousing./venv/bin/python3:sudo ./venv/bin/python3 ./main.py
Don't do this since it'll create a 131MB executable, which is kinda ridiculous.
- Install
pyinstaller:sudo pip3 install pyinstaller - Run
pyinstall --onefile ./main.py - Run
./mainwithsudo:sudo ./main
./main.py: Program entrance./ICMPexample.py: Example of library usage./lib: Self-defined libraries./lib/packet.py: Packet factory classes of different protocols./lib/helper.py: Packet unpack class, constants, helper functions
./views: Qt frontend./views/*.py: Views of different protocols./views/widgets/info.*.py: Visualization of unpacked data
See ./docs/api for library usage
See ./docs/program for program usage