SlideShare uma empresa Scribd logo
1 de 21
Outlook & Exchange
for the Bad Guys
IT’S ALWAYS FUN BREAKING THE RULES
NICK LANDERS / @MONOXGAS / SILENT BREAK SECURITY
> getuid
Nick Landers (@monoxgas)
Security Consultant at Silent Break Security
Salt Lake City, Utah, US
Hacking for 8 years, 2 professionally
My Loves:
◦ Writing Windows malware (slingshot/throwback)
◦ Coding with C++, Python, or PowerShell
◦ Security Research for the Red Side
◦ Long walks on the beach
NICK LANDERS / @MONOXGAS / SILENT BREAK SECURITY
Tonight’s Agenda
1. Exchange Overview
2. Recon
3. Credential Harvesting
4. Outlook Rules
5. Exploitation Details
6. Demo!
7. Questions
NICK LANDERS / @MONOXGAS / SILENT BREAK SECURITY
Currently supported versions: 2007, 2010, 2013, 2016
Office 365 / Outlook.com
Remote Access Protocols
◦ Exchange Web Services (EWS) – SOAP over HTTP
◦ Outlook Anywhere – RPC over HTTP
◦ MAPI over HTTP (Exchange 2013+)
◦ Exchange ActiveSync (EAS) – HTTP/XML – High latency/Low bandwidth
Functions
◦ AutoDiscover – Fast collection of Exchange configurations, supported protocols, and service URLs
◦ Outlook Web App (OWA) – Minimal E-Mail client available via the web – http://mail.org.com/owa
◦ Global Address List (GAL) – LDAP/Active Directory
NICK LANDERS / @MONOXGAS / SILENT BREAK SECURITY
Recon
Goal: Collect E-Mails, usernames, and (maybe) passwords from public resources
Sources:
◦ Search engines (Google, Bing, etc.)
◦ Company Websites – DNS brute-forcing to discover subdomains
◦ Public Websites (LinkedIn, GitHub)
◦ Database Dumps (leakedsource, haveibeenpwned)
◦ Active Directory – For lateral movement and segmentation bypassing
Tooling:
◦ Discover - https://github.com/leebaird/discover (Lee Baird)
◦ Passive: ARIN, dnsrecon, goofile, goog-mail, goohost, theHarvester, Metasploit, URLCrazy, Whois, multiple websites, and recon-ng
◦ Active: nmap, dnsrecon, Fierce, lbd, WAF00W, traceroute, and Whatweb
◦ FOCA - https://www.elevenpaths.com/labstools/foca/index.html
◦ LinkedIn Scraper - https://github.com/wpentester/Linkedin_profiles (Hans Petrich)
◦ HackerTarget - https://hackertarget.com/ip-tools/
NICK LANDERS / @MONOXGAS / SILENT BREAK SECURITY
Collecting Credentials
Brute Forcing Techniques
◦ OWA – Black Hills Security Password Spraying w/ Burp - http://www.blackhillsinfosec.com/?p=4694
◦ EWS – ShellIntel PowerShell Toolkit - https://github.com/Shellntel/OWA-Toolkit
◦ NTLM HTTP Auth – Python Requests - https://github.com/requests/requests-ntlm
◦ Use a targeted E-Mail list with common passwords – Summer2016, Password1, etc.
NICK LANDERS / @MONOXGAS / SILENT BREAK SECURITY
Collecting Credentials pt. 2
Credential Harvesting Attacks via E-Mail
◦ Impersonate target company logon page (OWA, Office 365, etc.)
◦ No payload to burn + Blend with the spam
◦ = Attacks can be scaled up (5-10 vs 100-200 targets)
External Site Compromise (WordPress, LiveAgent, etc.)
◦ No longer useless for gaining internet network access!
◦ Credential re-use is VERY common
◦ Backdoor logon pages with JavaScript to steal credentials
◦ Grab passwords from databases
◦ Social Engineering
NICK LANDERS / @MONOXGAS / SILENT BREAK SECURITY
Outlook Rules Overview
“A rule is an action that Outlook for Windows runs automatically on incoming or outgoing
messages. You choose what triggers the rule as well as the actions the rule takes.” – Microsoft
Rules can be created:
◦ Server side (OWA, Outlook.com)
◦ Client side (Outlook)
◦ Often not compatible due to subtle differences in the usage of rule properties
Rule action order:
◦ Server side actions (move mail to folder)
◦ Client side actions (print a message)
Rules are stored with the exchange server. Any new Outlook instance receives all existing rules
When a client side action is needed, deferred action message (DAM) is sent to client w/ rule ID
NICK LANDERS / @MONOXGAS / SILENT BREAK SECURITY
Rule Actions
That looks promising!
NICK LANDERS / @MONOXGAS / SILENT BREAK SECURITY
Peeking Inside
NICK LANDERS / @MONOXGAS / SILENT BREAK SECURITY
A Deeper Look
NICK LANDERS / @MONOXGAS / SILENT BREAK SECURITY
ShellExecuteEx
lpVerb – “The set of available verbs depends on the particular file or folder. Generally, the
actions available from an object's shortcut menu are available verbs. This parameter can
be NULL, in which case the default verb is used if available. If not, the "open" verb is used.”
◦ Can be viewed/modified in HKEY_CLASSES_ROOT
lpFile – “The address of a null-terminated string that specifies the name of the file or object on
which ShellExecuteEx will perform the action specified by the lpVerb parameter. ”
lpParameters – “Optional. The address of a null-terminated string that contains the application
parameters. ”
NICK LANDERS / @MONOXGAS / SILENT BREAK SECURITY
Exploitation Challenges
Requires valid account credentials along with Exchange service access
◦ Recon & Brute Forcing
◦ RPC/MAPI over HTTP
No command line arguments
Need a local file on disk for Outlook to open – UNC to the rescue! (ServerShareevil.exe)
◦ Local SMB share (Kali Linux, existing windows share) – Internal pentesting/pivoting/persistence
◦ WebDAV share – Accessible via UNC path – HTTP with proxy awareness
A file type which can give us code execution with ShellExecute
◦ BAT, EXE, PIF, VBS, JS, HTA, LNK, etc.
Target needs Outlook open to receive the DAM and execute the attack
NICK LANDERS / @MONOXGAS / SILENT BREAK SECURITY
Use Cases
Initial Access to a target network
◦ Relatively easy to collect E-Mail credentials externally
Pivot to workstation without local admin privileges
Bypass network segmentation
Persistence:
◦ Stealthy – Obscure technique with minimal tooling available for detection/monitoring
◦ Long-Term – Linked to E-Mail profile, not workstation. Persistence across a DFIR wipe
◦ Drop a executable onto an internal file share
◦ Load rule into many E-Mail accounts, trigger with one E-Mail
NICK LANDERS / @MONOXGAS / SILENT BREAK SECURITY
State of things
Rulz.py – Build malicious RWZ files for importing into Outlook (monoxgas)
◦ https://gist.github.com/monoxgas/7fec9ec0f3ab405773fc
Ruler – MAPI over HTTP to quickly sync rule file without building complete profile (SensePost)
◦ https://github.com/sensepost/ruler
Xrulez – Use local Outlook profiles to import malicious rule for persistence (MRW Labs)
◦ https://github.com/mwrlabs/XRulez
NICK LANDERS / @MONOXGAS / SILENT BREAK SECURITY
Demo!
Pop a shell with E-Mail!
NICK LANDERS / @MONOXGAS / SILENT BREAK SECURITY
NICK LANDERS / @MONOXGAS / SILENT BREAK SECURITY
Case Study #1
Black-Box Penetration Test for an organization
Discovered 0-Day in externally hosted LiveAgent software for support chat
Compromised SQL database and used tokens to login to the web interface
Placed custom HTML on the footer of the logon page to steal user credentials
Password Re-Use to get into an E-Mail account
Outlook attack to pivot into the environment
Lateral movement and privilege escalation to Domain Admin
NICK LANDERS / @MONOXGAS / SILENT BREAK SECURITY
Case Study #2
Black-Box Penetration Test for an organization
Credential brute-forcing to find weak user login
Outlook attack to gain initial access to the network
Security team discovered the compromise, changed user password, wiped workstation
Use previously synced rule with external E-Mail to gain access to the network AGAIN
Lateral movement and privilege escalation to get Domain Admin
Phishing payloads are DEAD! Long live the Outlook Attack!
NICK LANDERS / @MONOXGAS / SILENT BREAK SECURITY
What Now?
Future Research
◦ Abuse mso.dll/Outlook to avoid argument limitations with ShellExecute
◦ Modify ‘Ruler’ by SensePost to include support for MAPI over RPC over HTTP (2007/2010)
◦ Build Pass the Hash support into tooling so NTLM hashes can be used to pivot internally
◦ Use Named Pipes as a file replacement for In-Memory pivoting
◦ Backdoor/Patch mso.dll on disk for Outlook persistence without modifying server-side profile
Defenses:
◦ Disable WebDAV outbound at the firewall
◦ Monitor process creation from Outlook and/or app whitelisting
◦ Monitor Exchange logs for rule sync events from outside of the network?
NICK LANDERS / @MONOXGAS / SILENT BREAK SECURITY
Questions?
Nick Landers - @monoxgas
Silent Break Security
nick@silentbreaksecurity.com
NICK LANDERS / @MONOXGAS / SILENT BREAK SECURITY

