aboutsummaryrefslogtreecommitdiff
path: root/slides/xss/index.html
blob: a28a7dddbe40210fc9cb945b56e9278dea0a926c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
---
layout: slides
title: Security
scripts: [ ./script.js ]
styles: [ ../reveal.js/theme/blood.css, ../reveal.js/zenburn.css, ./style.css ]
---
<div class="reveal">
  <div class="slides">
    <section>
      <h1>XSS Injections</h1>
      <div class="profile">
        <img src="/assets/face.jpg" alt="Noah Loomans">
        <div class="info">
          <div class="name">Noah Loomans</div>
          <!-- Pls work GitLab, random change! -->
          <div class="pgp-key">67B0 295A C271 345D 0706 4B9B 8B23 75F3 B367 DF6D</div>
        </div>
      </div>
    </section>
    <section>
      <h2>Cross Site Scripting</h2>
    </section>
    <section>
      <h2>Sample Code</h2>
      <pre><code class="hljs" data-trim contenteditable>
&lt;?php

$sql = "SELECT comment FROM comments";
$result = $conn->query($sql);

// output data of each row
while($row = $result->fetch_assoc()) {
    echo $row["comment"] . "&lt;br&gt;";
}

?&gt;
			</code></pre>
    </section>
    <section>
      <h2>What if I enter <code>&lt;b&gt;hello&lt;/b&gt;</code>?</h2>
    </section>
    <section>
      <pre><code class="hljs html" data-trim data-noescape contenteditable>
&lt;p class="comments"&gt;
<span class="fragment">This sucks&lt;br&gt;</span>
<span class="fragment">First!&lt;br&gt;</span>
<span class="fragment"><mark>&lt;b&gt;hello.&lt;/b&gt;&lt;br&gt;</mark></span>
&lt;/p&gt;̿
			</code></pre>
    </section>
    <section data-background-image="https://keybase.io/images/blog/zcash/evil.png">
      <h1><code>&lt;script&gt;</code></h1>
    </section>
    <section>
      <h2>Sample Code</h2>
      <pre><code class="hljs" data-trim data-noescape contenteditable>
&lt;?php

$sql = "SELECT comment FROM comments";
$result = $conn->query($sql);

// output data of each row
while($row = $result->fetch_assoc()) {
  echo <span class="fragment" data-fragment-index="2"><mark>htmlspecialchars(</mark></span>$row["comment"]<span class="fragment" data-fragment-index="2"><mark>);</mark></span> . "&lt;br&gt;";
}

?&gt;
      </code></pre>
      <p class="fragment" data-fragment-index="1">
        Source: <a href="https://www.w3schools.com/php/php_mysql_select.asp">w3schools</a>
      </p>
    </section>
    <section>
      <h1><code class="hljs">&lt;</code> -> <code class="hljs">&amp;lt;</code></h1>
    </section>
    <section>
      https://hack-challange-nloomans.c9users.io/
    </section>
  </div>
</div>