【Cuckoo】add_path()失败 和 report.json太大解决办法

add_path()失败

>>>from cuckoo.core.database import Database
>>>db=Database()
>>>db.connect()
	    Traceback (most recent call last):
	    File "", line 1, in 
	    File "/home/chenjh/cuckoo/venv/lib/python2.7/site-packages/cuckoo/core/database.py", line 444, in connect
	    dsn = config("cuckoo:database:connection")
	    File "/home/chenjh/cuckoo/venv/lib/python2.7/site-packages/cuckoo/common/config.py", line 1084, in config
	    file_name, cfg=cfg, strict=strict, raw=raw, loose=loose
	    File "/home/chenjh/cuckoo/venv/lib/python2.7/site-packages/cuckoo/common/config.py", line 925, in init
	    config.read(cfg or cwd("conf", "%s.conf" % file_name))
	    File "/home/chenjh/cuckoo/venv/lib/python2.7/site-packages/cuckoo/misc.py", line 62, in cwd
	    return os.path.join(_root, *args)
	    File "/usr/lib64/python2.7/posixpath.py", line 77, in join
	    elif path == '' or path.endswith('/'):
	    AttributeError: 'NoneType' object has no attribute 'endswith'
>>>db.add_path("/data/test_submit/hda.qcow2")
	    Traceback (most recent call last):
	    File "", line 1, in 
	    File "/home/chenjh/cuckoo/venv/lib/python2.7/site-packages/cuckoo/core/database.py", line 1150, in add_path
	    enforce_timeout, clock, "file", submit_id)
	    File "/home/chenjh/cuckoo/venv/lib/python2.7/site-packages/cuckoo/common/utils.py", line 196, in inner
	    return f(self, *args, kwargs)
	    File "/home/chenjh/cuckoo/venv/lib/python2.7/site-packages/cuckoo/core/database.py", line 1026, in add
	    session = self.Session()
	    AttributeError: 'Database' object has no attribute 'Session'

解决办法:

from cuckoo.core.database import Database
from cuckoo.misc import decide_cwd

decide_cwd("path to your cwd")
db = Database()
db.connect()
db.add_path("/tmp/malware.exe")

report.json太大,解决办法:

找到自己cuckoo的cwd路径
一般为/root/.cuckoo/conf/reporting.conf
[jsondump]
enabled = yes
indent = 4
calls = no(原本为yes,改为no)

你可能感兴趣的:(cuckoo,Cuckoo)