Taking security a step further Red Team operations ME 2 Geek 20 - - PowerPoint PPT Presentation
Taking security a step further Red Team operations ME 2 Geek 20 - - PowerPoint PPT Presentation
Taking security a step further Red Team operations ME 2 Geek 20 year of experience doing hacking Authored tools / articles / books / etc Speaker at conferences around the world Volunteer at OWASP Still getting the same thrill when
2
Geek 20 year of experience doing hacking Authored tools / articles / books / etc Speaker at conferences around the world Volunteer at OWASP Still getting the same thrill when compromising a host CEO at SECFORCE
ME
3
IT Security Consultancy – penetration testing Highly specialised in offensive security Teams located in London (UK) and Malta
SECFORCE
Blockchain security Red Team Testing Penetration Testing Incident Response
Agenda
5
Introduction
1
Agenda
2 3 4
Why Red Teaming How is a Red Team operation conducted Questions and answers
Introduction
1
7
Taking security a step further Red Team operations
9
DEFENSIVE OFFENSIVE
10
DEFENSIVE OFFENSIVE
AV and Firewall vendors Blue Team, sysadmins, etc SIEM, IDS, IPS, etc. Penetration Testing Red Team A lot more fun! :-)
11
PENETRATION TESTING RED TEAM
12
PENETRATION TESTING RED TEAM
Specific target – narrow scope Aiming for full coverage of issues Stealth is not important Assess the security controls such as patch management, password policies, access control, etc Wider scope Stealth attack Assess controls such as incident response, monitoring, network sensors, user security awareness, etc. Sophisticated attacks Longer engagements
13
WHAT IS A RED TEAM OPERATION?
Assessment to identify the resilience of an
- rganisation to highly sophisticated targeted attacks
A team of attackers performs an attack to help the target organisation to identify weaknesses in their defensive mechanisms Some of these exercise may replicate attacks such as: Hacktivists Ransomware attacks State sponsored threat actors
Why Red Teaming?
2
15
Why performing a Red Team assessment?
16
Why performing a Red Team assessment?
How else would an organisation know their resilience? Regulatory compliance Assess security holistically, instead of in isolation Assess user security awareness Train a blue team
How is a Red Team conducted?
3
18
19
20
INFRASTRUCTURE STAFF
21
INFRASTRUCTURE STAFF
Identification of security holes Critical issues affecting the perimeter Development systems? UAT? Etc. Misconfigurations, etc. Spear phishing attacks
22
OUTSIDE INSIDE
23
OUTSIDE INSIDE
External reconnaissance Assessment of the perimeter Identify target users for phishing Goal: Network foothold Network awareness Persistence Understanding the current security controls Identification of misconfigurations Privilege escalation
24
Tools
Cobalt Strike Empire Powershell (Microsoft’s Post-Exploitation Language ;-) ) PowerView, PowerUp, PowerSploit Custom scripts Living off the land WMI WinRM GPO Nmap and Nessus (only for external testing)
25
Methodology
Detective work Design an attack Deliver the attack
26
User Reconnaissance
Look for: emails, departments, files (metadata), user/domain names, password dumps, ex-employees.. Google-fu Social media The harvester Maltego FOCA Threat Intelligence
27
Infrastructure Reconnaissance
Goal: Get a list of IP addresses / domain to target Google-fu Whois DNS bruteforce SSL certificates review Web crawling, etc.
28
Infrastructure Assessment
Goal: Identification of RCE issues such as misconfigured Tomcat, SQLi, SMTP relays, shellshock, hearbleed, etc Nmap (common ports) Nessus Standard penetration testing tools Commonly conducted over VPN
29
Phishing
Recon gave us emails, departments and ideas Profiling Prepare pretexts (domains, mail server, sites, etc) Delivery: Macros or Java usually but others exist (hta, js, sct files) Password protected zip files Payload: Cobalt Strike Beacon Spoofing? SPF + DKIM + mail relays Mail filters? MX records and NDR help!
30
Phishing
31
Phishing - profiling
32
Phishing - profiling
33
Phishing payload creation
We have a good understanding of the target Choose the angle of attack AV bypass Communication channels to C2 server
34
AV evasion
35
Delivery – office macro
36
Delivery – Java Applet
37
Command & Control
HTTP(S) Beacon is proxy aware but some proxies inflict pain :( DNS Beware of command output! Totally legit domains: static-jquery.com, msn-cdn.com, onedrive-live.co.uk Web filtering checks domain reputation based on age, etc Cobalt Strike Malleable C2
38
Malleable C2 profile
39
Gaining a network foothold!
40
Gaining a network foothold!
41
OUTSIDE INSIDE
42
We are in! Now what?
Situational awareness whoami /groups process list + steal_token (explorer.exe) powershell $PSVersionTable.PSVersion net start | findstr -i "protect vir“ systeminfo | find "Boot Time“ echo %temp% & time /t Watch out for network monitoring Only be interactive when you need to sleep 10
43
Wait! Let’s be safe!
44
Persistence
We need to survive reboot Don’t want to phish again Persist on workstations, not servers Typical methods: Registry Scheduled tasks WMI (requires admin) VPN (requires creds)
45
Persistence - Registry
46
Persistence – Scheduled tasks
47
Persistence – WMI
48
Privilege escalation + lateral movement
They go hand in hand Priv esc goals Local Admin -> Domain Admin (of course) Domain User -> Domain User with access to target system Lateral movement goals Our box -> key workstation -> target system Our box -> box that leads to compromise of higher priv user Our box -> box that leads to box that leads to box… General goal: remain undetected
49
Privilege escalation tactics
PowerUp GPP files Clear text passwords in files/scripts/shares Monitor users Inveigh / Responder General misconfigurations Abuse of common practices Users often have a low + high priv account
50
Capturing password hashes
51
Lateral movement tactics
User hunting Find more interesting users Find out where they are logged in Can we log in there? Steal their token/creds Repeat Tools for this include PowerView’s UserHunter Bloodhound
52
Bloodhound
53
Lateral movement tactics (continued)
SMB comms for pivoting Not psexec, use wmic/winrm dir c:\ is often enough to check privs runas /user:domain\user cmd Don’t portscan, query the domain - SPN scanning
54
Lateral movement tactics (continued)
setspn -Q */* (query all SPNs) setspn -L <server/user> (query specific SPN) setspn –L MSSQLSvc
55
Summary
56