Taking security a step further Red Team operations ME 2 Geek 20 - - PowerPoint PPT Presentation

taking security a step further
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

Taking security a step further Red Team operations

slide-2
SLIDE 2

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

slide-3
SLIDE 3

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

slide-4
SLIDE 4

Agenda

slide-5
SLIDE 5

5

Introduction

1

Agenda

2 3 4

Why Red Teaming How is a Red Team operation conducted Questions and answers

slide-6
SLIDE 6

Introduction

1

slide-7
SLIDE 7

7

slide-8
SLIDE 8

Taking security a step further Red Team operations

slide-9
SLIDE 9

9

DEFENSIVE OFFENSIVE

slide-10
SLIDE 10

10

DEFENSIVE OFFENSIVE

AV and Firewall vendors Blue Team, sysadmins, etc SIEM, IDS, IPS, etc. Penetration Testing Red Team A lot more fun! :-)

slide-11
SLIDE 11

11

PENETRATION TESTING RED TEAM

slide-12
SLIDE 12

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

slide-13
SLIDE 13

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

slide-14
SLIDE 14

Why Red Teaming?

2

slide-15
SLIDE 15

15

Why performing a Red Team assessment?

slide-16
SLIDE 16

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

slide-17
SLIDE 17

How is a Red Team conducted?

3

slide-18
SLIDE 18

18

slide-19
SLIDE 19

19

slide-20
SLIDE 20

20

INFRASTRUCTURE STAFF

slide-21
SLIDE 21

21

INFRASTRUCTURE STAFF

Identification of security holes Critical issues affecting the perimeter Development systems? UAT? Etc. Misconfigurations, etc. Spear phishing attacks

slide-22
SLIDE 22

22

OUTSIDE INSIDE

slide-23
SLIDE 23

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

slide-24
SLIDE 24

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)

slide-25
SLIDE 25

25

Methodology

Detective work Design an attack Deliver the attack

slide-26
SLIDE 26

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

slide-27
SLIDE 27

27

Infrastructure Reconnaissance

Goal: Get a list of IP addresses / domain to target Google-fu Whois DNS bruteforce SSL certificates review Web crawling, etc.

slide-28
SLIDE 28

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

slide-29
SLIDE 29

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!

slide-30
SLIDE 30

30

Phishing

slide-31
SLIDE 31

31

Phishing - profiling

slide-32
SLIDE 32

32

Phishing - profiling

slide-33
SLIDE 33

33

Phishing payload creation

We have a good understanding of the target Choose the angle of attack AV bypass Communication channels to C2 server

slide-34
SLIDE 34

34

AV evasion

slide-35
SLIDE 35

35

Delivery – office macro

slide-36
SLIDE 36

36

Delivery – Java Applet

slide-37
SLIDE 37

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

slide-38
SLIDE 38

38

Malleable C2 profile

slide-39
SLIDE 39

39

Gaining a network foothold!

slide-40
SLIDE 40

40

Gaining a network foothold!

slide-41
SLIDE 41

41

OUTSIDE INSIDE

slide-42
SLIDE 42

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

slide-43
SLIDE 43

43

Wait! Let’s be safe!

slide-44
SLIDE 44

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)

slide-45
SLIDE 45

45

Persistence - Registry

slide-46
SLIDE 46

46

Persistence – Scheduled tasks

slide-47
SLIDE 47

47

Persistence – WMI

slide-48
SLIDE 48

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

slide-49
SLIDE 49

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

slide-50
SLIDE 50

50

Capturing password hashes

slide-51
SLIDE 51

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

slide-52
SLIDE 52

52

Bloodhound

slide-53
SLIDE 53

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

slide-54
SLIDE 54

54

Lateral movement tactics (continued)

setspn -Q */* (query all SPNs) setspn -L <server/user> (query specific SPN) setspn –L MSSQLSvc

slide-55
SLIDE 55

55

Summary

slide-56
SLIDE 56

56

slide-57
SLIDE 57
slide-58
SLIDE 58

Questions?

4

slide-59
SLIDE 59

rodrigo.marcos@secforce.com

Thank you!