Final project in OS course. Sniffer for traffic capturing. Based on libpcap for capture packages and Qt for viewing and analysing them. Support gui and cli
- C++ compiler - needs to support C++17 standard
- CMake 3.16+
- libpcap
- Qt
Dependencies (such as development libraries) can be found in the dependencies folder in the form of the text files with package names for different package managers.
-
Clone the project.
git clone git@github.com:igor185/sniffer.git
-
Install required packages.
On Ubuntu:
[[ -r dependencies/apt.txt ]] && sed 's/#.*//' dependencies/apt.txt | xargs sudo apt-get install -y
On MacOS:
[[ -r dependencies/homebrew.txt ]] && sed 's/#.*//' dependencies/homebrew.txt | xargs brew install
Use Conan on Windows.
-
Build.
mkdir build && cd build && cmake .. && make
sudo ./sniffer --help
├── cmake
├── dependencies -- dependencies of project
├── resources -- Qt resources folder
│ └── images
└── src
├── core
│ ├── core -- main logic for package capturing
│ └── socket -- definition of packate structure and main function for it
├── IO -- IO part of project
├── UI
│ ├── Details -- Window for full information about package
│ ├── Filters -- Window for filters set up
│ ├── HexView -- View for package in hex
│ ├── InitPage -- Main logic for UI
│ └── Table -- Table for package preview displaying
└── utils -- helpers functions
- Open src/core/sockets.h
- Define class representing your packet
- Extend base_socket class or more suitable
- Add <name_of_protocol>.cpp in src/core/socket folder
- Override all needed methods
- Add this class in src/core/socket/general.cpp