SlideShare ist ein Scribd-Unternehmen logo
1 von 56
Windows Malware
Techniques
Lee Christensen
@tifkin_
C:> whoami
PS C:> ls env:
Where are we going?
• Windows user-land malware development and design
• Techniques for Windows environments
• Detection techniques
• I probably will forget to mention some of these….
• Not focusing on
• Kernel malware/rootkits, anti-forensics, AV-evasion
Why discuss malware
development and design?
Malware Dev: Defensive Perspective
• Understanding the code helps you design your defenses
• Malware development has its own pyramid of pain
Defensive Perspective
• Understanding the code helps you design your defense
• Malware development has its own pyramid of pain
• Gives insight into the future
Malware Dev: Offensive Perspective
• Understanding of tools
• Gives you control - easy to adapt
• Offensive in Depth
• Writing malware is fun!
A remote administration tool (RAT) is a piece of
software that allows a remote "operator" to control a
system as if he has physical access to that system.
A Good RAT
• <REMOVED>
Memory Residency
and
Modular Design
Approaches to Modularity
• <REMOVED>
DLL injection
• <REMOVED>
LoadLibrary
• <REMOVED>
LoadLibrary demo
Reflective DLL injection
• <REMOVED>
Reflective DLL demo
Modular Malware Demo
Beaconing Malware
Windows API HTTP Cheatsheet
• <REMOVED>
WinInet Example
DNS
• Why DNS?
• Not montitored as often
• Routed through a trusted host
• Great for low and slow
• Size considerations
• TXT records (255 bytes max)
• A records (4 bytes max)
Defensive Interjection!
• What can we do to detect poorly designed HTTP-based malware?
• How about DNS malware?
• Not all comms are beaconing
Internal Pivoting and Comms
• Goals
• Get remote execution
• Blend in
• Limit egress hosts
Execution
Pass the hash
• Pass the hash
• Toolkit
• Windows Credential Editor
• Metasploit
• SMBExec
• psexec
Oldies but Goodies:
Living Off The Land
At.exe
net use <ip>c$ /user:<username> <password>
at <ip> <time> c:users<user>appdatalocalmicrosoftbackdoor.exe
Schtasks.exe
schtasks /create /s <ip> /u <user> /p <password> /ru <runasuser> /tr
c:backdoor.exe /tn run /sc once /st <starttime>
Wmic.exe
wmic /node:<ip> /user:<user> /password:<password>
process call create c:backdoor.exe
Other ways…
• RDP
• VNC
• PowerShell Remoting
Internal Comm
Channels
Named Pipe
A named pipe is a named, one-way or duplex pipe for
communication between the pipe server and one or more pipe
clients. All instances of a named pipe share the same pipe name, but
each instance has its own buffers and handles.
Named Pipe
• <REMOVED>
Create a null SECURITY_DESCRIPTOR
<REMOVED>
Mail Slots
• <REMOVED>
Named Pipes Demo
Attacking Active Directory
Detecting/Preventing Local Password Theft
• Install KB2871997
• Removes all plaintext creds from lsass except WDigest
• http://blogs.technet.com/b/srd/archive/2014/06/05/an-overview-of-kb2871997.aspx
• Add admin accounts to "Protected Users" AD group
• Kerberos authentication only
• No account delegation (can't steal tokens)
• AES for pre-authentication process
• Restricted Admin mode for RDP
• Plaintext password never sent to server
• Network logons on (prevents token stealing)
Preventing Local Password Theft - cont
• LSASS Protected Process (Windows 8.1/2012 R2 and above)
• https://technet.microsoft.com/en-us/library/Dn408187.aspx
• Can be bypassed by via a driver
• Honey tokens
• Idea by Mark Baggett
• https://github.com/SMAPPER/MimikatzHoneyToken
• Alert on usage
Pass the hash Protections
• KB2871997
• Adds GPO to disable remote network logons from local accounts
• Local Adminstrator Password Solution (LAPS)
• Restrict inter-machine communications
Dumping the Domain’s Hashes
Old School – Code Execution on DC
Dump them from LSASS (Traditional hashdump)
lsadump::lsa /inject
lsadump::lsa /patch /name:krbtgt
Meterpreter
post/windows/gather/credentials/domain_hashdump
• Parses the ESE Database using the built-in JetAPI
Ntds.dit
Invoke-NinjaCopy
PowerForensics (@jaredatkinson)
Shadow copies
Ntdsutil
Detection
• Acesss to ntds.dit == Domain wide access
• Who has admin rights on DC's?
• Restrict logon rights of admin accounts (they don't need to be able to logon everywhere)
• Who has admin rights on admin PC’s?
• Who has access to backups?
• Who has access to virtualization infrastructure?
• Shadow Copy events
• Sysmon - Injections into lsass.exe, powershell.exe, ntdsutil.exe
• Network traffic - ntds.dit is not a small file…
DCSync – New Hotness for
grabbing domain hashes
Demo
DCSync Detection
• Follow Sean Metcalf (@PyroTek3)
• Unofficial documenter of Mimikatz functionality
• At the moment, enable Auditing of Directory Service Access
• https://support.microsoft.com/en-us/kb/232714
• Demo
Golden Tickets
Golden Tickets
• Event IDs: 4624 (logon), 4672 (admin logon), 4634 (logoff)
• Account Domain field is blank (should be DOMAIN)
• Account Domain field is FQDN (should be DOMAIN)
Pay attention to what your tools are doing!!!
Golden Tickets
• Event IDs: 4624 (logon), 4672 (admin logon), 4634 (logoff)
• Account Domain field is blank (should be DOMAIN)
• Account Domain field is FQDN (should be DOMAIN)
• Account Domain field is "eo.oe.kiwi :)"
Windows Malware Techniques
Windows Malware Techniques

Weitere ähnliche Inhalte

Was ist angesagt?

Cued click point image based kerberos authentication protocol
Cued click point image based kerberos authentication protocolCued click point image based kerberos authentication protocol
Cued click point image based kerberos authentication protocol
IAEME Publication
 
SPS Ozarks 2012: Kerberos Survival Guide
SPS Ozarks 2012: Kerberos Survival GuideSPS Ozarks 2012: Kerberos Survival Guide
SPS Ozarks 2012: Kerberos Survival Guide
J.D. Wade
 
BlueHat v17 || Where, how, and why is SSL traffic on mobile getting intercept...
BlueHat v17 || Where, how, and why is SSL traffic on mobile getting intercept...BlueHat v17 || Where, how, and why is SSL traffic on mobile getting intercept...
BlueHat v17 || Where, how, and why is SSL traffic on mobile getting intercept...
BlueHat Security Conference
 
Kerberos Survival Guide SPS Chicago
Kerberos Survival Guide SPS ChicagoKerberos Survival Guide SPS Chicago
Kerberos Survival Guide SPS Chicago
J.D. Wade
 

Was ist angesagt? (20)

Cued click point image based kerberos authentication protocol
Cued click point image based kerberos authentication protocolCued click point image based kerberos authentication protocol
Cued click point image based kerberos authentication protocol
 
SPS Ozarks 2012: Kerberos Survival Guide
SPS Ozarks 2012: Kerberos Survival GuideSPS Ozarks 2012: Kerberos Survival Guide
SPS Ozarks 2012: Kerberos Survival Guide
 
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...
 
Understanding Active Directory Enumeration
Understanding Active Directory EnumerationUnderstanding Active Directory Enumeration
Understanding Active Directory Enumeration
 
BlueHat v17 || Where, how, and why is SSL traffic on mobile getting intercept...
BlueHat v17 || Where, how, and why is SSL traffic on mobile getting intercept...BlueHat v17 || Where, how, and why is SSL traffic on mobile getting intercept...
BlueHat v17 || Where, how, and why is SSL traffic on mobile getting intercept...
 
Trusts You Might Have Missed - 44con
Trusts You Might Have Missed - 44conTrusts You Might Have Missed - 44con
Trusts You Might Have Missed - 44con
 
Kerberos authentication
Kerberos authenticationKerberos authentication
Kerberos authentication
 
BlueHat v17 || Scaling Incident Response - 5 Keys to Successful Defense at S...
 BlueHat v17 || Scaling Incident Response - 5 Keys to Successful Defense at S... BlueHat v17 || Scaling Incident Response - 5 Keys to Successful Defense at S...
BlueHat v17 || Scaling Incident Response - 5 Keys to Successful Defense at S...
 
An Introduction to Kerberos
An Introduction to KerberosAn Introduction to Kerberos
An Introduction to Kerberos
 
Kerberos case study
Kerberos case studyKerberos case study
Kerberos case study
 
Kerberos Survival Guide SPS Chicago
Kerberos Survival Guide SPS ChicagoKerberos Survival Guide SPS Chicago
Kerberos Survival Guide SPS Chicago
 
Ch15
Ch15Ch15
Ch15
 
Kerberos
KerberosKerberos
Kerberos
 
RACE - Minimal Rights and ACE for Active Directory Dominance
RACE - Minimal Rights and ACE for Active Directory DominanceRACE - Minimal Rights and ACE for Active Directory Dominance
RACE - Minimal Rights and ACE for Active Directory Dominance
 
Deep dive in Citrix Troubleshooting
Deep dive in Citrix TroubleshootingDeep dive in Citrix Troubleshooting
Deep dive in Citrix Troubleshooting
 
Rakesh raj
Rakesh rajRakesh raj
Rakesh raj
 
Kerberos
KerberosKerberos
Kerberos
 
Forging Trusts for Deception in Active Directory
Forging Trusts for Deception in Active DirectoryForging Trusts for Deception in Active Directory
Forging Trusts for Deception in Active Directory
 
EC PKI Training on-prem and cloud-based PKI
EC PKI Training on-prem and cloud-based PKIEC PKI Training on-prem and cloud-based PKI
EC PKI Training on-prem and cloud-based PKI
 
Bletchley
BletchleyBletchley
Bletchley
 

Ähnlich wie Windows Malware Techniques

Lateral Movement - Hacker Halted 2016
Lateral Movement - Hacker Halted 2016Lateral Movement - Hacker Halted 2016
Lateral Movement - Hacker Halted 2016
Xavier Ashe
 
Lateral Movement - Phreaknik 2016
Lateral Movement - Phreaknik 2016Lateral Movement - Phreaknik 2016
Lateral Movement - Phreaknik 2016
Xavier Ashe
 
Exploiting Active Directory Administrator Insecurities
Exploiting Active Directory Administrator InsecuritiesExploiting Active Directory Administrator Insecurities
Exploiting Active Directory Administrator Insecurities
Priyanka Aash
 

Ähnlich wie Windows Malware Techniques (20)

Owning computers without shell access 2
Owning computers without shell access 2Owning computers without shell access 2
Owning computers without shell access 2
 
Lateral Movement: How attackers quietly traverse your Network
Lateral Movement: How attackers quietly traverse your NetworkLateral Movement: How attackers quietly traverse your Network
Lateral Movement: How attackers quietly traverse your Network
 
Lateral Movement - Hacker Halted 2016
Lateral Movement - Hacker Halted 2016Lateral Movement - Hacker Halted 2016
Lateral Movement - Hacker Halted 2016
 
Windows Privilege Escalation
Windows Privilege EscalationWindows Privilege Escalation
Windows Privilege Escalation
 
Owning computers without shell access dark
Owning computers without shell access darkOwning computers without shell access dark
Owning computers without shell access dark
 
unit 2 confinement techniques.pdf
unit 2 confinement techniques.pdfunit 2 confinement techniques.pdf
unit 2 confinement techniques.pdf
 
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
 
CNIT 152 12. Investigating Windows Systems (Part 3)
CNIT 152 12. Investigating Windows Systems (Part 3)CNIT 152 12. Investigating Windows Systems (Part 3)
CNIT 152 12. Investigating Windows Systems (Part 3)
 
Lateral Movement - Phreaknik 2016
Lateral Movement - Phreaknik 2016Lateral Movement - Phreaknik 2016
Lateral Movement - Phreaknik 2016
 
CNIT 121: 12 Investigating Windows Systems (Part 3)
CNIT 121: 12 Investigating Windows Systems (Part 3)CNIT 121: 12 Investigating Windows Systems (Part 3)
CNIT 121: 12 Investigating Windows Systems (Part 3)
 
Thick Application Penetration Testing: Crash Course
Thick Application Penetration Testing: Crash CourseThick Application Penetration Testing: Crash Course
Thick Application Penetration Testing: Crash Course
 
1000 to 0
1000 to 01000 to 0
1000 to 0
 
Botnets Attacks.pptx
Botnets Attacks.pptxBotnets Attacks.pptx
Botnets Attacks.pptx
 
Typhoon Managed Execution Toolkit
Typhoon Managed Execution ToolkitTyphoon Managed Execution Toolkit
Typhoon Managed Execution Toolkit
 
Assume Compromise
Assume CompromiseAssume Compromise
Assume Compromise
 
Exploiting Active Directory Administrator Insecurities
Exploiting Active Directory Administrator InsecuritiesExploiting Active Directory Administrator Insecurities
Exploiting Active Directory Administrator Insecurities
 
Security research over Windows #defcon china
Security research over Windows #defcon chinaSecurity research over Windows #defcon china
Security research over Windows #defcon china
 
Hacking Highly Secured Enterprise Environments by Zoltan Balazs
Hacking Highly Secured Enterprise Environments by Zoltan BalazsHacking Highly Secured Enterprise Environments by Zoltan Balazs
Hacking Highly Secured Enterprise Environments by Zoltan Balazs
 
Practical Malware Analysis: Ch 11: Malware Behavior
Practical Malware Analysis: Ch 11: Malware BehaviorPractical Malware Analysis: Ch 11: Malware Behavior
Practical Malware Analysis: Ch 11: Malware Behavior
 
Bridging the Gap
Bridging the GapBridging the Gap
Bridging the Gap
 

Kürzlich hochgeladen

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Kürzlich hochgeladen (20)

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 

Windows Malware Techniques

Hinweis der Redaktion

  1. AppSec background Silent Break Security PowerShell
  2. Some of this is taken from our blackhat course
  3. Understanding the code help you design your defenses Windows APIs (WinInet, Code Injection)
  4. Malware developers have their own pyramid of pain Easy to change comm signatures. Hard to change injection technique Easy to change dropper/stage1 malware. Hard to rewrite credential extraction tool Insight into where malware will be going in the future A lot of the code used by malware is developed and released by the good guys (Mimikatz, Metasploit, PowerSploit, etc.)
  5. Understanding the code help you design your defenses Windows APIs (WinInet, Code Injection)
  6. Gives you an understanding of your tools Do you know what your tools are doing? Are your tools OpSec safe? Gives you control - easy to adapt SEP and Meterpreter staging Offensive in Depth Having a completely custom RAT comes in handy
  7. Metasploit Immunity INNUENDO PowerShell Empire Core Impact Cobalt Strike Throwback
  8. What are DLLs
  9. Doesn’t beacon back to just one location
  10. HTTP - NTLM Proxy - User agent strings - Beaconing Thresholds - Connection logging (Sysmon, Carbon black) DNS - CHATTY
  11. How many of have used at? How many of you regualarly use at.exe? “Deprecated”
  12. Similar to at.exe – can run as another user
  13. Named pipes are connection orientated, mailslots are not. Mailslots can be used for broadcast, named pipes cannot.