Mais conteúdo relacionado

Mais procurados

Fantastic Red Team Attacks and How to Find Them
Fantastic Red Team Attacks and How to Find ThemFantastic Red Team Attacks and How to Find Them
Fantastic Red Team Attacks and How to Find Them
Ross Wolf
 

Mais procurados (20)

A Threat Hunter Himself
A Threat Hunter HimselfA Threat Hunter Himself
A Threat Hunter Himself
 
Fantastic Red Team Attacks and How to Find Them
Fantastic Red Team Attacks and How to Find ThemFantastic Red Team Attacks and How to Find Them
Fantastic Red Team Attacks and How to Find Them
 
PowerShell for Practical Purple Teaming
PowerShell for Practical Purple TeamingPowerShell for Practical Purple Teaming
PowerShell for Practical Purple Teaming
 
mimikatz @ phdays
mimikatz @ phdaysmimikatz @ phdays
mimikatz @ phdays
 
Attacking thru HTTP Host header
Attacking thru HTTP Host headerAttacking thru HTTP Host header
Attacking thru HTTP Host header
 
Level Up! - Practical Windows Privilege Escalation
Level Up! - Practical Windows Privilege EscalationLevel Up! - Practical Windows Privilege Escalation
Level Up! - Practical Windows Privilege Escalation
 
