Easy avoided but perhaps worth fixing...
If you set the name of your VirtualBox guest as a number such as '7' (just the number) and configure that in the machine configuration conf/virtualbox.conf machine list unexpected behaviour in Python will crash Cuckoo back to shell, insisting (quite rightly) that an "int object has no attribute strip". Looks like Python is helpfully typing the label as an integer. A more sane label of 'Seven' works fine.
A quick review of the code locations in the stack trace does not suggest a simple solution, but perhaps a check could be added in common/abstracts.py function _initialize_check ?
hth,
adric
=== Exception details ===
Cuckoo version: 2.0-dev
OS version: posix
OS release: Ubuntu 14.04 trusty
Python version: 2.7.6
Machine arch: x86_64
Git version: 7a470ebd5e1ccbe22681e8af2738480f93d46bd7
Traceback (most recent call last):
File "./cuckoo.py", line 122, in <module>
cuckoo_main(max_analysis_count=args.max_analysis_count)
File "./cuckoo.py", line 93, in cuckoo_main
sched.start()
File "/home/lts/cuckoo/lib/cuckoo/core/scheduler.py", line 639, in start
self.initialize()
File "/home/lts/cuckoo/lib/cuckoo/core/scheduler.py", line 584, in initialize
machinery.initialize(machinery_name)
File "/home/lts/cuckoo/lib/cuckoo/common/abstracts.py", line 90, in initialize
self._initialize(module_name)
File "/home/lts/cuckoo/lib/cuckoo/common/abstracts.py", line 108, in _initialize
for machine_id in mmanager_opts["machines"].strip().split(","):
AttributeError: 'int' object has no attribute 'strip'
The bigger issue here is that we should normalize configuration parsing. To be addressed another time :-) Thanks.
I'd like to work on this issue, but I might need some guidance.
@mack7121 Nice! What needs to happen is that we need to introduce a centralized list of available configuration & analysis options and their types (and optionally custom verification routines). This will then have to be used in order to load the configuration and parse it accordingly.
As an example, by pre-defining that VM names are always strings, Cuckoo shouldn't try to parse it as an integer and thus should avoid the issue posted above.
Furthermore, by centralizing this knowledge (there a lot of options hidden away in modules with zero documentation), we may also document the options at the same time, allowing us to generate documentation out of this information (semi-)automatically.
Is this enough information for you to get started with? :-)
A related issue may be followed here https://github.com/cuckoosandbox/cuckoo/issues/547. Let's keep both open for the time being though (there's some useful information in both issues).
@jbremer yep that's plenty of info. If I get stuck I'll let you know. Thanks
Any luck @mack7121? :-)
Hey @jbremer , I think I fixed it, but I need a little help with configuration to test it more. How should I share my code?
You could simply share the changes here. I have to mention that this issue has been resolved as part of #863 already, though, so I'm going to close this issue for that reason.
Most helpful comment
The bigger issue here is that we should normalize configuration parsing. To be addressed another time :-) Thanks.