Monday, June 15, 2015

tshark and pcapline from Wesley McGrew

I came across where I wanted to separate out TCP streams and I found a couple of solutions that met my needs.  The first solution is using tshark and I found it at the following link and I have adapted and saved the bash script below:


# This is a script that seperates out based on a's of a pcap
# Adapted from the script found at
# Check to see if the argument for the pcap file has been supplied
if [ $# -eq 0 ]; then
	echo "Usage: ./ file.pcap"

# Create the output directory if it does not exist
if [ ! -d $outputDir ]; then
	mkdir output

# Seperate the streams into seperate files
for stream in `tshark -r ${pcapFile} -T fields -e | sort -n | uniq`
    tshark -r ${pcapFile} -w $outputDir/stream-$stream.cap -Y "$stream"

The second script was pcapline by Wesley McGrew.  I only made one change to fix the title tag in the html to allow the html to output correctly in Chrome and Firefox.  The original code is located here and below with my incorporated change I have placed it on my drive here.

No comments:

Post a Comment

Docker with Juiceshop - Focus on SQL Injection

In preparation for an ethical hacking class that I will be teaching, I wanted to work through a few of the Vulnhub or docker images to refr...