Skip to content

Commit 1f9124e

Browse files
committed
Update checkcodes and bug fixes
1 parent 19d333d commit 1f9124e

35 files changed

Lines changed: 93 additions & 67 deletions

modules/exploits/linux/http/mutiny_frontend_upload.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def check
147147
return Exploit::CheckCode::Appears("Version #{version} appears to be vulnerable")
148148
end
149149

150-
return Exploit::CheckCode::Safe("Version #{version} is not vulnerable")
150+
return Exploit::CheckCode::Safe(version ? "Version #{version} is not vulnerable" : 'The target is not vulnerable')
151151
end
152152

153153
def exploit

modules/exploits/linux/http/nagios_xi_chained_rce.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,16 @@ def check
6363
return unless res && (html = res.get_html_document)
6464

6565
if (version = html.at('//input[@name = "version"]/@value'))
66+
version = version.value
6667
vprint_status("Nagios XI version: #{version}")
6768
if Rex::Version.new(version) <= target[:version]
6869
return CheckCode::Appears("Version #{version} appears to be vulnerable")
6970
end
7071
end
7172

72-
CheckCode::Safe("Version #{version} is not vulnerable")
73+
return CheckCode::Safe("Version #{version} is not vulnerable") if version
74+
75+
CheckCode::Unknown('Could not determine Nagios XI version')
7376
end
7477

7578
def exploit

modules/exploits/linux/http/nagios_xi_chained_rce_2_electric_boogaloo.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,10 @@ def check
8787
if @version < target[:lower_version]
8888
vprint_bad('Try nagios_xi_chained for this version.')
8989
elsif (@version <= target[:upper_version] && @version >= target[:lower_version])
90-
return CheckCode::Appears("Version #{version} appears to be vulnerable")
90+
return CheckCode::Appears("Version #{@version} appears to be vulnerable")
9191
end
9292
end
93-
CheckCode::Safe("Version #{version} is not vulnerable")
93+
CheckCode::Safe("Version #{@version} is not vulnerable")
9494
end
9595

9696
def set_db_user(usr, passwd)

modules/exploits/linux/http/nagios_xi_mibs_authenticated_rce.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,10 @@ def check
9696
end
9797

9898
if @version >= Rex::Version.new('5.6.0') && @version <= Rex::Version.new('5.7.3')
99-
return CheckCode::Appears("Version #{version} appears to be vulnerable")
99+
return CheckCode::Appears("Version #{@version} appears to be vulnerable")
100100
end
101101

102-
return CheckCode::Safe("Version #{version} is not vulnerable")
102+
return CheckCode::Safe("Version #{@version} is not vulnerable")
103103
end
104104

105105
def execute_command(cmd, _opts = {})

modules/exploits/linux/http/nagios_xi_plugins_check_plugin_authenticated_rce.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,10 @@ def check
130130
end
131131

132132
if @version < Rex::Version.new('5.6.6')
133-
return CheckCode::Appears("Version #{version} appears to be vulnerable")
133+
return CheckCode::Appears("Version #{@version} appears to be vulnerable")
134134
end
135135

136-
return CheckCode::Safe("Version #{version} is not vulnerable")
136+
return CheckCode::Safe("Version #{@version} is not vulnerable")
137137
end
138138

139139
def grab_plugins_nsp

modules/exploits/linux/http/nagios_xi_plugins_filename_authenticated_rce.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,10 @@ def check
9797
end
9898

9999
if @version < Rex::Version.new('5.8.0')
100-
return CheckCode::Appears("Version #{version} appears to be vulnerable")
100+
return CheckCode::Appears("Version #{@version} appears to be vulnerable")
101101
end
102102

103-
return CheckCode::Safe("Version #{version} is not vulnerable")
103+
return CheckCode::Safe("Version #{@version} is not vulnerable")
104104
end
105105

106106
def execute_command(cmd, _opts = {})

modules/exploits/linux/http/netgear_dnslookup_cmd_exec.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,17 +73,19 @@ def check
7373
marker_one = "Basic realm=\"NETGEAR "
7474
marker_two = "\""
7575
model = data[/#{marker_one}(.*?)#{marker_two}/m, 1]
76+
return CheckCode::Unknown('Could not determine NETGEAR model') if model.nil?
77+
7678
vprint_status("Router is a NETGEAR router (#{model})")
7779
model_numbers = ['DGN2200v1', 'DGN2200v2', 'DGN2200v3', 'DGN2200v4']
7880
if model_numbers.include?(model)
7981
print_good("Router may be vulnerable (NETGEAR #{model})")
80-
return CheckCode::Detected("Target detected: version #{model}")
82+
return CheckCode::Detected("Target detected: model #{model}")
8183
else
82-
return CheckCode::Safe("Version #{model} is not vulnerable")
84+
return CheckCode::Safe("Model #{model} is not vulnerable")
8385
end
8486
else
8587
print_error('Router is not a NETGEAR router')
86-
return CheckCode::Safe("Version #{model} is not vulnerable")
88+
return CheckCode::Safe('NETGEAR router not detected')
8789
end
8890
end
8991

modules/exploits/linux/http/netgear_r7000_cgibin_exec.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,18 @@ def check
7171
marker_one = "Basic realm=\"NETGEAR "
7272
marker_two = "\""
7373
model = scrape(data, marker_one, marker_two)
74+
return CheckCode::Unknown('Could not determine NETGEAR model') if model.nil?
75+
7476
vprint_status("Router is a NETGEAR router (#{model})")
7577
if model == 'R7000' || model == 'R6400'
7678
print_good("Router may be vulnerable (NETGEAR #{model})")
77-
return CheckCode::Detected("Target detected: version #{model}")
79+
return CheckCode::Detected("Target detected: model #{model}")
7880
else
79-
return CheckCode::Safe("Version #{model} is not vulnerable")
81+
return CheckCode::Safe("Model #{model} is not vulnerable")
8082
end
8183
else
8284
print_error('Router is not a NETGEAR router')
83-
return CheckCode::Safe("Version #{model} is not vulnerable")
85+
return CheckCode::Safe('NETGEAR router not detected')
8486
end
8587
end
8688

modules/exploits/linux/http/netis_unauth_rce_cve_2024_22729.rb

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

122122
return CheckCode::Safe(version[2].chop.to_s)
123123
end
124-
CheckCode::Safe("Version #{version} is not vulnerable")
124+
CheckCode::Unknown('Unable to parse target version from response')
125125
end
126126

127127
def exploit

modules/exploits/linux/http/netis_unauth_rce_cve_2024_48456_and_48457.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ def check
212212
return CheckCode::Safe(version[1].to_s)
213213
end
214214
end
215-
CheckCode::Safe("Version #{version} is not vulnerable")
215+
CheckCode::Unknown('Unable to parse target version from response')
216216
end
217217

218218
def exploit

0 commit comments

Comments
 (0)