Skip to content
This repository was archived by the owner on Mar 31, 2026. It is now read-only.

DFAIR-LAB-Augusta/tcpdump-command-runner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

tcpdump-command-runner

A Python script that uses tcpdump to capture network traffic for a specified duration, runs custom commands during the capture, and saves the output to pcap files. This allows for capturing both the network traffic during the idle state and the traffic generated by the execution of the commands.

Requirements

  • Python 3.x
  • tcpdump Please ensure that you have tcpdump installed on your system. You can install it using the package manager for your distribution. For example, on Ubuntu: sudo apt-get install tcpdump

Usage

  1. Clone the repository: git clone https://github.com/your_username/tcpdump-command-runner.git
  2. Edit the commands and fileNames lists in tcpdump_command_runner.py to include your desired commands and output pcap file names.
  3. Run the script: python3 tcpdump_command_runner.py The script will iterate through the commands and file names, running tcpdump for the specified duration (default is 8 hours) and executing each command during the capture. The captured network traffic, including the effects of the executed commands, will be saved to the corresponding pcap files.

Customization

You can change the capture duration by modifying the capture_duration variable in tcpdump_command_runner.py. The default value is 8 hours (8 * 60 * 60 seconds). To change the duration, simply update the value to your desired duration in seconds.

License

This project is licensed under the Unlicense License. See the LICENSE file for details.

About

A Python script to capture network traffic with tcpdump, run custom commands, and save the output to pcap files.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages