Skip to content

Commit c06a7c4

Browse files
committed
Check Method Refactoring
1 parent 45a6176 commit c06a7c4

File tree

1 file changed

+10
-15
lines changed

1 file changed

+10
-15
lines changed

modules/exploits/multi/http/lighthouse_studio_unauth_rce_cve_2025_34300.rb

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -112,29 +112,24 @@ def check
112112
'method' => 'GET',
113113
'vars_get' => vars
114114
)
115+
return CheckCode::Unknown('No response from target') unless res
115116

116-
unless res.body =~ /Lighthouse Studio (\d+_\d+_\d+)/
117-
print_error("#{peer} - Unable to extract version number")
118-
end
119-
120-
version_match = Regexp.last_match(1).to_s
121-
if !version_match.empty?
117+
if res.body =~ /Lighthouse Studio (\d+_\d+_\d+)/
118+
version_match = Regexp.last_match(1).to_s
122119
print_status("Extracted version: #{version_match.gsub('_', '.')}")
123-
124120
version = Rex::Version.new(version_match.gsub('_', ''))
125-
if version < Rex::Version.new(91614)
126-
return CheckCode::Appears
127-
else
128-
return CheckCode::Safe
129-
end
121+
122+
return CheckCode::Appears if version < Rex::Version.new(91614)
123+
else
124+
print_error("#{peer} - Unable to extract version number")
130125
end
131126

132-
html = res.get_html_document if res
133-
if html.text.include?('Lighthouse Studio')
127+
html = res.get_html_document
128+
if html&.text&.include?('Lighthouse Studio')
134129
return CheckCode::Detected
135130
end
136131

137-
CheckCode::Unknown
132+
CheckCode::Safe
138133
end
139134

140135
def execute_command(cmd, _opts = {})

0 commit comments

Comments
 (0)