-
Notifications
You must be signed in to change notification settings - Fork 3
/
nglspam.py
148 lines (119 loc) · 4.83 KB
/
nglspam.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
import json, random, time, httpx, sys, os
from concurrent.futures import ThreadPoolExecutor
import threading
from msg import randomQuestions
from colorama import Fore, Style
from time import strftime, gmtime
sent, errored = 0, 0
class Console:
@staticmethod
def get_time() -> str:
return time.strftime("%H:%M:%S", time.gmtime())
@staticmethod
def logger(*content: tuple, status: bool) -> None:
lock = threading.Lock()
time = Console.get_time()
green = "[" + Fore.GREEN + Style.BRIGHT + "+" + Style.RESET_ALL + "] "
red = "[" + Fore.RED + Style.BRIGHT + "-" + Style.RESET_ALL + "] "
yellow = "[" + Fore.YELLOW + Style.BRIGHT + "!" + Style.RESET_ALL + "] "
with lock:
if status == "g":
sys.stdout.write(
f'{Fore.YELLOW}[{time}]{Style.RESET_ALL}{green}{" ".join(content)}\n'
)
elif status == "r":
sys.stdout.write(
f'{Fore.YELLOW}[{time}]{Style.RESET_ALL}{red}{" ".join(content)}\n'
)
elif status == "y":
sys.stdout.write(
f'{Fore.YELLOW}[{time}]{Style.RESET_ALL}{yellow}{" ".join(content)}\n'
)
@staticmethod
def clear() -> None:
os.system("cls" if os.name == "nt" else "clear")
def main(username, message, deviceid, proxy, proxystatus):
global errored
global sent
headers = {
"Content-Type": "application/x-www-form-urlencoded",
"Accept-Language": "en-US,en;q=0.5",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8",
"User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:104.0) Gecko/20100101 Firefox/104.0",
}
if proxystatus == True:
client = httpx.Client(headers=headers, proxies=proxy)
else:
client = httpx.Client(headers=headers)
try:
postresp = client.post(
f"https://ngl.link/api/submit",
data={
"username": username,
"question": message,
"deviceId": deviceid,
},
)
if postresp.status_code == 200:
sent += 1
Console.logger(
f"Sent {message} to victim, Sent {sent} messages, Errored {errored} messages",
status="g",
)
elif postresp.status_code == 404:
Console.logger(f"User {username} does not exist", status="r")
exit()
elif postresp.status_code == 429:
Console.logger(f"User {username} is rate limited", status="r")
else:
Console.logger(postresp.status_code, status="r")
except Exception as e:
errored += 1
Console.logger(f"Error: {e}", status="y")
main(username, messages(), deviceid(), proxy())
def messages():
return random.choice(randomQuestions)
def proxy():
return "http://" + random.choice(list(open("proxy.txt")))
def deviceid():
return "".join(
random.choice("0123456789abcdefghijklmnopqrstuvwxyz-") for i in range(36)
)
def handler():
print(
Fore.LIGHTRED_EX
+ """
▒█▄░▒█ ▒█▀▀█ ▒█░░░ ▒█▀▀▀█ ▒█▀▀█ ░█▀▀█ ▒█▀▄▀█
▒█▒█▒█ ▒█░▄▄ ▒█░░░ ░▀▀▀▄▄ ▒█▄▄█ ▒█▄▄█ ▒█▒█▒█
▒█░░▀█ ▒█▄▄█ ▒█▄▄█ ▒█▄▄▄█ ▒█░░░ ▒█░▒█ ▒█░░▒█
"""
+ Fore.GREEN
+ "Made by https://github.com/oxitheman"
+ "\nStar the repository on github if you like it!"
+ " If you would like to send random questions or use proxies edit config.json to true."
+ Style.RESET_ALL
)
username = str(input("Enter username (Along with numbers in their NGL link): "))
threadcount = int(input("Enter thread count: "))
with open("config.json") as config:
data = json.load(config)
proxystatus = data["proxy"]
messagestatus = data["random_messages"]
delay = data["delay"]
if messagestatus == True:
with ThreadPoolExecutor(max_workers=threadcount) as executor:
for x in range(threadcount):
executor.submit(
main, username, messages(), deviceid(), proxy(), proxystatus
)
else:
message = str(input("Enter message: "))
with ThreadPoolExecutor(max_workers=threadcount) as executor:
for x in range(threadcount):
executor.submit(
main, username, message, deviceid(), proxy(), proxystatus
)
time.sleep(delay)
Console.logger(f"Sent {sent} messages to {username}.", status="g")
if __name__ == "__main__":
handler()