secator 0.4.0__py3-none-any.whl → 0.4.1__py3-none-any.whl

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.

Potentially problematic release.


This version of secator might be problematic. Click here for more details.

secator/cli.py CHANGED
@@ -592,6 +592,24 @@ def health(json, debug):
592
592
  table.add_row(*row)
593
593
  status['secator'] = info
594
594
 
595
+ # Check addons
596
+ console.print('\n:wrench: [bold gold3]Checking installed addons ...[/]')
597
+ table = get_health_table()
598
+ with Live(table, console=console):
599
+ for addon in ['worker', 'google', 'mongodb', 'redis', 'dev', 'trace', 'build']:
600
+ addon_var = ADDONS_ENABLED[addon]
601
+ info = {
602
+ 'name': addon,
603
+ 'version': None,
604
+ 'status': 'ok' if addon_var else 'missing',
605
+ 'latest_version': None,
606
+ 'installed': addon_var,
607
+ 'location': None
608
+ }
609
+ row = fmt_health_table_row(info, 'addons')
610
+ table.add_row(*row)
611
+ status['addons'][addon] = info
612
+
595
613
  # Check languages
596
614
  console.print('\n:wrench: [bold gold3]Checking installed languages ...[/]')
597
615
  version_cmds = {'go': 'version', 'python3': '--version', 'ruby': '--version'}
@@ -616,24 +634,6 @@ def health(json, debug):
616
634
  table.add_row(*row)
617
635
  status['tools'][tool.__name__] = info
618
636
 
619
- # # Check addons
620
- console.print('\n:wrench: [bold gold3]Checking installed addons ...[/]')
621
- table = get_health_table()
622
- with Live(table, console=console):
623
- for addon in ['worker', 'google', 'mongodb', 'redis', 'dev', 'trace', 'build']:
624
- addon_var = ADDONS_ENABLED[addon]
625
- info = {
626
- 'name': addon,
627
- 'version': None,
628
- 'status': 'ok' if addon_var else 'missing',
629
- 'latest_version': None,
630
- 'installed': addon_var,
631
- 'location': None
632
- }
633
- row = fmt_health_table_row(info, 'addons')
634
- table.add_row(*row)
635
- status['addons'][addon] = info
636
-
637
637
  # Print JSON health
638
638
  if json:
639
639
  import json as _json
secator/config.py CHANGED
@@ -6,11 +6,14 @@ from typing_extensions import Annotated, Self
6
6
 
7
7
  import requests
8
8
  import yaml
9
+ from dotenv import find_dotenv, load_dotenv
9
10
  from dotmap import DotMap
10
11
  from pydantic import AfterValidator, BaseModel, model_validator, ValidationError
11
12
 
12
13
  from secator.rich import console, console_stdout
13
14
 
15
+ load_dotenv(find_dotenv(usecwd=True), override=False)
16
+
14
17
  Directory = Annotated[Path, AfterValidator(lambda v: v.expanduser())]
15
18
  StrExpandHome = Annotated[str, AfterValidator(lambda v: v.replace('~', str(Path.home())))]
16
19
 
@@ -245,9 +248,9 @@ class Config(DotMap):
245
248
  value = float(value)
246
249
  elif isinstance(existing_value, Path):
247
250
  value = Path(value)
248
- except ValueError as e:
249
- from secator.utils import debug
250
- debug(f'Could not cast value {value} to expected type {type(existing_value).__name__}: {str(e)}', sub='config')
251
+ except ValueError:
252
+ # from secator.utils import debug
253
+ # debug(f'Could not cast value {value} to expected type {type(existing_value).__name__}: {str(e)}', sub='config')
251
254
  pass
252
255
  finally:
253
256
  target[final_key] = value
secator/definitions.py CHANGED
@@ -2,12 +2,10 @@
2
2
 
3
3
  import os
4
4
 
5
- from dotenv import find_dotenv, load_dotenv
6
5
  from importlib.metadata import version
7
6
 
8
7
  from secator.config import CONFIG, ROOT_FOLDER
9
8
 
10
- load_dotenv(find_dotenv(usecwd=True), override=False)
11
9
 
12
10
  # Globals
13
11
  VERSION = version('secator')
@@ -105,56 +103,30 @@ WORDLIST = 'wordlist'
105
103
  WORDS = 'words'
106
104
 
107
105
 
106
+ def is_importable(module_to_import):
107
+ import importlib
108
+ try:
109
+ importlib.import_module(module_to_import)
110
+ return True
111
+ except ModuleNotFoundError:
112
+ return False
113
+ except Exception as e:
114
+ print(f'Failed trying to import {module_to_import}: {str(e)}')
115
+ return False
116
+
117
+
108
118
  ADDONS_ENABLED = {}
109
119
 
