Skip to content

Commit 5b58f28

Browse files
authored
Merge pull request #21304 from adfoster-r7/improve-auxiliary-check-code-messages
Improve auxiliary check code messages
2 parents 3106aef + 31ef5e0 commit 5b58f28

78 files changed

Lines changed: 221 additions & 220 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

modules/auxiliary/admin/dcerpc/cve_2020_1472_zerologon.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@ def check
101101
fail_with(Failure::UnexpectedReply, windows_error)
102102
end
103103

104-
return Exploit::CheckCode::Detected unless status == 0
104+
return Exploit::CheckCode::Detected('Target responded but Zerologon exploit did not succeed') unless status == 0
105105

106-
Exploit::CheckCode::Vulnerable
106+
Exploit::CheckCode::Vulnerable('Zerologon authentication bypass succeeded')
107107
end
108108

109109
def run

modules/auxiliary/admin/hp/hp_ilo_create_admin_account.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,14 @@ def check
5656
}
5757
})
5858
rescue StandardError
59-
return Exploit::CheckCode::Unknown
59+
return Exploit::CheckCode::Unknown('Failed to connect to the target')
6060
end
6161

6262
if (res.code == 200) && res.body.include?('"Description":"iLO User Accounts"')
63-
return Exploit::CheckCode::Vulnerable
63+
return Exploit::CheckCode::Vulnerable('Authentication bypass returned iLO User Accounts')
6464
end
6565

66-
return Exploit::CheckCode::Safe
66+
return Exploit::CheckCode::Safe('Authentication bypass did not return account data')
6767
end
6868

6969
def run

modules/auxiliary/admin/http/cisco_ssm_onprem_account.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def check
143143
return Exploit::CheckCode::Appears('Password reset was successful, target is vulnerable')
144144
end
145145

146-
Exploit::CheckCode::Unknown
146+
Exploit::CheckCode::Unknown('Password reset status could not be determined')
147147
end
148148

149149
def decode_url(encoded_string)

modules/auxiliary/admin/http/fortinet_fortiweb_create_admin.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def check
7777
j = JSON.parse(res.body)
7878

7979
# Tested against vulnerable FortiWeb versions 8.0.1, 7.4.8, 6.4.3, and 6.3.9
80-
return Exploit::CheckCode::Appears if j.dig('results', 'errcode') == -56
80+
return Exploit::CheckCode::Appears('Authentication bypass succeeded on FortiWeb') if j.dig('results', 'errcode') == -56
8181

8282
Exploit::CheckCode::Unknown('Unexpected JSON results')
8383
rescue JSON::ParserError

modules/auxiliary/admin/http/hikvision_unauth_pwd_reset_cve_2017_7921.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,9 @@ def check
118118
user_array.each do |user|
119119
print_status("USERNAME:#{user&.at_css('userName')&.content} | ID:#{user&.at_css('id')&.content} | ROLE:#{user&.at_css('userLevel')&.content}")
120120
end
121-
return Exploit::CheckCode::Vulnerable
121+
return Exploit::CheckCode::Vulnerable('Unauthenticated access to user credentials succeeded')
122122
else
123-
return Exploit::CheckCode::Safe
123+
return Exploit::CheckCode::Safe("Target returned HTTP #{res.code}")
124124
end
125125
end
126126

modules/auxiliary/admin/http/ibm_drm_download.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ def check
7575
}
7676
})
7777
if res && (res.code == 302)
78-
return Exploit::CheckCode::Detected
78+
return Exploit::CheckCode::Detected('IBM DRM web interface detected')
7979
end
8080

81-
Exploit::CheckCode::Unknown
81+
Exploit::CheckCode::Unknown('Could not determine if target is IBM DRM')
8282
end
8383

8484
def create_session_id

modules/auxiliary/admin/http/idsecure_auth_bypass.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,19 +47,19 @@ def check
4747
'uri' => normalize_uri(target_uri.path, 'api/util/configUI')
4848
})
4949
rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout, ::Rex::ConnectionError
50-
return Exploit::CheckCode::Unknown
50+
return Exploit::CheckCode::Unknown('Connection failed')
5151
end
5252

53-
return Exploit::CheckCode::Unknown unless res&.code == 401
53+
return Exploit::CheckCode::Unknown('Target did not return HTTP 401') unless res&.code == 401
5454

5555
data = res.get_json_document
5656
version = data['Version']
57-
return Exploit::CheckCode::Unknown if version.nil?
57+
return Exploit::CheckCode::Unknown('Could not determine IDSecure version') if version.nil?
5858

5959
print_status('Got version: ' + version)
60-
return Exploit::CheckCode::Safe unless Rex::Version.new(version) <= Rex::Version.new('4.7.43.0')
60+
return Exploit::CheckCode::Safe("IDSecure version #{version} is not vulnerable") unless Rex::Version.new(version) <= Rex::Version.new('4.7.43.0')
6161

62-
return Exploit::CheckCode::Appears
62+
return Exploit::CheckCode::Appears("IDSecure version #{version} is vulnerable")
6363
end
6464

6565
def run

modules/auxiliary/admin/http/intersil_pass_reset.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,16 @@ def check
5858

5959
if res && (m = res.headers['Server'].match(%r{Boa/(.*)}))
6060
vprint_status("Boa Version Detected: #{m[1]}")
61-
return Exploit::CheckCode::Safe if (m[1][0].ord - 48 > 0) # boa server wrong version
62-
return Exploit::CheckCode::Safe if (m[1][3].ord - 48 > 4)
61+
return Exploit::CheckCode::Safe("Boa version #{m[1]} is not vulnerable") if (m[1][0].ord - 48 > 0) # boa server wrong version
62+
return Exploit::CheckCode::Safe("Boa version #{m[1]} is not vulnerable") if (m[1][3].ord - 48 > 4)
6363

64-
return Exploit::CheckCode::Vulnerable
64+
return Exploit::CheckCode::Vulnerable("Boa version #{m[1]} is vulnerable")
6565
end
6666

6767
return Exploit::CheckCode::Safe('Not a Boa Server!')
6868
rescue Rex::ConnectionRefused
6969
print_error('Connection refused by server.')
70-
return Exploit::CheckCode::Safe
70+
return Exploit::CheckCode::Safe('Connection refused by server')
7171
end
7272

7373
def run

modules/auxiliary/admin/http/ivanti_vtm_admin.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ def check
6161
version = match[1]
6262
return Exploit::CheckCode::Appears("Version: #{version}") if Rex::Version.new(version) <= Rex::Version.new('22.7R1')
6363
else
64-
return Exploit::CheckCode::Safe
64+
return Exploit::CheckCode::Safe('Could not detect Ivanti vTM version')
6565
end
6666

67-
Exploit::CheckCode::Safe
67+
Exploit::CheckCode::Safe('Ivanti vTM version is not vulnerable')
6868
end
6969

7070
def run

modules/auxiliary/admin/http/joomla_registration_privesc.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,28 +52,28 @@ def check
5252

5353
unless res
5454
vprint_error('Unable to connect to target')
55-
return Exploit::CheckCode::Unknown
55+
return Exploit::CheckCode::Unknown('Unable to connect to target')
5656
end
5757

5858
unless joomla_and_online?
5959
vprint_error('Unable to detect Joomla')
60-
return Exploit::CheckCode::Safe
60+
return Exploit::CheckCode::Safe('Target does not appear to be Joomla')
6161
end
6262

6363
version = Rex::Version.new(joomla_version)
6464

6565
unless version
6666
vprint_error('Unable to detect Joomla version')
67-
return Exploit::CheckCode::Detected
67+
return Exploit::CheckCode::Detected('Joomla detected but version could not be determined')
6868
end
6969

7070
vprint_status("Detected Joomla version #{version}")
7171

7272
if version.between?(Rex::Version.new('3.4.4'), Rex::Version.new('3.6.3'))
73-
return Exploit::CheckCode::Appears
73+
return Exploit::CheckCode::Appears("Joomla #{version} is in the vulnerable range 3.4.4-3.6.3")
7474
end
7575

76-
Exploit::CheckCode::Safe
76+
Exploit::CheckCode::Safe("Joomla #{version} is not in the vulnerable range")
7777
end
7878

7979
def get_csrf(hidden_fields)

0 commit comments

Comments
 (0)