pcap-fuzzer


Namepcap-fuzzer JSON
Version 0.4.0 PyPI version JSON
download
home_pagehttps://github.com/smart-home-network-security/pcap-fuzzer
SummaryRandomly edit packet fields in a PCAP file.
upload_time2024-07-12 15:11:25
maintainerNone
docs_urlNone
authorFrançois De Keersmaeker
requires_python>=3.7
licenseGPLv3+
keywords
VCS
bugtrack_url
requirements scapy
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pcap-fuzzer

[PyPI package page](https://pypi.org/project/pcap-fuzzer/)

This program randomly edits packets from a PCAP file,
one field per edited packet.

The edited field will be chosen at random,
starting from the highest layer, and going down until it finds a supported protocol layer.

Example: a DNS packet will have one of its DNS fields edited,
and not one of the UDP or IP fields.


## Installation

```bash
pip install pcap-fuzzer
```

## Usage

Import statement:
```python
import pcap_fuzzer
```

`fuzz_pcaps` function doc:
```python
pcap_fuzzer.fuzz_pcaps(
    pcaps: Union[str, list]       # (List of) input PCAP files
    output: str,                  # [Optional] Output PCAP file path. Used only if a single input file is specified.
    random_range: int = 1,        # [Optional] Upper bound for random range (not included). Defaults to 1.
    packet_numbers: list = None,  # [Optional] List of indices, starting from 1, of packets to edit. If not specified, packets are randomly picked.
    dry_run: bool = False         # [Optional] If True, do not write output PCAP file(s).
) -> None
```

This function produces new, edited PCAP file(s).
If no output file is specified (for a single input file),
or if multiple input files are given,
the output file(s) will have the same name as the input file(s),
but with the suffix `.edit`,
and will be placed in a directory called `edited`,
in the same directory as the input files.
It will be created if it doesn't exist.

The program also produces CSV log files,
indicating which fields were edited for each packet.
The log files will be placed in a directory called `logs`,
in the same directory as the input files.
It will be created if it doesn't exist.


## Supported protocols (for now)

* Datalink Layer (2)
  * ARP
* Network Layer (3)
  * IPv4
  * IPv6
* Transport Layer (4)
  * TCP
  * UDP
  * ICMP
  * IGMP(v2 and v3)
* Application Layer (7)
  * HTTP
  * DNS
  * DHCP
  * SSDP
  * CoAP



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/smart-home-network-security/pcap-fuzzer",
    "name": "pcap-fuzzer",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": null,
    "author": "Fran\u00e7ois De Keersmaeker",
    "author_email": "francois.dekeersmaeker@uclouvain.be",
    "download_url": "https://files.pythonhosted.org/packages/25/79/6998401da2c35d45dd00d7186b236bb10d0cba6edebd14f47d71b705f8eb/pcap_fuzzer-0.4.0.tar.gz",
    "platform": null,
    "description": "# pcap-fuzzer\n\n[PyPI package page](https://pypi.org/project/pcap-fuzzer/)\n\nThis program randomly edits packets from a PCAP file,\none field per edited packet.\n\nThe edited field will be chosen at random,\nstarting from the highest layer, and going down until it finds a supported protocol layer.\n\nExample: a DNS packet will have one of its DNS fields edited,\nand not one of the UDP or IP fields.\n\n\n## Installation\n\n```bash\npip install pcap-fuzzer\n```\n\n## Usage\n\nImport statement:\n```python\nimport pcap_fuzzer\n```\n\n`fuzz_pcaps` function doc:\n```python\npcap_fuzzer.fuzz_pcaps(\n    pcaps: Union[str, list]       # (List of) input PCAP files\n    output: str,                  # [Optional] Output PCAP file path. Used only if a single input file is specified.\n    random_range: int = 1,        # [Optional] Upper bound for random range (not included). Defaults to 1.\n    packet_numbers: list = None,  # [Optional] List of indices, starting from 1, of packets to edit. If not specified, packets are randomly picked.\n    dry_run: bool = False         # [Optional] If True, do not write output PCAP file(s).\n) -> None\n```\n\nThis function produces new, edited PCAP file(s).\nIf no output file is specified (for a single input file),\nor if multiple input files are given,\nthe output file(s) will have the same name as the input file(s),\nbut with the suffix `.edit`,\nand will be placed in a directory called `edited`,\nin the same directory as the input files.\nIt will be created if it doesn't exist.\n\nThe program also produces CSV log files,\nindicating which fields were edited for each packet.\nThe log files will be placed in a directory called `logs`,\nin the same directory as the input files.\nIt will be created if it doesn't exist.\n\n\n## Supported protocols (for now)\n\n* Datalink Layer (2)\n  * ARP\n* Network Layer (3)\n  * IPv4\n  * IPv6\n* Transport Layer (4)\n  * TCP\n  * UDP\n  * ICMP\n  * IGMP(v2 and v3)\n* Application Layer (7)\n  * HTTP\n  * DNS\n  * DHCP\n  * SSDP\n  * CoAP\n\n\n",
    "bugtrack_url": null,
    "license": "GPLv3+",
    "summary": "Randomly edit packet fields in a PCAP file.",
    "version": "0.4.0",
    "project_urls": {
        "Homepage": "https://github.com/smart-home-network-security/pcap-fuzzer"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "940ee2473d072893331b08e403bcc2b96130b9309f4c9e3af0f65f9e75284aa2",
                "md5": "071ed70280308f5a33d6b08654d60ba2",
                "sha256": "120c5c5a911a3369ab9fb7c9ddc1f49acfdf29c1d34f8f2a9ccdc97b0e645496"
            },
            "downloads": -1,
            "filename": "pcap_fuzzer-0.4.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "071ed70280308f5a33d6b08654d60ba2",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 29138,
            "upload_time": "2024-07-12T15:11:23",
            "upload_time_iso_8601": "2024-07-12T15:11:23.547974Z",
            "url": "https://files.pythonhosted.org/packages/94/0e/e2473d072893331b08e403bcc2b96130b9309f4c9e3af0f65f9e75284aa2/pcap_fuzzer-0.4.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "25796998401da2c35d45dd00d7186b236bb10d0cba6edebd14f47d71b705f8eb",
                "md5": "685c9371d8acde8593972b383ba42f6a",
                "sha256": "e6299cc80d833ce6e0667bfb6b6ec2180ac01e2e710ad0f9f1da9d9043d22dc9"
            },
            "downloads": -1,
            "filename": "pcap_fuzzer-0.4.0.tar.gz",
            "has_sig": false,
            "md5_digest": "685c9371d8acde8593972b383ba42f6a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 35054,
            "upload_time": "2024-07-12T15:11:25",
            "upload_time_iso_8601": "2024-07-12T15:11:25.140523Z",
            "url": "https://files.pythonhosted.org/packages/25/79/6998401da2c35d45dd00d7186b236bb10d0cba6edebd14f47d71b705f8eb/pcap_fuzzer-0.4.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-12 15:11:25",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "smart-home-network-security",
    "github_project": "pcap-fuzzer",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "scapy",
            "specs": []
        }
    ],
    "lcname": "pcap-fuzzer"
}
        
Elapsed time: 0.29150s