-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmain.py
105 lines (86 loc) Β· 5.03 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
import os, sys, json, requests, itertools, threading
__config__ = json.load(open('./data/config.json', 'r+'))
class Thanatos:
def __init__(self):
if sys.platform == "linux":
os.system("clear")
else:
os.system("cls && title ππππ£ππ©π€π¨ ^| github.com/Plasmonix")
self.sent = 0
self.errors = 0
self.proxies = itertools.cycle(open('./data/proxies.txt').read().splitlines())
self.client = requests.Session()
def login(self):
headers = {
"accept": "*/*",
"accept-encoding": "gzip, deflate, br",
"accept-language": "en-US,en;q=0.9",
"content-length": "267",
"content-type": "application/x-www-form-urlencoded",
"cookie": "ig_did=0897491F-B736-4E7E-A657-37438D0967B8; csrftoken=xvAQoMiz2eaU4RrcmRp2hqinDVMfgkpe; rur=FTW; mid=XxTPfgALAAGHGReE-x_i1ISMG4Xr",
"origin": "https://www.instagram.com",
"referer": "https://www.instagram.com/",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-origin",
"user-agent": f"Mozilla/91.81 (Linux; Android 6.3; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Mobile Safari/537.36",
"x-csrftoken": "xvAQoMiz2eaU4RrcmRp2hqinDVMfgkpe",
"x-ig-app-id": "1217981644879628",
"x-ig-www-claim": "0",
"x-instagram-ajax": "180c154d218a",
"x-requested-with": "XMLHttpRequest"
}
payload = {
"username": f"{__config__['username']}",
"enc_password": f"#PWD_INSTAGRAM_BROWSER:0:&:{__config__['password']}",
}
try:
res = self.client.post(
"https://www.instagram.com/accounts/login/ajax/",
headers= headers,
data= payload,
proxies= {"https": f"http://{next(self.proxies)}"} if __config__['use_proxy'] else None,
timeout= 5)
if '"authenticated":true' in res.text:
print(f"[\x1b[32m+\x1b[0m] Successfully logged into {__config__['username']}")
self.client.headers.update({"x-csrftoken": res.cookies["csrftoken"]})
profile = self.client.get(
f"https://i.instagram.com/api/v1/users/web_profile_info/?username={__config__['target']}",
headers= {'user-agent': 'Instagram 85.0.0.21.100 Android (23/6.0.1; 538dpi; 1440x2560; LGE; LG-E425f; vee3e; en_US'},
proxies= {"https": f"http://{next(self.proxies)}"} if __config__['use_proxy'] else None,
timeout= 5)
user_id = str(profile.json()["data"]["user"]["id"])
for _ in range(__config__['count']):
try:
threading.Thread(target=self.report, args=(user_id,)).start()
except Exception as err:
print(err)
elif '"user":false' in res.text:
print(f"[\x1b[31m!\x1b[0m] Username does not exist")
elif 'showAccountRecoveryModal' in res.text:
print(f"[\x1b[31m!\x1b[0m] Incorrect password")
elif '"message":"checkpoint_required"' in res.text:
print(f"[\x1b[31m!\x1b[0m] 2FA enabled")
else:
print(f"[\x1b[31m!\x1b[0m] {res.text}")
except Exception as err:
print(f"[\x1b[31m!\x1b[0m] {err}")
def report(self, user_id):
try:
data = {"source_name":"","reason_id":f"{__config__['reason_id']}","frx_contex":""}
req = self.client.post(
f"https://www.instagram.com/users/{user_id}/report/",
data= data,
proxies= {"https": f"http://{next(self.proxies)}"} if __config__['use_proxy'] else None,
timeout= 5)
if '"status":"ok"' in req.text:
self.sent += 1
print(f"[\x1b[34m*\x1b[0m] Sent: {self.sent} | Errors: {self.errors}")
else:
self.errors += 1
print(f"[\x1b[34m*\x1b[0m] Sent: {self.sent} | Errors: {self.errors}")
except Exception as err:
print(f"[\x1b[31m!\x1b[0m] {err}")
if __name__ == "__main__":
client = Thanatos()
client.login()