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
Metadata
Release files for pcraft 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pcraft-0.1.4.tar.gz | 16.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pcraft-0.1.4-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 44.3 kB
Release files / pcraft-0.1.4.tar.gz
| Download URL | pcraft-0.1.4.tar.gz |
|---|---|
| Size | 16.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
10b35eea07a3b73e93c171d3d99f3fa6df4ad40384fce6b3e8defc9bb733748a
|
|
BLAKE2b-256 checksum How to use checksums |
952f645d45934a0ae2206ff4effe020d8a4e8b217f292893553fe5529c989cb3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / pcraft-0.1.4-py2.py3-none-any.whl
| Download URL | pcraft-0.1.4-py2.py3-none-any.whl |
|---|---|
| Size | 27.4 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
00ffe15c6dcfadffa54fe67e68a355d25fe00dc7fdca0e260c6aac10e437ce4b
|
|
BLAKE2b-256 checksum How to use checksums |
935b7d9876bdd01ccfe724e0d98a0f2c3e9a6f18157b04285bebff2c36bdf1c6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|