SlideShare a Scribd company logo
Try {stuff}
Catch {hopefully not}
Evading Detection & Covering Tracks
Security Weekly, Oct 25th 2018
Yossi Sassi
CyberArt
CyberArtSecurity.com
WindowsSecurity.biz
Whoami Y1nTh35h3ll
• ADProtector // Oriental Rock Bouzoukitarist
• Co-Founder @ CyberArt, Advisory Board @ Javelin Networks
• Security researcher, White hat hacker (Banks, Military), Musician
• ~30 years experience – Networking, IT, Programming
• Ex-Technology Group Manager @ Microsoft (~8 years), coded
Windows Server Support Tools; Ex-CTO @ public companies
Stealth reconnaissance Data exfiltration Cleanup
81 2 3 4 5 6 7 9
Privilege escalationInitial exploitation
Intelligence
gathering
Establish
foothold
Initial
attack
Enable
persistence
Enterprise
recon
Lateral
Movement
Escalate
privileges
Gather
and encrypt
data
Extract
data
Phishing emails
are sent to the
group
Red team
searches for
focused attack
targets
Red team gets access
into the organization
Local privileged
access is obtained
Internal network hunt
after domain-level
elevated privileges
Attain access to
domain-level elevated
privileges account
Obtain access to
all domain-level
accounts
Identify trophy data Data exfiltration of
trophies onto a secured
location
Removal of attack
evidence from all
systems
Recon
Red team accesses physical
environment
10
Remove
evidence
To Admin or Not to Admin?
• Security descriptors may matter more than group
memberships *
• Not convinced?
• Check out harmj0y’s “Unintended risks of trusting AD”
https://www.slideshare.net/harmj0y/the-unintended-
risks-of-trusting-active-directory
GetChangesAll right aka DCSync
• Request a DC to replicate AD objects, including user
credentials, through GetNCChanges RPC
• Look for DCSync right (DS-Replication-Get-Changes etc)
on a domain user(s):
• Typically used with Sync connectors (Azure, SharePoint)
• Can also add this right to a regular user
• Requires domain (or Enterprise) Admin
• Limitations: Read only. No ability to inject data/modify
without high chances of detection (PTH etc)
*
DC Shadow
• Feature in mimikatz located in the lsadump module
• Simulates behavior of a DC via RPC to inject your data
• Requires Domain (or enterprise) Admin
• Online AD DB modify w/Bypass monitoring (SIEM/Evt Logs)
• Can push AD changes/create backdoor without any logging:
• SIDHistory (Add Enterprise Admins group SID),
ntpwdHistory, WhenChanged, primaryGroup=519 ...
• Erase traces (replication metadata,
schemasignatureinfo...)
• Turn off enhanced auditing by set ACL of AdminSDHolder
Event Logs
• Clearing logs obviously not a practical move...
• Stopping the event log service – also not cool
• Not allowed on PTs, and easily detected
• How about Terminating Event Log thread(s)?
• Local admin required
• Restart service will renew logging
• Cons: Blue team can lookout for anomalies in number
of event received over a period of time *
Protected Event Logging
• Part of “PS <3 The Blue Team” document for PowerShell
• Issue: logged content may contain sensitive data, e.g. a
script may contain credentials, connection strings etc.
• If an attacker later compromises a machine that has
logged this data, he can use it for Recon etc.
• Solution: Encrypt data that PowerShell writes to the
event log using CMS*.
• Later you can decrypt and analyze logs once moved to
a more secure and centralized location
Try {stuff} Catch {hopefully not} - Evading Detection & Covering Tracks
Protected Event Logging
• Using defense for Offense – think Ransomware for
Event Logs 
• Requires local admin
*
PowerShell Auditing & Logging
• MS did some great stuff – Script Block Logging, Module
Logging, Constrained Language, Transcriptions.. and more
• Downgrade to v2.0 when possible, or move to .NET/other
• Invisi-Shell, our (Javelin’s) latest research bypass it ALL,
including AMSI
• Check out Omer Yair’s github, DerbyCon talk, or here at
Security Weekly
• https://securityweekly.com/2018/10/13/omer-yair-
javelin-pauls-security-weekly-578/
• Registry, Prefetch …
• … and a bunch of other places
Some thoughts about persistence
• Anything that can be related to process/service/wmi
event/regkey etc – can be detected (or terminated)
• Javelin’s approach (ADProtect)
• In-memory “dissolvable agent”
• Note: ADProtect also detects current DCSync users
AND when new ones added, among other AD
vulnerabilities, misconfigurations & excessive
permissions
Finally {}
• Security descriptors may go further than memberships
• Defending as an attacker, attacking as a defender
• It’s all about the Yin Yang, folks 
References & Resources (1/2)
• Y1nTh35h3ll Github – Code from this session, and some more
– https://github.com/YossiSassi
• More on DC Sync
– https://adsecurity.org/?p=1729
• DC Shadow explanation
– https://blog.alsid.eu/dcshadow-explained-4510f52fc19d
• https://www.dcshadow.com/
• Invoke-Phant0m (Event log thread termination)
– https://github.com/hlldz/Invoke-Phant0m
• Powershell <3 the Blue Team – best practices for auditing & logging
– https://blogs.msdn.microsoft.com/powershell/2015/06/09/powershell-the-blue-
team/
• Invisi-Shell – Bypass all Powershell security features
– https://github.com/OmerYa/Invisi-Shell, or twitter: https://twitter.com/Yair_Omer
• Javelin Networks - ADProtect
– www.Javelin-networks.com
References & Resources (2/2)
Thqnk Y0v 
@sassi_yossi
yossi@CyberArtSecurity.com

