close
Skip to content

Updated version detection methods in http-fingerprints.lua#767

Closed
rewanthtammana wants to merge 8 commits into
nmap:masterfrom
rewanthtammana:fingerprints
Closed

Updated version detection methods in http-fingerprints.lua#767
rewanthtammana wants to merge 8 commits into
nmap:masterfrom
rewanthtammana:fingerprints

Conversation

@rewanthtammana
Copy link
Copy Markdown
Contributor

Detects version by scraping meta tags, rss feed, readme pages, etc..

@rewanthtammana rewanthtammana changed the title Updated version detection in http-fingerprints.lua Updated version detection methods in http-fingerprints.lua Mar 17, 2017
@Varunram
Copy link
Copy Markdown

Varunram commented Mar 17, 2017

As mentioned in http://seclists.org/nmap-dev/2017/q1/211 and http://seclists.org/nmap-dev/2017/q1/211, Joomla and Wordpress have fingerprints which cover a wide range of possibilities.

Joomla version fingerprints - 8233
Wordpress versions - line 7047, 7177, 7247 among others

Updating them would be a better option to avoid the possibility of duplicate fingerprints

@rewanthtammana
Copy link
Copy Markdown
Contributor Author

rewanthtammana commented Mar 17, 2017

@Varunram You are exactly right and I did the same thing. Please have a look at the modified script and I cross checked the new code against 10 websites and its working good.

Copy link
Copy Markdown

@dmiller-nmap dmiller-nmap left a comment

Choose a reason for hiding this comment

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

Just a few minor changes. Thanks!

output = 'WordPress 3.0.x found'
},
{
output = 'Wordpress login page.'
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why were these matches removed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm sure these will be of great help and hence I restored them. Thanks for pointing out.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Committed as bdce616.

Comment thread nselib/data/http-fingerprints.lua Outdated
},
matches = {
{
match = '[V|v]ersion ([0-9 .]*)',
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is a pretty general match for a page as general as "readme.html". Can we make a more specific match to ensure it is Wordpress before extracting the version? e.g. "WordPress.*[Vv]ersion ([0-9.]+)" (note use of + instead of * to ensure there is something there).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Committed as b0a2ee5.

Comment thread nselib/data/http-fingerprints.lua Outdated
output = 'WordPress version: \\1'
},
{
match = '/wp-includes\\/js\\/wp-emoji-release.min.js?ver=([0-9 .]*)',
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Lots of urls like this could work besides wp-emoji-release. Can we change this to '/wp-includes/js/[%w.-]+.js?ver=([0-9.]+)'? Also note that "/" does not need to be escaped in lua patterns.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No, Dan. We can't use "/wp-includes/js/[%w.-]+.js?ver=([0-9.]+)" because there are CSS and JS files which are linked in WordPress through external scripts.

For example,
"/wp-includes/js/jquery/jquery.js?ver=1.7.1" also matches the regex proposed above. But this refers to Jquery version not WordPress version, so I think its better to use string instead of regex.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I still think we should expand this to include other files that may be linked according to WordPress version. Not every site uses the wp-emoji plugin, and they may not use the minified version, either. What other script names could be used here? I see wp-embed in use in more of the sites in wordpress.org's "showcase," so we could at least check for that.

@dmiller-nmap
Copy link
Copy Markdown

This looks good. I do suggest adding more wp-includes/js matches if you can find them. Otherwise, go ahead and commit.

@rewanthtammana
Copy link
Copy Markdown
Contributor Author

Added more matches based on wp-includes/. Committed as 0ef0115

@nmap-bot nmap-bot closed this in 29b4615 Aug 23, 2017
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.

3 participants