@echo off
rem Callidus - the funny port scanner 4 cmd.exe, by Circiter.
if exist _ goto %1
rem Check host accessibility.
echo ping...
ping %1 > nul
if ERRORLEVEL 1 (
echo access denied
goto bye
)
rem Save parameters and prepare to scanning.
set host=%1
set begin=%2
set end=%3
md _
echo scanning...
echo -> _\lock
echo -> _\wait
start /wait /min cmd /c "%0 actualscan"
rem FIXME: It fails if all ports
rem in given range is opened.
echo wait...
:djvu
if exist _\wait goto djvu
echo draft report:
call %0 list
echo wait some time and execute "callidus list" to
echo get probably more relevant results
goto bye
:try
rem Connect to certain port using standard telnet-client.
telnet %host% %2
echo -> _\%2
if exist _\wait del _\wait
:anchor
if exist _\lock goto anchor
exit
:list
rem Enumerate all opened ports.
echo opened ports
for /l %%i in (%begin%,1,%end%) do if not exist _\%%i echo %%i
goto bye
:clear
rem Remove all auxiliary data.
del /q _\*
rd _
goto bye
:actualscan
rem Scan entire range of ports.
for /l %%i in (%begin%,1,%end%) do start /b %0 try %%i
:bye