Advertisement
irenicus09

Spotify Account Generator V 1.2

May 6th, 2011
5,062
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 6.04 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3. #####################################################################################
  4. #                                                       #
  5. # Spotify Account Generator Console Edition                     #
  6. # Copyright Irenicus (C) 2011                                                       #
  7. #                                                                                   #
  8. #///////////////////////////////////////////////////////////////////////////////////#
  9. #                                                       #
  10. # Author: IRENICUS                                  #
  11. # Contact: irenicus09[at]gmail[dot]com                          #
  12. # Date: 3rd May, 2011                                   #
  13. # Version: 1.2                                      #
  14. #                                           #  
  15. #####################################################################################
  16.  
  17.  
  18. """
  19.  
  20.                                LICENSE AGREEMENT                       
  21.                                        
  22.                                            
  23.   Warning! Use this software at your own risk and consent. The Author takes no    
  24.                                            
  25.   responsibility for the use of this software in any way or the damage caused    
  26.                                            
  27.   by the use of this software to Spotify or to any other third party.
  28.  
  29.   This script has been released as a proof of concept tool and for educational
  30.  
  31.   purposes only. By using this software you agree that you are solely
  32.  
  33.   responsible for any damage caused by direct, indirect, coincidental or
  34.  
  35.    consequential use of this software.             
  36.                                            
  37.  
  38. ###############################################################################
  39. #                                                                             #
  40.  #           USAGE: ./filename [username] [password] [email-address]           #
  41.  #                                         #
  42. ###############################################################################
  43.  
  44.  
  45. """
  46.  
  47.  
  48.  
  49.  
  50. import sys, os, mechanize, cookielib, re, random
  51. from BeautifulSoup import BeautifulSoup
  52. from time import sleep
  53.  
  54.  
  55.  
  56. def printLogo():
  57.     return """
  58.     ___          _   _  __      
  59.    / __|_ __ ___| |_(_)/ _|_  _
  60.    \__ \ '_ | _ \ _| |  _| || |
  61.    |___/ .__|___/\__|_|_|  \_, |
  62.      |_|                |__/ """
  63.  
  64.  
  65.  
  66. def clear():
  67.         if os.name in ['nt', 'win32', 'dos']:
  68.             os.system('cls')
  69.         else:
  70.             os.system('clear')
  71.  
  72. def generateAccount():
  73.    
  74.     if (len(sys.argv) == 4):
  75.        
  76.         if (len(sys.argv[2]) < 6):
  77.             print "[-] Password needs to be minimum 6 characters in Length."
  78.             print "[!] Quitting."
  79.             sys.exit(1)
  80.            
  81.         clear()
  82.  
  83.                 print "######################################\n"
  84.                 print printLogo()
  85.         print "\n  Free Account Generator Version 1.2\n\n"
  86.         print "        Developed by Irenicus       \n"
  87.         print "######################################\n\n"
  88.        
  89.         sleep(2)
  90.        
  91.         print "[+] Trying to setup a new account...\n"
  92.        
  93.                 # Setting up Account details
  94.         usr = sys.argv[1]
  95.         passwd = sys.argv[2]
  96.         email = sys.argv[3]
  97.         proxySite = 'http://www.daveproxy.co.uk/'
  98.         url = "http://www.spotify.com/uk/get-spotify/go/open/"
  99.         postalCodeList = ["LN94DF", "AB252SW", "TW33HJ", "EH428IG", "SG114YO"]
  100.         postalCode = str(random.choice(postalCodeList))
  101.         birthDay = str(random.randint(1,27))
  102.         birthMonth = str(random.randint(1,12))
  103.         birthYear = str(random.randint(1950, 1990))
  104.  
  105.                 # Compiling Regex For Error Handling
  106.                 usrPattern = re.compile(r'"error">\s+We\'re sorry, that username is taken\.')
  107.                 emailPattern = re.compile(r'id="email-error"')
  108.         genList = ("male", "female")
  109.         gender = (random.choice(genList))
  110.  
  111.         # Setting cookies to maintain sessions, Yum Yum ^^
  112.         cj = cookielib.LWPCookieJar()
  113.         br = mechanize.Browser()
  114.         br.set_cookiejar(cj)
  115.        
  116.         # Instructing robots to follow orders & do our dirty work
  117.         br.set_handle_robots(False)
  118.        
  119.                 br.set_handle_redirect(True)
  120.  
  121.         # Pretending to be fake & gay
  122.         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')]
  123.        
  124.         # Shows live headers, good for testing
  125.         # br.set_debug_http(True)
  126.        
  127.         # No more comments from this point.
  128.         # Reason: no patience
  129.         html = br.open(proxySite)
  130.        
  131.         br.select_form(nr=0)
  132.        
  133.         br.form['u'] = url
  134.        
  135.         reponse1 = br.submit()
  136.            
  137.         br.select_form(nr=1)
  138.        
  139.         br.form['username'] = usr
  140.         br.form['password_new'] = passwd
  141.         br.form['password_check'] = passwd
  142.         br.form['email'] = email
  143.         br.form['postal_code'] = postalCode
  144.         br.form.find_control('gender').get(gender).selected = True
  145.         br.form.find_control('birth_day').get(birthDay).selected = True
  146.         br.form.find_control('birth_month').get(birthMonth).selected = True
  147.         br.form.find_control('birth_year').get(birthYear).selected = True
  148.         br.form.set_single(True, 'iagree')
  149.         br.form.set_single(False, 'sendemail')
  150.         br.form.set_single(False, 'thirdpartyemail')
  151.         br.form.set_single(False, 'sendsms')
  152.        
  153.         br.submit()
  154.    
  155.                 response2 = br.response().read()
  156.                
  157.                 soup = (BeautifulSoup(response2)).prettify()
  158.                
  159.                 usrMatch = usrPattern.findall(soup)
  160.                
  161.                 emailMatch = emailPattern.findall(soup)
  162.  
  163.                 if (usrMatch):
  164.                     print "[-] Username already exists\n"
  165.                     print "[!] Quitting"
  166.                     sleep(2)
  167.                     sys.exit(1)
  168.  
  169.                 if (emailMatch):
  170.                     print "[-] Email has already been taken\n"
  171.                     print "[!] Quitting"
  172.                     sleep(2)
  173.                     sys.exit(1)
  174.  
  175.  
  176.         print "[+] Account Created Successfully.\n"
  177.         print "[#] Account Details:"
  178.                 print "--------------------------------------"
  179.         print "    Username: %s" % usr
  180.         print "    Password: %s" % passwd
  181.                 print "--------------------------------------"
  182.         print "\n[*] Enjoy Free Music!"
  183.     else:
  184.         print "[-] Failed to generate account: Insufficient Arguments"
  185.         print "[*] USAGE: %s [username] [password] [email-address]" % (sys.argv[0])
  186.    
  187. if __name__ == '__main__':
  188.     generateAccount()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement