Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
React2Shell_Hunter — AWS Organization-wide detection toolkit for CVE-2025-55182 & CVE-2025-66478 (React Server Components / Next.js RCE vulnerabilities) | Kitploit
Tools/GitHubGitHub/rocklambros/react2shell_hunter
Defensive ToolsVulnerability ScannersExploitationWeb SecurityCloud SecurityThreat IntelligenceIntrusion DetectionIncident ResponseLog Analysis
GitHubrocklambros/react2shell_hunter

React2Shell_Hunter

AWS Organization-wide detection toolkit for CVE-2025-55182 & CVE-2025-66478 (React Server Components / Next.js RCE vulnerabilities)

18 months agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share
View Repository

React2Shell Hunter

AWS Organization-Wide Detection Toolkit for CVE-2025-55182 & CVE-2025-66478


⚠️ IMPORTANT DISCLAIMER - PLEASE READ BEFORE USE

This toolkit has NOT been tested in a production AWS environment.

Due to infrastructure constraints, this project was developed and validated through code review, static analysis, and documentation verification only. It has not been deployed to or tested against a live AWS environment with active GuardDuty, WAF, EventBridge, or CloudTrail services.

What This Means For You:

ComponentStatus
Python Scanner Logic✅ Code reviewed, Snyk validated
Terraform Syntax✅ Validated, not applied
IAM Policies⚠️ May require adjustment for your environment
EventBridge Rules⚠️ Finding patterns based on AWS documentation
WAF Rules⚠️ Regex patterns untested against live traffic
Athena Queries⚠️ Schema assumptions may need modification

Recommendations:

  1. Deploy to a non-production account first - Test all components in a sandbox environment
  2. Review IAM policies carefully - Adjust permissions to match your organization's requirements
  3. Validate Terraform plans - Run terraform plan and review before applying
  4. Test EventBridge patterns - Verify finding type strings match your GuardDuty output
  5. Monitor CloudWatch logs - Check for errors after deployment

Liability:

This software is provided "AS IS" without warranty of any kind. The authors assume no responsibility for any damage, security incidents, or AWS costs incurred through the use of this toolkit. Use at your own risk.

If you successfully deploy and test this toolkit, please consider contributing your findings back to improve it for the community.


A comprehensive security toolkit for detecting React2Shell exploitation attempts across AWS environments. This toolkit provides real-time detection, threat hunting capabilities, and automated response for the critical React Server Components RCE vulnerability.


Table of Contents

  1. What This Toolkit Detects
  2. Prerequisites
  3. Installation
  4. Quick Start
  5. Architecture Deep Dive
  6. Component Reference
  7. Deployment Guide
  8. IOC Reference
  9. Troubleshooting
  10. FAQ

What This Toolkit Detects

CVE-2025-55182 (React Server Components)

  • CVSS Score: 10.0 (Maximum severity)
  • Attack Vector: Network, no authentication required
  • Root Cause: Prototype pollution via unsafe deserialization in React's "Flight" protocol
  • Exploitation: __proto__:then manipulation enables arbitrary code execution via process.mainModule.require('child_process').execSync()

CVE-2025-66478 (Next.js)

  • Downstream Impact: Next.js frameworks using vulnerable React versions
  • Affected Versions: Next.js 15.0.4, 15.1.8, 15.2.5, 15.3.5, 15.4.7, 15.5.6, 16.0.6, and 14.3.0-canary.77+

Attack Chain This Toolkit Detects

root@kitploit:~
1. INITIAL ACCESS     → WAF detects Next-Action header + prototype pollution payloads
2. EXECUTION          → GuardDuty ThreatIntelSet detects C2 IP connections
3. CREDENTIAL THEFT   → CloudTrail detects GetCallerIdentity from EC2 roles
4. LATERAL MOVEMENT   → EventBridge rules detect SSM SendCommand/StartSession
5. EXFILTRATION       → DNS exfiltration to ceye.io/dnslog.cn detected
6. CRYPTOMINING       → GuardDuty detects cryptocurrency mining activity

