Power Pwn: An offensive and defensive security toolset for Microsoft 365 Power Platform
Power Pwn
Power Pwn is an offensive and defensive security toolset for Microsoft Power Platform.
Disclaimer: These materials are presented from an attacker’s perspective to raise awareness of the risks of underestimating the security impact of No Code/Low Code. No Code/Low Code is excellent.
Module
- Copilot Connector and Automator: Allow interaction with Copilot for Microsoft 365 through the WebSocket messages and undocumented APIs. This module implements multiple capabilities than can be easily extended to implement any process that requires interaction with the Copilot.
- Copilot Interactive Chat: Interactive chat with Copilot M365 through the terminal.
- Copilot M365 ‐ Dump: Data dump is a tool for exploring information in Microsoft 365 from a Red Team perspective.
- Extract emails contents
- Sharepoint site content enumeration and extraction
- Password and credentials harvesting
- Copilot M365 ‐ Whoami: Extracts useful information about the current user such as:
- Name, title, email, manager etc.
- Accessible documents
- Weekly schedule
- Accessible Sharepoint sites
- Access to financial data
- Emails
- Collaborators and Contacts
- Copilot Studio Hunter ‐ Deep Scan: Conducts deep scanning to find open Copilot Studio bots based on domains or tenant IDs using an automation which utilizes different Copilot Studio & Power Platform mechanics and the Power Platform API, FFUF and Puppeteer.
- Copilot Studio Hunter ‐ Enum: Utilizes open-source intelligence to compile lists of environment and tenant IDs from the Power Platform API subdomains to be used by the other Copilot Studio scanning sub-modules. Uses amass.
- Install a backdoor: Maintain persistency on Power Platform by installing an automation factory that creates, executes and deletes arbitrary commands.
- Internal phishing: Set up an internal phishing application on a Microsoft-owned domains which will automatically authenticate as users browse to your link.
- No‐Code Malware: Repurpose Microsoft-trusted executables, service accounts and cloud services to power a malware operation.
- Power Pages: Conducts a scan to test and alert of any anonymous access to dataverse tables via power pages, either via the apis or odata feeds.
- PowerDump:powerdump is a tool for exploring information in Microsoft PowerPlatform from a Red Team perspective. In short, this is what it does:
- Generates access tokens for fetching available resources in Microsoft PowerApps.
- Uses HTTP calls in Python to dump all available information in the Microsoft PowerPlatform into a local directory.
- Generates access tokens for performing advanced actions on the discovered resources.
- Provides a basic GUI for presenting the collected resources and data.
How to set up your power-pwn cloud account
Set up a malicious Microsoft tenant
Set up your free Microsoft tenant by following Microsoft guidelines
Create a malicious user account and assign it a Power platform administrator role. The admin role isn’t necessary, it’s just convenient.
On a private browser tab
Go to https://flow.microsoft.com and log in with the malicious user. Follow through the sign-in process to initiate a Power Automate trial license.
Follow the same process with https://make.powerapps.com to initiate a Power Apps trial license.
Create a Service Principal by following Microsoft guidelines and note the tenantId, applicationId, and secret.
Infect a test victim machines
Infect a test machine by following the How to infect a victim machine guide.
Verify that the machine has been onboarded
Log into https://flow.microsoft.com as the malicious user
Click Go to Monitor and then Machines and verify that the test victim machine is there
Upload pwntoso to your Power Automate cloud environment
Log into https://flow.microsoft.com with the malicious user.
Go to Solutions and click Import solution
Zip the content of pwntoso_1_0_0_1 and select it when asked to provide a solution file. Follow the guided process to completion.
- When asked to provide a connection, follow the guided process to create a new machine connection. Use the test victim machine credentials.
Go to My flows and search for Endpoint
Click on Edit and then on When an HTTP request is received and copy the URL under HTTP POST URL
Note the HTTP Post URL for use with the Python module.