Oct 5

Find HTML Injection Vulnerabilities with Google Code Search

Posted by Jaimie Sirovich on Oct. 5th, 2006. 7 comments — voice your opinion.

BECOME AN EGGHEAD. SUBSCRIBE TO OUR RSS FEED OR FOLLOW US ON TWITTER!

Learn to be as nerdy as we are by never missing our latest blog entries. Receive great tips, tricks, and ideas on improving your web site every day! Subscribe via our RSS Feed, follow us, or use the chicklets in the sidebar for more options.
X

I guess I think like a hacker, because I thought of this before seeing RSnake's post about finding vulnerabilities with Google Code Search.

If you want to find lots of PHP-based web applications that are likely vulnerable to HTML injection, try this search out:

lang:php (print\(|echo)\s\$_(GET|REQUEST)

This says "Find all PHP code that calls 'print' or 'echo' to display $_GET or $_POST (likely) without escaping anything.  What a great way to find places to inject stuff!  This is useful to find XSS vulnerabilities as well.

Organizing the world's information is useful — for many things :)

Tell an amigo:
  • Sphinn
  • Digg
  • Reddit
  • del.icio.us
  • StumbleUpon
  • Facebook



Related posts:
XSS & HTML Injection are Frighteningly Trivial to Find at Harvard.edu This recent article mentions that XSS and HTML injection are...
Auditing for HTML Tainting Note: the code for the auditing script is located here....
Code for HTML Auditing <? // +———————————————————————-+ // | HTMLParser                                                           | // | Simple HTML Parsing Library                                          | // | Based on Jose Solorzano's Library; his notice is below.              | // +———————————————————————-+ // | Portions Copyright (c) 2004-2005 Jaimie Sirovich                     | // +———————————————————————-+ // | This program is free software; you can redistribute it and/or        |...
PubCon / SES Idea: Protecting Yourself From Black Hat Vulnerabilities We all have a mischievous side.  I know I do. ...
Patched Sociable Code To Enable Feed Icons I said I would release this if enough people asked. ...




"7 Wise Comments Banged Out Somewhere On The Internet ..."


Atanas Yanev

Fix your link (lang:php) friend ;)

Nice vulnerability :D

Stephen W.

I'm torn between hating you for aiding hackers or praising you for spotlighting shoddy development practices. Perhaps instead of "Don't be evil," Google should have its new motto be, "Don't be evil; just be a tool for evil." ;)

Jaimie Sirovich

Thanks, Atanas. Fixed.

Shuan W

A much broader search would be to search for

lang:php (print|echo)\s\$_(GET|REQUEST|POST) since you dont need a left parenthesis for print.

Jeremy Luebke

Forget injection attacks. Just log in as the admin and add real links where they might not be noticed.

http://google.com/codesearch?hl=en&lr=&q=lang%3Aphp+file%3Awp-config+user+-sample&btnG=Search

Search Engine Land: News About Search Engines & Search Marketing

Using Google Code Search To Find Vulnerable Sites…

ShoeMoney wrote a detailed write up on how hackers can easily use Google Code Search to quickly find sites that are vulnerable to being hacked. ShoeMoney shows XSS exploits, SQL Injection exploits, and methods to find host,user,pass for mysql databases…

Usando Google para encontrar sitios vulnerables » Internet Marketing MX

[...] - Find HTML Injection Vulnerabilities with Google Code Search [...]



Care To Bang On The Keys ... ?

BECOME AN EGGHEAD. SUBSCRIBE TO OUR RSS FEED!

Learn to be as nerdy as we are by never missing our latest blog entries. Receive great tips, tricks, and ideas on improving your web site every day! Subscribe via our RSS Feed or use the chicklets in the sidebar.