More Related Content

PDF
There’s an OpenBullet Attack Config for Your Site – What Should You Do?
PDF
Brksec 2048-demystifying aci-security
PDF
Sigma Hall of Fame - EU ATT&CK User Workshop, October 2021
PDF
50 Shades of Sigma
PDF
Security Analyst Workshop - 20190314
PDF
Maturity Model of Security Disciplines
PDF
Security Analyst Workshop - 20200212
PDF
Ransomware Resistance
There’s an OpenBullet Attack Config for Your Site – What Should You Do?
Brksec 2048-demystifying aci-security
Sigma Hall of Fame - EU ATT&CK User Workshop, October 2021
50 Shades of Sigma
Security Analyst Workshop - 20190314
Maturity Model of Security Disciplines
Security Analyst Workshop - 20200212
Ransomware Resistance

What's hot (20)

PDF
Detection and Response Roles
PPT
Penetration testing, What’s this?
PPTX
Detection Rules Coverage
PDF
THOR Apt Scanner
PDF
Red Team Methodology - A Naked Look
PPTX
Rugged DevOps at Scale with Rich Mogull
PPTX
Security War Games
PDF
Anatomy of a Cloud Hack
PDF
Beyond the mcse red teaming active directory
PDF
BlueHat v18 || Tales from the soc - real-world attacks seen through azure atp...
PDF
MITRE ATT&CKcon 2018: From Technique to Detection, Paul Ewing and Ross Wolf, ...
PPTX
Injection flaw teaser
PDF
Ch 6: Attacking Authentication
PDF
Web security for developers
PDF
Attacker's Perspective of Active Directory
PDF
CSW2017 chuanda ding_state of windows application security
PPT
Malware forensics
PPTX
Large enterprise SIEM: get ready for oversize
PDF
BlueHat v18 || Protecting the protector, hardening machine learning defenses ...
PDF
BlueHat v17 || Go Hunt: An Automated Approach for Security Alert Validation
Detection and Response Roles
Penetration testing, What’s this?
Detection Rules Coverage
THOR Apt Scanner
Red Team Methodology - A Naked Look
Rugged DevOps at Scale with Rich Mogull
Security War Games
Anatomy of a Cloud Hack
Beyond the mcse red teaming active directory
BlueHat v18 || Tales from the soc - real-world attacks seen through azure atp...
MITRE ATT&CKcon 2018: From Technique to Detection, Paul Ewing and Ross Wolf, ...
Injection flaw teaser
Ch 6: Attacking Authentication
Web security for developers
Attacker's Perspective of Active Directory
CSW2017 chuanda ding_state of windows application security
Malware forensics
Large enterprise SIEM: get ready for oversize
BlueHat v18 || Protecting the protector, hardening machine learning defenses ...
BlueHat v17 || Go Hunt: An Automated Approach for Security Alert Validation
Ad

Similar to Try {stuff} Catch {hopefully not} - Evading Detection & Covering Tracks (20)

