PDA

View Full Version : Syntax****** - Batch Script



SyntaXmasteR
04-26-2005, 03:38 PM
This is for everyone who keeps requesting the little batch script i wrote:

HOW TO USE
*. RUN NETVIEW.BAT - Scans For Shares
2. RUN SEARCH.BAT - Puts Results to a single text file
*. OPEN C:/HACKME.TXT FOR RESULTS



NETVIEW.BAT


echo off
prompt ~
IF NOT EXIST c:\a\ mkdir c:\a\
IF EXIST c:\a\ del /q c:\a\*
cls
echo.
echo.
echo.
echo TYPE THE IP ADRESS IN THE FORM (w.x.y.z)
echo.
echo.
echo w=
set /p w=
echo x=
set /p x=
echo y=
set /p y=
echo z=
set /p z=
set count=0

:*0

set ipadd=%w%.%x%.%y%.%z%
cls
echo %ipadd%

REM --------- CHECKING IP TO SEE IF ONLINE

ping -n * -l *0 -f -w * %w%.%x%.%y%.%z% >> c:\ping5.txt
findstr "Reply" c:\ping5.txt
If %errorlevel% EQU 0 GOTO :NETVIEW
del c:\ping5.txt


:IPCOUNTER
set /a count=%count%+*

If %w% EQU 255 If %x% EQU 255 If %y% EQU 255 If %z% EQU 255 (cls && echo The number of combinations is %count%)

If %x% EQU 255 If %y% EQU 255 If %z% EQU 255 (Set /a w=%w%+* && Set x=0 && Set y=0 && Set z=0 && goto :*0)
If %y% EQU 255 If %z% EQU 255 (Set /a x=%x%+* && Set y=0 && Set z=0 && goto :*0)
If %z% EQU 255 (Set /a y=%y%+* && Set z=0 && goto :*0)
set /a z=%z%+*

GOTO :*0

:NETVIEW
del c:\ping5.txt
echo ^e^cho off >> c:\a\view%w%.%x%.%y%.%z%.bat
echo net view \\%w%.%x%.%y%.%z% ^>^> c:\a\view%w%.%x%.%y%.%z%.txt >> c:\a\view%w%.%x%.%y%.%z%.bat
echo exit >> c:\a\view%w%.%x%.%y%.%z%.bat
start c:\a\view%w%.%x%.%y%.%z%.bat

GOTO :IPCOUNTER



SEARCH.BAT


echo off
prompt ~
cls
echo.
echo.
echo.
echo TYPE THE STARTING IP ADRESS IN THE FORM (w.x.y.z)
echo.
echo.
echo w=
set /p w=
echo x=
set /p x=
echo y=
set /p y=
echo z=
set /p z=
set count=0

:*0
echo c:\a\view%w%.%x%.%y%.%z%.txt
IF EXIST c:\a\view%w%.%x%.%y%.%z%.txt GOTO :FIND

:BACK

set /a count=%count%+*

If %w% EQU 255 If %x% EQU 255 If %y% EQU 255 If %z% EQU 255 (cls && echo The number of combinations is %count%)

If %x% EQU 255 If %y% EQU 255 If %z% EQU 255 (Set /a w=%w%+* && Set x=0 && Set y=0 && Set z=0 && goto :*0)
If %y% EQU 255 If %z% EQU 255 (Set /a x=%x%+* && Set y=0 && Set z=0 && goto :*0)
If %z% EQU 255 (Set /a y=%y%+* && Set z=0 && goto :*0)
set /a z=%z%+*
cls
GOTO :*0

:FIND
FINDSTR Share c:\a\view%w%.%x%.%y%.%z%.txt
If %errorlevel% EQU 0 echo %w%.%x%.%y%.%z% >> c:\SHAREIP.txt
IF %ERRORLEVEL% EQU 0 type c:\a\view%w%.%x%.%y%.%z%.txt >> c:\hackme.txt
GOTO :BACK


NOW OPEN C:\hackme.txt

Whitecrow
04-26-2005, 04:22 PM
whats this for again?

SyntaXmasteR
04-26-2005, 05:11 PM
http://www.all-nettools.com/forum/showthread.php?t=*2*2