Prerequisites

Required Permissions

root@kitploit:~
# Minimum IAM permissions for the detection script
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "cloudtrail:LookupEvents",
        "logs:StartQuery",
        "logs:GetQueryResults",
        "guardduty:ListDetectors",
        "guardduty:ListFindings",
        "guardduty:GetFindings",
        "guardduty:CreateThreatIntelSet",
        "guardduty:UpdateThreatIntelSet",
        "guardduty:ListThreatIntelSets",
        "guardduty:GetThreatIntelSet",
        "s3:PutObject",
        "s3:GetObject",
        "sts:GetCallerIdentity",
        "sts:AssumeRole"
      ],
      "Resource": "*"
    }
  ]
}

# For Security Hub integration, add:
"securityhub:BatchImportFindings"

# For SNS alerting, add:
"sns:Publish"

# For organization-wide scanning, add:
"organizations:ListAccounts"

Software Requirements


Installation

Step 1: Clone and Install Dependencies

root@kitploit:~
# Navigate to project
cd React2Shell_Hunter

# Create virtual environment (RECOMMENDED)
python3 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

Step 2: Configure AWS Credentials

root@kitploit:~
# Option A: Use AWS CLI profile
aws configure --profile security-scanner

# Option B: Export environment variables
export AWS_ACCESS_KEY_ID="your-access-key"
export AWS_SECRET_ACCESS_KEY="your-secret-key"
export AWS_DEFAULT_REGION="us-east-1"

# Option C: Use IAM role (recommended for EC2/Lambda)
# Attach appropriate IAM role to your compute resource

Step 3: Verify Installation

root@kitploit:~
# Test AWS connectivity
aws sts get-caller-identity

# Test Python dependencies
python -c "import boto3, yaml; print('Dependencies OK')"

# Test IOC loading
python -c "
import yaml
with open('config/iocs.yaml') as f:
    iocs = yaml.safe_load(f)
    print(f'Loaded {len(iocs[\"network_iocs\"][\"malicious_ips\"])} malicious IPs')
"

Quick Start

Scan Current Account (Last 24 Hours)

root@kitploit:~
python src/react2shell_detector.py --hours 24

Expected Output:

root@kitploit:~
2025-12-06 10:00:00 - React2ShellDetector - INFO - ============================================================
2025-12-06 10:00:00 - React2ShellDetector - INFO - React2Shell IOC Detection Script
2025-12-06 10:00:00 - React2ShellDetector - INFO - CVE-2025-55182 & CVE-2025-66478
2025-12-06 10:00:00 - React2ShellDetector - INFO - ============================================================
2025-12-06 10:00:00 - React2ShellDetector - INFO - Starting single account scan...
2025-12-06 10:00:00 - React2ShellDetector - INFO - Analyzing CloudTrail logs...
2025-12-06 10:00:05 - React2ShellDetector - INFO - Checking GuardDuty findings...

Total findings: 0
  CRITICAL: 0
  HIGH: 0
  MEDIUM: 0

Full Production Scan

root@kitploit:~
python src/react2shell_detector.py \
    --organization \
    --role-name SecurityAuditRole \
    --security-hub \
    --guardduty-bucket my-threat-intel-bucket-12345 \
    --vpc-log-group /aws/vpc/flowlogs \
    --waf-log-group aws-waf-logs-react2shell \
    --sns-topic arn:aws:sns:us-east-1:123456789012:security-alerts \
    --output json \
    --output-file findings-$(date +%Y%m%d).json \
    --hours 72

Architecture Deep Dive

Critical Concept: How GuardDuty Detection Works

YOU CANNOT CREATE CUSTOM DETECTION RULES IN GUARDDUTY.

GuardDuty uses ML models and threat intelligence to generate findings. To detect React2Shell:

  1. ThreatIntelSet: Upload C2 IPs to GuardDuty → Generates MaliciousIPCaller.Custom findings
  2. EventBridge: Filter specific finding types → Route to SNS/Lambda/CloudWatch
  3. Response: Receive alerts, trigger automation, investigate
