Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pcapslice #72

Merged
merged 4 commits into from Nov 24, 2015
Merged

pcapslice #72

merged 4 commits into from Nov 24, 2015

Conversation

amm3
Copy link
Contributor

@amm3 amm3 commented Nov 19, 2015

This is a utility to split pcap files by ip src/dst pair or tcp/udp stream using Dshell's PCAPWriter() to write the output files. This is sometimes useful when trying to process pcap in dshell that contains numerous and interleaved really large streams.

@dev195
Copy link
Contributor

dev195 commented Nov 23, 2015

Some things to do before this gets accepted:

  • Add an --outdir argument, similar to rip-http. This script is going to generate a lot of files, and we might not want them all dumped in our current directory.
  • Update the normalIP function to handle IPv6. You can probably use the same logic from pcapanon.py
  • Fix so it doesn't choke on packets that don't have ports (e.g. ICMP).
Traceback (most recent call last):
  File "../bin/pcapslice.py", line 229, in <module>
    main()
  File "../bin/pcapslice.py", line 88, in main
    thisflow = flow(addr)
  File "../bin/pcapslice.py", line 123, in __init__
    self.outfilename = localfilename(addr)
  File "../bin/pcapslice.py", line 204, in localfilename
    sport = '%05d' % int(sport)
TypeError: int() argument must be a string or a number, not 'NoneType'

Also, I see the --debug flag, but I don't see any debug messages. Does that need to be there for something?

@amm3
Copy link
Contributor Author

amm3 commented Nov 23, 2015

I think this covers the requested updates.

@dev195
Copy link
Contributor

dev195 commented Nov 24, 2015

Okay, it looks like it's working, so I'll merge it.

At some point, I would recommend changing some of the logging. It seems awkward to have informational messages about new and closing files be marked as WARNings.

dev195 added a commit that referenced this pull request Nov 24, 2015
New script, pcapslice.py
@dev195 dev195 merged commit 60944b6 into USArmyResearchLab:master Nov 24, 2015
@amm3
Copy link
Contributor Author

amm3 commented Nov 24, 2015

Thanks. I can definitely update the output. This was cobbled together without much thought to usability, so it probably merits a rethink of the standard and diagnostic messaging.

@amm3 amm3 deleted the pcapslice branch November 24, 2015 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants