Sunday, September 18, 2011

Built your own scanning tools to secure windows machine

It's always get my interest in term of finding other people loophole, well this is my job:). I would like to share some of the scanning software you can built by your self and use it to assess the current network you have.I always try not to download tools that will have impact to the windows machine as their origin is unknown. I haven't tested this yet on the windows that are installed with Windows Services for Unix , but I think it should be working well.The most hackers will try to target will be the port 139,445, as we can do a lot of damage to it if is not properly secure. What does the code do is, it try to check the entire network range for any living windows.

Here is the code.

for i in `seq 1 254`;
ping -c 1 x.y.z.$1 | grep "bytes from" | cut -d" " -f4 | cut -d":" -f1 &

nmap -p 139 x.y.z.* -oG 139.txt
cat 139.txt | grep open | cut -d" " -f2
cat 139.txt | grep open | cut -d" " -f2 > 139-ips.txt
nmap -O -iL 139-ips -oG 139-os.txt
cat 139-os.tx | grep open | cut -d":" -f4

1 comment: