Bugfix in Versiondetection. Without this Fix a very long string is detected as WPVersion and wpscan crashes on determing the vulns from XML because the string is used as xpath

This commit is contained in:
Christian Mehlmauer
2013-01-14 14:27:12 +01:00
parent 91187a0db3
commit 96d82405df
3 changed files with 7 additions and 1 deletions

View File

@@ -168,6 +168,6 @@ class WpVersion < Vulnerable
# Used to check if the version is correct: must contain at least one dot.
def self.version_pattern
'([^\r\n]+[\.][^\r\n]+)'
'([^\r\n"\']+\.[^\r\n"\']+)'
end
end

View File

@@ -52,6 +52,11 @@ describe WpVersion do
@fixture = fixtures_dir + "/invalid_version.htm"
@expected = nil
end
it "should return 3.5" do
@fixture = fixtures_dir + "/3.5_minified.htm"
@expected = "3.5"
end
end
describe "#find_from_rss_generator" do

View File

@@ -0,0 +1 @@
<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://site.at/wp-includes/wlwmanifest.xml" /> <meta name="generator" content="WordPress 3.5" /> </head> <body class="home blog"> <div id="main-container"> <div id="skip-navigation"> <ol> <li><a href="#inhalt" title="Zum Inhalt springen">Zum Inhalt springen...</a></li> <li><a href="#navigation" title="Zur Navigation springen">Zur Navigation springen...</a></li> <li><a href="#institute" title="Zu den Instituten springen">Zu den Instituten springen...</a></li>