Sign Up or Log In
Privacy and TOS
Contact Us

underground

Php-Security-Audit-Howto

Provided by : underground » Folder : Download free pdf ebooks or books » Category : Document » (no category)

"PHP Security Audit HOWTO Zend/PHP Conference & Expo San Francisco, CA 18 - 21 Oct 2005 Chris Shiflett Brain Bulb chris@brainbulb.com Talk Outline What Is a PHP Security Audit? Setting the Bar Analyzing the Design Analyzing the Configuration Searching the Source More Information Questions and Answers What Is a PHP Security Audit? An audit is an examination. Nothing should be off-limits. A PHP security audit is primarily an examination of the source. Other points of interest are the design and configuration. Setting the Bar How much security do you need? Start with a minimum level. At the very least, a PHP application should filter input and escape output. What Is Input? Some input is obvious - form data ($_GET and $_POST), cookies ($_COOKIE), etc. Some input is hard to identify - $_SERVER Sometimes it depends on your perspective $_SESSION, data from databases, etc. The key is to identify the origin of data. Data that originates anywhere else is input. What Is Filtering? Filtering is an inspection process. Prove data to be valid. Consider everything else tainted. Ensure you can easily and reliably distinguish between filtered and tainted data. I use a strict naming convention. Show Me the Code! <?php $clean = array(); switch($_POST['color']) {     case 'red':     case 'green':     case 'blue':         $clean['color'] = $_POST['color'];         break; } ?> Show Me the Code! <?php $clean = array(); if (ctype_alnum($_POST['username'])) {     $clean['username'] = $_POST['username']; } ?> What Is Output? Some output is obvious - HTML, JavaScript, etc. The client isn't the only remote destination databases, session data stores, feeds, etc. The key is to identify the destination of data. Data destined for anywhere else is output. What Is Escaping? Escaping preserves data as it enters another context. Some characters need to be represented in a special way: O\'Reilly (SQL) AT&amp;T (HTML) In most cases, there is a function you can use. If you must write your own, be exhaustive. Show Me the Code! <?php $html = array(); $html['username'] = htmlentities($clean['username'],      ENT_QUOTES, 'UTF-8'); echo "<p>Welcome back, {$html['username']}.</p>"; ?> Show Me the Code! <?php $mysql = array(); $mysql['username'] = mysql_real_escape_string($clean['username']); $sql = "SELECT *         FROM   profile         WHERE  username = '{$mysql['username']}'"; $result = mysql_query($sql); ?> Analyzing the Design Have the design explained first. Avoid unnecessary complexity. Encourage distinction between tainted and filtered data. Analyzing the Configuration Mostly dictated by php.ini. Also consider httpd.conf, .htaccess, ini_set(). Analyzing the Configuration Things to avoid: register_globals allow_url_fopen magic_quotes_gpc display_errors Searching the Source Identify input and trace it forward. Identify output and trace it backward. Ensure input is filtered and output is escaped. Identifying Input HTML Forms: form input $_GET $_POST $_REQUEST Identifying Input Databases: mysql_query() SELECT HTTP Headers: $_COOKIE $_SERVER Identifying Output Client: echo print <?= Identifying Output Databases: mysql_query() Commands: exec() passthru() system() Tracing Forward <?php $action = $_POST['action']; $query_string = "action=$action"; $link = "index.php?$query_string"; ?> <a href="<?php echo $link; ?>"> Click Here </a> Tracing Backward <?php $username = $_COOKIE['username']; $greeting = "Welcome back, $username."; $html = "<p>$greeting</p>"; echo $html; ?> Gotchas Trust of HTTP Headers: Referer Trust of $_SERVER: $_SERVER['PHP_SELF'] Trust of Client-Side Restrictions: maxlength More Information PHP Security Consortium http://phpsec.org/ Essential PHP Security http://phpsecurity.org/ My Business Web Site http://brainbulb.com/ My Personal Web Site and Blog http://shiflett.org/ Questions and Answers Thanks for Listening! Chris Shiflett chris@brainbulb.com ..."

You need to upgrade your Flash Player , or try to enable javascript in order see this document properly.

Php-Security-Audit-Howto

(no description)
more

File Name: Php-Security-Audit-Howto.pdf
Provided by: underground
Folder: Download free pdf ebooks or books (Download online free books or as u call them pdf ebooks )
Category: Document » (no category)
Size: 358.38 kb
Extension: pdf
Rating: 0
Views: 27
Downloads: 1
Uploaded: 05/01/09 07:27
Tags: (no tags)


Embed:
Link:
Forum:

Submit to digg
digg stumble reddit Submit to del.icio.us delicio furl facebook
comments Comments : 0
No comments yet..

Add comment: (Sing Up or Log In)

Securing MySQL for a Security Audit (pdf document)
Securing MySQL for a Security Audit
Securing MySQL for a Security Audit. presentation mysql mysqluc08
pdf document From: undergroun...
PHP Architects Guide to PHP Security - Marco Tabini and Associates (pdf document)
PHP Architects Guide to PHP Security - Marco Tabini and Associates
Download free PHP e-books
pdf document From: gagic
Pro PHP Security - Apress (pdf document)
Pro PHP Security - Apress
Download free PHP e-books
pdf document From: gagic
Guide-To-Php-Security-Ch3 (pdf document)
Guide-To-Php-Security-Ch3
(no description)
pdf document From: undergroun...
Php-Security-Guide (pdf document)
Php-Security-Guide
(no description)
pdf document From: undergroun...
Guide php-security-guide  (pdf document)
Guide php-security-guide
Download guide
pdf document From: illuminate...
Php-Security-Guide (pdf document)
Php-Security-Guide
(no description)
pdf document From: illuminate...
php pcre cheat sheet (pdf document)
php pcre cheat sheet
A table of PHP PCRE Cheat Sheet Programming Presentation Design Adobe...
pdf document From: undergroun...
OReilly.Learning.PHP.and.MySQL.2nd.Edition.Aug.2007 (pdf document)
OReilly.Learning.PHP.and.MySQL.2nd.Edition.Aug.2007
Featuring basic concepts explained in plain English, Learning PHP and ...
pdf document From: amine2610
linux security quickref (pdf document)
linux security quickref
linux security
pdf document From: ob1
flash mx security (pdf document)
flash mx security
flash mx security
pdf document From: ob1
Advanced PHP for Flash (zip archive)
Advanced PHP for Flash
Advanced PHP for Flash book files
zip archive From: ob1
New Blog php (zip archive)
New Blog php
New Blog php
zip archive From: ob1
amazon s3 php utility class (zip archive)
amazon s3 php utility class
amazon s3 php utility class
zip archive From: ob1
amazon s3 php utility  example (zip archive)
amazon s3 php utility example
amazon s3 php utility example
zip archive From: ob1
amazon s3 php demo example (zip archive)
amazon s3 php demo example
amazon s3 php demo example
zip archive From: ob1
PHP and MySQL Bible (pdf document)
PHP and MySQL Bible
PHP and MySQL Bible
pdf document From: ebook
NOD32 Smart Security 3.0.56 (rar archive)
NOD32 Smart Security 3.0.56
A New Malware Defense: ESET Smart SecurityBy the time you finish readi...
rar archive From: realestnig...
ESET Smart Security 3.0.556_32bit free download crack (zip archive)
ESET Smart Security 3.0.556_32bit free download crack
Eset Smart Security 3.0.556 35bit & Crack
zip archive From: jihchi
php manual (pdf document)
php manual
Manual de PHP
pdf document From: kattatzu

© 2009 Fliiby LLC