hacking contest

hacking exploits security forum
hacking
compliance articles
upgrade backup exec
information security consultant

technoboy
might be useful...

QUOTE

echo off
:
:
: -=[ © 2003-10-31 MrB ]=-
:
: collect the name of accessible Windows® shares
:
: syntax: openshare 192.168.0
: - scans all ip from 192.168.0.1 to 192.168.0.254
:
: This is a multithreading script ™. ;-) So don't panic if you
: see many console windows in your taskbar. They are all closing
: by itself.
:
:

:cmd
if not "%5"=="" start "CMD" /min %0 %1 %2 %3 && shift /2 && shift /2 && goto :cmd
if "%0"=="%2" exit
if not "%4"=="" goto :netview
if "%1"=="" echo Nothing to do... && exit
if exist OpenShares.txt del OpenShares.txt
if "%2"=="" if exist *.pid del *.pid
if "%2"=="" start "CMD" /min %0 %1 1 20 21 41 42 62 63 83 84 104 105 125 126 146 147 167 168 188 189 209 210 230 231 254 %0 %1
if "%3"=="" ping 127.0.0.1 -n 5 > nul && goto :wait
echo.>%2.pid
for /L %%I in (%2,1,%3) do echo test if up: %1.%%I && ping %1.%%I -n 1 -w 1000 1>nul 2>nul && if errorlevel = 0 start "CMD" /min %0 %1.%%I %2 %3 %1.%%I
del %2.pid
exit

:wait
echo.&&echo ---[ Please wait... ]---

:wait2
ping 127.0.0.1 -n 2 > nul
if exist *.pid goto :wait2
if exist *.up goto :wait2
for %%I in (*.res) do type %%I >> OpenShares.txt && del %%I
if exist OpenShares.txt start OpenShares.txt
goto :end

:netview
net view \\%1 1> %1.up 2> nul
if errorlevel = 1 goto :endchild
ren %1.up %1.res

:endchild
if exist %1.up del %1.up
exit

:end
daguilar01
very handy tool, thx for sharing, smile.gif

edit:
editing these 3 lines makes it a bit more cmd prompt friendly, tongue.gif
QUOTE
if not "%5"=="" start "CMD" /b ... etc ...
if "%2"=="" start /b "CMD" ... etc ...
if exist OpenShares.txt type OpenShares.txt

keeps you from seeing all the cmd prompts and it doesnt seem to affect performance, and the type thing outputs the txt file to the cmd prompt instead of opening notepad or default .txt viewer
dotcom
I love batch scripting... this is a nice piece of work I might not use it for what you intended, but I always appreciate nice batch....gives me some ideas for other uses!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.

 
Invision Power Board © 2001-2005 Invision Power Services, Inc.