attack-driven defense

124
A"ackDriven Defense [email protected] @zanelackey

Upload: zane-lackey

Post on 08-Sep-2014

35.909 views

Category:

Technology


0 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Attack-driven defense

A"ack-­‐Driven  Defense  

   

[email protected]  @zanelackey  

Page 2: Attack-driven defense

Who  am  I?  

•  Director  of  Security  Engineering  @  Etsy  – Lead  AppSec/NetSec/SecEng/RiskEng  teams    

•  Formerly  @  iSEC  Partners  

   

Page 3: Attack-driven defense

This  talk  simply  isn’t  possible  without  a  number  of  people:  

–  Ben  Hughes  –  Brendan  Adamson  –  Corey  Benninger  –  Kai  Zhong  –  Ken  Lee  –  Kyle  Barry  – Marcus  Barczak  – Mike  Arpaia  – Omar  Ahmed    

   

Page 4: Attack-driven defense

Also  a  shout  out  to  secteams  we’ve  enjoyed  collaboraUng  with:    

Facebook/GitHub/Google/Square/Twi"er  

Page 5: Attack-driven defense

 

What  is  Etsy?        

Page 6: Attack-driven defense

     

Page 7: Attack-driven defense

 

Etsy?  Security?  …  Why!?      

Page 8: Attack-driven defense

 Advanced  Persistent  Tapestries    

   

Page 9: Attack-driven defense

     

This  talk  is  about  shiXing  from  historically                un-­‐contextualized  defensive  approaches  

   

Page 10: Attack-driven defense

     

To  building  defenses  around  real  world  a"ack  pa"erns    

   

Page 11: Attack-driven defense

     

Un-­‐contextualized?        

Page 12: Attack-driven defense

Historically  defense  has:      – Focused  on  the  perimeter      – Deployed  security  products  that  don’t  address  real  a"ack  scenarios    

– Treated  vulnerability  enumeraUon  (or  worse,  compliance)  as  “pentesUng”    

Page 13: Attack-driven defense

     

 These  don’t  address  modern  a"ack  behavior        

Page 14: Attack-driven defense

     

What  should  we  be  doing?        

Page 15: Attack-driven defense

Fundamentally  we  have  three  goals:    

1)  Raise  cost  to  a"ackers  

2)  Increase  the  odds  of  detecUng  compromise  

3)  Iterate  defenses  based  on  real  a"ack  pa"erns  

       

Page 16: Attack-driven defense

 Increasing  detecUon  

Page 17: Attack-driven defense

     

Build  your  defenses  from  an  offensive  mindset        

Page 18: Attack-driven defense

Instrument  detecUon  mechanisms  around  key  areas  of  the  a"ack  chain:    •  IniUal  compromise  –  Defensive  rootkidng    

•  Persistence/C2  –  Host  level  –  OrganizaUonal  level  

•  Lateral  Movement  –  Network/systems  discovery    –  InformaUon  discovery  

Page 19: Attack-driven defense

IniUal  compromise  

Page 20: Attack-driven defense

     Rootkit  your  endpoints  before  your  a"ackers  do      

Page 21: Attack-driven defense

   

Focus  on  the  combinaUon  of  system  behaviors  and  commands  executed  

Page 22: Attack-driven defense

   

Specifically,  log  commands  executed  on  endpoints  and  analyze  this  data  

     

Page 23: Attack-driven defense

   

Analyze  the  data  and  build  automaUc  alerUng  from  anomalies    

Page 24: Attack-driven defense

     

Anomalies?    

Page 25: Attack-driven defense

   

From  a  macro  level,  bucket  users  into    technical  vs  non-­‐technical    

Page 26: Attack-driven defense

 Pa"erns  then  break  down  into:      – Anomalous  if  by  a  non-­‐technical  user    – Anomalous  if  by  technical  user    – Always  anomalous    

 

Page 27: Attack-driven defense

Non-­‐Technical  bucket:    –  Alert  off  any  commands  which  show  technical  capabiliUes  

•  It’s  either  an  a"acker  or  your  IT  team    

Technical  bucket:    –  Treat  individual  commands  and  behaviors  as  low  quality  signals  •  Aggregate  commands,  look  for  unique  combinaUons  and  bursts  