PSConfEU - Offensive Active Directory (With PowerShell!)
PSConfEU - Offensive Active Directory (With PowerShell!)PSConfEU - Offensive Active Directory (With PowerShell!)
PSConfEU - Offensive Active Directory (With PowerShell!)
 
Neat tricks to bypass CSRF-protection
Neat tricks to bypass CSRF-protectionNeat tricks to bypass CSRF-protection
Neat tricks to bypass CSRF-protection
 
Offzone | Another waf bypass
Offzone | Another waf bypassOffzone | Another waf bypass
Offzone | Another waf bypass
 
Introduction to red team operations
Introduction to red team operationsIntroduction to red team operations
Introduction to red team operations
 
Derbycon - The Unintended Risks of Trusting Active Directory
Derbycon - The Unintended Risks of Trusting Active DirectoryDerbycon - The Unintended Risks of Trusting Active Directory
Derbycon - The Unintended Risks of Trusting Active Directory
 
Windows Privilege Escalation
Windows Privilege EscalationWindows Privilege Escalation
Windows Privilege Escalation
 
Kheirkhabarov24052017_phdays7
Kheirkhabarov24052017_phdays7Kheirkhabarov24052017_phdays7
Kheirkhabarov24052017_phdays7
 
Ace Up the Sleeve
Ace Up the SleeveAce Up the Sleeve
Ace Up the Sleeve
 
