jwilk / python-afl

American Fuzzy Lop fork server and instrumentation for pure-Python code
https://jwilk.net/software/python-afl
MIT License
350 stars 33 forks source link

AttributeError: module 'afl' has no attribute 'init' #14

Closed NeuroWinter closed 4 years ago

NeuroWinter commented 4 years ago

Hello all I have just created a new virtual env to play around with python-afl.

However I cant seem to get anything to work. I have tried a few test scripts including the afl-fuzzing-demos. But I am always getting this error:

[-] PROGRAM ABORT : Fork server handshake failed

Also when I just import afl I am getting this error:

projects/fuzz/afl via fuzz-test 
➜ python 
Python 3.6.9 (default, Nov  7 2019, 10:44:02) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import afl
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/neuro/projects/fuzz/afl/afl.py", line 10, in <module>
    afl.init()
AttributeError: module 'afl' has no attribute 'init'
>>> 

projects/fuzz/afl via fuzz-test took 7s 
➜ pip freeze
Cython==0.29.15
python-afl==0.7.2

projects/fuzz/afl via fuzz-test 
➜ which python
/home/neuro/.virtualenvs/fuzz-test/bin/python

projects/fuzz/afl via fuzz-test 
➜ /home/neuro/.virtualenvs/fuzz-test/bin/python --version
Python 3.6.9
jwilk commented 4 years ago

Looks like in the current working directory there's afl.py, which shadows python-afl's afl module. Rename your afl.py to something else and it should work.

NeuroWinter commented 4 years ago

Wow that fixed it!

Thank you so much! Sorry for the silly problem though haha