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!
|