Always  anomalous  (both  buckets):    –  Analyze  a"ack  pa"erns  and  idenUfy  commands/behaviors  strongly  indicaUve  of  compromise  •  We’re  looking  at  you,  `uname  -­‐a`    

   

Page 28: Attack-driven defense

Non-­‐Technical  bucket:    –  Alert  off  any  commands  which  show  technical  capabiliUes  

•  It’s  either  an  a"acker  or  your  IT  team    

Technical  bucket:    –  Treat  individual  commands  and  behaviors  as  low  quality  signals  •  Aggregate  commands,  look  for  unique  combinaUons  and  bursts  

Always  anomalous  (both  buckets):    –  Analyze  a"ack  pa"erns  and  idenUfy  commands/behaviors  strongly  indicaUve  of  compromise  •  We’re  looking  at  you,  `uname  -­‐a`    

   

Page 29: Attack-driven defense

Non-­‐Technical  bucket:    –  Alert  off  any  commands  which  show  technical  capabiliUes  

•  It’s  either  an  a"acker  or  your  IT  team    

Technical  bucket:    –  Treat  individual  commands  and  behaviors  as  low  quality  signals  •  Aggregate  commands,  look  for  unique  combinaUons  and  bursts  

Always  anomalous  (both  buckets):    –  Analyze  a"ack  pa"erns  and  idenUfy  commands/behaviors  strongly  indicaUve  of  compromise  •  We’re  looking  at  you,  `uname  -­‐a`    

   

Page 30: Attack-driven defense

Sample  output  of  auditd  execuUon  logging:        header,163,11,execve(2),0,Mon Jul 29 20:31:11 2013, + 373 msec,exec arg,praudit,-l,current,path,/usr/sbin/praudit,path,/usr/sbin/praudit,attribute,100755,root,wheel,16777220,171538,0,subject,zlackey,root,wheel,root,wheel,78044,100005,50331650,0.0.0.0,return,success,0,trailer,163,

Page 31: Attack-driven defense

Persistence    

Page 32: Attack-driven defense

Host  level  persistence:      – Look  for  common  pa"erns  of  persistence  via  programs  executed  on  boot,  kernel  modules  loaded,  etc  

Page 33: Attack-driven defense

Host  level  persistence:      – Look  for  common  pa"erns  of  persistence  via  programs  executed  on  boot,  kernel  modules  loaded,  etc  

– Understand  that  in  pracUce  sophisUcated  persistence  mechanisms  won’t  be  detected    •  Aim  to  detect  the  basics,  and  increase  a"acker  cost  by  forcing  use  of  custom  persistence  mechanisms        

Page 34: Attack-driven defense

   

Shout  out  to  @mimeframe  and  the  FB  secteam  for  their  work  on  BigMac:    

h"p://www.slideshare.net/mimeframe/ruxcon-­‐2012-­‐15195589    

Page 35: Attack-driven defense

   

PresenUng  the  Etsy  version  of  a  host  IDS:    

Page 36: Attack-driven defense

   

PresenUng  the  Etsy  version  of  a  host  IDS:    Tripyarn  

Page 37: Attack-driven defense

   

Tripyarn’s  goal  is  to  alert  off  real  world  pa"erns  of  compromise  and  persistence  

Page 38: Attack-driven defense

   

Lessons  learned  from  detecUng  hosUle  persistence  mechanisms  

Page 39: Attack-driven defense

   

First,  find  the  legiUmate  OS-­‐provided  mechanisms  you’re  interested  in  instrumenUng  

Page 40: Attack-driven defense

   

Treat  addiUons  to/modificaUon  of  these  mechanisms  as  an  event    

Page 41: Attack-driven defense

For  rare  events,  alert  on  every  occurrence  – Low  false  posiUve  cost    

 Ex:    – New  SSH  keys  being  added  to  a  host  – Crontabs  being  created    – etc  

Page 42: Attack-driven defense

   

For  events  that  happen  oXen,  use  data  aggregated  across  the  organizaUon  to  detect  

anomalies  

Page 43: Attack-driven defense

   

 Example:  Kernel  modules  

Page 44: Attack-driven defense

Goal:  Detect  a  malicious  kernel  module  loading  on  an  endpoint      – We  thought  kernel  modules  loading  would  be  fairly  rare  aXer  boot  and  we  could  alert  off  that  alone.  We  were  wildly  wrong.    

– WhitelisUng/blacklisUng  kernel  module  names  wouldn’t  be  effecUve  

–  Instead,  analyze  a  kernel  module  being  loaded  for  organizaUonal  uniqueness    

 

Page 45: Attack-driven defense

Goal:  Detect  a  malicious  kernel  module  loading  on  an  endpoint      – We  thought  kernel  modules  loading  would  be  fairly  rare  aXer  boot  and  we  could  alert  off  that  alone.  We  were  wildly  wrong.    

– WhitelisUng/blacklisUng  kernel  module  names  wouldn’t  be  effecUve  

–  Instead,  analyze  a  kernel  module  being  loaded  for  organizaUonal  uniqueness    

 

Page 46: Attack-driven defense

Goal:  Detect  a  malicious  kernel  module  loading  on  an  endpoint      – We  thought  kernel  modules  loading  would  be  fairly  rare  aXer  boot  and  we  could  alert  off  that  alone.  We  were  wildly  wrong.    

– WhitelisUng/blacklisUng  kernel  module  names  wouldn’t  be  effecUve  

–  Instead,  analyze  a  kernel  module  being  loaded  for  organizaUonal  uniqueness    

 

Page 47: Attack-driven defense

Goal:  Detect  a  malicious  kernel  module  loading  on  an  endpoint      – We  thought  kernel  modules  loading  would  be  fairly  rare  aXer  boot  and  we  could  alert  off  that  alone.  We  were  wildly  wrong.    

– WhitelisUng/blacklisUng  kernel  module  names  wouldn’t  be  effecUve  

–  Instead,  analyze  a  kernel  module  being  loaded  for  organizaUonal  uniqueness    

 

Page 48: Attack-driven defense

   

“Did  module  X  that  just  got  loaded  on  endpoint  Y  get  loaded  on  less  than  N  systems  across  the  

organizaUon  in  the  last  D  days?”    

     

Page 49: Attack-driven defense

   

Use  a"ack  post-­‐exploitaUon  techniques  in  a  defensive  context  by  separaUng  your  objecUves  

from  your  tooling        

Page 50: Attack-driven defense

   

Specifically,  collect  data  on  the  endpoints  and  analyze/alert  from  that  data  on  the  server-­‐side  

   

Page 51: Attack-driven defense

   

When  an  a"acker  discovers  and  analyzes  your  endpoint  security  mechanisms  they  shouldn’t  be  able  to  automaUcally  learn  all  alerts  in  place    

   

Page 52: Attack-driven defense

OrganizaUonal  level  persistence:    –  LegiUmate  remote  access  mechanisms  or  cloud  systems  with  data  desired  by  a"acker    •  Ex:  VPN  and  GMail        

– Use  a  mixed  approach  of  manual  and  automated  anomaly  detecUon  for  these  systems    •  GeneraUng  daily  rollups  of  new  accounts/keys  created  •  AlerUng  off  account  creaUon/modificaUon  at  unusual  Umes,  from  unusual  locaUons,  etc    

   

Page 53: Attack-driven defense

OrganizaUonal  level  persistence:    –  LegiUmate  remote  access  mechanisms  or  cloud  systems  with  data  desired  by  a"acker    •  Ex:  VPN  and  GMail        

– Use  a  mixed  approach  of  manual  and  automated  anomaly  detecUon  for  these  systems    •  GeneraUng  daily  rollups  of  new  accounts/keys  created  •  AlerUng  off  account  creaUon/modificaUon  at  unusual  Umes,  from  unusual  locaUons,  etc    

   

Page 54: Attack-driven defense

   

 Example:  GMail    

   

Page 55: Attack-driven defense

Goal:  Instrument  GMail  to  detect  compromise  of  domain  admin  accounts    –  GMail  provides  logs  of  interesUng  acUons  via  Admin  Audit  API  and  Email  Audit  API  

–  Pull  down  logs  via  these  APIs,  store  them  locally  so  you  have  a  record  of  acUons    

–  Perform  alerUng  on  strong  signals  of  compromise  and  persistence:  •  Signins  from  unusual  locaUons/Umes  •  CreaUon  of  new  admin  level  accounts  •  CreaUon  of  new  mail-­‐forwarding  filters  •  Any  change  to  2FA  sedngs    •  Etc    

Page 56: Attack-driven defense

