assessing dns vulnerability to record injection · 2017. 10. 20. · assessing dns vulnerability to...

23
Assessing DNS Vulnerability to Record Injection Kyle Schomp†, Tom Callahan†, Michael Rabinovich†, Mark Allman†‡ †Case Western Reserve University ‡Interna@onal Computer Science Ins@tute Passive and Ac@ve Measurement Conference 2014 3/11/2014 PAM 2014 1

Upload: others

Post on 28-Feb-2021

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Assessing DNS Vulnerability to Record Injection · 2017. 10. 20. · Assessing DNS Vulnerability to Record Injection Kyle%Schomp †,%Tom%Callahan†,%Michael%Rabinovich†,%Mark%Allman†‡

Assessing DNS Vulnerability to Record

Injection Kyle  Schomp†,  Tom  Callahan†,  Michael  Rabinovich†,  Mark  Allman†‡  

†Case  Western  Reserve  University  

‡Interna@onal  Computer  Science  Ins@tute  

Passive  and  Ac@ve  Measurement  Conference  2014  

3/11/2014   PAM  2014   1  

Page 2: Assessing DNS Vulnerability to Record Injection · 2017. 10. 20. · Assessing DNS Vulnerability to Record Injection Kyle%Schomp †,%Tom%Callahan†,%Michael%Rabinovich†,%Mark%Allman†‡

3/11/2014   PAM  2014   2  

Page 3: Assessing DNS Vulnerability to Record Injection · 2017. 10. 20. · Assessing DNS Vulnerability to Record Injection Kyle%Schomp †,%Tom%Callahan†,%Michael%Rabinovich†,%Mark%Allman†‡

DNS Recording Injection

•  Subver@ng  the  DNS  name  to  address  bindings  can  result  in:  •  Redirec@on  to  a  malicious  webserver  •  Privacy  issues  •  Denial  of  service  •  Phishing  aPacks  •  Malware  installa@on  

3/11/2014   PAM  2014   3  

Page 4: Assessing DNS Vulnerability to Record Injection · 2017. 10. 20. · Assessing DNS Vulnerability to Record Injection Kyle%Schomp †,%Tom%Callahan†,%Michael%Rabinovich†,%Mark%Allman†‡

Our Contribution

• Assess  vulnerability  to  extraneous  record  injec@on  •  Bailiwick  viola@ons  

•  Examine  the  incidence  rate  of  inten@onal  response  rewri@ng  by  resolvers  

•  Nega@ve  response  rewri@ng  •  Search  engine  hijacking  (Paxfire)  

•  Survey  use  of  established  mi@ga@ons  to  the  Kaminsky  vulnerability  

• Demonstrate  a  new  record  injec@on  aPack  (the  Preplay  vulnerability)  

3/11/2014   PAM  2014   4  

Page 5: Assessing DNS Vulnerability to Record Injection · 2017. 10. 20. · Assessing DNS Vulnerability to Record Injection Kyle%Schomp †,%Tom%Callahan†,%Michael%Rabinovich†,%Mark%Allman†‡

• Discover  open  resolvers  by  sampling  randomly  from  the  Internet    • Deploy  our  own  authorita@ve  DNS  server  (ADNS)  • DNS  request  probes  target  our  own  domain  

•  Test  open  and  egress  resolvers  for  vulnerability  to  record  injec@on  

Dataset Collection Methodology

3/11/2014   PAM  2014   5  

Open  Resolver  

Egress  Resolver  

“FDNS”,  Forwarding  Resolver  Scanner   ADNS  for  dnsresearch.us  “RDNS”,  Recursive  Resolver  Client  

Page 6: Assessing DNS Vulnerability to Record Injection · 2017. 10. 20. · Assessing DNS Vulnerability to Record Injection Kyle%Schomp †,%Tom%Callahan†,%Michael%Rabinovich†,%Mark%Allman†‡

Bailiwick Violations

• Over  10  years  old  • Mi@gated  via  the  bailiwick  rules  •  749  viola@ons  found  in  1.09M  open  resolvers  tested  

•  Some  resolvers  s4ll  vulnerable  to  this  very  old  aPack!  

