Skip to content

Commit c400c24

Browse files
committed
Add human-readable descriptions to CheckCode returns in linux/http exploit modules (A-M)
1 parent 9efc727 commit c400c24

108 files changed

Lines changed: 295 additions & 295 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/linux/http/accellion_fta_getstatus_oauth.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def check
7474
})
7575

7676
unless res && res.code == 200 && res.body.to_s =~ /"result_msg":"MD5 token is invalid"/
77-
return Exploit::CheckCode::Safe
77+
return Exploit::CheckCode::Safe('The target is not vulnerable')
7878
end
7979

8080
res = send_request_cgi({
@@ -87,10 +87,10 @@ def check
8787
})
8888

8989
unless res && res.code == 200 && res.body.to_s =~ /"result_msg":"Success","transaction_id":"/
90-
return Exploit::CheckCode::Safe
90+
return Exploit::CheckCode::Safe('The target is not vulnerable')
9191
end
9292

93-
Msf::Exploit::CheckCode::Vulnerable
93+
Msf::Exploit::CheckCode::Vulnerable('The target is vulnerable')
9494
end
9595

9696
def exploit

modules/exploits/linux/http/advantech_switch_bash_env_exec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,19 +75,19 @@ def check
7575
)
7676
if !res
7777
vprint_error("No response from host")
78-
return Exploit::CheckCode::Unknown
78+
return Exploit::CheckCode::Unknown('Could not determine the target status')
7979
elsif res.headers['Server'] =~ /Boa\/(.*)/
8080
vprint_status("Found Boa version #{$1}")
8181
else
8282
print_status("Target is not a Boa web server")
83-
return Exploit::CheckCode::Safe
83+
return Exploit::CheckCode::Safe('The target is not vulnerable')
8484
end
8585

8686
if res.body.to_s.index('127.0.0.1 ping statistics')
87-
return Exploit::CheckCode::Detected
87+
return Exploit::CheckCode::Detected('The target service was detected')
8888
else
8989
vprint_error("Target does not appear to be an Advantech switch")
90-
return Expoit::CheckCode::Safe
90+
return Expoit::CheckCode::Safe('The target is not vulnerable')
9191
end
9292
end
9393

modules/exploits/linux/http/airties_login_cgi_bof.rb

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

7171
if res && [200, 301, 302].include?(res.code) && res.body.to_s =~ /login.html\?ErrorCode=2/
72-
return Exploit::CheckCode::Detected
72+
return Exploit::CheckCode::Detected('The target service was detected')
7373
end
7474
rescue ::Rex::ConnectionError
75-
return Exploit::CheckCode::Unknown
75+
return Exploit::CheckCode::Unknown('Could not determine the target status')
7676
end
7777

78-
Exploit::CheckCode::Unknown
78+
Exploit::CheckCode::Unknown('Could not determine the target status')
7979
end
8080

8181
def exploit

modules/exploits/linux/http/alienvault_exec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ def check
8787
})
8888

8989
if res && res.code == 200 && res.body =~ /XPATH syntax error: ':#{r}'/
90-
Exploit::CheckCode::Vulnerable
90+
Exploit::CheckCode::Vulnerable('The target is vulnerable')
9191
else
92-
Exploit::CheckCode::Safe
92+
Exploit::CheckCode::Safe('The target is not vulnerable')
9393
end
9494
end
9595

modules/exploits/linux/http/alienvault_sqli_exec.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 == 200 && res.body =~ /#{marker}726F6F7440[0-9a-zA-Z]+#{marker}/ # 726F6F7440 = root
78-
return Exploit::CheckCode::Vulnerable
78+
return Exploit::CheckCode::Vulnerable('The target is vulnerable')
7979
else
8080
print_status("#{res.body}")
81-
return Exploit::CheckCode::Safe
81+
return Exploit::CheckCode::Safe('The target is not vulnerable')
8282
end
8383
end
8484

modules/exploits/linux/http/apache_airflow_dag_rce.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def check
103103
end
104104

105105
unless Rex::Version.new(version_number) < Rex::Version.new('1.10.11')
106-
return CheckCode::Safe
106+
return CheckCode::Safe("Version #{version_number} is not vulnerable")
107107
end
108108

109109
vprint_status(
@@ -115,7 +115,7 @@ def check
115115
check_task
116116
check_unpaused
117117

118-
return CheckCode::Appears
118+
return CheckCode::Appears("Version #{version_number} appears to be vulnerable")
119119
end
120120

121121
def check_api

modules/exploits/linux/http/apache_continuum_cmd_exec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ def check
5656
)
5757

5858
if res && res.body.include?('1.4.2')
59-
CheckCode::Appears
59+
CheckCode::Appears('The target appears to be vulnerable')
6060
elsif res && res.code == 200
61-
CheckCode::Detected
61+
CheckCode::Detected('The target service was detected')
6262
else
63-
CheckCode::Safe
63+
CheckCode::Safe('The target is not vulnerable')
6464
end
6565
end
6666

modules/exploits/linux/http/apache_couchdb_cmd_exec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,16 +77,16 @@ def post_auth?
7777

7878
def check
7979
get_version
80-
return CheckCode::Unknown if @version.nil?
80+
return CheckCode::Unknown('Could not determine the target status') if @version.nil?
8181

8282
version = Rex::Version.new(@version)
83-
return CheckCode::Unknown if version.version.empty?
83+
return CheckCode::Unknown('Could not determine the target status') if version.version.empty?
8484

8585
vprint_status "Found CouchDB version #{version}"
8686

87-
return CheckCode::Appears if version < Rex::Version.new('1.7.0') || version.between?(Rex::Version.new('2.0.0'), Rex::Version.new('2.1.0'))
87+
return CheckCode::Appears("Version #{version} appears to be vulnerable") if version < Rex::Version.new('1.7.0') || version.between?(Rex::Version.new('2.0.0'), Rex::Version.new('2.1.0'))
8888

89-
CheckCode::Safe
89+
CheckCode::Safe("Version #{version} is not vulnerable")
9090
end
9191

9292
def exploit

modules/exploits/linux/http/apache_druid_js_rce.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,11 @@ def check
138138
end
139139

140140
unless res.code == 200
141-
return CheckCode::Safe
141+
return CheckCode::Safe('The target is not vulnerable')
142142
end
143143

144144
if res.body.include?(genecho)
145-
return CheckCode::Vulnerable
145+
return CheckCode::Vulnerable('The target is vulnerable')
146146
end
147147

148148
CheckCode::Unknown('Target does not seem to be running Apache Druid.')

modules/exploits/linux/http/artica_proxy_auth_bypass_service_cmds_peform_command_injection.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ def check
9393
end
9494
rand_string = Rex::Text.rand_text_alphanumeric(4..16)
9595
if execute_command("echo #{Rex::Text.encode_base64(rand_string)}|base64 -d").include?(rand_string)
96-
CheckCode::Appears
96+
CheckCode::Appears('The target appears to be vulnerable')
9797
else
98-
CheckCode::Safe
98+
CheckCode::Safe('The target is not vulnerable')
9999
end
100100
end
101101

0 commit comments

Comments
 (0)