Red Team Revenge - Attacking Microsoft ATA
Red Team Revenge - Attacking Microsoft ATARed Team Revenge - Attacking Microsoft ATA
Red Team Revenge - Attacking Microsoft ATA
 
DerbyCon 2019 - Kerberoasting Revisited
DerbyCon 2019 - Kerberoasting RevisitedDerbyCon 2019 - Kerberoasting Revisited
DerbyCon 2019 - Kerberoasting Revisited
 
RACE - Minimal Rights and ACE for Active Directory Dominance
RACE - Minimal Rights and ACE for Active Directory DominanceRACE - Minimal Rights and ACE for Active Directory Dominance
RACE - Minimal Rights and ACE for Active Directory Dominance
 
0wn-premises: Bypassing Microsoft Defender for Identity
0wn-premises: Bypassing Microsoft Defender for Identity0wn-premises: Bypassing Microsoft Defender for Identity
0wn-premises: Bypassing Microsoft Defender for Identity
 
Zap vs burp
Zap vs burpZap vs burp
Zap vs burp
 
PowerUp - Automating Windows Privilege Escalation
PowerUp - Automating Windows Privilege EscalationPowerUp - Automating Windows Privilege Escalation
PowerUp - Automating Windows Privilege Escalation
 

Semelhante a Outlook and Exchange for the bad guys

Attack All the Layers - What's Working in Penetration Testing
Attack All the Layers - What's Working in Penetration TestingAttack All the Layers - What's Working in Penetration Testing
Attack All the Layers - What's Working in Penetration Testing
NetSPI
 
Attack All The Layers - What's Working in Penetration Testing
Attack All The Layers - What's Working in Penetration TestingAttack All The Layers - What's Working in Penetration Testing
Attack All The Layers - What's Working in Penetration Testing
NetSPI
 

Semelhante a Outlook and Exchange for the bad guys (20)

OpenStack Security Project
OpenStack Security ProjectOpenStack Security Project
OpenStack Security Project
 
Secure360 - Attack All the Layers! Again!
Secure360 - Attack All the Layers! Again!Secure360 - Attack All the Layers! Again!
Secure360 - Attack All the Layers! Again!
 
Osquery
OsqueryOsquery
Osquery
 
Reading Group Presentation: Web Attacks on Host-Proof Encrypted Storage
Reading Group Presentation: Web Attacks on Host-Proof Encrypted StorageReading Group Presentation: Web Attacks on Host-Proof Encrypted Storage
Reading Group Presentation: Web Attacks on Host-Proof Encrypted Storage
 
Low Hanging Fruit, Making Your Basic MongoDB Installation More Secure
Low Hanging Fruit, Making Your Basic MongoDB Installation More SecureLow Hanging Fruit, Making Your Basic MongoDB Installation More Secure
Low Hanging Fruit, Making Your Basic MongoDB Installation More Secure
 
Linux confau 2019: Web Security 2019
Linux confau 2019: Web Security 2019Linux confau 2019: Web Security 2019
Linux confau 2019: Web Security 2019
 
Attack All the Layers - What's Working in Penetration Testing
Attack All the Layers - What's Working in Penetration TestingAttack All the Layers - What's Working in Penetration Testing
Attack All the Layers - What's Working in Penetration Testing
 
Attack All The Layers - What's Working in Penetration Testing
Attack All The Layers - What's Working in Penetration TestingAttack All The Layers - What's Working in Penetration Testing
Attack All The Layers - What's Working in Penetration Testing
 