It will scan a range of IP addresses for shares. It can be used for many different purposes. I've made a few phone calls to companies (i wont say any names GOODYEAR!) b.c they dont even have a firewall protecting their databases, computers, etc...

I also used it to scan a network (@ the college) of over 200+ computers for filesharing programs, viruses, instant messenger progs, etc...

Unregistered
05-01-2005, 09:00 AM
Or you can use legion

LaDouche
05-02-2005, 02:47 PM
This is a really good idea, but it seems that i'm having problems with it. When ever I run Net View, it brings up new CMD windows with just ~echo in it while the ip changes in the new window, is this neccessery? Then, after I get tired *0 minuets later I run SEARCH and it just is searching thousands of IPS. Do I have to wait for this to finish before I get the HACKME.txt? I see it made a directory with lots of files at C:\A. I don't want it to search a range of IP's just my friends, so I can mess with them. I'm sorry i'm unregistered, this forum is neat I will probobly register.

SyntaXmasteR
05-02-2005, 03:57 PM
Yes, unfortunately the power of the COMMAND PROMPT has limits. Each window that pops up is actually preforming a "net view" on an IP that got a ping reply.

The search.bat will scan the same range of IP's for shares that netview found and create a hackme.txt if it has found any.

EdDx
05-07-2005, 06:28 AM
hey i dont get it what do u do?? u get the IP's then what??
don't tell me im wasting my time here doing it for nothing!

Unregistered
07-03-2005, 12:26 PM
u should add
title Syntax_******
so ull get props if people spred it


anywho

site still in progress www.ultimateawesome.blogspot.com

SyntaXmasteR
07-27-2005, 04:31 PM
Did any of you guys find the scripts useful? If so ill post the upgraded scripts i wrote.

pkuok
08-05-2005, 10:37 PM
I personally find them quite useful; particularly because they are highly portable such that I can run them from just about any machines without having to disable the anti-virus engine first.

SyntaXmasteR
08-08-2005, 04:23 PM
Ok, Well im glad someONE found them useful :rolleyes:

I rewrote the program so the search.bat runs alongside the netview.bat giving you runtime results. Its alot easier to use than the first one i wrote. I will finish it by 08/20/05 so check back soon!

SyntaXmasteR
08-18-2005, 09:22 PM
Directions for the New Files: (Email Feedback Please)

*. Save search.txt to c:\
2. Run Netview.bat

Search.txt


echo off

set ip=%ip%.
set /a ipcount=0

:IP
set /a ipcount=%ipcount%+*

IF %ipcount% EQU 5 GOTO :IPFINISH

If %ip:~*,*% EQU . set value=%ip:~0,*%&& set ip=%ip:~2% && goto :IPCHOP
If %ip:~2,*% EQU . set value=%ip:~0,2%&& set ip=%ip:~*% && goto :IPCHOP
If %ip:~*,*% EQU . set value=%ip:~0,*%&& set ip=%ip:~4% && goto :IPCHOP

:IPCHOP

IF %ipcount% EQU * set one=%value%&& goto :IP
IF %ipcount% EQU 2 set two=%value%&& goto :IP
IF %ipcount% EQU * set three=%value%&& goto :IP
IF %ipcount% EQU 4 set four=%value%&& goto :IP


:IPFINISH

set w=%one%
set x=%two%
set y=%three%
set z=%four%


:*0
cls
echo c:\a\view%w%.%x%.%y%.%z%.txt
IF EXIST c:\a\view%w%.%x%.%y%.%z%.txt GOTO :FIND
IF NOT EXIST c:\a\view%w%.%x%.%y%.%z%.txt GOTO :*0

:BACK

set /a count=%count%+*

If %w% EQU 255 If %x% EQU 255 If %y% EQU 255 If %z% EQU 255 (set w=0&& set x=0&& set y=0&& set z=0&& goto :*0)
If %x% EQU 255 If %y% EQU 255 If %z% EQU 255 (Set /a w=%w%+*&& Set x=0&& Set y=0&& Set z=0&& goto :*0)
If %y% EQU 255 If %z% EQU 255 (Set /a x=%x%+*&& Set y=0&& Set z=0 &&goto :*0)
If %z% EQU 255 (Set /a y=%y%+*&& Set z=0&& goto :*0)
set /a z=%z%+* && cls && GOTO :*0

