Presentation is loading. Please wait.

Presentation is loading. Please wait.

INFO 344 Web Tools And Development CK Wang University of Washington Spring 2014.

Similar presentations


Presentation on theme: "INFO 344 Web Tools And Development CK Wang University of Washington Spring 2014."— Presentation transcript:

1 INFO 344 Web Tools And Development CK Wang University of Washington Spring 2014

2 Announcements PA4 due Tonight! No late days. – Canvas shuts down at 11:00pm, please submit earlier!

3 Security

4 Firewall Software or Hardware Separate local area network from Internet Protocol/Port, inbound & outbound

5 SQL Injection Common security risk What is SQL Injection – Go to site, insert malicious SQL Before hacking: – Understanding “Union” mysql clause – MySQL versions, latest version has: INFORMATION_SCHEMA.TABLES Take a look locally to understand the columns/etc

6 SQL Injection Try hacking this! http://uwinfo344.chunkaiw.com/trysqlinjection.php Strategy – Get it working normally – Find out how many columns in current table – Get database name via database() – Show all tables in current database – Identify table with sensitive info (and # rows it has) – Identify column names in sensitive table – Get sensitive info! What is my username & password? Groups of 2 Lab submission

7 SQL Injection Solution – Use PDO! – See PHP best practices slides – PDO, prepare, bind parameters, execute

8 Cross Site Scripting (XSS) Attack Common security risk What is XSS Attack? – Send victim compromised site url Try hacking this! (use Firefox) http://uwinfo344.chunkaiw.com/tryxssattack.php?name=Joe Strategy – Add JS to parameter, get it to show “compromised” alert box – Look at source code, understand how it works – Add JS to override the current onclick function and alert instead – Change override function to send 15x the payment entered Groups of 2 Lab submission Hint: Google jquery override onclick Hint: need to url encode the # tag

9 Cross Site Scripting (XSS) Attack A lot of browsers disable this But sanitize your inputs! Reject ones with script tags!

10 Validate Cookies Cookies are stored on client side User can actually go change them! So if you assume cookie data is valid = Dangerous!!! A lot of websites will store “ID=XXX” in the cookie and the next time assume it’s real/valid/authenticated => not true!

11 Encrypt Passwords Encrypt passwords stored in your database If your system gets hacked, the passwords aren’t leaked

12 Sanitize HTML Same reason to prevent XSS Sanitize with PHP functions – http://www.php.net/manual/en/filter.filters.sanitize.php http://www.php.net/manual/en/filter.filters.sanitize.php C# Sanitize – http://msdn.microsoft.com/en-us/library/ff647397.aspx http://msdn.microsoft.com/en-us/library/ff647397.aspx

13 Questions?


Download ppt "INFO 344 Web Tools And Development CK Wang University of Washington Spring 2014."

Similar presentations


Ads by Google