SnakeScan 1.9.7__tar.gz → 1.9.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,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: SnakeScan
3
- Version: 1.9.7
3
+ Version: 1.9.8
4
4
  Summary: Unlock the potential of your network with this powerful IPv4 address scanner. Easily scan IP address ranges, identify active hosts, and even extract IPv4 addresses from IPv6 environments. Enhance your network monitoring, troubleshooting, and security analysis!
5
5
  Author: Den*Ram
6
6
  Requires-Python: >=3.7
@@ -26,8 +26,6 @@ A versatile and efficient Python library designed for comprehensive network port
26
26
 
27
27
  **SnakeScan** provides a flexible and powerful solution for network administrators, security professionals, and developers who need reliable port scanning capabilities. From simple port checks to advanced, multi-threaded subnet analysis, SnakeScan provides the tools necessary for effective network assessment.
28
28
 
29
- Attention: A large number of bugs were found, so the use of several subcommands is not possible at the moment, and this will be corrected after 3 days. Because of this, it is recommended to use version 1.9.5 and below. Version 1.9.7 must be fixed.
30
-
31
29
  ## ⚙️ Key Features:
32
30
 
33
31
  * **Flexible Port Specification:** Define target ports as individual values, ranges, or through preconfigured sets.
@@ -71,10 +69,22 @@ cd [directory where the archive was unpacked]
71
69
  flit install
72
70
 
73
71
  ## ⌨️ Command Line Usage:
72
+
73
+ * * Commands for individual actions (Updating 1.9.8): scan{save}, info, dict.
74
+
75
+ * * Commands cannot be used in one line: Snake scan -t info -i dict -d ~ cause an error due to incorrect command input.
76
+
77
+ * * The optional "save" command was added to the "scan" command.
78
+
79
+ * * "save" ~ Attributes -
80
+ "-s", "--save", help= Gives permission to save the file.
81
+ "-n", "--name", help= The name of the file to be saved.
82
+ "-p", "--path", help= Specify your own file save path.
83
+ "-a", "--append", help= Add an existing file with data. **WARNING: By default, the file is overwritten every time you save it using this argument, the file will be supplemented without overwriting the content.
74
84
 
75
85
  ### 💡 Attribute Reference:
76
86
 
77
- * * Commands for individual actions (Updating 1.9.6): scan, info, dict, save
87
+ * **-hs --host**: Provides the ability to enter a host. **WARNING: If the value is not specified, the default value will be used. **Default value: localhost.`
78
88
 
79
89
  * **-time**: Sets a timeout for each port. Examples: `snake scan -time 4`
80
90
 
@@ -144,5 +154,5 @@ watcher.start() # Start monitoring!
144
154
 
145
155
  ---
146
156
 
147
- **Last Updated:** 1.9.7 (Added a new argument -time, --timeout, and also added commands for individual actions: scan, info, dict, save)
157
+ **Last Updated:** 1.9.8 (Bug fix)
148
158
 
@@ -14,8 +14,6 @@ A versatile and efficient Python library designed for comprehensive network port
14
14
 
15
15
  **SnakeScan** provides a flexible and powerful solution for network administrators, security professionals, and developers who need reliable port scanning capabilities. From simple port checks to advanced, multi-threaded subnet analysis, SnakeScan provides the tools necessary for effective network assessment.
16
16
 
17
- Attention: A large number of bugs were found, so the use of several subcommands is not possible at the moment, and this will be corrected after 3 days. Because of this, it is recommended to use version 1.9.5 and below. Version 1.9.7 must be fixed.
18
-
19
17
  ## ⚙️ Key Features:
20
18
 
21
19
  * **Flexible Port Specification:** Define target ports as individual values, ranges, or through preconfigured sets.
@@ -59,10 +57,22 @@ cd [directory where the archive was unpacked]
59
57
  flit install
60
58
 
61
59
  ## ⌨️ Command Line Usage:
60
+
61
+ * * Commands for individual actions (Updating 1.9.8): scan{save}, info, dict.
62
+
63
+ * * Commands cannot be used in one line: Snake scan -t info -i dict -d ~ cause an error due to incorrect command input.
64
+
65
+ * * The optional "save" command was added to the "scan" command.
66
+
67
+ * * "save" ~ Attributes -
68
+ "-s", "--save", help= Gives permission to save the file.
69
+ "-n", "--name", help= The name of the file to be saved.
70
+ "-p", "--path", help= Specify your own file save path.
71
+ "-a", "--append", help= Add an existing file with data. **WARNING: By default, the file is overwritten every time you save it using this argument, the file will be supplemented without overwriting the content.
62
72
 
63
73
  ### 💡 Attribute Reference:
64
74
 
65
- * * Commands for individual actions (Updating 1.9.6): scan, info, dict, save
75
+ * **-hs --host**: Provides the ability to enter a host. **WARNING: If the value is not specified, the default value will be used. **Default value: localhost.`
66
76
 