root@kitploit:~
┌─────────────────────────────────────────────────────────────────────────────┐
│                           DETECTION ARCHITECTURE                             │
├─────────────────────────────────────────────────────────────────────────────┤
│                                                                              │
│   DATA SOURCES              DETECTION ENGINE           RESPONSE              │
│   ════════════              ════════════════           ════════              │
│                                                                              │
│   ┌──────────┐             ┌─────────────────┐        ┌───────────┐         │
│   │CloudTrail│────────────>│    GuardDuty    │───────>│EventBridge│         │
│   │  Logs    │             │    Detector     │        │   Rules   │         │
│   └──────────┘             │                 │        └─────┬─────┘         │
│                            │ ┌─────────────┐ │              │               │
│   ┌──────────┐             │ │ThreatIntel  │ │              ▼               │
│   │VPC Flow  │────────────>│ │Set (C2 IPs) │ │        ┌───────────┐         │
│   │  Logs    │             │ └─────────────┘ │        │    SNS    │         │
│   └──────────┘             └─────────────────┘        │   Topic   │         │
│                                                        └─────┬─────┘         │
│   ┌──────────┐             ┌─────────────────┐              │               │
│   │DNS Query │────────────>│    Route 53     │              ▼               │
│   │  Logs    │             │    Resolver     │        ┌───────────┐         │
│   └──────────┘             └─────────────────┘        │  Lambda   │         │
│                                                        │ (Enrich)  │         │
│   ┌──────────┐             ┌─────────────────┐        └─────┬─────┘         │
│   │   WAF    │────────────>│   WAF WebACL    │              │               │
│   │  Logs    │             │  (HTTP Rules)   │              ▼               │
│   └──────────┘             └─────────────────┘        ┌───────────┐         │
│                                                        │ Security  │         │
│                                                        │    Hub    │         │
│                                                        └───────────┘         │
└─────────────────────────────────────────────────────────────────────────────┘

EventBridge Rule Patterns

The Terraform creates 7 specific EventBridge rules:

WAF Protection Layers

The WAF WebACL implements 9 rules in priority order:

Note: Rules 2 & 3 use or_statement with multiple byte_match_statement checks to detect malicious header VALUES (not just header presence). AWS WAF does not support regex in header matching, so each pattern requires a separate statement. Header names are lowercase as required by WAF.


Component Reference

Project Structure

root@kitploit:~
React2Shell_Hunter/
├── config/
│   └── iocs.yaml                    # IOC database (IPs, domains, patterns) - 452 lines
├── src/
│   └── react2shell_detector.py      # Main detection script - 1141 lines
├── terraform/
│   ├── guardduty.tf                 # GuardDuty + ThreatIntelSet + S3 - 405 lines
│   ├── eventbridge_rules.tf         # 7 EventBridge rules - 533 lines
│   └── waf_rules.tf                 # WAF WebACL with 9 rules - 681 lines
├── lambda/
│   └── ioc_scanner/
│       └── handler.py               # Real-time Lambda scanner - 381 lines
├── athena_queries/
│   └── detection_queries.sql        # 18 threat hunting queries - 483 lines
├── tests/
│   ├── __init__.py                  # Test package init
│   ├── conftest.py                  # Pytest fixtures (project_root, ioc_config, etc.)
│   ├── test_ioc_matching.py         # IOC pattern validation tests
│   ├── test_terraform.py            # Terraform configuration validation
│   └── test_waf_patterns.py         # WAF regex pattern tests
├── docs/
│   ├── THREAT_INTELLIGENCE_REPORT.md
│   └── GUARDDUTY_EVENTBRIDGE_SETUP_GUIDE.md
├── requirements.txt                 # Python dependencies (boto3, pyyaml, pytest, python-hcl2)
├── README.md
└── CLAUDE.md

Python Script Classes

CLI Arguments Reference


Deployment Guide

Step 1: Deploy Terraform Infrastructure

root@kitploit:~
cd terraform

