95
Assessing BYOD with the Smarthpone Pentest Framework Georgia Weidman

Assessing BYOD with the Smarthpone Pentest Framework

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Assessing BYOD with the Smarthpone Pentest Framework

Assessing  BYOD  with  the  Smarthpone  Pentest  Framework  

Georgia  Weidman  

Page 2: Assessing BYOD with the Smarthpone Pentest Framework
Page 3: Assessing BYOD with the Smarthpone Pentest Framework
Page 4: Assessing BYOD with the Smarthpone Pentest Framework
Page 5: Assessing BYOD with the Smarthpone Pentest Framework
Page 6: Assessing BYOD with the Smarthpone Pentest Framework

BYOD  Is  Not  New  

Contractor Laptop Rogue Access Point Gaming Console

Page 7: Assessing BYOD with the Smarthpone Pentest Framework
Page 8: Assessing BYOD with the Smarthpone Pentest Framework

Tradi>onal  Vulnerability  Scanning  

Page 9: Assessing BYOD with the Smarthpone Pentest Framework

The  iPhone  in  Ques>on  Is…  

Jailbroken    Has  SSH  installed    Has  a  default  password    Is  not  subject  to  any  MDM  restric>ons  

Page 10: Assessing BYOD with the Smarthpone Pentest Framework

The  Ques>on  

     

What  can  we  do  to  assess  the  threat  BYOD  Mobile  devices  add  to  the  enterprise?  

Page 11: Assessing BYOD with the Smarthpone Pentest Framework

Smartphones  in  the  workplace  

l  Access  your  data    l  Store  company  emails    l  Connect  to  VPNs    l  Generate  1  >me  passwords  

Page 12: Assessing BYOD with the Smarthpone Pentest Framework

Threats  against  smartphones:  Apps  

l  Malicious  apps  steal  your  data,  remotely  control  your  phone,  etc.  

 l  Happens  on  all  plaQorms.  Some  easier  than  others.  

 l  If  your  employees  have  a  malicious  angry  birds  add-­‐on  what  is  it  doing  with  your  data?    

Page 13: Assessing BYOD with the Smarthpone Pentest Framework

Threats  against  smartphones:  soUware  bugs  

l  Browsers  have  bugs    l  Apps  have  bugs    l  Kernels  have  bugs    l  Malicious  apps,  webpages,  etc.  can  exploit  these  and  gain  access  to  data  

Page 14: Assessing BYOD with the Smarthpone Pentest Framework

Threats  against  smartphones:  social  engineering    

l  Users  can  be  tricked  into  opening  malicious  links  

 l  Downloading  malicious  apps      

Page 15: Assessing BYOD with the Smarthpone Pentest Framework

Threats  against  smartphones:  jailbreaking  

l  Smartphones  can  be  jailbroken    l  Giving  a  program  expressed  permission  to  exploit  your  phone  

 l  Once  it  is  exploited,  what  else  does  the  jailbreaking  program  do?  

Page 16: Assessing BYOD with the Smarthpone Pentest Framework

Remote  Vulnerability  Example  

Jailbroken  iPhones  all  have  the  same  default  SSH  password  

 How  many  jailbroken  iPhones  have  the  default  SSH  password  (anyone  can  log  in  as  root)?  

 

Page 17: Assessing BYOD with the Smarthpone Pentest Framework

Client  Side  Vulnerability  Example  

Smartphone  browsers,  etc.  are  subject  to  vulnerabili>es    

 If  your  users  surf  to  a  malicious  page  their  browsers  may  be  exploited  

 Are  the  smartphone  browsers  in  your  organiza>on  vulnerable  to  browser  exploits?  

Page 18: Assessing BYOD with the Smarthpone Pentest Framework

Social  Engineering  Vulnerability  Example  

SMS  is  the  new  email  for  spam/phishing  a_acks    “Open  this  website”  “Download  this  app”      Will  your  users  click  on  links  in  text  messages?    Will  they  download  apps  from  3rd  par>es?  

