<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Red Team Feedback - RiskInsight</title>
	<atom:link href="https://www.riskinsight-wavestone.com/en/tag/red-team-feedback/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.riskinsight-wavestone.com/en/tag/red-team-feedback/</link>
	<description>The cybersecurity &#38; digital trust blog by Wavestone&#039;s consultants</description>
	<lastBuildDate>Wed, 15 Oct 2025 08:15:34 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://www.riskinsight-wavestone.com/wp-content/uploads/2024/02/Blogs-2024_RI-39x39.png</url>
	<title>Red Team Feedback - RiskInsight</title>
	<link>https://www.riskinsight-wavestone.com/en/tag/red-team-feedback/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>SharePoint &#038; App Registrations: A Vector for IT System Compromise and Red Team Feedback</title>
		<link>https://www.riskinsight-wavestone.com/en/2025/10/sharepoint-app-registrations-a-vector-for-it-system-compromise-and-red-team-feedback/</link>
					<comments>https://www.riskinsight-wavestone.com/en/2025/10/sharepoint-app-registrations-a-vector-for-it-system-compromise-and-red-team-feedback/#respond</comments>
		
		<dc:creator><![CDATA[Nathan HAMARD]]></dc:creator>
		<pubDate>Wed, 15 Oct 2025 08:15:28 +0000</pubDate>
				<category><![CDATA[Ethical Hacking & Incident Response]]></category>
		<category><![CDATA[Focus]]></category>
		<category><![CDATA[App Registrations]]></category>
		<category><![CDATA[Compromission]]></category>
		<category><![CDATA[cybersecurity]]></category>
		<category><![CDATA[detection]]></category>
		<category><![CDATA[feedback]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Privilege escalation]]></category>
		<category><![CDATA[red team]]></category>
		<category><![CDATA[Red Team Feedback]]></category>
		<category><![CDATA[Sharepoint]]></category>
		<guid isPermaLink="false">https://www.riskinsight-wavestone.com/?p=27964</guid>

					<description><![CDATA[<p>While on-premises Active Directory environments are being hardened against threats (tiering model, network segmentation, admin bastions, domain controller hardening), attackers are now exploiting a new component to compromise their targets: cloud resources, particularly App Registrations linked to Microsoft 365 services....</p>
<p>Cet article <a href="https://www.riskinsight-wavestone.com/en/2025/10/sharepoint-app-registrations-a-vector-for-it-system-compromise-and-red-team-feedback/">SharePoint &amp; App Registrations: A Vector for IT System Compromise and Red Team Feedback</a> est apparu en premier sur <a href="https://www.riskinsight-wavestone.com/en/">RiskInsight</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p style="text-align: justify;">While on-premises Active Directory environments are being hardened against threats (tiering model, network segmentation, admin bastions, domain controller hardening), attackers are now exploiting a new component to compromise their targets: cloud resources, particularly <em>App Registrations</em> linked to Microsoft 365 services.</p>
<p style="text-align: justify;">Often underestimated by internal technical and defence teams, and frequently over-privileged, <em>App Registrations</em> can enable powerful pivots following a cloud environment compromise.</p>
<p style="text-align: justify;">Among the most exposed services, <em>Microsoft SharePoint</em> stands out. Present on most M365 tenants and often configured permissively, it <strong>provides access to company files via SharePoint and to collaborators files through OneDrive</strong>.</p>
<p style="text-align: justify;">This article shares several observations from Red Team operations: how a simple <em>App Registration</em>, loosely or closely linked to SharePoint, can offer broad access to your on-premises IT system, and how exploiting this weak link can render your Tiering segmentation merely symbolic for an attacker.</p>
<p style="text-align: justify;"> </p>
<h2 style="text-align: justify;">Introduction to App Registrations</h2>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">In Microsoft Azure, registering an application (<em>App Registration</em>) in Entra ID allows you to create an identity for that application, along with an associated <em>Enterprise Application</em>. The <em>App Registration</em> defines the application (identifiers, keys, permissions), while the <em>Enterprise Application</em> represents its instance within the tenant, where access policies are applied (such as conditional access policies or assigned roles).</p>
<p style="text-align: justify;">An <em>App Registration</em> contains the necessary information to authenticate to Entra ID and obtain access tokens to interact with Microsoft 365 services via APIs like Microsoft Graph. Depending on the permissions granted – delegated (scopes) or application-level (roles) – it can read or modify resources such as emails, files, users, or groups, as long as the <em>Enterprise Application</em> is instantiated in the tenant.</p>
<p style="text-align: justify;"> </p>
<figure id="attachment_27968" aria-describedby="caption-attachment-27968" style="width: 1452px" class="wp-caption aligncenter"><img fetchpriority="high" decoding="async" class="wp-image-27968 size-full" src="https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/1-1.png" alt="App Registration in EntraID" width="1452" height="757" srcset="https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/1-1.png 1452w, https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/1-1-366x191.png 366w, https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/1-1-71x37.png 71w, https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/1-1-768x400.png 768w" sizes="(max-width: 1452px) 100vw, 1452px" /><figcaption id="caption-attachment-27968" class="wp-caption-text"><em>App Registration in EntraID</em></figcaption></figure>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">Typically used to register applications designed to automate business processes (user management, SharePoint file cleanup, O365 activity monitoring, etc.), App Registrations represent a largely <strong>unmonitored</strong> but high-impact <strong>surface</strong>.</p>
<p style="text-align: justify;">Indeed, the secrets of <em>App Registrations</em> (certificates, client secrets) are often stored insecurely – in code repositories, workstations, or servers. These secrets allow an application to impersonate itself with potentially elevated privileges (as listed in the <em>App Registration</em>), resulting in <strong>stealthy persistence across corporate resources</strong>.</p>
<p style="text-align: justify;">For an attacker, compromising an <em>App Registration</em> means <strong>acquiring an Entra ID application identity with direct access to certain corporate data</strong> – without needing to pivot through interactive user accounts or MFA. While security measures around user accounts are increasing (mandatory MFA, conditional access requiring trusted IPs or devices), these protections are often not yet applied to applications.</p>
<p style="text-align: justify;"> </p>
<h3 style="text-align: justify;">Connecting as an App Registration</h3>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;"><strong>Azure applications</strong> can authenticate with Entra ID using application secrets generated in the associated <em>App Registration</em>:</p>
<ul style="text-align: justify;">
<li><span style="text-decoration: underline;"><em>AppId</em> + </span><em><em><span style="text-decoration: underline;">App Secret</span>: </em></em>This authentication method is equivalent to using a username and password and is subject to the same limitations: it is <strong>difficult to ensure their protection</strong>, as they can easily be stored insecurely, exposed in command histories, etc.</li>
</ul>
<ul style="text-align: justify;">
<li><span style="text-decoration: underline;"><em>AppId</em> + </span><em><span style="text-decoration: underline;">Certificate</span>: </em>This method is more secure, as security solutions installed on machines effectively protect installed certificates. However, it is generally less used due to operational constraints, such as the need to install the certificate on each machine that uses the account.</li>
</ul>
<p style="text-align: justify;"> </p>
<figure id="attachment_27970" aria-describedby="caption-attachment-27970" style="width: 1801px" class="wp-caption aligncenter"><img decoding="async" class="wp-image-27970 size-full" src="https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/2-1.png" alt="App Registration certificates and secrets" width="1801" height="660" srcset="https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/2-1.png 1801w, https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/2-1-437x160.png 437w, https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/2-1-71x26.png 71w, https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/2-1-768x281.png 768w, https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/2-1-1536x563.png 1536w" sizes="(max-width: 1801px) 100vw, 1801px" /><figcaption id="caption-attachment-27970" class="wp-caption-text"><em>App Registration certificates and secrets</em></figcaption></figure>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">The application&#8217;s credentials and secrets allow it to retrieve an <em>OAuth2</em> access token, enabling authentication and API calls to Microsoft services (Graph, SharePoint, Exchange, etc.) that it is authorized to contact. This connection method is typically hard to detect if access logs are not enabled or monitored.</p>
<p style="text-align: justify;"> </p>
<h3 style="text-align: justify;">App Registration permissions</h3>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">Each <em>App Registration</em> defines the <strong>API</strong> <strong>permissions associated with the registered application</strong>. These are described as roles or scopes across various Microsoft services. For example, application permissions may allow:</p>
<ul style="text-align: justify;">
<li>Reading or modifying user profiles (<em>User.ReadWrite.All</em>),</li>
<li>Managing objects in the Entra ID directory (<em>Directory.ReadWrite.All</em>),</li>
<li>Reading, writing, or deleting files in SharePoint or OneDrive (<em>Files.ReadWrite.All</em>),</li>
<li>Reading or writing emails across all mailboxes (<em>Mail.ReadWrite</em>),</li>
<li>Etc.</li>
</ul>
<p style="text-align: justify;">During audits, it is observed that these permissions are <strong>often oversized</strong> compared to the actual needs of the applications. As a result, they can provide attackers with a <strong>significant privilege escalation vector</strong> if compromised.</p>
<p style="text-align: justify;">Moreover, an attacker can <strong>identify an application&#8217;s permissions through its associated and compromised </strong><em>App Registration</em> by authenticating via the URL <span style="color: #000080;"><a style="color: #000080;" href="https://login.microsoftonline.com/$TenantId/oauth2/v2.0/token">https://login.microsoftonline.com/$TenantId/oauth2/v2.0/token</a></span> :</p>
<p style="text-align: justify;"> </p>
<figure id="attachment_27972" aria-describedby="caption-attachment-27972" style="width: 1667px" class="wp-caption aligncenter"><img decoding="async" class="wp-image-27972 size-full" src="https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/3-1.png" alt="Access token retrieved for the Microsoft Graph API" width="1667" height="489" srcset="https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/3-1.png 1667w, https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/3-1-437x128.png 437w, https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/3-1-71x21.png 71w, https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/3-1-768x225.png 768w, https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/3-1-1536x451.png 1536w" sizes="(max-width: 1667px) 100vw, 1667px" /><figcaption id="caption-attachment-27972" class="wp-caption-text"><em>Access token retrieved for the Microsoft Graph API</em></figcaption></figure>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">The access token obtained is in <em>base64</em> format, and the permissions defined by the <em>App Registration</em> are embedded within it.</p>
<p style="text-align: justify;"> </p>
<figure id="attachment_27974" aria-describedby="caption-attachment-27974" style="width: 676px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" class="wp-image-27974 " src="https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/4-1.png" alt="Extraction of the compromised App Registration’s permissionsExtraction of the compromised App Registration’s permissions" width="676" height="565" srcset="https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/4-1.png 1035w, https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/4-1-229x191.png 229w, https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/4-1-47x39.png 47w, https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/4-1-768x642.png 768w" sizes="auto, (max-width: 676px) 100vw, 676px" /><figcaption id="caption-attachment-27974" class="wp-caption-text"><em>Extraction of the compromised App Registration’s permissions</em></figcaption></figure>
<p style="text-align: justify;"> </p>
<h2 style="text-align: justify;">Compromise of App Registrations during Red Team operations</h2>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">In the context of an attack, it is very common for the compromise to occur progressively. Typically, an initial server is compromised, then a second, and so on, until more critical infrastructure components or more privileged users are reached: initial access, privilege escalation, lateral movement, and so forth.</p>
<p style="text-align: justify;">In recent years, the implementation of the Tier model (Tier-0, Tier-1, and Tier-2) within Active Directory infrastructures has become widespread, resulting in increased security for on-premises IT systems. Another factor has also emerged with the development of EDR agents: detection!</p>
<p style="text-align: justify;">Now, in mature environments, it is much more difficult to compromise Tier-0 (domain controllers, PKI, etc.) simply by compromising a Tier-1 server, all without being detected by the Blue Team (the defence team).</p>
<p style="text-align: justify;">However, during several operations across very diverse environments, SharePoint has proven to be a formidable vector for privilege escalation, and in these cases, <strong>no detection was reported</strong> by the Blue Team.</p>
<p style="text-align: justify;">Several Red Team operation case studies illustrating this point are shared below.</p>
<p style="text-align: justify;"> </p>
<h3 style="text-align: justify;">Case 1: Tier-2 Administrator of a domain leading to the compromise of the Active Directory Forest</h3>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">This case illustrates an operation for an international client whose IT system includes several thousand servers – application and business servers, industrial systems, infrastructure, etc. The compromise of an initial server led to the <strong>compromise of Tier-1 and then Tier-2 administrator accounts</strong>.</p>
<p style="text-align: justify;">As soon as administrative privileges were obtained on workstations (Tier-2), a targeted collection phase began with the aim of identifying application secrets.</p>
<p style="text-align: justify;">On several workstations belonging to technical users (DevOps teams, Cloud teams, etc.), PowerShell scripts were discovered. Some of these contained <strong>credentials linked to App Registrations</strong>, including an <em>AppId</em>, an <em>AppSecret</em>, and the Azure tenant ID to which they were associated:</p>
<p style="text-align: justify;"> </p>
<figure id="attachment_27976" aria-describedby="caption-attachment-27976" style="width: 1570px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" class="wp-image-27976 size-full" src="https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/5-1.png" alt="PowerShell scripts containing App Registration credentials" width="1570" height="1066" srcset="https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/5-1.png 1570w, https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/5-1-281x191.png 281w, https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/5-1-57x39.png 57w, https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/5-1-768x521.png 768w, https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/5-1-1536x1043.png 1536w" sizes="auto, (max-width: 1570px) 100vw, 1570px" /><figcaption id="caption-attachment-27976" class="wp-caption-text"><em>PowerShell scripts containing App Registration credentials</em></figcaption></figure>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">Exploiting these secrets allows the attacker to <strong>connect directly to the</strong> <em>Microsoft Graph API</em>, using the permissions already granted in the compromised <em>App Registration</em>.</p>
<p style="text-align: justify;">The App Registration identified in this context had extensive application rights over O365, including:</p>
<ul style="text-align: justify;">
<li><em>User.ReadWrite.All</em>: Read and modify all user profiles.</li>
<li><em>Directory.Read.All</em>: Read directory data.</li>
<li><em>Directory.ReadWrite.All</em>: Read and write directory data.</li>
<li><em>Group.ReadWrite.All</em>: Read and write all group information.</li>
<li><span style="color: #ff0000;"><em>Files.ReadWrite.All</em>: </span>Read and write all files.</li>
<li><em>Mail.ReadWrite</em>: Read, write, update and delete emails in user mailboxes.</li>
<li><em>Calendars.ReadWrite</em>: Read and write all calendars.</li>
<li><em>Contacts.ReadWrite</em>: Read and write all contacts.</li>
<li><em>Tasks.ReadWrite</em>: Read and write all tasks.</li>
</ul>
<p style="text-align: justify;">Among this set of application permissions, the <em>Files.ReadWrite.All</em> right is <strong>particularly critical and attractive for an attacker</strong>, as it grants full access to all files stored on <em>SharePoint</em> and <em>OneDrive</em>.</p>
<p style="text-align: justify;"><em><strong><span style="text-decoration: underline;">Note:</span> </strong>These permissions can be “delegated”, in which case they only apply within the context of what the user can do.</em></p>
<p style="text-align: justify;">A PowerShell script has been developed by the Wavestone Red Team <span style="color: #000080;">(<a style="color: #000080;" href="https://github.com/Ethical-Kaizoku/SharePwned">SharePwned</a>)</span> to perform keyword-based searches on SharePoint and OneDrive and to download the desired files.</p>
<p style="text-align: justify;">Using this script, and by <strong>searching for the name of the Active Directory administration forest</strong> (e.g., <em>admin.xx.xxxx.net</em>), several files were identified within users’ OneDrive spaces and subsequently downloaded:</p>
<p style="text-align: justify;"> </p>
<figure id="attachment_27978" aria-describedby="caption-attachment-27978" style="width: 1988px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" class="wp-image-27978 size-full" src="https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/6-EN.png" alt="Identification of files containing secrets in OneDrive" width="1988" height="361" srcset="https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/6-EN.png 1988w, https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/6-EN-437x79.png 437w, https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/6-EN-71x13.png 71w, https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/6-EN-768x139.png 768w, https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/6-EN-1536x279.png 1536w" sizes="auto, (max-width: 1988px) 100vw, 1988px" /><figcaption id="caption-attachment-27978" class="wp-caption-text"><em>Identification of files containing secrets in OneDrive</em></figcaption></figure>
<p style="text-align: justify;"> </p>
<figure id="attachment_27980" aria-describedby="caption-attachment-27980" style="width: 769px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" class="wp-image-27980 " src="https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/7-1.png" alt="Retrieval of accounts dedicated to the AD administration forest" width="769" height="501" srcset="https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/7-1.png 1398w, https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/7-1-293x191.png 293w, https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/7-1-60x39.png 60w, https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/7-1-768x500.png 768w" sizes="auto, (max-width: 769px) 100vw, 769px" /><figcaption id="caption-attachment-27980" class="wp-caption-text"><em>Retrieval of accounts dedicated to the AD administration forest</em></figcaption></figure>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">These files, stored in the OneDrive spaces of technical users, made it possible to identify the <strong>pivot servers used to access the Active Directory administration forest</strong> of the information system.</p>
<p style="text-align: justify;">The <strong>insecure secrets storage</strong> on workstations and in cloud spaces represent a major security vulnerability. However, the lack of security controls and monitoring around this <em>App Registration</em> – linked to significant privileges – constitutes a critical weakness as soon as an associated <em>Enterprise Application</em> is instantiated in the tenant.</p>
<p style="text-align: justify;">In this case, the Tier-2 compromise, followed by read access to files stored in employees’ OneDrive spaces, quickly enabled the <strong>identification of secrets and network pivots necessary to compromise the company’s Tier-0 environment</strong>.</p>
<p style="text-align: justify;"> </p>
<h3 style="text-align: justify;">Case 2: Remote access to the group’s corporate network following the compromise of a subsidiary</h3>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">This second case describes a Red Team operation targeting a company with numerous subsidiaries whose networks do not communicate with each other.</p>
<p style="text-align: justify;">First, the IT system of <strong>one subsidiary was compromised</strong>, along with its Azure tenant.</p>
<p style="text-align: justify;">For persistence and further exploration, the Red Team then created an <em>App Registration</em>, adding the <em>Files.Read.All</em> application permission.</p>
<p style="text-align: justify;">By downloading the application’s secrets at creation, it was once again possible to use the tool developed by the Wavestone Red Team to search SharePoint and OneDrive:</p>
<p style="text-align: justify;"> </p>
<figure id="attachment_27982" aria-describedby="caption-attachment-27982" style="width: 1920px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" class="wp-image-27982 size-full" src="https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/8-EN.png" alt="Discovery of secrets in users’ OneDrive spaces" width="1920" height="344" srcset="https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/8-EN.png 1920w, https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/8-EN-437x78.png 437w, https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/8-EN-71x13.png 71w, https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/8-EN-768x138.png 768w, https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/8-EN-1536x275.png 1536w" sizes="auto, (max-width: 1920px) 100vw, 1920px" /><figcaption id="caption-attachment-27982" class="wp-caption-text"><em>Discovery of secrets in users’ OneDrive spaces</em></figcaption></figure>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">By searching for passwords, <strong>accounts associated with remote access solutions</strong> to the Red Team’s target company were identified. In fact, some members of the Finance teams in the compromised subsidiary had <strong>access to the group’s remote desktop solution</strong> and stored their passwords in clear text on their OneDrive.</p>
<p style="text-align: justify;">Although MFA was configured for all users of this solution, only notification approval was required – no code was requested. By flooding users with MFA notifications, one eventually approved the authentication, allowing the Red Team operators <strong>temporary access to the remote desktop solution</strong>.</p>
<p style="text-align: justify;">Finally, by accessing the Finance application hosted on a Windows virtual machine, access to the <strong>group’s internal network was obtained</strong>.</p>
<p style="text-align: justify;">Thus, starting from the compromise of a subsidiary with no direct interconnection to the group network, the use of <em>App Registrations</em> once again enabled the <strong>discovery of secrets and a pivot into the group’s IT system</strong>.</p>
<p style="text-align: justify;"> </p>
<h3 style="text-align: justify;">Case 3: Compromise of the EDR deployed on Domain Controller via the CICD pipeline</h3>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">The compromise of the client’s CICD environment (hosted on AWS) led to the compromise of their <em>GitLab</em> server. With <em>root</em> access to the <em>GitLab</em> server, it was possible to access its database and the secrets stored within. Although these secrets were encrypted, they could be decrypted via the <em>GitLab Rails</em> console.</p>
<p style="text-align: justify;">Among these secrets, Azure <em>clientID</em> and <em>clientSecret</em> for an <em>App Registration</em> were recovered. These credentials allowed access to Azure under the identity of the associated application – in this case, the <em>GitLab</em> application.</p>
<p style="text-align: justify;">On the client’s tenant, the <em>GitLab</em> application had a <strong>contributor</strong> role on the resources of an Azure subscription. This meant it could <strong>manage access to resources</strong> and <strong>read their contents</strong>.</p>
<p style="text-align: justify;">Among the accessible resources, secrets were stored (and readable) in an <em>Azure Key Vault</em>. In particular, <em>clientId</em> and <em>clientSecret</em> values were present:</p>
<p style="text-align: justify;"> </p>
<figure id="attachment_27984" aria-describedby="caption-attachment-27984" style="width: 1931px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" class="wp-image-27984 size-full" src="https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/9-1.png" alt="Exfiltration of App Registration secrets from an Azure Key Vault" width="1931" height="809" srcset="https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/9-1.png 1931w, https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/9-1-437x183.png 437w, https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/9-1-71x30.png 71w, https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/9-1-768x322.png 768w, https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/9-1-1536x644.png 1536w" sizes="auto, (max-width: 1931px) 100vw, 1931px" /><figcaption id="caption-attachment-27984" class="wp-caption-text"><em>Exfiltration of App Registration secrets from an Azure Key Vault</em></figcaption></figure>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">A new Azure application, named <em>xxxxx-NettoyageSharePoint</em>, was thus obtained. This application had the necessary permissions to read the entirety of SharePoint and OneDrive.</p>
<p style="text-align: justify;">Using an early version of the <em>SharePwned</em> tool, a search for secrets was carried out within employees’ OneDrive spaces. Insecurely stored secrets were discovered in configuration files for administration tools such as <em>mRemoteNg</em>. By default, these configuration files typically contain passwords encrypted with a known public key. As a result, it is possible to decrypt them and obtain users’ passwords in clear text:</p>
<p style="text-align: justify;"> </p>
<figure id="attachment_27986" aria-describedby="caption-attachment-27986" style="width: 1927px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" class="wp-image-27986 size-full" src="https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/10-1.png" alt="Retrieval of insecurely stored secrets in OneDrive" width="1927" height="165" srcset="https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/10-1.png 1927w, https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/10-1-437x37.png 437w, https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/10-1-71x6.png 71w, https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/10-1-768x66.png 768w, https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/10-1-1536x132.png 1536w, https://www.riskinsight-wavestone.com/wp-content/uploads/2025/10/10-1-1920x165.png 1920w" sizes="auto, (max-width: 1927px) 100vw, 1927px" /><figcaption id="caption-attachment-27986" class="wp-caption-text"><em>Retrieval of insecurely stored secrets in OneDrive</em></figcaption></figure>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">The account retrieved here had <strong>administrative privileges on the company’s IAM application</strong>.</p>
<p style="text-align: justify;">After multiple <strong>searches of documentation on SharePoint</strong> – still using the <em>SharePwned</em> tool to target the searches – the Red Team was able to understand the SOC team’s intervention methods on the Information System, the vaults where their secrets were stored, and the permissions required to access them.</p>
<p style="text-align: justify;">Then, using the IAM administrator account recovered from OneDrive, an attack was carried out based on the SOC’s intervention procedures, resulting in the <strong>complete compromise of the client’s on-premise Information System</strong>.</p>
<p style="text-align: justify;">In this scenario as well, targeted searches on SharePoint and OneDrive enabled the <strong>retrieval of highly valuable technical information for an attacker</strong>, including the EDR agent deployed on the domain controllers, the secrets required for its use, and the permissions needed to access it.</p>
<p style="text-align: justify;">Beyond the passwords recovered (whether encrypted or not) in all the previously described scenarios, SharePoint and OneDrive represent a <strong>gateway to knowledge of the Information System</strong> for the attacker. When the attacker wishes to remain discreet, they must closely <strong>mimic the company’s legitimate business and administrative workflows</strong>. The prerequisite for this is first to know them, then to understand and replicate them.</p>
<p style="text-align: justify;"> </p>
<h2 style="text-align: justify;">Protect and detect malicious use of App Registrations</h2>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">As previously mentioned, SharePoint and OneDrive have enabled the retrieval of sensitive and compromising secrets for client information systems. It is therefore essential to <strong>raise employee awareness</strong> about secure secret storage and to provide them with the necessary tools for this purpose.</p>
<p style="text-align: justify;">Nevertheless, it is important to implement processes and security measures for these applications to ensure compliance with the <strong>principles of least privilege</strong> and <strong>defence in depth</strong>. Below are recommendations to apply to these App Registrations.</p>
<p style="text-align: justify;"> </p>
<h3 style="text-align: justify;">Regular review and principle of least privilege</h3>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">It is important to <strong>inventory</strong> applications with permissions on SharePoint and <strong>restrict these applications to the bare minimum</strong>. The relevant permissions are:</p>
<ul style="text-align: justify;">
<li><em>Sites.Read.All</em>;</li>
<li><em>Sites.ReadWrite.All</em>;</li>
<li><em>Sites.FullControl</em>;</li>
<li><em>Files.Read.All</em>;</li>
<li><em>Files.ReadWrite.All</em>.</li>
</ul>
<p style="text-align: justify;">As with privileged users and groups, a <strong>regular review</strong> of these <strong>App Registrations</strong> is necessary.</p>
<p style="text-align: justify;"> </p>
<h3 style="text-align: justify;">Management and monitoring of secrets</h3>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">To prevent <em>App Secrets</em> from being stored insecurely (in scripts, documentation, emails, etc.), it is recommended to <strong>favour the use of connection certificates</strong>.</p>
<p style="text-align: justify;">In general, <strong>connection secrets</strong> should be subject to <strong>regular and automated renewal</strong>.</p>
<p style="text-align: justify;">Creating an <em>App Registration</em> automatically generates an <em>Enterprise Application</em>. When this is granted read permissions on SharePoint, consent from a <em>Global Administrator</em> is required. As a result, it is not trivial for an attacker to create such privileged applications, and adding a secret to an existing privileged application is often preferred by attackers.</p>
<p style="text-align: justify;">It is therefore important to <strong>monitor the creation of new connection secrets on privileged applications</strong>.</p>
<p style="text-align: justify;"> </p>
<h3 style="text-align: justify;">Reduce the attack surface</h3>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">Finally, it is recommended to <strong>limit the usage capabilities of these applications</strong>. This may involve <strong>restrictions on source IP addresses</strong> or on the <strong>time windows</strong> during which the application can be used.</p>
<p style="text-align: justify;"><em><span style="text-decoration: underline;"><strong>Note:</strong> </span>It is not always necessary to apply these measures in a “blocking” mode. In fact, detection without blocking can already allow the Blue Team to become aware of an attack and begin their response.</em></p>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;"> </p>




<p>Cet article <a href="https://www.riskinsight-wavestone.com/en/2025/10/sharepoint-app-registrations-a-vector-for-it-system-compromise-and-red-team-feedback/">SharePoint &amp; App Registrations: A Vector for IT System Compromise and Red Team Feedback</a> est apparu en premier sur <a href="https://www.riskinsight-wavestone.com/en/">RiskInsight</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.riskinsight-wavestone.com/en/2025/10/sharepoint-app-registrations-a-vector-for-it-system-compromise-and-red-team-feedback/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