# Initialize Terraform
terraform init

# Preview changes (ALWAYS DO THIS FIRST)
terraform plan \
    -var="threat_intel_bucket=react2shell-threat-intel-$(aws sts get-caller-identity --query Account --output text)" \
    -var="enable_guardduty=true" \
    -var="enable_waf=true" \
    -var="waf_scope=REGIONAL"

# Apply changes
terraform apply \
    -var="threat_intel_bucket=react2shell-threat-intel-$(aws sts get-caller-identity --query Account --output text)"

Terraform Variables:

Step 2: Associate WAF with Resources

The WAF WebACL must be associated with your resources:

root@kitploit:~
# Associate with ALB
aws wafv2 associate-web-acl \
    --web-acl-arn $(terraform output -raw web_acl_arn) \
    --resource-arn arn:aws:elasticloadbalancing:us-east-1:123456789012:loadbalancer/app/my-alb/1234567890

# Associate with API Gateway
aws wafv2 associate-web-acl \
    --web-acl-arn $(terraform output -raw web_acl_arn) \
    --resource-arn arn:aws:apigateway:us-east-1::/restapis/abc123/stages/prod

Step 3: Subscribe to SNS Alerts

root@kitploit:~
# Get SNS topic ARN
SNS_TOPIC=$(terraform output -raw sns_topic_arn)

# Subscribe email
aws sns subscribe \
    --topic-arn $SNS_TOPIC \
    --protocol email \
    --notification-endpoint [email protected]

# Subscribe Slack webhook (via Lambda)
aws sns subscribe \
    --topic-arn $SNS_TOPIC \
    --protocol lambda \
    --notification-endpoint arn:aws:lambda:us-east-1:123456789012:function:slack-notifier

Step 4: Create Athena Tables

root@kitploit:~
# Open Athena console or use AWS CLI
# Run the CREATE TABLE statements from athena_queries/detection_queries.sql

# CloudTrail table
aws athena start-query-execution \
    --query-string "CREATE EXTERNAL TABLE cloudtrail_logs ..." \
    --work-group primary \
    --query-execution-context Database=default

IOC Reference

Malicious IP Addresses

Malicious Domains

Suspicious Ports

PortUsage
652PowerShell stager
2045Custom C2
8000, 8080Alternative HTTP C2
12000, 45178Custom C2

HTTP Indicators


Troubleshooting

Common Issues

"No GuardDuty detector found"

root@kitploit:~
# Check if GuardDuty is enabled
aws guardduty list-detectors

# If empty, enable GuardDuty
aws guardduty create-detector --enable

# Or use Terraform
terraform apply -var="enable_guardduty=true"

"Failed to assume role in member account"

root@kitploit:~
# Verify role exists in target account
aws iam get-role --role-name SecurityAuditRole

# Verify trust policy allows your account
aws iam get-role --role-name SecurityAuditRole --query 'Role.AssumeRolePolicyDocument'

# Test role assumption
aws sts assume-role \
    --role-arn arn:aws:iam::TARGET_ACCOUNT:role/SecurityAuditRole \
    --role-session-name test

"ThreatIntelSet stuck in ACTIVATING"

root@kitploit:~
# Check ThreatIntelSet status
DETECTOR_ID=$(aws guardduty list-detectors --query 'DetectorIds[0]' --output text)
aws guardduty list-threat-intel-sets --detector-id $DETECTOR_ID

# Verify S3 bucket permissions
aws s3api get-bucket-policy --bucket your-threat-intel-bucket

# Verify IP list format (one IP per line, no CIDR)
aws s3 cp s3://your-bucket/threat-intel/react2shell-ips.txt -

"WAF rule not blocking"

root@kitploit:~
# Check if WebACL is associated
aws wafv2 list-resources-for-web-acl \
    --web-acl-arn $(terraform output -raw web_acl_arn)

