2000#2012%military%spending%increases%...step 1: remove the hash " first, ensure the local host...

51

Upload: others

Post on 02-Jan-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 2000#2012%military%spending%increases%...Step 1: Remove the hash " First, ensure the local host is ripe enough and has the residue necessary to extract NTLM hashes " Using the edge
Page 2: 2000#2012%military%spending%increases%...Step 1: Remove the hash " First, ensure the local host is ripe enough and has the residue necessary to extract NTLM hashes " Using the edge

2000-­‐2012  military  spending  increases  

1.7  X  

2.8  X  

4.5  X  

Data  courtesy  of  SIPRI:  h3p://www.sipri.org/   2  

Page 3: 2000#2012%military%spending%increases%...Step 1: Remove the hash " First, ensure the local host is ripe enough and has the residue necessary to extract NTLM hashes " Using the edge

Which  of  the  following  is  a  more  cost-­‐effec@ve  intelligence  collec@on  plaBorm?  

3  

Page 4: 2000#2012%military%spending%increases%...Step 1: Remove the hash " First, ensure the local host is ripe enough and has the residue necessary to extract NTLM hashes " Using the edge

4  

Page 5: 2000#2012%military%spending%increases%...Step 1: Remove the hash " First, ensure the local host is ripe enough and has the residue necessary to extract NTLM hashes " Using the edge

OR  

5  

Page 6: 2000#2012%military%spending%increases%...Step 1: Remove the hash " First, ensure the local host is ripe enough and has the residue necessary to extract NTLM hashes " Using the edge

Photo  courtesy  of  mac_ivan  under  CC  license   6  

Page 7: 2000#2012%military%spending%increases%...Step 1: Remove the hash " First, ensure the local host is ripe enough and has the residue necessary to extract NTLM hashes " Using the edge

Superpower  status                                                                                                        is  not  a  prerequisite  to  {collect/disseminate}                                                      

intelligence  anymore  

7  

Page 8: 2000#2012%military%spending%increases%...Step 1: Remove the hash " First, ensure the local host is ripe enough and has the residue necessary to extract NTLM hashes " Using the edge

8  

Page 9: 2000#2012%military%spending%increases%...Step 1: Remove the hash " First, ensure the local host is ripe enough and has the residue necessary to extract NTLM hashes " Using the edge

This  means  you  probably  have  someone  in  your  network  that  can  maneuver  around  as  well  

as  you  can.  

9  

Page 10: 2000#2012%military%spending%increases%...Step 1: Remove the hash " First, ensure the local host is ripe enough and has the residue necessary to extract NTLM hashes " Using the edge

My  background  in  incident  response  gave  me  visibility  into  tac@cs  and  techniques  used  by  

sophis@cated  adversaries.  

10  

Page 11: 2000#2012%military%spending%increases%...Step 1: Remove the hash " First, ensure the local host is ripe enough and has the residue necessary to extract NTLM hashes " Using the edge

11  

Page 12: 2000#2012%military%spending%increases%...Step 1: Remove the hash " First, ensure the local host is ripe enough and has the residue necessary to extract NTLM hashes " Using the edge

I  also  write  a  lot  of  code.  

12  

Page 13: 2000#2012%military%spending%increases%...Step 1: Remove the hash " First, ensure the local host is ripe enough and has the residue necessary to extract NTLM hashes " Using the edge

13  

Page 14: 2000#2012%military%spending%increases%...Step 1: Remove the hash " First, ensure the local host is ripe enough and has the residue necessary to extract NTLM hashes " Using the edge

So  here  I’m  going  to  present  you  with…  

14  

Page 15: 2000#2012%military%spending%increases%...Step 1: Remove the hash " First, ensure the local host is ripe enough and has the residue necessary to extract NTLM hashes " Using the edge

3 Rogue techniques to sniff out the nasties in

your network

15  

Page 16: 2000#2012%military%spending%increases%...Step 1: Remove the hash " First, ensure the local host is ripe enough and has the residue necessary to extract NTLM hashes " Using the edge

Rogue Technique #1

• Trojanize your DOS/Win32 shell

16  

