Morten's Blog


The random output of Morten André Steinsland

Spammer-Scammer, random e-mail generator with Python.

Posted by Morten André on May 26, 2009 at 00:23. In the Funny Stuff, Python category.
Tags : , , , ,
Spam in a can

Spam in a can

Lately I’ve received a number of messages from bots using other people’s hacked MSN accounts. The link they were pushing was basically an email confirmation link, clicking it would have told them that my e-mail address was valid, and surely landed me in some spammer’s e-mail lists. So instead i decided to try and mess around a little, and thus this little Python program was written.

It generates random fake e-mails, from three text lists, and sends them to the spammer using their own validator link, trough the Tor proxy network; making it harder to block  or locate you.

Download it here . Use it at your own risk or don’t use it at all, read the disclaimer in the source. Feel free to do whatever the heck you want with it, just don’t come back crying if you make a booboo.


Below is the source, name lists excluded (included in the zip).

#!/usr/bin/env python
# -*- coding: utf-8 -*-

# SpammerScammer.py
# Copyright (c)2009 Morten André Steinsland

# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
# OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE. USE THE SOFTWARE AT YOUR OWN RISK!

import random , time , urllib

preURL = "http://www.wespamandscam.com/?youremail=" #First part of the URL
proxy = {'http': 'http://127.0.0.1:8118'} #Local Tor proxy address

##[ Open the text lists ]##
FileFirstNames = open('first_names.txt', 'r')
FileLastNames = open('last_names.txt', 'r')
FileDomains = open('domain_names.txt', 'r')

##[ Generate lists ]##
FirstNames = FileFirstNames.readlines()
LastNames = FileLastNames.readlines()
DomainNames = FileDomains.readlines()
Separators = ['_' , '.' , '-' , '']

##[ Set the User-Agent ]##
class UserAgentHack(urllib.FancyURLopener):
    version = "Mozilla/5.0 (Windows; U; Windows NT 5.1; it; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11"
urllib._urlopener = UserAgentHack()

##[ Functions ]##
def GenerateMail(firstnames, separators, lastnames, domains):
    """This returns a random email address generated from four lists"""

    RandomFirstName = firstnames[random.randint(0 , len(firstnames)-1)].rstrip('\n').lower()
    RandomSeparator = separators[random.randint(0 , len(separators)-1)]
    RandomLastName = lastnames[random.randint(0 , len(lastnames)-1)].rstrip('\n').lower()
    RandomDomain = domains[random.randint(0 , len(domains)-1)].rstrip('\n').lower()

    return RandomFirstName + RandomSeparator + RandomLastName + '@' + RandomDomain

##[ Main ]##
print "Choosing among " + str(len(FirstNames)) + " first names, " + str(len(Separators)) + ' separators, ' + str(len(LastNames)) + " surnames and " + str(len(DomainNames)) + " domains."

print str(len(FirstNames) * len(Separators) * len(LastNames) * len(DomainNames)) + ' possible combinations.'

Number = 0
while True:

    URL = preURL + GenerateMail(FirstNames, Separators, LastNames, DomainNames)
    urllib.urlopen(URL , proxies=proxy)
    print str(Number) + ' ' +  URL
    urllib.urlcleanup()
    time.sleep(1)
    Number = Number + 1

Leave a comment

(required)
(required)

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Powered by WordPress
Theme by Morten Andrè Steinsland
66 queries. 0.139 seconds.