<?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 Tpw on Medium]]></title>
        <description><![CDATA[Stories by Tpw on Medium]]></description>
        <link>https://medium.com/@tpw8677?source=rss-3c6cdc510785------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*7IVzpt2q_ygzhgAf</url>
            <title>Stories by Tpw on Medium</title>
            <link>https://medium.com/@tpw8677?source=rss-3c6cdc510785------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 13:34:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tpw8677/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 TryHackMe Walkthrough]]></title>
            <link>https://medium.com/@tpw8677/creative-tryhackme-walkthrough-6cf405c71613?source=rss-3c6cdc510785------2</link>
            <guid isPermaLink="false">https://medium.com/p/6cf405c71613</guid>
            <category><![CDATA[tryhackme-writeup]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[creative]]></category>
            <dc:creator><![CDATA[Tpw]]></dc:creator>
            <pubDate>Thu, 18 Apr 2024 08:39:41 GMT</pubDate>
            <atom:updated>2024-04-18T08:45:05.104Z</atom:updated>
            <content:encoded><![CDATA[<p>tryhackme <a href="https://tryhackme.com/r/room/creative">https://tryhackme.com/r/room/creative</a></p><p>Start off with an nmap scan</p><p>target ip is 10.10.118.16</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/739/1*gWuGDfLszGFxVb8Cl6X64Q.png" /></figure><p>The nmap scan uses tags</p><ul><li>-A for OS, scripts and service versions</li><li>-T4 for faster scan — can be level 1–5</li><li>-p- for scanning all ports</li><li>— min-rate 5000 — to speed up scan</li></ul><p>Can see from the nmap scan have open ports 22 ssh 8.2p1, 80 http nginx 1.18.0 and its a linux OS.</p><p>Lets have a look at port 80 http on the browser <a href="http://10.10.118.16/">http://10.10.118.16</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*NWOXfeEo8BqO-9YaQzhZ6w.png" /></figure><p>In browser can see the target ip is redirected to creative.thm in the url bar</p><p>Need to add creative.thm to the hosts file</p><p>on a terminal</p><p>nano /etc/hosts</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/709/1*F1vpUSPpPWQBolLZtWTr7Q.png" /></figure><p>Add creative.thm to /etc/hosts file and save and exit.</p><p>Now in browser go to <a href="http://creative.thm/">http://creative.thm</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rp-Uqt584Wkn-wKUS2GWzA.png" /></figure><p>Can see webpage creative studio — with many different options — click around found nothing — view source — nothing</p><p>Search for hidden directories with gobuster</p><p>Doing a directory scan with tags</p><ul><li>-u for ip address of target</li><li>-w for wordlist used in scan</li><li>-x for extensions used to scan for</li><li>-t for 50 threads</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bt5Ol2nqqLN1fc_NRdEFjA.png" /></figure><p>found /assets — checkeed in browser <a href="http://creative.thm/assets/">http://creative.thm/assets/</a> — access denied. This scan no use. Move on to next step.</p><p>Scan for subdomains with gobuster</p><p>Doing a vhost scan with tags</p><ul><li>-w for wordlist used</li><li>-u for ip address of target</li><li>— append-domain to add anything found to the target domain creative.thm</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7uoLgubBvnh4hMizs7OiWg.png" /></figure><p>From the vhost gobuster scan found beta.creative.thm</p><p>Add to beta.creative.thm to /etc/hosts file same way as added creative.thm</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*U0eBGflvuXdxp4EpgBE6RQ.png" /></figure><p>save and exit</p><p>Now in browser go to <a href="http://beta.creative.thm/">http://beta.creative.thm</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1KQ8zsRrmpK1mat1Uxlx1A.png" /></figure><p>In browser we see the webpage for Beta URL Tester with an input box and submit button</p><p>Enter the url <a href="http://localhost/">http://localhost</a> —( localhost is creative.thm the target) into the input box. we get the HTML of the creative.thm website:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YGwl9g8A3i5p4EArphAEUg.png" /></figure><p>lets try <a href="http://localhost:port/">http://localhost:port</a> to see if there are any other HTTP services that are not accessible from outside?</p><p>We going to use Burps intruder to scan through the top 50 ports to see if any the ports are accessible.</p><p>google 50 common ports <a href="https://www.geeksforgeeks.org/50-common-ports-you-should-know/">https://www.geeksforgeeks.org/50-common-ports-you-should-know/</a></p><p>make a text file with the top 50 tcp ports</p><p>nano top_50_tcp_ports</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/1*Tdwl329LgWK5P8hdFFOA9g.png" /></figure><p>Not all ports are shown in img above. save and exit</p><p>now open Burp Suite, turn on foxy proxy — firefox extension — set to port 8080 and 127.0.0.1</p><p>Turn on intercept in burp and capture the request <a href="http://localhost:port">http://localhost:port</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1EG8npUVWNlAMKBS6gcjMA.png" /></figure><p>Now in burp should see the captured request</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WuMhWJm71xJeN7_h5i4sOg.png" /></figure><p>Now right click request and send to intruder</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1VzYXw_RpptHmFyWeiXSzQ.png" /></figure><p>change url=<a href="http://localhost/">http://localhost</a>:§80§/ at the bottom of the request. The § can be added from the left side.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qVwoTyYL-pfP-VwizMkfBg.png" /></figure><p>Click on payloads and load thetext file created for top 50 ports — top_50_tcp_ports. Then start attack</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Eui5bPkUgr37_4sO73-Vcg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QVi7DXOAdx52_ZmHMDlgEg.png" /></figure><p>Can see from the attack that port 1337 has a different length to all others and when clicked on the response it shows details — the directory listing for the target. So port 1337 is the port we can use to find more info about the target.</p><p>Now in the browser disable foxy proxy and on the webpage for beta.creative.thm input <a href="http://localhost:1337/etc/passwd">http://localhost:1337/etc/passwd</a> and submit</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U-3hakxVp9Zgo120qL5GNQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*95NYm_h9UWL0cVdRwAwhww.png" /></figure><p>The output when submitted shows the /etc/passwd file for the target. Right click and view source to see it clearer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rADq3rs9IZ_zAFuzN5ldkQ.png" /></figure><p>Can see user saad on the target</p><p>Now search for the user saad id_rsa private ssh key. Input <a href="http://localhost:1337/home/saad/.ssh/id_rsa">http://localhost:1337/home/saad/.ssh/id_rsa</a> and submit</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P62RcZI787c_R39mTT4_yg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wql-vPElIr6akzaCN48CcQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mWliOUI_Eo8J3U5ym4YDBA.png" /></figure><p>Can see saad private ssh key. copy and paste the entire key to a file id_rsa</p><p>nano id_rsa</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/711/1*DD82nESq57MkMhoj99Tf-A.png" /></figure><p>save and exit.</p><p>Now to find the passphrase so we can ssh into the target</p><p>change the permissions of id_rsa to be more secure</p><p>Locate ssh2john — found its in the location /usr/share/john/ssh2john.py</p><p>Run that ssh2john with python and save to file password.hash</p><p>python3 /usr/share/john/ssh2john.py id_rsa &gt; password.hash</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/734/1*0wU1JU-vh_5c8Bgj8P4RsQ.png" /></figure><p>Now use john the ripper to crack the password with the rockyou.txt wordlist.</p><p>john password.hash — wordlist=/usr/share/wordlists/rockyou.txt</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*mtroz9dSdkHmC7vHdDJmyA.png" /></figure><p>Found the password. Alright now its time to get a connection to the target with ssh.</p><p>target ip has changed cause had to restart the machine lol</p><p>target ip is now 10.10.59.12</p><p>So now ssh into the target with the cmd</p><p>ssh -i id_rsa saad@10.10.59.12</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/733/1*P00niy9dhyak0AP1KEGYXA.png" /></figure><p>We have a connection to the target. Clear the screen</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/741/1*u-goh92UqqLgFbW7egrklA.png" /></figure><p>ls — to see whats in the current directory</p><p>found the user flag</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/1*iefSokuQbKi4uhhpCJk9Aw.png" /></figure><p>Now to find the root flag</p><p>ls -la to see any hidden files</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*D82d5Yy0Nw297evxyG5ykg.png" /></figure><p>can see file .bash_history. Lets check that out</p><p>cat .bash_history</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/737/1*oe9HCIa-Bw8byvhoU1VorA.png" /></figure><p>Can see a password for user saad. copy that password</p><p>Priv Esc</p><p>first thing well try is sudo -l with the password found</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/726/1*wrMbVacpSBMEWwuyLeJ0gA.png" /></figure><p>success found user saad can run /usr/bin/ping as root</p><p>Also can see env_keep+=LD_PRELOAD</p><p>go to GTFOBins github webpage to check out ping with sudo</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GKOWJS0gG__nRqL2qZGrvQ.png" /></figure><p>No entry for ping only has fping and hping3</p><p>check out env_keep+=LD_PRELOAD</p><p>google found this <a href="https://www.hackingarticles.in/linux-privilege-escalation-using-ld_preload/">https://www.hackingarticles.in/linux-privilege-escalation-using-ld_preload/</a></p><p>So following the steps in the article.</p><p>change directory to the temp /tmp</p><p>create a file shell.c using nano</p><p>nano shell.c</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*crDELBfvSYE0rIvR1wTyxg.png" /></figure><p>add the code below to file shell.c and save and exit</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/731/1*3YYciDQnRvV0TVvxFh_DRg.png" /></figure><p>Compile the file shell.c to output file shell.so</p><p>gcc -fPIC -shared -o shell.so shell.c -nostartfiles</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*FrLNEsPGQPxUkvvhh8P-ww.png" /></figure><p>ls -can now see files shell.c and shell.so in the tmp directory</p><p>Now run the command</p><p>sudo LD_PRELOAD=/tmp/shell.so ping</p><p>(use ping from (root) /usr/bin/ping from running sudo -l)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*4ax1rZrHH50Eb3K7oSXyfA.png" /></figure><p>#whoami</p><p>root</p><p>We are now the root user</p><p>cat /root/root.txt to get the root flag.</p><p>Cheers.</p><p>Cyas next time :D</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6cf405c71613" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>