Home page logo
/

fulldisclosure logo Full Disclosure mailing list archives

gather windows shares with an cmd-script
From: Frank Dietrich <bits_n_bytes () gmx de>
Date: Sun, 7 Mar 2004 14:53:13 +0100

Hi,

i got an intersting cmd-script to gather shares in a windows network
without the need to install something.

Sorry for quoting long lines.

@echo off
:
:
: -=[ (c) 2003-10-31 MrB ]=-
:
: collect the name of accessible Windows(R) shares
:
: syntax: openshare 192.168.0
:         - scans all ip from 192.168.0.1 to 192.168.0.254
:
: This is a multithreading script (tm). ;-) 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

_______________________________________________
Full-Disclosure - We believe in it.
Charter: http://lists.netsys.com/full-disclosure-charter.html


  By Date           By Thread  

Current thread:
  • gather windows shares with an cmd-script Frank Dietrich (Mar 07)
[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]