Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
kybernetyk committed Mar 18, 2012
0 parents commit 1a63452
Show file tree
Hide file tree
Showing 5 changed files with 136 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
@@ -0,0 +1,3 @@
decaptcha_creds
selenium*
*.pyc
31 changes: 31 additions & 0 deletions README
@@ -0,0 +1,31 @@
REAC - reddit account creator
=============================

A little python script for mass reddit account creation. Fucking hipsters!

deps:
- curl
- selenium standalone server + selenium webdriver
- a de-captcher.com account

INSTALLATION
------------
1. get curl
2. get selenium (seleniumhq.org)
3. get your de-captcher.com credentials and create a file named
"decaptcha_creds" with your login:password.

USAGE
-----
1) run ./captcha.py to check if your re-captcha.com credentials are right
2) edit reac.py: change 'username' and 'password' to your desired account username/password
3) run ./reac.py
4) ...
5) profit

IDEA
----
Automate this and use TOR or proxies. :3

(C) Leon Szpilewski, GPL3, leon.szpilewski@gmail.com

50 changes: 50 additions & 0 deletions captcha.py
@@ -0,0 +1,50 @@
#!/usr/bin/env python

import urllib2, os
from StringIO import StringIO
import subprocess

def curl(*args):
curl_path = '/usr/bin/curl'
curl_list = [curl_path]
for arg in args:
# loop just in case we want to filter args in future.
curl_list.append(arg)
curl_result = subprocess.Popen(
curl_list,
stderr=subprocess.PIPE,
stdout=subprocess.PIPE).communicate()[0]
return curl_result

def solve(captcha_url):
captcha_path = download_captcha(captcha_url);
solved_captcha = call_solver(captcha_path)
os.remove(captcha_path)
return solved_captcha

def call_solver(captcha_img_path):
creds = open("decaptcha_creds","r").read().rstrip('\n').split(':')

resp = curl('-F', 'function=picture2',
'-F', 'username=' + creds[0],
'-F', 'password=' + creds[1],
'-F', 'pict=@'+captcha_img_path,
'-F', 'pict_to=0',
'-F', 'pict_type=0',
'http://poster.de-captcher.com')
return resp.split('|')[5]

def download_captcha(url):
tempfn = os.path.basename(url)
captcha = urllib2.urlopen(url)
f = file(tempfn, "wb")
f.write(captcha.read())
f.close()
return tempfn

def main():
solved = solve("http://www.reddit.com/captcha/Y1GE8H32Q5SOTi9QWGlfHwevrfNSZMyd.png")
print "the solved captcha is: " + solved

if __name__ == '__main__':
main()
49 changes: 49 additions & 0 deletions reac.py
@@ -0,0 +1,49 @@
#!/usr/bin/env python

###################################################################
#
# Reddit Account Creator
#
# deps:
# -selenium
# -firefox
# -de-captcher.com account
#
# license: GPL3 (c) Leon Szpilewski
#
###################################################################
from selenium import webdriver
import captcha

username = "archlocherlol"
password = "warbird"

# don't change anything below

browser = webdriver.Firefox()

browser.get('http://reddit.com');
browser.get(browser.find_element_by_class_name('login-required').get_attribute('href'))

browser.find_element_by_id('user_reg').click()
browser.find_element_by_id('user_reg').send_keys(username)

browser.find_element_by_id('passwd_reg').click()
browser.find_element_by_id('passwd_reg').send_keys(password)

browser.find_element_by_id('passwd2_reg').click()
browser.find_element_by_id('passwd2_reg').send_keys(password)

captcha_url = browser.find_element_by_class_name('capimage').get_attribute('src')
solved_captcha = captcha.solve(captcha_url)

browser.find_element_by_id('captcha_').click()
browser.find_element_by_id('captcha_').send_keys(solved_captcha)

for btn in browser.find_elements_by_class_name('button'):
if btn.text == 'create account':
btn.click()
break
else:
print "couldn't find button!"

3 changes: 3 additions & 0 deletions run_selenium.sh
@@ -0,0 +1,3 @@
#!/bin/sh

java -jar selenium-server-standalone-2.20.0.jar

0 comments on commit 1a63452

Please sign in to comment.