Skip to content

Commit 0df004c

Browse files
committed
check for nil here, before we check for the end cdata tag (resolves a linting warning)
1 parent 3ff685b commit 0df004c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

modules/exploits/multi/http/cleo_rce_cve_2024_55956.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,12 @@ def exploit
124124
command = "cmd.exe /c \"#{payload.encoded}\""
125125
elsif (target['Platform'] == 'linux') || (target['Platform'] == 'unix')
126126
command = "/bin/sh -c \"#{payload.encoded}\""
127-
else
128-
fail_with(Failure::BadConfig, 'Unsupported target platform')
129127
end
130128

131-
# As we wrap the command in XML CDATA tags, we cannot have the closing CDATA tag in the command.
132-
if command.include? ']]>'
129+
if command.nil?
130+
fail_with(Failure::BadConfig, 'Unsupported target platform')
131+
elsif command.include? ']]>'
132+
# As we wrap the command in XML CDATA tags, we cannot have the closing CDATA tag in the command.
133133
fail_with(Failure::BadConfig, 'Payload cannot contain a CDATA closing tag ]]>')
134134
end
135135

0 commit comments

Comments
 (0)