From 1a63452b274da46d3c0505f95051b1abb81d507d Mon Sep 17 00:00:00 2001 From: Leon Szpilewski Date: Sun, 18 Mar 2012 16:18:59 +0100 Subject: [PATCH] Initial Commit --- .gitignore | 3 +++ README | 31 ++++++++++++++++++++++++++++++ captcha.py | 50 +++++++++++++++++++++++++++++++++++++++++++++++++ reac.py | 49 ++++++++++++++++++++++++++++++++++++++++++++++++ run_selenium.sh | 3 +++ 5 files changed, 136 insertions(+) create mode 100644 .gitignore create mode 100644 README create mode 100755 captcha.py create mode 100755 reac.py create mode 100755 run_selenium.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..84e1567 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +decaptcha_creds +selenium* +*.pyc diff --git a/README b/README new file mode 100644 index 0000000..6c4228b --- /dev/null +++ b/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 + diff --git a/captcha.py b/captcha.py new file mode 100755 index 0000000..b451e15 --- /dev/null +++ b/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() diff --git a/reac.py b/reac.py new file mode 100755 index 0000000..c0c780c --- /dev/null +++ b/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!" + diff --git a/run_selenium.sh b/run_selenium.sh new file mode 100755 index 0000000..dd1ee62 --- /dev/null +++ b/run_selenium.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +java -jar selenium-server-standalone-2.20.0.jar