Skip to content

Commit

Permalink
Merge pull request #684 from AkikoOrenji/AkikoOrenji-nuclei.py-fixes-1
Browse files Browse the repository at this point in the history
Update nuclei.py for usability and improve error handling
  • Loading branch information
TheTechromancer authored Sep 1, 2023
2 parents 0da5a94 + ea66ab7 commit c84d50d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion bbot/modules/deadly/nuclei.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ async def setup(self):
self.warning(f"Failure while updating nuclei templates: {update_results.stderr}")
else:
self.warning("Error running nuclei template update command")

self.proxy = self.scan.config.get("http_proxy", "")
self.mode = self.config.get("mode", "severe")
self.ratelimit = int(self.config.get("ratelimit", 150))
self.concurrency = int(self.config.get("concurrency", 25))
Expand Down Expand Up @@ -135,6 +135,9 @@ async def handle_batch(self, *events):
cleaned_host = temp_target.get(host)
source_event = self.correlate_event(events, cleaned_host)

if not source_event:
continue

if url == "":
url = str(source_event.data)

Expand Down Expand Up @@ -204,6 +207,10 @@ async def execute_nuclei(self, nuclei_input):
command.append("-t")
command.append(self.budget_templates_file)

if self.proxy:
command.append("-proxy")
command.append(f"{self.proxy}")

stats_file = self.helpers.tempfile_tail(callback=self.log_nuclei_status)
try:
with open(stats_file, "w") as stats_fh:
Expand Down

0 comments on commit c84d50d

Please sign in to comment.