|
|
|
@ -88,16 +88,21 @@ def to_accs(db, data, info, profiles, vendor, accs="accs"): |
|
|
|
n1 = 0 |
|
|
|
n1 = 0 |
|
|
|
|
|
|
|
|
|
|
|
for profile in data: |
|
|
|
for profile in data: |
|
|
|
|
|
|
|
|
|
|
|
if len(profile) < 3: |
|
|
|
if len(profile) < 3: |
|
|
|
continue |
|
|
|
continue |
|
|
|
|
|
|
|
|
|
|
|
doc = {} |
|
|
|
doc = {} |
|
|
|
doc["vendor"] = vendor |
|
|
|
doc["vendor"] = vendor |
|
|
|
doc["created"] = now() |
|
|
|
doc["created"] = now() |
|
|
|
|
|
|
|
|
|
|
|
if "email" in info: |
|
|
|
if "email" in info: |
|
|
|
doc["email"] = profile[info.index("email")] |
|
|
|
doc["email"] = profile[info.index("email")] |
|
|
|
|
|
|
|
|
|
|
|
elif "login" in info: |
|
|
|
elif "login" in info: |
|
|
|
doc["email"] = profile[info.index("login")] |
|
|
|
doc["email"] = profile[info.index("login")] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if doc["email"] in used_accs or doc["email"] in used_profiles: |
|
|
|
if doc["email"] in used_accs or doc["email"] in used_profiles: |
|
|
|
n1 += 1 |
|
|
|
n1 += 1 |
|
|
|
continue |
|
|
|
continue |
|
|
|
@ -120,11 +125,9 @@ def to_accs(db, data, info, profiles, vendor, accs="accs"): |
|
|
|
for c in cookies.split(";"): |
|
|
|
for c in cookies.split(";"): |
|
|
|
cookie[c[: c.find("=")].strip()] = c[c.find("=") + 1 :].strip() |
|
|
|
cookie[c[: c.find("=")].strip()] = c[c.find("=") + 1 :].strip() |
|
|
|
else: |
|
|
|
else: |
|
|
|
try: |
|
|
|
#try: |
|
|
|
cookies_base64 = cookies.strip() # .strip('=') |
|
|
|
cookies_base64 = cookies.strip() # .strip('=') |
|
|
|
# print() |
|
|
|
|
|
|
|
# print(cookies_base64) |
|
|
|
|
|
|
|
# print() |
|
|
|
|
|
|
|
cookies64_bytes = cookies_base64.encode("ascii") |
|
|
|
cookies64_bytes = cookies_base64.encode("ascii") |
|
|
|
cookies_bytes = base64.b64decode(cookies64_bytes) |
|
|
|
cookies_bytes = base64.b64decode(cookies64_bytes) |
|
|
|
# exit() |
|
|
|
# exit() |
|
|
|
@ -134,23 +137,33 @@ def to_accs(db, data, info, profiles, vendor, accs="accs"): |
|
|
|
.replace("False", "false") |
|
|
|
.replace("False", "false") |
|
|
|
.replace("True", "true") |
|
|
|
.replace("True", "true") |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
if vendor in ["827"]: |
|
|
|
|
|
|
|
cookies = {} |
|
|
|
|
|
|
|
for c in cookies_str.split(';'): |
|
|
|
|
|
|
|
cookies[c[:c.find('=')]] = c[c.find('=')+1:] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
else: |
|
|
|
cookies = json.loads(cookies_str) |
|
|
|
cookies = json.loads(cookies_str) |
|
|
|
|
|
|
|
|
|
|
|
cookie = {} |
|
|
|
cookie = {} |
|
|
|
if vendor == "159": |
|
|
|
if vendor in ["159"]: |
|
|
|
for c in cookies["cookies"]: |
|
|
|
for c in cookies["cookies"]: |
|
|
|
cookie[c["name"]] = c["value"] |
|
|
|
cookie[c["name"]] = c["value"] |
|
|
|
|
|
|
|
elif vendor in ["827"]: |
|
|
|
|
|
|
|
cookie = cookies |
|
|
|
else: |
|
|
|
else: |
|
|
|
for c in cookies: |
|
|
|
for c in cookies: |
|
|
|
name = c["name"] |
|
|
|
name = c["name"] |
|
|
|
del c["name"] |
|
|
|
del c["name"] |
|
|
|
cookie[name] = c["value"] |
|
|
|
cookie[name] = c["value"] |
|
|
|
doc["cookie"] = cookie |
|
|
|
doc["cookie"] = cookie |
|
|
|
except Exception as e: |
|
|
|
# except Exception as e: |
|
|
|
print('\n\nFel på cookie.\n', e, '\n') |
|
|
|
# print('\n\nFel på cookie.\n', e, '\n') |
|
|
|
for i in profile: |
|
|
|
# for i in profile: |
|
|
|
print(i) |
|
|
|
# print(i) |
|
|
|
continue |
|
|
|
|
|
|
|
|
|
|
|
# exit() |
|
|
|
|
|
|
|
|
|
|
|
else: |
|
|
|
else: |
|
|
|
cookie = {} |
|
|
|
cookie = {} |
|
|
|
if "birthday" in info: |
|
|
|
if "birthday" in info: |
|
|
|
@ -163,7 +176,6 @@ def to_accs(db, data, info, profiles, vendor, accs="accs"): |
|
|
|
|
|
|
|
|
|
|
|
print(f'\nInlagda profiler: {n0}\nProfiler redan i db: {n1}') |
|
|
|
print(f'\nInlagda profiler: {n0}\nProfiler redan i db: {n1}') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def used_servers(profiles="profiles"): |
|
|
|
def used_servers(profiles="profiles"): |
|
|
|
cursor = db.aql.execute( |
|
|
|
cursor = db.aql.execute( |
|
|
|
""" |
|
|
|
""" |
|
|
|
@ -231,7 +243,9 @@ if __name__ == "__main__": |
|
|
|
}, |
|
|
|
}, |
|
|
|
#'1113': {'info': 'login:mail:password:emailpassword:birthday:useragent:token:cookie', 'sep': '|'}, |
|
|
|
#'1113': {'info': 'login:mail:password:emailpassword:birthday:useragent:token:cookie', 'sep': '|'}, |
|
|
|
"159": {"info": "login:password:mail:email password:birthday:id", "sep": ":"}, |
|
|
|
"159": {"info": "login:password:mail:email password:birthday:id", "sep": ":"}, |
|
|
|
#'159': {'info': 'login:password:birthday:id:cookie', 'sep':':' |
|
|
|
#'159': {'info': 'login:password:birthday:id:cookie', 'sep':':', |
|
|
|
|
|
|
|
"827": {"info": "login:password:mail:email password:birthday:useragent:token:cookie", |
|
|
|
|
|
|
|
"sep": "|"} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
############################### |
|
|
|
############################### |
|
|
|
@ -258,8 +272,8 @@ if __name__ == "__main__": |
|
|
|
# Öppna SSH-tunnel till RBP/db. |
|
|
|
# Öppna SSH-tunnel till RBP/db. |
|
|
|
pwd_key = getpass("Password for rsa-key: ") |
|
|
|
pwd_key = getpass("Password for rsa-key: ") |
|
|
|
with open_tunnel( |
|
|
|
with open_tunnel( |
|
|
|
("studio-garda.asuscomm.com", 2200), |
|
|
|
("studio-garda.asuscomm.com", 2210), |
|
|
|
ssh_username="Lasse", |
|
|
|
ssh_username="lasse", |
|
|
|
ssh_pkey=paramiko.RSAKey.from_private_key_file( |
|
|
|
ssh_pkey=paramiko.RSAKey.from_private_key_file( |
|
|
|
"/Users/Lasse/.ssh/id_rsa", password=pwd_key |
|
|
|
"/Users/Lasse/.ssh/id_rsa", password=pwd_key |
|
|
|
), |
|
|
|
), |
|
|
|
|