You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

228 lines
8.1 KiB

import random
import subprocess
from getopt import getopt
from os import chdir
from os.path import abspath, dirname
from sys import argv
from time import sleep
# Gör fb-scraper till arbetsmapp
chdir(dirname(dirname(abspath(__file__))))
from arangodb import arango_connect, used_servers
from config import *
from helpers import now
def profile_generator(db, n=1, bulk=False):
cursor = db.aql.execute(
"""
FOR doc IN @@col
FILTER doc._to == 'members/krisjohngethin'
RETURN doc._from
""",
bind_vars={"@col": "picture_reactions"},
)
count = 0
first_names = []
last_names = []
n = int(n) + 1
for doc in cursor:
name = db.collection("members").get(doc)["name"]
first_names.append(name[: name.find(" ")])
last_names.append(name[name.rfind(" ") :])
with open("data/passwords.txt") as f:
words = [word for word in f.readlines()]
servers_used = used_servers()
with open("data/servers.txt") as f:
servers = []
while len(servers) < n:
for line in f.readlines():
if "@" in line:
line = line.strip()
city = line[: line.find("@")].strip()
if "WireGuard" in line and line.strip()[:2] in [
"gb",
"us",
]: # "au", "ca" #För senare när det behövs
line = line.strip()
country_short = line[:2]
server = line[: line.find("-")]
# Kolla så att servern inte redan används av profil i databasen
# eller finns i listan som skapas nu.
if server not in servers_used and server not in servers:
city_short = city[city.find("(") + 1 : city.find(")")]
server_name = [country_short, city_short, server + "-wireguard"]
servers.append(
{
"server_city": city,
"server": server + "-wg.socks5.mullvad.net:1080",
"server_connect": server_name,
}
)
count = 0
for i in range(0, n - 1):
name = (
first_names[random.randrange(0, len(first_names), 1)].strip()
+ " "
+ last_names[random.randrange(0, len(last_names), 1)].strip()
)
print(name, end="\r")
sleep(0.1)
year = str(random.randrange(74, 90))
email = name.lower().replace(" ", ".") + year + "@outlook.com"
pwd = ""
for _ in range(0, random.randrange(3, 6)):
w = words[random.randrange(0, 10000, 1)].strip()
if random.randrange(0, 3) == 0:
w = w.upper()
pwd = pwd + "_" + w
pwd = pwd.strip("_") + str(random.randrange(5, 35))
server_info = servers.pop(random.randrange(0, len(servers)))
server = server_info["server"].strip()
birthday = f"{year}-{random.randrange(1, 13)}-{random.randrange(1, 30)}"
_key = server[: server.find("-")]
doc = {
"_id": "profiles/" + _key,
"_key": _key,
"name": name,
"email": email,
"pwd": pwd,
"server": server,
"server_connect": server_info["server_connect"],
"birthday": birthday,
"created": False,
"in_use": False,
}
# Skriv till databasen (skriver inte profiler med servarar som redan används)
if bulk == True:
try:
db.insert_document("profiles", doc)
count += 1
except:
pass
print(f"Skrev {count} profiler till databasen. ")
else:
return doc
def mullvad(server):
""" Anslut till Mullvad-server. """
sleep(2)
subprocess.run(
[
"mullvad",
"relay",
"set",
"location",
server[0],
server[1],
server[2],
]
)
connect_to_mullvad = subprocess.Popen(["mullvad", "connect"])
connect_to_mullvad.wait()
sleep(3)
def close_browser():
subprocess.run(["osascript", "-e", 'quit app "Brave Browser"'])
subprocess.run(["osascript", "-e", 'quit app "Opera"'])
def create_profile():
""" Supports during the creation of a profile """
arango_server = ["se", "sto", "se2-wireguard"]
while True:
mullvad(arango_server)
sleep(2)
# Hämta profil
db = arango_connect(pwd)
profile = profile_generator(db)
# Asnlut till profilens VPN-server
mullvad(profile["server_connect"])
# Öppna Brave med Outlook och Facebook
subprocess.run(["open", "-a", "Brave Browser", "https://outlook.com"])
# Printa användaruppgfifter för Outlook och Facebook
print()
print(profile["email"][: profile["email"].find("@")])
print(profile["pwd"])
print(profile["birthday"])
print(profile["name"])
print()
print(profile["name"])
print(profile["email"])
print(profile["pwd"])
print(profile["birthday"])
user_input = input("Done/Next/Delete/Quit: ")
user_input = user_input.lower()
if user_input in ["done", "d", ""]:
close_browser()
sleep(1)
profile["created"] = True
mullvad(arango_server)
sleep(3)
db = arango_connect(pwd)
db.update_document('profiles', profile)
elif user_input in ["delete", "d"]:
close_browser()
mullvad(arango_server)
db = arango_connect(pwd)
blocked = db.collection("profiles").delete(profile['_key'])
blocked['_id'] = 'block_created/' + now()
blocked['key'] = now()
sleep(2)
db = arango_connect(pwd)
db.insert_document("block_created", blocked)
elif user_input in ["quit", "q"]:
close_browser()
close_browser()
mullvad(arango_server)
exit()
else:
sleep(3)
db = arango_connect(pwd)
continue
if __name__ == "__main__":
print(__file__)
# Det här ska köras lokalt så löseordet finns i fil
with open('password_arango.txt') as f:
pwd = f.readline()
db = arango_connect(pwd)
argv = argv[1:]
opts, args = getopt(argv, "cg:", ["create", "generate"])
for o, a in opts:
if o in ["-g", "--generate"]:
profile_generator(db, a)
if o in ['-c', '--create']:
create_profile()
[{'domain': '.facebook.com', 'httpOnly': False, 'name': 'x-referer', 'path': '/', 'sameSite': 'None', 'secure': True, 'value': 'eyJyIjoiL2NvbmZpcm1lbWFpbC5waHA%2Fc29mdD1oamsiLCJoIjoiL2NvbmZpcm1lbWFpbC5waHA%2Fc29mdD1oamsiLCJzIjoibSJ9'}, {'domain': '.facebook.com', 'expiry': 1649728634, 'httpOnly': True, 'name': 'xs', 'path': '/', 'secure': True, 'value': '2%3AZrCj3xPTmzApJw%3A2%3A1618192633%3A-1%3A-1'}, {'domain': '.facebook.com', 'expiry': 1649728634, 'httpOnly': False, 'name': 'c_user', 'path': '/', 'secure': True, 'value': '100066462633263'}, {'domain': '.facebook.com', 'expiry': 1618797592, 'httpOnly': False, 'name': 'wd', 'path': '/', 'sameSite': 'None', 'secure': True, 'value': '994x534'}, {'domain': '.facebook.com', 'httpOnly': False, 'name': 'm_pixel_ratio', 'path': '/', 'secure': True, 'value': '1.25'}, {'domain': '.facebook.com', 'expiry': 1625968625, 'httpOnly': True, 'name': 'fr', 'path': '/', 'secure': True, 'value': '16Qhs4a4NEktNwlhZ.AWXIpZOVbupyu5pAidanfvTaWIc.Bgc6jD.C2.AAA.0.0.Bgc6jy.AWXCdEVJ7k4'}, {'domain': '.facebook.com', 'expiry': 1681264643, 'httpOnly': True, 'name': 'sb', 'path': '/', 'secure': True, 'value': 'w6hzYAXTtE1avdx0LoFIrHox'}, {'domain': '.facebook.com', 'expiry': 1681264587, 'httpOnly': True, 'name': 'datr', 'path': '/', 'secure': True, 'value': 'w6hzYONZsuS635di6pHBZV7D'}]