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
socket
library 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.py
withsudo
using./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
./main
withsudo
: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