1% of CMS-Powered Sites Expose Their Database Passwords

November 17th, 2011 | 7,817 views | 9 Comments » |

Nearly 1% of websites built with a content management system (like WordPress or Joomla) are unknowingly exposing their database password to anyone who knows where to look.

TL;DR — Summary of the Problem

Using a text editor to modify content management system (CMS) configuration files (like wp-config.php) could expose your database password to the world. Several popular text editors like Vim and Emacs automatically create backup copies of the files you edit, giving them names like “wp-config.php~” and “#wp-config.php#”. If the text editor crashes or the SSH connection drops during editing, then the temporary backup files may not be cleaned up correctly. This means that the CMS config file (which contains the database password) could accidentally be made public to anyone who knows where to look.

Most servers, including the ubiquitous Apache, will happily serve the plaintext of .php~ and .php# files without passing them through the PHP preprocessor first, since they don’t have the .php file extension. Thus, your sensitive database credentials are just one GET request away from being accessed by a malicious party.

I wrote an automatic program, which I call CMSploit, to test for the prevalence of this issue across the wider web. I tested the top 200,000 websites (as ranked by Quantcast) and found that 0.11% of websites are vulnerable. If we eliminate non-CMS sites, and just look at CMS-powered websites, then we find that 0.77% of websites running a CMS have publicly-visible config files.

If you want all the gory details, then keep reading.

Read the rest of this entry »

9 Comments | Leave a comment » More posts about: Computer Science, Hacks, Security, Stanford, Web Dev

HOW TO: Spy on the Webcams of Your Website Visitors

October 18th, 2011 | 52,672 views | 98 Comments » |

Update 10/19/2011: CNET says that Adobe is working on a fix and it could be ready by end of week. Adobe also emailed me and said “our product team is wrapping up their investigation and is now working on a fix, which should not require a Flash Player update”.

Update 10/20/2011: Whoa, this story is everywhere!

Update 10/20/2011: Adobe says they just posted a fix to the Settings Manager that should resolve the issue. I just tested it out, and indeed the issue appears to be fixed now. Congrats, Adobe, for the quick fix!

Update 12/21/2011: This attack made it into Jeremiah Grossman’s list of top web hacking techniques of 2011. It’s #26.

Update 1/10/2012: Another similar clickjacking attack was just discovered and fixed by Adobe.


Original post:

I discovered a vulnerability in Adobe Flash that allows any website to turn on your webcam and microphone without your knowledge or consent to spy on you.

It works in all versions of Adobe Flash that I tested. I’ve confirmed that it works in the Firefox and Safari for Mac browsers. Use one of those if you check out the live demo. There’s a weird CSS opacity bug in most other browsers (Chrome for Mac and most browsers on Windows/Linux).

Video demo of the attack:

Source code: Github

Clickjacking + Adobe Flash = Sad Times!

This attack works by using a neat variation of the normal clickjacking technique that spammers and other bad people are using in the wild right now. For the uninitiated:

Clickjacking is a malicious technique of tricking Web users into revealing confidential information or taking control of their computer while clicking on seemingly innocuous web pages.
— Wikipedia

Combine clickjacking with the Adobe Flash Player Setting Manager page and you have a recipe for some sad times.

Read the rest of this entry »

98 Comments | Leave a comment » More posts about: Computer Science, Hacks, Security, Stanford, Web Dev

YouTube Instant Shortlisted for Best API Use in .Net Magazine Awards

October 4th, 2011 | 1,164 views | 1 Comment » |

YouTube Instant Logo

YouTube Instant made it onto the shortlist for Best API Use in the .Net Awards. It’s right there with Instagram and Gowalla!

I want to thank all the people who voted for me — I feel so honored and humbled by all the attention. I’ll do my best to keep making cool stuff that delights people.

Also, I want to thank the good people at .Net Magazine for putting on this awesome award series to recognize so many of the creative people who work in web design and development.

1 Comment » | Leave a comment » More posts about: Hacks, Me, YouTube

How I Learned to Program Computers

September 13th, 2011 | 18,413 views | 14 Comments » |

I’ve been asked this question a lot lately, especially after I built YouTube Instant. So, here’s the answer, once and for all, for those who are interested.

In short:

I learned how to program by building lots of websites.

The full story:

I learned how to program by working on lots of different website projects starting from a pretty young age. What follows is a full account of all the major websites I’ve built, back to the very first site I made when I was 11 years old. What I hope the reader takes away from this full retelling is the importance of doing lots of side projects if you want to learn to program well.

The best way to learn a new skill is to practice, practice, practice. All the best programmers that I know sincerely enjoy programming — it’s something that makes them absurdly happy to do. And, so they do it a lot. Often, an unhealthy amount. Learning how to program — and how to do it well — doesn’t take superhuman ability. It just takes a willingness to get your hands dirty and build stuff.

Read the rest of this entry »

14 Comments | Leave a comment » More posts about: Computer Science, Essays, Hacks, Me, Startups, Web Dev

I’m on Github now!

September 1st, 2011 | 1,513 views | 1 Comment » |

Follow me on GitHub!

I’ve been using Github for the past year to work on projects with friends (like Instant.fm and iBoard). But until now, I’ve only created private repositories.

I’ve been meaning to open source the rest of my projects on Github, but haven’t got around to it, until now!!

Right now, I’ve mostly posted some small projects, but I plan to use Github for pretty much anything I build, from now on.

1 Comment » | Leave a comment » More posts about: Free Software, Hacks, Me
Fork me on GitHub