Skip to content

Commit 85926e1

Browse files
committed
Improve check
1 parent 5a2d291 commit 85926e1

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

modules/exploits/linux/http/pandora_fms_sqli.rb

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -62,27 +62,30 @@ def uri
6262

6363

6464
def check
65-
# Check version
6665
vprint_status("#{peer} - Trying to detect installed version")
6766

67+
version = nil
6868
res = send_request_cgi({
6969
'method' => 'GET',
7070
'uri' => normalize_uri(uri, 'index.php')
7171
})
7272

73-
if res && res.code == 200 && res.body =~ /Pandora FMS - the Flexible Monitoring System/ && res.body =~ /(?<=xx-small;">v)(.*?)(?=<\/td>)/
74-
version = $1
75-
vprint_status("#{peer} - Pandora FMS version #{version} detected")
76-
else
77-
vprint_status("#{peer} - Unable to access Pandora FMS")
78-
return Exploit::CheckCode::Unknown
73+
if res && res.code == 200 && res.body =~ /Pandora FMS - the Flexible Monitoring System/
74+
if res.body =~ /<div id="ver_num">v(.*?)<\/div>/
75+
version = $1
76+
else
77+
return Exploit::CheckCode::Detected
78+
end
7979
end
8080

81-
if version && version <= '4.1.1'
82-
return Exploit::CheckCode::Appears
83-
else
84-
return Exploit::CheckCode::Safe
81+
unless version.nil?
82+
vprint_status("#{peer} - Pandora FMS #{version} found")
83+
if Gem::Version.new(version) <= Gem::Version.new('5.0SP2')
84+
return Exploit::CheckCode::Appears
85+
end
8586
end
87+
88+
Exploit::CheckCode::Safe
8689
end
8790

8891

0 commit comments

Comments
 (0)