Page 17: 2000#2012%military%spending%increases%...Step 1: Remove the hash " First, ensure the local host is ripe enough and has the residue necessary to extract NTLM hashes " Using the edge

In  our  case,  threat  actors  were  heavy  command-­‐line  users  –  using  the  net  

executable  to  mount  shares  and  propagate  malicious  payloads  

17  

Page 18: 2000#2012%military%spending%increases%...Step 1: Remove the hash " First, ensure the local host is ripe enough and has the residue necessary to extract NTLM hashes " Using the edge

We  trojanized  the  shell  •  Placed  a  net.com  binary  in  the  system32  folder  (runs  1st)  

•  Our  version  beaconed  out  to  a  Google  App  Engine  service  that  logged  the  ac@vity  and  ran  the  original  u@lity  as  intended  

•  Transparent  to  the  aaackers  

Google  App  Engine  

The  Enterprise  

net.exe  

net.com  

18  

Page 19: 2000#2012%military%spending%increases%...Step 1: Remove the hash " First, ensure the local host is ripe enough and has the residue necessary to extract NTLM hashes " Using the edge

§  This  gave  us  a  subtle,  last-­‐ditch  warning  if  a  compromise  was  not  caught  by  our  other  sensors  

§  Very  simple  wrapper  makes  outbound  HTTP  calls  (interes@ngly,  not  flagged  by  enterprise  A/V  either)  

Code  available  at:            haps://github.com/RogueNetworks  

19  

Page 20: 2000#2012%military%spending%increases%...Step 1: Remove the hash " First, ensure the local host is ripe enough and has the residue necessary to extract NTLM hashes " Using the edge

In  case  you’re  wondering,    this  is  supposed  to  be    Socrates,  not  God  

*  Any  similarity  between  this  Socrates  clip-­‐art  and  Jesus  is  purely  coincidental  20  

Page 21: 2000#2012%military%spending%increases%...Step 1: Remove the hash " First, ensure the local host is ripe enough and has the residue necessary to extract NTLM hashes " Using the edge

In  case  you’re  wondering,    this  is  supposed  to  be    Socrates,  not  God  

*  Any  similarity  between  this  Socrates  clip-­‐art  and  Jesus  is  purely  coincidental  21  

Page 22: 2000#2012%military%spending%increases%...Step 1: Remove the hash " First, ensure the local host is ripe enough and has the residue necessary to extract NTLM hashes " Using the edge

The  propaga@on  of  malicious  payloads  also  depends  on  weaknesses  in  Ac@ve  Directory  

authen@ca@on    

22  

Page 23: 2000#2012%military%spending%increases%...Step 1: Remove the hash " First, ensure the local host is ripe enough and has the residue necessary to extract NTLM hashes " Using the edge

The  use  of  NTLM  hash-­‐injec@on  tools  allow  seamless  +  na@ve  file/share  access  as  any  

domain  (or  local)  user    

23  

Page 24: 2000#2012%military%spending%increases%...Step 1: Remove the hash " First, ensure the local host is ripe enough and has the residue necessary to extract NTLM hashes " Using the edge

What  is  PTH?  

24  

Page 25: 2000#2012%military%spending%increases%...Step 1: Remove the hash " First, ensure the local host is ripe enough and has the residue necessary to extract NTLM hashes " Using the edge

Chef Monte’s World-Famous Recipe for�

Pass-the-Hash�Delicious  and  low-­‐calorie,  too!  

25  

Page 26: 2000#2012%military%spending%increases%...Step 1: Remove the hash " First, ensure the local host is ripe enough and has the residue necessary to extract NTLM hashes " Using the edge

Ingredients�

ü  1 Microsoft Active Directory Network �

ü  1-3 servings of domain �admin hashes, unsalted�

ü  1 teaspoon of lemon zest �

ü  1 hash-injection tool�26  

Page 27: 2000#2012%military%spending%increases%...Step 1: Remove the hash " First, ensure the local host is ripe enough and has the residue necessary to extract NTLM hashes " Using the edge

Step 1: Remove the hash�

ü First, ensure the local host is ripe enough and has the residue necessary to extract NTLM hashes �

ü Using the edge of a bowl, crack open the LSASS process to extract cached or in-memory hashes to produce your hashes �

27  

Page 28: 2000#2012%military%spending%increases%...Step 1: Remove the hash " First, ensure the local host is ripe enough and has the residue necessary to extract NTLM hashes " Using the edge

Step 2: Inject the hash�

ü After allowing the hashes to rest, prepare the NTLM hash using your injection tool of choice (console recommended)�

ü Then, carefully whisk the extracted hash into memory to replace the in-memory NTLM hash with the desired hash of your choice�

28  

Page 29: 2000#2012%military%spending%increases%...Step 1: Remove the hash " First, ensure the local host is ripe enough and has the residue necessary to extract NTLM hashes " Using the edge

Step 3: Enjoy! �

ü Congratulations, you are now able to access resources and generate Kerberos tickets as any domain user! �

ü Remember to wash your hands when done! �

29  

Page 30: 2000#2012%military%spending%increases%...Step 1: Remove the hash " First, ensure the local host is ripe enough and has the residue necessary to extract NTLM hashes " Using the edge

Chef Monte Says: �

Remember  to  try  my  spam  loaf  recipe!!  

30  

Page 31: 2000#2012%military%spending%increases%...Step 1: Remove the hash " First, ensure the local host is ripe enough and has the residue necessary to extract NTLM hashes " Using the edge

While  this  problem  has  persisted  for  years,  it  is  possible  to  detect  and  iden@fy  the  

characteris@cs  associated  with  this  technique  

31  

Page 32: 2000#2012%military%spending%increases%...Step 1: Remove the hash " First, ensure the local host is ripe enough and has the residue necessary to extract NTLM hashes " Using the edge

Rogue Technique #2

• Turn pass-the-hash into Trash-the-hash

32  

Page 33: 2000#2012%military%spending%increases%...Step 1: Remove the hash " First, ensure the local host is ripe enough and has the residue necessary to extract NTLM hashes " Using the edge

Lateral  authen@ca@on  looks  odd:  

33  

Page 34: 2000#2012%military%spending%increases%...Step 1: Remove the hash " First, ensure the local host is ripe enough and has the residue necessary to extract NTLM hashes " Using the edge

The {code}

•  Breachbox core: a suite of Linux daemons for monitoring Kerberos authentication traffic in the core

34  

Page 35: 2000#2012%military%spending%increases%...Step 1: Remove the hash " First, ensure the local host is ripe enough and has the residue necessary to extract NTLM hashes " Using the edge

Features

•  Flexible deployment: can be deployed via span port or in-line layer-2 for extra stealth

•  Zero-trust certified*: Rebuilds authentication transactions from the wire, not from log data

•  Plays well with log management: Send alerts to enterprise log platforms via Syslog interface

35  

Page 36: 2000#2012%military%spending%increases%...Step 1: Remove the hash " First, ensure the local host is ripe enough and has the residue necessary to extract NTLM hashes " Using the edge

Caveats

•  Doesn’t completely support newest SMB protocols

•  Protocol analyzer code is scary

36  

Page 37: 2000#2012%military%spending%increases%...Step 1: Remove the hash " First, ensure the local host is ripe enough and has the residue necessary to extract NTLM hashes " Using the edge

The {code}

Code  available  at:            haps://github.com/RogueNetworks  

37  

Page 38: 2000#2012%military%spending%increases%...Step 1: Remove the hash " First, ensure the local host is ripe enough and has the residue necessary to extract NTLM hashes " Using the edge

Rogue Technique #3

• Profile your applications

38  

Page 39: 2000#2012%military%spending%increases%...Step 1: Remove the hash " First, ensure the local host is ripe enough and has the residue necessary to extract NTLM hashes " Using the edge

Good  Blacklist  malicious  ac@vity  

Beaer  Whitelist  acceptable  ac@vity  

Best  Use  math  +  lists!  

39  

Page 40: 2000#2012%military%spending%increases%...Step 1: Remove the hash " First, ensure the local host is ripe enough and has the residue necessary to extract NTLM hashes " Using the edge

