Results 1 to 6 of 6

Thread: goog-mail.py

  1. #1
    Junior Member
    Join Date
    Aug 2010
    Posts
    51

    Post goog-mail.py

    Hey guys I have come across goog-mail.py in my training and cannot for the life in me seem to find just that one program!
    Even if I get it in python code (which I have never used) I will make do with that, can anyone assist me with locating this?
    I am using BT4 and its not in there as far as I can tell.

    Thank you for your assistance

  2. #2
    Super Moderator Archangel-Amael's Avatar
    Join Date
    Jan 2010
    Location
    Somewhere
    Posts
    8,012

    Default Re: goog-mail.py

    I don't believe goog-mail.py is even in BT4.
    To be successful here you should read all of the following.
    ForumRules
    ForumFAQ
    If you are new to Back|Track
    Back|Track Wiki
    Failure to do so will probably get your threads deleted or worse.

  3. #3
    Just burned his ISO
    Join Date
    Jan 2010
    Location
    Israel
    Posts
    10

    Default Re: goog-mail.py

    I thought I'd help you out

    goog-mail.py from DarkC0de.com
    Code:
    #!/usr/bin/python
    
    import sys
    import re
    import string
    import httplib
    import urllib2
    import re
    def StripTags(text):
        finished = 0
        while not finished:
            finished = 1
            start = text.find("<")
            if start >= 0:
                stop = text[start:].find(">")
                if stop >= 0:
                    text = text[:start] + text[start+stop+1:]
                    finished = 0
        return text
    if len(sys.argv) != 2:
            print "\nExtracts emails from google results.\n"
            print "\nUsage : ./goog-mail.py <domain-name>\n"
            sys.exit(1)
    
    domain_name=sys.argv[1]
    d={}
    page_counter = 0
    try:
        while page_counter < 50 :
            results =
    'http://groups.google.com/groups?q='+str(domain_name)+'&hl=en&lr=&ie=UTF-8&start='
    + repr(page_counter) + '&sa=N'
            request = urllib2.Request(results)
            request.add_header('User-Agent','Mozilla/4.0 (compatible; MSIE
    5.5; Windows NT 5.0)')
            opener = urllib2.build_opener()
            text = opener.open(request).read()
            emails = (re.findall('([\w\.\-]+@'+domain_name+')',StripTags(text)))
            for email in emails:
                d[email]=1
                uniq_emails=d.keys()
            page_counter = page_counter +10
    except IOError:
        print "Can't connect to Google Groups!"+""
    
    page_counter_web=0
    try:
        print "\n\n+++++++++++++++++++++++++++++++++++++++++++++++++++++"+""
        print "+ Google Web & Group Results:"+""
        print "+++++++++++++++++++++++++++++++++++++++++++++++++++++\n\n"+""
    
        while page_counter_web < 50 :
            results_web =
    'http://www.google.com/search?q=%40'+str(domain_name)+'&hl=en&lr=&ie=UTF-8&start='
    + repr(page_counter_web) + '&sa=N'
            request_web = urllib2.Request(results_web)
            request_web.add_header('User-Agent','Mozilla/4.0 (compatible;
    MSIE 5.5; Windows NT 5.0)')
            opener_web = urllib2.build_opener()
            text = opener_web.open(request_web).read()
            emails_web = (re.findall('([\w\.\-]+@'+domain_name+')',StripTags(text)))
            for email_web in emails_web:
                d[email_web]=1
                uniq_emails_web=d.keys()
            page_counter_web = page_counter_web +10
    
    except IOError:
        print "Can't connect to Google Web!"+""
    for uniq_emails_web in d.keys():
        print uniq_emails_web+""

  4. #4
    Junior Member
    Join Date
    Aug 2010
    Posts
    51

    Default Re: goog-mail.py

    Is it not possible for me to get the source somewhere? I was hoping sourceforge would have it but unable to track it down.

    Im very intrigued to use this tool as I have heard bout it but want to try it for myself and edit the code so I can also get some Python experience alongside it

  5. #5
    Junior Member
    Join Date
    Jun 2010
    Location
    Carmel, IN USA
    Posts
    36

    Default Re: goog-mail.py

    Did a little google-foo and found this
    Code:
    #!/usr/bin/python
    
    import sys
    import re
    import string
    import httplib
    import urllib2
    import re
    def StripTags(text):
        finished = 0
        while not finished:
            finished = 1
            start = text.find("<")
            if start >= 0:
                stop = text[start:].find(">")
                if stop >= 0:
                    text = text[:start] + text[start+stop+1:]
                    finished = 0
        return text
    if len(sys.argv) != 2:
            print "\nExtracts emails from google results.\n"
            print "\nUsage : ./goog-mail.py <domain-name>\n"
            sys.exit(1)
    
    domain_name=sys.argv[1]
    d={}
    page_counter = 0
    try:
        while page_counter < 50 :
            results =
    'http://groups.google.com/groups?q='+str(domain_name)+'&hl=en&lr=&ie=UTF-8&start='
    + repr(page_counter) + '&sa=N'
            request = urllib2.Request(results)
            request.add_header('User-Agent','Mozilla/4.0 (compatible; MSIE
    5.5; Windows NT 5.0)')
            opener = urllib2.build_opener()
            text = opener.open(request).read()
            emails = (re.findall('([\w\.\-]+@'+domain_name+')',StripTags(text)))
            for email in emails:
                d[email]=1
                uniq_emails=d.keys()
            page_counter = page_counter +10
    except IOError:
        print "Can't connect to Google Groups!"+""
    
    page_counter_web=0
    try:
        print "\n\n+++++++++++++++++++++++++++++++++++++++++++++++++++++"+""
        print "+ Google Web & Group Results:"+""
        print "+++++++++++++++++++++++++++++++++++++++++++++++++++++\n\n"+""
    
        while page_counter_web < 50 :
            results_web =
    'http://www.google.com/search?q=%40'+str(domain_name)+'&hl=en&lr=&ie=UTF-8&start='
    + repr(page_counter_web) + '&sa=N'
            request_web = urllib2.Request(results_web)
            request_web.add_header('User-Agent','Mozilla/4.0 (compatible;
    MSIE 5.5; Windows NT 5.0)')
            opener_web = urllib2.build_opener()
            text = opener_web.open(request_web).read()
            emails_web = (re.findall('([\w\.\-]+@'+domain_name+')',StripTags(text)))
            for email_web in emails_web:
                d[email_web]=1
                uniq_emails_web=d.keys()
            page_counter_web = page_counter_web +10
    
    except IOError:
        print "Can't connect to Google Web!"+""
    for uniq_emails_web in d.keys():
        print uniq_emails_web+""

  6. #6
    Junior Member
    Join Date
    Aug 2010
    Posts
    51

    Thumbs up Re: goog-mail.py

    OMW you guys are legend!
    Darkcode... I will keep that in mind for future reference
    Thanks guys appreciate the help

Similar Threads

  1. sslstrip e login mail
    By merryxmas in forum Supporto Software
    Replies: 8
    Last Post: 01-27-2010, 10:37 AM
  2. goog-mail.py
    By Danboy in forum OLD Latest Public Release - BackTrack4 Beta
    Replies: 4
    Last Post: 08-17-2009, 05:20 AM
  3. goog-mail.py, bug or...?
    By jorgan in forum OLD BT3final Bugs and Fixes
    Replies: 7
    Last Post: 01-05-2009, 04:02 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •