-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
324 lines (282 loc) · 9.22 KB
/
index.html
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
<!doctype html>
<html>
<head>
<link rel="stylesheet" href="styles.css">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>Introduction To Web Security</title>
<link rel="stylesheet" href="css/reset.css">
<link rel="stylesheet" href="css/reveal.css">
<link rel="stylesheet" href="css/theme/night.css">
<!-- Theme used for syntax highlighting of code -->
<link rel="stylesheet" href="lib/css/monokai.css">
<!-- Printing and PDF exports -->
<script>
var link = document.createElement( 'link' );
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = window.location.search.match( /print-pdf/gi ) ? 'css/print/pdf.css' : 'css/print/paper.css';
document.getElementsByTagName( 'head' )[0].appendChild( link );
</script>
</head>
<body>
<div class="reveal">
<div class="slides">
<section>
<h2>Introduction to <br />Web Security</h2>
<p>- Mehul Mohan</p>
<p style="font-size: 20px;font-style: italic;">bit.ly/hack-night-01</p>
</section>
<section>
<h2>Disclaimer</h2>
<p>Do not try to do any attack discussed in this, or any subsequent lecture on any publicly/privately running service unless you have written permission from the organization. I'm not responsible for anything you do.</p>
</section>
<section>
<h2>About Me</h2>
<ul>
<li class="fragment">BITSkrieg coordinator</li>
<li class="fragment">Google HoF (bughunter.withgoogle.com/rank/hof)</li>
<li class="fragment">Microsoft HoF (June & July 2015 Security Researchers)</li>
<li class="fragment">Sony HoF (secure.sony.net/hallofthanks)</li>
<li class="fragment">ESET, Trend Micro, Gratipay, Automattic, etc.</li>
</ul>
</section>
<section>
<h2>Web Security 101</h2>
<ul>
<li class="fragment">Involves Web</li>
<li class="fragment">Involves technologies web uses</li>
<li class="fragment">Involves security</li>
</ul>
</section>
<section>
<h2>Goals for this talk</h2>
<ul>
<li class="fragment">What is web</li>
<li class="fragment">How Web works</li>
<li class="fragment">Some common attack scenarios</li>
<li class="fragment">Some simple questions</li>
</ul>
</section>
<section>
<table class="reveal">
<thead>
<tr>
<th>Web</th>
<th>Internet</th>
</tr>
</thead>
<tbody>
<tr>
<td class="fragment">*software*</td>
<td class="fragment">*hardware*</td>
</tr>
<tr>
<td class="fragment">web pages/web sites/web apps</td>
<td class="fragment">web + VoIP + ssh + torrents + other P2P</td>
</tr>
<tr>
<td class="fragment">Uses only HTTP(S) protocol</td>
<td class="fragment">This. is. everything.</td>
</tr>
</tbody>
</table>
</section>
<section>
<h2>HTTP</h2>
<ul>
<li class="fragment">Hypertext Transfer Protocol</li>
<li class="fragment">Language of Web</li>
<li class="fragment">Layer 7/Application protocol</li>
</ul>
</section>
<section>
<h2>Open Systems Interconnection (OSI)<br /> Model</h2>
</section>
<section>
<img src="images/osi-model.jpeg" />
</section>
<section>
<h2>How HTTP works</h2>
<ul>
<li class="fragment">Request-response model (over TCP/IP)</li>
<li class="fragment">How about UDP?</li>
<li class="fragment">UDP works on one-way model</li>
</ul>
</section>
<section>
<h2>Request-response model</h2>
<p class="fragment">Time << Data</p>
</section>
<section>
<h2>One-way model</h2>
<p class="fragment">Time >> Data</p>
</section>
<section>
<h2>Simple HTTP request/response</h2>
<p class="fragment">Netcat (nc) is a raw TCP/UDP client/server tool</p>
</section>
<section>
<pre><code data-trim data-noescape data-line-numbers="1-5" class="bash">
GET / HTTP/1.1 # Request line
Host: 127.0.0.1 # Header 1
X-Header-1: just-for-fun # Header 1
X-Header-2: just-for-fun-again # Header 1
X-Header-3: Spaces are allowed! # Header 1
# empty line
</code></pre>
</section>
<section>
<h2>Request line</h2>
<ul>
<li>Request Method (HTTP/1.1): GET/POST/PUT/DELETE/OPTIONS/CONNECT/HEAD/TRACE</li>
<li>Request URI: Absolute/relative URI of the resource you want to apply the request to</li>
<li>HTTP Version: Version which the server should conform to</li>
</ul>
</section>
<section>
<h2>Slow Loris Demonstration</h2>
<ul>
<li class="fragment">Denial of Service attack</li>
<li class="fragment">Exhausts max connection limit of server</li>
<li class="fragment">Bring down servers with just one machine for fun!</li>
</ul>
</section>
<section>
<h2>HTTP is stateless</h2>
<ul>
<li class="fragment">It is stateless - doesn't remember past</li>
<li class="fragment">Need to pass "stateful" data to-and-fro</li>
<li class="fragment">Achieved through HTTP headers</li>
</ul>
</section>
<section>
<h2>HTTP Headers</h2>
<ul>
<li class="fragment">Way for client/server to share additional data</li>
<li class="fragment">Some common headers for statefulness:</li>
<li class="fragment">Cookie, User-Agent, Authorization and custom tokens</li>
</ul>
</section>
<section>
<h2>Real-life v/s CTFs</h2>
</section>
<section>
<table class="reveal">
<thead>
<tr>
<th>Real world</th>
<th>CTF</th>
</tr>
</thead>
<tbody>
<tr>
<td class="fragment">Actual exploits</td>
<td class="fragment">Planted exploits</td>
</tr>
<tr>
<td class="fragment">Involves user data/user security</td>
<td class="fragment">Need to break in and get flag</td>
</tr>
<tr>
<td class="fragment">Hard-Very Hard</td>
<td class="fragment">Easy-Hard</td>
</tr>
<tr>
<td class="fragment">$$$$$$</td>
<td class="fragment">$$</td>
</tr>
<tr>
<td class="fragment">Not the best way to start</td>
<td class="fragment">Great way to start</td>
</tr>
</tbody>
</table>
</section>
<section>
<h2>Cookie</h2>
<ul>
<li class="fragment">A piece of information to uniquely identify a client after authentication</li>
<li class="fragment">Possible exploit - predicatable cookies for users/non-expiring cookies/any other crazy idea depending on implementation</li>
</ul>
</section>
<section>
<h2>User-Agent</h2>
<ul>
<li class="fragment">Includes information about your browser, browser version, OS and OS version.</li>
</ul>
</section>
<section>
<h2>Common places to look for flags/clues</h2>
<p class="fragment">Cookie</p>
<p class="fragment">User-agent</p>
<p class="fragment">HTTP Method</p>
<p class="fragment">robots.txt</p>
<p class="fragment">Source code</p>
<p class="fragment">...custom application exploits</p>
</section>
<section>
<h2>CTF Questions</h2>
</section>
<section>
<img src="images/ctf-inspect.png" />
<p>http://2018shell.picoctf.com:28831</p>
</section>
<section>
<img src="images/ctf-button.png" />
<p>http://2018shell.picoctf.com:18342</p>
</section>
<section>
<img src="images/ctf-admin.png" />
<p>http://2018shell.picoctf.com:57252</p>
</section>
<section data-background="images/hack.jpg" data-background-size="contain">
</section>
<section>
<h2>Thanks for attending. Questions?</h2>
</section>
</div>
</div>
<script src="js/reveal.js"></script>
<script>
// More info about config & dependencies:
// - https://github.com/hakimel/reveal.js#configuration
// - https://github.com/hakimel/reveal.js#dependencies
Reveal.initialize({
transition: 'concave',
transitionSpeed: 'slow',
// Parallax background image
//parallaxBackgroundImage: "https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg",
// Parallax background size
//parallaxBackgroundSize: "2100px 900px", //- currently only pixels are supported (don't use % or auto)
// Number of pixels to move the parallax background per slide
// - Calculated automatically unless specified
// - Set to 0 to disable movement along an axis
//parallaxBackgroundHorizontal: 200,
//parallaxBackgroundVertical: 50,
dependencies: [
{ src: 'plugin/markdown/marked.js' },
{ src: 'plugin/markdown/markdown.js' },
{ src: 'plugin/notes/notes.js', async: true },
{ src: 'plugin/highlight/highlight.js', async: true },
]
});
Reveal.addEventListener( 'ready', () => {
//Reveal.slide(100)
});
(new MutationObserver(function(mutations, observer) {
mutations.reduce(function(accumulator, current) {
return accumulator.concat(Array.prototype.slice.call(
current.addedNodes));
}, []).forEach(function(el) {
if(/video/i.test(el.tagName)) {
el.controls = true;
}
});
})).observe(document.body, {
childList: true,
subtree: true
});
</script>
</body>
</html>