Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mobiwn/pcap2csv

๐Ÿ“ฆ Convert PCAP network capture files to CSV format for easy analysis and reporting! ๐Ÿ“Š
https://github.com/mobiwn/pcap2csv

csv cybersecurity cybersecurity-tool network-analysis network-traffic pcap pcap-converter pcap2csv scapy

Last synced: 3 months ago
JSON representation

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

Awesome Lists containing this project

README

        

# 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** ๐Ÿš€

```bash
git clone https://github.com/mobiwn/Pcap2CSV.git
cd Pcap2CSV
```

2. **Set Up a Virtual Environment** ๐Ÿ—๏ธ

```bash
python -m venv venv
source venv/bin/activate # On Windows, use `venv\Scripts\activate`
```

3. **Install Dependencies** ๐Ÿ“ฆ

```bash
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:

```bash
python scripts/convert_pcap.py
```

**Example:**

```bash
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:

```bash
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:

```bash
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](LICENSE) file for details. ๐Ÿ“œ

## Contact

For any questions or support, please contact [[email protected]]([email protected]). ๐Ÿ“ง