Skip to content

Modify recog verify tool to better match Ruby implementation output#14

Merged
mkienow-r7 merged 2 commits intorapid7:masterfrom
mkienow-r7:feature/recog-verify-match-ruby-output
Nov 3, 2021
Merged

Modify recog verify tool to better match Ruby implementation output#14
mkienow-r7 merged 2 commits intorapid7:masterfrom
mkienow-r7:feature/recog-verify-match-ruby-output

Conversation

@mkienow-r7
Copy link
Copy Markdown
Contributor

@mkienow-r7 mkienow-r7 commented Oct 29, 2021

Description

Small modifications were made to the recog verify tool to better match the Ruby implementation output. The message order did not match the Ruby implementation since Ruby's hash maintains insertion order. In order to resolve this the following changes were made:

  • HashMap replaced with LinkedHashMap
  • HashSet replaced with LinkedHashSet
  • Collapsed consecutive whitespace and trimmed leading and trailing whitespace from the description field

Motivation and Context

This makes it easier to compare output against the Ruby implementation.

How Has This Been Tested?

  • mvn integration-test
  • Compared the Ruby recog_verify output to the com.rapid7.recog.verify.RecogVerifier output. Of the 49 XML fingerprint files from rapid7/recog only 3 created differences and those were the result of the Java implementation not currently supporting base64 encoding. The three files with differences were: ldap_searchresult.xml, snmp_sysdescr.xml, and telnet_banners.xml.
~/recog $ ./bin/recog_verify xml/*.xml > ruby.txt

~/recog-java $ mvn --projects recog-verify exec:java -Dexec.mainClass="com.rapid7.recog.verify.RecogVerifier" -Dexec.args="$(ls -1 xml/*.xml | xargs)" > java.txt

diff ruby.txt java.txt

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist:

  • I have updated the documentation accordingly (or changes are not required).
  • I have added tests to cover my changes (or new tests are not required).
  • All new and existing tests passed.

This makes it easier to compare output against the Ruby implementation.
@mkienow-r7 mkienow-r7 merged commit 17a0c9b into rapid7:master Nov 3, 2021
@mkienow-r7 mkienow-r7 deleted the feature/recog-verify-match-ruby-output branch November 3, 2021 03:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants