Jump to content

IP Range Scanner


sykes
 Share

Recommended Posts

OK Ok I know there hundreds of these things around, but I hadta go ahead and create one myself ... Feel free to critique or improve if you want

$IP = InputBox("Starting IP", "Please enter the IP you want to start at" & @CRLF & "(Use . to seperate the Octets)")
If @error = 1 Then
   MsgBox(0, "Error", "You Clicked Cancel ... Click OK To Exit")
   Exit
EndIf
If $IP = "" Then 
   MsgBox(0, "Error", "An Invalid Value Was Entered" & @CRLF & "Click OK To Exit")
   Exit
EndIf

$END = InputBox("Ending IP", "Please enter the ending value of the last octet you wish to scan")
If @error = 1 Then
   MsgBox(0, "Error", "You Clicked Cancel ... Click OK To Exit")
   Exit
EndIf
If $END > 255 Then 
   MsgBox(0, "Error", "You Have Entered An Invalid Value" & @CRLF & "Maximum Value is 255")
   Exit
EndIf
If $END = "" Then 
   MsgBox(0, "Error", "An Invalid Value Was Entered" & @CRLF & "Click OK To Exit")
   Exit
EndIf
If Not StringInStr($IP, ".") Then
   MsgBox(0, "", "You did not enter '.' Between Octets" & @CRLF & "Click OK To Exit")
   Exit
EndIf

$IP = StringSplit($IP, ".")
If StringIsAlpha($IP[1]) Or StringIsAlpha($IP[2]) Or StringIsAlpha($IP[3]) Or StringIsAlpha($IP[4]) Then
   MsgBox(0, "", "Only Numeric Values Are Accepted" & @CRLF & "Click OK To Exit")
   Exit
EndIf

$NEXTIP = $IP[4]
$IP = $IP[1] & "." & $IP[2] & "." & $IP[3] & "."

$FILE = FileOpen("IPCheck.log", 2)
While 1
   SplashTextOn("Connectivity Test", "Currently Checking: " & $IP & $NEXTIP, 200, 50)
   $ERRORCODE = RunWait(@ComSpec & " /c ping -n 1 -l 5 " & $IP & $NEXTIP, "", @SW_HIDE)
   If $ERRORCODE = 0 Then
      FileWriteLine($FILE, $IP & $NEXTIP & " Is Alive")
   Else
      FileWriteLine($FILE, $IP & $NEXTIP & " Is Not Responding")
   EndIf
   $NEXTIP = $NEXTIP + 1
   If $NEXTIP > $END Then
      SplashOff()
      ExitLoop
   EndIf
Wend
FileClose($FILE)
RunWait(@WindowsDir & "\Notepad.exe " & @ScriptDir & "\IPCheck.log")
Exit

Errr.... Be sure to watch out for word wrap :ph34r:

or

Download the source here: My Autoit Scripts

We have enough youth. How about a fountain of SMART?

Link to comment
Share on other sites

/me hugs nmap

/me also know he can't emote on these forums :ph34r:

[font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

Link to comment
Share on other sites

I sense an eve junkie

Nope. I just spend way too much time on IRC.

[font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...