Webinar 1540 Slides
Webinar 1540 Slides
Webinar 1540 Slides
Sponsored by
Anatomy of a Hack: How
TEMP.Mixmaster Attackers
Use TrickBot and RyukTo
Poach Big Game
Made possible by
Thanks to
1
3/19/2019
PAGE 3
Anatomy of an Attack
Ryuk & Trickbot
Webinar
March 19, 2019
Copyright © 2019 STEALTHbits Technologies, Inc. All rights reserved. | STEALTHbits Confidential
Agenda
PAGE 4
• Introductions
• The Evolution of Ransomware
• Breakdown of Ryuk & Trickbot
• Live Demo of PowerShell Empire
• Mitigation & Detection
• Live Demo of Mitigation & Detection
• Q&A
• Next Steps
Copyright © 2019 STEALTHbits Technologies, Inc. All rights reserved. | STEALTHbits Confidential
2
3/19/2019
PAGE 5
Jeff Warren
General Manager, Products
STEALTHbits Technologies
Copyright © 2019 STEALTHbits Technologies, Inc. All rights reserved. | STEALTHbits Confidential
PAGE 6
Evolution of
Ransomware
Copyright © 2019 STEALTHbits Technologies, Inc. All rights reserved. | STEALTHbits Confidential
3
3/19/2019
Evolution of Ransomware
PAGE 7
Petya/NotPetya
AIDS Trojan Virus CryptoLocker EternalBlue
WannaCry
SamSam Ryuk
Copyright © 2019 STEALTHbits Technologies, Inc. All rights reserved. | STEALTHbits Confidential
Lateral PAGE 8
Targeted Recon Exploits Dwell Time
Movement
Copyright © 2019 STEALTHbits Technologies, Inc. All rights reserved. | STEALTHbits Confidential
4
3/19/2019
PAGE 9
Trickbot & Ryuk
Copyright © 2019 STEALTHbits Technologies, Inc. All rights reserved. | STEALTHbits Confidential
PAGE 10
Overview of Trickbot & Ryuk
$4M
• Ryuk ransomware encrypts data
days/weeks/months later
• Source code derived from commodity
ransomware Hermes
• Attributed to threat actors out of
Russia GRIM SPIDER
Extorted from enterprises between
August and December of 2018
Copyright © 2019 STEALTHbits Technologies, Inc. All rights reserved. | STEALTHbits Confidential
5
3/19/2019
PAGE 11
Initial Infection with Trickbot
Source: FireEye
Copyright © 2019 STEALTHbits Technologies, Inc. All rights reserved. | STEALTHbits Confidential
PAGE 12
Trickbot’sBag of Tricks
Tasks Module
•systeminfo – computer specs (operating system,
Gather information from the infected architecture, processor)
user’s system •networkdll – gathers machine data (username, domain
name, etc.)
•wormdll – SMB exploit (MS17-010)
Infect more machines within the system •sharedll – drops copies in administrative shares C$ or
ADMIN$
•tabdll
•injectdll
Steal credentials and intercept •importdll
connections to certain banking sites •mailsearcher
•pwgrab
•NewBCtestnDll64
PowerShell Empire module for reverse
shell
Source: TrendMicro
Copyright © 2019 STEALTHbits Technologies, Inc. All rights reserved. | STEALTHbits Confidential
6
3/19/2019
PAGE 13
Recon & Lateral Movement
Copyright © 2019 STEALTHbits Technologies, Inc. All rights reserved. | STEALTHbits Confidential
PAGE 14
Spreading Laterally with Trickbot
Trickbot
NewBCtestnDll64 sharedll admin$ and
Mimikatz credential theft c$
Copyright © 2019 STEALTHbits Technologies, Inc. All rights reserved. | STEALTHbits Confidential
7
3/19/2019
PAGE 15
Dropping Ryuk
Source: CrowdStrike
Copyright © 2019 STEALTHbits Technologies, Inc. All rights reserved. | STEALTHbits Confidential
PAGE 16
Real World Example – Ryuk (Q3 2018)
• Using stolen credentials the attacker copied AdFind.exe onto a domain controller
• AdFind.exe was executed (twice) to collect information about Active Directory
• Attacker tested access to multiple domain controllers in the victim environment
• The attacker logged into a DC and copied PSExec.exe, a batch script used to kill
processes and stop services, and an instance of Ryuk onto the system.
• Using PsExec the attacker copied the process/service killing batch script to the
%TEMP% folder on hundreds of computers across the victim environment, from which
it was then executed.
• The attacker then used PsExec to copy the Ryuk binary to the %SystemRoot%
directories of these same computers. A new service configured to launch the Ryuk
binary was then created and started.
• Ryuk execution proceeded as normal, encrypting files on impacted systems.
Source: FireEye
Copyright © 2019 STEALTHbits Technologies, Inc. All rights reserved. | STEALTHbits Confidential
8
3/19/2019
PAGE 17
Overview of the Attack
1. An obfuscated PowerShell script is executed and connects to a remote IP address.
2. A reverse shell is downloaded and executed on the compromised host.
3. PowerShell anti-logging scripts are executed on the host.
4. Reconnaissance of the network is conducted using standard Windows command line tools
along with external uploaded tools.
5. Lateral movement throughout the network is enabled using Remote Desktop Protocol
(RDP).
6. Service User Accounts are created.
7. PowerShell Empire is downloaded and installed as a service.
8. Lateral movement is continued until privileges are recovered to obtain access to a domain
controller.
9. PSEXEC is used to push out the Ryuk binary to individual hosts.
10. Batch scripts are executed to terminate processes/services and remove backups, followed
by the Ryuk binary.
Source: CrowdStrike®
Copyright © 2019 STEALTHbits Technologies, Inc. All rights reserved. | STEALTHbits Confidential
PAGE 18
LIVE DEMO
PowerShell Empire
Copyright © 2019 STEALTHbits Technologies, Inc. All rights reserved. | STEALTHbits Confidential
9
3/19/2019
PAGE 19
PowerShell Empire – Demo Overview
Weak PC
Hardened PC
Perform Compromise Compromise SQL
Infect PC
Reconnaissance Accounts Server (MS SQL)
Copyright © 2019 STEALTHbits Technologies, Inc. All rights reserved. | STEALTHbits Confidential
PAGE 20
Mitigating the
Attack
Copyright © 2019 STEALTHbits Technologies, Inc. All rights reserved. | STEALTHbits Confidential
10
3/19/2019
PAGE 21
How Does TrickbotSpread?
>
Step 1 Step 2 Step 3 Step 4
Source: CrowdStrike
Copyright © 2019 STEALTHbits Technologies, Inc. All rights reserved. | STEALTHbits Confidential
PAGE 22
Mitigation of MS17-010 Vulnerability
https://support.microsoft.com/en-us/help/2696547/how-to-detect-enable-and-disable-smbv1-smbv2-and-smbv3-
in-windows-and
Copyright © 2019 STEALTHbits Technologies, Inc. All rights reserved. | STEALTHbits Confidential
11
3/19/2019
PAGE 23
PowerShell Security – Constrained Language Mode
Copyright © 2019 STEALTHbits Technologies, Inc. All rights reserved. | STEALTHbits Confidential
PAGE 24
Empire Launcher with Constrained Language Mode
Copyright © 2019 STEALTHbits Technologies, Inc. All rights reserved. | STEALTHbits Confidential
12
3/19/2019
PAGE 25
Constrained Language Mode Bypass
Patch: https://portal.msrc.microsoft.com/en-us/security-guidance/advisory/CVE-2019-0632
Copyright © 2019 STEALTHbits Technologies, Inc. All rights reserved. | STEALTHbits Confidential
PAGE 26
AppLocker
• When running with Allow actions, this will enforce Constrained Language
Mode
• Can be bypassed by stopping the AppID service
Copyright © 2019 STEALTHbits Technologies, Inc. All rights reserved. | STEALTHbits Confidential
13
3/19/2019
PAGE 27
Preventing PowerShell Downgrade Attacks
Copyright © 2019 STEALTHbits Technologies, Inc. All rights reserved. | STEALTHbits Confidential
PAGE 28
Restrict Admin Rights
“Ryuk does not encrypt files from
within its own process memory
• Administrators and privileged local
groups space, but injects into a remote
• Admin-equivalences such as
process. Before injecting into a
– Act as part of the OS
remote process, Ryuk attempts to
(SeTcbPrivilege) adjust its token privileges to have
– Debug programs (SeDebugPrivileg) the SeDebugPrivilege. It takes
– Take Ownership no action if the adjustment of the
(SeTakeOwnershipPrivilege) token privileges fails.”
CrowdStrike
Copyright © 2019 STEALTHbits Technologies, Inc. All rights reserved. | STEALTHbits Confidential
14
3/19/2019
PAGE 29
Detecting the
Attack
Copyright © 2019 STEALTHbits Technologies, Inc. All rights reserved. | STEALTHbits Confidential
PAGE 30
PowerShell Script Block Logging
Copyright © 2019 STEALTHbits Technologies, Inc. All rights reserved. | STEALTHbits Confidential
15
3/19/2019
PAGE 31
PowerShell Script Block Logging
Copyright © 2019 STEALTHbits Technologies, Inc. All rights reserved. | STEALTHbits Confidential
PAGE 32
PowerShell Script Block Logging
Copyright © 2019 STEALTHbits Technologies, Inc. All rights reserved. | STEALTHbits Confidential
16
3/19/2019
PAGE 33
PowerShell Script Block Logging
• Even if command opens a web cradle to pull down code, it will show the results
Copyright © 2019 STEALTHbits Technologies, Inc. All rights reserved. | STEALTHbits Confidential
PAGE 34
Enabling PowerShell Script Block Logging
Copyright © 2019 STEALTHbits Technologies, Inc. All rights reserved. | STEALTHbits Confidential
17
3/19/2019
PAGE 35
Additional Detections to Consider
Copyright © 2019 STEALTHbits Technologies, Inc. All rights reserved. | STEALTHbits Confidential
PAGE 36
LIVE DEMO
Attack Detection &
Mitigation
Copyright © 2019 STEALTHbits Technologies, Inc. All rights reserved. | STEALTHbits Confidential
18
3/19/2019
PAGE 37
STEALTHbits’ Active Directory Solution Architecture
Active Directory Azure Active Directory AD-Connected Resources
Applications
Resources
Systems
Authentication Objects GPOs Permissions
Data
LDAP Attributes Replication Configurations
Unstructured Data
Approach Differential Agent-less Least Privilege LSASS Agent Blocking
Cloud Data
Reporting & Governance Rollback & Recovery Threat Detection & Response
Platform
Services
Clean Up & Remediation Alerting Blocking
Structured Data
Integration REST API SQL Syslog …
Points
…
Copyright © 2019 STEALTHbits Technologies, Inc. All rights reserved. | STEALTHbits Confidential
PAGE 38
STEALTHbits’ Active Directory Solution
Security Threats
Identify and eliminate weak passwords Detect modern threats against AD in real-time
Prevent unauthorized changes and authentication Identify abnormal behavior (UBA)
Identify and remediate configuration and Automatically respond to threats and abnormalities
permission vulnerabilities for instant containment
Operations Compliance
Automate account deprovisioning Govern group memberships
Clean-up stale and toxic objects Automate privileged access reporting
Rollback and recover from changes and deletions Control access to sensitive security groups and data
Copyright © 2019 STEALTHbits Technologies, Inc. All rights reserved. | STEALTHbits Confidential
19
3/19/2019
PAGE 39
STEALTHbits’ Active Directory Product Portfolio
Copyright © 2019 STEALTHbits Technologies, Inc. All rights reserved. | STEALTHbits Confidential
PAGE 40
Modern AD Attacks
Copyright © 2019 STEALTHbits Technologies, Inc. All rights reserved. | STEALTHbits Confidential
20
3/19/2019
PAGE 41
Next Steps
• Learn More
– https://attack.stealthbits.com
• Download a Trial
– Visit https://www.stealthbits.com/free-trial
• Contact Us
– Visit https://www.stealthbits.com/contact
Copyright © 2019 STEALTHbits Technologies, Inc. All rights reserved. | STEALTHbits Confidential
PAGE 42
©STEALTHbits Technologies, Inc. All rights reserved. STEALTHbits and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.
The information herein is for informational purposes only and represents the current view of STEALTHbits Technologies as of the date of this presentation. Because STEALTHbits must respond to changing market conditions, it should not be
interpreted to be a commitment on the part of STEALTHbits, and STEALTHbits cannot guarantee the accuracy of any information provided after the date of this presentation. STEALTHBITS MAKES NO WARRANTIES, EXPRESS, IMPLIED OR
STATUATORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Copyright © 2019 STEALTHbits Technologies, Inc. All rights reserved. | STEALTHbits Confidential
21