Ive been taking it easy this week, I’ve been hit with some type of bug and can’t seem to get rid of it. I’ve also been working on expanding business so I haven’t had much attention on the blog.. Sorries!
Over at EH.net there was some chatter about a webcast presented by Core, featuring Ed skoudous. Ok, cool I read one of his books, but the selling point of the webcast was
“Do you know how to create an automated, iterative reverse DNS lookup tool in a
single Windows command? How about a ping sweeper in a single Windows command?
A password guesser?”
For the record, I didn’t attent because I read that and was like wtf, I hope that isnt going to be the focus of the webcast. After all, I feel as though that block should be common knowledge. Then I started reading the eh.net forum and realized not many people have the command line f00. So, I want everyone to purchase this book:
http://search.barnesandnoble.com/Microsoft-Windows-Command-Line- Administrators-Pocket-Consultant/William-R-Stanek/e/9780735620384/? itm=1
this book will provide you so much more info than any Administering Windows Server book will ever give you. Remember, when you are popping shells you don’t have a gui… Unless you use the VNC payload, or crakc a password and Term serv in… But wheres the fun in any of that?
So let’s get started shall we? The first topic is reverse dns, which chrisg answered no and yes to in the forum over at eh.net. He knows how in bash, but not in windows…. Ok, lets see
———————————————————————
nope but i can do it in bash…
| Code: |
#!/bin/bash
cat iprange.txt | while read IP;
do echo ${IP} && host ${IP} nameserverIP;
done >> hostoutput.txt
|
——————————————————————–
First, I wouldnt even bother with this.
| Code: |
$ UNSET HISTFILE
$ for addr in `cat iprange.txt`; do echo $addr && host $addr >> output.txt; done
|
That’s besides the point, we are talking about windows!
| Code: |
for /F %host in (c:iplist.txt) do echo %host && nslookup %host >> output.txt
|
NEXT!!!!!!!
ping sweep
one of two ways
with a target list:
generate a target list:
| Code: |
for /l %i in (1,1,254) do echo 192.168.1.%i >> targetlist.txt
for /F %addr in (c:targets.txt) do echo %addr && ping -n 1 -w 2 %addr >> output.txt
|
without target list :
| Code: |
for /l %i in (1,1,254) do ping -n 1 -w 2 192.168.1.%i >> output.txt
|
what about a larger network?
| Code: |
for /l %i in (1,1,254) do ping -n 1 -w 2 10.10.%i.%i >> biglist.txt
|
next up is a password guesser
this one is easy!
| Code: |
for /F %passwd in (c:passwdlist.txt) do net use localhostipc$ %passwd /u:"administrator"
|
There’s your Windows cmd line f00 for the day