pcap_to_ditg
Generates DITG flow definition Files for each IP using a Packet Capture (.pcap) file as input
Installation
-
The package is available to be installed through PyPI - the Python Package Index at https://pypi.org/project/pcap_to_ditg
-
You can install the latest version by running:
$ sudo pip install pcap_to_ditg -
The latest release can be also downloaded from the Github repository
Usage
-
The help section of the run.py program describes the usage details
usage: run.py [-h] [-t START_TIME] [-e END_TIME] [-s PACKET_SIZE_OPTIONS] [-p] [-c] [-op] pcap_file mapper_file list_file Generate DITG script files from a pcap file positional arguments: pcap_file .pcap file to be used in generation mapper_file Mapper file to be used in generation list_file File containing all distinct IPs to be used in generation optional arguments: -h, --help show this help message and exit -t START_TIME, --start-time START_TIME Timestamp (in sec) from which the file should be read -e END_TIME, --end-time END_TIME Timestamp (in sec) until which the file should be read -s PACKET_SIZE_OPTIONS, --packet-size-options PACKET_SIZE_OPTIONS Packet size options to be used for each flow (for ex. For Anonymized trace pcap files). If not provided, *_ps files are created for each flow by using packet sizes as per the pcap file -p, --print-all-ips Print all distinct IPs appearing in the pcap file and exit -c, --clean Remove any older generated files and exit the program -op, --orig-ports Whether original destination ports should be used or a non-clashing port should be assigned -
The format of
list_fileis as follows:10.0.1.10, 10.0.2.10, . . .-
These are the IPs that are appearing in the PCAP file (as specified by
pcap_fileargument) -
You can generate this list automatically by running the example program with
-poption$ touch list_file $ python run.py -p pcap_file mapper_file list_file > list_file -
Note: While running the program with
-poption, the filesmapper_fileandlist_fileare not actually used but still have to be provided as argument and should exist.
-
-
The format of
mapper_fileis as follows:Host,Start_row,End_row,Number,IP h1,1734,1902,169,10.0.0.1 h2,1528,1733,206,10.0.0.2 . . . -
Usage in a different script or in interpreter mode is as:
>> from pcap_to_ditg import pcap_to_ditg >> pcap_file_path = '***' >> mapper_file_path = '***' >> list_file_path = '***' >> options = {'end_time' : 60} >> p = pcap_to_ditg.pcap_to_ditg( pcap_file_path, mapper_file_path, list_file_path, options ) The flow scripts and the IDT files have been generated and have been saved in separate sub-folders *_ditg_files. >>
Metadata
Release files for pcap_to_ditg 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pcap_to_ditg-1.0.1.tar.gz | 5.5 kB | Without provenance | Details for pcap_to_ditg-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pcap_to_ditg-1.0.1-py2-none-any.whl | Python 2 | none | any | Details for pcap_to_ditg-1.0.1-py2-none-any.whl |
Total release size: 11.8 kB
Release files / pcap_to_ditg-1.0.1.tar.gz
| Download URL | pcap_to_ditg-1.0.1.tar.gz |
|---|---|
| Size | 5.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9e63b08ce9c820967d6d9c66484fdb78f5346830e50573a0bb86f9e80b8b3ec5
|
|
BLAKE2b-256 checksum How to use checksums |
a66d8ef44693d1ad57a04e1879e06ff39a979d43a2888d433da08c73b2a4f01b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.15
|
Release files / pcap_to_ditg-1.0.1-py2-none-any.whl
| Download URL | pcap_to_ditg-1.0.1-py2-none-any.whl |
|---|---|
| Size | 6.3 kB |
| Tags | Python 2 |
|
SHA-256 checksum How to use checksums |
c383a68072aa709eb8904ab6adcb0ff97b7af70f89b9854bd00b04f1dbb234ff
|
|
BLAKE2b-256 checksum How to use checksums |
8f9f736dc073eb32ec409f75f8b2aad5405f22b2316ad4a72ea1b662e2bd0bcf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.15
|
Security for pcap_to_ditg 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.