Goal:  Instrument  GMail  to  detect  compromise  of  domain  admin  accounts    –  GMail  provides  logs  of  interesUng  acUons  via  Admin  Audit  API  and  Email  Audit  API  

–  Pull  down  logs  via  these  APIs,  store  them  locally  so  you  have  a  record  of  acUons    

–  Perform  alerUng  on  strong  signals  of  compromise  and  persistence:  •  Signins  from  unusual  locaUons/Umes  •  CreaUon  of  new  admin  level  accounts  •  CreaUon  of  new  mail-­‐forwarding  filters  •  Any  change  to  2FA  sedngs    •  Etc    

Page 57: Attack-driven defense

Goal:  Instrument  GMail  to  detect  compromise  of  domain  admin  accounts    –  GMail  provides  logs  of  interesUng  acUons  via  Admin  Audit  API  and  Email  Audit  API  

–  Pull  down  logs  via  these  APIs,  store  them  locally  so  you  have  a  record  of  acUons    

–  Perform  alerUng  on  strong  signals  of  compromise  and  persistence:  •  Signins  from  unusual  locaUons/Umes  •  CreaUon  of  new  admin  level  accounts  •  CreaUon  of  new  mail-­‐forwarding  filters  •  Any  change  to  2FA  sedngs    •  Etc    

Page 58: Attack-driven defense
Page 59: Attack-driven defense

Lateral  movement  

Page 60: Attack-driven defense

Focusing  on  two  areas  of  lateral  movement:    1.  Network/systems  discovery    2.  InformaUon  discovery    

     

Page 61: Attack-driven defense

   

Use  endpoint  firewalls  as  a  detecUon  mechanism  (NOT  a  blocking  one)  

   

Page 62: Attack-driven defense

   

Build  alerts  around  services  unused  on  your  network  but  likely  interesUng  to  a"ackers  

   

Page 63: Attack-driven defense

   

By  alerUng  on  (but  not  blocking!)  traffic  you  don’t  immediately  signal  there’s  a  detecUon  

mechanism  in  place      

Page 64: Attack-driven defense

   

Also  endpoint  firewalls  counter  Uming-­‐based  evasions  

Page 65: Attack-driven defense

   

Any  traffic  to  targeted  service,  no  ma"er  how  slow,  causes  alerts  

 

Page 66: Attack-driven defense

InformaUon  Discovery  

Page 67: Attack-driven defense

   What  internal  systems  provide  informaUon  that  

help  an  a"acker  achieve  their  goals?  

Page 68: Attack-driven defense

             -­‐  Wikis              -­‐  Source  control                -­‐  Bug  tracking              -­‐  Etc  

   

Page 69: Attack-driven defense

   Instrument  these  systems  the  way  you  would  

other  high-­‐value  pieces  of  infrastructure    

Page 70: Attack-driven defense

Alert  off  behavioral  anomalies  such  as:  

– Usage  outside  of  normal  hours    •  Your  a"ackers  are  rarely  in  your  Ume  zone  

–  Bursts  of  acUvity    •  Viewing  all  security  Uckets  in  the  bug  tracker  isn’t  even  done  by  the  security  team  

–  Etc  

   

Page 71: Attack-driven defense

Increasing  a"acker  cost  

Page 72: Attack-driven defense

Make  compromise  more  expensive    – We’ll  discuss:  

•  Reducing  trusted  CA  roots  •  Removing  cheap  exploitaUon  vectors    •  Forcing  updates  without  the  force  •  LimiUng  drive-­‐by  exposure    •  PracUcal  goals  for  security  awareness  training    

   

Page 73: Attack-driven defense

How  can  you  reduce  the  likelihood  of  a  DigiNotar-­‐like  MITM  happening  against  your  

organizaUon?    

Page 74: Attack-driven defense

If  you  remove  unused  CAs,  when  one  is  compromised  it  can’t  silently  MITM  your  

endpoints  

Page 75: Attack-driven defense

We  performed  several  months  of  anonymized  traffic  analysis  to  record  what  CAs  were  seen  

during  our  employees  Internet  usage  

Page 76: Attack-driven defense

We  found  less  than  29%  of  SSL  CerUficate  AuthoriUes  trusted  by  our  endpoints  were  

actually  used  

Page 77: Attack-driven defense

