Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- #####################################################################################
- # #
- # Spotify Account Generator Console Edition #
- # Copyright Irenicus (C) 2011 #
- # #
- #///////////////////////////////////////////////////////////////////////////////////#
- # #
- # Author: IRENICUS #
- # Contact: irenicus09[at]gmail[dot]com #
- # Date: 3rd May, 2011 #
- # Version: 1.2 #
- # #
- #####################################################################################
- """
- LICENSE AGREEMENT
- Warning! Use this software at your own risk and consent. The Author takes no
- responsibility for the use of this software in any way or the damage caused
- by the use of this software to Spotify or to any other third party.
- This script has been released as a proof of concept tool and for educational
- purposes only. By using this software you agree that you are solely
- responsible for any damage caused by direct, indirect, coincidental or
- consequential use of this software.
- ###############################################################################
- # #
- # USAGE: ./filename [username] [password] [email-address] #
- # #
- ###############################################################################
- """
- import sys, os, mechanize, cookielib, re, random
- from BeautifulSoup import BeautifulSoup
- from time import sleep
- def printLogo():
- return """
- ___ _ _ __
- / __|_ __ ___| |_(_)/ _|_ _
- \__ \ '_ | _ \ _| | _| || |
- |___/ .__|___/\__|_|_| \_, |
- |_| |__/ """
- def clear():
- if os.name in ['nt', 'win32', 'dos']:
- os.system('cls')
- else:
- os.system('clear')
- def generateAccount():
- if (len(sys.argv) == 4):
- if (len(sys.argv[2]) < 6):
- print "[-] Password needs to be minimum 6 characters in Length."
- print "[!] Quitting."
- sys.exit(1)
- clear()
- print "######################################\n"
- print printLogo()
- print "\n Free Account Generator Version 1.2\n\n"
- print " Developed by Irenicus \n"
- print "######################################\n\n"
- sleep(2)
- print "[+] Trying to setup a new account...\n"
- # Setting up Account details
- usr = sys.argv[1]
- passwd = sys.argv[2]
- email = sys.argv[3]
- proxySite = 'http://www.daveproxy.co.uk/'
- url = "http://www.spotify.com/uk/get-spotify/go/open/"
- postalCodeList = ["LN94DF", "AB252SW", "TW33HJ", "EH428IG", "SG114YO"]
- postalCode = str(random.choice(postalCodeList))
- birthDay = str(random.randint(1,27))
- birthMonth = str(random.randint(1,12))
- birthYear = str(random.randint(1950, 1990))
- # Compiling Regex For Error Handling
- usrPattern = re.compile(r'"error">\s+We\'re sorry, that username is taken\.')
- emailPattern = re.compile(r'id="email-error"')
- genList = ("male", "female")
- gender = (random.choice(genList))
- # Setting cookies to maintain sessions, Yum Yum ^^
- cj = cookielib.LWPCookieJar()
- br = mechanize.Browser()
- br.set_cookiejar(cj)
- # Instructing robots to follow orders & do our dirty work
- br.set_handle_robots(False)
- br.set_handle_redirect(True)
- # Pretending to be fake & gay
- br.addheaders = [('User-agent', 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.1) Gecko/2008071615 Fedora/3.0.1-1.fc9 Firefox/3.0.1')]
- # Shows live headers, good for testing
- # br.set_debug_http(True)
- # No more comments from this point.
- # Reason: no patience
- html = br.open(proxySite)
- br.select_form(nr=0)
- br.form['u'] = url
- reponse1 = br.submit()
- br.select_form(nr=1)
- br.form['username'] = usr
- br.form['password_new'] = passwd
- br.form['password_check'] = passwd
- br.form['email'] = email
- br.form['postal_code'] = postalCode
- br.form.find_control('gender').get(gender).selected = True
- br.form.find_control('birth_day').get(birthDay).selected = True
- br.form.find_control('birth_month').get(birthMonth).selected = True
- br.form.find_control('birth_year').get(birthYear).selected = True
- br.form.set_single(True, 'iagree')
- br.form.set_single(False, 'sendemail')
- br.form.set_single(False, 'thirdpartyemail')
- br.form.set_single(False, 'sendsms')
- br.submit()
- response2 = br.response().read()
- soup = (BeautifulSoup(response2)).prettify()
- usrMatch = usrPattern.findall(soup)
- emailMatch = emailPattern.findall(soup)
- if (usrMatch):
- print "[-] Username already exists\n"
- print "[!] Quitting"
- sleep(2)
- sys.exit(1)
- if (emailMatch):
- print "[-] Email has already been taken\n"
- print "[!] Quitting"
- sleep(2)
- sys.exit(1)
- print "[+] Account Created Successfully.\n"
- print "[#] Account Details:"
- print "--------------------------------------"
- print " Username: %s" % usr
- print " Password: %s" % passwd
- print "--------------------------------------"
- print "\n[*] Enjoy Free Music!"
- else:
- print "[-] Failed to generate account: Insufficient Arguments"
- print "[*] USAGE: %s [username] [password] [email-address]" % (sys.argv[0])
- if __name__ == '__main__':
- generateAccount()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement