Created
September 4, 2012 01:15
-
-
Save pedrovanzella/3615507 to your computer and use it in GitHub Desktop.
strip-capture.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
print_usage() { | |
echo "Usage: $0 <essid> </path/to/capture.cap>" | |
} | |
hash tshark &> /dev/null | |
if [ $? -eq 1 ]; then | |
echo "This script requires 'tshark', but it does not appear to be installed." | |
echo "Please install 'tshark', (sudo apt-get install tshark) and try again." | |
exit | |
fi | |
if [ -z "$1" ]; then | |
echo "You must specify an ESSID!" | |
print_usage | |
exit | |
fi | |
if [ -z "$2" ]; then | |
echo "You must specify a capture file!" | |
print_usage | |
exit | |
fi | |
if ! [ -f "$2" ]; then | |
echo "$2 does not exist!" | |
print_usage | |
exit | |
fi | |
echo "Stripping file..." | |
tshark -r "$2" -R "eapol || wlan_mgt.tag.interpretation eq $1 || (wlan.fc.type_subtype==0x08 && wlan_mgt.ssid eq $1)" -w stripped.cap | |
echo "Done! Wrote stripped file to ./stripped.cap" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment