Skip to content

Commit 7c4f15a

Browse files
Merge pull request rapid7#21354 from adfoster-r7/improve-checkcode-messages-7
Add human-readable descriptions to CheckCode returns in modules
2 parents 7479078 + 96a37da commit 7c4f15a

116 files changed

Lines changed: 323 additions & 319 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/exploits/multi/http/pandora_upload_exec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,16 @@ def check
7272
if res and res.code == 200
7373
# Tested on v3.1 Build PC100609 and PC100608
7474
if res.body.include?("v3.1 Build PC10060")
75-
return Exploit::CheckCode::Appears
75+
return Exploit::CheckCode::Appears('The target appears to be a vulnerable version')
7676
elsif res.body.include?("Pandora")
77-
return Exploit::CheckCode::Detected
77+
return Exploit::CheckCode::Detected('The target application was detected but the version could not be confirmed as vulnerable')
7878
end
7979
end
80-
return Exploit::CheckCode::Safe
80+
return Exploit::CheckCode::Safe('The target is not running a vulnerable version')
8181
rescue ::Rex::ConnectionError
8282
vprint_error("Connection failed")
8383
end
84-
return Exploit::CheckCode::Unknown
84+
return Exploit::CheckCode::Unknown('Could not connect to the target')
8585
end
8686

8787
# upload a payload using the pandora built-in file upload

modules/exploits/multi/http/papercut_ng_auth_bypass.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,10 @@ def check
202202
# For the check command
203203
bypass_success = bypass_auth
204204
if bypass_success.nil?
205-
return Exploit::CheckCode::Safe
205+
return Exploit::CheckCode::Safe('The target is not vulnerable')
206206
end
207207

208-
return Exploit::CheckCode::Vulnerable
208+
return Exploit::CheckCode::Vulnerable('Successfully verified the authentication bypass')
209209
end
210210

211211
def exploit

modules/exploits/multi/http/pentaho_business_server_authbypass_and_ssti.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,12 @@ def check
124124
'uri' => normalize_uri(target_uri.path, 'api', 'ldap', 'config', 'ldapTreeNodeChildren', "require#{post_require_mixup}#{period_mixup}js")
125125
)
126126

127-
return Exploit::CheckCode::Unknown unless res
127+
return Exploit::CheckCode::Unknown('Could not authenticate to the target') unless res
128128

129129
if res.code == 200 && res.body == '{}'
130-
Exploit::CheckCode::Appears
130+
Exploit::CheckCode::Appears('The target appears to be vulnerable based on the response')
131131
else
132-
Exploit::CheckCode::Safe
132+
Exploit::CheckCode::Safe('The target is not vulnerable')
133133
end
134134
end
135135

modules/exploits/multi/http/phoenix_exec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ def check
5656
test = Rex::Text.rand_text_alpha(8)
5757
res = http_send_command("echo \"#{test}\";")
5858
if res && res.body.include?(test)
59-
return Exploit::CheckCode::Vulnerable
59+
return Exploit::CheckCode::Vulnerable('Successfully verified remote code execution')
6060
end
6161

62-
Exploit::CheckCode::Safe
62+
Exploit::CheckCode::Safe('The target is not vulnerable')
6363
end
6464

6565
def exploit

modules/exploits/multi/http/php_cgi_arg_injection.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def check
8686
return CheckCode::Unknown('Connection failed.') unless response
8787

8888
if response.code == 200 && response.body.to_s.lstrip =~ /^<code><span style/i
89-
return CheckCode::Vulnerable
89+
return CheckCode::Vulnerable('The target is vulnerable')
9090
end
9191

9292
if datastore['PLESK'] && response.code == 500

modules/exploits/multi/http/php_fpm_rce.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ def check
379379

380380
print_good("Parameters found: QSL=#{@params[:qsl]}, customh_length=#{@params[:customh_length]}")
381381
print_good('Target is vulnerable!')
382-
CheckCode::Vulnerable
382+
CheckCode::Vulnerable('The target is vulnerable')
383383
ensure
384384
disconnect(client) if client&.conn?
385385
end

modules/exploits/multi/http/php_utility_belt_rce.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ def check
6060
res = http_send_command("echo #{txt};")
6161

6262
if res && res.body.include?(txt)
63-
Exploit::CheckCode::Vulnerable
63+
Exploit::CheckCode::Vulnerable('Successfully verified arbitrary PHP code execution')
6464
else
65-
Exploit::CheckCode::Safe
65+
Exploit::CheckCode::Safe('The target is not vulnerable')
6666
end
6767
end
6868

modules/exploits/multi/http/phpfilemanager_rce.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ def check
6363
res = http_send_command("echo #{txt}")
6464

6565
if res && res.body =~ /#{txt}/
66-
return Exploit::CheckCode::Vulnerable
66+
return Exploit::CheckCode::Vulnerable('Successfully verified remote command execution vulnerability')
6767
else
68-
return Exploit::CheckCode::Safe
68+
return Exploit::CheckCode::Safe('The target is not vulnerable')
6969
end
7070
end
7171

modules/exploits/multi/http/phpldapadmin_query_engine.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ def check
6969
)
7070

7171
if (res and res.body =~ /phpLDAPadmin \(1\.2\.[0|1]\.\d/i)
72-
return Exploit::CheckCode::Appears
72+
return Exploit::CheckCode::Appears('The target appears to be vulnerable based on the response')
7373
end
7474

75-
return Exploit::CheckCode::Safe
75+
return Exploit::CheckCode::Safe('The target is not vulnerable')
7676
end
7777

7878
def get_session

modules/exploits/multi/http/phpmoadmin_exec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ def check
6363
})
6464

6565
if res and res.body.include?(testrun)
66-
return Exploit::CheckCode::Vulnerable
66+
return Exploit::CheckCode::Vulnerable('The target is vulnerable')
6767
end
6868

69-
Exploit::CheckCode::Safe
69+
Exploit::CheckCode::Safe('The target is not vulnerable')
7070
end
7171

7272
def exploit

0 commit comments

Comments
 (0)