# Check sampled requests
aws wafv2 get-sampled-requests \
    --web-acl-arn $(terraform output -raw web_acl_arn) \
    --rule-metric-name React2Shell-Malicious-IP-Blocked \
    --scope REGIONAL \
    --time-window StartTime=2025-12-06T00:00:00Z,EndTime=2025-12-06T23:59:59Z \
    --max-items 10

"No findings generated"

root@kitploit:~
# Generate sample findings to test pipeline
DETECTOR_ID=$(aws guardduty list-detectors --query 'DetectorIds[0]' --output text)
aws guardduty create-sample-findings \
    --detector-id $DETECTOR_ID \
    --finding-types "UnauthorizedAccess:IAMUser/MaliciousIPCaller.Custom"

# Check EventBridge rule invocations
aws cloudwatch get-metric-statistics \
    --namespace AWS/Events \
    --metric-name Invocations \
    --dimensions Name=RuleName,Value=react2shell-malicious-ip-caller \
    --start-time $(date -u -d '1 hour ago' +%Y-%m-%dT%H:%M:%SZ) \
    --end-time $(date -u +%Y-%m-%dT%H:%M:%SZ) \
    --period 300 \
    --statistics Sum

FAQ

Q: Does this replace patching?

NO. This is a detection toolkit, not a prevention solution. You MUST patch:

  • React: 19.0.1, 19.1.2, or 19.2.1
  • Next.js: 15.0.5, 15.1.9, 15.2.6, 15.3.6, 15.4.8, 15.5.7, or 16.0.7

Q: Will this detect all React2Shell attacks?

