Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scanner Scripts
#1
Here is my old scanner script written in Dark Script and adapted to work with DarkSignsJ

Code:
// flederohr's scanner

var$ filename, ip1, ip2, tmpip
var currentip, ipcount, dot, perc, percent, tmppercent, dec, 1ip1, 2ip1, 3ip1, 4ip1, 1ip2, 2ip2, 3ip2, 4ip2, count, pos, port, portscan

getcolor
getfont
chr 37
! perc = %chr%
chr 46
! dot = %chr%
free chr
! ip1=1.0.0.0
! ip2=255.255.255.255
! filename=scan.txt
! portscan=true
goto getip1

@mainmenu
clear
color green
font robotica 46
say # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
color red
say                  Welcome to flederohr's Scanner        
color green
say # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
font %getfont%  
skipline
color yellow
say #######################################################
color white
say 1) start scanning %ipcount% IPs  from "%1ip1%.%2ip1%.%3ip1%.%4ip1%" to "%1ip2%.%2ip2%.%3ip2%.%4ip2%"
say 2) change ip-range
say 3) change file [%filename%]
if %portscan% = true
say 4) portscanning [ON]
else
say 4) portscanning [OFF]
endif
say 5) exit
color yellow
say #######################################################
color white
input dec enter your choice:
skipline
if %dec% = 1
goto scan
endif
if %dec% = 2
goto changeips
endif
if %dec% = 3
goto changefile
endif
if %dec% = 4
goto changeportscan
endif
if %dec% = 5
goto end
endif
goto mainmenu

@changeportscan
if %portscan% = true
! portscan=false
else
! portscan=true
endif
goto mainmenu

@changefile
clear
color yellow
say ##############################
color white
say enter the filename for storing the data:
color yellow
say ##############################
skipline    
color white
input filename filename:
exists %filename%
if %exists% = true
goto fileexists
else
goto mainmenu
endif

@fileexists
clear
color red
say ++++++++++
say file already sexists!
say ++++++++++
color yellow
say ##############################
color white
say 1)  store Data in another file
say 2)  append data to %filename%
say 3)  overwrite %filename%
say 4)  exit scanner
color yellow
say ##############################
color white
input dec input
if %dec% = 1
goto changefile
endif
if %dec% = 2
goto mainmenu
endif
if %dec% = 3
cldo %filename%
goto mainmenu
endif
if %dec% = 4
goto end
endif
goto fileexists


@changeips
clear
color yellow
say ##############################
color white
say enter the IP-range you will scan:
color yellow
say ##############################
skipline                    
color white
input ip1 enter IP you want to start from:
input ip2 enter IP you want to scan to:
goto getip1

@getip1
! currentip=1
! count=1
! tmpip=%ip1%
! pos=1
goto getiploop

@getip2
! currentip=2
! count=1
! tmpip=%ip2%
! pos=1
goto getiploop

@getiploop
strlen %tmpip%
if %strlen% = 0
goto wrongip
endif
strmid %tmpip% %pos% 1
if strmid=%dot%
! strlen=strlen - pos
! pos=pos - 1
strmid %tmpip% 1 %pos%
! %count%ip%currentip%=strmid
! pos=pos + 2
strmid %tmpip% %pos% %strlen%
! tmpip=strmid
! pos=0
! count=count + 1
endif
if count = 4
strmid %tmpip% 1 %strlen%
! 4ip%currentip%=strmid
goto next
endif
if pos = strlen
goto wrongip
endif
if pos > 3
goto wrongip
endif
! pos=pos + 1
goto getiploop

@next
if currentip = 1
goto getip2
else
goto checkips
endif

@checkips
if 1ip1 > 255
goto wrongip
endif
if 2ip1 > 255
goto wrongip
endif
if 3ip1 > 255
goto wrongip
endif
if 4ip1 > 255
goto wrongip
endif
if 1ip2 > 255
goto wrongip
endif
if 2ip2 > 255
goto wrongip
endif
if 3ip2 > 255
goto wrongip
endif
if 4ip2 > 255
goto wrongip
endif
if 1ip1 < 1
goto wrongip
endif
if 2ip1 < 0
goto wrongip
endif
if 3ip1 < 0
goto wrongip
endif
if 4ip1 < 0
goto wrongip
endif
if 1ip2 < 1
goto wrongip
endif
if 2ip2 < 0
goto wrongip
endif
if 3ip2 < 0
goto wrongip
endif
if 4ip2 < 0
goto wrongip
endif
goto getipcount

@getipcount
var tmpcount
! tmpcount=1ip2 - 1ip1
! ipcount=tmpcount * 16581375
! tmpcount=2ip2 - 2ip1
! ipcount=tmpcount * 65536 + ipcount
! tmpcount=3ip2 - 3ip1
! ipcount=tmpcount * 256 + ipcount
! tmpcount=4ip2 - 4ip1
! ipcount=tmpcount + ipcount
if %ipcount% < 0
! ipcount=4228446466 + ipcount
endif
free tmpcount
goto mainmenu


@scan
clear
cldo %filename%
skipline
! count = 0
! percent = 0
goto scanloop

@scanloop
! count=count + 1
! tmppercent=100 * count / ipcount
! percent=percent + 1
if %tmppercent% < %percent%
! percent = percent - 1
endif
print scanning server %1ip1%.%2ip1%.%3ip1%.%4ip1%\t[%count% of %ipcount%] [%percent%%perc%]
qping %1ip1%.%2ip1%.%3ip1%.%4ip1%
if %qping% = false
goto nextip
endif
if %portscan% = true
goto portscan
endif
gethostnamefromip %1ip1%.%2ip1%.%3ip1%.%4ip1%
write %filename% Server: %gethostnamefromip% [%1ip1%.%2ip1%.%3ip1%.%4ip1%]
clear
skipline
goto nextip

@portscan
scan %1ip1%.%2ip1%.%3ip1%.%4ip1% %filename%
clear
skipline
goto nextip

@nextip
if count = ipcount
goto complete
endif
! 4ip1=4ip1+1
if %4ip1% = 256
! 4ip1=0
! 3ip1=3ip1+1
else
goto scanloop
endif
if %3ip1% = 256
! 3ip1=0
! 2ip1=2ip1+1
else
goto scanloop
endif
if %2ip1%=256
! 2ip1=0
! 1ip1=1ip1+1
else
goto scanloop
endif
if %1ip1%=256
!1ip1=1
endif
goto scanloop

@wrongip
color red
clear
say You entered not an IP of the Form: XXX.XXX.XXX.XXX
say IP is a number in the range [1.0.0.0 - 255.255.255.255]
say Please retype the IP's you want to scan
color %getcolor%
getkey
goto mainmenu

@complete
color green
clear
say complete scanning form %ip1% to %ip2%
color blue
skipline
exists %filename%
if %exists% = true
view %filename%
endif
goto credits

@credits
color orange
skipline
skipline
skipline
say @@@ this scanner is written by flederohr @@@
pause
clear
color %getcolor%

@end
free getcolor
free gethosnnamefromip
free dot
free strlen
free ip1
free ip2
free tmpip
free filename
free currentip
free dec
free 1ip1
free 2ip1
free 3ip1
free 4ip1
free 1ip2
free 2ip2
free 3ip2
free 4ip2
free count
free pos
free port
free ipcount
free perc
free percent
free tmppercent


Forum Jump:


Users browsing this thread: 2 Guest(s)