Skip to content

Commit

Permalink
changed placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
crock committed Aug 25, 2017
1 parent 2c8317e commit 7fcdb6e
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 26 deletions.
17 changes: 17 additions & 0 deletions AVAILABLE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
https://steamcommunity.com/id/%dlgkjsdkgjl%
https://steamcommunity.com/id/%kd9%
https://steamcommunity.com/id/%plague%
https://steamcommunity.com/id/%plain%
https://steamcommunity.com/id/%plan%
https://steamcommunity.com/id/%planet%
https://steamcommunity.com/id/%player%
https://steamcommunity.com/id/%plug%
https://steamcommunity.com/id/%podium%
https://steamcommunity.com/id/%poetry%
https://steamcommunity.com/id/%point%
https://steamcommunity.com/id/%police%
https://steamcommunity.com/id/%policy%
https://steamcommunity.com/id/%poodle%
https://steamcommunity.com/id/%pool%
https://steamcommunity.com/id/%pope%
https://steamcommunity.com/id/%popular%
49 changes: 27 additions & 22 deletions UsernameChecker.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Python Standard Modules
import sys
import os
import json
import re
import string
import random
Expand All @@ -16,9 +15,8 @@
OUTPUT = "AVAILABLE.txt"

# Regex Patterns
PLACEHOLDER = r"(%word%)"
URLPATT = r"(^https?:\/\/[-.a-zA-Z0-9]+)"
DOMAIN = r"\Ahttps?:\/\/([-a-zA-Z0-9]+)\.[a-zA-Z]+"
DOMAIN = r"https?:\/\/(\w*)(?(1)\.|(?(1)\w*))"

# Reads configuration file
config = configparser.ConfigParser()
Expand All @@ -34,30 +32,31 @@
# Site URLs
URLS = {
1:URL,
2:"https://api.mojang.com/users/profiles/minecraft/%word%",
3:"https://api.twitter.com/i/users/username_available.json?username=%word%",
2:"https://api.mojang.com/users/profiles/minecraft/%s",
3:"https://api.twitter.com/i/users/username_available.json?username=%s",
4:"https://instagram.com/accounts/web_create_ajax/attempt/",
5:"https://steamcommunity.com/id/%word%",
6:"https://steamcommunity.com/groups/%word%",
7:"https://soundcloud.com/%word%",
8:"https://passport.twitch.tv/usernames/%word%",
9:"https://mixer.com/api/v1/channels/%word%",
10:"https://github.com/%word%",
11:"https://about.me/%word%",
12:"https://youtube.com/%word%"
5:"https://steamcommunity.com/id/%s",
6:"https://steamcommunity.com/groups/%s",
7:"https://soundcloud.com/%s",
8:"https://passport.twitch.tv/usernames/%s",
9:"https://mixer.com/api/v1/channels/%s",
10:"https://github.com/%s",
11:"https://about.me/%s",
12:"https://youtube.com/%s"
}

# Proxy List
proxyDict = {}

s = requests.Session()

def generate_pw(size=16, chars=string.ascii_uppercase + string.digits + string.ascii_lowercase):
return ''.join(random.choice(chars) for _ in range(size))

def replace(word):
# Finds and replaces matches of the name variable with the actual word to insert in URL
if int(SITE) != 4: # if not Instagram
x = re.sub(PLACEHOLDER, word, URLS[int(SITE)])
return x
return URLS[int(SITE)] % word
else:
print("instagram")

Expand Down Expand Up @@ -146,7 +145,7 @@ def log_result(response, word, link, matches=None):
manual(response, word, service)

def get_cookie():
r = requests.get(URLS[int(SITE)])
r = s.get(URLS[int(SITE)])
return r.cookies

def ready_payload(word):
Expand All @@ -155,7 +154,7 @@ def ready_payload(word):
"email":"[email protected]",
"username": word,
"password": generate_pw(),
"first_name": "Croc"
"first_name": word
}
else:
print("Wrong site!")
Expand All @@ -176,19 +175,19 @@ def send_get(words):
link = replace(words[w])
if PROXY:
proxyDict[PROTOCOL] = get_proxy()
r = requests.get(link, proxies=proxyDict)
r = s.get(link, proxies=proxyDict)
else:
r = requests.get(link)
r = s.get(link)
log_result(r, words[w], link)

def parse_page(words):
for w in range(words.__len__()):
link = replace(words[w])
if PROXY:
proxyDict[PROTOCOL] = get_proxy()
r = requests.get(link, proxies=proxyDict)
r = s.get(link, proxies=proxyDict)
else:
r = requests.get(link)
r = s.get(link)
page = r.content
soup = BeautifulSoup(page, "html.parser")
matches = []
Expand Down Expand Up @@ -218,7 +217,13 @@ def send_post(words):
link = URLS[int(SITE)]
for w in range(words.__len__()):
payload = ready_payload(words[w])
r = requests.post(URLS[int(SITE)], json=payload, headers=header, cookies=cookie)
r = None
if PROXY:
proxyDict[PROTOCOL] = get_proxy()
r = s.post(URLS[int(SITE)], data=payload, headers=header, cookies=cookie, proxies=proxyDict)
else:
r = s.post(URLS[int(SITE)], data=payload, headers=header, cookies=cookie)

log_result(r, words[w], link)

def main():
Expand Down
9 changes: 5 additions & 4 deletions config.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; This is the configuration file for Croc's Username Checker script.
; This is the configuration file for OGCheckr CLI.
; A semicolon at the start of a line denotes a code comment.
; _________________________________
; | SERVICE | VALUE TO ENTER |
Expand All @@ -22,11 +22,11 @@
; If your target site is not listed, put "1" for CUSTOM (without the quotes).
siteNum = 5
; Fill in the option below with the profile URL of the service you want to check available names for.
; Use %%word%% as the placeholder for the username to check.
; Use %s as the placeholder for the username to check.
; customSite is only for sites not specifically listed in the chart above, but please be aware
; that not every site will work this way. If there is a service you would like to see support for, please
; don't hesistate to let Croc know.
customSite = https://example.com
customSite = https://example.com/%s

[lists]
; Be sure to include the file extension if it has one
Expand All @@ -38,7 +38,8 @@ wordList = word_lists/WORD-LIST-1
; To enable proxy support, put True. To disable, put False
enableProxy = False
; If proxy support is enabled, put http or https below depending on what type of proxies you are using.
proxyProtocol = http
proxyProtocol = https
; If proxy support is enabled, you must specify the path to the proxy list you want to use here
; Place all proxy lists in the proxy_lists directory
; Place one proxy per line in the this format "###.###.###.###:####"
proxyList = proxy_lists/proxies.txt

0 comments on commit 7fcdb6e

Please sign in to comment.