Skip to content

Commit

Permalink
Update modules.py
Browse files Browse the repository at this point in the history
  • Loading branch information
enty8080 authored May 18, 2024
1 parent 2aa6c35 commit 241b557
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions hatsploit/lib/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,14 +343,19 @@ def run_module(module: Module) -> None:
""" Run module.
:param Module module: module object
:raises RuntimeError: with trailing error message
:return None: None
"""

if hasattr(module, "check"):
if module.check():
module.run()
else:
if not hasattr(module, "check"):
module.run()
return

if not module.check():
raise RuntimeWarning(
f"{module.details['Category'].title()} module failed! (not vulnerable)")

module.run()

def entry_to_module(self, module: Module) -> None:
""" Prepare to entry the module.
Expand Down

0 comments on commit 241b557

Please sign in to comment.