Skip to content

Commit

Permalink
Merge pull request #1439 from zrquan/patch-1
Browse files Browse the repository at this point in the history
fix bug in #1430
  • Loading branch information
maurosoria authored Dec 18, 2024
2 parents 767fb19 + 82eeb84 commit e9ea7f8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 17 deletions.
27 changes: 10 additions & 17 deletions lib/controller/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,9 @@ def run(self) -> None:
self.requester = Requester()
if options["async_mode"]:
self.loop = asyncio.new_event_loop()
try:
self.loop.add_signal_handler(signal.SIGINT, self.handle_pause)
except NotImplementedError:
# Windows
signal.signal(signal.SIGINT, self.handle_pause)
signal.signal(signal.SIGTERM, self.handle_pause)

signal.signal(signal.SIGINT, lambda *_: self.handle_pause())
signal.signal(signal.SIGTERM, lambda *_: self.handle_pause())

while options["urls"]:
url = options["urls"][0]
Expand Down Expand Up @@ -509,18 +506,14 @@ def is_timed_out(self) -> bool:

def process(self) -> None:
while True:
try:
while not self.fuzzer.is_finished():
if self.is_timed_out():
raise SkipTargetInterrupt(
"Runtime exceeded the maximum set by the user"
)
time.sleep(0.5)

break
while not self.fuzzer.is_finished():
if self.is_timed_out():
raise SkipTargetInterrupt(
"Runtime exceeded the maximum set by the user"
)
time.sleep(0.5)

except KeyboardInterrupt:
self.handle_pause()
break

def add_directory(self, path: str) -> None:
"""Add directory to the recursion queue"""
Expand Down
1 change: 1 addition & 0 deletions lib/core/fuzzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ def start(self) -> None:
self.setup_scanners()
self.setup_threads()
self.play()
self._quit_event.clear()

for thread in self._threads:
thread.start()
Expand Down

0 comments on commit e9ea7f8

Please sign in to comment.