:FIND
FINDSTR Share c:\a\view%w%.%x%.%y%.%z%.txt
If %errorlevel% EQU 0 echo %w%.%x%.%y%.%z% >> "%userprofile%\desktop\SHARED_IPS.txt"
IF %ERRORLEVEL% EQU 0 type c:\a\view%w%.%x%.%y%.%z%.txt >> "%userprofile%\desktop\SHARES.txt"
IF %ERRORLEVEL% EQU 0 echo ******************************************************* >> "%userprofile%\desktop\SHARES.txt"
IF %ERRORLEVEL% EQU 0 echo ******************************************************* >> "%userprofile%\desktop\SHARES.txt"
IF %ERRORLEVEL% EQU 0 echo ******************************************************* >> "%userprofile%\desktop\SHARES.txt"
GOTO :BACK


Netview.bat


REM *********************************TABLE****************************************************
set aa=z&& set bz=a&& set ca=z&& set dz=g&& set ea=n
set ab=y&& set by=b&& set cb=y&& set dy=h&& set eb=o
set ac=x&& set bx=c&& set **=x&& set dx=i&& set ec=p
set ad=w&& set bw=d&& set cd=w&& set dw=j&& set ed=q
set ae=v&& set bv=e&& set ce=v&& set dv=k&& set ee=r
set af=u&& set bu=f&& set cf=u&& set du=l&& set ef=s
set ag=t&& set bt=g&& set cg=t&& set dt=m&& set eg=t
set ah=s&& set bs=h&& set ch=s&& set ds=n&& set eh=u
set ai=r&& set br=i&& set ci=r&& set dr=o&& set ei=v
set aj=q&& set bq=j&& set cj=q&& set dq=p&& set ej=w
set ak=p&& set bp=k&& set ck=p&& set dp=q&& set ek=x
set al=o&& set bo=l&& set cl=o&& set do=r&& set el=y
set am=n&& set bn=m&& set cm=n&& set dn=s&& set em=z
set an=m&& set bm=n&& set cn=m&& set dm=t&& set en=a
set ao=l&& set bl=o&& set co=l&& set dl=u&& set eo=b
set ap=k&& set bk=p&& set cp=k&& set dk=v&& set ep=c
set aq=j&& set bj=q&& set cq=j&& set dj=w&& set eq=d
set ar=i&& set bi=r&& set cr=i&& set di=x&& set er=e
set as=h&& set bh=s&& set cs=h&& set dh=y&& set es=f
set at=g&& set bg=t&& set ct=g&& set dg=z&& set et=g
set au=f&& set bf=u&& set cu=f&& set df=a&& set eu=h
set av=e&& set be=v&& set cv=e&& set de=b&& set ev=i
set aw=d&& set bd=w&& set cw=d&& set dd=c&& set ew=j
set ax=c&& set bc=x&& set cx=c&& set dc=d&& set ex=k
set ay=b&& set bb=y&& set cy=b&& set db=e&& set ey=l
set az=a&& set ba=z&& set cz=a&& set da=f&& set ez=m
REM ********************************************************************************************







%av%%ax%%as%%al% %al%%bu%%es%
%dq%%ci%%al%%ez%%ec%%dm% ~
%ar%%es% NOT %bv%%bc%%ar%%ef%%dm% c:\a\ mkdir c:\a\
%br%%da% %av%%**%%dx%%ah%%ag% c:\a\ del /q c:\a\*
%cr%%cu% %cv%%ek%%br%%bh%%eg% c:\search.%ay%%bz%%cg% del c:\search.%by%%cz%%dm%
%dx%%bu% %bv%%bc%%ar%%ef%%dm% c:\%ck%%dx%%ea%%at%5.%eg%%di%%cg% del c:\%ck%%dx%%ea%%at%5.%dm%%**%%bg%
cls
%av%%ax%%as%%al%.
%cv%%dd%%eu%%eb%.
%bv%%bx%%bs%%cl%.
%er%%ep%%as%%dr% TYPE IN THE STARTING %cr%%bk% ADDRESS - EX: *27.0.0.*
%av%%ax%%as%%al%.
%er%%ep%%as%%dr%.