PPTX
BSides SG Practical Red Teaming Workshop
PDF
DEF CON 24 - Sean Metcalf - beyond the mcse red teaming active directory
PDF
2017-BSidesCharm-DetectingtheElusive-ActiveDirectoryThreatHunting-Final.pdf
PPTX
Bridging the Gap
PPTX
Lateral Movement - Phreaknik 2016
PDF
theVIVI-AD-Security-Workshop_AfricaHackon2019.pdf
PPTX
Adversary tactics config mgmt-&amp;-logs-oh-my
PDF
Derbycon - The Unintended Risks of Trusting Active Directory
PDF
I Have the Power(View)
PPTX
I hunt sys admins 2.0
PPTX
Bridging the Gap: Lessons in Adversarial Tradecraft
PDF
Hacktive Directory Forensics - HackCon18, Oslo
PPTX
Catch Me If You Can - Finding APTs in your network
PDF
The Dirty Little Secrets They Didn’t Teach You In Pentesting Class
PPTX
First Responders Course - Session 6 - Detection Systems [2004]
PPTX
Drilling deeper with Veil's PowerTools
PPTX
Windows 10 CredentialGuard vs Mimikatz - SEC599
PPTX
PowerShell for Cyber Warriors - Bsides Knoxville 2016
PDF
BSidesPGH 2019
PPTX
PSConfEU - Offensive Active Directory (With PowerShell!)
BSides SG Practical Red Teaming Workshop
DEF CON 24 - Sean Metcalf - beyond the mcse red teaming active directory
2017-BSidesCharm-DetectingtheElusive-ActiveDirectoryThreatHunting-Final.pdf
Bridging the Gap
Lateral Movement - Phreaknik 2016
theVIVI-AD-Security-Workshop_AfricaHackon2019.pdf
Adversary tactics config mgmt-&amp;-logs-oh-my
Derbycon - The Unintended Risks of Trusting Active Directory
I Have the Power(View)
I hunt sys admins 2.0
Bridging the Gap: Lessons in Adversarial Tradecraft
Hacktive Directory Forensics - HackCon18, Oslo
Catch Me If You Can - Finding APTs in your network
The Dirty Little Secrets They Didn’t Teach You In Pentesting Class
First Responders Course - Session 6 - Detection Systems [2004]
Drilling deeper with Veil's PowerTools
Windows 10 CredentialGuard vs Mimikatz - SEC599
PowerShell for Cyber Warriors - Bsides Knoxville 2016
BSidesPGH 2019
PSConfEU - Offensive Active Directory (With PowerShell!)
Ad

Recently uploaded (20)

DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Advanced IT Governance
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PPTX
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
PPTX
Cloud computing and distributed systems.
PDF
cuic standard and advanced reporting.pdf
PPT
Teaching material agriculture food technology
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Advanced Soft Computing BINUS July 2025.pdf
PDF
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
[발표본] 너의 과제는 클라우드에 있어_KTDS_김동현_20250524.pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
The AUB Centre for AI in Media Proposal.docx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Understanding_Digital_Forensics_Presentation.pptx
Advanced IT Governance
NewMind AI Monthly Chronicles - July 2025
Spectral efficient network and resource selection model in 5G networks
Review of recent advances in non-invasive hemoglobin estimation
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
Cloud computing and distributed systems.
cuic standard and advanced reporting.pdf
Teaching material agriculture food technology
Diabetes mellitus diagnosis method based random forest with bat algorithm
NewMind AI Weekly Chronicles - August'25 Week I
Advanced Soft Computing BINUS July 2025.pdf
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
The Rise and Fall of 3GPP – Time for a Sabbatical?
[발표본] 너의 과제는 클라우드에 있어_KTDS_김동현_20250524.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy

Try {stuff} Catch {hopefully not} - Evading Detection & Covering Tracks

  • 1. Try {stuff} Catch {hopefully not} Evading Detection & Covering Tracks Security Weekly, Oct 25th 2018 Yossi Sassi CyberArt CyberArtSecurity.com WindowsSecurity.biz
  • 2. Whoami Y1nTh35h3ll • ADProtector // Oriental Rock Bouzoukitarist • Co-Founder @ CyberArt, Advisory Board @ Javelin Networks • Security researcher, White hat hacker (Banks, Military), Musician • ~30 years experience – Networking, IT, Programming • Ex-Technology Group Manager @ Microsoft (~8 years), coded Windows Server Support Tools; Ex-CTO @ public companies
  • 3. Stealth reconnaissance Data exfiltration Cleanup 81 2 3 4 5 6 7 9 Privilege escalationInitial exploitation Intelligence gathering Establish foothold Initial attack Enable persistence Enterprise recon Lateral Movement Escalate privileges Gather and encrypt data Extract data Phishing emails are sent to the group Red team searches for focused attack targets Red team gets access into the organization Local privileged access is obtained Internal network hunt after domain-level elevated privileges Attain access to domain-level elevated privileges account Obtain access to all domain-level accounts Identify trophy data Data exfiltration of trophies onto a secured location Removal of attack evidence from all systems Recon Red team accesses physical environment 10 Remove evidence
  • 4. To Admin or Not to Admin? • Security descriptors may matter more than group memberships * • Not convinced? • Check out harmj0y’s “Unintended risks of trusting AD” https://www.slideshare.net/harmj0y/the-unintended- risks-of-trusting-active-directory
  • 5. GetChangesAll right aka DCSync • Request a DC to replicate AD objects, including user credentials, through GetNCChanges RPC • Look for DCSync right (DS-Replication-Get-Changes etc) on a domain user(s): • Typically used with Sync connectors (Azure, SharePoint) • Can also add this right to a regular user • Requires domain (or Enterprise) Admin • Limitations: Read only. No ability to inject data/modify without high chances of detection (PTH etc) *
  • 6. DC Shadow • Feature in mimikatz located in the lsadump module • Simulates behavior of a DC via RPC to inject your data • Requires Domain (or enterprise) Admin • Online AD DB modify w/Bypass monitoring (SIEM/Evt Logs) • Can push AD changes/create backdoor without any logging: • SIDHistory (Add Enterprise Admins group SID), ntpwdHistory, WhenChanged, primaryGroup=519 ... • Erase traces (replication metadata, schemasignatureinfo...) • Turn off enhanced auditing by set ACL of AdminSDHolder
  • 7. Event Logs • Clearing logs obviously not a practical move... • Stopping the event log service – also not cool • Not allowed on PTs, and easily detected • How about Terminating Event Log thread(s)? • Local admin required • Restart service will renew logging • Cons: Blue team can lookout for anomalies in number of event received over a period of time *
  • 8. Protected Event Logging • Part of “PS <3 The Blue Team” document for PowerShell • Issue: logged content may contain sensitive data, e.g. a script may contain credentials, connection strings etc. • If an attacker later compromises a machine that has logged this data, he can use it for Recon etc. • Solution: Encrypt data that PowerShell writes to the event log using CMS*. • Later you can decrypt and analyze logs once moved to a more secure and centralized location
  • 10. Protected Event Logging • Using defense for Offense – think Ransomware for Event Logs  • Requires local admin *
  • 11. PowerShell Auditing & Logging • MS did some great stuff – Script Block Logging, Module Logging, Constrained Language, Transcriptions.. and more • Downgrade to v2.0 when possible, or move to .NET/other • Invisi-Shell, our (Javelin’s) latest research bypass it ALL, including AMSI • Check out Omer Yair’s github, DerbyCon talk, or here at Security Weekly • https://securityweekly.com/2018/10/13/omer-yair- javelin-pauls-security-weekly-578/
  • 12. • Registry, Prefetch … • … and a bunch of other places
  • 13. Some thoughts about persistence • Anything that can be related to process/service/wmi event/regkey etc – can be detected (or terminated) • Javelin’s approach (ADProtect) • In-memory “dissolvable agent” • Note: ADProtect also detects current DCSync users AND when new ones added, among other AD vulnerabilities, misconfigurations & excessive permissions
  • 14. Finally {} • Security descriptors may go further than memberships • Defending as an attacker, attacking as a defender • It’s all about the Yin Yang, folks 
  • 15. References & Resources (1/2) • Y1nTh35h3ll Github – Code from this session, and some more – https://github.com/YossiSassi • More on DC Sync – https://adsecurity.org/?p=1729 • DC Shadow explanation – https://blog.alsid.eu/dcshadow-explained-4510f52fc19d • https://www.dcshadow.com/ • Invoke-Phant0m (Event log thread termination) – https://github.com/hlldz/Invoke-Phant0m
  • 16. • Powershell <3 the Blue Team – best practices for auditing & logging – https://blogs.msdn.microsoft.com/powershell/2015/06/09/powershell-the-blue- team/ • Invisi-Shell – Bypass all Powershell security features – https://github.com/OmerYa/Invisi-Shell, or twitter: https://twitter.com/Yair_Omer • Javelin Networks - ADProtect – www.Javelin-networks.com References & Resources (2/2)