PISA Pakistan — Community CERT

← ⚙️ Red Team Fundamentals (Ethical)

26. Red Teaming Microsoft 365 & Google Workspace: Cloud Collaboration Attacks

⏱ 9 min

Red Teaming Microsoft 365 & Google Workspace: Cloud Collaboration Attacks

Cloud Adoption in Pakistani Enterprises

Government ministries, banks, and telecom giants rely on Microsoft 365 (M365) and Google Workspace for email, file sharing, and collaboration. Attackers increasingly target the identity plane (Azure AD) rather than perimeters, making these platforms a high‑value attack surface for red teams.

Initial Recon & Tenant Enumeration

  • Gather tenant info using roadrecon (for Azure AD) or the aadlediscov script to retrieve:
    • Tenant ID, login domains, and federation settings.
    • Open Azure AD applications (OAuth 2.0 consent phishing).
  • Microsoft Online (MSOL) spraying:
    python3 MSOLSpray.py --userlist users.txt --password Summer2024! --url https://login.microsoft.com/common/oauth2/token
    
  • Google Workspace enumeration via gam (Google Admin Manager) to list users, groups, and devices.

Credential‑Based Attacks

  • Password spraying against Azure AD with common Pakistani weak passwords (e.g., Pakistan@123). Enforce MFA for all accounts; test its resilience by attempting MFA bypass via push fatigue or token hijacking.
  • OAuth consent phishing: craft a fake app requesting Mail.Read or Files.ReadWrite permissions, then send the link via a spear‑phishing email.

Privilege Escalation & Data Exfiltration

  • Azure AD privilege roles: Identify Global Admins, Privileged Role Administrators, or misconfigured Conditional Access policies.
  • Use Microburst to dump Azure AD tokens and BloodHound (Azure版) to map lateral paths.
  • Exfiltrate SharePoint/OneDrive files via curl with stolen OAuth tokens:
    curl -H "Authorization: Bearer <token>" https://graph.microsoft.com/v1.0/sites/root/drive/root/children
    

Defensive Recommendations

  • Enable Continuous Access Evaluation (CAE) and enforce phishing‑resistant MFA (FIDO2).
  • Restrict OAuth app permissions; regularly audit approved apps via the M365 Secure Score.
  • Deploy Microsoft Defender for Cloud Apps to detect anomalous sign‑in locations.

Do / Don't

  • Do simulate a real‑world adversary using CALDERA with M365 plugins.
  • Do report any OAuth consent anomalies to your SOC.
  • Don't store harvested tokens in plaintext; use a password manager or encrypted vault.
  • Don't exfiltrate real user data; use synthetic files for proof‑of‑concept.

Takeaway: Run a password‑spray test against your M365 tenant using MSOLSpray and confirm that MFA blocks all attempts. This single test reveals whether your identity controls would stop a common cloud‑phase attack.

← PrevNext →