commit
3772bf3ccc
12 changed files with 475 additions and 599 deletions
@ -0,0 +1,290 @@ |
|||||||
|
""" Import profiles from accsmarket """ |
||||||
|
|
||||||
|
from os import chdir |
||||||
|
from getpass import getpass |
||||||
|
from os.path import abspath, dirname |
||||||
|
from random import randint |
||||||
|
from time import sleep |
||||||
|
import base64 |
||||||
|
import json |
||||||
|
import requests |
||||||
|
|
||||||
|
# Gör fb-scraper till arbetsmapp |
||||||
|
chdir(dirname(dirname(abspath(__file__)))) |
||||||
|
|
||||||
|
from arangodb import arango_connect |
||||||
|
import config |
||||||
|
from helpers import now, nowstamp |
||||||
|
|
||||||
|
def mullvad_servers_to_db(db): |
||||||
|
""" Läser fil med servarar och exporterar till db. Används bara om servarna skulle uppdateras hos Mullvad. """ |
||||||
|
with open("data/servers.txt") as f: |
||||||
|
for line in f.readlines(): |
||||||
|
if "@" in line: |
||||||
|
line = line.strip() |
||||||
|
city = line[: line.find("@")].strip() |
||||||
|
|
||||||
|
if ("WireGuard" in line): # "au", "ca" #För senare när det behövs |
||||||
|
line = line.strip() |
||||||
|
country_short = line[:2] |
||||||
|
server_id = line[: line.find("-")] |
||||||
|
|
||||||
|
# Kolla så att servern inte redan används av profil i databasen |
||||||
|
# eller finns i listan som skapas nu. |
||||||
|
city_short = city[city.find("(") + 1 : city.find(")")] |
||||||
|
server_name = [country_short, city_short, server_id + "-wireguard"] |
||||||
|
server = { |
||||||
|
'_key': server_id, |
||||||
|
'country': country_short, |
||||||
|
"city": city, |
||||||
|
"id": server_id, |
||||||
|
"server": server_id + "-wg.socks5.mullvad.net:1080", |
||||||
|
"server_connect": server_name,} |
||||||
|
db.insert_document('servers', server) |
||||||
|
sleep(0.1) |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def servers_to_db(db, server_collection, socks='socks5'): |
||||||
|
""" Läser fil med servarar och exporterar till db. """ |
||||||
|
with open("socks5free.csv") as f: |
||||||
|
for line in f.readlines(): |
||||||
|
server = line.split(';')[1] |
||||||
|
db.insert_document(server_collection, {'_key':server, 'proxies': {"https": f"{socks}://{server}", |
||||||
|
"http": f"{socks}://{server}"}, 'country': False}) |
||||||
|
sleep(0.1) |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def used_emails(db, collection): |
||||||
|
cursor = db.aql.execute( |
||||||
|
""" |
||||||
|
FOR doc IN @@col |
||||||
|
RETURN doc.email |
||||||
|
""", |
||||||
|
bind_vars={'@col': collection}) |
||||||
|
return [email for email in cursor] |
||||||
|
|
||||||
|
def get_server(db, country, test=False, servers='servers', profiles='profiles'): |
||||||
|
""" Hämtar en server åt profilen """ |
||||||
|
if country == 'any': |
||||||
|
cursor = db.aql.execute( |
||||||
|
""" |
||||||
|
FOR doc IN @@col |
||||||
|
FILTER doc.country not in ['us', 'se'] |
||||||
|
RETURN {proxies: doc.proxies, country: doc.country, id: doc.id, _key:doc._key, city:doc.city, server:doc.server, server_connect:doc.server_connect} |
||||||
|
""", bind_vars={'@col': servers}) |
||||||
|
else: |
||||||
|
cursor = db.aql.execute( |
||||||
|
""" |
||||||
|
FOR doc IN @@servers |
||||||
|
FILTER doc.country == @country |
||||||
|
RETURN {proxies: doc.proxies, country: doc.country, id: doc.id, _key:doc._key, city:doc.city, server:doc.server, server_connect:doc.server_connect} |
||||||
|
""", |
||||||
|
bind_vars={'country': country, '@servers': servers} |
||||||
|
) |
||||||
|
|
||||||
|
servers = [] |
||||||
|
used = used_servers(test, profiles) |
||||||
|
for server in cursor: |
||||||
|
if server['_key'] not in used: |
||||||
|
servers.append(server) |
||||||
|
if servers != []: |
||||||
|
server = servers[randint(0, len(servers)-1)] |
||||||
|
return server |
||||||
|
|
||||||
|
|
||||||
|
def to_accs(db, vendors, accs, profiles): |
||||||
|
""" |
||||||
|
Ta profiles från köpt fil och lägg i accs |
||||||
|
""" |
||||||
|
|
||||||
|
file = input('Lägg filen här ').strip("'").strip() |
||||||
|
vendor = str(file[file.rfind('-')+1:file.rfind('.')]) |
||||||
|
sep = vendors[vendor]['sep'] |
||||||
|
info = vendors[vendor]['info'].split(':') |
||||||
|
|
||||||
|
used_accs = used_emails(db, accs) |
||||||
|
used_profiles = used_emails(db, profiles) |
||||||
|
|
||||||
|
|
||||||
|
with open(file) as f: |
||||||
|
for line in f: |
||||||
|
line = line.replace("https:", "https;") |
||||||
|
l = line.split(sep) |
||||||
|
# c = 0 |
||||||
|
# for i in l: |
||||||
|
# c += 1 |
||||||
|
# print(c) |
||||||
|
# print(i) |
||||||
|
# print() |
||||||
|
doc = {} |
||||||
|
doc["vendor"] = vendor |
||||||
|
doc["created"] = now() |
||||||
|
if 'email' in info: |
||||||
|
doc['email'] = l[info.index('email')] |
||||||
|
elif 'login' in info: |
||||||
|
doc['email'] = l[info.index('login')] |
||||||
|
if doc['email'] in used_accs or doc['email'] in used_profiles: |
||||||
|
continue |
||||||
|
doc['name'] = doc['email'] |
||||||
|
if 'pwd' in info: |
||||||
|
doc["pwd"] = l[info.index('pwd')] |
||||||
|
else: |
||||||
|
doc["pwd"] = '' |
||||||
|
if 'url' in info: |
||||||
|
doc['id'] = l[info.index('url')].replace("https;", "https:") |
||||||
|
if "useragent" in info: |
||||||
|
doc["useragent"] = l[info.index('useragent')].strip() |
||||||
|
else: |
||||||
|
doc["useragent"] = config.user_agent |
||||||
|
if 'cookie' in info: |
||||||
|
cookies = l[info.index('cookie')] |
||||||
|
|
||||||
|
if 'c_user=' in cookies: |
||||||
|
cookie = {} |
||||||
|
for c in cookies.split(';'): |
||||||
|
cookie[c[:c.find('=')].strip()] = c[c.find('=') + 1:].strip() |
||||||
|
else: |
||||||
|
cookies_base64 = cookies.strip()#.strip('=') |
||||||
|
# print() |
||||||
|
# print(cookies_base64) |
||||||
|
# print() |
||||||
|
cookies64_bytes = cookies_base64.encode("ascii") |
||||||
|
cookies_bytes = base64.b64decode(cookies64_bytes) |
||||||
|
#exit() |
||||||
|
cookies_str = ( |
||||||
|
cookies_bytes.decode("ascii") |
||||||
|
.replace("'", '"') |
||||||
|
.replace("False", "false") |
||||||
|
.replace("True", "true") |
||||||
|
) |
||||||
|
cookies = json.loads(cookies_str) |
||||||
|
cookie = {} |
||||||
|
if vendor == '159': |
||||||
|
for c in cookies['cookies']: |
||||||
|
cookie[c['name']] = c['value'] |
||||||
|
else: |
||||||
|
for c in cookies: |
||||||
|
name = c["name"] |
||||||
|
del c["name"] |
||||||
|
cookie[name] = c["value"] |
||||||
|
doc['cookie'] = cookie |
||||||
|
else: |
||||||
|
cookie = {} |
||||||
|
if 'birthday' in info: |
||||||
|
doc["birthday"] = l[info.index('birthday')] |
||||||
|
if 'token' in info: |
||||||
|
doc['token'] = l[info.index('token')].strip() |
||||||
|
db.insert_document(accs, doc) |
||||||
|
sleep(0.1) |
||||||
|
|
||||||
|
def to_profiles(db, test, accs='accs', profiles='profiles', country='us', servers='servers'): |
||||||
|
""" Tar en prifil från accs och en server från servers och lägger in i profiles """ |
||||||
|
count = 0 |
||||||
|
for profile in [i for i in db.collection(accs).all()]: |
||||||
|
count +=1 |
||||||
|
if profile['email'] in used_emails(db, profiles): |
||||||
|
continue |
||||||
|
id_acc = profile['_id'] |
||||||
|
del profile['_id'] |
||||||
|
del profile['_rev'] |
||||||
|
server = get_server(db, country, test, servers, profiles) |
||||||
|
if server == None: |
||||||
|
print(f'Inlagda profiler: {count}\nInga fler lediga servrar.') |
||||||
|
break |
||||||
|
profile["server"] = server["server"] |
||||||
|
profile["server_connect"] = server["server_connect"] |
||||||
|
profile["_key"] = server["_key"]#.replace(':', '') |
||||||
|
profile["in_use"] = nowstamp() |
||||||
|
profile['proxies'] = server['proxies'] |
||||||
|
if test: |
||||||
|
profile["in_use"] = nowstamp() - 1200 |
||||||
|
db.insert_document(profiles, profile) |
||||||
|
sleep(0.1) |
||||||
|
db.delete_document(id_acc) |
||||||
|
print('Inlagda profiler:', count, end='\r') |
||||||
|
|
||||||
|
|
||||||
|
def used_servers(test=False, profiles='profiles'): |
||||||
|
cursor = db.aql.execute( |
||||||
|
""" |
||||||
|
FOR doc IN @@col |
||||||
|
RETURN doc._key |
||||||
|
""", |
||||||
|
bind_vars={'@col': profiles} |
||||||
|
) |
||||||
|
servers = [doc for doc in cursor] |
||||||
|
return servers |
||||||
|
|
||||||
|
|
||||||
|
def webshare_proxies(): |
||||||
|
"""Get list of webshare-proxies.""" |
||||||
|
|
||||||
|
proxielist = requests.get('https://proxy.webshare.io/proxy/list/download/sompzungcbajbeqmxoopddsthzarqlewjgraicog/-/http/port/direct/') |
||||||
|
|
||||||
|
proxies = {} |
||||||
|
count = 0 |
||||||
|
|
||||||
|
for line in proxielist.text.split('\n'): |
||||||
|
count += 1 |
||||||
|
proxie = line.replace('\r', '').split(':') |
||||||
|
if proxie != ['']: |
||||||
|
server = proxie[0] |
||||||
|
port = proxie[1] |
||||||
|
proxies[count] = {'server': server, 'port': port} |
||||||
|
|
||||||
|
|
||||||
|
for _, proxie in proxies.items(): |
||||||
|
proxies={'https':'socks5://xigpxrzr:ezgjcwr8lonj@{server}:{port}'.format(server=proxie['server'], port=proxie['port']), |
||||||
|
'http':'socks5://xigpxrzr:ezgjcwr8lonj@{server}:{port}'.format(server=proxie['server'], port=proxie['port']) |
||||||
|
} |
||||||
|
|
||||||
|
try: |
||||||
|
db.insert_document('servers_webshare', {'_key':proxie['server'], 'proxies': proxies, 'country': 'us'}) |
||||||
|
except: |
||||||
|
pass |
||||||
|
|
||||||
|
if __name__ == "__main__": |
||||||
|
|
||||||
|
vendors = { |
||||||
|
'1152': {'info': 'login:password:cookie:token', 'sep': '|'}, |
||||||
|
'1091': {'info': 'login:password:birthday:url:cookie', 'sep': ':'}, |
||||||
|
'1113': {'info': 'login:password:mail:password:birthday:country:useragent:token:cookie', 'sep': '|'}, |
||||||
|
'926': {'info': 'login:password:email:email password:birthday:token:cookie', 'sep': '|'} , |
||||||
|
#'1113': {'info': 'login:mail:password:emailpassword:birthday:useragent:token:cookie', 'sep': '|'}, |
||||||
|
'159': {'info': 'login:password:birthday:id:cookie', 'sep':':'} |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
# Det här ska köras lokalt så löseordet finns i fil |
||||||
|
try: |
||||||
|
with open("password_arango.txt") as f: |
||||||
|
pwd = f.readline() |
||||||
|
except: |
||||||
|
pwd = getpass('Lösenord för Accs: ').strip() |
||||||
|
|
||||||
|
db = arango_connect(pwd, username='Accs') |
||||||
|
§ |
||||||
|
############################### |
||||||
|
### Variabler att ställa in ### |
||||||
|
country='us' |
||||||
|
test = False |
||||||
|
profiles = 'profiles_webshare' # ex profiles_free |
||||||
|
servers = 'servers_webshare' |
||||||
|
############################### |
||||||
|
|
||||||
|
|
||||||
|
accs = 'accs' |
||||||
|
if test: |
||||||
|
profiles='profiles_test' |
||||||
|
accs='accs_test' |
||||||
|
|
||||||
|
#to_accs(db, vendors, accs=accs, profiles=profiles) ## Den här för att lägga in nyköpta profiler |
||||||
|
#webshare_proxies() ## Den här för att uppdatera servers hos webshare |
||||||
|
|
||||||
|
# Kombinera köpt profil med server och lägg i profiles |
||||||
|
to_profiles(db, test, accs=accs, profiles=profiles, country=country, servers=servers) |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -0,0 +1,24 @@ |
|||||||
|
import re |
||||||
|
from time import sleep |
||||||
|
from getpass import getpass |
||||||
|
|
||||||
|
from bs4 import BeautifulSoup |
||||||
|
from arango import ArangoClient |
||||||
|
import requests |
||||||
|
from urllib.parse import urlencode |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def check_ip(): |
||||||
|
""" |
||||||
|
Checks the current IP. |
||||||
|
""" |
||||||
|
url = f'https://mrkoll.se/resultat?n={46706111785}' |
||||||
|
proxies = {'https': 'http://sgz2bkt7:TtLyyPGKMmjabg7R_country-Sweden@proxy.proxy-cheap.com:31112'} |
||||||
|
ip = requests.get(url, proxies=proxies).text |
||||||
|
|
||||||
|
return ip |
||||||
|
|
||||||
|
print(check_ip()) |
||||||
|
|
||||||
|
|
||||||
@ -0,0 +1,104 @@ |
|||||||
|
""" |
||||||
|
Skript för att söka i FB-läckan. |
||||||
|
""" |
||||||
|
|
||||||
|
import re |
||||||
|
import paramiko |
||||||
|
import arangodb |
||||||
|
from getpass import getpass |
||||||
|
from sshtunnel import open_tunnel |
||||||
|
import paramiko |
||||||
|
from termcolor import cprint |
||||||
|
|
||||||
|
def search(db, attribute, value): |
||||||
|
""" |
||||||
|
Search for attribute in db. |
||||||
|
Returns list of matching documents. |
||||||
|
""" |
||||||
|
|
||||||
|
if '%' in value or '_' in value: |
||||||
|
match = 'like' |
||||||
|
else: |
||||||
|
match = '==' |
||||||
|
|
||||||
|
cursor = db.aql.execute( |
||||||
|
f""" |
||||||
|
FOR doc IN leak |
||||||
|
FILTER doc.@attribute {match} @value |
||||||
|
RETURN doc |
||||||
|
""", |
||||||
|
bind_vars={"attribute": attribute, "value": value}, |
||||||
|
) |
||||||
|
return [doc for doc in cursor] |
||||||
|
|
||||||
|
pwd_key = getpass(f"Password key: ") |
||||||
|
|
||||||
|
with open_tunnel( |
||||||
|
("studio-garda.asuscomm.com", 2200), |
||||||
|
ssh_username="Lasse", |
||||||
|
ssh_pkey=paramiko.RSAKey.from_private_key_file( |
||||||
|
"/Users/Lasse/.ssh/id_rsa", password=pwd_key |
||||||
|
), |
||||||
|
ssh_private_key_password=pwd_key, |
||||||
|
remote_bind_address=("127.0.0.1", 8529), |
||||||
|
) as server: |
||||||
|
# server.start() |
||||||
|
port_arango = server.local_bind_port |
||||||
|
|
||||||
|
db = arangodb.arango_connect( |
||||||
|
"gruel-ADOBE-foolish-winy-borax", |
||||||
|
username="Leak", |
||||||
|
host_arango="http://127.0.0.1", |
||||||
|
port_arango=port_arango, |
||||||
|
) |
||||||
|
|
||||||
|
cprint("\n\nVad vill du söka efter?", attrs=['bold']) |
||||||
|
print("1 - Telefonnummer") |
||||||
|
print("2 - Facebook-ID") |
||||||
|
print('3 - Namn') |
||||||
|
print("4 - Arbete") |
||||||
|
print('5 - Bostadsort') |
||||||
|
print("6 - Födelseort") |
||||||
|
print("7 - Epost") |
||||||
|
|
||||||
|
# Få input för attribut |
||||||
|
attribute = input("\n>>> ") |
||||||
|
attributes = { |
||||||
|
"1": ("telefonnummer", "phone"), |
||||||
|
"2": ("Facebook-ID", "_key"), |
||||||
|
"3": ("namn", "full_name"), |
||||||
|
"4": ("arbete", "work"), |
||||||
|
"5": ('bostadsort', "lives_in"), |
||||||
|
"6": ('födelseort', 'from'), |
||||||
|
"7": ('epost', 'email') |
||||||
|
} |
||||||
|
|
||||||
|
# Bestäm n- eller t-form och få input för värde. |
||||||
|
if attribute in ['5', '6', '7']: |
||||||
|
genus = 'n' |
||||||
|
else: |
||||||
|
genus = 't' |
||||||
|
|
||||||
|
cprint(f"\nVilke{genus} {attributes[attribute][0]}? ", attrs=['bold']) |
||||||
|
cprint('Använd % för att ersätta flera okända tecken, _ för att ersätta ett.', attrs=['dark']) |
||||||
|
value = input('\n>>> ') |
||||||
|
|
||||||
|
if attribute == '1': # telefonnummer |
||||||
|
value = ''.join(re.findall(r'\d+', value)) |
||||||
|
if value[0] == '0': |
||||||
|
value = f'46{value[1:]}' |
||||||
|
elif attribute == '3': # namn |
||||||
|
value = value.upper() |
||||||
|
|
||||||
|
# Sök i databasen. |
||||||
|
result = search(db, attributes[attribute][1], value) |
||||||
|
|
||||||
|
# Presentera reultaten #TODO hur vill man få dem? Spara ner? |
||||||
|
for i in result: |
||||||
|
print('\n', i['full_name']) |
||||||
|
for key, value in i.items(): |
||||||
|
print(f'{key}: {value}') |
||||||
|
print(f'https://facebook.com/{i["_key"]}') |
||||||
|
|
||||||
|
print(f'\nAntal träffar: {len(result)}\n') |
||||||
|
|
||||||
|
unable to load file from head commit
|
Loading…
Reference in new issue