-
Notifications
You must be signed in to change notification settings - Fork 0
/
spam_c2.py
285 lines (246 loc) · 9.44 KB
/
spam_c2.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
"""
May or may not work, you are responsible for your own actions
and following the laws in your jurisdiction.
TODO: Verify functionality with more dynamic analysis on virus ^
"""
import requests
import random
import string
from region_data import REGION_DATA
# Define a dictionary mapping regions to their corresponding cities and time zones
DISTROS = [
"Windows 10 Home",
"Windows 10 Pro",
"Windows 10 Enterprise",
"Windows 10 Education",
"Windows 10 S",
"Windows 11 Home",
"Windows 11 Pro",
"Windows 11 Enterprise",
"Windows 11 Education",
]
COMPUTER_NAMES = [
"DESKTOP-A1B2C3", "LAPTOP-XYZ123", "WORKSTATION-001", "SERVER-123ABC", "THINKPAD-T490", "SURFACE-BOOK-2",
"HP-PAVILION", "DELL-XPS-15", "ACER-ASPIRE", "LENOVO-YOGA",
"ASUS-ROG", "MSI-GAMING", "TOSHIBA-SATELLITE", "SAMSUNG-NOTEBOOK"
]
def generate_computer_name():
return random.choice(COMPUTER_NAMES) + "-" + random_string(random.randint(4, 8))
def generate_discord_token():
# Generate a valid-looking Discord token
parts = []
for _ in range(3):
parts.append(''.join(random.choices(string.ascii_letters + string.digits, k=24)))
parts.append(''.join(random.choices(string.ascii_letters + string.digits + '-' + '_', k=38)))
return '.'.join(parts)
def generate_public_ip():
# Generate a random public IP address
return f"{random.randint(1, 255)}.{random.randint(0, 255)}.{random.randint(0, 255)}.{random.randint(1, 254)}"
def random_string(length): # used for any other data I have yet to realistically randomize
characters = string.ascii_letters + string.digits
return ''.join(random.choice(characters) for _ in range(length))
API_BASE_URL = 'https://serenos.site/api/'
USER_ID = '5896714143' # same user id for all agents I think -- todo: verify
def post_new_injection():
url = f'{API_BASE_URL}new-injection/'
headers = {'Content-Type': 'application/json'}
# Randomly select a region from the dictionary
region = random.choice(list(REGION_DATA.keys()))
# Get the corresponding cities and time zone for the selected region
cities = REGION_DATA[region]["cities"]
timezone = REGION_DATA[region]["timezone"]
# Randomly select a city from the region's cities
city = random.choice(cities)
# Simulate ipinfo.io JSON response
ip_info = {
"ip": generate_public_ip(),
"city": city,
"region": region,
"country": "US",
"loc": f"{random.uniform(-90, 90):.4f},{random.uniform(-180, 180):.4f}",
"org": f"AS{random.randint(1000, 9999)} {random_string(10)}",
"postal": f"{random.randint(10000, 99999)}",
"timezone": timezone,
"readme": "https://ipinfo.io/missingauth"
}
data = {
"duvet_user": USER_ID,
"computer_name": generate_computer_name(),
"ram": random.randint(4, 64),
"cpu": random_string(15),
"injections": ["Discord"],
"distro": random.choice(DISTROS),
"uptime": random.randint(10000, 1000000),
"network": {
"ip": ip_info["ip"],
"country": ip_info["country"],
"city": ip_info["city"],
"region": ip_info["region"],
}
}
try:
requests.post(url, json=data, headers=headers, timeout=0.1)
except Exception as e:
print(e)
pass
def post_valid_tokens():
url = f'{API_BASE_URL}valid-tokens/'
headers = {'Content-Type': 'application/json'}
data = {
"duvet_user": USER_ID,
"valid_tokens": [
{
"token": generate_discord_token(),
"found_at": random.choice(["Discord", "Chrome", "Firefox"]),
"auth_tag_length": random.randint(16, 32),
"crypto_iv": random.randint(12, 16)
} for _ in range(1 if random.random() < 0.7 else random.randint(2, 3))
],
"computer_name": generate_computer_name(),
}
try:
requests.post(url, json=data, headers=headers, timeout=0.1)
except Exception as e:
print(e)
pass
def post_browsers_data():
url = f'{API_BASE_URL}browsers-data'
headers = {'Content-Type': 'application/json'}
data = {
"duvet_user": USER_ID,
"computer_name": generate_computer_name(),
"data": {
"cookies": [
{
"browser": random.choice(["Chrome", "Firefox", "Edge"]),
"list": [f"cookie{i}" for i in range(random.randint(1, 10))]
}
],
"autofills": [
{
"browser": random.choice(["Chrome", "Firefox", "Edge"]),
"list": [f"autofill{i}" for i in range(random.randint(1, 5))]
}
],
"passwords": [
{
"browser": random.choice(["Chrome", "Firefox", "Edge"]),
"list": [f"password{i}" for i in range(random.randint(1, 8))]
}
]
}
}
try:
requests.post(url, json=data, headers=headers, timeout=0.1)
except Exception as e:
print(e)
pass
def post_2fa_enable():
url = f'{API_BASE_URL}2fa-enable/'
headers = {'Content-Type': 'application/json'}
data = {
"user": f'{{"id": "{random_string(18)}", "username": "{random_string(8)}", "email": "{random_string(8)}@example.com"}}',
"profile": f'{{"bio": "Hello, I\'m {random_string(8)}!", "avatar": "{random_string(18)}"}}',
"billing": f'{{"paymentMethods": [{{"type": "creditCard", "last4": "{random.randint(1000, 9999)}"}}]}}',
"duvet_user": USER_ID,
"login": {
"password": random_string(12),
"token": generate_discord_token()
},
"two_factor": {
"secret": random_string(16),
"code": str(random.randint(100000, 999999))
}
}
try:
requests.post(url, json=data, headers=headers, timeout=0.1)
except Exception as e:
print(e)
pass
def post_2fa_disable():
url = f'{API_BASE_URL}2fa-disable/'
headers = {'Content-Type': 'application/json'}
data = {
"user": f'{{"id": "{random_string(18)}", "username": "{random_string(8)}", "email": "{random_string(8)}@example.com"}}',
"profile": f'{{"bio": "Hello, I\'m {random_string(8)}!", "avatar": "{random_string(18)}"}}',
"billing": f'{{"paymentMethods": [{{"type": "creditCard", "last4": "{random.randint(1000, 9999)}"}}]}}',
"duvet_user": USER_ID,
"login": {
"token": generate_discord_token()
}
}
try:
requests.post(url, json=data, headers=headers, timeout=0.1)
except Exception as e:
print(e)
pass
def post_password_change():
url = f'{API_BASE_URL}password-change/'
headers = {'Content-Type': 'application/json'}
data = {
"user": f'{{"id": "{random_string(18)}", "username": "{random_string(8)}", "email": "{random_string(8)}@example.com"}}',
"profile": f'{{"bio": "Hello, I\'m {random_string(8)}!", "avatar": "{random_string(18)}"}}',
"billing": f'{{"paymentMethods": [{{"type": "creditCard", "last4": "{random.randint(1000, 9999)}"}}]}}',
"duvet_user": USER_ID,
"login": {
"password": random_string(12),
"new_password": random_string(12),
"token": generate_discord_token()
}
}
try:
requests.post(url, json=data, headers=headers, timeout=0.1)
except Exception as e:
print(e)
pass
def post_email_change():
url = f'{API_BASE_URL}email-change/'
headers = {'Content-Type': 'application/json'}
data = {
"user": f'{{"id": "{random_string(18)}", "username": "{random_string(8)}", "email": "{random_string(8)}@example.com"}}',
"profile": f'{{"bio": "Hello, I\'m {random_string(8)}!", "avatar": "{random_string(18)}"}}',
"billing": f'{{"paymentMethods": [{{"type": "creditCard", "last4": "{random.randint(1000, 9999)}"}}]}}',
"duvet_user": USER_ID,
"login": {
"password": random_string(12),
"email": f"{random_string(8)}@example.com",
"token": generate_discord_token()
}
}
try:
requests.post(url, json=data, headers=headers, timeout=0.1)
except Exception as e:
print(e)
pass
def post_discord_login():
url = f'{API_BASE_URL}discord-login/'
headers = {'Content-Type': 'application/json'}
data = {
"user": f'{{"id": "{random_string(18)}", "username": "{random_string(8)}", "email": "{random_string(8)}@example.com"}}',
"profile": f'{{"bio": "Hello, I\'m {random_string(8)}!", "avatar": "{random_string(18)}"}}',
"billing": f'{{"paymentMethods": [{{"type": "creditCard", "last4": "{random.randint(1000, 9999)}"}}]}}',
"duvet_user": USER_ID,
"login": {
"password": random_string(12),
"token": generate_discord_token()
}
}
try:
requests.post(url, json=data, headers=headers, timeout=0.1)
except Exception as e:
print(e)
pass
def main():
num_requests = 1000000
for _ in range(num_requests):
print(f'sending request {_}')
post_new_injection()
post_valid_tokens()
post_browsers_data()
post_2fa_enable()
post_2fa_disable()
post_password_change()
post_email_change()
post_discord_login()
if __name__ == "__main__":
main()