Page 19: Assessing BYOD with the Smarthpone Pentest Framework

Local  Vulnerability  Example  

Smartphones  have  kernel  vulnerabili>es    Used  my  jailbreaks  and  malicious  apps    Are  the  smartphones  in  your  organiza>on  subject  to  local  privilege  escala>on  vulnerabili>es?  

Page 20: Assessing BYOD with the Smarthpone Pentest Framework

Post  exploita>on  

Command  shell  App  based  agent  

Payloads:  informa>on  gathering  local  privilege  escala>on  remote  control      

Page 21: Assessing BYOD with the Smarthpone Pentest Framework

The  Ques>on  

A  client  wants  to  know  if  the  environment  is  secure  

 I  as  a  pentester  am  charged  with  finding  out    There  are  smartphones  in  the  environment    How  to  I  assess  the  threat  of  these  smartphones?  

Page 22: Assessing BYOD with the Smarthpone Pentest Framework

Smartphone  Pentest  Framework  

Wri_en  in  Perl    Post  exploita>on  in  the  languages  of  the  devices    Supported  in  Linux    Included  in  Backtrack  5  R3      

Page 23: Assessing BYOD with the Smarthpone Pentest Framework

What  you  can  test  for  

Remote  vulnerabili>es    Client  side  vulnerabili>es    Social  engineering    Local  vulnerabili>es    

Page 24: Assessing BYOD with the Smarthpone Pentest Framework

Requirements  

Uses  Perl  Expect,  Perl  SerialPort,  and  Perl  DB  connectors    Stores  data  in  a  MYSQL  or  Postgress  database    Serves  malicious  pages  and  payloads  via  web  server    Uses  Android  SDK  to  custom  build  agents  

Page 25: Assessing BYOD with the Smarthpone Pentest Framework

Gegng  SPF  

Open  source      On  github      git  clone  h_ps://github.com/georgiaw/Smartphone-­‐Pentest-­‐Framework.git  

Page 26: Assessing BYOD with the Smarthpone Pentest Framework

Installa>on  

B>nstall  script  will  install  all  Perl  dependencies      Downloads  and  installs  Android  SDK  if  not  already  present    Sets  up  database  

Page 27: Assessing BYOD with the Smarthpone Pentest Framework

Config  File  

<SPF  folder>/frameworkconsole/config    Tells  SPF  what  database  to  use,  etc.      

Page 28: Assessing BYOD with the Smarthpone Pentest Framework
Page 29: Assessing BYOD with the Smarthpone Pentest Framework

Star>ng  SPF  

 <SPF  directory>/frameworkconsole/framework.pl      

Page 30: Assessing BYOD with the Smarthpone Pentest Framework

Star>ng  SPF  

./framework.pl      

Page 31: Assessing BYOD with the Smarthpone Pentest Framework

Mobile  Modems  

To  send  mobile  a_acks  SPF  allows  you  to  use  the  mobile  modems  you  already  own    Smartphone  based  app    USB  modem  a_ached  to  SPF  machine  

Page 32: Assessing BYOD with the Smarthpone Pentest Framework

A_aching  SPF  to  a  USB  mobile  modem  

Sakis3g  script  sets  up  modem  in  Linux    root@bt:~/Desktop#  ./sakis3g  switchonly  Modem  switched  to  1c9e:9603.      

Page 33: Assessing BYOD with the Smarthpone Pentest Framework

A_aching  SPF  to  a  USB  mobile  modem  

spf>4      Choose  a  type  of  modem  to  a_ach  to:  

 1.)  Search  for  a_ached  modem    2.)  A_ach  to  a  smartphone  based  app  

spf>1  USB  Modem  Found  ATZ  OK  Spf>  

Page 34: Assessing BYOD with the Smarthpone Pentest Framework

A_aching  SPF  to  a  USB  mobile  modem  

