Skip to content

Commit

Permalink
add logs to explain what is happening.
Browse files Browse the repository at this point in the history
  • Loading branch information
elyousfi5 committed Mar 11, 2024
1 parent bfe2393 commit 7225d94
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions agent/agent_nuclei.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ def process(self, message: m.Message) -> None:
if self._is_target_already_processed(message) is True:
return

logger.info("Preparing targets.")
targets = self.prepare_targets(message)
# Filter out all the target that are out of scope.
targets = [
Expand All @@ -172,8 +173,10 @@ def process(self, message: m.Message) -> None:
if len(targets) > 0:
templates_urls = self.args.get("template_urls")
if templates_urls is not None:
logger.info("Running custom templates.")
self._run_templates(templates_urls, targets)
if self.args.get("use_default_templates", True):
logger.info("Running default templates.")
self._run_command(targets)
self._mark_target_as_processed(message)
logger.debug("Done processing message of selector : %s", message.selector)
Expand Down Expand Up @@ -480,6 +483,7 @@ def _run_nuclei_command(self, command: list[str]) -> None:
stderr=subprocess.PIPE,
check=True,
)
logger.info("Parsing nuclei output.")
self._parse_output()
except subprocess.CalledProcessError as e:
logger.error("Error running nuclei %s", e)
Expand Down

0 comments on commit 7225d94

Please sign in to comment.