# Copyright (C) 2011 David Francos Cuartero # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # Along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. report_file=$DUMP_PATH/$Host_MAC.report report_proto_stats(){ check_function tcpdstat_ || source $path/plugins/tcpdstat echo "${warn}Loading tcpdstat plugin" _tcpdstat } _get_report_data(){ kstatsmenu auto; _airgraph; report_proto_stats; } _make_report(){ # Virtual function so I can easily override make_report while preserving this one. cp $path/templates/start.html ${report_file}.html; echo "

Report for $Host_SSID : $Host_MAC

" >> ${report_file}.html echo "
" >> ${report_file}.html report_html &>> ${report_file}.html echo "
" >> ${report_file}.html
    cat $DUMP_PATH/$Host_MAC.report_proto_stats $DUMP_PATH/$Host_MAC.kstats >> ${report_file}.html
    echo "
" >> ${report_file}.html echo "
" >> ${report_file}.html get_html_warnings >> ${report_file}.html echo "
" >> ${report_file}.html cat $path/templates/end >> ${report_file}.html } make_report(){ [[ -e $DUMP_PATH/$Host_MAC.key ]] && { _get_report_data; _make_report &>/dev/null; }; } get_html_warnings(){ get_warnings; while read warning; do echo "

${warning}

"; done < ${report_file}.warns; } get_warnings(){ [[ -e $DUMP_PATH/$Host_MAC.key ]] || return key=`cat $DUMP_PATH/$Host_MAC.key` [[ "$Host_ENC" =~ (.*)"WEP"(.*) ]] && echo "WEP encription is unsecure and should not be used" >> ${report_file}.warns (( ${#key} < 104 )) && echo "Key lenght is less than 104 bytes" >> ${report_file}.warns } report_html(){ [[ -e $DUMP_PATH/$Host_MAC.key ]] || return key=`cat $DUMP_PATH/$Host_MAC.key` echo "

Network SSID $Host_SSID

" echo "

Network MAC $Host_MAC

" echo "

Network channel $Host_CHAN

" echo "

Network encription $Host_ENC

" echo "

Network speed $Host_SPEED

" echo "

Network key $key" } report_mode(){ [[ -e $DUMP_PATH/$Host_MAC.key ]] || { error "${mark} Couldn't crack network"; return; } key=`cat $DUMP_PATH/$Host_MAC.key` echo -e "Network, Mac, Channel, Encription, Speed, key\n$Host_SSID, $Host_MAC, $Host_CHAN, $Host_ENC, $Host_SPEED, $key" > ${report_file}_standard.csv } kstatsmenu(){ $IVSTOOLS --convert $DUMP_PATH/$Host_MAC.cap $DUMP_PATH/$Host_MAC.ivs &> /dev/null && $KSTATS $DUMP_PATH/$Host_MAC.ivs `cat $DUMP_PATH/$Host_MAC.key` &> $DUMP_PATH/$Host_MAC.kstats [[ $1 == "" ]] && less $DUMP_PATH/$Host_MAC.kstats } _airgraph(){ if [[ "$Host_MAC" != "" ]]; then read -p $"Enter format (CPG|CAPR) (CAPR by default): " g [[ $g != "CPG" ]] && g="CAPR" export wait_for_execute=1; AUTO=1; execute $"Generating graphics" $AIRGRAPH -i $DUMP_PATH/$Host_MAC-01.csv -o $DUMP_PATH/$Host_MAC.png -g $g; export wait_for_execute=0; AUTO=0; read -p $"Do you want to launch a browser? [y|N] " yn # Didn't like it. [[ $yn == "y" ]] && x-www-browser $DUMP_PATH/$Host_MAC.png else $clear; echo $"Error: You have to scan for targets first"; fi }