Networking Forums

Networking Forums > Computer Networking > Linux Networking > tcpdump and scripting

Reply
Thread Tools Display Modes

tcpdump and scripting

 
 
Matt
Guest
Posts: n/a

 
      05-28-2005, 09:46 PM
Hey everyone. I'm trying to play w/ some pcap files captured from wifi
networks. I've done some research on google and taken the advice found on
here and i'm trying to come up w/ a script that parses pcapfiles into
seperate files. The part i'm working on now is pulling every BSSID from a
pcap file so i can deal with each one in tethereal seperately. i'm using
the following command:

tcpdump -r dumpfile -e |
grep -o --regexp=BSSID:[0-9a-f][0-9a-f]:[0-9a-f][0-9a-f]:[0-9a-f][0-9a-f]:[0-9a-f][0-9a-f]:[0-9a-f][0-9a-f]:[0-9a-f][0-9a-f]
|
grep -o --regexp=[0-9a-f][0-9a-f]:[0-9a-f][0-9a-f]:[0-9a-f][0-9a-f]:[0-9a-f][0-9a-f]:[0-9a-f][0-9a-f]:[0-9a-f][0-9a-f]

all it does is reads from a pcap file, greps out the lines that have BSSID
and a mac address, then greps only the mac address from that line. It then
outputs to the screen a list of bssids, but it repeats them. Can someone
point me in the direction to learn how to use scripting to gather these
bssids, and keep only unique ones? I would know how to do it in php: i'd
use the array_unique() command, but what would let me do this in bash, for
instance?

basically, the goal is to list the bssids in the pcap file, then let you
choose which ones to put into seperate files, or put them all in seperate
files using tethereal.

thanks for any advise!


 
Reply With Quote
 
 
 
 
Allen McIntosh
Guest
Posts: n/a

 
      05-28-2005, 10:50 PM
> Can someone
> point me in the direction to learn how to use scripting to gather these
> bssids, and keep only unique ones? I would know how to do it in php: i'd
> use the array_unique() command, but what would let me do this in bash, for
> instance?


man uniq
man sort (experiment with -u and definition of sort key)
 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
WZC scripting Thomas K Wireless Internet 0 08-24-2005 05:42 AM
Scripting and the Registry RayRedSoxFan Windows Networking 0 08-22-2005 09:51 PM
Problem scripting iwconfig can2002 Linux Networking 4 04-22-2005 11:41 PM
Scripting configuration entries? Eras Wireless Internet 5 01-21-2005 06:37 PM
Windows Scripting Host Nazly Windows Networking 0 07-22-2003 03:29 AM



1 2 3 4 5 6 7 8 9 10 11