Pcraft
Project description
pCraft
pCraft is a PCAP Crafter, which creates a PCAP from a YAML scenario.
When generating data for testing, it is rather hard to do forthe following reasons:
- Lack of consistency between clients and servers
- Make sure no personal data leaks
- Consistency across different services.
- Keeping timing right
- etc.
This program helps solving this problem, one simply creates a script in YAML and the program outputs a PCAP.
Creating a Hello World script
Create a file called "hello.yaml", we want to add the following content:
start: Generate_a_new_domain
Generate_a_new_domain:
_plugin: GenerateNewDomain
_next: DNSConnection
DNSConnection:
_plugin: DNSConnection
_next: loop-1
loop-1:
count: 3
newip: 1 # We get a new IP address for each loop
_sleep: {"before-start":3,"interval":0.2,"once-finished":0.3}
_next: done
_start: DNSConnection # Where our loop starts
Now execute the pcraft program:
pcrafter hello.yaml hello.pcap
Let's read the result pcap using tshark:
$ tshark -r hello.pcap
1 0.000000 192.168.67.150 → 10.218.175.58 DNS 81 Standard query 0x0000 A masaryk-treasurer.com
2 0.000552 10.218.175.58 → 192.168.67.150 DNS 118 Standard query response 0x0000 A masaryk-treasurer.com A 199.34.228.66
3 0.001115 192.168.53.38 → 10.44.21.216 DNS 81 Standard query 0x0000 A masaryk-treasurer.com
4 0.001529 10.44.21.216 → 192.168.53.38 DNS 118 Standard query response 0x0000 A masaryk-treasurer.com A 199.34.228.66
5 0.002126 192.168.160.175 → 10.79.78.60 DNS 81 Standard query 0x0000 A masaryk-treasurer.com
6 0.002531 10.79.78.60 → 192.168.160.175 DNS 118 Standard query response 0x0000 A masaryk-treasurer.com A 199.34.228.66
7 0.003038 192.168.33.44 → 10.46.101.67 DNS 81 Standard query 0x0000 A masaryk-treasurer.com
8 0.003439 10.46.101.67 → 192.168.33.44 DNS 118 Standard query response 0x0000 A masaryk-treasurer.com A 199.34.228.66
9 0.003947 192.168.140.220 → 10.117.63.91 DNS 81 Standard query 0x0000 A masaryk-treasurer.com
10 0.004350 10.117.63.91 → 192.168.140.220 DNS 118 Standard query response 0x0000 A masaryk-treasurer.com A 199.34.228.66
Writing a Scenario
Please look at the documentation on this topic to understand more about the engine: "Writing a Scenario".
Available Plugins
The Plugins documentation is generated from themselves: Plugins Documentation
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pcraft-0.1.4.tar.gz
.
File metadata
- Download URL: pcraft-0.1.4.tar.gz
- Upload date:
- Size: 16.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 10b35eea07a3b73e93c171d3d99f3fa6df4ad40384fce6b3e8defc9bb733748a |
|
MD5 | 389ec2eaf639e35c1dfd29f5f448b880 |
|
BLAKE2b-256 | 952f645d45934a0ae2206ff4effe020d8a4e8b217f292893553fe5529c989cb3 |
File details
Details for the file pcraft-0.1.4-py2.py3-none-any.whl
.
File metadata
- Download URL: pcraft-0.1.4-py2.py3-none-any.whl
- Upload date:
- Size: 27.4 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 00ffe15c6dcfadffa54fe67e68a355d25fe00dc7fdca0e260c6aac10e437ce4b |
|
MD5 | fbf019018c1bfaad0d250b8fe0949e09 |
|
BLAKE2b-256 | 935b7d9876bdd01ccfe724e0d98a0f2c3e9a6f18157b04285bebff2c36bdf1c6 |