Skip to content

πŸ“¦ Convert PCAP network capture files to CSV format for easy analysis and reporting! πŸ“Š

License

Notifications You must be signed in to change notification settings

Mobiwn/Pcap2CSV

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Pcap2CSV

Pcap2CSV is a Python utility for converting packet capture (PCAP) files into CSV format. This tool allows for easy analysis of network traffic by converting detailed packet data into a structured CSV file, which can be used for further analysis or reporting. πŸ“Š

Features

  • πŸ—‚οΈ Convert PCAP files to CSV format
  • 🌐 Support for IP, TCP, UDP, and other protocols
  • πŸ–₯️ Simple command-line interface
  • πŸ§ͺ Includes utility scripts for generating test PCAP files
  • βœ… Unit tests to ensure code reliability

Installation

  1. Clone the Repository πŸš€

    git clone https://github.com/mobiwn/Pcap2CSV.git
    cd Pcap2CSV
  2. Set Up a Virtual Environment πŸ—οΈ

    python -m venv venv
    source venv/bin/activate  # On Windows, use `venv\Scripts\activate`
  3. Install Dependencies πŸ“¦

    pip install -r requirements.txt

Usage

Converting a PCAP File to CSV

To convert a PCAP file to CSV, use the convert_pcap.py script:

python scripts/convert_pcap.py <pcap_file> <csv_file>

Example:

python scripts/convert_pcap.py tests/data/test.pcap tests/data/test.csv

Generating a Test PCAP File

To generate a test PCAP file with random packets, use the generate_test_pcap.py script:

python scripts/generate_test_pcap.py

This will generate a test.pcap file in the tests/data/ directory.

Project Structure

Here is the structure of the Pcap2CSV project as visible in GitHub:

Pcap2CSV/
β”œβ”€β”€ .gitignore
β”œβ”€β”€ LICENSE
β”œβ”€β”€ README.md
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ pcap2csv/
β”‚   β”œβ”€β”€ __init__.py
β”‚   └── converter.py
β”œβ”€β”€ scripts/
β”‚   β”œβ”€β”€ convert_pcap.py
β”‚   └── generate_test_pcap.py
└── tests/
    β”œβ”€β”€ __init__.py
    β”œβ”€β”€ __pycache__/
    β”œβ”€β”€ data/
    └── test_converter.py

Running Tests

To run the unit tests, use the following command:

python -m unittest discover -s tests

Contributing

Contributions are welcome! Please open an issue or submit a pull request to propose changes or improvements. 🀝

License

This project is licensed under the MIT License - see the LICENSE file for details. πŸ“œ

Contact

For any questions or support, please contact [email protected]. πŸ“§

About

πŸ“¦ Convert PCAP network capture files to CSV format for easy analysis and reporting! πŸ“Š

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages