SlideShare a Scribd company logo
44CON Hacking Enterprises
grep ‘in.security’ /etc/groups
A cyber security consultancy offering specialist technical and training services
Technical
• Vulnerability Assessments
• Penetration Testing
• Red Team Engagements
• Social Engineering Engagements
• Wireless Security Assessments
• Password Audits
• Build Reviews
• Firewall Reviews
© in.security Ltd 2019, all rights reserved
$whoami /all
Will Hunt
• Co-founder of in.security
• 10+ years in cyber
• Assists UK Government
• Hacker, formerly digital forensics
• Trained at various conferences including Black Hat USA/EU
• @Stealthsploit
• https://stealthsploit.com
© in.security Ltd 2019, all rights reserved
$whoami /all
Owen Shearing
• Co-founder of in.security
• 14+ years in technical roles
• Trained at various bespoke events and conferences including Black
Hat Asia, USA and EU
• CREST CCT
• @rebootuser
• https://rebootuser.com / https://github.com/rebootuser
© in.security Ltd 2019, all rights reserved
The LAB
The LAB
• The MGT network hosts LAB resources for all
students to access, including:
• Phishing Platform (Gophish)
• ELK Stack
• CTF Platform
• Kali network (attackers) – this is you!
• The Dev network - routable from attackers
subnet
• Two undiscovered, firewalled subnets!
+ a third subnet unlocked after training
completes!
© in.security Ltd 2019, all rights reserved
MGT
Dev
Attackers
© in.security Ltd 2019, all rights reserved
Topics…
© in.security Ltd 2019, all rights reserved
MGT
A:ackers Dev
OSINT techniques
IPv4 / IPv6 discovery & enumeration
Automated vulnerability scanning
Introduction into exploitation frameworks & Mobile devices
Linux enumeration, shells, privilege escalation & post exploitation
P@ssw0rd cracking (Linux)
Windows enumeration
Creating & executing a phishing campaign
P@ssw0rd cracking (Windows)
Windows shells, privilege escalation, post exploitation & info gathering
Defensive monitoring
Restricted environment breakouts
Pivoting and lateral movement
Identifying further targets
Database/application enumeration & exploitation
Domain/trust compromise
Persistence & exfiltration
Our 45min Pwnage Plan…
Phish >
Kibana >
Phish#2 >
Enumeration >
Exfiltration >
Password Cr@cK5 >
SOCKS Proxies >
OOB Persistence!
© in.security Ltd 2019, all rights reserved
Our 45min Pwnage Plan…
Phish >
Kibana >
Phish#2 >
Enumeration >
Exfiltration >
Password Cr@cK5 >
SOCKS Proxies >
OOB Persistence!
© in.security Ltd 2019, all rights reserved
Phishing – Delivery & Payloads
Delivery Examples
• Email, generic ‘campaign’ or targeted attack (spear phishing)
• SMS (Smishing) / Voice (Vishing)
• Web based (malicious/hacked website)
• Malvertising
Payload Examples
• Data collection via hosted forms (credentials, personal/sensitive information, payment details)
• Spoofing and/or content injection targeting legitimate websites
• Embedded code in attached Office documents (Macros, DDE)
• Exploiting vulnerabilities in client-side software (Flash, Acrobat, Java)
© in.security Ltd 2019, all rights reserved
Gophish – Users & Groups
Using Gophish for a phishing campaign:
• Targets (Users & Groups tab)
• Email template
• Landing page
• Sending Profile
https://docs.getgophish.com/user-guide
© in.security Ltd 2019, all rights reserved
Phishing – HTA Files
• HTML application
• Launched by mshta.exe on Windows
“In short, HTAs pack all the power of Internet Explorer - its object
model, performance, rendering power and protocol support - without
enforcing the strict security model and user interface of the browser”
https://docs.microsoft.com/en-us/previous-versions//ms536496(v=vs.85)
• A nice overview of HTA/command execution
https://9to5it.com/using-html-applications-as-a-powershell-gui/
© in.security Ltd 2019, all rights reserved
Phishing – HTA Files
<script language="VBScript">
window.moveTo -4000, -4000
cmd = "powershell.exe -c Test-Connection 10.133.251.10"
Set runme = CreateObject("Wscript.Shell")
result = runme.Run(cmd, 0, true)
window.close()
</script>
• Cmd – command we are executing
• 0 – set to hidden
• True - wait for command to complete before continuing
© in.security Ltd 2019, all rights reserved
Our 45min Pwnage Plan…
<DEMO>
© in.security Ltd 2019, all rights reserved
[Phishing]
Our 45min Pwnage Plan…
Phish >
Kibana >
Phish#2 >
Enumeration >
Exfiltration >
Password Cr@cK5 >
SOCKS Proxies >
OOB Persistence!
© in.security Ltd 2019, all rights reserved
Monitoring & Alerting
• Elasticsearch Logstash Kibanna (ELK)
https://www.elastic.co/products
© in.security Ltd 2019, all rights reserved
Kibana - a web-based frontend to allow real-time,
visual analysis of collected data in Elasticsearch
Elasticsearch – based on Apache Lucene, a NoSQL
(JSON based/document store model) database
Logstash – a tool to intake, process and output log data
from various sources
Monitoring & Alerting
• Elasticsearch Logstash Kibanna (ELK)
https://www.elastic.co/products
© in.security Ltd 2019, all rights reserved
Kibana - a web-based frontend to allow real-time,
visual analysis of collected data in Elasticsearch
Elasticsearch – based on Apache Lucene, a NoSQL
(JSON based/document store model) database
Logstash – a tool to intake, process and output log data
from various sources
Monitoring & Alerting
• Elasticsearch Logstash Kibanna (ELK)
https://www.elastic.co/products
© in.security Ltd 2019, all rights reserved
Kibana - a web-based frontend to allow real-time,
visual analysis of collected data in Elasticsearch
Elasticsearch – based on Apache Lucene, a NoSQL
(JSON based/document store model) database
Logstash – a tool to intake, process and output log data
from various sources
Sysmon
• Part of the Sysinternals suite
https://docs.microsoft.com/en-gb/sysinternals/downloads/sysmon
• A configuration file can be supplied (-i) containing the desired rules
• A great template config from @SwiftOnSecurity
https://github.com/SwiftOnSecurity/sysmon-config
© in.security Ltd 2019, all rights reserved
A/V & AMSI
• So, why did our initial phish with msfvenom generated HTA fail?
….
• Well, this would be due to Windows Defender/Antimalware Scan Interface
© in.security Ltd 2019, all rights reserved
Our 45min Pwnage Plan…
DEMO…
© in.security Ltd 2019, all rights reserved
[Monitoring]
Our 45min Pwnage Plan…
Phish >
Kibana >
Phish#2 >
Enumeration >
Exfiltration >
Password Cr@cK5 >
SOCKS Proxies >
OOB Persistence!
© in.security Ltd 2019, all rights reserved
Unicorn
• Created by TrustedSec / https://github.com/trustedsec/unicorn
• Simple to use, well documented and regularly updated with new techniques/evasion methods
• A number of payloads rely on a msf handler listening on the attacking system (all required
configs are generated by the tool)
© in.security Ltd 2019, all rights reserved
Our 45min Pwnage Plan…
DEMO…
© in.security Ltd 2019, all rights reserved
[Phishing #2]
Our 45min Pwnage Plan…
Phish >
Kibana >
Phish#2 >
Enumeration >
Exfiltration >
Password Cr@cK5 >
SOCKS Proxies >
OOB Persistence!
© in.security Ltd 2019, all rights reserved
Information Gathering
Some questions we’re going to be asking ourselves
• What permissions does the compromised account hold?
© in.security Ltd 2019, all rights reserved
Information Gathering
Some questions we’re going to be asking ourselves
• What permissions does the compromised account hold?
• Do we have access to any users with interesting group memberships or delegated
rights within the domain?
© in.security Ltd 2019, all rights reserved
Information Gathering
Some questions we’re going to be asking ourselves
• What permissions does the compromised account hold?
• Do we have access to any users with interesting group memberships or delegated
rights within the domain?
• What systems/networks does the compromised host have access to?
© in.security Ltd 2019, all rights reserved
Information Gathering
Some questions we’re going to be asking ourselves
• What permissions does the compromised account hold?
• Do we have access to any users with interesting group memberships or delegated
rights within the domain?
• What systems/networks does the compromised host have access to?
• […
• …]
• What systems are deemed to hold important/sensitive data?
© in.security Ltd 2019, all rights reserved
Information Gathering
PowerView
• Part of the PowerSploit package
https://github.com/PowerShellMafia/PowerSploit/tree/master/Recon
OR, for the latest version 3 (development) version
https://github.com/PowerShellMafia/PowerSploit/blob/dev/Recon/PowerView.ps1
• PowerShell script that provides numerous functions for situational awareness and domain
enumeration
• A great ‘cheatsheet’ on functions and usage by @harmj0y
https://gist.github.com/HarmJ0y/184f9822b195c52dd50c379ed3117993
• Functions include: Get-DomainUser, Get-DomainGroup, Get-DomainGroupMember
Get-NetDomain, Get-DomainPolicy, Get-DomainTrust, Get-DomainComputer,
Find-DomainShare + LOADS more
© in.security Ltd 2019, all rights reserved
Our 45min Pwnage Plan…
DEMO…
© in.security Ltd 2019, all rights reserved
[Enumeration]
Our 45min Pwnage Plan…
Phish >
Kibana >
Phish#2 >
Enumeration >
Exfiltration >
Password Cr@cK5 >
SOCKS Proxies >
OOB Persistence!
© in.security Ltd 2019, all rights reserved
Password Managers - KeePass
© in.security Ltd 2019, all rights reserved
• Password managers/vaults are often used to store privileged credentials
and information
• KeePass uses .kdb files (v1) and .kdbx files (v2) to store the database
• We can’t just give the file to a password cracker so we need to extract
the hash
• keepass2john can do this and it comes shipped with Kali
• We could then either install KeePass and load the database, or access
directly over the command line using a tool like kpcli
How Can We Exfil The DataZ?
© in.security Ltd 2019, all rights reserved
Transferring files using PowerShell
$FileName = “<target_file>”
$base64string =
[Convert]::ToBase64String([IO.File]::ReadAllBytes($FileName))
ReadAllBytes – Opens a binary file, reads the contents into a byte array and
closes the file*
* https://docs.microsoft.com/en-us/dotnet/api/system.io.file.readallbytes
Our 45min Pwnage Plan…
DEMO…
© in.security Ltd 2019, all rights reserved
[Exfiltration]
Our 45min Pwnage Plan…
Phish >
Kibana >
Phish#2 >
Enumeration >
Exfiltration >
Password Cr@cK5 >
SOCKS Proxies >
OOB Persistence!
© in.security Ltd 2019, all rights reserved
Offline Password Cracking
Success depends on a number of factors
• Algorithm complexity
• Password length / complexity
• Hardware (GPU/FPGA/ASIC)
Password cracking process
• Hash the clear text candidate
• Compare to stolen hash
• No match? Start again
• Match = Win!
© in.security Ltd 2019, all rights reserved
Brute Force Attack
© in.security Ltd 2019, all rights reserved
• Try every possible combination of every character
• Not used 99% of the time…
Pros
• 100% GUARANTEED to crack
Cons
• You likely won’t be around to see it happen!
Brute Force Attack
• Key space = char set ^ length
• 8x NVIDIA GTX 1080 Ti GPUs - Windows passwords @ 513 GH/s*
(full 95 char set)
• 8 char NTLM = 3.5 hours
• 9 char NTLM = 14 days
• 10 char NTLM = 3.7 years
• 11 char NTLM = 351 years
• 12 char NTLM = 33,401 years
• 13 char NTLM = 3.2 million years
© in.security Ltd 2019, all rights reserved
*h:ps://gist.github.com/epixoip/ace60d09981be09544fdd35005051505
Dictionary Attack
© in.security Ltd 2019, all rights reserved
Wordlist Rules
insecurity Insecurity
Password 1nsecurity
monkey ins3curity!
1234567 Ins3cur1ty
Qwerty in53cur!ty
letmein
• Wordlist contains password candidates
• Most commonly used
• Can be mangled with rules
Pros
• Wordlists contain common passwords
• Mangling addresses the human element
Cons
• Only as good as your dictionary/rules
Our 45min Pwnage Plan…
DEMO…
© in.security Ltd 2019, all rights reserved
[Cracking]
Our 45min Pwnage Plan…
Phish >
Kibana >
Phish#2 >
Enumeration >
Exfiltration >
Password Cr@cK5 >
SOCKS Proxies >
OOB Persistence!
© in.security Ltd 2019, all rights reserved
Routing in Metasploit
• Traffic to target networks can be routed over existing sessions…
• To add a route
route add <$network> <$mask> <$sessionID>
© in.security Ltd 2019, all rights reserved
SOCKS Proxies
• A server that can establish a connection to a destination on behalf of a client
• Metasploit SOCKS modules
auxiliary/server/socks4a
auxiliary/server/socks5
”This module provides a socksx proxy server that uses the built-in Metasploit routing to relay connections” *
• This functionality allows programs external to Metasploit, to utilise configured
routes within msf and gain access to the target system(s)/network(s)
…with the help of proxychains
© in.security Ltd 2019, all rights reserved
SOCKS Proxies & Proxychains
• Proxychains / http://proxychains.sourceforge.net
• Allows/supports TCP (not UDP - with the exception of DNS)
• Used to allow *any program to run through a SOCKS proxy
• Configuration file @ /etc/proxychains.conf
• Then run a program through the proxy!
proxychains smbclient -W insec-xxxx.local //10.133.50.xxx/<$fileshare> -U <$targetUser>%<$password>
© in.security Ltd 2019, all rights reserved
Our 45min Pwnage Plan…
DEMO…
© in.security Ltd 2019, all rights reserved
[SOCKS & Shellz]
Our 45min Pwnage Plan…
Phish >
Kibana >
Phish#2 >
Enumeration >
Exfiltration >
Password Cr@cK5 >
SOCKS Proxies >
OOB Persistence!
© in.security Ltd 2019, all rights reserved
Hiding Data
• Alternate Data Streams (ADS) allow one file system entry to contain multiple data
sets (NTFS only)
• Original file is always the ‘main’ stream, additional streams are appended to
filename and are colon delimited
File.txt File.txt:secretdata.txt:$DATA
File.txt:shell.exe:$DATA
• One option to trigger – wmic process call create File.txt:shell.exe
• A nice article by Oddvar Moe on executing files from ADS
https://oddvar.moe/2018/01/14/putting-data-in-alternate-data-streams-and-how-to-execute-it/
© in.security Ltd 2019, all rights reserved
Exfiltrating Data Over ICMP
© in.security Ltd 2019, all rights reserved
• ICMP doesn’t use ports (types) and is often left enabled, forgotten and not
monitored
• Overcomes network egress issues when usual channels are blocked
• icmpsh is a reverse ICMP shell (https://github.com/inquisb/icmpsh)
• Server works in C, Perl, Python
• Client is Win32
• We have to disable ICMP replies from the attacking host and then start
the ICMP server
sysctl -w net.ipv4.icmp_echo_ignore_all=1
Our 45min-ish Pwnage Plan…
DEMO…
© in.security Ltd 2019, all rights reserved
[ADS & OOB ICMP… If time persists!]
Our 45min Pwnage Plan…
Phish
Kibana
Phish#2
Enumeration
Exfiltration
Password Cr@cK5
SOCKS Proxies
OOB Persistence
© in.security Ltd 2019, all rights reserved
Our 45min Pwnage Plan…
</DEMO>
© in.security Ltd 2019, all rights reserved
Much, Much
More…
© in.security Ltd 2019, all rights reserved
June 6th/7th
@44CON
h9ps://44con.com/44con-training/hacking-enterprises-exploiCng-insecurity/

More Related Content

PPTX
How to write secure code
PPTX
Red teaming in the cloud
PDF
Hacking SIP Like a Boss!
PDF
Avoiding Sophisticated Targeted Breach Critical Guidance Healthcare
PDF
Activated Charcoal - Making Sense of Endpoint Data
PDF
5 step plan to securing your APIs
PDF
VoIP Wars: Attack of the Cisco Phones
PDF
How to write secure code
Red teaming in the cloud
Hacking SIP Like a Boss!
Avoiding Sophisticated Targeted Breach Critical Guidance Healthcare
Activated Charcoal - Making Sense of Endpoint Data
5 step plan to securing your APIs
VoIP Wars: Attack of the Cisco Phones

What's hot (19)

PPTX
OWASP Atlanta 2018: Forensics as a Service
PDF
VoIP Wars: The Phreakers Awaken
PDF
VoIP Wars: Destroying Jar Jar Lync (Filtered version)
PPTX
End-to-Eend security with Palo Alto Networks (Onur Kasap, Palo Alto Networks)
PDF
VoIP Wars: Destroying Jar Jar Lync (Unfiltered version)
PPT
Presentacion Palo Alto Networks
PDF
VMworld 2013: VMware NSX with Next-Generation Security by Palo Alto Networks
PDF
F5 DDoS Protection
PDF
F5 Web Application Security
PPTX
Prowler: BlackHat Europe Arsenal 2018
PPTX
Why choose pan
PPTX
Palo Alto Networks 28.5.2013
PDF
F5 TMOS v13.0
PDF
Palo Alto Networks y la tecnología de Next Generation Firewall
PPTX
VoIP – vulnerabilities and attacks
PDF
Departed Communications: Learn the ways to smash them!
PDF
MBFuzzer : MITM Fuzzing for Mobile Applications
PDF
Preparing for the Imminent Terabit DDoS Attack
PDF
BlackHat Hacking - Hacking VoIP.
OWASP Atlanta 2018: Forensics as a Service
VoIP Wars: The Phreakers Awaken
VoIP Wars: Destroying Jar Jar Lync (Filtered version)
End-to-Eend security with Palo Alto Networks (Onur Kasap, Palo Alto Networks)
VoIP Wars: Destroying Jar Jar Lync (Unfiltered version)
Presentacion Palo Alto Networks
VMworld 2013: VMware NSX with Next-Generation Security by Palo Alto Networks
F5 DDoS Protection
F5 Web Application Security
Prowler: BlackHat Europe Arsenal 2018
Why choose pan
Palo Alto Networks 28.5.2013
F5 TMOS v13.0
Palo Alto Networks y la tecnología de Next Generation Firewall
VoIP – vulnerabilities and attacks
Departed Communications: Learn the ways to smash them!
MBFuzzer : MITM Fuzzing for Mobile Applications
Preparing for the Imminent Terabit DDoS Attack
BlackHat Hacking - Hacking VoIP.

Similar to 44CON Hacking Enterprises (20)

PDF
Zero Day Malware Detection/Prevention Using Open Source Software
PPTX
Application security meetup k8_s security with zero trust_29072021
PDF
Build advanced chat bots - Steve Sfartz - Codemotion Amsterdam 2017
PDF
Guide of authentication and authorization for cloud native applications with ...
PPTX
Meeting rooms are talking. Are you listening
PDF
The Whys and Hows of Deploying a Secure RPA Solution
PPTX
Man in the Cloud Attacks
PPTX
Rome 2017: Building advanced voice assistants and chat bots
PPTX
Stève Sfartz - Meeting rooms are talking! Are you listening? - Codemotion Ber...
PPTX
Stève Sfartz - Meeting rooms are talking! Are you listening? - Codemotion Ber...
PDF
Introduction to Mobile Application Security - Techcity 2015 (Vilnius)
PDF
IT Camp 19: Top Azure security fails and how to avoid them
PDF
Jeremiah O'Connor & David Maynor - Chasing the Crypto Workshop: Tracking Fina...
PDF
Building advanced Chats Bots and Voice Interactive Assistants - Stève Sfartz ...
PDF
Emulators as an Emerging Best Practice for API Providers
PDF
PKI in DevOps: How to Deploy Certificate Automation within CI/CD
PPTX
Meeting rooms are talking! are you listening?
PDF
Keeping your collaboration safe while working remotely
PDF
BRKSEC-3144.pdf
PDF
Secure coding guidelines
Zero Day Malware Detection/Prevention Using Open Source Software
Application security meetup k8_s security with zero trust_29072021
Build advanced chat bots - Steve Sfartz - Codemotion Amsterdam 2017
Guide of authentication and authorization for cloud native applications with ...
Meeting rooms are talking. Are you listening
The Whys and Hows of Deploying a Secure RPA Solution
Man in the Cloud Attacks
Rome 2017: Building advanced voice assistants and chat bots
Stève Sfartz - Meeting rooms are talking! Are you listening? - Codemotion Ber...
Stève Sfartz - Meeting rooms are talking! Are you listening? - Codemotion Ber...
Introduction to Mobile Application Security - Techcity 2015 (Vilnius)
IT Camp 19: Top Azure security fails and how to avoid them
Jeremiah O'Connor & David Maynor - Chasing the Crypto Workshop: Tracking Fina...
Building advanced Chats Bots and Voice Interactive Assistants - Stève Sfartz ...
Emulators as an Emerging Best Practice for API Providers
PKI in DevOps: How to Deploy Certificate Automation within CI/CD
Meeting rooms are talking! are you listening?
Keeping your collaboration safe while working remotely
BRKSEC-3144.pdf
Secure coding guidelines

Recently uploaded (20)

PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PPT
Module 1.ppt Iot fundamentals and Architecture
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Architecture types and enterprise applications.pdf
PDF
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
PDF
2021 HotChips TSMC Packaging Technologies for Chiplets and 3D_0819 publish_pu...
PDF
A contest of sentiment analysis: k-nearest neighbor versus neural network
PDF
Zenith AI: Advanced Artificial Intelligence
PDF
Hindi spoken digit analysis for native and non-native speakers
PPTX
observCloud-Native Containerability and monitoring.pptx
PDF
NewMind AI Weekly Chronicles – August ’25 Week III
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PDF
Developing a website for English-speaking practice to English as a foreign la...
PDF
A novel scalable deep ensemble learning framework for big data classification...
PDF
Getting started with AI Agents and Multi-Agent Systems
PDF
project resource management chapter-09.pdf
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PPTX
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
PPTX
O2C Customer Invoices to Receipt V15A.pptx
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Module 1.ppt Iot fundamentals and Architecture
Programs and apps: productivity, graphics, security and other tools
NewMind AI Weekly Chronicles - August'25-Week II
Architecture types and enterprise applications.pdf
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
2021 HotChips TSMC Packaging Technologies for Chiplets and 3D_0819 publish_pu...
A contest of sentiment analysis: k-nearest neighbor versus neural network
Zenith AI: Advanced Artificial Intelligence
Hindi spoken digit analysis for native and non-native speakers
observCloud-Native Containerability and monitoring.pptx
NewMind AI Weekly Chronicles – August ’25 Week III
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
Developing a website for English-speaking practice to English as a foreign la...
A novel scalable deep ensemble learning framework for big data classification...
Getting started with AI Agents and Multi-Agent Systems
project resource management chapter-09.pdf
Assigned Numbers - 2025 - Bluetooth® Document
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
O2C Customer Invoices to Receipt V15A.pptx

44CON Hacking Enterprises

  • 2. grep ‘in.security’ /etc/groups A cyber security consultancy offering specialist technical and training services Technical • Vulnerability Assessments • Penetration Testing • Red Team Engagements • Social Engineering Engagements • Wireless Security Assessments • Password Audits • Build Reviews • Firewall Reviews © in.security Ltd 2019, all rights reserved
  • 3. $whoami /all Will Hunt • Co-founder of in.security • 10+ years in cyber • Assists UK Government • Hacker, formerly digital forensics • Trained at various conferences including Black Hat USA/EU • @Stealthsploit • https://stealthsploit.com © in.security Ltd 2019, all rights reserved
  • 4. $whoami /all Owen Shearing • Co-founder of in.security • 14+ years in technical roles • Trained at various bespoke events and conferences including Black Hat Asia, USA and EU • CREST CCT • @rebootuser • https://rebootuser.com / https://github.com/rebootuser © in.security Ltd 2019, all rights reserved
  • 5. The LAB The LAB • The MGT network hosts LAB resources for all students to access, including: • Phishing Platform (Gophish) • ELK Stack • CTF Platform • Kali network (attackers) – this is you! • The Dev network - routable from attackers subnet • Two undiscovered, firewalled subnets! + a third subnet unlocked after training completes! © in.security Ltd 2019, all rights reserved MGT Dev Attackers
  • 6. © in.security Ltd 2019, all rights reserved Topics… © in.security Ltd 2019, all rights reserved MGT A:ackers Dev OSINT techniques IPv4 / IPv6 discovery & enumeration Automated vulnerability scanning Introduction into exploitation frameworks & Mobile devices Linux enumeration, shells, privilege escalation & post exploitation P@ssw0rd cracking (Linux) Windows enumeration Creating & executing a phishing campaign P@ssw0rd cracking (Windows) Windows shells, privilege escalation, post exploitation & info gathering Defensive monitoring Restricted environment breakouts Pivoting and lateral movement Identifying further targets Database/application enumeration & exploitation Domain/trust compromise Persistence & exfiltration
  • 7. Our 45min Pwnage Plan… Phish > Kibana > Phish#2 > Enumeration > Exfiltration > Password Cr@cK5 > SOCKS Proxies > OOB Persistence! © in.security Ltd 2019, all rights reserved
  • 8. Our 45min Pwnage Plan… Phish > Kibana > Phish#2 > Enumeration > Exfiltration > Password Cr@cK5 > SOCKS Proxies > OOB Persistence! © in.security Ltd 2019, all rights reserved
  • 9. Phishing – Delivery & Payloads Delivery Examples • Email, generic ‘campaign’ or targeted attack (spear phishing) • SMS (Smishing) / Voice (Vishing) • Web based (malicious/hacked website) • Malvertising Payload Examples • Data collection via hosted forms (credentials, personal/sensitive information, payment details) • Spoofing and/or content injection targeting legitimate websites • Embedded code in attached Office documents (Macros, DDE) • Exploiting vulnerabilities in client-side software (Flash, Acrobat, Java) © in.security Ltd 2019, all rights reserved
  • 10. Gophish – Users & Groups Using Gophish for a phishing campaign: • Targets (Users & Groups tab) • Email template • Landing page • Sending Profile https://docs.getgophish.com/user-guide © in.security Ltd 2019, all rights reserved
  • 11. Phishing – HTA Files • HTML application • Launched by mshta.exe on Windows “In short, HTAs pack all the power of Internet Explorer - its object model, performance, rendering power and protocol support - without enforcing the strict security model and user interface of the browser” https://docs.microsoft.com/en-us/previous-versions//ms536496(v=vs.85) • A nice overview of HTA/command execution https://9to5it.com/using-html-applications-as-a-powershell-gui/ © in.security Ltd 2019, all rights reserved
  • 12. Phishing – HTA Files <script language="VBScript"> window.moveTo -4000, -4000 cmd = "powershell.exe -c Test-Connection 10.133.251.10" Set runme = CreateObject("Wscript.Shell") result = runme.Run(cmd, 0, true) window.close() </script> • Cmd – command we are executing • 0 – set to hidden • True - wait for command to complete before continuing © in.security Ltd 2019, all rights reserved
  • 13. Our 45min Pwnage Plan… <DEMO> © in.security Ltd 2019, all rights reserved [Phishing]
  • 14. Our 45min Pwnage Plan… Phish > Kibana > Phish#2 > Enumeration > Exfiltration > Password Cr@cK5 > SOCKS Proxies > OOB Persistence! © in.security Ltd 2019, all rights reserved
  • 15. Monitoring & Alerting • Elasticsearch Logstash Kibanna (ELK) https://www.elastic.co/products © in.security Ltd 2019, all rights reserved Kibana - a web-based frontend to allow real-time, visual analysis of collected data in Elasticsearch Elasticsearch – based on Apache Lucene, a NoSQL (JSON based/document store model) database Logstash – a tool to intake, process and output log data from various sources
  • 16. Monitoring & Alerting • Elasticsearch Logstash Kibanna (ELK) https://www.elastic.co/products © in.security Ltd 2019, all rights reserved Kibana - a web-based frontend to allow real-time, visual analysis of collected data in Elasticsearch Elasticsearch – based on Apache Lucene, a NoSQL (JSON based/document store model) database Logstash – a tool to intake, process and output log data from various sources
  • 17. Monitoring & Alerting • Elasticsearch Logstash Kibanna (ELK) https://www.elastic.co/products © in.security Ltd 2019, all rights reserved Kibana - a web-based frontend to allow real-time, visual analysis of collected data in Elasticsearch Elasticsearch – based on Apache Lucene, a NoSQL (JSON based/document store model) database Logstash – a tool to intake, process and output log data from various sources
  • 18. Sysmon • Part of the Sysinternals suite https://docs.microsoft.com/en-gb/sysinternals/downloads/sysmon • A configuration file can be supplied (-i) containing the desired rules • A great template config from @SwiftOnSecurity https://github.com/SwiftOnSecurity/sysmon-config © in.security Ltd 2019, all rights reserved
  • 19. A/V & AMSI • So, why did our initial phish with msfvenom generated HTA fail? …. • Well, this would be due to Windows Defender/Antimalware Scan Interface © in.security Ltd 2019, all rights reserved
  • 20. Our 45min Pwnage Plan… DEMO… © in.security Ltd 2019, all rights reserved [Monitoring]
  • 21. Our 45min Pwnage Plan… Phish > Kibana > Phish#2 > Enumeration > Exfiltration > Password Cr@cK5 > SOCKS Proxies > OOB Persistence! © in.security Ltd 2019, all rights reserved
  • 22. Unicorn • Created by TrustedSec / https://github.com/trustedsec/unicorn • Simple to use, well documented and regularly updated with new techniques/evasion methods • A number of payloads rely on a msf handler listening on the attacking system (all required configs are generated by the tool) © in.security Ltd 2019, all rights reserved
  • 23. Our 45min Pwnage Plan… DEMO… © in.security Ltd 2019, all rights reserved [Phishing #2]
  • 24. Our 45min Pwnage Plan… Phish > Kibana > Phish#2 > Enumeration > Exfiltration > Password Cr@cK5 > SOCKS Proxies > OOB Persistence! © in.security Ltd 2019, all rights reserved
  • 25. Information Gathering Some questions we’re going to be asking ourselves • What permissions does the compromised account hold? © in.security Ltd 2019, all rights reserved
  • 26. Information Gathering Some questions we’re going to be asking ourselves • What permissions does the compromised account hold? • Do we have access to any users with interesting group memberships or delegated rights within the domain? © in.security Ltd 2019, all rights reserved
  • 27. Information Gathering Some questions we’re going to be asking ourselves • What permissions does the compromised account hold? • Do we have access to any users with interesting group memberships or delegated rights within the domain? • What systems/networks does the compromised host have access to? © in.security Ltd 2019, all rights reserved
  • 28. Information Gathering Some questions we’re going to be asking ourselves • What permissions does the compromised account hold? • Do we have access to any users with interesting group memberships or delegated rights within the domain? • What systems/networks does the compromised host have access to? • [… • …] • What systems are deemed to hold important/sensitive data? © in.security Ltd 2019, all rights reserved
  • 29. Information Gathering PowerView • Part of the PowerSploit package https://github.com/PowerShellMafia/PowerSploit/tree/master/Recon OR, for the latest version 3 (development) version https://github.com/PowerShellMafia/PowerSploit/blob/dev/Recon/PowerView.ps1 • PowerShell script that provides numerous functions for situational awareness and domain enumeration • A great ‘cheatsheet’ on functions and usage by @harmj0y https://gist.github.com/HarmJ0y/184f9822b195c52dd50c379ed3117993 • Functions include: Get-DomainUser, Get-DomainGroup, Get-DomainGroupMember Get-NetDomain, Get-DomainPolicy, Get-DomainTrust, Get-DomainComputer, Find-DomainShare + LOADS more © in.security Ltd 2019, all rights reserved
  • 30. Our 45min Pwnage Plan… DEMO… © in.security Ltd 2019, all rights reserved [Enumeration]
  • 31. Our 45min Pwnage Plan… Phish > Kibana > Phish#2 > Enumeration > Exfiltration > Password Cr@cK5 > SOCKS Proxies > OOB Persistence! © in.security Ltd 2019, all rights reserved
  • 32. Password Managers - KeePass © in.security Ltd 2019, all rights reserved • Password managers/vaults are often used to store privileged credentials and information • KeePass uses .kdb files (v1) and .kdbx files (v2) to store the database • We can’t just give the file to a password cracker so we need to extract the hash • keepass2john can do this and it comes shipped with Kali • We could then either install KeePass and load the database, or access directly over the command line using a tool like kpcli
  • 33. How Can We Exfil The DataZ? © in.security Ltd 2019, all rights reserved Transferring files using PowerShell $FileName = “<target_file>” $base64string = [Convert]::ToBase64String([IO.File]::ReadAllBytes($FileName)) ReadAllBytes – Opens a binary file, reads the contents into a byte array and closes the file* * https://docs.microsoft.com/en-us/dotnet/api/system.io.file.readallbytes
  • 34. Our 45min Pwnage Plan… DEMO… © in.security Ltd 2019, all rights reserved [Exfiltration]
  • 35. Our 45min Pwnage Plan… Phish > Kibana > Phish#2 > Enumeration > Exfiltration > Password Cr@cK5 > SOCKS Proxies > OOB Persistence! © in.security Ltd 2019, all rights reserved
  • 36. Offline Password Cracking Success depends on a number of factors • Algorithm complexity • Password length / complexity • Hardware (GPU/FPGA/ASIC) Password cracking process • Hash the clear text candidate • Compare to stolen hash • No match? Start again • Match = Win! © in.security Ltd 2019, all rights reserved
  • 37. Brute Force Attack © in.security Ltd 2019, all rights reserved • Try every possible combination of every character • Not used 99% of the time… Pros • 100% GUARANTEED to crack Cons • You likely won’t be around to see it happen!
  • 38. Brute Force Attack • Key space = char set ^ length • 8x NVIDIA GTX 1080 Ti GPUs - Windows passwords @ 513 GH/s* (full 95 char set) • 8 char NTLM = 3.5 hours • 9 char NTLM = 14 days • 10 char NTLM = 3.7 years • 11 char NTLM = 351 years • 12 char NTLM = 33,401 years • 13 char NTLM = 3.2 million years © in.security Ltd 2019, all rights reserved *h:ps://gist.github.com/epixoip/ace60d09981be09544fdd35005051505
  • 39. Dictionary Attack © in.security Ltd 2019, all rights reserved Wordlist Rules insecurity Insecurity Password 1nsecurity monkey ins3curity! 1234567 Ins3cur1ty Qwerty in53cur!ty letmein • Wordlist contains password candidates • Most commonly used • Can be mangled with rules Pros • Wordlists contain common passwords • Mangling addresses the human element Cons • Only as good as your dictionary/rules
  • 40. Our 45min Pwnage Plan… DEMO… © in.security Ltd 2019, all rights reserved [Cracking]
  • 41. Our 45min Pwnage Plan… Phish > Kibana > Phish#2 > Enumeration > Exfiltration > Password Cr@cK5 > SOCKS Proxies > OOB Persistence! © in.security Ltd 2019, all rights reserved
  • 42. Routing in Metasploit • Traffic to target networks can be routed over existing sessions… • To add a route route add <$network> <$mask> <$sessionID> © in.security Ltd 2019, all rights reserved
  • 43. SOCKS Proxies • A server that can establish a connection to a destination on behalf of a client • Metasploit SOCKS modules auxiliary/server/socks4a auxiliary/server/socks5 ”This module provides a socksx proxy server that uses the built-in Metasploit routing to relay connections” * • This functionality allows programs external to Metasploit, to utilise configured routes within msf and gain access to the target system(s)/network(s) …with the help of proxychains © in.security Ltd 2019, all rights reserved
  • 44. SOCKS Proxies & Proxychains • Proxychains / http://proxychains.sourceforge.net • Allows/supports TCP (not UDP - with the exception of DNS) • Used to allow *any program to run through a SOCKS proxy • Configuration file @ /etc/proxychains.conf • Then run a program through the proxy! proxychains smbclient -W insec-xxxx.local //10.133.50.xxx/<$fileshare> -U <$targetUser>%<$password> © in.security Ltd 2019, all rights reserved
  • 45. Our 45min Pwnage Plan… DEMO… © in.security Ltd 2019, all rights reserved [SOCKS & Shellz]
  • 46. Our 45min Pwnage Plan… Phish > Kibana > Phish#2 > Enumeration > Exfiltration > Password Cr@cK5 > SOCKS Proxies > OOB Persistence! © in.security Ltd 2019, all rights reserved
  • 47. Hiding Data • Alternate Data Streams (ADS) allow one file system entry to contain multiple data sets (NTFS only) • Original file is always the ‘main’ stream, additional streams are appended to filename and are colon delimited File.txt File.txt:secretdata.txt:$DATA File.txt:shell.exe:$DATA • One option to trigger – wmic process call create File.txt:shell.exe • A nice article by Oddvar Moe on executing files from ADS https://oddvar.moe/2018/01/14/putting-data-in-alternate-data-streams-and-how-to-execute-it/ © in.security Ltd 2019, all rights reserved
  • 48. Exfiltrating Data Over ICMP © in.security Ltd 2019, all rights reserved • ICMP doesn’t use ports (types) and is often left enabled, forgotten and not monitored • Overcomes network egress issues when usual channels are blocked • icmpsh is a reverse ICMP shell (https://github.com/inquisb/icmpsh) • Server works in C, Perl, Python • Client is Win32 • We have to disable ICMP replies from the attacking host and then start the ICMP server sysctl -w net.ipv4.icmp_echo_ignore_all=1
  • 49. Our 45min-ish Pwnage Plan… DEMO… © in.security Ltd 2019, all rights reserved [ADS & OOB ICMP… If time persists!]
  • 50. Our 45min Pwnage Plan… Phish Kibana Phish#2 Enumeration Exfiltration Password Cr@cK5 SOCKS Proxies OOB Persistence © in.security Ltd 2019, all rights reserved
  • 51. Our 45min Pwnage Plan… </DEMO> © in.security Ltd 2019, all rights reserved
  • 52. Much, Much More… © in.security Ltd 2019, all rights reserved June 6th/7th @44CON h9ps://44con.com/44con-training/hacking-enterprises-exploiCng-insecurity/