rapid7 / recog

Pattern recognition for hosts, services, and content
Other
662 stars 195 forks source link

Update README.md testing matches to set grep color to never #564

Closed mkienow-r7 closed 1 year ago

mkienow-r7 commented 1 year ago

Description

Updates README.md testing matches examples to set the grep color to never to avoid possible issues.

I discovered having grep aliased to grep --color=always caused some confusion when experimenting with the new examples under the "Testing matches" section added in #557.

$ echo 'laravel_session=eyJ...etc..etc...%3D; expires=Mon, 13-Mar-2023 16:48:58 GMT; Max-Age=7200; path=/; httponly; samesite=lax' | bin/recog_match xml/http_cookies.xml -
MATCH: {"matched"=>"Laravel PHP web application framework", "service.vendor"=>"Laravel", "service.product"=>"Laravel", "service.cpe23"=>"cpe:/a:laravel:laravel:-", "service.protocol"=>"http", "fingerprint_db"=>"http_header.cookie", "data"=>"laravel_session=eyJ...etc..etc...%3D; expires=Mon, 13-Mar-2023 16:48:58 GMT; Max-Age=7200; path=/; httponly; samesite=lax"}

$ echo 'Set-Cookie: laravel_session=eyJ...etc..etc...%3D; expires=Mon, 13-Mar-2023 16:48:58 GMT; Max-Age=7200; path=/; httponly; samesite=lax' | grep -i '^Set-Cookie:' | cut -d: -f2- | bin/recog_match xml/http_cookies.xml -
FAIL:  laravel_session=eyJ...etc..etc...%3D; expires=Mon, 13-Mar-2023 16:48:58 GMT; Max-Age=7200; path=/; httponly; samesite=lax
$ echo 'Set-Cookie: laravel_session=eyJ...etc..etc...%3D; expires=Mon, 13-Mar-2023 16:48:58 GMT; Max-Age=7200; path=/; httponly; samesite=lax' | grep -i '^Set-Cookie:' | cut -d: -f2- | hexdump -C
C
00000000  1b 5b 6d 1b 5b 4b 20 6c  61 72 61 76 65 6c 5f 73  |.[m.[K laravel_s|
00000000  1b 5b 6d 1b 5b 4b 20 6c  61 72 61 76 65 6c 5f 73  |.[m.[K laravel_s|
...

$ echo 'Set-Cookie: laravel_session=eyJ...etc..etc...%3D; expires=Mon, 13-Mar-2023 16:48:58 GMT; Max-Age=7200; path=/; httponly; samesite=lax' | grep -i --color=never '^Set-Cookie:' | cut -d: -f2- | hexdump -CC
00000000  20 6c 61 72 61 76 65 6c  5f 73 65 73 73 69 6f 6e  | laravel_session|
00000000  20 6c 61 72 61 76 65 6c  5f 73 65 73 73 69 6f 6e  | laravel_session|
...

$ echo 'Set-Cookie: laravel_session=eyJ...etc..etc...%3D; expires=Mon, 13-Mar-2023 16:48:58 GMT; Max-Age=7200; path=/; httponly; samesite=lax' | grep -i --color=never '^Set-Cookie:' | cut -d: -f2- | bin/recog_match xml/http_cookies.xml -
MATCH: {"matched"=>"Laravel PHP web application framework", "service.vendor"=>"Laravel", "service.product"=>"Laravel", "service.cpe23"=>"cpe:/a:laravel:laravel:-", "service.protocol"=>"http", "fingerprint_db"=>"http_header.cookie", "data"=>"laravel_session=eyJ...etc..etc...%3D; expires=Mon, 13-Mar-2023 16:48:58 GMT; Max-Age=7200; path=/; httponly; samesite=lax"}

Motivation and Context

Help reduce the barrier to testing Recog fingerprint matches

How Has This Been Tested?

See notes under description

Types of changes

Checklist: