1 / 20

Security

Security. Khaled Al-Sham’aa. What Is Security?. Security is a measurement, not a characteristic. Security must be balanced with expense. Security must be balanced with usability. Security must be part of the design. Basic Steps. Consider illegitimate uses of your application.

jenna-burt
Download Presentation

Security

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Security Khaled Al-Sham’aa

  2. What Is Security? • Security is a measurement, not a characteristic. • Security must be balanced with expense. • Security must be balanced with usability. • Security must be part of the design.

  3. Basic Steps • Consider illegitimate uses of your application. • Educate yourself. • If nothing else: FILTER ALL INPUT DATA ESCAPE ALL OUTPUT DATA

  4. Register Globals (1)

  5. Register Globals (2)

  6. Filtering (1)

  7. Filtering (2)

  8. Filtering (3)

  9. Form Processing (1)

  10. Form Processing (2)

  11. Cross-Site Scripting (XSS)

  12. Cross-Site Scripting (XSS) 1

  13. Cross-Site Scripting (XSS) 2

  14. Cross-Site Scripting (XSS) 3 • htmlentities() • strip_tags() • utf8_decode()

  15. Session Hijacking

  16. SQL Injection (example 1) <form method="post" action="http://www.example.com/login.php"> <input name="user" type="text"> <input name="pwd" type="password"> </form>

  17. SQL Injection (example 1) con. • SELECT `id` FROM `logins` WHERE `username` = '$user' AND `password` = '$pwd' • $user = “Khaled”; • $pwd = “anything' OR 'x'='x”; • SELECT `id` FROM `logins` WHERE `username` = 'Khaled' AND `password` = 'anything' OR 'x'='x'

  18. SQL Injection (example 2) • $query = “UPDATE usertable SET pwd='$pwd' WHERE uid='$uid' ”; • $pwd = “abc”; • $uid = “anything' or uid='admin'; -- ”; • $query = “UPDATE usertable SET pwd='abc' WHERE uid= 'anything' or uid='admin'; -- ' ”;

  19. Avoiding SQL Injection • mysql_real_escape_string() • for PHP version < 4.3.0 use addslashes() • Prepared Statements

  20. Questions

More Related