21.29%    EQUIFAX  SECURE  CERTIFICATE  AUTHORITY  10.37%    ENTRUST.NET  SECURE  SERVER  CERTIFICATION  AUTHORITY  10.07%    DIGICERT  HIGH  ASSURANCE  EV  ROOT  CA  8.97%      GO  DADDY  CLASS  2  CERTIFICATION  AUTHORITY  7.91%      GEOTRUST  GLOBAL  CA  7.23%      ADDTRUST  EXTERNAL  CA  ROOT  6.48%      HTTP://WWW.VALICERT.COM/  6.04%      GTE  CYBERTRUST  GLOBAL  ROOT  4.45%      VERISIGN  CLASS  3  PUBLIC  PRIMARY  CERTIFICATION  AUTHORITY  -­‐  G5  4.08%      CLASS  3  PUBLIC  PRIMARY  CERTIFICATION  AUTHORITY  3.82%      BALTIMORE  CYBERTRUST  ROOT  3.22%      CLASS  3  PUBLIC  PRIMARY  CERTIFICATION  AUTHORITY  -­‐  G2  1.37%      THAWTE  PRIMARY  ROOT  CA  1.36%      THAWTE  PREMIUM  SERVER  CA  1.33%      ENTRUST.NET  CERTIFICATION  AUTHORITY  (2048)  0.65%      GLOBALSIGN  ROOT  CA    [The  CAs  which  had  <  0.5%  traffic  have  been  edited  out  for  brevity.    More  info  here:  h"p://codeascraX.com/2013/07/16/reducing-­‐the-­‐roots-­‐of-­‐some-­‐evil/]  

Our  raw  results:    

Page 78: Attack-driven defense

 By  removing  only  unused  CAs  you  don’t  teach  

users  to  click  through  SSL  errors    

ConUnue  traffic  analysis,  add/remove  trusted  CAs  as  appropriate  

Page 79: Attack-driven defense

                           in  the  browser  is:  cheap,  reliable,  and  

efficient  (pick  three!)      

 

Page 80: Attack-driven defense

                           in  the  browser  is:  cheap,  reliable,  and  

efficient  (pick  three!)      

                           …for  a"ackers    

 

Page 81: Attack-driven defense
Page 82: Attack-driven defense

What  did  we  learn  when  we  removed  Java  web  plugins  from  the  enterprise?    

Page 83: Attack-driven defense

•  Hardly  any  groups  actually  needed  it    – Network  OperaUons,  for  legacy  networking  equipment    

•  For  them,  we  built  dedicated  Java  jump  boxes      

Page 84: Attack-driven defense

Benefits:    

1.  No  Java  on  any  laptops/desktops  2.  Boxes  with  Java  can’t  hit  Internet  3.  Able  to  frequently  re-­‐image  jump  boxes  4.  Only  a  few  boxes  to  patch    

Page 85: Attack-driven defense

 But…  

 Java  shows  back  up  when  you  apply  Apple  

patches.    

Page 86: Attack-driven defense

 But…  

 Java  shows  back  up  when  you  apply  Apple  

patches.    Remove  it  on  an  ongoing  basis    

   

Page 87: Attack-driven defense

   

Page 88: Attack-driven defense

     

 Browser  updates  

   

Page 89: Attack-driven defense

     

We  wanted  a  less  heavy  handed  approach  to  ensuring  up  to  date  browsers  

   

Page 90: Attack-driven defense

     

Built  browser  detecUon  logic  into  our  internal  SSO  point  

   

Page 91: Attack-driven defense

   

UX  is  key:    Show  in  screenshots  how  quick  it  is  to  update,  

provide  a  bypass  mechanism        

Page 92: Attack-driven defense
Page 93: Attack-driven defense

     

Simply  asking  users  to  update  works  shockingly  well    

   

Page 94: Attack-driven defense

   

Page 95: Attack-driven defense

 Funny  story,  users  will  install  malware  because  

an  ad  popup  told  them  to.    

Page 96: Attack-driven defense

 Funny  story,  users  will  install  malware  because  

an  ad  popup  told  them  to.    O8en.      

 

Page 97: Attack-driven defense

 You  can  almost  enUrely  kill  this  source  of  

compromise  (for  free!)  by  pushing  adblocker  plugins  to  the  organizaUon    

 

Page 98: Attack-driven defense

Security  awareness  training  

Page 99: Attack-driven defense

   

Historically  we’ve  focused  on  reducing  the  number  of  people  who  fall  for  phishing  