Attack All the Layers: What's Working during Pentests (OWASP NYC)
Attack All the Layers: What's Working during Pentests (OWASP NYC)Attack All the Layers: What's Working during Pentests (OWASP NYC)
Attack All the Layers: What's Working during Pentests (OWASP NYC)
 
Database Firewall with Snort
Database Firewall with SnortDatabase Firewall with Snort
Database Firewall with Snort
 
OWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptxOWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptx
 
FreeBSD and Hardening Web Server
FreeBSD and Hardening Web ServerFreeBSD and Hardening Web Server
FreeBSD and Hardening Web Server
 
Securing Your Apache Spark Applications
Securing Your Apache Spark ApplicationsSecuring Your Apache Spark Applications
Securing Your Apache Spark Applications
 
Securing Spark Applications by Kostas Sakellis and Marcelo Vanzin
Securing Spark Applications by Kostas Sakellis and Marcelo VanzinSecuring Spark Applications by Kostas Sakellis and Marcelo Vanzin
Securing Spark Applications by Kostas Sakellis and Marcelo Vanzin
 
Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)
Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)
Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)
 
Pro Tips for Power Users – Palo Alto Networks Live Community and Fuel User Gr...
Pro Tips for Power Users – Palo Alto Networks Live Community and Fuel User Gr...Pro Tips for Power Users – Palo Alto Networks Live Community and Fuel User Gr...
Pro Tips for Power Users – Palo Alto Networks Live Community and Fuel User Gr...
 