3/11/2014   PAM  2014   6  

Query   www.x.com  ?  

Answer   1.2.3.4  

Addi@onal   www.hsbc.com  A  2.3.4.5  

www.x.com  ?    

RDNS   ADNS  for  x.com  

Page 7: Assessing DNS Vulnerability to Record Injection · 2017. 10. 20. · Assessing DNS Vulnerability to Record Injection Kyle%Schomp †,%Tom%Callahan†,%Michael%Rabinovich†,%Mark%Allman†‡

Negative Response Rewriting

• Why?  DNS  provider  profits  from  adver@sing  at  A  • Happens  to  24%  of  open  resolvers  

3/11/2014   PAM  2014   7  

anazon.com  ?    

does  not  exist  

anazon.com  ?    

anazon.com  =  A  

RDNS  Client   ADNS  for  x.com  

Page 8: Assessing DNS Vulnerability to Record Injection · 2017. 10. 20. · Assessing DNS Vulnerability to Record Injection Kyle%Schomp †,%Tom%Callahan†,%Michael%Rabinovich†,%Mark%Allman†‡

Search Engine Hijacking (Paxfire)

• Again,  the  primary  reason  is  to  mone@ze  user’s  search  traffic  • While  once  common,  this  is  no  longer  a  widespread  prac@ce  3/11/2014   PAM  2014   8  

www.google.com  ?    

www.google.com  =  G  

www.google.com  ?    

www.google.com  =  A  

search  

search  

result  

result’  ADNS  for  google.com  RDNS  

A   G  

Page 9: Assessing DNS Vulnerability to Record Injection · 2017. 10. 20. · Assessing DNS Vulnerability to Record Injection Kyle%Schomp †,%Tom%Callahan†,%Michael%Rabinovich†,%Mark%Allman†‡

Off-path Attacks

• Cral  an  acceptable  DNS  response  to  squeeze  between  the  real  DNS  request  and  response  

•  Fields  to  match:  •  IP  addresses:  source  and  des@na@on  •  Port  numbers:  source  and  des@na@on  •  Query  string  and  transac@on  ID  

3/11/2014   PAM  2014   9  

real  response  malicious  response  

real  request  

Resolver  

Page 10: Assessing DNS Vulnerability to Record Injection · 2017. 10. 20. · Assessing DNS Vulnerability to Record Injection Kyle%Schomp †,%Tom%Callahan†,%Michael%Rabinovich†,%Mark%Allman†‡

Kaminsky Vulnerability

•  In  2008,  Dan  Kaminsky  discovered  a  new  vulnerability  •  2  keys  to  Kaminsky  

•  Transac@on  ID  is  the  only  field  the  aPacker  needs  to  guess  •  Simple  way  to  aPempt  mul@ple  guesses  

• Kaminsky  showed  that  a  cache  could  be  poisoned  in  under  10  minutes!  

3/11/2014   PAM  2014   10  

Page 11: Assessing DNS Vulnerability to Record Injection · 2017. 10. 20. · Assessing DNS Vulnerability to Record Injection Kyle%Schomp †,%Tom%Callahan†,%Michael%Rabinovich†,%Mark%Allman†‡

Kaminsky Vulnerability (cont.)

Query   x1.vic9m.com  ?  

Answer   doesn’t  maPer  

Authority   [email protected]  NS  [email protected]  

Addi@onal   [email protected]  A  aPacker  

3/11/2014   PAM  2014   11  

x1.vic@m

.com  ?    

[email protected]  ?  TID=y  

guesses

 

answer  TID=y  

APacker  

RDNS   ADNS  for  [email protected]  

[email protected]  ?  

www.vi

[email protected]

 ?  

Page 12: Assessing DNS Vulnerability to Record Injection · 2017. 10. 20. · Assessing DNS Vulnerability to Record Injection Kyle%Schomp †,%Tom%Callahan†,%Michael%Rabinovich†,%Mark%Allman†‡

Kaminsky Vulnerability (cont.)

•  65K  possible  transac@on  IDs  •  First  aPempt  likely  unsuccessful,  so  repeat  with:  

•  [email protected]  •  [email protected]  •  etc…  

