Giter Club home page Giter Club logo

pdml2flow's Introduction

pdml2flow's People

Contributors

enteee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

5l1v3r1 sphill007

pdml2flow's Issues

Missing Value 0 in raw

Zero values do not show up in raw array. In show, they are correctly appended. See example:

  "raw": [
    1425,
    338,
    9,
    6,
    45,
    44,
    38,
    402,
    31
  ],
  "show": [
    "TCP Segment Len: 0",
    "TCP Segment Len: 0",
    "TCP Segment Len: 1425",
    "TCP Segment Len: 338",
    "TCP Segment Len: 9",
    "TCP Segment Len: 0",
    "TCP Segment Len: 6",
    "TCP Segment Len: 45",
    "TCP Segment Len: 44",
    "TCP Segment Len: 38",
    "TCP Segment Len: 402",
    "TCP Segment Len: 0",
    "TCP Segment Len: 31",
    "TCP Segment Len: 0",
    "TCP Segment Len: 0"

Better document use case

Why not use tshark -T json?

Tshark already has the ability to output json. Once you have json, you could use some utility to convert JSON to XML.

Whatever the reason, this issue is to provide better use case documentation in the README.

Crash when using -a option

tshark -i enp3s0 -T pdml -c1 | pdml2flow -a
Capturing on 'enp3s0'
1 
Traceback (most recent call last):
  File "/usr/bin/pdml2flow", line 9, in <module>
    load_entry_point('pdml2flow==1.0', 'console_scripts', 'pdml2flow')()
  File "/usr/lib/python3.5/site-packages/pdml2flow-1.0-py3.5.egg/pdml2flow/__init__.py", line 4, in main
  File "/usr/lib/python3.5/site-packages/pdml2flow-1.0-py3.5.egg/pdml2flow/pdml2flow.py", line 305, in main
  File "/usr/lib/python3.5/xml/sax/expatreader.py", line 110, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/usr/lib/python3.5/xml/sax/xmlreader.py", line 127, in parse
    self.close()
  File "/usr/lib/python3.5/xml/sax/expatreader.py", line 223, in close
    self._cont_handler.endDocument()
  File "/usr/lib/python3.5/site-packages/pdml2flow-1.0-py3.5.egg/pdml2flow/pdml2flow.py", line 287, in endDocument
  File "/usr/lib/python3.5/site-packages/pdml2flow-1.0-py3.5.egg/pdml2flow/pdml2flow.py", line 192, in __str__
  File "/usr/lib/python3.5/site-packages/pdml2flow-1.0-py3.5.egg/pdml2flow/pdml2flow.py", line 185, in __repr__
AttributeError: 'list' object has no attribute 'clean_empty'

Allow non-deep merge

Right now you deep merge every object.
Output of the following representation could also be useful ("non deep merge"):

{  _Flow__id: [<-5-tuple->],
   _Flow__packets: [
       {  <- packet 1 -> },
       {  <- packet 2 -> },
       {  <- packet . -> },
       {  <- packet n -> }
   ]
}

pdml2json

It should be possible to disable the flow aggregation.
pdml2flow would then simply convert the xml to a json representation (as fluentflow did).

AttributeError: 'list' object has no attribute 'merge'

 cat in.txt | pdml2json > /dev/null                     
Traceback (most recent call last):
  File "/usr/bin/pdml2json", line 9, in <module>
    load_entry_point('pdml2flow==1.0', 'console_scripts', 'pdml2json')()
  File "/usr/lib/python3.5/site-packages/pdml2flow-1.0-py3.5.egg/pdml2flow/__init__.py", line 81, in pdml2json
  File "/usr/lib/python3.5/site-packages/pdml2flow-1.0-py3.5.egg/pdml2flow/__init__.py", line 102, in pdml2frame
  File "/usr/lib/python3.5/site-packages/pdml2flow-1.0-py3.5.egg/pdml2flow/__init__.py", line 115, in start_parser
  File "/usr/lib/python3.5/xml/sax/expatreader.py", line 110, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/usr/lib/python3.5/xml/sax/xmlreader.py", line 125, in parse
    self.feed(buffer)
  File "/usr/lib/python3.5/xml/sax/expatreader.py", line 210, in feed
    self._parser.Parse(data, isFinal)
  File "/build/python/src/Python-3.5.1/Modules/pyexpat.c", line 414, in StartElement
  File "/usr/lib/python3.5/xml/sax/expatreader.py", line 322, in start_element
    self._cont_handler.startElement(name, AttributesImpl(attrs))
  File "/usr/lib/python3.5/site-packages/pdml2flow-1.0-py3.5.egg/pdml2flow/pdmlhandler.py", line 47, in startElement
AttributeError: 'list' object has no attribute 'merge'

Input is a normal pdml file (2GB).

Any Idea what that could be?
I can send you the pcap file (100mb) via email/och, if you need it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.