SlideShare une entreprise Scribd logo
1  sur  53
Bridging the Gap
Lessons in Adversarial
Tradecraft
Will Schroeder, Matt Nelson
Veris Group’s Adaptive Threat Division
@harmj0y
◦ Security researcher and red teamer for
the Adaptive Threat Division of Veris
Group
◦ Co-founder/active developer of Empire,
PowerTools, and the Veil-Framework
◦ Cons: Shmoocon, Defcon, Derbycon,
various BSides
@enigma0x3
◦ Penetration tester and red teamer for
the Adaptive Threat Division of Veris
Group
◦ Developer on the Empire Project
◦ Offensive PowerShell Advocate
◦ First time presenting at a con!
tl;dr
◦ Setting the stage
▫ Red team philosophy
▫ Bridging the Gap
◦ Push it, Push it Real Good
▫ #1 - Weak Standard Images
▫ #2 - Network/User Hygiene
▫ #3 - Domain Trusts
◦ Empire
▫ Offensive PowerShell and Rats 101
▫ Modules
Invoke-
TrollSploit
Setting the Stage
Pentesting, Red Teaming, and the
“Assume Breach” Mentality
0
Penetration Testing
◦ Definition ranges anywhere from a single
person running a (slightly)-glorified vuln scan,
to a full on multi-person assault for several
weeks
◦ Reasonable Balance: breadth vs. depth, find
as many holes as you can and see how far
you can get in a limited timeframe
◦ Generally focused on finding issues and not
about training/exercising processes
Red Teaming
◦ Red teaming means different things to
different people
▫ physical ops
▫ in-depth social engineering
▫ custom exploit dev
▫ pure network based operations
▫ adversary emulation
▫ etc.
◦ Common thread of increased time
frame, more permissive scope
“Assume Breach” Mentality
◦ With the rash of recent major incidents,
organizations have started to realize
that they’re probably already owned
◦ You’re not going to stop the bad
guys from getting in the front door
◦ Companies need to implement an
“assume breach” way of thinking
Bridging the Gap
◦ Red Teaming historically:
▫ specialized toolsets, expanded timeframe,
large team size, lots of $$$
◦ Our approach has been to build tools
that automate a lot of this previously
specialized tradecraft
▫ PowerShell plays a big role here
◦ We also try to distribute a
knowledgebase of these tactics
Why PowerShell?
◦ “Microsoft’s post-exploitation
language” - @obscuresec
◦ PowerShell provides (out of the box):
▫ Full .NET access
▫ application whitelist bypassing
▫ direct access to the Win32 API
▫ ability to assemble malicious binaries in
memory
▫ default installation Win7+ !
Just a “Toy Language”?
The Weaponization
Problem
◦ There’s been an sharp increase in
offensive PowerShell projects over the past
year
◦ But many people still struggle with how to
securely work PowerShell into
engagements
◦ Using existing tech at this point hasn’t
always been the most straightforward
Weak Standard Images
Spreading vulnerabilities by design...
1
Standard Images
◦ Organizations typically utilize some
standard image per internal business
unit or across the entire enterprise
▫ Frequently contracted to 3rd parties
◦ Security of this image is paramount
◦ Exploitation of this image gets us
beyond the beachhead
▫ Enables further lateral spread
Windows Services
◦ One of the most effective escalation
vectors was (and still is) vulnerable
Windows services
◦ Many organizations overlook the
permissions for service binaries :)
▫ Overwrite the service binary to add a local user
or install an agent
▫ Do have to reboot :(
.DLL Hijacking
◦ Many programs/services will search in
multiple locations when loading,
including directories listed in the
%PATH% environment variable
◦ If you have write access to any folder in
%PATH%, there’s a good chance you
can drop a malicious DLL and escalate
privileges on Windows 7
Standard Image Analysis
◦ PowerUp - PowerShell tool to automate
common Windows privilege escalation
vectors
▫ Part of PowerTools
▫ Invoke-AllChecks will run all current checks
against a host
◦ We also manually inspect each standard
image in depth to discover enterprise “0-
days”
Custom Internal
Development
Is the most common root cause of
escalation vectors we find.
Network/User Hygiene
It’s just not hard to find targets...
2
Dirty Networks
◦ This is a major catch all issue…
▫ Network Hygiene - Random default services
existing with little knowledge by IT staff (ie.
Tomcat, Cold Fusion, etc)
▫ User Hygiene - Lots of old users, admin users,
overly delegated groups, and long running
interactive logons
◦ One of the first steps in a network is to
identify how ‘dirty’ it is
Hunt -> pop box -> Mimikatz -> profit
Invoke-UserHunter
◦ PowerView function that:
▫ queries AD for hosts or takes a target list
▫ queries AD for users of a target group, or takes
a list/single user
▫ uses Win32 API calls to enumerate sessions
and logged in users, matching against the
target user list
◦ You don’t need administrative privileges
to get a ton of information!
Invoke-UserHunter -Stealth
◦ Uses an old red teaming trick
1. Queries AD for all users and extracts all
homeDirectory/scriptPath/profilePath fields
to identify likely domain file servers
2. Runs Get-NetSession against each file server
to enumerate remote sessions, matching
against target user list
◦ Gets reasonable coverage with a lot
less traffic
▫ also doesn’t need admin privileges
Most
Organizations
Have terrible privileged account hygiene in
their networks.
This makes our job much easier.
Domain Trusts
Or: Why You Shouldn’t Trust AD
3
AD Domain Trusts 101
◦ Trusts allow separate domains to form
inter-connected relationships
◦ A trust just links up the authentication
systems of two domains and allows
authentication traffic to flow between
them
◦ A trust allows for the possibility of
privileged access between domains, but
doesn’t guarantee it*
So What?
◦ Why does this matter?
◦ Red teams often compromise
accounts/machines in a domain trusted
by their actual target
▫ This allows operators to exploit these existing
trust relationships to achieve their end goal
◦ More information:
▫ http://www.harmj0y.net/blog/tag/domain-trusts/
PowerView
◦ Domain/forest trust relationships can be
enumerated through several PowerView
functions:
▫ Get-NetForest, Get-NetForestTrust, Get-
NetForestDomain, Get-NetDomainTrust
◦ If a trust exists, most functions in
PowerView can accept a “-Domain
<name>” flag to operate across a trust:
▫ Get-NetUser, Get-NetGroup, Get-
NetDomainController, etc.
Mapping the Mesh
◦ If an organization has a large number of
trusts, we use Invoke-
MapDomainTrust to recursively map all
reachable trusts from our foothold
◦ @sixdub’s DomainTrustExplorer tool
can perform nodal analysis of trust data
▫ It can also generate GraphML output of the
entire mesh, which yED can use to build
visualizations
We Often
Understand
An organization’s domain trust mesh better
than they do by the end of an engagement.
The Mimikatz Trustpocalypse
◦ Mimikatz Golden Tickets now accept
SidHistories
▫ though the new /sids:<X> argument
▫ thanks @gentilkiwi and @PyroTek3 !
◦ If you compromise a DC in a child domain,
you can create a golden ticket with
“Enterprise Admins” in the sid history
◦ This can let you compromise the parent
domain
The Mimikatz Trustpocalypse
If you compromise any
DA credentials
anywhere in a forest,
you can compromise
the entire forest!
Empire
A Pure PowerShell Post-
Exploitation Agent
First Things First
◦ This tool would not be possible if it wasn’t
for the help and phenomenal work from
these people:
▫ @mattifestation, @obscuresec, @josephbialek
https://github.com/mattifestation/PowerSploit/
▫ @tifkin_
https://github.com/leechristensen/
▫ @carlos_perez, @ben0xa, @mwjcomputing,
@pyrotek3, @subtee, and the rest of the
offensive PowerShell community!
Empire?
◦ Empire is a full-featured PowerShell
post-exploitation agent
◦ Aims to provide a rapidly extensible
platform to integrate offensive/defensive
PowerShell work
◦ An attempt to train defenders on how to
stop and respond to PowerShell
“attacks”
Methods of Execution
◦ Small “stager” that can be manually
executed or easily implemented
elsewhere
▫ A PowerShell command block can load an
Empire agent
▫ Lots of formats (.bat, .vbs, .dll, etc.)
◦ Listeners are the server side of the whole
system
▫ Configuration of the agent set here
Empire Staging
◦ Currently have the following categories for
modules:
▫ code_execution - ways to run more code
▫ collection - post exploitation data collection
▫ credentials - collect and use creds
▫ lateral_movement - move around the network
▫ management - host management and auxiliary
▫ persistence - survive the reboot
▫ privesc - escalation capabilities
▫ situational_awareness - network awareness
▫ trollsploit - for the lulz
Module Categories
Module Development
◦ Development is extremely fast due to
the wealth of existing PowerShell tech
and the ease of development in a
scripting language
◦ Modules are essentially metadata
containers for an embedded PowerShell
script
▫ Things like option sets, needs admin, opsec
safe, save file output, etc
management/psinject
◦ First up: our auto-magic process
injection module for Empire
▫ Takes a listener name and an optional process
name/ID
◦ Uses Invoke-PSInjector to inject our
ReflectivePick .DLL into the host or
specified process
▫ Based on @tifkin_‘s UnmanagedPowerShell
▫ The launcher code to stage the agent is
embedded in the .DLL
ReflectivePick
PowerShell in LSASS? LOL
Invoke-Mimikatz
◦ Everyone's favorite post-exploitation
capability (thanks @gentilkiwi !)
▫ We use PowerSploit’s Invoke-Mimikatz
function built by @josephbialek
◦ Not just dumping creds:
▫ Golden tickets, Silver tickets
▫ PTH, Skeleton key
▫ And more!
◦ Empire has Internal credential model
▫ Lets you easily reuse creds you’ve stolen
Demo
Questions?
◦ Will
▫ @harmj0y | blog.harmj0y.net | will [at]
harmj0y.net
◦ Matt
▫ @enigma0x3 | enigma0x3.wordpress.com |
MNelson [at] verisgroup.com
◦ Empire | PowerTools
▫ github.com/PowerShellEmpire/Empire |
github.com/PowerShellEmpire/PowerTools
▫ www.PowerShellEmpire.com

Contenu connexe

Tendances

Tendances (20)

Building an EmPyre with Python
Building an EmPyre with PythonBuilding an EmPyre with Python
Building an EmPyre with Python
 
I Have the Power(View)
I Have the Power(View)I Have the Power(View)
I Have the Power(View)
 
SpecterOps Webinar Week - Kerberoasting Revisisted
SpecterOps Webinar Week - Kerberoasting RevisistedSpecterOps Webinar Week - Kerberoasting Revisisted
SpecterOps Webinar Week - Kerberoasting Revisisted
 
I Hunt Sys Admins
I Hunt Sys AdminsI Hunt Sys Admins
I Hunt Sys Admins
 
I hunt sys admins 2.0
I hunt sys admins 2.0I hunt sys admins 2.0
I hunt sys admins 2.0
 
Defending Your "Gold"
Defending Your "Gold"Defending Your "Gold"
Defending Your "Gold"
 
Here Be Dragons: The Unexplored Land of Active Directory ACLs
Here Be Dragons: The Unexplored Land of Active Directory ACLsHere Be Dragons: The Unexplored Land of Active Directory ACLs
Here Be Dragons: The Unexplored Land of Active Directory ACLs
 
RAT - Repurposing Adversarial Tradecraft
RAT - Repurposing Adversarial TradecraftRAT - Repurposing Adversarial Tradecraft
RAT - Repurposing Adversarial Tradecraft
 
Adventures in Asymmetric Warfare
Adventures in Asymmetric WarfareAdventures in Asymmetric Warfare
Adventures in Asymmetric Warfare
 
BlueHat 2014 - The Attacker's View of Windows Authentication and Post Exploit...
BlueHat 2014 - The Attacker's View of Windows Authentication and Post Exploit...BlueHat 2014 - The Attacker's View of Windows Authentication and Post Exploit...
BlueHat 2014 - The Attacker's View of Windows Authentication and Post Exploit...
 
Six Degrees of Domain Admin - BloodHound at DEF CON 24
Six Degrees of Domain Admin - BloodHound at DEF CON 24Six Degrees of Domain Admin - BloodHound at DEF CON 24
Six Degrees of Domain Admin - BloodHound at DEF CON 24
 
The Unintended Risks of Trusting Active Directory
The Unintended Risks of Trusting Active DirectoryThe Unintended Risks of Trusting Active Directory
The Unintended Risks of Trusting Active Directory
 
PSConfEU - Building an Empire with PowerShell
PSConfEU - Building an Empire with PowerShellPSConfEU - Building an Empire with PowerShell
PSConfEU - Building an Empire with PowerShell
 
Client side attacks using PowerShell
Client side attacks using PowerShellClient side attacks using PowerShell
Client side attacks using PowerShell
 
Trusts You Might Have Missed - 44con
Trusts You Might Have Missed - 44conTrusts You Might Have Missed - 44con
Trusts You Might Have Missed - 44con
 
PowerShell for Cyber Warriors - Bsides Knoxville 2016
PowerShell for Cyber Warriors - Bsides Knoxville 2016PowerShell for Cyber Warriors - Bsides Knoxville 2016
PowerShell for Cyber Warriors - Bsides Knoxville 2016
 
Catch Me If You Can: PowerShell Red vs Blue
Catch Me If You Can: PowerShell Red vs BlueCatch Me If You Can: PowerShell Red vs Blue
Catch Me If You Can: PowerShell Red vs Blue
 
An ACE in the Hole - Stealthy Host Persistence via Security Descriptors
An ACE in the Hole - Stealthy Host Persistence via Security DescriptorsAn ACE in the Hole - Stealthy Host Persistence via Security Descriptors
An ACE in the Hole - Stealthy Host Persistence via Security Descriptors
 
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
 
BloodHound: Attack Graphs Practically Applied to Active Directory
BloodHound: Attack Graphs Practically Applied to Active DirectoryBloodHound: Attack Graphs Practically Applied to Active Directory
BloodHound: Attack Graphs Practically Applied to Active Directory
 

En vedette

Scénarios d'exploitation Metasploit - FR : Scénario 3
Scénarios d'exploitation Metasploit - FR : Scénario 3Scénarios d'exploitation Metasploit - FR : Scénario 3
Scénarios d'exploitation Metasploit - FR : Scénario 3
Eric Romang
 

En vedette (14)

PowerUp - Automating Windows Privilege Escalation
PowerUp - Automating Windows Privilege EscalationPowerUp - Automating Windows Privilege Escalation
PowerUp - Automating Windows Privilege Escalation
 
A Year in the Empire
A Year in the EmpireA Year in the Empire
A Year in the Empire
 
Pwnstaller
PwnstallerPwnstaller
Pwnstaller
 
Wielding a cortana
Wielding a cortanaWielding a cortana
Wielding a cortana
 
AMSI: How Windows 10 Plans to Stop Script-Based Attacks and How Well It Does It
AMSI: How Windows 10 Plans to Stop Script-Based Attacks and How Well It Does ItAMSI: How Windows 10 Plans to Stop Script-Based Attacks and How Well It Does It
AMSI: How Windows 10 Plans to Stop Script-Based Attacks and How Well It Does It
 
PowerShell for Penetration Testers
PowerShell for Penetration TestersPowerShell for Penetration Testers
PowerShell for Penetration Testers
 
PowerShell Technical Overview
PowerShell Technical OverviewPowerShell Technical Overview
PowerShell Technical Overview
 
Powerpreter: Post Exploitation like a Boss
Powerpreter: Post Exploitation like a BossPowerpreter: Post Exploitation like a Boss
Powerpreter: Post Exploitation like a Boss
 
Scénarios d'exploitation Metasploit - FR : Scénario 1
Scénarios d'exploitation Metasploit - FR : Scénario 1Scénarios d'exploitation Metasploit - FR : Scénario 1
Scénarios d'exploitation Metasploit - FR : Scénario 1
 
Up is Down, Black is White: Using SCCM for Wrong and Right
Up is Down, Black is White: Using SCCM for Wrong and RightUp is Down, Black is White: Using SCCM for Wrong and Right
Up is Down, Black is White: Using SCCM for Wrong and Right
 
Introduction To Windows Power Shell
Introduction To Windows Power ShellIntroduction To Windows Power Shell
Introduction To Windows Power Shell
 
Fundamentals of Linux Privilege Escalation
Fundamentals of Linux Privilege EscalationFundamentals of Linux Privilege Escalation
Fundamentals of Linux Privilege Escalation
 
ColdFusion for Penetration Testers
ColdFusion for Penetration TestersColdFusion for Penetration Testers
ColdFusion for Penetration Testers
 
Scénarios d'exploitation Metasploit - FR : Scénario 3
Scénarios d'exploitation Metasploit - FR : Scénario 3Scénarios d'exploitation Metasploit - FR : Scénario 3
Scénarios d'exploitation Metasploit - FR : Scénario 3
 

Similaire à Bridging the Gap

Creating Havoc using Human Interface Device
Creating Havoc using Human Interface DeviceCreating Havoc using Human Interface Device
Creating Havoc using Human Interface Device
Positive Hack Days
 
Finalppt metasploit
Finalppt metasploitFinalppt metasploit
Finalppt metasploit
devilback
 

Similaire à Bridging the Gap (20)

Bridging the Gap: Lessons in Adversarial Tradecraft
Bridging the Gap: Lessons in Adversarial TradecraftBridging the Gap: Lessons in Adversarial Tradecraft
Bridging the Gap: Lessons in Adversarial Tradecraft
 
Go Hack Yourself - 10 Pen Test Tactics for Blue Teamers
Go Hack Yourself - 10 Pen Test Tactics for Blue TeamersGo Hack Yourself - 10 Pen Test Tactics for Blue Teamers
Go Hack Yourself - 10 Pen Test Tactics for Blue Teamers
 
XP Days 2019: First secret delivery for modern cloud-native applications
XP Days 2019: First secret delivery for modern cloud-native applicationsXP Days 2019: First secret delivery for modern cloud-native applications
XP Days 2019: First secret delivery for modern cloud-native applications
 
For Business's Sake, Let's focus on AppSec
For Business's Sake, Let's focus on AppSecFor Business's Sake, Let's focus on AppSec
For Business's Sake, Let's focus on AppSec
 
The State of the Veil Framework
The State of the Veil FrameworkThe State of the Veil Framework
The State of the Veil Framework
 
Platform Security IRL: Busting Buzzwords & Building Better
Platform Security IRL:  Busting Buzzwords & Building BetterPlatform Security IRL:  Busting Buzzwords & Building Better
Platform Security IRL: Busting Buzzwords & Building Better
 
So you want to be a security expert
So you want to be a security expertSo you want to be a security expert
So you want to be a security expert
 
Q Con New York 2015 Presentation - Conjur
Q Con New York 2015 Presentation - ConjurQ Con New York 2015 Presentation - Conjur
Q Con New York 2015 Presentation - Conjur
 
3. APTs Presentation
3. APTs Presentation3. APTs Presentation
3. APTs Presentation
 
The Veil-Framework
The Veil-FrameworkThe Veil-Framework
The Veil-Framework
 
Owning computers without shell access dark
Owning computers without shell access darkOwning computers without shell access dark
Owning computers without shell access dark
 
7 Ways To Cyberattack And Hack Azure
7 Ways To Cyberattack And Hack Azure7 Ways To Cyberattack And Hack Azure
7 Ways To Cyberattack And Hack Azure
 
Chapter 9 system penetration [compatibility mode]
Chapter 9 system penetration [compatibility mode]Chapter 9 system penetration [compatibility mode]
Chapter 9 system penetration [compatibility mode]
 
Multi-tenancy with Rails
Multi-tenancy with RailsMulti-tenancy with Rails
Multi-tenancy with Rails
 
2012-03-15 What's New at Red Hat
2012-03-15 What's New at Red Hat2012-03-15 What's New at Red Hat
2012-03-15 What's New at Red Hat
 
Creating Havoc using Human Interface Device
Creating Havoc using Human Interface DeviceCreating Havoc using Human Interface Device
Creating Havoc using Human Interface Device
 
How to measure your security response readiness?
How to measure your security response readiness?How to measure your security response readiness?
How to measure your security response readiness?
 
Here Be Dragons: Security Maps of the Container New World
Here Be Dragons: Security Maps of the Container New WorldHere Be Dragons: Security Maps of the Container New World
Here Be Dragons: Security Maps of the Container New World
 
Finalppt metasploit
Finalppt metasploitFinalppt metasploit
Finalppt metasploit
 
Big Bang Theory: The Evolution of Pentesting High Security Enviroments IT Def...
Big Bang Theory: The Evolution of Pentesting High Security Enviroments IT Def...Big Bang Theory: The Evolution of Pentesting High Security Enviroments IT Def...
Big Bang Theory: The Evolution of Pentesting High Security Enviroments IT Def...
 

Plus de Will Schroeder (6)

Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
 
Nemesis - SAINTCON.pdf
Nemesis - SAINTCON.pdfNemesis - SAINTCON.pdf
Nemesis - SAINTCON.pdf
 
ReCertifying Active Directory
ReCertifying Active DirectoryReCertifying Active Directory
ReCertifying Active Directory
 
Certified Pre-Owned
Certified Pre-OwnedCertified Pre-Owned
Certified Pre-Owned
 
DerbyCon 2019 - Kerberoasting Revisited
DerbyCon 2019 - Kerberoasting RevisitedDerbyCon 2019 - Kerberoasting Revisited
DerbyCon 2019 - Kerberoasting Revisited
 
Not a Security Boundary
Not a Security BoundaryNot a Security Boundary
Not a Security Boundary
 

Dernier

Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
imonikaupta
 
📱Dehradun Call Girls Service 📱☎️ +91'905,3900,678 ☎️📱 Call Girls In Dehradun 📱
📱Dehradun Call Girls Service 📱☎️ +91'905,3900,678 ☎️📱 Call Girls In Dehradun 📱📱Dehradun Call Girls Service 📱☎️ +91'905,3900,678 ☎️📱 Call Girls In Dehradun 📱
📱Dehradun Call Girls Service 📱☎️ +91'905,3900,678 ☎️📱 Call Girls In Dehradun 📱
@Chandigarh #call #Girls 9053900678 @Call #Girls in @Punjab 9053900678
 
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
Call Girls In Delhi Whatsup 9873940964 Enjoy Unlimited Pleasure
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
ydyuyu
 
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
nirzagarg
 

Dernier (20)

"Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency""Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
 
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
 
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
 
Katraj ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For S...
Katraj ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For S...Katraj ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For S...
Katraj ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For S...
 
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
 
📱Dehradun Call Girls Service 📱☎️ +91'905,3900,678 ☎️📱 Call Girls In Dehradun 📱
📱Dehradun Call Girls Service 📱☎️ +91'905,3900,678 ☎️📱 Call Girls In Dehradun 📱📱Dehradun Call Girls Service 📱☎️ +91'905,3900,678 ☎️📱 Call Girls In Dehradun 📱
📱Dehradun Call Girls Service 📱☎️ +91'905,3900,678 ☎️📱 Call Girls In Dehradun 📱
 
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
 
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
 
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
 
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
 
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
 
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
 
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrStory Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
 
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
 
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
 
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort ServiceBusty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
 
Wadgaon Sheri $ Call Girls Pune 10k @ I'm VIP Independent Escorts Girls 80057...
Wadgaon Sheri $ Call Girls Pune 10k @ I'm VIP Independent Escorts Girls 80057...Wadgaon Sheri $ Call Girls Pune 10k @ I'm VIP Independent Escorts Girls 80057...
Wadgaon Sheri $ Call Girls Pune 10k @ I'm VIP Independent Escorts Girls 80057...
 

Bridging the Gap

  • 1. Bridging the Gap Lessons in Adversarial Tradecraft Will Schroeder, Matt Nelson Veris Group’s Adaptive Threat Division
  • 2. @harmj0y ◦ Security researcher and red teamer for the Adaptive Threat Division of Veris Group ◦ Co-founder/active developer of Empire, PowerTools, and the Veil-Framework ◦ Cons: Shmoocon, Defcon, Derbycon, various BSides
  • 3. @enigma0x3 ◦ Penetration tester and red teamer for the Adaptive Threat Division of Veris Group ◦ Developer on the Empire Project ◦ Offensive PowerShell Advocate ◦ First time presenting at a con!
  • 4. tl;dr ◦ Setting the stage ▫ Red team philosophy ▫ Bridging the Gap ◦ Push it, Push it Real Good ▫ #1 - Weak Standard Images ▫ #2 - Network/User Hygiene ▫ #3 - Domain Trusts ◦ Empire ▫ Offensive PowerShell and Rats 101 ▫ Modules
  • 6.
  • 7. Setting the Stage Pentesting, Red Teaming, and the “Assume Breach” Mentality 0
  • 8. Penetration Testing ◦ Definition ranges anywhere from a single person running a (slightly)-glorified vuln scan, to a full on multi-person assault for several weeks ◦ Reasonable Balance: breadth vs. depth, find as many holes as you can and see how far you can get in a limited timeframe ◦ Generally focused on finding issues and not about training/exercising processes
  • 9. Red Teaming ◦ Red teaming means different things to different people ▫ physical ops ▫ in-depth social engineering ▫ custom exploit dev ▫ pure network based operations ▫ adversary emulation ▫ etc. ◦ Common thread of increased time frame, more permissive scope
  • 10. “Assume Breach” Mentality ◦ With the rash of recent major incidents, organizations have started to realize that they’re probably already owned ◦ You’re not going to stop the bad guys from getting in the front door ◦ Companies need to implement an “assume breach” way of thinking
  • 11. Bridging the Gap ◦ Red Teaming historically: ▫ specialized toolsets, expanded timeframe, large team size, lots of $$$ ◦ Our approach has been to build tools that automate a lot of this previously specialized tradecraft ▫ PowerShell plays a big role here ◦ We also try to distribute a knowledgebase of these tactics
  • 12. Why PowerShell? ◦ “Microsoft’s post-exploitation language” - @obscuresec ◦ PowerShell provides (out of the box): ▫ Full .NET access ▫ application whitelist bypassing ▫ direct access to the Win32 API ▫ ability to assemble malicious binaries in memory ▫ default installation Win7+ !
  • 13. Just a “Toy Language”?
  • 14. The Weaponization Problem ◦ There’s been an sharp increase in offensive PowerShell projects over the past year ◦ But many people still struggle with how to securely work PowerShell into engagements ◦ Using existing tech at this point hasn’t always been the most straightforward
  • 15. Weak Standard Images Spreading vulnerabilities by design... 1
  • 16.
  • 17. Standard Images ◦ Organizations typically utilize some standard image per internal business unit or across the entire enterprise ▫ Frequently contracted to 3rd parties ◦ Security of this image is paramount ◦ Exploitation of this image gets us beyond the beachhead ▫ Enables further lateral spread
  • 18. Windows Services ◦ One of the most effective escalation vectors was (and still is) vulnerable Windows services ◦ Many organizations overlook the permissions for service binaries :) ▫ Overwrite the service binary to add a local user or install an agent ▫ Do have to reboot :(
  • 19. .DLL Hijacking ◦ Many programs/services will search in multiple locations when loading, including directories listed in the %PATH% environment variable ◦ If you have write access to any folder in %PATH%, there’s a good chance you can drop a malicious DLL and escalate privileges on Windows 7
  • 20. Standard Image Analysis ◦ PowerUp - PowerShell tool to automate common Windows privilege escalation vectors ▫ Part of PowerTools ▫ Invoke-AllChecks will run all current checks against a host ◦ We also manually inspect each standard image in depth to discover enterprise “0- days”
  • 21. Custom Internal Development Is the most common root cause of escalation vectors we find.
  • 22. Network/User Hygiene It’s just not hard to find targets... 2
  • 23. Dirty Networks ◦ This is a major catch all issue… ▫ Network Hygiene - Random default services existing with little knowledge by IT staff (ie. Tomcat, Cold Fusion, etc) ▫ User Hygiene - Lots of old users, admin users, overly delegated groups, and long running interactive logons ◦ One of the first steps in a network is to identify how ‘dirty’ it is Hunt -> pop box -> Mimikatz -> profit
  • 24. Invoke-UserHunter ◦ PowerView function that: ▫ queries AD for hosts or takes a target list ▫ queries AD for users of a target group, or takes a list/single user ▫ uses Win32 API calls to enumerate sessions and logged in users, matching against the target user list ◦ You don’t need administrative privileges to get a ton of information!
  • 25.
  • 26. Invoke-UserHunter -Stealth ◦ Uses an old red teaming trick 1. Queries AD for all users and extracts all homeDirectory/scriptPath/profilePath fields to identify likely domain file servers 2. Runs Get-NetSession against each file server to enumerate remote sessions, matching against target user list ◦ Gets reasonable coverage with a lot less traffic ▫ also doesn’t need admin privileges
  • 27.
  • 28. Most Organizations Have terrible privileged account hygiene in their networks. This makes our job much easier.
  • 29. Domain Trusts Or: Why You Shouldn’t Trust AD 3
  • 30.
  • 31. AD Domain Trusts 101 ◦ Trusts allow separate domains to form inter-connected relationships ◦ A trust just links up the authentication systems of two domains and allows authentication traffic to flow between them ◦ A trust allows for the possibility of privileged access between domains, but doesn’t guarantee it*
  • 32. So What? ◦ Why does this matter? ◦ Red teams often compromise accounts/machines in a domain trusted by their actual target ▫ This allows operators to exploit these existing trust relationships to achieve their end goal ◦ More information: ▫ http://www.harmj0y.net/blog/tag/domain-trusts/
  • 33. PowerView ◦ Domain/forest trust relationships can be enumerated through several PowerView functions: ▫ Get-NetForest, Get-NetForestTrust, Get- NetForestDomain, Get-NetDomainTrust ◦ If a trust exists, most functions in PowerView can accept a “-Domain <name>” flag to operate across a trust: ▫ Get-NetUser, Get-NetGroup, Get- NetDomainController, etc.
  • 34. Mapping the Mesh ◦ If an organization has a large number of trusts, we use Invoke- MapDomainTrust to recursively map all reachable trusts from our foothold ◦ @sixdub’s DomainTrustExplorer tool can perform nodal analysis of trust data ▫ It can also generate GraphML output of the entire mesh, which yED can use to build visualizations
  • 35.
  • 36. We Often Understand An organization’s domain trust mesh better than they do by the end of an engagement.
  • 37. The Mimikatz Trustpocalypse ◦ Mimikatz Golden Tickets now accept SidHistories ▫ though the new /sids:<X> argument ▫ thanks @gentilkiwi and @PyroTek3 ! ◦ If you compromise a DC in a child domain, you can create a golden ticket with “Enterprise Admins” in the sid history ◦ This can let you compromise the parent domain
  • 38. The Mimikatz Trustpocalypse If you compromise any DA credentials anywhere in a forest, you can compromise the entire forest!
  • 39.
  • 40. Empire A Pure PowerShell Post- Exploitation Agent
  • 41. First Things First ◦ This tool would not be possible if it wasn’t for the help and phenomenal work from these people: ▫ @mattifestation, @obscuresec, @josephbialek https://github.com/mattifestation/PowerSploit/ ▫ @tifkin_ https://github.com/leechristensen/ ▫ @carlos_perez, @ben0xa, @mwjcomputing, @pyrotek3, @subtee, and the rest of the offensive PowerShell community!
  • 42. Empire? ◦ Empire is a full-featured PowerShell post-exploitation agent ◦ Aims to provide a rapidly extensible platform to integrate offensive/defensive PowerShell work ◦ An attempt to train defenders on how to stop and respond to PowerShell “attacks”
  • 43. Methods of Execution ◦ Small “stager” that can be manually executed or easily implemented elsewhere ▫ A PowerShell command block can load an Empire agent ▫ Lots of formats (.bat, .vbs, .dll, etc.) ◦ Listeners are the server side of the whole system ▫ Configuration of the agent set here
  • 45.
  • 46. ◦ Currently have the following categories for modules: ▫ code_execution - ways to run more code ▫ collection - post exploitation data collection ▫ credentials - collect and use creds ▫ lateral_movement - move around the network ▫ management - host management and auxiliary ▫ persistence - survive the reboot ▫ privesc - escalation capabilities ▫ situational_awareness - network awareness ▫ trollsploit - for the lulz Module Categories
  • 47. Module Development ◦ Development is extremely fast due to the wealth of existing PowerShell tech and the ease of development in a scripting language ◦ Modules are essentially metadata containers for an embedded PowerShell script ▫ Things like option sets, needs admin, opsec safe, save file output, etc
  • 48. management/psinject ◦ First up: our auto-magic process injection module for Empire ▫ Takes a listener name and an optional process name/ID ◦ Uses Invoke-PSInjector to inject our ReflectivePick .DLL into the host or specified process ▫ Based on @tifkin_‘s UnmanagedPowerShell ▫ The launcher code to stage the agent is embedded in the .DLL
  • 51. Invoke-Mimikatz ◦ Everyone's favorite post-exploitation capability (thanks @gentilkiwi !) ▫ We use PowerSploit’s Invoke-Mimikatz function built by @josephbialek ◦ Not just dumping creds: ▫ Golden tickets, Silver tickets ▫ PTH, Skeleton key ▫ And more! ◦ Empire has Internal credential model ▫ Lets you easily reuse creds you’ve stolen
  • 52. Demo
  • 53. Questions? ◦ Will ▫ @harmj0y | blog.harmj0y.net | will [at] harmj0y.net ◦ Matt ▫ @enigma0x3 | enigma0x3.wordpress.com | MNelson [at] verisgroup.com ◦ Empire | PowerTools ▫ github.com/PowerShellEmpire/Empire | github.com/PowerShellEmpire/PowerTools ▫ www.PowerShellEmpire.com