40  

Math  is  powerful  

Holy  moley  –  is  that  an  A-­‐bomb  right  outside  Vegas?  

It  sure  is,  Pardner!  

Page 41: 2000#2012%military%spending%increases%...Step 1: Remove the hash " First, ensure the local host is ripe enough and has the residue necessary to extract NTLM hashes " Using the edge

41  

Math  lets  you  soar  to  new  heights  

Page 42: 2000#2012%military%spending%increases%...Step 1: Remove the hash " First, ensure the local host is ripe enough and has the residue necessary to extract NTLM hashes " Using the edge

Many  spam-­‐detec@on  systems  work  this  way.    They  use  Bayesian  sta@s@cs  to  flag  

anomalies.  

42  

Page 43: 2000#2012%military%spending%increases%...Step 1: Remove the hash " First, ensure the local host is ripe enough and has the residue necessary to extract NTLM hashes " Using the edge

How  email  looks  in  a  Bayesian  world  

43  

Page 44: 2000#2012%military%spending%increases%...Step 1: Remove the hash " First, ensure the local host is ripe enough and has the residue necessary to extract NTLM hashes " Using the edge

Eric:  

Thanks  for  the  note.    Did  you  see  the  ar@cle  about  how  Walmart’s  employees  slammed  the  company  on  its  own  website?  

Later,  

-­‐Skinner  

44  

Page 45: 2000#2012%military%spending%increases%...Step 1: Remove the hash " First, ensure the local host is ripe enough and has the residue necessary to extract NTLM hashes " Using the edge

Whatever  your  illness  or  disorder  is  it’s  beaer  to  be  sure  of  the  medica@ons  you  take!    Cialis,  Viagra,  Prozac…  

45  

Page 46: 2000#2012%military%spending%increases%...Step 1: Remove the hash " First, ensure the local host is ripe enough and has the residue necessary to extract NTLM hashes " Using the edge

We  can  apply  the  same  approach  to  web  traffic.  

46  

Page 47: 2000#2012%military%spending%increases%...Step 1: Remove the hash " First, ensure the local host is ripe enough and has the residue necessary to extract NTLM hashes " Using the edge

hap://www.spotkick.com/api/push?c=breachbox&@d=1234567&ctype=3  

hap://www.spotkick.com/api/push?c=spotkick&@d=7654321&ctype=2  

Profile  for  push  api  service  call:  c:  alphanumeric,  9+-­‐2  characters  Jd:  numeric,  7+-­‐1  characters    ctype:  numeric,  1+-­‐1  characters  

47  

Page 48: 2000#2012%military%spending%increases%...Step 1: Remove the hash " First, ensure the local host is ripe enough and has the residue necessary to extract NTLM hashes " Using the edge

hap://www.spotkick.com/api/push?c=breachbox&@d=1234567’%20or%201=1&ctype=3  

Profile  for  push  api  service  call:  c  expects:  alphanumeric,  9+-­‐2  character        received:  alphanumeric,  9  characters  (PASS)  Ctype  expects:  numeric,  1+-­‐1  characters        received:  numeric,  1  character  (PASS)  @d:  numeric,  7+-­‐1  characters        received:  alphanumeric  +  control  characters,  14  characters  (FAIL)  

48  

Page 49: 2000#2012%military%spending%increases%...Step 1: Remove the hash " First, ensure the local host is ripe enough and has the residue necessary to extract NTLM hashes " Using the edge

The {code}

•  Breachbox web: a suite of Linux daemons for monitoring HTTP traffic

49  

Page 50: 2000#2012%military%spending%increases%...Step 1: Remove the hash " First, ensure the local host is ripe enough and has the residue necessary to extract NTLM hashes " Using the edge

Features

•  Flexible deployment: can be deployed via span port or in-line layer-2 for extra stealth

•  Hybrid scheme reduces false positives: Statistical can be combined with list-based approaches

50  

Page 51: 2000#2012%military%spending%increases%...Step 1: Remove the hash " First, ensure the local host is ripe enough and has the residue necessary to extract NTLM hashes " Using the edge

51  

[email protected]  www.spotkick.com