Detect CVE-2021-26828: OpenPLC ScadaBR Unrestricted File Upload RCE in Microsoft Sentinel
Detects exploitation of CVE-2021-26828, an unrestricted file upload vulnerability in OpenPLC ScadaBR that allows authenticated attackers to upload files with dangerous types (e.g., JSP, PHP, WAR) to the server, leading to remote code execution. ScadaBR is a SCADA/HMI web application widely used in industrial control systems. This vulnerability is actively exploited in the wild and listed in CISA KEV.
MITRE ATT&CK
- Tactic
- Initial Access Execution Persistence
KQL Detection Query
union DeviceNetworkEvents, DeviceProcessEvents, DeviceFileEvents
| where TimeGenerated > ago(24h)
| where (
(ActionType == "FileCreated" and FolderPath matches regex @"(?i)(scadabr|openplc|tomcat)[/\\](webapps|upload|images)[/\\].*\.(jsp|jspx|php|war|sh|py|pl|rb|aspx|cfm)$")
or (ActionType == "ProcessCreated" and InitiatingProcessFileName in~ ("java.exe", "java", "tomcat") and (ProcessCommandLine contains ".jsp" or ProcessCommandLine contains "cmd" or ProcessCommandLine contains "bash"))
or (ActionType == "InboundConnectionAccepted" and RemotePort in (8080, 8443, 80, 443) and LocalPort in (8080, 8443))
)
| extend SuspiciousIndicator = case(
ActionType == "FileCreated" and FolderPath matches regex @"(?i)\.(jsp|jspx|php|war)$", "WebShell upload to SCADA directory",
ActionType == "ProcessCreated" and InitiatingProcessFileName in~ ("java.exe", "java"), "Java process spawning shell",
"Suspicious SCADA web activity"
)
| project TimeGenerated, DeviceName, AccountName, ActionType, FolderPath, FileName, ProcessCommandLine, RemoteIP, SuspiciousIndicator
| order by TimeGenerated desc Detects unrestricted file uploads to ScadaBR/OpenPLC web directories and subsequent web shell execution via Java/Tomcat processes on endpoints running SCADA software.
Data Sources
Required Tables
False Positives & Tuning
- Legitimate WAR deployments by administrators to Tomcat/ScadaBR application directories
- Authorized JSP development or customization of ScadaBR dashboards by ICS engineers
- Security testing or vulnerability scanning tools uploading test payloads in authorized engagements
- Automated backup or configuration management tools creating files in web directories
Other platforms for CVE-2021-26828
Testing Methodology
Validate this detection against 4 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.
- Test 1Upload JSP Web Shell to ScadaBR Upload Endpoint
Expected signal: HTTP POST to /ScadaBR/upload.shtm with multipart form data containing .jsp file; Tomcat access log shows 200 response; file creation event for .jsp file in webapps directory
- Test 2Execute OS Command via Uploaded JSP Web Shell
Expected signal: Java process (Tomcat JVM) spawning child process for id, whoami, cat commands; Sysmon Event ID 1 with ParentImage containing java; process command line containing /etc/passwd
- Test 3Establish Reverse Shell from ScadaBR Server via Web Shell
Expected signal: Java process spawning bash with /dev/tcp redirect; outbound TCP connection from ScadaBR host to ATTACKER_IP:4444; network flow event with non-standard destination port from Java process
- Test 4Upload PHP Web Shell as Image File Bypass
Expected signal: POST request to upload endpoint with PHP file disguised as image; file creation event showing PHP content in webapps directory; Content-Type mismatch between declared image/jpeg and actual PHP content
Unlock Pro Content
Get the full detection package for CVE-2021-26828 including response playbook, investigation guide, and atomic red team tests.