<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>tryhackme — drsh0&#39;s llog</title>
    <link>https://drsh0.writeas.com/tag:tryhackme</link>
    <description>my learning log; notes on cybersec activities, ctfs, and ill-equipped cyber adventures. Consume responsibly.</description>
    <pubDate>Tue, 17 Nov 2026 00:29:51 +0000</pubDate>
    <image>
      <url>https://i.snap.as/v7Oo2ci6.png</url>
      <title>tryhackme — drsh0&#39;s llog</title>
      <link>https://drsh0.writeas.com/tag:tryhackme</link>
    </image>
    <item>
      <title>Jack - TryHackMe</title>
      <link>https://drsh0.writeas.com/jack-tryhackme?pk_campaign=rss-feed</link>
      <description>https://tryhackme.com/room/jack&#xA;&#xA;Summary&#xA;exploit Wordpress web server&#xA;gain user shell&#xA;use Python to escalate to root&#xA;&#xA;Tools Used&#xA;nmap, wpscan, python, pspy</description>
      <content:encoded><![CDATA[<p><a href="https://tryhackme.com/room/jack" rel="nofollow ugc">https://tryhackme.com/room/jack</a></p>

<h2 id="summary">Summary</h2>
<ul><li>exploit Wordpress web server</li>
<li>gain user shell</li>
<li>use Python to escalate to root</li></ul>

<h3 id="tools-used">Tools Used</h3>
<ul><li><code>nmap</code>, <code>wpscan</code>, <code>python</code>, <code>pspy</code></li></ul>



<h2 id="enum">Enum</h2>

<h5 id="nmap">Nmap</h5>

<p><code>sudo nmap -A jack.thm -oN jack</code></p>

<p><code>nmap</code> tells us we have a host running ssh and serving a wordpress application.</p>

<p><details></p>

<pre><code># Nmap 7.80 scan initiated Sun Aug 30 03:57:41 2020 as: nmap -A -oN jack -v jack.thm
Nmap scan report for jack.thm (10.10.126.131)
Host is up (0.30s latency).
Not shown: 998 closed ports
PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 7.2p2 Ubuntu 4ubuntu2.7 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   2048 3e:79:78:08:93:31:d0:83:7f:e2:bc:b6:14:bf:5d:9b (RSA)
|   256 3a:67:9f:af:7e:66:fa:e3:f8:c7:54:49:63:38:a2:93 (ECDSA)
|_  256 8c:ef:55:b0:23:73:2c:14:09:45:22:ac:84:cb:40:d2 (ED25519)
80/tcp open  http    Apache httpd 2.4.18 ((Ubuntu))
|_http-favicon: Unknown favicon MD5: D41D8CD98F00B204E9800998ECF8427E
|_http-generator: WordPress 5.3.2
| http-methods: 
|_  Supported Methods: GET HEAD POST OPTIONS
| http-robots.txt: 1 disallowed entry 
|_/wp-admin/
|_http-server-header: Apache/2.4.18 (Ubuntu)
|_http-title: Jack&amp;#039;s Personal Site &amp;#8211; Blog for Jacks writing adven...
No exact OS matches for host (If you know what OS is running on it, see https://nmap.org/submit/ ).
TCP/IP fingerprint:
OS:SCAN(V=7.80%E=4%D=8/30%OT=22%CT=1%CU=42716%PV=Y%DS=4%DC=T%G=Y%TM=5F4B15C
OS:E%P=x86_64-pc-linux-gnu)SEQ(SP=106%GCD=1%ISR=10A%TI=Z%CI=I%II=I%TS=8)SEQ
OS:(SP=106%GCD=1%ISR=10A%TI=Z%CI=I%TS=8)OPS(O1=M509ST11NW7%O2=M509ST11NW7%O
OS:3=M509NNT11NW7%O4=M509ST11NW7%O5=M509ST11NW7%O6=M509ST11)WIN(W1=68DF%W2=
OS:68DF%W3=68DF%W4=68DF%W5=68DF%W6=68DF)ECN(R=Y%DF=Y%T=40%W=6903%O=M509NNSN
OS:W7%CC=Y%Q=)T1(R=Y%DF=Y%T=40%S=O%A=S+%F=AS%RD=0%Q=)T2(R=N)T3(R=N)T4(R=Y%D
OS:F=Y%T=40%W=0%S=A%A=Z%F=R%O=%RD=0%Q=)T5(R=Y%DF=Y%T=40%W=0%S=Z%A=S+%F=AR%O
OS:=%RD=0%Q=)T6(R=Y%DF=Y%T=40%W=0%S=A%A=Z%F=R%O=%RD=0%Q=)T7(R=Y%DF=Y%T=40%W
OS:=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)U1(R=Y%DF=N%T=40%IPL=164%UN=0%RIPL=G%RID=G%R
OS:IPCK=G%RUCK=G%RUD=G)IE(R=Y%DFI=N%T=40%CD=S)

Uptime guess: 0.014 days (since Sun Aug 30 03:38:38 2020)
Network Distance: 4 hops
TCP Sequence Prediction: Difficulty=262 (Good luck!)
IP ID Sequence Generation: All zeros
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

TRACEROUTE (using port 587/tcp)
HOP RTT       ADDRESS
1   167.61 ms 10.13.0.1
2   ... 3
4   304.95 ms jack.thm (10.10.126.131)

Read data files from: /usr/bin/../share/nmap
OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
# Nmap done at Sun Aug 30 03:58:22 2020 -- 1 IP address (1 host up) scanned in 41.89 seconds
</code></pre>

<p></details></p>

<h5 id="wpscan">WPScan</h5>

<p><code>wpscan --url jack.thm</code></p>

<blockquote><p>XML-RPC seems to be enabled</p></blockquote>

<p>We can use this to enumerate usernames. Let&#39;s try:
* <code>http://jack.thm/wp-json/wp/v2/users/1</code> – 200 – we are able to see the <em>jack</em> user (that we already know about)
* <code>http://jack.thm/wp-json/wp/v2/users/2</code> – 401 – not allowed to view this user
* <code>http://jack.thm/wp-json/wp/v2/users/99</code> – 404 – user not found</p>

<p>WPScan to the rescue as it provides user enumerition AND bruteforcing which may allow us into the <code>wp-admin</code> panel. We find 2 additional users.</p>

<p><code>wpscan --wpscan --url jack.thm --enumerate u</code></p>

<p>Put all three users into a users.txt file and use a wordlist of your choice to brute force. We are able to sucesfully obtain a password for a user. Use that to login to <code>wp-admin</code>.</p>

<p><code>wpscan --url jack.thm --passwords rockyou.txt --usernames users.txt</code></p>

<p>Unfortunately, once logged in, the user does not have any administrative rights. Time to move onto exploitation.</p>

<h2 id="exploit">Exploit</h2>

<h3 id="user">User</h3>
<ul><li><a href="https://www.exploit-db.com/exploits/44595" rel="nofollow ugc">https://www.exploit-db.com/exploits/44595</a></li>
<li>edit plugin php</li>
<li>insert php reverse shell</li>
<li>gain access to <code>www-data</code> user shell</li>
<li>obtain user flag</li></ul>

<h2 id="priv-esc">Priv Esc</h2>

<p>Our next aim is to move from <code>www-data</code> to <code>jack</code>. Fortunately, according to <code>reminder.txt</code> in jack&#39;s home directory, this user has an issue setting permissions on backups. Doing a quick check we find <code>/var/backups</code> that contains some goodies that <code>www-data</code> is able to read. Using this, we can SSH to the host.</p>

<p><code>find / -name backup* 2&gt;/dev/null</code></p>

<h2 id="root">Root</h2>
<ul><li>linPEAS (or any other privesc script of choice)</li>
<li>nothing of interest can be found apart from various interesting file access rights.</li>
<li>hint reveals that python is being used.</li>
<li>use <code>pspy</code> to monitor for any strange cronjobs by root</li>

<li><p>👀</p>
<ul><li><p><code>2020/08/30 00:26:01 CMD: UID=0    PID=3036   | /usr/bin/python /opt/statuscheck/checker.py</code></p>

<h5 id="python-exploitation">python exploitation</h5></li></ul></li></ul>

<p><code>checker.py</code>:</p>

<pre><code class="language-python">import os

os.system(&#34;/usr/bin/curl -s -I http://127.0.0.1 &gt;&gt; /opt/statuscheck/output.log&#34;)
</code></pre>

<p>From previous linenum scripts <code>jack</code> is a part of <code>family</code> which has write access to /usr/lib/python2.7/</p>

<p>Since we know <code>os.system</code> is being used in the script we have a lot of options to gain root access such as:</p>
<ul><li>modify <code>os.py</code> to facilitate a reverse shell.</li>
<li>change permissions of other files and folders within the system (as root).</li>
<li>change ssh configs to allow for password-less root access via ssh.</li>
<li>obtain the root flag and write it to a file that is world readable.</li></ul>

<p><a href="https://drsh0.writeas.com/tag:tryhackme" class="hashtag" rel="nofollow ugc"><span>#</span><span class="p-category">tryhackme</span></a> <a href="https://drsh0.writeas.com/tag:wordpress" class="hashtag" rel="nofollow ugc"><span>#</span><span class="p-category">wordpress</span></a> <a href="https://drsh0.writeas.com/tag:python" class="hashtag" rel="nofollow ugc"><span>#</span><span class="p-category">python</span></a></p>
]]></content:encoded>
      <guid>https://drsh0.writeas.com/jack-tryhackme</guid>
      <pubDate>Tue, 01 Dec 2020 06:04:31 +0000</pubDate>
    </item>
    <item>
      <title>TryHackMe | Advent of Cyber 2019</title>
      <link>https://drsh0.writeas.com/tryhackme-advent-of-cyber-2019?pk_campaign=rss-feed</link>
      <description>Link: https://tryhackme.com/room/25daysofchristmas Get started with Cyber Security in 25 Days – Learn the basics by doing a new, beginner...</description>
      <content:encoded><![CDATA[<p>Link: <a href="https://tryhackme.com/room/25daysofchristmas" rel="nofollow ugc">https://tryhackme.com/room/25daysofchristmas</a></p>

<blockquote><p>Get started with Cyber Security in 25 Days – Learn the basics by doing a new, beginner friendly security challenge every day leading up to Christmas</p></blockquote>

<h2 id="day-1">Day 1</h2>
<ul><li>cookies that have fixed values are bad as it allows attackers to guess the pattern and values.</li>
<li>a new cookie can be created from Firefox dev tools &gt; storage &gt; cookies &gt; add new</li></ul>

<h2 id="day-2">Day 2</h2>
<ul><li>check source pages</li>
<li>dir searching</li>
<li>github search for website</li></ul>

<h2 id="day-3">Day 3</h2>
<ul><li>for pcaps, the best thing to do is search for interesting activities e.g. telnet and ssh</li>
<li>follow stream to export to txt</li>
<li>johntheripper can work on <code>/etc/shadow</code> without needeing <code>/etc/passwd</code>.</li></ul>

<h2 id="day-4">Day 4</h2>
<ul><li>to find text within all files: <code>grep -Ril &#34;text&#34;</code>
<ul><li>to grep for all IP addresses: <code>grep -E -o &#34;([0-9]{1,3}[\.]){3}[0-9]{1,3}&#34; file.txt</code></li></ul></li>
<li>It&#39;s wise to search for *.bak files in case some world readable backups exist :
<code>find / -name *.bak 2&gt;/dev/null</code></li></ul>

<h2 id="day-5">Day 5</h2>
<ul><li>OSINT required creative google searches, social media, and the use of waybackmachine.</li></ul>

<h2 id="day-6">Day 6</h2>
<ul><li>Tools used:
<ul><li>wireshark-gtk</li>
<li>fcrackzip</li>
<li>steghide</li></ul></li></ul>

<h2 id="day-7">Day 7</h2>
<ul><li>strange protocols running on weird ports are worth trying out via http.</li></ul>

<h2 id="day-8">Day 8</h2>
<ul><li>if binaries such as <code>find</code> are running as another user you can usually use <code>exec</code> to execute something with that binary e.g.:</li></ul>

<pre><code>find /home/igor -name flag1.txt  -exec cat /home/igor/flag1.txt \;
</code></pre>
<ul><li>commonly used command to list all suid binaries:</li></ul>

<pre><code>find / -user root -perm -4000 -exec ls -ldb {} \; 2&gt;/dev/null
</code></pre>

<h2 id="day-10-metasploit">Day 10: Metasploit</h2>
<ul><li>After a quick nmap scan, there seems to be a tomcat server running on port 80.</li>
<li>Version enumeration reveals that it may be prone to the <a href="https://www.secjuice.com/apache-struts2-cve-2018-11776/" rel="nofollow ugc">struts2 vuln</a>.</li>
<li>Let&#39;s use the <code>struts2_content_type_ognl</code> exploit via MSF and configure hosts, ports, and path (path = “”).</li>
<li>exploit successful! Use meterpreter shell to exploit further and find a way to break out of the docker container.</li>
<li>SSH creds are available —&gt; this is how we break out.</li></ul>

<h2 id="day-11-network-exploitation">Day 11: Network Exploitation</h2>
<ul><li><code>nmap -A $IP -oA &lt;filename&gt;</code></li>
<li>We can see the following services open: ftp, nfs, mysql</li>
<li>Anonymous login is allowed on FTP. Use <code>ftp</code> to login and retrieve file and credentials.</li></ul>

<h4 id="nfs">NFS</h4>
<ul><li><code>showmount -e $IP</code> to check if NFS is present and directory path.</li>
<li><code>cd /tmp &amp;&amp; mkdir thm-nfs-11</code></li>
<li><code>sudo mount $IP:/opt/files thm-nfs-11</code></li>
<li>thm-nfs-11 contains a file with the flag.</li></ul>

<h4 id="mysql">MySQL</h4>
<ul><li>I&#39;ll be using <a href="https://github.com/dbcli/mycli" rel="nofollow ugc"><code>mycli</code></a> to connect to the msql database.</li>
<li><code>mycli -h $IP -P 3306 -u root</code></li>
<li><code>show databases</code></li>
<li><code>use data</code></li>
<li><code>show tables</code></li>
<li><code>SELECT * FROM &#39;USERS&#39;</code></li>
<li>Creds are now retrieved from the table.</li></ul>

<h2 id="day-12">Day 12</h2>

<p>1) <code>md5sum</code>
2) <code>gpg --decrypt note1.txt.gpg</code> with supplied passphrase
3a) Decrypt private RSA key first with supplied passphrase <code>openssl rsa -in private.key -out test.key</code>
3b) Then use <code>openssl rsautl -decrypt -inkey test.key -in note2_encrypted.txt -out note2_decrypted.txt</code> to obtain decrypted note.</p>

