info

WHEN IT COMES TO ANDROID THEN WE ARE THE BEST BY UPLOADING LATEST AND FILTERED GAMES, APPS, HACKS ETC. WHICH ARE ADDED EVERYDAY. SO STAY CONNECTED AND BOOKMARK US!

Friday, 30 December 2011

MAKE YOUR COMPUTER AN IP SCANNER.

in this post i am gonna show you how to make your computer an ip scanner

This is the simple bash script to scan your neighbouring ips. You just have to give starting  and ending ips. 
Note: Give our network interface with which u r connected to the network(eg. instead ofppp0 u can give eth0 or wlan0 )
Read the script and make changes accordingly.
(DOWNLOAD THE IMAGE FOR REFERENCE AS IT IS A LITTLE BIT SMALL)
this is the complete script:



#!/bin/bash
#Name : autoping.sh
#author : ashy
#date : 27/12/2010
#purpose : ping neibouring ips

#########Start################
#finds your ip addr
myip=`ifconfig ppp0 | grep “inet addr” | cut -d: -f2 |cut -d” ” -f1`
echo “Your IP : $myip”

#finds neibouring ip addresses

byte4=`ifconfig ppp0 | grep “inet addr” | cut -d: -f2 |cut -d” ” -f1 | cut -d. -f4`
byte123=`ifconfig ppp0 | grep “inet addr” | cut -d: -f2 |cut -d” ” -f1 | cut -d. -f1,2,3`
i=1

echo “!Hosts Alive!”
startip=$1
endip=$2
if [ $startip -ge $endip ]
then
echo “Error Occured!!!  Check the following.”
echo “Enter Start and Ending IP !!”
echo “OR”
echo “Start and Ending IP should not be equal!!”
echo “OR”
echo “Startip should not be greater than Endip”
exit 0
fi

while [ $startip != $endip ]
do
newip=”$byte123″.”$startip”
ping_result=`ping -c 1 $newip |grep “64 bytes from” |cut -d: -f1 |cut -d ” ” -f4`
echo $ping_result
let startip+=1;


done
THANK YOU

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...