SnakeScan 1.6.0__tar.gz → 1.6.2__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,8 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: SnakeScan
3
- Version: 1.6.0
4
- Summary: Module SnakeScan
3
+ Version: 1.6.2
4
+ Summary: IPv4 address scanner for collecting address information.Use carefully for your network safety.Use to get IPV4 from IPV6 address.Don't use it to scan IPV6 because it's not designed for it.
5
5
  Author: Den*Ram
6
+ Requires-Python: >=3.7
6
7
  Description-Content-Type: text/markdown
7
8
  License-Expression: MIT
8
9
  License-File: LICENSE
@@ -14,7 +15,7 @@ Project-URL: Repository, https://github.com/Den-Ram/SnakeScan
14
15
 
15
16
  # SnakeScan
16
17
  ![PyPI version](https://badge.fury.io/py/SnakeScan.svg)
17
- ![Requires-python](https://img.shields.io/badge/requires--python-3.6+-red)
18
+ ![Requires-python](https://img.shields.io/badge/requires--python-3.7+-red)
18
19
  ![License](https://img.shields.io/badge/License-MIT-blue.svg)
19
20
  ```
20
21
  import SnakeScan
@@ -63,3 +64,7 @@ options:
63
64
  -ch, --check scan subnet
64
65
  -l, --local view you public ip - need internet
65
66
  ```
67
+ ## Added Info about ipv6
68
+ ```
69
+ snake 2001:db8:: -i or snake [2001:4860:4860::8888] -i
70
+ ```
@@ -1,6 +1,6 @@
1
1
  # SnakeScan
2
2
  ![PyPI version](https://badge.fury.io/py/SnakeScan.svg)
3
- ![Requires-python](https://img.shields.io/badge/requires--python-3.6+-red)
3
+ ![Requires-python](https://img.shields.io/badge/requires--python-3.7+-red)
4
4
  ![License](https://img.shields.io/badge/License-MIT-blue.svg)
5
5
  ```
6
6
  import SnakeScan
@@ -48,4 +48,8 @@ options:
48
48
  -t, --thread fast scan
49
49
  -ch, --check scan subnet
50
50
  -l, --local view you public ip - need internet
51
+ ```
52
+ ## Added Info about ipv6
53
+ ```
54
+ snake 2001:db8:: -i or snake [2001:4860:4860::8888] -i
51
55
  ```
@@ -65,7 +65,7 @@ ports = {
65
65
  8080: "Tomcat",
66
66
  10000: "Webmin",
67
67
  }
68
- version = "1.6.0"
68
+ version = "1.6.2"
69
69
 
70
70
 
71
71
  def is_port_open(host, port):
@@ -118,23 +118,23 @@ def SnakeArgs():
118
118
  port_user = SnakeArgs().ports
119
119
  host = SnakeArgs().host
120
120
  if host.startswith("http://"):
121
- host = host.strip()
122
- host = host.split("http:")
123
- host = host[1].strip("//")
124
- host = host.split("/")
125
- host = host[0]
126
- for i in range(len(host)):
127
- if host[i] == "/":
128
- host = host[0:i]
121
+ host = host.strip()
122
+ host = host.split("http:")
123
+ host = host[1].strip("//")
124
+ host = host.split("/")
125
+ host = host[0]
126
+ for i in range(len(host)):
127
+ if host[i] == "/":
128
+ host = host[0:i]
129
129
  if host.startswith("https://"):
130
- host = host.strip()
131
- host = host.split("https:")
132
- host = host[1].strip("//")
133
- host = host.split("/")
134
- host = host[0]
135
- for i in range(len(host)):
136
- if host[i] == "/":
137
- host = host[0:i]
130
+ host = host.strip()
131
+ host = host.split("https:")
132
+ host = host[1].strip("//")
133
+ host = host.split("/")
134
+ host = host[0]
135
+ for i in range(len(host)):
136
+ if host[i] == "/":
137
+ host = host[0:i]
138
138
  if host == "None":
139
139
  host = "localhost"
140
140
  if SnakeArgs().ports:
@@ -202,6 +202,8 @@ if SnakeArgs().single:
202
202
  )
203
203
  except:
204
204
  print(f"Closed{colored('|X|','red')}{host}-->|{port_user[port]}|")
205
+
206
+
205
207
  if SnakeArgs().local:
206
208
  local = ""
207
209
  s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
@@ -216,14 +218,26 @@ if SnakeArgs().local:
216
218
  if SnakeArgs().info:
217
219
  if host == "None":
218
220
  host = "localhost"
219
- host = host.strip("-i").strip()
221
+
220
222
  print("".center(60, "-"))
221
223
  try:
222
224
  host = socket.gethostbyname(host)
223
225
  except Exception as e:
224
- print(e)
225
- print("".center(60, "^"))
226
- print("".center(60, "-"))
226
+ try:
227
+ hostname, list, iplist = socket.gethostbyaddr(host)
228
+ except Exception as e:
229
+ if host.startswith("[") and host.endswith("]"):
230
+ host = host[1:-1]
231
+ else:
232
+ host = host.split("[")
233
+ for i in range(len(host)):
234
+ host = host[i - 1].split("]")
235
+ host = host[0]
236
+ try:
237
+ hostname, list, iplist = socket.gethostbyaddr(host)
238
+ except Exception as e:
239
+ print(e)
240
+ sys.exit()
227
241
 
228
242
  hosting = ""
229
243
  hosting = host.split(".")
@@ -235,10 +249,28 @@ if SnakeArgs().info:
235
249
  network += "/24"
236
250
  hosting = network
237
251
  try:
252
+ if host.startswith("[") and host.endswith("]"):
253
+ host = host[1:-1]
254
+ else:
255
+ host = host.split("[")
256
+ for i in range(len(host)):
257
+ host = host[i - 1].split("]")
258
+ host = host[0]
238
259
  ip_obj = ipaddress.ip_address(host)
260
+ if ip_obj.version == 6:
261
+
262
+ try:
263
+ network = host + "/64"
264
+ network_obj = ipaddress.ip_network(network)
265
+ except Exception as e:
266
+ pass
267
+ try:
268
+ network = host + "/128"
269
+ network_obj = ipaddress.ip_network(network)
270
+ except Exception as e:
271
+ pass
239
272
  except Exception as e:
240
273
  print(e)
241
- sys.exit()
242
274
  print(f"Type IP: {type(ip_obj)}")
243
275
  print(f"Version IP: {ip_obj.version}")
244
276
  network_obj = ipaddress.ip_network(network)
@@ -253,10 +285,15 @@ if SnakeArgs().info:
253
285
  try:
254
286
  print(f"IP:{socket.gethostbyname(host)}")
255
287
  except Exception as e:
256
- print(f"IP:{e}")
257
-
288
+ try:
289
+ hostname, list, iplist = socket.gethostbyaddr(host)
290
+ print(f"IP:{socket.gethostbyname(hostname)}")
291
+ except:
292
+ pass
258
293
  finally:
259
294
  print("".center(60, "-"))
295
+
296
+
260
297
  if SnakeArgs().thread:
261
298
  print(f"Thread".center(60, "-"))
262
299
 
@@ -1,6 +1,6 @@
1
- """Module SnakeScan"""
1
+ """IPv4 address scanner for collecting address information.Use carefully for your network safety.Use to get IPV4 from IPV6 address.Don't use it to scan IPV6 because it's not designed for it. """
2
2
 
3
- __version__ = "1.6.0"
3
+ __version__ = "1.6.2"
4
4
  import socket
5
5
  import ipaddress
6
6
  from art import tprint
@@ -6,10 +6,11 @@ build-backend = "flit_core.buildapi"
6
6
  [project]
7
7
  name = "SnakeScan"
8
8
  authors = [{name = "Den*Ram"}]
9
+ requires-python = ">=3.7"
9
10
  readme = "README.md"
10
11
  license = "MIT"
11
12
  license-files = ["LICENSE"]
12
- dynamic = ["version", "description"]
13
+ dynamic = ["version","description"]
13
14
  dependencies = [
14
15
  "art",
15
16
  "tqdm",
File without changes