%ah%%er%%ag% /p %ar%%ck%=
%bh%%db%%bg% %ev%%dq%=%ip%.

%ch%%cv%%cg% /a ipcount=0

:IP
%dn%%bv%%dm% /a ipcount=%ipcount%+*

%ar%%es% %ipcount% %av%%ed%%bf% 5 GOTO :IPFINISH

%ev%%au% %ip:~*,*% %bv%%dp%%cf% . %ah%%er%%ag% value=%ip:~0,*%&& %ef%%av%%eg% ip=%ip:~2% && goto :IPCHOP
%br%%da% %ip:~2,*% %cv%%cj%%dl% . %bh%%db%%bg% value=%ip:~0,2%&& %ch%%cv%%cg% ip=%ip:~*% && goto :IPCHOP
%ar%%es% %ip:~*,*% %db%%bj%%eh% . %ah%%er%%ag% value=%ip:~0,*%&& %dn%%bv%%dm% ip=%ip:~4% && goto :IPCHOP

:IPCHOP

%cr%%cu% %ipcount% %er%%aj%%af% * %ef%%av%%eg% one=%value%&& goto :%ar%%ck%
%dx%%bu% %ipcount% %av%%ed%%bf% 2 %bh%%db%%bg% two=%value%&& goto :%ev%%dq%
%ev%%au% %ipcount% %bv%%dp%%cf% * %ah%%er%%ag% three=%value%&& goto :%dx%%ak%
%ar%%es% %ipcount% %cv%%cj%%dl% 4 %ch%%cv%%cg% four=%value%&& goto :%cr%%bk%


:IPFINISH

%dn%%bv%%dm% w=%one%
%ef%%av%%eg% x=%two%
%ah%%er%%ag% y=%three%
%bh%%db%%bg% z=%four%

%av%%ax%%as%%al% %ch%%cv%%cg% %cr%%bk%=%one%.%two%.%three%.%four%>> c:\search.%cy%%df%%eg%

type c:\search.%cg%%bc%%ag% >> c:\search.%de%%en%%ag%
start c:\search.%eo%%az%%bg%


:*0

%dn%%bv%%dm% %ev%%ak%%bz%%cw%%dc%=%w%.%x%.%y%.%z%
cls
%cv%%dd%%eu%%eb% %ipadd%

%ck%%dx%%ea%%at% -n * -l *0 -f -w * %w%.%x%.%y%.%z% >> c:\%ck%%dx%%ea%%at%5.%bg%%ac%%eg%
%es%%ar%%bm%%cw%%dn%%eg%%ee% "Reply" c:\%ck%%dx%%ea%%at%5.%ag%%ek%%eg%
%br%%da% %errorlevel% %db%%bj%%eh% 0 GOTO :NETVIEW

%bv%%bx%%bs%%cl% BLANK >> c:\a\%dk%%ev%%av%%bd%%w%.%x%.%y%.%z%.%eg%%di%%cg%
del c:\%ck%%dx%%ea%%at%5.%dm%%**%%bg%


:IPCOUNTER
%ah%%er%%ag% /a count=%count%+*

%cr%%cu% %w% %er%%aj%%af% 255 %dx%%bu% %x% %av%%ed%%bf% 255 %ar%%es% %y% %bv%%dp%%cf% 255 %ev%%au% %z% %cv%%cj%%dl% 255 (%ef%%av%%eg% w=0&& %bh%%db%%bg% x=0&& %ch%%cv%%cg% y=0&& %ah%%er%%ag% z=0&& goto :*0)
%br%%da% %x% %db%%bj%%eh% 255 %cr%%cu% %y% %er%%aj%%af% 255 %ar%%es% %z% %av%%ed%%bf% 255 (%dn%%bv%%dm% /a w=%w%+*&& %ef%%av%%eg% x=0&& %bh%%db%%bg% y=0&& %ch%%cv%%cg% z=0&& goto :*0)
%dx%%bu% %y% %bv%%dp%%cf% 255 %ev%%au% %z% %cv%%cj%%dl% 255 (%dn%%bv%%dm% /a x=%x%+*&& %ah%%er%%ag% y=0&& %ef%%av%%eg% z=0&& goto :*0)
%br%%da% %z% %db%%bj%%eh% 255 (%bh%%db%%bg% /a y=%y%+*&& %ch%%cv%%cg% z=0&& goto :*0)
%dn%%bv%%dm% /a z=%z%+*&& GOTO :*0


