start	end	text
0	5360	All right, welcome to the last track of track four of DEF CON 33.
6440	11380	And he's going to be talking to us a little bit of his research into SCCM security.
12940	14300	Hi, everyone.
14460	16240	I'm super glad to be here.
16240	18140	And thank you for staying till the end.
18220	23780	So today in this last session, I will walk you through my research on SCCM.
24320	27160	So let me first introduce myself.
27160	36760	My name is Mehdi Eliassar, and I work as a red teamer at Synactive, which is an offensive security company based in Paris, in France.
36780	42100	So I've been working in IT security for eight years now, and I started as a pen tester.
42320	46200	And now I do red teaming full-time.
46360	52960	And I mainly focus on breaking web applications and also on Active Directory stuff.
54260	56760	So this talk will cover the following topics.
56760	64550	First, I will present and describe some key internals of SCCM, mainly to give you a grasp on how it works under the hood.
65060	68790	Then I will cover the CVs I've discovered in SCCM.
69180	80170	Then I will introduce some post-exploitation techniques that I've been using throughout my engagements, but also these techniques that led to the creation of a tool that I will present here.
80900	89040	And finally, based on the knowledge that we've got about the internals of SCCM, I will share with you some techniques to backdoor an instance.
90660	93680	So let's start with the SCCM internals.
93680	101040	For those who don't know what SCCM actually is, it was renamed recently to Microsoft Configuration Manager.
101200	105780	So it's an IT asset management solution edited by Microsoft.
105780	112900	It has been around for a long time now, and it is still widely used and deployed within organizations.
112900	121600	And so to manage devices, SCCM installs an agent on the clients, and it provides code execution capabilities.
121780	130900	And for us, on the offensive side, this makes it Microsoft's native C2, and it's a prime target during our engagements.
131600	142180	And today, there are many attack techniques to take over an SCCM instance, and they primarily arise from misconfiguration or a lack of hardening.
142900	149020	But they were widely documented until now, so I won't cover them in this talk.
149360	155900	So let's start with the first internal, and the first concept to introduce this part is the client communication modes.
155900	157220	So you have two of them.
157220	163320	So SCCM client mainly talks over HTTP with the management point.
164120	170700	So you have on the management point, you can configure it either with enhanced HTTP mode.
170700	174880	So this is mainly using plain HTTP transport mode.
174880	185320	Or you have HTTPS mode, which is advised by Microsoft, which requires an internal PKI to issue certificates such as ADCS.
186300	193660	And this is done to make the clients do mutual TLS with the management point services.
193660	198660	So this is what makes the clients present
203520	206220	a certificate to talk with the management point.
206220	216280	So sometimes in an engagement, you need that certificate, and it can be a bit painful to exploit SCCM.
217480	221230	Now let's take a look at how SCCM works under the hood.
221230	225010	Most services are web applications hosted on IIS.
225890	232410	From what I've seen, it's a mix of old and new technologies that are glued together sometimes.
232410	237010	You have mainly ASAPI modules alongside .NET applications.
237590	244770	And you also have COM that is heavily used between components, often with deep chains of COM codes.
244770	250350	So when you do reverse engineering, it can be hard to follow the code flow.
251490	257250	And as I have limited time, I will focus only on the services that I tied to the management point.
257990	261110	And let's start with the SMS management point service.
261110	267510	So on the right side, this is a snippet of a dump I did on the IIS web configuration.
267510	274410	So this is only for the SMS management point service, but we'll get other snippets for other services.
274590	279210	And you can observe here that there are three ASAPI modules in use.
279210	287470	One to serve policies to clients, another to serve scripts to clients, and the last one to serve location services information to clients.
288010	291450	So this service has four different entry points.
291450	303230	You have the standard one that is named SMS underscore MP, and other ones with the same modules, but different authentication methods, such as Windows Auth, Alt-Auth, and Token-Auth.
303670	315910	But also you can observe on the right side in the configuration on IIS that anonymous authentication is enabled on three entry points out of four.
316370	317410	So that's weird.
317970	327150	And as I said previously, when the management point is configured in HTTPS mode, a mutual TLS is required from the client to access the services.
327330	331130	This is the theory, but in practice, you can bypass this.
331150	336970	To do so, you have to use the SMS MP, Token-Auth, or Alt-Auth entry points.
337390	340530	And here, there is no need for a client certificate.
340770	349830	As you can see in the snippet below, the first query, we get a 403 error from the server asking for a client certificate.
349850	355190	But if you hit it with the other entry points, you get 200, and you can reach the services.
357130	358830	What can you do with this?
358830	369010	For example, on the service, you can hit the method MP list on the get-auth module to get a full list of management points within a site.
369130	371330	There are two interesting fields.
371330	380250	You have the version with the build number of SCCM and also the SSL state, which indicates if HTTPS mode is enabled on the management point or not.
380370	383430	You also have another method, which is MP list one.
383830	394090	You give it a parameter of the site code so you can enumerate management points from other sites within the same hierarchy.
394910	405970	So you can do with this unauthenticated reconnaissance on HTTP, but also on HTTPS if you use those TLS bypass, mutual TLS bypass that I showed you earlier.
408090	412110	Let me now cover another key service, which is CCM messaging.
412530	421710	This web app has a single ASAPI module with entry point named in a similar way than the ones we've seen before.
422370	426690	And here, too, anonymous authentication is enabled on three entry points.
428810	437950	So in practice, CCM messaging is an HTTP-based communication protocol that uses a custom method, CCM underscore post.
438210	449750	And this protocol is mainly used by the clients to discuss with the management points, but also it's used by other site servers, such as management points or between internal services.
450910	454810	In this snippet below, you have the structure of a message.
454810	461590	There is two main parts in a multi-part body, the XML header and the request, which is an XML document.
461670	469830	So in the header, sometimes you get a message signature that is included and it proves the device identity.
469830	473610	So this is how authentication is done here in this protocol.
475370	485990	And under the hood again, the ISAPI module serves as a single entry point that dispatches the messages to the right service handler.
486030	493510	So it does so by checking the value of the target and point field in the header part in the system message.
493550	498510	And once again, everything is done through COM as the service handler are COM classes.
498530	511770	They are configured within the WMI database as instances of the CCM service and point configuration class, and these objects can be found in two distinct namespaces.
512690	518090	So the first one is where the configuration is persisted between reboots.
519150	535790	And on this class, you have two interesting fields, the CO class one, which is the cellist ID of the COM service handler to call, and also the visibility field, which is super important as it indicates if a device identity is needed to interact with this service.
535790	538870	So this is where the authorization level is defined.
539570	547770	And as you can see in the dump below, the MP services are configured with either all or client signed visibility.
548170	553090	And I will circle back to this knowledge at the end of this talk for the persistence part.
554570	562450	And once again, when HTTPS mode is enabled, there is also a trick to bypass mutual TLS for CCM messaging.
562810	567710	So you need to use CCM system alt-auth entry point to do so.
567790	573030	Unfortunately, the other entry point with the token auth doesn't work at this time.
573030	583990	And as the alt-auth was introduced in recent version of ECCM 2403, this bypass won't work in older version of ECCM.
585230	590890	So how can you leverage this bypass to do some nasty thing on ECCM?
590950	596790	In fact, you can loot NIA credentials without having Windows credentials on the network.
597410	609310	So there is a well-known technique to harvest NIA credential is to register fake clients when you got yourself a Windows credential for a machine account.
609470	610470	That's needed.
610470	615650	So when you do that registration, the SSM client is approved.
615650	618430	And this is mandatory to pull policies.
618430	626370	However, with this mutual TLS bypass, if you register a client with a domain credentials, it is automatically marked as approved.
626670	631030	Thus, this gives you the ability to loot NIA credentials unauthenticated.
631410	637710	So I plan on updating the tool SSCM secrets, which is available on GitHub already.
637850	642850	So I will do a pull request in the next day, right after the DevCon.
642850	646230	So I've discovered this while preparing this talk.
647970	648510	All right.
648510	654310	Another service that is interesting is the one that is named SMS Provider.
654310	659130	It acts as an abstraction layer for read and write operation on the database.
659190	661950	So this is a completely different role.
661950	668390	It creates a specific WMI namespace named SMS underscore this three-letter site code.
668970	674550	And access control is managed through airbag, withdrawals that are defined in the database.
674910	684150	And there is also a local Windows group, SMS admin that is created, and it is granted access permission to the WMI namespace.
684230	693730	So this group automatically includes any user or group assigned an airbag role, as well as machine accounts of management points servers.
693730	696810	So this gives you the ability to do some relaying.
698710	704730	And on top of that, the SMS Provider exposes the Admin Service REST API.
705790	717810	So this API offers two routes, one for the OData protocol, and another one for WMI, supporting GET and POST operation on over 700 classes.
717810	725210	And this API is a .NET application built with Owen, and there is no way to configure or enable EPA.
725210	731170	So this makes it vulnerable by default, by design, to relay attacks.
731910	733430	So you can't fix that.
734350	738190	And let me finish with the Tenant Attach concept.
738190	744530	So for a hybrid management approach, an SCCM site can be configured with Tenant Attach.
744710	750490	Basically, the feature allows the on-premise SCCM instance to connect to Intune.
750730	755610	And when enabled, the SCCM instance uploads service device information to Intune.
755610	766890	But also from the Intune web console, you can run some actions on those on-premise device, such as asking for a device restart, but also installing application or running scripts.
767350	776730	And when this feature is enabled, there is a principle named config-manager-svc-underscore-guid that is created on your tenant.
776810	782990	So it's an intra-ID application, granted the following permission on the tenant.
782990	791850	So we have read and write collection data on the configuration manager microservice API, which is an undocumented API.
792110	796650	But also we have directory read-all granted on the graph API.
796970	803010	So this is an account that you can extract from the on-premise to perform reconnaissance on the tenant.
803710	809590	And I'll get back later to this account and show you how you can recover its credentials from the database.
811110	814390	All right, let's talk a bit about zero days.
814390	820570	So now I'm gonna walk you through how I identified vulnerabilities in SCCM.
820610	829890	I will mostly detail the methodology I applied so you can see exactly how the issues were discovered.
829890	831890	So I got two of them today.
832470	834990	So the first one, it's CVE-2024.
834990	840430	It's an unauthenticated SQL injection that I discussed earlier this year.
840470	848370	So it affects SCCM messaging, the MP location manager handler.
848890	857990	And as this handler is configured with visibility at all, so there is no need to prove the device identity which makes the exploitation unauthenticated.
859150	864910	And usually the management point and site server roles are installed on the same server.
864910	874370	So as the site server has the sysadmin role on the database, this issue allows you to instantly take over the database and all the sites.
874450	880170	And to mitigate the impact, Microsoft advises to install the roles on distinct servers.
880170	883530	So the code is already available on our GitHub.
885230	893650	All right, so to discover this issue, I kick-started my research by extracting strings from all the libraries used by SCCM.
894330	898730	And some SQL format string patterns stand out right away.
898730	907430	Also, there were method signatures that show up in the debugging messages that are left in the code of SCCM, which reveal the internal code structure.
908470	922830	Among those SQL patterns in the location manager library, precisely, there are some format strings used by the service to execute stored procedures, like the one calling MP get machine ID, which is highlighted here in the snippet.
923730	934810	So looking at the code next with the compiler like IDA, we can confirm that the input is formatted into the SQL string without escaping.
935210	939070	So here comes the question, how to reach this flawed method?
940950	952190	And thanks to the call tree overview plugin in IDA, you can observe that there are multiple paths to the flawed method, but one clearly stands out, the one highlighted here.
952570	956250	It stands out as the simplest route to reach the code.
956910	959610	So this is the one I took for the exploit.
959710	963130	There is less hassle and less condition to reach the code.
964330	969490	And following that shortest path from the CTO, I landed in the code location shown in this screenshot.
969790	979250	And once again, the debugging strings are helpful, as they indicate that the get machine ID is called right before an update SF method.
979650	984910	So this is helpful next to choose which requests to pick up.
984910	997250	So this is an extract of the partial request body, in which there are at least 20 names of XML document that are processed by this service that you can reach.
997290	1007690	And with the information that you, the hint that I got from the debug string, I could quickly choose the update SF request as the one to use to reach the flawed code.
1009830	1013050	And here is the final CCM message to exploit the injection.
1013050	1020310	So on the left side, you have the header part where the injection point is located in the source ID field.
1020310	1028110	So this is the injection point is in the header, which isn't even signed by the client.
1028150	1035610	And on the right side, you have a minimal update SF request filled with the placeholder values just so the exploit can work.
1035610	1037090	So that's the exploitation.
1037910	1044670	All right, so when the patch was released, I confirmed the issue was fixed because they now use prepared statements.
1045470	1057830	However, I've also noticed that the flawed code is still there and it's now gated by an if condition, which was raising questions about the purpose of that.
1059470	1065730	And digging a bit further, I concluded that the if condition checks if a registry value is set on the system.
1065730	1068430	So it's named disable additional validations.
1068730	1072770	So this is clearly a fail-safe to bypass that patch.
1073110	1079390	So when you exploit the system and you put that value, you will get the vulnerability again.
1079830	1089430	And I think the main reason is that the first version of the patch that was released by Microsoft was causing serious trouble to the customers.
1089810	1096750	So they left that if condition as a rollback for customers that are complaining about the patch.
1098430	1102670	All right, let's talk now about the other CVE 2025.
1102690	1107910	It's a not authenticated SQL injection in the SMS provider component.
1107910	1109450	It's the admin service.
1109990	1115630	Microsoft released a patch in July 2025 to address this flow.
1116250	1122050	So this vulnerability can be exploited using any SCCM airbag role, even the read-only one.
1122050	1123710	We'll see later why.
1124370	1129550	And I am releasing the proof of concept for this issue right after this talk.
1132090	1137530	So to discover this bug, I reviewed the MOV file for the SMS provider namespace.
1137530	1147030	I looked mostly for patterns where methods had parameters that appear numeric but are defined as strings in the WMI side.
1147070	1156370	So this mismatch between the expected type and the one defined into WMI enables potential injection.
1156370	1168810	So this, I identified the method update classic deployment as a good candidate, as its offer ID parameter seems numeric, but it's defined as a string in the WMI MOV.
1168810	1171690	So you have its definition here in the snippet.
1174170	1184630	All right, so looking into the code behind of update classic deployment, I noticed that the SQL injection occurs in the permission check step.
1184970	1190890	So that's why a user with any RBAC role, even the read-only one, can exploit this injection.
1193050	1197070	And from my point of view, there are two ways to exploit this issue.
1197090	1203950	First is obtaining credentials for a user having any SSCM administrative role.
1204090	1208130	But this is not that easy on an engagement.
1208790	1219710	Otherwise, you can perform authentication relay against the admin service API on which EPA protection can't be required.
1219930	1225650	So depending on the topology of the deployment you got, you have multiple scenarios.
1225650	1237170	First, if the SMS provider role is installed on a dedicated server or not on the management points, you can relay the management point to the admin service and exploit the injection.
1237170	1247110	If there are multiple management points deployed on a site, you can relay one management point to another management point hosting the SMS provider role.
1247230	1258910	And if there is a single management point in a standalone mode with also the SMS provider role on the same server, you can try some self-relay attacks if it isn't patched against it.
1259010	1264710	So remember, there is a CVE for NLM reflection that was disclosed in June.
1264710	1266590	So you can use that to exploit.
1268730	1274010	All right, so I have other unresolved issues with Microsoft, but I cannot cover them in this session.
1274010	1281210	But stay tuned, I will share the details at the appropriate time when I got the disclosure is okay.
1282370	1288670	Let me cover now the post-exploitation phase, when you got yourself an admin access.
1289190	1292070	Let's see what you can do from the database, for example.
1292750	1296910	So in SCCM, there is the create and run script feature.
1296910	1301690	It's super interesting as it allows you to run PowerShell on a single device.
1301930	1309130	The execution is done as system, and the process is spawned by the CCM exec process, which is highly trusted binary.
1309470	1315810	And to exploit this feature, actual public tools leverage the admin service API of the SMS provider to do so.
1315910	1321010	So there are some downsides to doing that, especially during a red team.
1321010	1323450	First, all actions are logged.
1323890	1327690	Then there is also a double approval mechanism by default.
1327690	1330770	So you need two accounts to exploit this.
1330770	1334230	One to create the script and another one to approve it.
1334310	1339190	And finally, you can't properly clean exploitation artifacts behind yourself.
1340970	1349410	So I asked myself if it was possible to trigger the script execution feature directly from the database access.
1349570	1351010	And the answer is yes.
1351010	1357070	Doing so bypasses the double approval process, and it leaves minimal logging press behind you.
1357330	1358550	And here is how to do so.
1358550	1360430	We have some steps to do so.
1360670	1364410	First, you'll have to create an entry in the scripts table.
1365490	1367630	There are some columns that are interesting.
1367950	1372030	For example, the script type set to zero is for PowerShell.
1372070	1373110	You have the approver set.
1373110	1377010	You directly set it to three, so to mark the script as already approved.
1377230	1378450	You have a feature.
1378450	1381950	If you set it to one, the script won't show up in the admin console.
1381950	1387530	Finally, the approver author are free text, so you can spoof whatever identity suits you.
1389290	1395010	Then we add an entry in the BGP task table, which will reference the script that we've created.
1395010	1397230	So we have one part is the template ID.
1397230	1402290	We set it to 15 to say that it's a task to request script execution.
1402430	1408090	Then you have the param column, which holds a task param XML document.
1408090	1412670	So this document will include the ID of the script to execute.
1412670	1421070	So this is the document that will be sent to the clients, and the clients will use that information to fetch the script and execute it.
1423170	1426610	Then we add an entry in the BGP REST task table.
1426610	1429650	So this is where you assign the task to a client.
1429650	1437610	You can see there is a field for the resource ID for the device, managed device, that you want the task to be executed on.
1437610	1445430	So this insertion triggers a push notification to the client, and it downloads the XML document and the script later.
1446950	1457110	To check the script output, in fact, the task's output is sent back by the client to the management point, which stores it in the script execution status table.
1457550	1461330	So you have the exit status code along the route output.
1461370	1465550	So you have to, after a slight delay, you have to query that table.
1468130	1480170	Regarding the login, the only thing on the client side that is logged is the task param XML document that is left in the CCM notification agent log file.
1480350	1483970	But the script content isn't logged, so that's OK.
1484090	1492450	However, beware that the script, which is downloaded on the client side, is stored in a script store folder.
1492470	1498750	But that file isn't removed after the execution, so you need to delete it manually.
1500930	1504650	And now I'm glad to introduce you to sccm-sql-client.py.
1504650	1509790	It's a tool that implements these techniques to automate as much as possible.
1510170	1516570	So it started as a fork of Impact's MSSQL client with queries to explore an SCCM database.
1516990	1529230	This is a tool that I've created for a red team a year ago and that I've kept improving with new ideas from the on-the-field experience, but also the knowledge I've gained from my research throughout the time.
1529310	1536430	So regarding the feature, there are some queries to map the topology, but also to list clients or list store credentials.
1536510	1543550	But also you have some features to run the PowerShell scripts on clients, but also to decrypt the credentials automatically.
1544310	1553410	And this tool also includes some anti-forensic measures as it automatically prepends a small command to your scripts to clean the script store folder.
1553410	1556310	So you don't leave anything behind you.
1556310	1560850	And it also includes some helpers to clean the artifacts easily from the database.
1561150	1564770	And let me just describe you some of its key commands.
1567310	1570630	First to map the topology, you can use SCCM servers.
1570630	1576610	It will just list the servers within a hierarchy so you can check for server from other sites.
1576610	1578330	Then you have SCCM devices.
1578330	1584050	So you will get a full list of known devices, also devices from other sites.
1584350	1588010	Then an important one is SCCM devices BGP status.
1588010	1594550	So we get only the clients for your current sites with their BGP status.
1594550	1600510	So the BGP status is the thing that will tell you if you can execute scripts on those clients.
1602230	1612830	And to run scripts on a device with the tool, you will have to load its content first, either in line with a set PS1 script or from a local file with load PS1 script.
1613130	1618270	And then you'll have to run SCCM run script with the resource ID of your target device.
1618350	1622790	And at this step, the tool prepends the commands to clean the script store folder, as I said.
1623490	1627350	Then to get the output, you use last task output.
1627350	1629910	It's a helper to check the execution output.
1629910	1633990	It uses the generated GUIDs that are kept in memory.
1634630	1640330	Finally, use the last task clean, which is a helper to clean the artifacts from the database.
1640330	1642310	It will delete everything.
1644810	1652110	Regarding secret extraction, so to look for secrets in the database, you can use SCCM user accounts.
1652110	1656330	It will query the table that stores NAA accounts and push accounts.
1656610	1661650	And here the password field is encrypted with crypto API on the site system server.
1661650	1665970	And only that site system server that issued that blob can decrypt it.
1668450	1671970	And you also have SCCM AAD apps.
1672090	1681010	So this is the command to list the intra-ID credentials that are stored when you have configured to not attach feature.
1681370	1693610	So here we have two columns, secret key, which is a blob that can be decrypted by a single site system, but also secret key for SCP, which uses a key shared between all systems.
1693610	1695390	So this is mostly interesting.
1695390	1698710	It makes it easier to decrypt.
1699770	1706170	And to decrypt the secrets, we need to execute code on the site system servers that created the blobs.
1706550	1710170	And by default, they are enrolled as clients too.
1710310	1713950	So we can run a specific script to decrypt those blobs.
1714410	1719290	So the tool has an SCCM decrypt blob command to automate that process.
1719910	1725050	So you need to give it the resource ID of a site system server and the blob to decrypt.
1725050	1730130	And depending on the blob format, it will use the right PowerShell command snippet to decrypt it.
1730130	1739030	So these commands use C-sharp assemblies available on the SCCM servers and that expose methods to decrypt those secrets.
1739030	1743310	So you have more details in the slides for later.
1744350	1746410	So it's time for a demo.
1746410	1755210	So I will start as an authenticated attacker and I will exploit the mutual TLS bypass to register clients, then dump the NAA credentials.
1755330	1767770	Within those NAA credentials, I will use one of those accounts to access the admin service API, exploit the SQL injection to create myself and admin access to the database.
1767770	1775230	And finally, with the database level access, I will showcase you the SCCM SQL client tool for some commands.
1778980	1784180	So I'm starting with some recon with the bypass for mutual TLS.
1788410	1797550	So here with the token auth, and with the auth auth, I'll show you that I can get the list of management points over HTTPS.
1798110	1803970	And now I'm using a modified version of SCCM secrets to dump the policies.
1803970	1811590	So I'm not giving it any Windows credentials and I will dump the policies like that over HTTPS too.
1811970	1815990	So this is the name of the client, the fake client that will be created.
1816410	1817470	And here we go.
1819150	1823890	And we have three accounts that are dumped by the tool and the last one we'll use it later.
1823890	1830010	So now I'm gonna show you that the fake clients that is created from in the SCCM console is approved.
1830010	1833770	So this bypass makes you create an approved client.
1835530	1849770	So now let's use the SCCM user, user SCCM read only to access the admin service API and exploit the CV 2025 and create our self an admin account on the database.
1854010	1855010	That's done.
1855010	1861470	Now we can use SCCM SQL client to access the database and confirm that we are administrator.
1862630	1865970	Now we can list the sites and it works.
1865970	1870150	So now let me showcase the SCCM SQL client.
1870150	1873530	First by executing commands on a domain controller.
1873530	1878550	So now with the BGP status, I confirm that the DC has online status at one.
1878550	1880810	So we can execute commands on it.
1881290	1886430	And right here, I'm loading a command to execute on the controller.
1886950	1888610	Then I will launch it.
1888610	1893490	So you need to pass the resource ID to run the command.
1897670	1901790	And now we wait a bit and we're gonna get the outputs.
1901790	1903590	And that's all right.
1910630	1916010	Okay, so with the last task clean, you can clean behind yourself the insertion that were done in the database.
1916310	1920290	So now let me show you how we can extract the credential and decrypt them.
1920990	1922970	So this is for the user accounts.
1922970	1925770	We have the push account, the NA accounts here.
1926270	1934210	So now I'm gonna look for the site system server, which is on this deployment is the management point.
1934210	1935410	CMC.
1935690	1939470	And I'm gonna get the resource ID of this server.
1940110	1946890	Then use that resource ID with SCCM decrypt blog and pass the blog to.
1948090	1954730	So right here, it's gonna run the scripts on the targets and wait a bit for the outputs.
1954730	1958870	Then it will print out the passwords for that account.
1960150	1961270	And that's it.
1961270	1963270	We have the password right there.
1964210	1969910	And now let me show you the same for those credentials for the application on Entry ID.
1971090	1972950	So this is pretty much the same.
1972950	1978570	We get our blog and we pass it in the comments for decryption.
1990350	1991550	And that's our app.
1992990	1994690	That's all for this demo.
2000970	2006230	All right, so let me conclude this talk with two persistence methods.
2006950	2012850	First, it consists in backdooring the CCM messaging protocol with a rogue service handler.
2012850	2021590	So you only have to do is create a DLA that implements the ECCM endpoint interface and the method executes.
2021590	2022990	It's a com method.
2023690	2030730	So I will, in this example, the method will receive PowerShell commands and returns the commands in the outputs.
2030770	2035430	Then you have to register the cellist ID on the management point.
2035430	2042670	Then create a new CCM service endpoint configuration WMI object that use that rogue cellist ID.
2042930	2045470	And the POC is available on our GitHub.
2045470	2048310	So you can grab it if you want to test it.
2051970	2059210	And right here, this is the signature of the execute method that you need to implement for this backdoor to process incoming messages.
2059210	2063870	And to do so, the first agreement is the CCM messaging service.
2064330	2069990	It has to be used to send the reply back with the send message method.
2070590	2077290	And to process the incoming message, it's as the second argument of the execute method.
2077290	2086090	So you use that argument and call the get body wide string method on it to get the input XML.
2087730	2091070	Let me show you a demo of this backdoor in action quickly.
2095540	2098480	So this is a session on a management point.
2098480	2103920	I opened the WMI Explorer to explore the config related to SSM components.
2103960	2108460	And mostly the one for the service handler that are registered on the management point.
2109540	2111300	So I'm looking for it here.
2114050	2121830	So I'm going to look for the one that starts with MP and the one with the visibility set to all.
2121990	2128390	And this is the one that I'm going to copy and use as a template for the backdoor service handler.
2129170	2134390	And now I'm going to compile the ROC service handler code which is written in C sharp here.
2134750	2139130	Then I will use reg ASM to register the ROC class on the system.
2144590	2154790	And finally, I'm going to use a partial script to register the ROC service handler in the WMI database of the CCM as a CCM service endpoint configuration instance.
2154790	2160630	Here it is named MP backdoor and the visibility is set to all so we can exploit it unauthenticated.
2162190	2169850	And we can see in the WMI explorer that we have our ROC service installed and it will persist between reboots too.
2171090	2175890	And now I'm going to use a Python client to interact with that service.
2176330	2180730	So I'm going to talk with the management point over HTTPS.
2182430	2185770	And now I'm giving it the name of the service backdoor.
2185770	2188850	Then the command to execute WMI, for example.
2193470	2196850	And we got the output here, the inter-authority system.
2198350	2202470	And let's do some directory listing too.
2202730	2205470	And we got the output too from the backdoor.
2207630	2212190	So that's all for this demo.
2215510	2216890	All right.
2216890	2221410	Last persistent technique without a demo but it's an idea.
2221530	2230330	And the idea here is to backdoor the stored procedure that are used by endpoints accessible without authentication on the management point.
2230470	2244630	So there are some legitimate procedures that are altered so that when a specific pattern is detected in the input, the procedure executes our supplied SQL statement.
2244750	2253610	And beyond functioning as a backdoor, this technique can be leveraged when a SQL injection exists but direct access to the database isn't possible, for example.
2253610	2263510	And in such cases, the management point acts as a SQL client allowing execution of arbitrary commands through the backdoor procedure.
2263950	2273190	And here below you have some example of unauthenticated endpoints exposed by the management point and the stored procedure they call.
2273570	2286590	So you have the first two ones for downloading policies and script documents that call MP get policy body or MP get SDM document.
2286950	2298210	But also the last one is more interesting because it is through the CCM messaging and through post requests so you can send bigger payloads.
2298210	2305870	So you use the site information request, for example, on the MP location service handler which calls the MP get sit info.
2306530	2312950	So this is a technique that I'm going to blog about a bit later with more details, so stay tuned about it.
2313950	2315090	So thank you.
2315090	2317030	Let me wrap this talk quickly.
2317030	2321950	So all the code examples that I presented are accessible through the links provided here.
2322310	2328350	And follow our blog for upcoming posts on this topic and also disclosure of pending issues.
2328350	2330310	And thank you very much for your attention.
2330310	2331770	I'm grabbing some questions from...
