OpenRCE / sulley

A pure-python fully automated and unattended fuzzing framework.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

signal module doesn't have pause method in Python 2.7 for Windows

jimmers opened this issue · comments

Traceback (most recent call last):
File "C:\SE\login.py", line 25, in
sess.fuzz()
File "C:\sulley_build\sulley\sulley\sessions.py", line 540, in fuzz
self.fuzz(self.fuzz_node, path)
File "C:\sulley_build\sulley\sulley\sessions.py", line 553, in fuzz
signal.pause()
AttributeError: 'module' object has no attribute 'pause'

commented

Yeah, this is a known bug, I thought this was fixed a while ago. Are you using sulley from the google code svn or from the master repo here?

I got code via:

git clone https://github.com/OpenRCE/sulley.git

On each fuzzer run I get an exception about pause method missing since I'm running Sulley on Windows.

commented

That's odd, I've never run into that issue myself...

I also meet the problem .on win7 git clone sulley form github.

I've also ran into this problem.
The cause is that the "signal" module on Windows does not implement the "pause()" method:

https://docs.python.org/2/library/signal.html#signal.pause

commented

Is there any solution about this issue? My system is win7 64bits.

I made a pull request but what worked for me is to catch the exception and loop instead:

diff --git a/sulley/sessions.py b/sulley/sessions.py
index 64d8c4c..5f0921c 100644
--- a/sulley/sessions.py
+++ b/sulley/sessions.py
@@ -551,8 +551,13 @@ class session (pgraph.graph):
             # if fuzzing is not finished, web interface thread will catch it
             if self.total_mutant_index == self.total_num_mutations:
                 import signal
-                while True:
-                    signal.pause()
+                try:
+                    while True:
+                        signal.pause()
+                except AttributeError:
+                    # signal.pause() is missing for Windows; wait 1ms and loop instead
+                    while True:
+                        time.sleep(1)


     ####################################################################################################################

Still having the issue ! @jtpereyda suggestion didnt work out. Is this stackoverflow post considered a fix ?