Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # TWITTER SPAMMER
- # by, well, Anonymous
- import base64
- from urllib import *
- from urllib2 import *
- from random import randint
- from random import choice
- from time import sleep
- from os.path import isfile
- import Tkinter as Tk
- import Image
- import ImageTk
- import string
- accounts = []
- class CaptchaEntry(Tk.Frame):
- def __init__(self, master=None):
- Tk.Frame.__init__(self, master)
- self.bind_all(sequence="<KeyPress-Return>",
- func=self.EnterAction)
- self.grid()
- self.aButton = Tk.Canvas ( self, width=300, height=60)
- global cimage
- im = Image.open(StringIO(cimage))
- tkim = ImageTk.PhotoImage(im)
- self.aButton.create_image(150, 30, image=tkim)
- self.aButton.image = tkim #keep the reference
- self.aButton.grid(row=1,columnspan = 3)
- self.str = Tk.StringVar()
- self.text = Tk.Entry(self,textvariable=self.str,
- width=15,font=("Helvetica", "24"))
- self.text.grid(row=2,column=1)
- self.text.focus_set()
- self.label = Tk.Label(self,text='Press enter after typing')
- self.label.grid(row=3,columnspan=3)
- def EnterAction(self,event):
- global textentry
- textentry = self.str.get()
- self.quit()
- def GenRandom(len=8, lowercase=1, capitalise=False):
- if lowercase == 1:
- chars = string.lowercase + string.digits
- elif lowercase == 2:
- chars = string.letters + string.digits
- else:
- chars = string.lowercase
- if capitalise:
- firstletter = choice(string.uppercase)
- else:
- firstletter = choice(string.letters)
- newpasswd = firstletter
- for i in range(len-1):
- newpasswd = newpasswd + choice(chars)
- return newpasswd
- signup = 0
- while signup < 3:
- signup += 1
- u = urlopen("https://twitter.com/signup")
- cookie = u.info()['set-cookie']
- content = u.read()
- u.close()
- match = '<script type="text/javascript" src="https://api-secure.recaptcha.net(?P<url>.*?)"></script>'
- m = re.search(match, content)
- if m:
- captchaurl = m.group('url')
- print 'Captcha URL:',captchaurl
- else:
- print 'failed to get captch url'
- sys.exit()
- if 'value="Create my account"' not in content:
- print 'Something is wrong with this form'
- sys.exit()
- #GET CAPTCHA CHALLENGE
- u = urlopen(Request("https://api-secure.recaptcha.net"+ captchaurl,
- headers={ "Referer" : "https://twitter.com/signup" }))
- capcookie = u.info()['set-cookie']
- capcontent = u.read()
- u.close()
- match = "challenge : '(?P<c>.*?)',"
- m = re.search(match, capcontent)
- if m:
- challenge = m.group('c')
- print 'Challenge:',challenge
- else:
- print 'failed to get captcha challenge'
- sys.exit()
- u = urlopen(Request('https://api-secure.recaptcha.net/image?c='+challenge,
- headers={"Cookie" : capcookie, "Referer" : "https://twitter.com/signup" } ))
- cimage = u.read()
- u.close()
- textentry = ''
- app = CaptchaEntry()
- app.master.title("DO EEET!!!111oneone1")
- app.mainloop()
- app.quit()
- app.destroy()
- #FILL THE FORM, first authenticity_token
- match = "twttr.form_authenticity_token = '(?P<token>.*?)';"
- m = re.search(match, content)
- if m:
- authtoken = m.group('token')
- print 'authenticity_token:',captchaurl
- else:
- print 'failed to get authenticity_token'
- sys.exit()
- username = GenRandom(randint(10, 15), 1, False)
- fullname = GenRandom(randint(7, 10), 3, True) + ' ' + GenRandom(randint(7, 10), 3, True)
- password = GenRandom(randint(7, 10), 2, False)
- email = GenRandom(randint(7, 10), 2, False) + '@mailinator.com'
- postdata = 'authenticity_token=' + authtoken
- postdata += '&follow=&user%5Bname%5D=' + fullname
- postdata += '&user%5Bscreen_name%5D=' + username
- postdata += '&user%5Buser_password%5D=' + password
- postdata += '&user%5Bemail%5D=' + email
- postdata += '&user%5Bsend_email_newsletter%5D=0'
- postdata += '&recaptcha_challenge_field=' + challenge
- postdata += '&recaptcha_response_field=' + textentry
- u = urlopen(Request("https://twitter.com/account/create", data = postdata,
- headers={ "Cookie" : cookie, "Referer" : "https://twitter.com/signup" }))
- response = u.read()
- u.close()
- print 'username', username
- print 'fullname', fullname
- print 'password', password
- print 'email', email
- if 'Please try to match the 2 words shown above, or try the audio version.' in response:
- print "\nCaptcha is not accepted"
- raw_input()
- sys.exit()
- if "By clicking on 'Create my account' above, you confirm that you accept" in response:
- print "\nFail. Run the application again."
- raw_input()
- sys.exit()
- if "You can't do that right now." in response:
- print "\nTwitter says: You can't do that right now. Probably your IP got banned. Change it or wait a while for it to be unlocked."
- raw_input()
- sys.exit()
- print 'Seems ok, account created.'
- accounts.append([username, password])
- # ==============================
- log = ""
- for a in accounts:
- log += "Username: " + a[0] + " Password: " + a[1] + "\n"
- if (isfile('log.txt')):
- file = open('log.txt', 'a')
- else:
- file = open('log.txt', 'w')
- file.write(log)
- file.close()
- timer = 15
- useragent="Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20091204 Firefox/3.5.0.1"
- url = 'http://www.twitter.com/statuses/update.xml'
- phrases = ["", "eBaum's World", "", "God bless America", "", "some stay dry and others feel the pain", "", "Has anyone really been far even as decided to use even go want to do look more like?", "", "", "nigger", "aids", "cancer", "gorilla", "faggot", "penis", "vagina", "asshole","butthurt", "koran", "islam", "basement", "retard", "", "", "", "Merkel", "listening to", "movie","happy hour", "love", "hate", "virgin", "lulz", "nazi", "Hitler", "negro", "anime", "manga","pooper", "sex", "anal","Fritzl", "", "", "", ""]
- cnt = 0;
- while(1):
- status = '#gorillapenis ' + phrases[randint(0,len(phrases)-1)] + ' ' + phrases[randint(0,len(phrases)-1)]
- quote_plus(status)
- rand = randint(0, len(accounts)-1)
- username = accounts[rand][0]
- password = accounts[rand][1]
- req = Request(url, data = 'status='+status)
- req.add_header('User-Agent', useragent)
- auth = HTTPPasswordMgrWithDefaultRealm()
- auth.add_password(None, url, username, password)
- handle = HTTPBasicAuthHandler(auth)
- opener = build_opener(handle)
- install_opener(opener)
- u = urlopen(req)
- try:
- response = u.read()
- except HTTPError, e:
- print "Fucking shit, error", e.code
- else:
- cnt += 1
- print "Tweet sent as", username, ", altogether", str(cnt), "tweets sent"
- if cnt > 140:
- print "Holy shit, your IP might get blocked soon. You'd better change it!"
- sleep(timer)
Add Comment
Please, Sign In to add comment