shellphish / fuzzer

A Python interface to AFL, allowing for easy injection of testcases and other functionality.
BSD 2-Clause "Simplified" License
638 stars 130 forks source link

AttributeError: 'Namespace' object has no attribute 'opc_afl' #35

Closed kburova closed 5 years ago

kburova commented 5 years ago

I tried to run shellphuzz after a long and painful installation of fuzzer and driller with all the prereqs for python 3 on Ubuntu 16.04 and got this: [*] Creating fuzzer... Traceback (most recent call last): File "/home/kburova/.virtualenvs/devis/bin/shellphuzz", line 87, in <module> memory=args.memory, seeds=seeds, timeout=args.run_timeout, protocol_fuzz=args.opc_afl, AttributeError: 'Namespace' object has no attribute 'opc_afl'

I removed protocol_fuzz=args.opc_afl, form this line:

fuzzer = fuzzer.Fuzzer( args.binary, args.work_dir, afl_count=args.afl_cores, force_interval=args.force_interval, args.binary, args.work_dir, afl_count=args.afl_cores, force_interval=args.force_interval, create_dictionary=not args.no_dictionary, stuck_callback=stuck_callback, time_limit=args.timeout, create_dictionary=not args.no_dictionary, stuck_callback=stuck_callback, time_limit=args.timeout, memory=args.memory, seeds=seeds, timeout=args.run_timeout memory=args.memory, seeds=seeds, timeout=args.run_timeout, protocol_fuzz=args.opc_afl, )

to make it work, but I'm not sure if that's the best solution.

rhelmot commented 5 years ago

AttributeError: 'Namespace' object has no attribute 'opc_afl indicates that there's something wrong with your python environment. When I see that it usually means I have a folder in my current directory which is shadowing the import of some module. If this doesn't seem to be the case, can you run the script with ipython --pdb to get a debug shell and print out the value of args?

kburova commented 5 years ago

[*] Creating fuzzer...

AttributeError Traceback (most recent call last) ~/.virtualenvs/devis3/bin/shellphuzz in \<module> 5 file = '/home/kburova/Installs/fuzzer/shellphuzz' 6 with open(file) as f: ----> 7 exec(compile(f.read(), file, 'exec'))

~/Installs/fuzzer/shellphuzz in \<module> 85 args.binary, args.work_dir, afl_count=args.afl_cores, force_interval=args.force_interval, 86 create_dictionary=not args.no_dictionary, stuck_callback=stuck_callback, time_limit=args.timeout, ---> 87 memory=args.memory, seeds=seeds, timeout=args.run_timeout, protocol_fuzz=args.opc_afl, 88 ) 89

AttributeError: 'Namespace' object has no attribute 'opc_afl' > /home/kburova/Installs/fuzzer/shellphuzz(87)\<module>() 85 args.binary, args.work_dir, afl_count=args.afl_cores, force_interval=args.force_interval, 86 create_dictionary=not args.no_dictionary, stuck_callback=stuck_callback, time_limit=args.timeout, ---> 87 memory=args.memory, seeds=seeds, timeout=args.run_timeout, protocol_fuzz=args.opc_afl, 88 ) 89

ipdb> print(args)
Namespace(afl_cores=1, binary='/home/kburova/devis_bindir/buggy', driller_timeout=600, driller_workers=None, first_crash=False, force_interval=None, grease_with=None, helper_module=None, ipython=False, length_extension=None, logcfg='.shellphuzz.ini', memory='8G', no_dictionary=False, run_timeout=None, seed_dir=None, tarball=None, timeout=None, work_dir='/dev/shm/work/')

kburova commented 5 years ago

I dont see opc_afl being added to the args parser in the script itself...

rhelmot commented 5 years ago

Yeah okay. I'm not sure what the heck that line was about. I've removed it.

see #34