<h2 id="day-14-aws-s3-buckets">Day 14: AWS S3 Buckets</h2>
<ul><li>Buckets can be accessed via <code>bucketname.s3.amazonaws.com</code> or <code>bucketname.region-name.amazonaws.com</code></li>
<li>Bucket contents can be accessed via <code>bucketname.region-name.amazonaws.com/file-name</code></li></ul>

<h2 id="day-15-local-file-inclusion">Day 15: Local File Inclusion</h2>
<ul><li>Webservers will often pull files from local locations to display on a webpage.</li>
<li>It&#39;s best to have a look at the HTTP requests and start crafting potential LFI that way.</li>
<li>Be sure to encode the <code>/</code> using <code>%2F</code>.</li>
<li>Example payload: <code>http://host/get-file/%2fetc%2fpasswd</code></li></ul>

<p><a href="https://drsh0.writeas.com/tag:writeups" class="hashtag" rel="nofollow ugc"><span>#</span><span class="p-category">writeups</span></a> <a href="https://drsh0.writeas.com/tag:ctf" class="hashtag" rel="nofollow ugc"><span>#</span><span class="p-category">ctf</span></a> <a href="https://drsh0.writeas.com/tag:tryhackme" class="hashtag" rel="nofollow ugc"><span>#</span><span class="p-category">tryhackme</span></a></p>
]]></content:encoded>
      <guid>https://drsh0.writeas.com/tryhackme-advent-of-cyber-2019</guid>
      <pubDate>Sun, 08 Dec 2019 23:40:33 +0000</pubDate>
    </item>
  </channel>
</rss>