Skip to main content

Aggregates wireshark pdml to flows

Project description

# pdml2flow [![PyPI version](https://badge.fury.io/py/pdml2flow.svg)](https://badge.fury.io/py/pdml2flow)
_Aggregates wireshark pdml to flows_

| Branch | Build | Coverage |
| ------- | ------ | -------- |
| master | [![Build Status](https://travis-ci.org/Enteee/pdml2flow.svg?branch=master)](https://travis-ci.org/Enteee/pdml2flow) | [![Coverage Status](https://coveralls.io/repos/github/Enteee/pdml2flow/badge.svg?branch=master)](https://coveralls.io/github/Enteee/pdml2flow?branch=master) |
| develop | [![Build Status](https://travis-ci.org/Enteee/pdml2flow.svg?branch=develop)](https://travis-ci.org/Enteee/pdml2flow) | [![Coverage Status](https://coveralls.io/repos/github/Enteee/pdml2flow/badge.svg?branch=develop)](https://coveralls.io/github/Enteee/pdml2flow?branch=develop) |

## Prerequisites
* [python]:
- 3.4
- 3.5
- 3.5-dev
- nightly
* [pip](https://pypi.python.org/pypi/pip)

## Installation
$ sudo pip install pdml2flow

## Usage
```shell
$ pdml2flow -h
usage: pdml2flow [-h] [-f FLOW_DEF_STR] [-t FLOW_BUFFER_TIME] [-l DATA_MAXLEN]
[-s] [-x] [-c] [-a] [-m] [-d]

Aggregates wireshark pdml to flows

optional arguments:
-h, --help show this help message and exit
-f FLOW_DEF_STR Fields which define the flow, nesting with: '.'
[default: ['vlan.id', 'ip.src', 'ip.dst', 'ipv6.src',
'ipv6.dst', 'udp.stream', 'tcp.stream']]
-t FLOW_BUFFER_TIME Lenght (in seconds) to buffer a flow before writing the
packets [default: 180]
-l DATA_MAXLEN Maximum lenght of data in tshark pdml-field [default:
200]
-s Extract show names, every data leave will now look like
{ raw : [] , show: [] } [default: False]
-x Switch to xml output [default: False]
-c Removes duplicate data when merging objects, will not
preserve order of leaves [default: False]
-a Instaead of merging the frames will append them to an
array [default: False]
-m Appends flow metadata [default: False]
-d Debug mode [default: False]
```
## Example
Sniff from interface:

```shell
$ tshark -i interface -Tpdml | pdml2flow
```

Write xml output
```shell
$ tshark -i interface -Tpdml | pdml2flow -x
```

Read a .pcap file
```shell
$ tshark -r pcap_file -Tpdml | pdml2flow
```

Aggregate based on ethernet source and ethernet destination address
```shell
$ tshark -i interface -Tpdml | pdml2flow -f eth.src -f eth.dst
```

Pretty print flows using [jq]
```shell
$ tshark -i interface -Tpdml | pdml2flow | jq
```

Post-process flows using [FluentFlow]
```shell
$ tshark -i interface -Tpdml | pdml2flow | fluentflow rules.js
```

## Utils

The following utils are part of this project

### pdml2json
_Converts pdml to json_

### Usage
```shell
$ pdml2json -h
usage: pdml2json [-h] [-s] [-d]

Converts wireshark pdml to json

optional arguments:
-h, --help show this help message and exit
-s Extract show names, every data leave will now look like { raw :
[] , show: [] } [default: False]
-d Debug mode [default: False]
```

### pdml2xml
_Converts pdml to xml_

### Usage
```shell
$ pdml2xml -h
usage: pdml2xml [-h] [-s] [-d]

Converts wireshark pdml to xml

optional arguments:
-h, --help show this help message and exit
-s Extract show names, every data leave will now look like { raw :
[] , show: [] } [default: False]
-d Debug mode [default: False]
```

[python]: https://www.python.org/
[wireshark]: https://www.wireshark.org/
[dict2xml]: https://github.com/delfick/python-dict2xml
[jq]: https://stedolan.github.io/jq/
[FluentFlow]: https://github.com/t-moe/FluentFlow

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

pdml2flow-1.4.tar.gz (15.0 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pdml2flow-1.4-py3.6.egg (31.1 kB view details)

Uploaded Egg

pdml2flow-1.4-py3.5.egg (31.1 kB view details)

Uploaded Egg

pdml2flow-1.4-py3.4.egg (31.2 kB view details)

Uploaded Egg

File details

Details for the file pdml2flow-1.4.tar.gz.

File metadata

  • Download URL: pdml2flow-1.4.tar.gz
  • Upload date:
  • Size: 15.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pdml2flow-1.4.tar.gz
Algorithm Hash digest
SHA256 3e1efec3affff1abd5492a402868e53bbe45daf2e803f0a421d3920829fd69e3
MD5 fa4a9f9b4e06046647094be7a4421a9a
BLAKE2b-256 fcef68e46a2d9d2bb4a770bd8ce8c069dfba9b8ac91724a63f89c728938b3dd8

See more details on using hashes here.

File details

Details for the file pdml2flow-1.4-py3.6.egg.

File metadata

  • Download URL: pdml2flow-1.4-py3.6.egg
  • Upload date:
  • Size: 31.1 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pdml2flow-1.4-py3.6.egg
Algorithm Hash digest
SHA256 37e433c0adce566bcbb6e45594fd3ca13f8c6f37ee860a5621a2916ef7525312
MD5 1ce3071c77ecef01ba65064d06cb5335
BLAKE2b-256 01eb6d83d7ff95412cb69e3e20049197a5fa712c2880a789cf666eaaf9192832

See more details on using hashes here.

File details

Details for the file pdml2flow-1.4-py3.5.egg.

File metadata

  • Download URL: pdml2flow-1.4-py3.5.egg
  • Upload date:
  • Size: 31.1 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pdml2flow-1.4-py3.5.egg
Algorithm Hash digest
SHA256 5eed4005248398f466bc432127df8dd4014cf7d55b74fde9041b231b904cbeb6
MD5 1d575f723ee3e2155540478cb85a01d8
BLAKE2b-256 9acbbc4fab997e1d9cd494837f57deef47151232ab0eefb1c115158b5fb854a6

See more details on using hashes here.

File details

Details for the file pdml2flow-1.4-py3.4.egg.

File metadata

  • Download URL: pdml2flow-1.4-py3.4.egg
  • Upload date:
  • Size: 31.2 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pdml2flow-1.4-py3.4.egg
Algorithm Hash digest
SHA256 d93ba6f40b8358a0926a2ebe18f6ea43c7d4d1f439f992e0d702a515c290833e
MD5 844523aed093e19608deb4ff483b12a2
BLAKE2b-256 4ff5e5bdaef79ec1f1af0709914032e8794831fe5326c5630970f02d24df0d9e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page