Sunday, November 23, 2014

wireshark - running tshark command in windows batch file

I have written a batch file that runs a tshark command to filter fields from a wireshark pcap file and write them to a csv file. When i ran on the windows cmd CLI, i had to change the current working directory to the wireshark folder directory in the My Computer> Program Files, so i changed the current working directory in the batch file so that it would run the same way as i ran in the windows cmd CLI.


However, when i ran the below batch script, the output csv file was blank. How do i correct this batch script so that i can see the contents in the output csv file generated using wireshark's tshark command?


I wrote the batch file like this.


@echo off


set curr_dir=%cd%


chdir /D cd..


chdir /D cd..


chdir /D cd program files


chdir /D cd wireshark


tshark -T fields -n -r "C:\Users\L33604\Desktop\SynFlood Sample.pcap" -E separator=, -e ip.src -e ip.dst > "C:\Users\L33604\Desktop\logcapture.txt"

No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...