"Ping scan" through Google

From: Petr.Kazil@eap.nl
Date: Fri Jan 20 2006 - 09:50:51 EST


The way I do a "Google Ping scan" is so trivial and badly programmed that
I'm almost ashamed to publish it.
But since two people asked about it, I'll publish it anyway.

This thing could be programmed much better using Perl and the Google API,
but I haven't taken the time to do this.

Suppose I want to scan the range: 221.208.146.1-255
(This is a random IP range that I got from one of the most recent SPAM
mails that I received.)

The Google search URL belonging to the spam sender's address
221.208.146.138 is:
http://www.google.nl/search?hl=en&q=%22221.208.146.138%22&btnG=Search

Now I cut off the last IP range from this string, replace it by a counter
and wrap this in a VBScript file:

===================================

Option Explicit

Const IPRange = "221.208.146"
Const ForWriting = 2

Dim objFSO, objFile, filename
Dim urlpart1, urlpart2, url
Dim i
Dim objHTTP

for i = 1 to 255

        urlpart1="http://www.google.nl/search?hl=en&q=%22"
        urlpart2="%22&btnG=Search"
        url= urlpart1 & IPRange & "." & i & urlpart2
 
        Set objHTTP = CreateObject("MSXML2.XMLHTTP")
        Call objHTTP.Open ("GET", url, FALSE)
        objHTTP.Send
 
        If InStr (objHTTP.ResponseText, "did not match any documents") > 0
Then
                ' do nothing
        Else
                filename = "Googlescan_" & IPRange & "." & i & ".htm"
                Set objFSO = CreateObject("Scripting.FileSystemObject")
                Set objFile = objFSO.OpenTextFile(filename, ForWriting,
True, vbTrue)
                objFile.Write objHTTP.ResponseText
                objFile.Close
        End If
 
        wscript.sleep 6000
next

===================================

That's all. (I hope I didn't leave a dumb bug in there ...)

Now the above example (IP Range) is not the most suitable,
because it looks like it's from a provider with a lot of outgoing
IP-adresses,
and it is in Chinese, so the websites are not very informative.

But try this for your own company's IP-range and it should get more
interesting.

Greetings, Petr Kazil

------------------------------------------------------------------------------
Audit your website security with Acunetix Web Vulnerability Scanner:

Hackers are concentrating their efforts on attacking applications on your
website. Up to 75% of cyber attacks are launched on shopping carts, forms,
login pages, dynamic content etc. Firewalls, SSL and locked-down servers are
futile against web application hacking. Check your website for vulnerabilities
to SQL injection, Cross site scripting and other web attacks before hackers do!
Download Trial at:

http://www.securityfocus.com/sponsor/pen-test_050831
-------------------------------------------------------------------------------



This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 10:55:24 EDT