Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Miscellaneous SNMP, FTP, SSH and HTTP fingerprints #64

Merged
merged 10 commits into from
Jun 9, 2015

Conversation

jhart-r7
Copy link
Contributor

@jhart-r7 jhart-r7 commented Jun 1, 2015

Found after using Recog data to fingerprint a private lab.

@jhart-r7 jhart-r7 assigned jhart-r7 and hdm and unassigned jhart-r7 Jun 1, 2015
@@ -184,8 +184,9 @@ against these patterns to fingerprint FTP servers.
<param pos="0" name="service.family" value="ProFTPD"/>
<param pos="0" name="service.product" value="ProFTPD"/>
</fingerprint>
<fingerprint pattern="^-{10} Welcome to Pure-FTPd (.*)-{10}$">
<fingerprint pattern="^-{9,10} Welcome to Pure-FTPd (.*)-{9,10}$">

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is looking for the ----'s even needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've never seen a default Pure-FTPDd banner that didn't have them, but that doesn't mean there aren't any. In general, in situations like this, we use our best judgement.

I took a look, and Pure-FTPd versions at least from 1.0.11 to 1.0.13 (all from November 2002) use the following for a default banner:

    addreply_noformat(0, "=(<*>)=-.:. (( " MSG_WELCOME_TO 
                      " PureFTPd " VERSION " )) .:.-=(<*>)=-");

Versions newer than that, however, use 9 (not 10) -s. My guess is that the original regex here was wrong but I don't know where that example came from. For now I'd say that the 9 is more correct based on source code but 9-10 may be more accurate for all versions of Pure-FTPd.

For now, I'm going to expand this to account for both variants.

@@ -184,11 +184,21 @@ against these patterns to fingerprint FTP servers.
<param pos="0" name="service.family" value="ProFTPD"/>
<param pos="0" name="service.product" value="ProFTPD"/>
</fingerprint>
<fingerprint pattern="^-{10} Welcome to Pure-FTPd (.*)-{10}$">
<fingerprint pattern="^=\(&lt;\*&gt;\)=\-\.:\. \(\( Welcome to Pure-FTPd ([\d\.]+) \)\) \.:\.\-=\(&lt;\*&gt;\)=\-$">

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't need to escape -'s because they're not in blocks.
Don't need to escape the . in the block for the version because it's not considered a wild card inside a block.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dot seems necessary here as well to match the literal .:.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Paul's comment about . was for ([\d\.]+), which is correct. Fixed on both accounts (nice catch).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@jhart-r7 jhart-r7 assigned gwiseman-r7 and unassigned hdm Jun 9, 2015
@gwiseman-r7 gwiseman-r7 merged commit d2fb488 into rapid7:master Jun 9, 2015
gwiseman-r7 added a commit that referenced this pull request Jun 9, 2015
@jhart-r7 jhart-r7 deleted the bug/lab-cleanup branch June 9, 2015 22:50
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.

None yet

5 participants