Searches  for  an  a_ached  modem    Confirms  it  can  communicate  with  the  modem  via  AT  commands    Adds  modem  to  SPF  database  

Page 35: Assessing BYOD with the Smarthpone Pentest Framework
Page 36: Assessing BYOD with the Smarthpone Pentest Framework
Page 37: Assessing BYOD with the Smarthpone Pentest Framework
Page 38: Assessing BYOD with the Smarthpone Pentest Framework

A_aching  SPF  to  a  Phone  mobile  modem  

App  for  Android  1.6  and  above    So  even  burner  phones  will  work  fine    App  hooks  up  to  SPF  and  allows  it  to  use  the  modem      

Page 39: Assessing BYOD with the Smarthpone Pentest Framework
Page 40: Assessing BYOD with the Smarthpone Pentest Framework

A_aching  SPF  to  a  Phone  mobile  modem  

Tell  SPF  the  phone  number  of  the  phone  we  will  use  (for  the  database)    Tell  SPF  the  control  key  (terrible  crypto.  I  should  really  fix  this)    Tell  SPF  the  path  on  the  webserver  we  want  to  use  

Page 41: Assessing BYOD with the Smarthpone Pentest Framework
Page 42: Assessing BYOD with the Smarthpone Pentest Framework

A_aching  SPF  to  a  Phone  mobile  modem  

Install  the  app  on  your  tes>ng  phone    Apk  and  source  are  in  the  FrameworkAndroidApp  folder  in  the  git  repo    Tell  the  app  the  IP  address  to  connect  to,  the  same  key  and  path    

Page 43: Assessing BYOD with the Smarthpone Pentest Framework
Page 44: Assessing BYOD with the Smarthpone Pentest Framework
Page 45: Assessing BYOD with the Smarthpone Pentest Framework

Post  Exploita>on  Agents  

Android  permission  model  based  agent    Android  roo>ng  agent    Android  network  agent  for  insider  threat    

Page 46: Assessing BYOD with the Smarthpone Pentest Framework

Building  Agents  on  the  Fly  

Choose  a  template  (you  can  import  your  own)    Give  SPF  the  informa>on    Mobile  modem  number  for  control    Key      Web  server  path  

Page 47: Assessing BYOD with the Smarthpone Pentest Framework
Page 48: Assessing BYOD with the Smarthpone Pentest Framework
Page 49: Assessing BYOD with the Smarthpone Pentest Framework
Page 50: Assessing BYOD with the Smarthpone Pentest Framework
Page 51: Assessing BYOD with the Smarthpone Pentest Framework
Page 52: Assessing BYOD with the Smarthpone Pentest Framework

Building  Custom  Agents  

Some  templates  included  in  SPF    Can  backdoor  any  app  you  have  source  code  for  with  SPF  agent  func>onality    

Page 53: Assessing BYOD with the Smarthpone Pentest Framework

Network  A_ack  Example  

Test  for  default  SSH  password  on  jailbroken  iPhone    Log  in  and  drop  whatever  you  want    Post  exploita>on  agent,  Meterpreter  

Page 54: Assessing BYOD with the Smarthpone Pentest Framework
Page 55: Assessing BYOD with the Smarthpone Pentest Framework
Page 56: Assessing BYOD with the Smarthpone Pentest Framework
Page 57: Assessing BYOD with the Smarthpone Pentest Framework
Page 58: Assessing BYOD with the Smarthpone Pentest Framework

Client  Side  Example  

Browser  vulnerability      Get  users  to  browse  to  my  page      Get  shell  

Page 59: Assessing BYOD with the Smarthpone Pentest Framework
Page 60: Assessing BYOD with the Smarthpone Pentest Framework
Page 61: Assessing BYOD with the Smarthpone Pentest Framework
Page 62: Assessing BYOD with the Smarthpone Pentest Framework
Page 63: Assessing BYOD with the Smarthpone Pentest Framework
Page 64: Assessing BYOD with the Smarthpone Pentest Framework
Page 65: Assessing BYOD with the Smarthpone Pentest Framework
Page 66: Assessing BYOD with the Smarthpone Pentest Framework