67
77
  * **-time**: Sets a timeout for each port. Examples: `snake scan -time 4`
68
78
 
@@ -132,4 +142,4 @@ watcher.start() # Start monitoring!
132
142
 
133
143
  ---
134
144
 
135
- **Last Updated:** 1.9.7 (Added a new argument -time, --timeout, and also added commands for individual actions: scan, info, dict, save)
145
+ **Last Updated:** 1.9.8 (Bug fix)
@@ -176,7 +176,7 @@ async def is_port_open_async(host, port, timeout=1):
176
176
  print(f"[!] WARNING: Error - {e}")
177
177
 
178
178
 
179
- async def is_port_run_threads(host, ports):
179
+ async def is_port_run_threads(host, ports, timeout=1):
180
180
  for n in range(len(host)):
181
181
  try:
182
182
  loop = asyncio.get_event_loop()
@@ -296,7 +296,7 @@ else:
296
296
  if __name__ == "__main__":
297
297
  main()
298
298
 
299
- version = "1.9.7"
299
+ version = "1.9.8"
300
300
 
301
301
 
302
302
  def is_port_open(host, port, argument=None, protocol=socket.SOCK_STREAM, timeout=1):
@@ -430,37 +430,13 @@ def SnakeArgs():
430
430
  description="SnakeScan is a command library / tool for performing port monitoring and maintenance tasks on the target system, it provides the ability to provide reliable protection against any threatening factors that can harm the user's system."
431
431
  )
432
432
  parser.add_argument(
433
- "host",
433
+ "-hs",
434
+ "--host",
434
435
  nargs="?",
435
436
  default="None",
437
+ help="Provides the ability to enter a host. **WARNING: If the value is not specified, the default value will be used. **Default value: localhost.",
436
438
  )
437
439
  command = parser.add_subparsers(dest="command", help="List of commands")
438
- save = command.add_parser(
439
- name="save", help="Allows you to create a log with port data to a file."
440
- )
441
- save.add_argument(
442
- "-s",
443
- "--save",
444
- help="Gives permission to save the file.",
445
- action="store_true",
446
- required="true",
447
- )
448
- save.add_argument(
449
- "-n",
450
- "--name",
451
- help="The name of the file to be saved.",
452
- nargs="?",
453
- default="saved_backup_ports_01.json",
454
- )
455
- save.add_argument(
456
- "-p", "--path", help="Specify your own file save path.", nargs="?"
457
- )
458
- save.add_argument(
459
- "-a",
460
- "--append",
461
- help="Add an existing file with data. **WARNING: By default, the file is overwritten every time you save it using this argument, the file will be supplemented without overwriting the content.",
462
- action="store_true",
463
- )
464
440
  scan = command.add_parser(name="scan", help="Allows you to use scanning.")
465
441
  scan.add_argument(
466
442
  "-a",
@@ -492,6 +468,35 @@ def SnakeArgs():
492
468
  action="store_true",
493
469
  help="Use to scan only with using ThreadPoolExecutor. **WARNING: If you use it in a place with the -u argument, then this will change the type of scanned ports to UDP.",
494
470
  )
471
+ save_command = scan.add_subparsers(
472
+ dest="save", help="Allows you to create a log with port data to a file."
473
+ )
474
+ save = save_command.add_parser(
475
+ name="save", help="Use to save data to a file. **Format: JSON."
476
+ )
477
+ save.add_argument(
478
+ "-s",
479
+ "--save",
480
+ help="Gives permission to save the file.",
481
+ action="store_true",
482
+ required="true",
483
+ )
484
+ save.add_argument(
485
+ "-n",
486
+ "--name",
487
+ help="The name of the file to be saved.",
488
+ nargs="?",
489
+ default="saved_backup_ports_01.json",
490
+ )
491
+ save.add_argument(
492
+ "-p", "--path", help="Specify your own file save path.", nargs="?"
493
+ )
494
+ save.add_argument(
495
+ "-a",
496
+ "--append",
497
+ help="Add an existing file with data. **WARNING: By default, the file is overwritten every time you save it using this argument, the file will be supplemented without overwriting the content.",
498
+ action="store_true",
499
+ )
495
500
  info = command.add_parser(
496
501
  name="info", help="Allows you to get the information you need."
497
502
  )
@@ -587,34 +592,37 @@ if SnakeArgs().command == "dict":
587
592
  ports_tcp = load_json_config(filepath[0])
588
593
  Save_config(filepath[0], "")
589
594
 
590
- if SnakeArgs().command == "save":
591
- save = True
595
+ if SnakeArgs().command == "scan":
596
+ if SnakeArgs().save:
597
+ save = True
598
+
599
+ def Save(data):
600
+ if SnakeArgs().path:
601
+ try:
602
+ path = Path(str(SnakeArgs().path)).expanduser()
603
+ except Exception as e:
604
+ print(f"[!] WARNING: Error - {e}")
605
+ sys.exit()
606
+ else:
607
+ path = Path.home() / "SnakeScan"
592
608
 
593
- def Save(data):
594
- if SnakeArgs().path:
609
+ if SnakeArgs().name:
610
+ name = str(SnakeArgs().name)
611
+ else:
612
+ name = "saved_backup_ports_01.json"
595
613
  try:
596
- path = Path(str(SnakeArgs().path)).expanduser()
614
+ name = str(name)
615
+ if name.endswith(".json"):
616
+ pass
617
+ else:
618
+ name = name + ".json"
619
+ with open(
620
+ path / name, "w" if SnakeArgs().append != True else "a"
621
+ ) as path:
622
+ json.dump(data, path, ensure_ascii=False, indent=4)
597
623
  except Exception as e:
598
624
  print(f"[!] WARNING: Error - {e}")
599
625
  sys.exit()
600
- else:
601
- path = Path.home() / "SnakeScan"
602
-
603
- if SnakeArgs().name:
604
- name = str(SnakeArgs().name)
605
- else:
606
- name = "saved_backup_ports_01.json"
607
- try:
608
- name = str(name)
609
- if name.endswith(".json"):
610
- pass
611
- else:
612
- name = name + ".json"
613
- with open(path / name, "w" if SnakeArgs().append != True else "a") as path:
614
- json.dump(data, path, ensure_ascii=False, indent=4)
615
- except Exception as e:
616
- print(f"[!] WARNING: Error - {e}")
617
- sys.exit()
618
626
 
619
627
 
620
628
  if SnakeArgs().command == "scan":
@@ -632,7 +640,7 @@ if SnakeArgs().command == "scan":
632
640
 
633
641
  if SnakeArgs().command == "scan":
634
642
  if SnakeArgs().asynchronous:
635
- asyncio.run(is_port_run_threads(host, ports, timeout))
643
+ asyncio.run(is_port_run_threads(host, ports))
636
644
 
637
645
 
638
646
  if SnakeArgs().command == "dict":
@@ -1,6 +1,6 @@
1
1
  """Unlock the potential of your network with this powerful IPv4 address scanner. Easily scan IP address ranges, identify active hosts, and even extract IPv4 addresses from IPv6 environments. Enhance your network monitoring, troubleshooting, and security analysis!"""
2
2
 
3
- __version__ = "1.9.7"
3
+ __version__ = "1.9.8"
4
4
  import socket
5
5
  from time import sleep
6
6
  from termcolor import colored
File without changes
File without changes