{
	"id": "61e4c31c-c607-454e-af0f-e6f4f1244e6b",
	"created_at": "2023-01-12T15:03:57.960658Z",
	"updated_at": "2026-11-18T02:15:01.509658Z",
	"deleted_at": null,
	"sha1_hash": "057cc50a7dbbf0d2f310629bcbc3ee016004f997",
	"title": "2021-03-25 - Web Shell Threat Hunting with Azure Sentinel",
	"llm_title": "2021-03-25 - Web Shell Threat Hunting with Azure Sentinel",
	"authors": "",
	"file_creation_date": "2022-05-28T15:49:35Z",
	"file_modification_date": "2022-05-28T15:49:35Z",
	"file_size": 373280,
	"plain_text": "Web Shell Threat Hunting with Azure Sentinel\n\ntechcommunity.microsoft.com/t5/azure-sentinel/web-shell-threat-hunting-with-azure-sentinel/ba-p/2234968\n\nMarch 25, 2021\n\nIn this blog post we will provide Microsoft Azure Sentinel customers with hunting queries\nto investigate possible on-premises Exchange Server exploitation and\nidentify additional attacker IOCs (Indicators of compromise) such as IP address and User\nAgent. These hunting techniques can also be applied to web shell techniques targeting other\nweb applications.\n\nThe techniques we discuss below have been adapted from the June 2020 blog post: Web\nshell threat hunting with Azure Sentinel and Microsoft Threat Protection. The previous blog\npost analysed an attack against a SharePoint server, however, many of the techniques can\nalso be applied to Exchange servers since it also uses IIS to host its web interfaces.\n\nRecent vulnerabilities in on-premises Microsoft Exchange servers have led to deployment of\nweb shells by threat actors. More information on these vulnerabilities can be found in\nthis MSRC blog, details on threat actor HAFNIUM using these vulnerabilities can be found in\nthis MSTIC blog. MSRC has also provided guidance for responders, a one-click tool for\nremediation and automatic remediation is delivered through Microsoft Defender for\nEndpoint.\n\nOur colleagues in Microsoft Defender Threat Intelligence have authored another blog\nthat provides additional details on use of web shells in attacks taking advantage of the\nExchange Server.\n\n1/7\n\nThe below diagram provides a high-level overview of an attacker leveraging these\nvulnerabilities to install a web shell on an Exchange server.\n\nInvestigating web shell alerts\n\nMicrosoft 365 Defender (M365D) detects web shell installation and execution activity.\nSecurity alerts and incidents generated by M365D can be written to the SecurityAlert table in\nAzure Sentinel by enabling the appropriate connector. An example of a web shell installation\nalert in the Azure Sentinel SecurityAlert table can be seen below.\n\n2/7\n\nThese alerts can be enriched in Azure Sentinel with new information from other log\n\nsources. When dealing with remote attacks on web application servers, one of the\n\nbest enrichment sources available are the web logs that have been generated. In the case\n\nthat the application server is Microsoft Exchange the W3CIISLog can be used to enrich\n\nM365D alerts with potential attacker information. Information on collecting IIS logs using the\n\nLog Analytics agent can be found here.\n\nIdentifying the Attacker IP\n\naddress from Microsoft 365 Defender alerts\n\nThe query below extracts alerts from M365D where a web script file has been observed as\n\npart of the alert. In the below example, alerts containing ASP, ASPX, ASMX and ASAX files\n\nwill be extracted; these are web script files commonly used by Exchange servers.\n\nAfter extracting relevant web shell alerts the query will join the alert information with the\n\nW3CIIS log, this allows the query to identify any clients that have accessed the potential\n\nshell file, allowing the potential attacker to be identified. A version of the query below is\n\nalready available as an Azure Sentinel detection and can be found here.\n\nlet timeWindow = 3d;  \n//Script file extensions to match on, can be expanded for your environment  \nlet scriptExtensions = dynamic([\".asp\", \".aspx\", \".asmx\", \".asax\"]);  \nSecurityAlert  \n| where TimeGenerated \u003e ago(timeWindow)  \n| where ProviderName == \"MDATP\"  \n//Parse and expand the alert JSON  \n| extend alertData = parse_json(Entities)  \n| mvexpand alertData  \n| where alertData.Type == \"file\"  \n//This can be expanded to include more file types  \n| where alertData.Name has_any(scriptExtensions)  \n| extend FileName = tostring(alertData.Name), Directory = \ntostring(alertData.Directory)  \n| project TimeGenerated, FileName, Directory  \n| join (   \nW3CIISLog   \n| where TimeGenerated \u003e ago(timeWindow)   \n| where csUriStem has_any(scriptExtensions)   \n| extend splitUriStem = split(csUriStem, \"/\")   \n| extend FileName = splitUriStem[-1]  \n| summarize StartTime=min(TimeGenerated), EndTime=max(TimeGenerated) by \nAttackerIP=cIP, AttackerUserAgent=csUserAgent, SiteName=sSiteName, \nShellLocation=csUriStem, tostring(FileName)   \n) on FileName  \n| project StartTime, EndTime, AttackerIP, AttackerUserAgent, SiteName, ShellLocation\n\nIdentifying Exchange Servers \u0026 Associated Security Alerts\n\n3/7\n\nExchange servers can be challenging to identify in default log data; however using data\navailable in W3CIISLog, Exchange servers can be identified using predictable URI strings\nwithout relying on the hostname or site name.\n\nThe query below extracts the host name from W3CIISLog where a known Exchange URI\npath is observed, this provides a list of hostnames that are running Exchange. This list of\nhost names can then be used to aggregate information from the alerts in\nthe SecurityAlert table.\n\nW3CIISLog  \n| where csUriStem has_any(\"/owa/auth/\", \"/ecp/healthcheck.htm\", \"/ews/exchange.asmx\") \n| summarize by computer=tolower(Computer)  \n| join kind=leftouter (  \nSecurityAlert  \n| extend alertData = parse_json(Entities)  \n| mvexpand alertData  \n| where alertData.Type == \"host\"  \n| extend computer = iff(isnotempty(alertData.DnsDomain), \ntolower(strcat(tostring(alertData.HostName), \".\" , \ntostring(alertData.DnsDomain))),tolower(tostring(alertData.HostName)))  \n| summarize Alerts=dcount(SystemAlertId), AlertTimes=make_list(TimeGenerated), \nAlertNames=make_list(AlertName) by computer  \n) on computer  \n| project ExchangeServer=computer, Alerts, AlertTimes, AlertNames\n\nThe results of the query provide insights into whether additional security alerts beyond web\nshell alerts have been observed on the host. Following deployment of a web shell it’s highly\nlikely the threat actor will begin to execute further commands on the server, triggering\nadditional alerts. In the above example three Exchange servers were observed with security\nalerts.\n\nThis same technique can be used to locate other web applications within the network that\nuse common or predictable web paths.\n\nW3CIISLog Analysis\n\nW3CIISLog provides detailed logging on actions performed on Microsoft Internet Information\nServers (IIS). Even when an Endpoint detection alert is not available, it is possible to explore\nW3CIISLogs for indicators of compromise. W3CIISLog can also provide additional insights\n\n4/7\n\ninto which hosts in the network are web application servers.\n\nNote: As part of the original Microsoft HAFNIUM blog post, several hunting and detection\nqueries were created to search for artefacts specific to the use of recent vulnerabilities.\n\nIdentifying generic exploitation activity\n\nIf the URI associated with the vulnerable file on the server is known, a query can be\nconstructed to identify log entries that match the URI pattern. W3CIIS logging stores the URI\nin the column named “csUriStem”, the below query can be used to search for a specific\nURI in logs and provide information on which clients have accessed them. Local IP\naddresses have been removed.\n\nW3CIISLog  \n| where TimeGenerated \u003e ago(3d)  \n| where not(ipv4_is_private(cIP))  \n//Insert potentially exploited URI here  \n| where csUriStem =~ \"/owa/auth/x.js\"  \n| project TimeGenerated, sSiteName, csMethod, csUriStem, sPort, cIP, csUserAgent\n\nFor HAFNIUM attacks observed by MSTIC an indicator feed has been made\navailable (CSV, JSON). A detection query, that will check for the presence of indicators in\nmultiple data sources, has also been made available by the Azure Sentinel team.\nThe detection can be found here, and IOC’s released as feeds by MSTIC can be found in\nthis directory.\n\nThe recent Exchange vulnerabilities do not need to be targeted at a specific file. Analysis of\nautomated exploitation tools online shows that many randomise the filenames used; this\nmeans that no legitimate user will visit these files as they do not exist on the server\nfilenames are randomly generated, static string matching cannot be used.\n\nThe Kusto “matches_regex” function can be used to perform regular expression matching on\nURI’s. The below example extracts events where the URI matches files associated with the\nexploitation of CVE-2021-27065 from W3CIISLog.\n\nW3CIISLog  \n| where TimeGenerated \u003e ago(3d)  \n| where not(ipv4_is_private(cIP))  \n| where (csUriStem matches regex @\"\\/owa\\/auth\\/[A-Za-z0-9]{1,30}\\.js\") or (csUriStem \nmatches regex @\"\\/ecp\\/[A-Za-z0-9]{1,30}\\.(js|flt|css)\")  \n| project TimeGenerated, sSiteName, csMethod, csUriStem, sPort, cIP, csUserAgent\n\n. As these\n\n5/7\n\nThe previous queries can be limited when the files being exploited are commonly accessed.\n\nThey would produce many candidate attacker IP addresses, making analysis challenging.\n\nUsing the recent Exchange vulnerabilities as an example, Microsoft\n\nhas seen malicious automated tools released publicly that are being used to exploit the\n\nExchange vulnerabilities. These tools are designed to only visit specific URIs on the server\n\nthat are required to perform the exploit. This activity differs from normal and legitimate\n\nAdministrator or User application browsing activity and if observed should be investigated.\n\nIt is possible to craft a query that uses basic statistical analysis to identify instances where a\n\nclient has visited a disproportionately high number of exploit-related URI’s when compared to\n\nother URIs on the site., The query below calculates the total number of suspicious\n\nURIs that have been visited by each user, it then calculates the total number of URIs visited\n\nby the user. Where the number of exploit related URIs is a significant proportion of URIs\n\nvisited, a result is returned. By default, the query requires over 90% of the URIs visited by\n\nthe user to be suspicious.\n\nlet timeRange = 7d; \n//Calculate number of suspicious URI stems visited by user  \nW3CIISLog \n| where TimeGenerated \u003e ago(timeRange) \n| where not(ipv4_is_private(cIP))  \n| where (csUriStem matches regex @\"\\/owa\\/auth\\/[A-Za-z0-9]{1,30}\\.js\") or (csUriStem \nmatches regex @\"\\/ecp\\/[A-Za-z0-9]{1,30}\\.(js|flt|css)\") or (csUriStem =~ \n\"/ews/exchange.asmx\")  \n| extend userHash = hash_md5(strcat(cIP, csUserAgent))  \n| summarize susCount=dcount(csUriStem), make_list(csUriStem), min(TimeGenerated), \nmax(TimeGenerated) by userHash, cIP, csUserAgent  \n| join kind=leftouter  (  \n//Calculate unique URI stems visited by each user  \nW3CIISLog  \n| where TimeGenerated \u003e ago(timeRange)  \n| where not(ipv4_is_private(cIP)) \n| extend userHash = hash_md5(strcat(cIP, csUserAgent))  \n| summarize allCount=dcount(csUriStem) by userHash  \n) on userHash  \n//Find instances where only a common endpoint was seen  \n| extend containsDefault = iff(list_csUriStem contains \"/ews/exchange.asmx\", 1, 0)  \n//If we only see the common endpoint and nothing else dump it  \n| extend result = iff(containsDefault == 1, containsDefault+susCount, 0)  \n| where result != 2  \n| extend susPercentage = susCount / allCount * 100  \n| where susPercentage \u003e 90  \n| project StartTime=min_TimeGenerated, EndTime=max_TimeGenerated, AttackerIP=cIP, \nAttackerUA=csUserAgent, URIsVisited=list_csUriStem, \nsuspiciousPercentage=susPercentage, allUriCount=allCount, suspiciousUriCount=susCount\n\n6/7\n\nWhile this query is designed to detect recent Exchange exploit activity, it can be easily\nadapted to other exploit chains if the pages or URIs used are known.\n\nRare Client File Access\n\nA previously published hunting query  can be used to detect instances where resources on a\nserver are requested by a single client – a behaviour that should be investigated in the\ncontext of web shell exploits. After the actor creates web shell on the server, it’s likely that\nthey will be the only user to access the file to complete their intended objective.\n\nInvestigating the Attacker\n\nIn the previous blog post covering SharePoint exploitation, a Jupyter Notebook Guided\nInvestigation is provided. This notebook can also be used to investigate on-prem Exchange\ncompromises within your environment.\n\nThe notebook extracts alerts from Microsoft 365 Defender related to web shell activity, these\ncan then be enriched with information from W3CIIS to identify the attacker IP and User\nAgent. The attackers IP and User Agent can be used to hunt through multiple log sources for\npotential post-compromise activity.\n\nAfter the attacker details have been identified, the notebook can be used to locate files that\nwere accessed by the attacker prior to the web shell being installed. The notebook will\nalso locate the first instance that the attacker visited the server.\n\nAzure-Sentinel-Notebooks/Guided Investigation - MDE Webshell Alerts.ipynb at master ·\nAzure/Azure-Se...\n\nInstructions for getting the notebook up and running can be found in the original blog post,\nunder the title “Building out the Investigation using Jupyter Notebooks”.\n\nYou can stay up to date with the latest information at https://aka.ms/exchangevulns.\n\n7/7",
	"extraction_quality": 1,
	"language": "EN",
	"sources": [
		"VXUG"
	],
	"origins": [
		"pdf"
	],
	"references": [
		"https://papers.vx-underground.org/papers/Malware Defense/Malware Analysis 2021/2021-03-25 - Web Shell Threat Hunting with Azure Sentinel.pdf"
	],
	"report_names": [
		"2021-03-25 - Web Shell Threat Hunting with Azure Sentinel.pdf"
	],
	"threat_actors": [
		{
			"id": "8e05a6ef-ec62-4919-9630-7cb0af0d6d54",
			"created_at": "2026-09-14T02:00:04.201433Z",
			"updated_at": "2026-11-18T02:00:08.70428Z",
			"deleted_at": null,
			"main_name": "BRONZE SATIN",
			"aliases": [
				"HAFNIUM",
				"Murky Panda",
				"Silk Typhoon"
			],
			"source_name": "Secureworks:BRONZE SATIN",
			"tools": [
				"ChinaChopper",
				"Godzilla Webshell"
			],
			"source_id": "Secureworks",
			"reports": null
		},
		{
			"id": "7c969685-459b-4c93-a788-74108eab6f47",
			"created_at": "2023-01-06T13:46:39.189751Z",
			"updated_at": "2026-11-18T02:00:19.754602Z",
			"deleted_at": null,
			"main_name": "HAFNIUM",
			"aliases": [
				"ATK233",
				"G0125",
				"Operation Exchange Marauder",
				"Red Dev 13",
				"Silk Typhoon",
				"MURKY PANDA"
			],
			"source_name": "MISPGALAXY:HAFNIUM",
			"tools": [],
			"source_id": "MISPGALAXY",
			"reports": null
		},
		{
			"id": "529c1ae9-4579-4245-86a6-20f4563a695d",
			"created_at": "2022-10-25T16:07:23.702006Z",
			"updated_at": "2026-11-18T02:00:17.377748Z",
			"deleted_at": null,
			"main_name": "Hafnium",
			"aliases": [
				"G0125",
				"Murky Panda",
				"Red Dev 13",
				"Silk Typhoon"
			],
			"source_name": "ETDA:Hafnium",
			"tools": [],
			"source_id": "ETDA",
			"reports": null
		},
		{
			"id": "2704d770-43b4-4bc4-8a5a-05df87416848",
			"created_at": "2022-10-25T15:50:23.306305Z",
			"updated_at": "2026-11-18T02:00:08.68452Z",
			"deleted_at": null,
			"main_name": "HAFNIUM",
			"aliases": [
				"HAFNIUM",
				"Operation Exchange Marauder",
				"Silk Typhoon"
			],
			"source_name": "MITRE:HAFNIUM",
			"tools": [
				"Tarrask",
				"ASPXSpy",
				"Impacket",
				"PsExec",
				"China Chopper"
			],
			"source_id": "MITRE",
			"reports": null
		}
	],
	"ts_created_at": 1673535837,
	"ts_updated_at": 1794968101,
	"ts_creation_date": 1653752975,
	"ts_modification_date": 1653752975,
	"files": {
		"pdf": "https://archive.orkl.eu/057cc50a7dbbf0d2f310629bcbc3ee016004f997.pdf",
		"text": "https://archive.orkl.eu/057cc50a7dbbf0d2f310629bcbc3ee016004f997.txt",
		"img": "https://archive.orkl.eu/057cc50a7dbbf0d2f310629bcbc3ee016004f997.jpg"
	}
}