zschema icon indicating copy to clipboard operation
zschema copied to clipboard

Bug using elisticsearch option

Open sei-mwd opened this issue 4 years ago • 0 comments

There is a bug in zschema when using the elasticsearch option:

zschema --module zgrab2_schemas.zgrab2 elasticsearch zgrab2-ftp /mnt/hgfs/Shared/ftp_dod_cidr.json
Traceback (most recent call last):
  File "/usr/local/bin/zschema", line 11, in <module>
    load_entry_point('zschema==0.10.2', 'console_scripts', 'zschema')()
  File "/home/juser/.local/lib/python2.7/site-packages/zschema/__main__.py", line 87, in main
    print json.dumps(record.to_es(recname))
UnboundLocalError: local variable 'recname' referenced before assignment

Removing recname from the to_es() call seems to fix this bug. You should probably check the other to_X() calls, as using recname is not correct most of the time.

sei-mwd avatar Jun 05 '20 18:06 sei-mwd