Page 100: Attack-driven defense

   

Historically  we’ve  focused  on  reducing  the  number  of  people  who  fall  for  phishing  

This  is  the  wrong  goal  

Page 101: Attack-driven defense

   If  you  go  from  being  36%  on  fire  to  27%  on  fire  

you’re  s;ll  on  fire      

Page 102: Attack-driven defense

 Instead,  focus  on  incenUvizing  users  to:    

     

Page 103: Attack-driven defense

 The  metric  to  track/increase  is  the  likelihood  of  phishing  emails  being  reported  to  security    

 Even  if  36%  sUll  fall  for  phishing,  as  long  as  one  

in  the  group  reports  it  IR  can  begin  

Page 104: Attack-driven defense

XXX  

           

Running  effecUve  a"ack  simulaUons      

Page 105: Attack-driven defense

   

Problems  with  “pentesUng”  are  well  understood  in  the  offensive  community  but  not  as  well  in  

the  defensive  community    

Page 106: Attack-driven defense

   Pentests  typically  result  in  a  list  of  enumerated  known  vulnerabiliUes  to  be  patched,  not  data  on  how  a  real  a"acker  would  operate  against  a  

given  environment    

 

Page 107: Attack-driven defense

 A"ack  simulaUons  should  be  done  to  learn  how  a"ackers  are  likely  to  achieve  goals  against  your  

organizaUon    

NOT  to  show  compromise  is  possible  (spoiler  alert:  it  is.)    

Page 108: Attack-driven defense

   

Use  this  a"ack  data  to  focus  where/how  to  build  detecUon  mechanisms  

Page 109: Attack-driven defense

   

From  an  organizaUonal  side,  a"ack  simulaUons  compliment  vulnerability  enumeraUon/

compliance/etc    

Page 110: Attack-driven defense

   

Vulnerability  enumeraUon/compliance  are  checklists  to  make  sure  you’re  covering  the  

basics    

Page 111: Attack-driven defense

   

But  checklists  aren’t  owning  you,  a"ackers  are  

Page 112: Attack-driven defense

Four  keys  to  effecUve  a"ack  simulaUons:    

–  Goal  oriented  •  “Obtain  domain  admin”,  “read  the  CEOs  email”,  “view  credit  card  data”,  …    

–  Full  organizaUon  in  scope  •  Have  a"ack  team  call  a  contact  if  they’re  about  to  do  something  risky  

–  Simulate  realisUc  compromise  pa"erns    •  Start  the  a"ack  team  on  a  standard  laptop/desktop  endpoint  inside  the  

organizaUon  to  simulate  phishing/clientside  compromise    •  Start  the  a"ack  team  on  a  database  or  web  server  to  simulate  SQL  injecUon/

RCE  •  A"ack  team  should  be  encouraged  to  use  0days  

–  Break  simulaUon  down  into  iteraUons:  •  Don’t  spend  the  full  engagement  Ume  on  only  round  of  tesUng,  once  one  team  

achieve  goal(s),  then  swap  in  new  a"ack  team  to  achieve  the  same  goal(s)    –  Ex:  We  try  to  run  3-­‐4  iteraUons  per  several  week  simulaUon  

Page 113: Attack-driven defense

Four  keys  to  effecUve  a"ack  simulaUons:    

–  Goal  oriented  •  “Obtain  domain  admin”,  “read  the  CEOs  email”,  “view  credit  card  data”,  …    

–  Full  organizaUon  in  scope  •  Have  a"ack  team  call  a  contact  if  they’re  about  to  do  something  risky  

–  Simulate  realisUc  compromise  pa"erns    •  Start  the  a"ack  team  on  a  standard  laptop/desktop  endpoint  inside  the  

organizaUon  to  simulate  phishing/clientside  compromise    •  Start  the  a"ack  team  on  a  database  or  web  server  to  simulate  SQL  injecUon/

RCE  •  A"ack  team  should  be  encouraged  to  use  0days  

–  Break  simulaUon  down  into  iteraUons:  •  Don’t  spend  the  full  engagement  Ume  on  only  round  of  tesUng,  once  one  team  

achieve  goal(s),  then  swap  in  new  a"ack  team  to  achieve  the  same  goal(s)    –  Ex:  We  try  to  run  3-­‐4  iteraUons  per  several  week  simulaUon  

Page 114: Attack-driven defense

