Skip to content

Layer 2 packet constructor and sender using Python

Notifications You must be signed in to change notification settings

nickchen120235/packet-sender

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Packet Sender

Layer 2 packet constructor and sender using Python

Table of Contents

Environment

  • Ubuntu Desktop 20.04 with linux kernel 5.4.0-58-generic
  • Python 3.8.5

Used Library

Run Directly

  1. 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
  1. Run ./main.py with sudo using ./venv/bin/python3: sudo ./venv/bin/python3 ./main.py

Build Executable

Don't do this since it'll create a 131MB executable, which is kinda ridiculous.

  1. Install pyinstaller: sudo pip3 install pyinstaller
  2. Run pyinstall --onefile ./main.py
  3. Run ./main with sudo: sudo ./main

Folder Structure

  • ./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

API Reference

See ./docs/api for library usage

Program Usage

See ./docs/program for program usage

About

Layer 2 packet constructor and sender using Python

Resources

Stars

Watchers

Forks

Languages