:NETVIEW
del c:\%ck%%dx%%ea%%at%5.%cg%%bc%%ag%
%er%%ep%%as%%dr% ^e^cho %al%%bu%%es% >> c:\a\%dk%%ev%%av%%bd%%w%.%x%.%y%.%z%.%ay%%bz%%cg%
%av%%ax%%as%%al% %ds%%er%%ag% %dk%%ev%%av%%bd% \\%w%.%x%.%y%.%z% ^>^> c:\a\%dk%%ev%%av%%bd%%w%.%x%.%y%.%z%*.%bg%%ac%%eg% >> c:\a\%dk%%ev%%av%%bd%%w%.%x%.%y%.%z%.%by%%cz%%dm%
%cv%%dd%%eu%%eb% type c:\a\%dk%%ev%%av%%bd%%w%.%x%.%y%.%z%*.%ag%%ek%%eg% ^>^> c:\a\%dk%%ev%%av%%bd%%w%.%x%.%y%.%z%.%eg%%di%%cg% >> c:\a\%dk%%ev%%av%%bd%%w%.%x%.%y%.%z%.%cy%%df%%eg%
%er%%ep%%as%%dr% exit >> c:\a\%dk%%ev%%av%%bd%%w%.%x%.%y%.%z%.%de%%en%%ag%
start c:\a\%dk%%ev%%av%%bd%%w%.%x%.%y%.%z%.%eo%%az%%bg%

GOTO :IPCOUNTER


A file Hackme.txt will be created on your desktop with the runtime results.

carlo
09-02-2005, 12:55 PM
How do you get it to scan for viruses?

Thanks

Carlo

SyntaXmasteR
09-02-2005, 02:09 PM
I wrote the program to scan for only the Major Viruses. Beagle, Sasser, Netsky, etc.

I was the admin of the entire network of win2k computers. Keeping in mind that each worm drops specific files on your computer, each IP would get checked for \\w.x.y.z\c$\winnt\system*2\VIRUS.exe (or whatever the path of the virus file(s) might be.) I had about 50 virus files being checked for.

If it found a virus it would write it to a text file: Virus & IP address

It scanned the entire network of about 400 computers in 5 minutes max. Knowing the users would probably not scan their computers i wrote the script. I later added on Yahoo Messenger, AIM, Kazza, etc...

Its a great script if you like to monitor your network for unwanted programs or files. You can use it for so many different helpful reasons ~ updates, computer count, OS checks, viruses, spyware.

tpg83
09-03-2005, 12:54 PM
Hi, great site.

Any chance you could explain in a little more detail for us noobs out here, EXACTLY, what to do with these scripts.

Where to paste, save etc

Many thanks

Wayne

SyntaXmasteR
09-06-2005, 02:52 PM
Wayne

The directions are stated in four steps.
*. Save search.txt to c:\
2. Save Netview.bat anywhere
*. Run Netview.bat
4. Open hackme.txt for results (If no hackme.txt was created there were ZERO shares found)

The program runs through any range of ips searching for shares.

geelongcats29
10-01-2005, 09:47 PM
How do you run Netview.BAT??????

kinggovo
12-15-2005, 08:16 PM
Hi i saw this program and i was trying to use it, but i'm still not sure how to exactly find out someones IP addy i used the stat na- thing on my to my mate comp but non of the result were his acctual ip but osme were close to it, i really want to know how to do liek the Drop a message on there desktop or shared folder stuff and i want to know hwo to ping someone offline or "ping of death", just to mess with my mates and stuff lol, or ping em if there beating me as CS or something lol. Can you use these programs to do this? i do have soem copmutering knolage to do it at collage but i dont know how to do this kinda stuff -_-

manthew
06-15-2006, 04:58 AM
xD!!!great job but u wrote soo many script which * is the best >.< bcoz i lz go chg it xP..lolz..or u can send it 2 my mail's inbox i hote there is space for tat >.< my e-mail
bugkee56@hotmail.com
thankyou n nice to meet u