Four  keys  to  effecUve  a"ack  simulaUons:    

–  Goal  oriented  •  “Obtain  domain  admin”,  “read  the  CEOs  email”,  “view  credit  card  data”,  …    

–  Full  organizaUon  in  scope  •  Have  a"ack  team  call  a  contact  if  they’re  about  to  do  something  risky  

–  Simulate  realisUc  compromise  pa"erns    •  Start  the  a"ack  team  on  a  standard  laptop/desktop  endpoint  inside  the  

organizaUon  to  simulate  phishing/clientside  compromise    •  Start  the  a"ack  team  on  a  database  or  web  server  to  simulate  SQL  injecUon/

RCE  •  A"ack  team  should  be  encouraged  to  use  0days  throughout  engagement  

–  Break  simulaUon  down  into  iteraUons:  •  Don’t  spend  the  full  engagement  Ume  on  only  round  of  tesUng,  once  one  team  

achieve  goal(s),  then  swap  in  new  a"ack  team  to  achieve  the  same  goal(s)    –  Ex:  We  try  to  run  3-­‐4  iteraUons  per  several  week  simulaUon  

Page 115: Attack-driven defense

Four  keys  to  effecUve  a"ack  simulaUons:    

–  Goal  oriented  •  “Obtain  domain  admin”,  “read  the  CEOs  email”,  “view  credit  card  data”,  …    

–  Full  organizaUon  in  scope  •  Have  a"ack  team  call  a  contact  if  they’re  about  to  do  something  risky  

–  Simulate  realisUc  compromise  pa"erns    •  Start  the  a"ack  team  on  a  standard  laptop/desktop  endpoint  inside  the  

organizaUon  to  simulate  phishing/clientside  compromise    •  Start  the  a"ack  team  on  a  database  or  web  server  to  simulate  SQL  injecUon/

RCE  •  A"ack  team  should  be  encouraged  to  use  0days  throughout  engagement    

–  Break  simulaUon  down  into  iteraUons:  •  Don’t  spend  the  full  engagement  Ume  on  only  round  of  tesUng,  once  one  team  

achieve  goal(s),  then  swap  in  new  a"ack  team  to  achieve  the  same  goal(s)    –  Ex:  We  try  to  run  3-­‐4  iteraUons  per  several  week  simulaUon  

Page 116: Attack-driven defense

   

The  project  output  should  be  a>ack  chains  showing  how  a"ack  team  went  from  A-­‐>B-­‐>C  to  achieve  goals,  what  steps  they  took  and  why    

Page 117: Attack-driven defense

   

Just  as  importantly,  what  steps  they  didn’t  take    

Ex:  “We  didn’t  try  to  find  internal  network  diagrams  on  your  wiki  because  zone  transfers  were  enabled  so  we  could  got  enough  data  about  your  network  from  that”    

   

Page 118: Attack-driven defense

   

Remember,  the  goal  is  to  simulate  realisUc  a"ack  behaviors  and  pa"erns  that  can  be  used  

to  enhance  detecUon  

Page 119: Attack-driven defense

   

In  addiUon,  simulate  varying  a"ack  profiles  from  quick  &  noisy  to  quietly  maintaining  persistence      

Page 120: Attack-driven defense

   

Over  mulUple  iteraUons  learn  what  behaviors  overlap  between  a"ackers  and  what  strong  

signals  of  lateral  movement  in  your  environment  look  like  

 

Page 121: Attack-driven defense

TL;DR  (The  secUon  formerly  known  as  “Conclusions”)    

   

Page 122: Attack-driven defense

Defend  like  an  a"acker      

Page 123: Attack-driven defense

   

Where  should  defense  focus?      –  Increase  a"acker  cost  by  reducing  cheap  compromise  vectors  

–  Build  detecUon  mechanisms  around  real  a"ack  pa"erns  •  Analyze  past  compromises,  new  offensive  research,  and  conduct  realisUc  a"ack  simulaUons  to  obtain  data  –  Depending  on  scale,  have  true  offensive  capabiliUes  on  staff  or  a  call  away  

– Have  product/tooling  development  capabiliUes  within  your  security  team  •  Roughly  one  quarter  of  our  team  is  soXware  engineers  who  focus  on  building  internal  security  products  

Page 124: Attack-driven defense

Thanks!  

[email protected]                  @zanelackey