Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bug in #1430 #1439

Merged
merged 2 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 10 additions & 17 deletions lib/controller/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,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 @@ -514,18 +511,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
Loading