•  Since  none  of  these  names  will  be  in  the  resolver’s  cache,  can  retry  immediately  

•  Eventually,  the  aPacker  will  guess  correctly  

3/11/2014   PAM  2014   12  

Page 13: Assessing DNS Vulnerability to Record Injection · 2017. 10. 20. · Assessing DNS Vulnerability to Record Injection Kyle%Schomp †,%Tom%Callahan†,%Michael%Rabinovich†,%Mark%Allman†‡

Mitigating the Kaminsky Vulnerability

• Add  entropy  to  response  beyond  just  a  random  transac@on  ID  • Randomized  ephemeral  port  •  0x20  encoding  

•  Random  capitaliza@on  of  query  string,  i.e.  X1.VicTIm.Com  •  ADNS  echoes  the  capitaliza@on  back  •  APacker  must  guess  capitaliza@on  •  1  bit  of  entropy  per  lePer  in  query  string  

• DNSSEC  and  ingress  filtering  defeat  the  Kaminsky  APack  •  Slow  progress  means  mi@ga@on  is  needed  

3/11/2014   PAM  2014   13  

Page 14: Assessing DNS Vulnerability to Record Injection · 2017. 10. 20. · Assessing DNS Vulnerability to Record Injection Kyle%Schomp †,%Tom%Callahan†,%Michael%Rabinovich†,%Mark%Allman†‡

Survey of Mitigations to Kaminsky

•  Send  mul@ple  DNS  requests  through  each  RDNS  •  Classify  RDNS  where  10  or  more  DNS  requests  arrive  at  our  ADNS  

• Nearly  all  classified  resolvers  appear  to  use  random  transac@on  IDs  •  16%  of  classified  resolvers  use  sta4c  ephemeral  ports!  

•  0x20  encoding  rare  •  (lower  bound)  

3/11/2014   PAM  2014   14  

Observa9on   RDNS  

Number   Percentage  

Total  Classified   57K   100%  

Complex  Transac@on  ID  Sequence   57K   100%  

Variable  Ephemeral  Port   48K   84%  

0x20  Encoding   195   0.3%  

Page 15: Assessing DNS Vulnerability to Record Injection · 2017. 10. 20. · Assessing DNS Vulnerability to Record Injection Kyle%Schomp †,%Tom%Callahan†,%Michael%Rabinovich†,%Mark%Allman†‡

Preplay Vulnerability

•  If  RDNS  are  vulnerable,  what  about  FDNS?  •  FDNS:  

•  Residen@al  loca@ons  •  Most  likely  home  wifi  routers  •  LiPle  aPen@on  paid  to  security  

• We  found  that  FDNS  have  a  vulnerablility  that  is  much  easier  to  exploit  than  the  Kaminsky  vulnerability    

3/11/2014   PAM  2014   15  

Page 16: Assessing DNS Vulnerability to Record Injection · 2017. 10. 20. · Assessing DNS Vulnerability to Record Injection Kyle%Schomp †,%Tom%Callahan†,%Michael%Rabinovich†,%Mark%Allman†‡

• RDNS  IP  address,  transac@on  ID,  and  port  numbers  are  not  validated!  •  7-­‐9%  FDNS  are  vulnerable  •  2-­‐3  million  out  of  the  ~32  million  open  resolvers  on  the  Internet  

APacker  

Preplay Vulnerability (cont.)

3/11/2014   PAM  2014   16  

[email protected]  ?     [email protected]  ?    

[email protected]  =  V    [email protected]  =  A  

[email protected]  =  A    

[email protected]  =  V  [email protected]  =  A  

RDNS  

FDNS  

Page 17: Assessing DNS Vulnerability to Record Injection · 2017. 10. 20. · Assessing DNS Vulnerability to Record Injection Kyle%Schomp †,%Tom%Callahan†,%Michael%Rabinovich†,%Mark%Allman†‡

APacker  

Implication: Indirect Attacks

•  62%  of  RDNS  are  closed,  yet  s@ll  accessible  through  FDNS  •  FDNS  are  an  avenue  to  detect  and  aPack  closed  resolvers  

3/11/2014   PAM  2014   17  

x.com  ?    

