salesforce / hassh

HASSH is a network fingerprinting standard which can be used to identify specific Client and Server SSH implementations. The fingerprints can be easily stored, searched and shared in the form of a small MD5 fingerprint.
BSD 3-Clause "New" or "Revised" License
532 stars 74 forks source link

Bug: Undeclared sshka when running on Centos 7 #6

Closed ozonejunkieau closed 5 years ago

ozonejunkieau commented 5 years ago

Executing the Python code on Centos 7 with Python 3.7.2 resulted in the following crash:


Traceback (most recent call last):
  File "hassh.py", line 428, in <module>
    main()
  File "hassh.py", line 422, in main
    pout=args.print_output)
  File "hassh.py", line 100, in process_packet
    record = server_hassh(packet)
  File "hassh.py", line 265, in server_hassh
    "sshka": sshka}
UnboundLocalError: local variable 'sshka' referenced before assignment

This appears to be due to the field being empty in the packet.

Attached fix explicitly initialises the relevant pair of variables. It also includes the relevant command to install tshark on Centos 7.

salesforce-cla[bot] commented 5 years ago

Thanks for the contribution! Before we can merge this, we need @ozonejunkieau to sign the Salesforce.com Contributor License Agreement.