Client  Side  A_ack  #2  

USSD  vulnerability  in  some  Android  phones  made  big  news    Test  your  enterprise’s  phones  with  SPF    Safe  (IMEI)  and  Dangerous  (wipe  phone)  checks  

Page 67: Assessing BYOD with the Smarthpone Pentest Framework
Page 68: Assessing BYOD with the Smarthpone Pentest Framework
Page 69: Assessing BYOD with the Smarthpone Pentest Framework
Page 70: Assessing BYOD with the Smarthpone Pentest Framework
Page 71: Assessing BYOD with the Smarthpone Pentest Framework
Page 72: Assessing BYOD with the Smarthpone Pentest Framework

Social  Engineering  Example  

Lure  users  to  malicious  websites  etc    SMS  is  an  a_ack  vector  that  is  star>ng  to  be  seen  in  the  wild    Test  if  your  users  will  browse  to  website  or  even  download  apps  using  SMS  

Page 73: Assessing BYOD with the Smarthpone Pentest Framework

Social  Engineering  Vulnerability  Example  

SMS  is  the  new  email  for  spam/phishing  a_acks    “Open  this  website”  “Download  this  app”      Will  your  users  click  on  links  in  text  messages?    Will  they  download  apps  from  3rd  par>es?  

Page 74: Assessing BYOD with the Smarthpone Pentest Framework
Page 75: Assessing BYOD with the Smarthpone Pentest Framework
Page 76: Assessing BYOD with the Smarthpone Pentest Framework
Page 77: Assessing BYOD with the Smarthpone Pentest Framework
Page 78: Assessing BYOD with the Smarthpone Pentest Framework
Page 79: Assessing BYOD with the Smarthpone Pentest Framework

Agent  looks  like  the  normal  app      With  hidden  func>onality    Remotely  control,  gather  informa>on,  privilege  escela>on    

Page 80: Assessing BYOD with the Smarthpone Pentest Framework

Interact  with  SPF  agents  

A_ach  SPF  to  deployed  agents  and  send  them  commands    Permission  apps  and  root  apps  

Page 81: Assessing BYOD with the Smarthpone Pentest Framework
Page 82: Assessing BYOD with the Smarthpone Pentest Framework
Page 83: Assessing BYOD with the Smarthpone Pentest Framework
Page 84: Assessing BYOD with the Smarthpone Pentest Framework
Page 85: Assessing BYOD with the Smarthpone Pentest Framework
Page 86: Assessing BYOD with the Smarthpone Pentest Framework
Page 87: Assessing BYOD with the Smarthpone Pentest Framework

Local  Vulnerability  Example  

Smartphones  have  kernel  vulnerabili>es    Used  my  jailbreaks  and  malicious  apps    Use  a  roo>ng  agent  to  try  to  install  as  root  or  use  with  a  permission  agent  

Page 88: Assessing BYOD with the Smarthpone Pentest Framework
Page 89: Assessing BYOD with the Smarthpone Pentest Framework
Page 90: Assessing BYOD with the Smarthpone Pentest Framework

SPF  App  

Used  to  a_ach  SPF  to  mobile  modem    Can  also  perform  SPF  modem  based  func>onality  straight  from  your  phone  

Page 91: Assessing BYOD with the Smarthpone Pentest Framework
Page 92: Assessing BYOD with the Smarthpone Pentest Framework
Page 93: Assessing BYOD with the Smarthpone Pentest Framework
Page 94: Assessing BYOD with the Smarthpone Pentest Framework
Page 95: Assessing BYOD with the Smarthpone Pentest Framework

Contact  Informa>on  

     

Georgia  Weidman  Founder  and  CEO,  Bulb  Security  LLC  

[email protected]  @georgiaweidman