FDNS  

Closed  RDNS  

Page 18: Assessing DNS Vulnerability to Record Injection · 2017. 10. 20. · Assessing DNS Vulnerability to Record Injection Kyle%Schomp †,%Tom%Callahan†,%Michael%Rabinovich†,%Mark%Allman†‡

• Advantages  for  an  aPacker:  •  Achieve  maximum  amplifica@on  •  Do  not  need  ADNS  •  Or  even  a  registered  DNS  record  

Implication: Phantom DDoS Attacks

3/11/2014   PAM  2014   18  

large.record  ?  from  V    large.record  

large.record  

large.record  

APacker  

FDNS  V  

Page 19: Assessing DNS Vulnerability to Record Injection · 2017. 10. 20. · Assessing DNS Vulnerability to Record Injection Kyle%Schomp †,%Tom%Callahan†,%Michael%Rabinovich†,%Mark%Allman†‡

Scanner  RDNS  

FDNS  

Round-­‐Trip  Times  

• APack  only  effec@ve  if  there  are  users  behind  the  FDNS  • We  test  FDNS  for  use  by  looking  for  popular  records  in  the  FDNS’s  cache  

•  If  a  popular  record  returned  in  ≪  RDNS  RTT  and  ≈  FDNS  RTT,  then  FDNS  is  used  

Context: Are Preplay Vulnerable FDNS Used?

3/11/2014   PAM  2014   19  

Page 20: Assessing DNS Vulnerability to Record Injection · 2017. 10. 20. · Assessing DNS Vulnerability to Record Injection Kyle%Schomp †,%Tom%Callahan†,%Michael%Rabinovich†,%Mark%Allman†‡

0 1 10 100 1K0

0.2

0.4

0.6

0.8

1

Records in CacheCC

DF

Context: Preplay Vulnerable FDNS Are Used! •  53%  of  FDNS  have  1  or  more  popular  records  in  cache  

•  (lower  bound)  •  So,  many  Preplay  vulnerable  FDNS  are  used  

3/11/2014   PAM  2014   20  

Page 21: Assessing DNS Vulnerability to Record Injection · 2017. 10. 20. · Assessing DNS Vulnerability to Record Injection Kyle%Schomp †,%Tom%Callahan†,%Michael%Rabinovich†,%Mark%Allman†‡

1 2 3 4 5 6 7 8 9 100.05

0.1

0.15

0.2

Snapshots in chronological orderFra

ction

of R

DNSContext: Effects of Sampling on RDNS

• RDNS  discovery  dependent  upon  FDNS  that  share  the  RDNS  

•  Frac@on  of  RDNS  vulnerable  to  Kaminsky  con@nues  to  grow  

•  Frequently  shared  RDNS  less  vulnerable  to  Kaminsky  

•  3%  of  FDNS  in  front  of  Kaminsky  vulnerable  RDNS  

3/11/2014   PAM  2014   21  

Page 22: Assessing DNS Vulnerability to Record Injection · 2017. 10. 20. · Assessing DNS Vulnerability to Record Injection Kyle%Schomp †,%Tom%Callahan†,%Michael%Rabinovich†,%Mark%Allman†‡

Summary

• Bailiwick  viola@ons  are  rare  • Nega@ve  response  rewri@ng  occurs  in  24%  of  FDNS  •  Search  engine  hijacking  no  longer  prevalent  •  16%  of  RDNS  s@ll  have  the  Kaminsky  vulnerability  

•  But  these  are  the  less  frequently  used  RDNS  •  7-­‐9%  of  FDNS  (2-­‐3M)  can  be  trivially  poisoned  due  to  the  Preplay  vulnerability  

3/11/2014   PAM  2014   22  

Page 23: Assessing DNS Vulnerability to Record Injection · 2017. 10. 20. · Assessing DNS Vulnerability to Record Injection Kyle%Schomp †,%Tom%Callahan†,%Michael%Rabinovich†,%Mark%Allman†‡

Thank you! Questions? Kyle Schomp – [email protected] For  access  to  our  datasets:  hPp://dns-­‐scans.eecs.cwru.edu/  

3/11/2014   PAM  2014   23