#!/usr/bin/perl # # Simple (hopefully) script to manipulate gpsmap using different options... # Why you ask (and thank you for asking!), TOO many options to remember! # # coded up by the fine, underpaid minions of cybersnipers Research Labs... # email: thiscodesucks@cybersnipers.com, # Released under GPLv2 # Jan 22, 2007: BETA 1.1 # Modified for backtrack2 - -k isn't working for some reason # Changelog: v1.2 - fixed some issues with filtering. # $ver = "1.2_BETA"; printf "\nmapscript $ver GPSMAP utility script\n"; printf "coded by the minions of cybersnipers Research Labs\n"; # Set the File name and path here printf "\nEnter the Path and file name of the .gps file you want to parse\n"; printf "(example: /var/log/kismet/Kismet-MMM-DD-YYYY-#.gps): "; my $file = ; chomp($file); # Set the type of drawing output you want here printf "\nMap Output types\n"; printf "[ t ] Track\n"; printf "[ b ] Network Bounding Box\n"; printf "[ r ] Estimated Range Circles\n"; printf "[ u ] Convex Hull\n"; printf "[ p ] Power Interpolation (need lots of data points)\n"; printf "[ a ] Scatter Plot (lots of dots)\n\n"; printf "If you are going to use a downloaded map, select \"a\" as the output\n"; printf "Otherwise if you want to enter multiple outputs, place a dash [-]\n"; printf "next to the second and subsequent choices. Enter the output type: "; $o = ; chomp($o); $od = "-$o"; # Set the Map Source printf "\nMap Source\n"; printf "[ 0 ] Local GoogleEarth Map\n"; printf "[ 1 ] Other Map Source\n"; #printf "[ 2 ] Use local copy of a map\n"; printf "\nEnter Your Choice: "; $g = ; chomp($g); if ($g eq "0") { $ms = "-j"; } # Local Cache copy syntax here in case we need it. # This is also covered further down in the code # #elsif ($g eq "2") { # printf "\nEnter the name of you local map file\n"; # printf "(Use full path if not in current dir): "; # $ma = ; # chomp($ma); # $ms = "-m $ma"; # } else { printf "\nInternet Map Sources\n"; printf "[ 1 ] Local Map\n"; printf "[ 2 ] TerraServer Satty\n"; printf "[ 3 ] Tiger US Census\n"; printf "[ 5 ] TerraServer Topo\n"; printf "[ 6 ] Expedia EU\n"; printf "[ 7 ] OpenStreetMap TilesAtHome\n"; printf "\nEnter the Map Source: "; $m = ; chomp($m); $ms = "$m"; if ($ms eq "1") { printf "\nEnter the location and name of your local map: "; $ma = ; chomp($ma); $map = "-m $ma"; } else { printf "\nDo you want to save the map after download (recommended) [ Y or N ]: "; $d = ; chomp($d); if ($d eq "Y" || $d eq "y") { $del = "-D"; } else { $del = " "; } } } # Legend and Labels printf "\nWhat label do you want on your map. Pick ONE only. Recommend you\n"; printf "use SSID to start with. If you are using google maps, this option makes\n"; printf "no difference. Choices & SYNTAX [ bssid,ssid,manuf,info,location ]: "; $li = ; chomp($li); $label = "-l $li"; # Map Colors printf "\nColor Legend\n"; printf "\nWhat do you want the colors based on?\n"; printf "[ 0 ] Random colors\n"; printf "[ 1 ] Based on WEP status\n"; printf "[ 2 ] Based on Network Channel\n"; printf "\nEnter your color: "; $co = ; chomp($co); $color = "-n $co"; # Selecting a Filter printf "\nDo you want to specify any BSSID's to specifically\n"; printf "display or not display on the map [ Y or N ]: "; $f = ; chomp($f); if ($f eq "Y" || $f eq "y") { printf "\nEnter the BSSID (MAC address) in the following format\n"; printf "[ 00:AA:BB:CC:DD:11 ]: "; $filt = ; chomp($filt); printf "\nDo you want the BSSID to be EXCLUDED from the map\n"; printf "or do you want the BSSID to be the ONLY entry on the\n"; printf "map? [ E = exclude, O = only entry]: "; $in = ; chomp($in); if ($in eq "O" || $in eq "o") { $filt = "-f $filt -i"; } else { $filt = "-f $filt"; } } # Variable Glossary (so we can remember what these vars mean! # $ms = map source # $od = output type (hull, track, scatter etc.) # $label = label data points (ssid, bssid, manuf etc.) # $color = colors based on WEP/No WEP # $filt = filter BSSID (MAC) (exclude or include) # $file = data file to read in # $map = name of local map to use # $out = output file # $del = save or don't save downloaded map for future use # -k = legend at bottom # Command Line all put together # Command Line for Google Map output if ($ms eq "-j") { printf "\nCreating file named gpsdata.js, place this file in your local google"; printf "map web root\n"; printf "\nCommand Line: gpsmap $ms $od $color $label $file $filt-o gpsdata.js\n\n"; system "gpsmap $ms $od $color $label $file $filt -o gpsdata.js"; } # Command Line for using Local Map elsif ($ms eq "1") { printf "\nOutput file name. Should be something.jpg or .png. Use the"; printf "\nfull path or it will be written to your current directory"; printf "\nPATH/FILE to Output: "; $out = ; chomp($out); printf "\nCommand Line: gpsmap $map -S $ms $od $label $filt $color -o $out $file\n\n"; system "gpsmap $map -S $ms $od $label $filt $color -o $out $file"; } # Command Line for using Internet Downloaded Map else { printf "\nOutput file name. Should be something.jpg or .png. Use the"; printf "\nfull path or it will be written to your current directory"; printf "\nPATH/FILE to Output: "; $out = ; chomp($out); printf "\nCommand Line: gpsmap $del -S $ms $od $label $filt $color -o $out $file\n\n"; system "gpsmap $del -S $ms $od $label $filt $color -o $out $file"; }