#!/bin/bash
#This Shit Uses NMAP by fyodor : fyodor@unsecure.org
#if probs occured using this mail me at : root@pcfreak.cc
#You can find logs of the scanning in /whereyouverunscanner/scanned/..
#All Copyrights for their respective owners and GPL ver. 2.0 license
#See The GPL ver. 2.0 license for more info
#Greets to all who knows me -===www.pcfreak.cc===- Stay Away Of M$ ,they stinks.

trap trapint INT
trapint()
{
echo 'Done'
exit
}
funct()
{
printf "Network Scanner\n"
echo -n 'IP:'
read ip
echo -n 'Port:'
read port
if test -d scanned; then
cat /dev/null
else
mkdir scanned
fi
pw=`pwd`
if [ "$port" == "" ];then
nmap $ip -O > $pw/scanned/scan-$ip
else
nmap $ip -p $port > $pw/scanned/scan-$ip
fi
}
funct2()
{
cd $pw/scanned/
if test -e scan-$ip; then
cat $pw/scanned/scan-$ip | less
else
echo 'No results.'
fi
}
main()
{
funct
funct2
}
main
