shiva-spampot / shiva

Spam Honeypot with Intelligent Virtual Analyzer
MIT License
131 stars 36 forks source link

shiva in hpfeed only-mode does not work #11

Open tweemeterjop opened 9 years ago

tweemeterjop commented 9 years ago

When installing a shiva sensor in hpfeed only-mode (without a mysql db) the analyzer doesnt run. The analyzer is killed by a python error:

Traceback (most recent call last):
  File "/opt/shiva/shivaAnalyzer/bin/lamson", line 7, in <module>
    args.parse_and_run_command(sys.argv[1:], commands, default_command="help")
  File "/opt/shiva/shivaAnalyzer/local/lib/python2.7/site-packages/modargs/args.py", line 381, in parse_and_run_command
    command_module(mod, command, options, cli_options=cli_options)
  File "/opt/shiva/shivaAnalyzer/local/lib/python2.7/site-packages/modargs/args.py", line 286, in command_module
    function(**options)
  File "/opt/shiva/shivaAnalyzer/local/lib/python2.7/site-packages/lamson/commands.py", line 122, in start_command
    utils.start_server(pid, FORCE, chroot, chdir, uid, gid, umask, loader, debug)
  File "/opt/shiva/shivaAnalyzer/local/lib/python2.7/site-packages/lamson/utils.py", line 121, in start_server
    settings.receiver.start()
  File "/opt/shiva/shivaAnalyzer/local/lib/python2.7/site-packages/lamson/server.py", line 265, in start
    mainDb.execute(whitelist)
AttributeError: 'NoneType' object has no attribute 'execute'

The server.py in analyzer/core needs a whitelist which is pulled from the db. However this is not enabled/installed.

Also the value localdb from the shiva.conf is never checked. When this value is false, none of the mysql code should be called.

b0nd commented 9 years ago

Hi tweemeterjop,

Thanks for reporting. We are aware of this issue and it cropped when whitelisting concept was introduced. Glad to see you digging deep, forcing us to gear up to fix issues. I am keeping this issue open until fixed.

Cheers!