runZeroInc / recog-go

Recog-Go: Pattern Recognition using Rapid7 Recog
Other
101 stars 30 forks source link

Fix user-supplied pattern/desc parsing #22

Closed pbarry25 closed 1 year ago

pbarry25 commented 1 year ago

Fixes #21.

fingerprint() was splitting the user-supplied pattern/description on spaces before comparing to recog fingerprints.

Example prior to this PR:

$ cd recog-go/cmd/recog_match
$ go run main.go /Users/userx/code/recog/xml/snmp_sysdescr.xml "Prestige 650R-T3"
$
$ go run main.go /Users/userx/code/recog/xml "Prestige 650R-T3"
$
$ go run main.go /Users/userx/code/recog/xml "Eltex - NTP-2"
$

Example with this PR:

$ cd recog-go/cmd/recog_match
$ go run main.go /Users/userx/code/recog/xml "Prestige 650R-T3"
{"fp.certainty":"0.85","matched":"ZxXEL Prestige 650R-T3 ADSL router","os.device":"Broadband Router","os.product":"Prestige 650R-T3","os.vendor":"Zyxel"}
$ go run main.go /Users/userx/code/recog/xml/snmp_sysdescr.xml "Prestige 650R-T3"
{"fp.certainty":"0.85","matched":"ZxXEL Prestige 650R-T3 ADSL router","os.device":"Broadband Router","os.product":"Prestige 650R-T3","os.vendor":"Zyxel"}
$ go run main.go /Users/userx/code/recog/xml "Eltex - NTP-2"
{"fp.certainty":"0.85","hw.cpe23":"cpe:/h:eltex-co:ntp-2:-","hw.device":"Broadband Router","hw.product":"NTP-2","hw.vendor":"Eltex","matched":"Eltex - NTP-2 broadband router","os.cpe23":"cpe:/o:eltex-co:ntp-2_firmware:-","os.device":"Broadband Router","os.product":"NTP-2 Firmware","os.vendor":"Eltex"}