110
- # Check worker addon
111
- try:
112
- import eventlet # noqa: F401
113
- ADDONS_ENABLED['worker'] = True
114
- except ModuleNotFoundError:
115
- ADDONS_ENABLED['worker'] = False
116
-
117
- # Check google addon
118
- try:
119
- import gspread # noqa: F401
120
- ADDONS_ENABLED['google'] = True
121
- except ModuleNotFoundError:
122
- ADDONS_ENABLED['google'] = False
123
-
124
- # Check mongodb addon
125
- try:
126
- import pymongo # noqa: F401
127
- ADDONS_ENABLED['mongodb'] = True
128
- except ModuleNotFoundError:
129
- ADDONS_ENABLED['mongodb'] = False
130
-
131
- # Check redis addon
132
- try:
133
- import redis # noqa: F401
134
- ADDONS_ENABLED['redis'] = True
135
- except ModuleNotFoundError:
136
- ADDONS_ENABLED['redis'] = False
137
-
138
- # Check dev addon
139
- try:
140
- import flake8 # noqa: F401
141
- ADDONS_ENABLED['dev'] = True
142
- except ModuleNotFoundError:
143
- ADDONS_ENABLED['dev'] = False
144
-
145
- # Check build addon
146
- try:
147
- import hatch # noqa: F401
148
- ADDONS_ENABLED['build'] = True
149
- except ModuleNotFoundError:
150
- ADDONS_ENABLED['build'] = False
151
-
152
- # Check trace addon
153
- try:
154
- import memray # noqa: F401
155
- ADDONS_ENABLED['trace'] = True
156
- except ModuleNotFoundError:
157
- ADDONS_ENABLED['trace'] = False
120
+ for addon, module in [
121
+ ('worker', 'eventlet'),
122
+ ('google', 'gspread'),
123
+ ('mongodb', 'pymongo'),
124
+ ('redis', 'redis'),
125
+ ('dev', 'flake8'),
126
+ ('trace', 'memray'),
127
+ ('build', 'hatch')
128
+ ]:
129
+ ADDONS_ENABLED[addon] = is_importable(module)
158
130
 
159
131
  # Check dev package
160
132
  if os.path.exists(f'{ROOT_FOLDER}/pyproject.toml'):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: secator
3
- Version: 0.4.0
3
+ Version: 0.4.1
4
4
  Summary: The pentester's swiss knife.
5
5
  Project-URL: Homepage, https://github.com/freelabz/secator
6
6
  Project-URL: Issues, https://github.com/freelabz/secator/issues
@@ -1,10 +1,10 @@
1
1
  secator/.gitignore,sha256=da8MUc3hdb6Mo0WjZu2upn5uZMbXcBGvhdhTQ1L89HI,3093
2
2
  secator/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  secator/celery.py,sha256=5Raua1rDFJACdmP4b1HLS15kx3ObcUrVConQ0UcopTc,12135
4
- secator/cli.py,sha256=-B3Hjy8I1z7Jc6fiPYQPCt0DX6TVrNZ98aU-8oN_RQM,34150
5
- secator/config.py,sha256=-PdJgIesb7T1N2s38iHHeIquxBHoW1Cmd04gQr9PnnY,17403
4
+ secator/cli.py,sha256=qf55GtYARFcCqOTumq3N5_dne3twxRkExolMrUI5UiU,34148
5
+ secator/config.py,sha256=Mzubha9pSzmpJnwA6f87OUScKrYo-szf8i9PJvKkz8w,17501
6
6
  secator/decorators.py,sha256=SIS_32SbeN9iTx82mvy9F9vLpjofRYspOOLCXytIO2g,10764
7
- secator/definitions.py,sha256=lGhuBw2oBvSjtpxCPm0EwoAZLxcf2rwDEpcU8yfxVUA,3689
7
+ secator/definitions.py,sha256=Spr62Nc0TweBAa84iRGSwNkIvXlKofPxtIi795gqTjc,3047
8
8
  secator/installer.py,sha256=fpjf5fbA5M5zDQVP4Fdr51sLoMwtoGZTe3mXh7DvD6s,9466
9
9
  secator/report.py,sha256=g0stVCcx9klbUS01uKvWcxNE9MJfNFMexYA2SoDIWJU,2596
10
10
  secator/rich.py,sha256=W4PipeZfIVnERfW3ySeWSvnZ90jhCFiABBoERYy_6kM,3177
@@ -94,8 +94,8 @@ secator/tasks/nuclei.py,sha256=lKZYPVcnCYomd830-ZCOz4fyc8xAKjNDuKayyz0BPek,3507
94
94
  secator/tasks/searchsploit.py,sha256=RD2uv3GFI3Eb-DiTzJp59jyXnvAZRACq-WjDI1NgFM0,1664
95
95
  secator/tasks/subfinder.py,sha256=cpFyFCpVaDZ3QAjNId26ezOwntn3CA5Uk-AC2l0mo0E,1087
96
96
  secator/tasks/wpscan.py,sha256=UVWnBPOQ1RDB2wzMswWR6vc6cucYgHtuJ8pLZoqCM40,5434
97
- secator-0.4.0.dist-info/METADATA,sha256=sG5y-7z5TSaCkO2_BehY8co5v_ieePZfv2EV9k9K8pc,14095
98
- secator-0.4.0.dist-info/WHEEL,sha256=zEMcRr9Kr03x1ozGwg5v9NQBKn3kndp6LSoSlVg-jhU,87
99
- secator-0.4.0.dist-info/entry_points.txt,sha256=lPgsqqUXWgiuGSfKy-se5gHdQlAXIwS_A46NYq7Acic,44
100
- secator-0.4.0.dist-info/licenses/LICENSE,sha256=19W5Jsy4WTctNkqmZIqLRV1gTDOp01S3LDj9iSgWaJ0,2867
101
- secator-0.4.0.dist-info/RECORD,,
97
+ secator-0.4.1.dist-info/METADATA,sha256=UWWDy4InD1uQ9MovLFt6zeSRKBj0b3Od9AwfX4cdoFY,14095
98
+ secator-0.4.1.dist-info/WHEEL,sha256=zEMcRr9Kr03x1ozGwg5v9NQBKn3kndp6LSoSlVg-jhU,87
99
+ secator-0.4.1.dist-info/entry_points.txt,sha256=lPgsqqUXWgiuGSfKy-se5gHdQlAXIwS_A46NYq7Acic,44
100
+ secator-0.4.1.dist-info/licenses/LICENSE,sha256=19W5Jsy4WTctNkqmZIqLRV1gTDOp01S3LDj9iSgWaJ0,2867
101
+ secator-0.4.1.dist-info/RECORD,,