Road to Opscon (Pisa '15) - DevOoops
Road to Opscon (Pisa '15) - DevOoopsRoad to Opscon (Pisa '15) - DevOoops
Road to Opscon (Pisa '15) - DevOoops
 
Network Securities.pptx
Network Securities.pptxNetwork Securities.pptx
Network Securities.pptx
 
20190516 web security-basic
20190516 web security-basic20190516 web security-basic
20190516 web security-basic
 
End to end web security
End to end web securityEnd to end web security
End to end web security
 

Último

Último (20)

AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 

Outlook and Exchange for the bad guys

  • 1. Outlook & Exchange for the Bad Guys IT’S ALWAYS FUN BREAKING THE RULES NICK LANDERS / @MONOXGAS / SILENT BREAK SECURITY
  • 2. > getuid Nick Landers (@monoxgas) Security Consultant at Silent Break Security Salt Lake City, Utah, US Hacking for 8 years, 2 professionally My Loves: ◦ Writing Windows malware (slingshot/throwback) ◦ Coding with C++, Python, or PowerShell ◦ Security Research for the Red Side ◦ Long walks on the beach NICK LANDERS / @MONOXGAS / SILENT BREAK SECURITY
  • 3. Tonight’s Agenda 1. Exchange Overview 2. Recon 3. Credential Harvesting 4. Outlook Rules 5. Exploitation Details 6. Demo! 7. Questions NICK LANDERS / @MONOXGAS / SILENT BREAK SECURITY
  • 4. Currently supported versions: 2007, 2010, 2013, 2016 Office 365 / Outlook.com Remote Access Protocols ◦ Exchange Web Services (EWS) – SOAP over HTTP ◦ Outlook Anywhere – RPC over HTTP ◦ MAPI over HTTP (Exchange 2013+) ◦ Exchange ActiveSync (EAS) – HTTP/XML – High latency/Low bandwidth Functions ◦ AutoDiscover – Fast collection of Exchange configurations, supported protocols, and service URLs ◦ Outlook Web App (OWA) – Minimal E-Mail client available via the web – http://mail.org.com/owa ◦ Global Address List (GAL) – LDAP/Active Directory NICK LANDERS / @MONOXGAS / SILENT BREAK SECURITY
  • 5. Recon Goal: Collect E-Mails, usernames, and (maybe) passwords from public resources Sources: ◦ Search engines (Google, Bing, etc.) ◦ Company Websites – DNS brute-forcing to discover subdomains ◦ Public Websites (LinkedIn, GitHub) ◦ Database Dumps (leakedsource, haveibeenpwned) ◦ Active Directory – For lateral movement and segmentation bypassing Tooling: ◦ Discover - https://github.com/leebaird/discover (Lee Baird) ◦ Passive: ARIN, dnsrecon, goofile, goog-mail, goohost, theHarvester, Metasploit, URLCrazy, Whois, multiple websites, and recon-ng ◦ Active: nmap, dnsrecon, Fierce, lbd, WAF00W, traceroute, and Whatweb ◦ FOCA - https://www.elevenpaths.com/labstools/foca/index.html ◦ LinkedIn Scraper - https://github.com/wpentester/Linkedin_profiles (Hans Petrich) ◦ HackerTarget - https://hackertarget.com/ip-tools/ NICK LANDERS / @MONOXGAS / SILENT BREAK SECURITY
  • 6. Collecting Credentials Brute Forcing Techniques ◦ OWA – Black Hills Security Password Spraying w/ Burp - http://www.blackhillsinfosec.com/?p=4694 ◦ EWS – ShellIntel PowerShell Toolkit - https://github.com/Shellntel/OWA-Toolkit ◦ NTLM HTTP Auth – Python Requests - https://github.com/requests/requests-ntlm ◦ Use a targeted E-Mail list with common passwords – Summer2016, Password1, etc. NICK LANDERS / @MONOXGAS / SILENT BREAK SECURITY
  • 7. Collecting Credentials pt. 2 Credential Harvesting Attacks via E-Mail ◦ Impersonate target company logon page (OWA, Office 365, etc.) ◦ No payload to burn + Blend with the spam ◦ = Attacks can be scaled up (5-10 vs 100-200 targets) External Site Compromise (WordPress, LiveAgent, etc.) ◦ No longer useless for gaining internet network access! ◦ Credential re-use is VERY common ◦ Backdoor logon pages with JavaScript to steal credentials ◦ Grab passwords from databases ◦ Social Engineering NICK LANDERS / @MONOXGAS / SILENT BREAK SECURITY
  • 8. Outlook Rules Overview “A rule is an action that Outlook for Windows runs automatically on incoming or outgoing messages. You choose what triggers the rule as well as the actions the rule takes.” – Microsoft Rules can be created: ◦ Server side (OWA, Outlook.com) ◦ Client side (Outlook) ◦ Often not compatible due to subtle differences in the usage of rule properties Rule action order: ◦ Server side actions (move mail to folder) ◦ Client side actions (print a message) Rules are stored with the exchange server. Any new Outlook instance receives all existing rules When a client side action is needed, deferred action message (DAM) is sent to client w/ rule ID NICK LANDERS / @MONOXGAS / SILENT BREAK SECURITY
  • 9. Rule Actions That looks promising! NICK LANDERS / @MONOXGAS / SILENT BREAK SECURITY
  • 10. Peeking Inside NICK LANDERS / @MONOXGAS / SILENT BREAK SECURITY
  • 11. A Deeper Look NICK LANDERS / @MONOXGAS / SILENT BREAK SECURITY
  • 12. ShellExecuteEx lpVerb – “The set of available verbs depends on the particular file or folder. Generally, the actions available from an object's shortcut menu are available verbs. This parameter can be NULL, in which case the default verb is used if available. If not, the "open" verb is used.” ◦ Can be viewed/modified in HKEY_CLASSES_ROOT lpFile – “The address of a null-terminated string that specifies the name of the file or object on which ShellExecuteEx will perform the action specified by the lpVerb parameter. ” lpParameters – “Optional. The address of a null-terminated string that contains the application parameters. ” NICK LANDERS / @MONOXGAS / SILENT BREAK SECURITY
  • 13. Exploitation Challenges Requires valid account credentials along with Exchange service access ◦ Recon & Brute Forcing ◦ RPC/MAPI over HTTP No command line arguments Need a local file on disk for Outlook to open – UNC to the rescue! (ServerShareevil.exe) ◦ Local SMB share (Kali Linux, existing windows share) – Internal pentesting/pivoting/persistence ◦ WebDAV share – Accessible via UNC path – HTTP with proxy awareness A file type which can give us code execution with ShellExecute ◦ BAT, EXE, PIF, VBS, JS, HTA, LNK, etc. Target needs Outlook open to receive the DAM and execute the attack NICK LANDERS / @MONOXGAS / SILENT BREAK SECURITY
  • 14. Use Cases Initial Access to a target network ◦ Relatively easy to collect E-Mail credentials externally Pivot to workstation without local admin privileges Bypass network segmentation Persistence: ◦ Stealthy – Obscure technique with minimal tooling available for detection/monitoring ◦ Long-Term – Linked to E-Mail profile, not workstation. Persistence across a DFIR wipe ◦ Drop a executable onto an internal file share ◦ Load rule into many E-Mail accounts, trigger with one E-Mail NICK LANDERS / @MONOXGAS / SILENT BREAK SECURITY
  • 15. State of things Rulz.py – Build malicious RWZ files for importing into Outlook (monoxgas) ◦ https://gist.github.com/monoxgas/7fec9ec0f3ab405773fc Ruler – MAPI over HTTP to quickly sync rule file without building complete profile (SensePost) ◦ https://github.com/sensepost/ruler Xrulez – Use local Outlook profiles to import malicious rule for persistence (MRW Labs) ◦ https://github.com/mwrlabs/XRulez NICK LANDERS / @MONOXGAS / SILENT BREAK SECURITY
  • 16. Demo! Pop a shell with E-Mail! NICK LANDERS / @MONOXGAS / SILENT BREAK SECURITY
  • 17. NICK LANDERS / @MONOXGAS / SILENT BREAK SECURITY
  • 18. Case Study #1 Black-Box Penetration Test for an organization Discovered 0-Day in externally hosted LiveAgent software for support chat Compromised SQL database and used tokens to login to the web interface Placed custom HTML on the footer of the logon page to steal user credentials Password Re-Use to get into an E-Mail account Outlook attack to pivot into the environment Lateral movement and privilege escalation to Domain Admin NICK LANDERS / @MONOXGAS / SILENT BREAK SECURITY
  • 19. Case Study #2 Black-Box Penetration Test for an organization Credential brute-forcing to find weak user login Outlook attack to gain initial access to the network Security team discovered the compromise, changed user password, wiped workstation Use previously synced rule with external E-Mail to gain access to the network AGAIN Lateral movement and privilege escalation to get Domain Admin Phishing payloads are DEAD! Long live the Outlook Attack! NICK LANDERS / @MONOXGAS / SILENT BREAK SECURITY
  • 20. What Now? Future Research ◦ Abuse mso.dll/Outlook to avoid argument limitations with ShellExecute ◦ Modify ‘Ruler’ by SensePost to include support for MAPI over RPC over HTTP (2007/2010) ◦ Build Pass the Hash support into tooling so NTLM hashes can be used to pivot internally ◦ Use Named Pipes as a file replacement for In-Memory pivoting ◦ Backdoor/Patch mso.dll on disk for Outlook persistence without modifying server-side profile Defenses: ◦ Disable WebDAV outbound at the firewall ◦ Monitor process creation from Outlook and/or app whitelisting ◦ Monitor Exchange logs for rule sync events from outside of the network? NICK LANDERS / @MONOXGAS / SILENT BREAK SECURITY
  • 21. Questions? Nick Landers - @monoxgas Silent Break Security nick@silentbreaksecurity.com NICK LANDERS / @MONOXGAS / SILENT BREAK SECURITY