Net Agent
Net-agent is a stand-alone binary crate within the Net Stalker project that allows you to capture network traffic, which then can be uploaded to my.netstalker.io for further analysis.
Installation
To install net-agent, use Cargo:
cargo install net-agent
Requirements
Before running net-agent, make sure you have the necessary dependencies installed for your operating system:
Linux
-
Ubuntu/Debian:
sudo apt-get install libpcap-dev -
Fedora:
sudo dnf install libpcap-devel -
Arch:
sudo pacman -S libpcap
macOS
libpcapshould be installed on Mac OS X by default.
Windows
-
Install Npcap.
-
Download the Npcap SDK.
-
Add the SDK's
/Libor/Lib/x64folder to yourLIBenvironment variable.
Usage
You can run net-agent with the following command-line options:
net-agent [OPTIONS]
The available options are:
-
-D, --device-name <DEVICE_NAME>: Specify the network device to capture traffic from. -
-N, --number-packages <NUMBER_PACKAGES>: Specify the number of packages to capture. -
-B, --buffer-size <BUFFER_SIZE>: Specify the buffer size for capturing packages. -
-O, --output-directory <OUTPUT_DIRECTORY>: Specify the output directory for captured traffic (default: "output").
Note: The -C, --config-file option conflicts with all other options. If specified, the configuration will be loaded from the specified file.
Configuration
To use the configuration file, pass the -C, --config-file option with the path to the file.
-
template
= <DEVICE_NAME> = <NUMBER_PACKAGES> = <BUFFER_SIZE> = <OUTPUT_DIRECTORY> -
example
= "eth0" = 1000 = 2048 = "captured_traffic"
Troubleshooting
On linux to run the application with sudo it usually needs to run
sudo cp ~/.cargo/bin/net-agent /usr/local/bin/
Contributing
All the contributions to net-agent are welcome! If you find any issues or have suggestions for improvements, please open an issue on the GitHub repository.
If you want to contribute code to the project, please follow these steps:
- Clone the repository and create a new branch for your feature or bug fix.
- Make your changes and ensure that the code passes all tests and linting checks.
- Submit a pull request describing your changes and why they should be merged.
Please note that all contributions are subject to review and approval by the project maintainers.
License
net-agent is licensed under the Apache License, Version 2.0. See LICENSE for more information.