No detection is 100%. This toolkit detects:

  • Connections to known C2 IPs (if attacker uses new IPs, won't detect)
  • Known payload patterns (if attacker obfuscates, may evade WAF)
  • Post-exploitation behavior (credential theft, lateral movement)

Q: How often should I run the scanner?

Recommended schedule:

  • Continuous: GuardDuty + EventBridge (real-time)
  • Hourly: Python script with --hours 1
  • Daily: Full Athena threat hunt queries

Q: How do I add new IOCs?

Edit config/iocs.yaml and add to appropriate sections:

root@kitploit:~
network_iocs:
  malicious_ips:
    - ip: "NEW.IP.ADDRESS.HERE"
      port: 8080
      context: "Description"
      confidence: high
      source: "Your source"

Then update ThreatIntelSet:

root@kitploit:~
python src/react2shell_detector.py --guardduty-bucket your-bucket

Running Tests

root@kitploit:~
# Install test dependencies
pip install -r requirements.txt

# Run all tests
pytest tests/ -v

# Run specific test categories
pytest tests/test_terraform.py -v      # Terraform validation
pytest tests/test_ioc_matching.py -v   # IOC pattern tests
pytest tests/test_waf_patterns.py -v   # WAF regex tests

# Run with coverage
pytest tests/ --cov=src --cov-report=html

References

  • CVE-2025-55182 - NVD
  • React2Shell Official Site
  • Datadog Security Labs
  • AWS Security Blog
  • Datadog IOC Repository

Disclaimer: This toolkit is for defensive security purposes only. Ensure you have proper authorization before scanning systems.

Download Tool
SoftwareVersionPurpose
Python3.9+Detection script runtime
Terraform1.0+Infrastructure deployment
AWS CLI2.xAWS authentication
boto31.34+AWS SDK for Python
RuleFinding Type PatternSeverity
react2shell-malicious-ip-callerMaliciousIPCaller.CustomCRITICAL
react2shell-credential-exfiltrationInstanceCredentialExfiltration.*CRITICAL
react2shell-dns-exfiltrationDNSDataExfiltrationHIGH
react2shell-cryptocurrency-miningCryptoCurrency:*HIGH
react2shell-unusual-network-portsNetworkPortUnusualMEDIUM
react2shell-malicious-domainMaliciousDomainRequest.*HIGH
react2shell-high-severity-catchallSeverity >= 7VARIES
PriorityRuleActionWhat It Detects
1Block Malicious IPsBLOCKConnections from 9 known C2 IPs
2Next-Action Header ValuesBLOCKnext-action header containing $ACTION OR __proto__ patterns
3RSC-Action-ID Header ValuesBLOCKrsc-action-id header containing $ACTION OR __proto__ patterns
4Prototype PollutionBLOCK__proto__ or constructor.prototype in body
5RCE PatternsBLOCKprocess.mainModule.require, child_process, execSync
6ACTION ParameterBLOCK$ACTION_0:0 or $ACTION_REF in POST body
7Suspicious User-AgentsCOUNTGo-http-client, Assetnote, python-requests
8AWS Known Bad InputsINHERITAWS managed rule group
9AWS Common Rule SetINHERITAWS managed rule group
ClassPurposeKey Methods
IOCLoaderLoad IOCs from YAMLget_malicious_ips(), get_suspicious_ports(), get_malicious_domains()
CloudTrailAnalyzerDetect API-based IOCsanalyze_recent_events(hours)
VPCFlowLogAnalyzerDetect network IOCsanalyze_flow_logs(log_group, hours)
GuardDutyManagerManage threat intelcreate_threat_intel_set(bucket), get_relevant_findings(hours)
WAFLogAnalyzerDetect HTTP IOCsanalyze_waf_logs(log_group, hours)
OrganizationScannerCross-account scanningscan_organization(hours, role_name)
SecurityHubReporterImport findingsimport_findings(findings)
SNSAlerterSend alertssend_alert(findings)
ArgumentTypeDefaultDescription
--configstringconfig/iocs.yamlPath to IOC configuration file
--hoursint24Hours of logs to analyze
--organizationflagfalseScan entire AWS Organization
--role-namestringOrganizationAccountAccessRoleRole to assume in member accounts
--sns-topicstringnoneSNS topic ARN for alerts
--security-hubflagfalseImport findings to Security Hub
--guardduty-bucketstringnoneS3 bucket for GuardDuty threat intel
--vpc-log-groupstringnoneVPC Flow Logs CloudWatch log group
--waf-log-groupstringnoneWAF logs CloudWatch log group
--outputenumtextOutput format: json, text, csv
--output-filestringnoneOutput file path
--debugflagfalseEnable debug logging
VariableRequiredDefaultDescription
threat_intel_bucketYES-S3 bucket name for threat intel files
enable_guarddutynotrueEnable GuardDuty detector
enable_wafnotrueCreate WAF WebACL
waf_scopenoREGIONALREGIONAL or CLOUDFRONT
block_modenoBLOCKBLOCK or COUNT
enable_lambda_automationnofalseEnable Lambda for automated response
IP AddressPortConfidenceContextSource
93.123.109.2478000HIGHPrimary C2 ServerDatadog
45.77.33.1368080HIGHPrimary C2 ServerDatadog
194.246.84.132045HIGHPrimary C2 ServerDatadog
141.11.240.10345178HIGHPrimary C2 ServerDatadog
23.235.188.3652HIGHPowerShell StagerGreyNoise
46.36.37.8512000HIGHPayload StagingGreyNoise
144.202.115.23480MEDIUMPayload HostingDatadog
162.215.170.263000MEDIUMSecondary PayloadGreyNoise
45.32.158.54-MEDIUMScannerGreyNoise
DomainCategoryConfidence
ceye.ioDNS ExfiltrationHIGH
dnslog.cnDNS ExfiltrationHIGH
*.oastify.comBurp CollaboratorMEDIUM
sapo.shk0x.netC2HIGH
xwpoogfunv.zaza.eu.orgC2HIGH
*.c3pool.comCryptominingHIGH
3333, 5555, 14433, 14444Cryptomining
PatternSeverityDescription
next-action: *CRITICALRSC exploitation header (lowercase in WAF)
rsc-action-id: *CRITICALRSC action identifier (lowercase in WAF)
$ACTION_0:0CRITICALRSC action parameter
__proto__:thenCRITICALPrototype pollution
process.mainModule.requireCRITICALNode.js RCE
child_processCRITICALCommand execution
Go-http-client/1.1MEDIUMScanner user agent