mushorg / conpot

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

int/string in snmp.xml value "Assert error" #571

Open hack3rman opened 2 years ago

hack3rman commented 2 years ago

Don't attach images of terminals but provide the text.

Describe the bug According to the documentation you can assign values directly in the template. However I receive an assertion error and the only way is to define the value as variable in the template.

To Reproduce Steps to reproduce the behavior:

  1. <mib name="IF-MIB">
    <symbol name="ifNumber">
        <value>2</value>
    </symbol>
    </mib>
  2. Restart
  3. See error
    Traceback (most recent call last):
    File "src/gevent/greenlet.py", line 906, in gevent._gevent_cgreenlet.Greenlet.run
    File "/home/conpot/.local/lib/python3.8/site-packages/conpot/protocols/snmp/snmp_server.py", line 185, in start
    self.xml_mib_config()
    File "/home/conpot/.local/lib/python3.8/site-packages/conpot/protocols/snmp/snmp_server.py", line 110, in xml_mib_config
    value = conpot_core.get_databus().get_value(
    File "/home/conpot/.local/lib/python3.8/site-packages/conpot/core/databus.py", line 43, in get_value
    assert key in self._data
    AssertionError
    2022-03-15T11:58:52Z <ServiceGreenlet "SNMPServer" at 0x7fca0dec4150: <bound method SNMPServer.start of <conpot.protocols.snmp.snmp_server.SNMPServer object at 0x7fca0deb5550>>('0.0.0.0', 16100)> failed with AssertionError

Expected behavior int and strings should be interpreted directly in the module template.