19.09.2017 Views

the-web-application-hackers-handbook

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 3 n Web Application Technologies 55<br />

n Web mail — SquirrelMail, IlohaMail<br />

n Photo galleries — Gallery<br />

n Shopping carts — osCommerce, ECW-Shop<br />

n Wikis — MediaWiki, WakkaWikki<br />

Because PHP is free and easy to use, it has often been <strong>the</strong> language of choice<br />

for many beginners writing <strong>web</strong> <strong>application</strong>s. Fur<strong>the</strong>rmore, <strong>the</strong> design and<br />

default configuration of <strong>the</strong> PHP framework has historically made it easy for<br />

programmers to unwittingly introduce security bugs into <strong>the</strong>ir code. These<br />

factors have meant that <strong>application</strong>s written in PHP have suffered from a disproportionate<br />

number of security vulnerabilities. In addition, several defects<br />

have existed within <strong>the</strong> PHP platform itself that often could be exploited via<br />

<strong>application</strong>s running on it. See Chapter 19 for details on common defects arising<br />

in PHP <strong>application</strong>s.<br />

Ruby on Rails<br />

Rails 1.0 was released in 2005, with strong emphasis on Model-View-Controller<br />

architecture. A key strength of Rails is <strong>the</strong> breakneck speed with which<br />

fully fledged data-driven <strong>application</strong>s can be created. If a developer follows <strong>the</strong><br />

Rails coding style and naming conventions, Rails can autogenerate a model<br />

for database content, controller actions for modifying it, and default views for<br />

<strong>the</strong> <strong>application</strong> user. As with any highly functional new technology, several<br />

vulnerabilities have been found in Ruby on Rails, including <strong>the</strong> ability to bypass<br />

a “safe mode,” analogous to that found in PHP.<br />

More details on recent vulnerabilities can be found here:<br />

www.ruby-lang.org/en/security/<br />

SQL<br />

Structured Query Language (SQL) is used to access data in relational databases,<br />

such as Oracle, MS-SQL server and MySQL. The vast majority of today’s <strong>web</strong><br />

<strong>application</strong>s employ SQL-based databases as <strong>the</strong>ir back-end data store, and nearly<br />

all <strong>application</strong> functions involve interaction with <strong>the</strong>se data stores in some way.<br />

Relational databases store data in tables, each of which contains a number<br />

of rows and columns. Each column represents a data field, such as “name” or<br />

“e-mail address,” and each row represents an item with values assigned to some<br />

or all of <strong>the</strong>se fields.<br />

SQL uses queries to perform common tasks such as reading, adding, updating,<br />

and deleting data. For example, to retrieve a user’s e-mail address with a<br />

specified name, an <strong>application</strong> might perform <strong>the</strong> following query:<br />

select email from users where name = ‘daf’

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!