-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathold_boring_not_good.py
69 lines (57 loc) · 2.28 KB
/
old_boring_not_good.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
import socket
import threading
import time
import requests
import datetime
from discord_webhook import DiscordWebhook, DiscordEmbed
def create_packet():
# Create the packet to query the server
packet = bytearray()
packet.extend(b'\xFE\x01')
return packet
# Create the packet
packet = create_packet()
def check_server(ip, port):
try:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.settimeout(0.2)
s.connect((ip, port))
s.send(packet)
data = s.recv(1024)
s.close()
if len(data) > 0:
message = DiscordEmbed(title="__New Server Found! (*Click Me!*)__",
url=f"https://mcsrvstat.us/server/{ip}:{port}",
description=f"Server Ip: `{ip}:{port}`\n Date and Time: `{datetime.datetime.now().strftime('%H:%M:%S')}`\n\n*Bot Made By __xxx__*",
color=242424)
hook = DiscordWebhook(url="https://discord.com/api/webhooks/1071013978530119690/Ra33VyHupRQ5aanV_WXczFcWTR1Vx_SSmuV3TPUY2V5Z3LWUCci0QQbXELgqCAFsR9kg",
username="The Fifth Eye")
hook.add_embed(message)
hook.execute()
except socket.error:
print(f"Checked The Ip: {ip}:{port}")
def main():
start_ip = input("Enter the starting IP address (e.g. 1.1.1.1): ")
start_ip = start_ip.strip().split(".")
start_ip = [int(x) for x in start_ip]
start_ip = (start_ip[0], start_ip[1], start_ip[2], start_ip[3])
end_ip = input("Enter the ending IP address (e.g. 255.255.255.255): ")
end_ip = end_ip.strip().split(".")
end_ip = [int(x) for x in end_ip]
end_ip = (end_ip[0], end_ip[1], end_ip[2], end_ip[3])
port = int(input("Enter the port to scan (e.g. 25565): "))
threads = []
for i in range(start_ip[0], end_ip[0]+1):
for j in range(start_ip[1], end_ip[1]+1):
for k in range(start_ip[2], end_ip[2]+1):
for l in range(start_ip[3], end_ip[3]+1):
ip = f"{i}.{j}.{k}.{l}"
t = threading.Thread(target=check_server, args=(ip, port))
threads.append(t)
t.start()
time.sleep(0.1)
for t in threads:
t.join()
if __name__ == '__main__':
main()
#178.63.19.87