mushorg / conpot

ICS/SCADA honeypot
GNU General Public License v2.0
1.24k stars 414 forks source link

Error when try to run Conpot #107

Closed zam89 closed 10 years ago

zam89 commented 10 years ago

Hi everyone,

I've install conpot on Ubuntu Server 12.04 64-bit. I follow the guide from https://github.com/glastopf/conpot/blob/master/docs/source/installation/ubuntu.rst

The installation seems has no error. But when I try to run the conpot, it shows this kind of error:

conpot@conpot-box:~$ sudo conpot

  Version 0.2.2
  Glastopf Project

2013-11-22 11:30:13,044 Fetched X.X.X.253 as external ip.
2013-11-22 11:30:13,045 Starting Conpot using template found in: /usr/local/lib/python2.7/dist-packages/Conpot-0.2.2-py2.7.egg/conpot/templates/default.xml
2013-11-22 11:30:13,045 Starting Conpot using configuration found in: /usr/local/lib/python2.7/dist-packages/Conpot-0.2.2-py2.7.egg/conpot/conpot.cfg
2013-11-22 11:30:13,046 Starting Conpot using www templates found in: /usr/local/lib/python2.7/dist-packages/Conpot-0.2.2-py2.7.egg/conpot/www/
Traceback (most recent call last):
  File "/usr/local/bin/conpot", line 5, in <module>
    pkg_resources.run_script('Conpot==0.2.2', 'conpot')
  File "/usr/local/lib/python2.7/dist-packages/distribute-0.6.35-py2.7.egg/pkg_resources.py", line 505, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/local/lib/python2.7/dist-packages/distribute-0.6.35-py2.7.egg/pkg_resources.py", line 1245, in run_script
    execfile(script_filename, namespace, namespace)
  File "/usr/local/lib/python2.7/dist-packages/Conpot-0.2.2-py2.7.egg/EGG-INFO/scripts/conpot", line 210, in <module>
    main()
  File "/usr/local/lib/python2.7/dist-packages/Conpot-0.2.2-py2.7.egg/EGG-INFO/scripts/conpot", line 159, in main
    modbus_instance = ModbusServer(args.template, log_queue)
  File "/usr/local/lib/python2.7/dist-packages/Conpot-0.2.2-py2.7.egg/conpot/modbus/modbus_server.py", line 44, in _ _init_ _
    slave = self.add_slave(slave_id)
  File "/usr/local/lib/python2.7/dist-packages/modbus_tk-0.4.2-py2.7.egg/modbus_tk/modbus.py", line 877, in add_slave
    return self._databank.add_slave(slave_id)
  File "/usr/local/lib/python2.7/dist-packages/Conpot-0.2.2-py2.7.egg/conpot/modbus/slave_db.py", line 26, in add_slave
    self._slaves[slave_id] = MBSlave(slave_id, self.dom)
  File "/usr/local/lib/python2.7/dist-packages/Conpot-0.2.2-py2.7.egg/conpot/modbus/slave.py", line 22, in _ _init_ _
    defines.DEVICE_INFO: self._device_info,
AttributeError: 'module' object has no attribute 'DEVICE_INFO'

Can someone guide me if I heading to right path? Or I missing something?

Thanks. :+1:

johnnykv commented 10 years ago

It is not working because you are using the original modbus-tk, you need to use the modbus-tk from glastopf: https://github.com/glastopf/modbus-tk

glaslos commented 10 years ago

Check if this fixed your issue: 8586269cd13a3ef5bc2671d58d164c8ac700a88b The version from modbus was missing that feature. Alternatively you can install modbus-tk from here: https://github.com/glastopf/modbus-tk

glaslos commented 10 years ago

@johnnykv You are almost correct ;)

glaslos commented 10 years ago

DEVICE_INFO was introduced here: #97 and here https://github.com/glastopf/modbus-tk/commit/b56f6e484b473172fbac2a753509a3cb8a86abe9

zam89 commented 10 years ago

Ah. I see. I've installed the modbus_tk via pip install. That's why I got this problem.

I remove using this command: sudo pip uninstall modbus_tk Then I install modbus_tk from here = https://github.com/glastopf/modbus-tk, then everything is working now.

Thanks! :) :+1: