Advertising
- Stuff
- Wednesday, May 23rd, 2012 at 6:34:22pm MDT
- #!/usr/bin/env python
- # --------------------------------------------------------------
- # Title: Military.com Mailer
- # Author: o sup i hear u mail
- # Source: http://www.military.com/ecards/1,14825,women,00.html
- # Date: 5/23/12
- # Method: Form mailer, rotate socks5/http/etc proxies, randomize
- # referer, random image from selection, multithreading
- # --------------------------------------------------------------
- import threading
- import os
- import sys
- import math
- import string
- import urllib2
- import urllib
- import re
- import random
- import pycurl
- import StringIO
- import cStringIO
- # Splits the email list into partitions based on how
- # many threads are currently running.
- def chunker(l, n):
- avg = len(l) / float(n)
- out = []
- last = 0.0
- while last < len(l):
- out.append(l[int(last):int(last + avg)])
- last += avg
- return out
- # Initial configuration options
- print("Welcome to Military.com Mailer\n")
- print("------------------------------------\n")
- usingThreads = input('Please enter how many threads {e.g. 1->500}')
- usingData = raw_input('Please enter a data source {e.g. emails.txt one email per line}')
- usingProxies = raw_input('Please enter a proxy source {e.g. proxies.txt for ip:port per line}')
- images = ['008', '001', '002', '003', '004', '006', '008', '015']
- baseURL = 'http://ecards.military.com/cgi-bin/postcard.cgi?image=/postcard-direct/images/women/ecard_women_'
- endURL = '.jpg'
- email_list = open(usingData, 'r')
- emails = email_list.readlines()
- proxy_list = open(usingProxies, 'r')
- proxies = proxy_list.readlines()
- # Store user agent strings
- user_agents = ['Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)', 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)', 'Mozilla/5.0 (Windows; U; MSIE 9.0; Windows NT 9.0; en-US)', 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.0; Trident/5.0; chromeframe/11.0.696.57)', 'Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 5.2; Trident/4.0; Media Center PC 4.0; SLCC1; .NET CLR 3.0.04320)']
- emailsThreads = chunker(emails, usingThreads)
- emailCounter = 0
- totalEmails = 0
- # Begin mailing process
- class MyThread( threading.Thread ):
- def run( self ):
- global images
- global emailCounter
- global baseURL
- global endURL
- global user_agents
- global r_name
- global totalEmails
- emailFlip = 0
- emailFile = emailsThreads[emailCounter]
- # random proxy
- proxy = random.choice(proxies)
- while(emailFlip < len(emailFile)):
- r_email = emailFile[emailFlip].strip()
- r_name = 'Recipient'
- title = ''
- s_name = 'Test'
- s_email = str(random.random()) + '@military.com'
- subject = "Congratulations, you've won!"
- message = "Please visit http://teacademy.com for further information"
- user_agent = random.choice(user_agents)
- imgSelect = random.choice(images)
- mailURL = baseURL + imgSelect + endURL
- mail_data = 'subject=' + subject + '&r_name=' + r_name + '&r_email=' + r_email + '&s_name=' + s_name + '&s_email=' + s_email + '&midi=none&message=' + message + '&method=web&opt=no+opt_in&agree=agree&opt_in=yes&agreement=yes&object=&image=%2Fpostcard-direct%2Fimages%2Fwomen%2Fecard_women_' + imgSelect + '.jpg&title=' + title + '&config=default.cfg&send=Send+Postcard'
- responses = cStringIO.StringIO()
- crz = pycurl.Curl()
- crz.setopt(pycurl.URL, mailURL)
- crz.setopt(pycurl.COOKIEFILE, 'cookie.txt')
- crz.setopt(pycurl.COOKIEJAR, 'cookie.txt')
- crz.setopt(pycurl.POST, 1)
- crz.setopt(pycurl.POSTFIELDS, mail_data)
- crz.setopt(pycurl.VERBOSE, 1)
- crz.setopt(pycurl.REFERER, mailURL)
- crz.setopt(pycurl.USERAGENT, user_agent)
- crz.setopt(pycurl.PROXY, proxy.split(':')[0])
- crz.setopt(pycurl.PROXYPORT, int(proxy.split(':')[1]))
- crz.setopt(pycurl.PROXYTYPE, pycurl.PROXYTYPE_HTTP)
- crz.setopt(pycurl.WRITEFUNCTION, responses.write)
- crz.perform()
- crz.close()
- tiger = responses.getvalue()
- #print tiger
- emailFlip = emailFlip + 1
- totalEmails = totalEmails + emailFlip
- print("Sent " + str(totalEmails) + " total emails.\n")
- emailCounter = emailCounter + 1
- # Run the program multithreaded
- for x in xrange( usingThreads ):
- MyThread().start()
- # Holds the screen so user needs to type after its done for window
- # to close, or click [x].
- g = raw_input()
advertising
Update the Post
Either update this post and resubmit it with changes, or make a new post.
You may also comment on this post.
Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.