Skip to content

Commit 4066766

Browse files
author
Emmanuel Fusté
committed
MongoDB identification fix
The actual code grep for "MongoDB" keyword in the head of the HTTP session. In case of "compressed" HTML, a big page is on one line. On a IT page, we could encounter the "MongoDB" keyword and miss-identify the application protocol. Fixed by matching on a longuer string taken from a live MogoDB server.
1 parent 62b5859 commit 4066766

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

testssl.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2360,7 +2360,7 @@ service_detection() {
23602360
[[ -z "$SERVICE" ]] && head $TMPFILE | grep -Eaqi "jabber|xmpp" && SERVICE=XMPP
23612361
[[ -z "$SERVICE" ]] && head $TMPFILE | grep -Eaqw "Jive News|InterNetNews|NNRP|INN|Kerio Connect|NNTP Service|Kerio MailServer|NNTP server" && SERVICE=NNTP
23622362
# MongoDB port 27017 will respond to a GET request with a mocked HTTP response
2363-
[[ "$SERVICE" == HTTP ]] && head $TMPFILE | grep -Eaqw "MongoDB" && SERVICE=MongoDB
2363+
[[ "$SERVICE" == HTTP ]] && head $TMPFILE | grep -Eaqw "you are trying to access MongoDB over HTTP" && SERVICE=MongoDB
23642364
debugme head -50 $TMPFILE | sed -e '/<HTML>/,$d' -e '/<html>/,$d' -e '/<XML/,$d' -e '/<xml/,$d' -e '/<\?XML/,$d' -e '/<\?xml/,$d' -e '/<\!DOCTYPE/,$d' -e '/<\!doctype/,$d'
23652365
fi
23662366

0 commit comments

Comments
 (0)