<?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 Riaz Royel on Medium]]></title>
        <description><![CDATA[Stories by Riaz Royel on Medium]]></description>
        <link>https://medium.com/@riazroyel?source=rss-41bd5936d4e7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*0BCPtE9BeWEQsfJy2fFUFQ.jpeg</url>
            <title>Stories by Riaz Royel on Medium</title>
            <link>https://medium.com/@riazroyel?source=rss-41bd5936d4e7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 07:44:35 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@riazroyel/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[HackTheBox(Easy): Bashed Walkthrough]]></title>
            <link>https://medium.com/@riazroyel/hackthebox-easy-bashed-walkthrough-6809e2eec194?source=rss-41bd5936d4e7------2</link>
            <guid isPermaLink="false">https://medium.com/p/6809e2eec194</guid>
            <category><![CDATA[hackthebox-writeup]]></category>
            <category><![CDATA[bashed]]></category>
            <category><![CDATA[hackthebox-walkthrough]]></category>
            <category><![CDATA[hackthebox]]></category>
            <dc:creator><![CDATA[Riaz Royel]]></dc:creator>
            <pubDate>Mon, 01 Jul 2024 04:54:08 GMT</pubDate>
            <atom:updated>2024-07-01T04:54:08.486Z</atom:updated>
            <content:encoded><![CDATA[<p>Step 1: First, we perform an Nmap scan. We can see that only port 80 is open.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/793/1*VhjUyuMAg63ERprfV5EEjg.png" /></figure><p>Step 2: We browsed the website and found nothing, so we performed directory brute-force to uncover hidden directories. We discovered a ‘dev’ directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/779/1*I905gusXwZuTcNI9vVw0Jw.png" /></figure><p>Step 3: We go to the ‘dev’ directory, which contains the ‘bashphp.php’ file. When we click on this file, we gain shell access. Next, we navigate to the home directory and proceed to the ‘arrexel’ user’s directory to locate the user flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/923/1*MO5jwQB7XK7FI0p8FxVDQA.png" /></figure><p>Step 4: We go to PentestMonkey and find a Python reverse shell. We copy the reverse shell code and replace the attacker’s IP and port with our own to establish the reverse shell connection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j-OkqT7sFi3CsGbmsmJM0g.png" /></figure><p>Step 5: We ran the nc command, then accessed the victim machine to execute a reverse shell successfully. After obtaining the reverse shell, we used the command python -c &#39;import pty; pty.spawn(&quot;/bin/bash&quot;)&#39; to gain an interactive TTY shell. With this interactive shell, we executed sudo -l to check for sudo permissions on any SUID binaries. We discovered that the scriptmanager user can execute commands with NOPASSWD. To escalate privileges, we ran sudo -i -u scriptmanager and switched from the www-data user to the scriptmanager user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/921/1*y_Wd4Sfo4WSwbw1Z1zdlQQ.png" /></figure><p>Step 6: We use the Python reverse shell named shell.py and run an HTTP server on our attacker machine to transfer the reverse shell file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oDttMpm74NIiQaQ5hQVqDA.png" /></figure><p>Step 7: Now, we import the Python os module to execute a single system command. We use echo &#39;os.system(&quot;cat /root/root.txt &gt; /tmp/flag.txt&quot;)&#39; &gt;&gt; test.py to redirect the contents of the root.txt file to /tmp/flag.txt, overwriting the test.py file. We concatenate the /tmp/flag.txt file to obtain the root flag, thus solving the lab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/1*6J_NgG3kthmJf0c7Gq0UmA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6809e2eec194" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HackTheBox(Easy): Explore Walkthrough]]></title>
            <link>https://medium.com/@riazroyel/hackthebox-easy-explore-walkthrough-107f2582709a?source=rss-41bd5936d4e7------2</link>
            <guid isPermaLink="false">https://medium.com/p/107f2582709a</guid>
            <category><![CDATA[adb]]></category>
            <category><![CDATA[andorid]]></category>
            <category><![CDATA[hackthebox]]></category>
            <category><![CDATA[hackthebox-writeup]]></category>
            <dc:creator><![CDATA[Riaz Royel]]></dc:creator>
            <pubDate>Thu, 20 Jun 2024 15:32:15 GMT</pubDate>
            <atom:updated>2024-07-01T04:53:30.817Z</atom:updated>
            <content:encoded><![CDATA[<p>Step 1: First of all, perform an Nmap scan on this box. nmap -T4 -sCV -p- -oN explore 10.10.10.247.the result will be this.</p><pre>Nmap 7.91 scan initiated Fri Sep  3 20:32:32 2021 as: nmap -T4 -sCV -p- -oN explore 10.10.10.247<br>Warning: 10.10.10.247 giving up on port because retransmission cap hit (6).<br>Nmap scan report for 10.10.10.247<br>Host is up (0.71s latency).<br>Not shown: 65485 closed ports, 46 filtered ports<br>PORT      STATE SERVICE VERSION<br>2222/tcp  open  ssh     (protocol 2.0)<br>| fingerprint-strings: <br>|   NULL: <br>|_    SSH-2.0-SSH Server - Banana Studio<br>| ssh-hostkey: <br>|_  2048 71:90:e3:a7:c9:5d:83:66:34:88:3d:eb:b4:c7:88:fb (RSA)<br>42135/tcp open  http    ES File Explorer Name Response httpd<br>42893/tcp open  unknown<br>| fingerprint-strings: <br>|   GenericLines: <br>|     HTTP/1.0 400 Bad Request<br>|     Date: Fri, 03 Sep 2021 15:24:51 GMT<br>|     Content-Length: 22<br>|     Content-Type: text/plain; charset=US-ASCII<br>|     Connection: Close<br>|     Invalid request line:<br>|   GetRequest: <br>|     HTTP/1.1 412 Precondition Failed<br>|     Date: Fri, 03 Sep 2021 15:24:52 GMT<br>|     Content-Length: 0<br>|   HTTPOptions: <br>|     HTTP/1.0 501 Not Implemented<br>|     Date: Fri, 03 Sep 2021 15:24:58 GMT<br>|     Content-Length: 29<br>|     Content-Type: text/plain; charset=US-ASCII<br>|     Connection: Close<br>|     Method not supported: OPTIONS<br>|   Help: <br>|     HTTP/1.0 400 Bad Request<br>|     Date: Fri, 03 Sep 2021 15:25:18 GMT<br>|     Content-Length: 26<br>|     Content-Type: text/plain; charset=US-ASCII<br>|     Connection: Close<br>|     Invalid request line: HELP<br>|   RTSPRequest: <br>|     HTTP/1.0 400 Bad Request<br>|     Date: Fri, 03 Sep 2021 15:24:59 GMT<br>|     Content-Length: 39<br>|     Content-Type: text/plain; charset=US-ASCII<br>|     Connection: Close<br>|     valid protocol version: RTSP/1.0<br>|   SSLSessionReq: <br>|     HTTP/1.0 400 Bad Request<br>|     Date: Fri, 03 Sep 2021 15:25:19 GMT<br>|     Content-Length: 73<br>|     Content-Type: text/plain; charset=US-ASCII<br>|     Connection: Close<br>|     Invalid request line: <br>|     ?G???,???`~?<br>|     ??{????w????&lt;=?o?<br>|   TLSSessionReq: <br>|     HTTP/1.0 400 Bad Request<br>|     Date: Fri, 03 Sep 2021 15:25:22 GMT<br>|     Content-Length: 71<br>|     Content-Type: text/plain; charset=US-ASCII<br>|     Connection: Close<br>|     Invalid request line: <br>|     ??random1random2random3random4<br>|   TerminalServerCookie: <br>|     HTTP/1.0 400 Bad Request<br>|     Date: Fri, 03 Sep 2021 15:25:21 GMT<br>|     Content-Length: 54<br>|     Content-Type: text/plain; charset=US-ASCII<br>|     Connection: Close<br>|     Invalid request line: <br>|_    Cookie: mstshash=nmap<br>59777/tcp open  http    Bukkit JSONAPI httpd for Minecraft game server 3.6.0 or older<br>|_http-title: Site doesn&#39;t have a title (text/plain).<br>2 services unrecognized despite returning data. If you know the service/version, please submit the following fingerprints at https://nmap.org/cgi-bin/submit.cgi?new-service :<br>==============NEXT SERVICE FINGERPRINT (SUBMIT INDIVIDUALLY)==============<br>SF-Port2222-TCP:V=7.91%I=7%D=9/3%Time=61323A6F%P=x86_64-pc-linux-gnu%r(NUL<br>SF:L,24,&quot;SSH-2\.0-SSH\x20Server\x20-\x20Banana\x20Studio\r\n&quot;);<br>==============NEXT SERVICE FINGERPRINT (SUBMIT INDIVIDUALLY)==============<br>SF-Port42893-TCP:V=7.91%I=7%D=9/3%Time=61323A70%P=x86_64-pc-linux-gnu%r(Ge<br>SF:nericLines,AA,&quot;HTTP/1\.0\x20400\x20Bad\x20Request\r\nDate:\x20Fri,\x200<br>SF:3\x20Sep\x202021\x2015:24:51\x20GMT\r\nContent-Length:\x2022\r\nContent<br>SF:-Type:\x20text/plain;\x20charset=US-ASCII\r\nConnection:\x20Close\r\n\r<br>SF:\nInvalid\x20request\x20line:\x20&quot;)%r(GetRequest,5C,&quot;HTTP/1\.1\x20412\x<br>SF:20Precondition\x20Failed\r\nDate:\x20Fri,\x2003\x20Sep\x202021\x2015:24<br>SF::52\x20GMT\r\nContent-Length:\x200\r\n\r\n&quot;)%r(HTTPOptions,B5,&quot;HTTP/1\.<br>SF:0\x20501\x20Not\x20Implemented\r\nDate:\x20Fri,\x2003\x20Sep\x202021\x2<br>SF:015:24:58\x20GMT\r\nContent-Length:\x2029\r\nContent-Type:\x20text/plai<br>SF:n;\x20charset=US-ASCII\r\nConnection:\x20Close\r\n\r\nMethod\x20not\x20<br>SF:supported:\x20OPTIONS&quot;)%r(RTSPRequest,BB,&quot;HTTP/1\.0\x20400\x20Bad\x20Re<br>SF:quest\r\nDate:\x20Fri,\x2003\x20Sep\x202021\x2015:24:59\x20GMT\r\nConte<br>SF:nt-Length:\x2039\r\nContent-Type:\x20text/plain;\x20charset=US-ASCII\r\<br>SF:nConnection:\x20Close\r\n\r\nNot\x20a\x20valid\x20protocol\x20version:\<br>SF:x20\x20RTSP/1\.0&quot;)%r(Help,AE,&quot;HTTP/1\.0\x20400\x20Bad\x20Request\r\nDat<br>SF:e:\x20Fri,\x2003\x20Sep\x202021\x2015:25:18\x20GMT\r\nContent-Length:\x<br>SF:2026\r\nContent-Type:\x20text/plain;\x20charset=US-ASCII\r\nConnection:<br>SF:\x20Close\r\n\r\nInvalid\x20request\x20line:\x20HELP&quot;)%r(SSLSessionReq,<br>SF:DD,&quot;HTTP/1\.0\x20400\x20Bad\x20Request\r\nDate:\x20Fri,\x2003\x20Sep\x2<br>SF:02021\x2015:25:19\x20GMT\r\nContent-Length:\x2073\r\nContent-Type:\x20t<br>SF:ext/plain;\x20charset=US-ASCII\r\nConnection:\x20Close\r\n\r\nInvalid\x<br>SF:20request\x20line:\x20\x16\x03\0\0S\x01\0\0O\x03\0\?G\?\?\?,\?\?\?`~\?\<br>SF:0\?\?{\?\?\?\?w\?\?\?\?&lt;=\?o\?\x10n\0\0\(\0\x16\0\x13\0&quot;)%r(TerminalSer<br>SF:verCookie,CA,&quot;HTTP/1\.0\x20400\x20Bad\x20Request\r\nDate:\x20Fri,\x2003<br>SF:\x20Sep\x202021\x2015:25:21\x20GMT\r\nContent-Length:\x2054\r\nContent-<br>SF:Type:\x20text/plain;\x20charset=US-ASCII\r\nConnection:\x20Close\r\n\r\<br>SF:nInvalid\x20request\x20line:\x20\x03\0\0\*%\?\0\0\0\0\0Cookie:\x20mstsh<br>SF:ash=nmap&quot;)%r(TLSSessionReq,DB,&quot;HTTP/1\.0\x20400\x20Bad\x20Request\r\nDa<br>SF:te:\x20Fri,\x2003\x20Sep\x202021\x2015:25:22\x20GMT\r\nContent-Length:\<br>SF:x2071\r\nContent-Type:\x20text/plain;\x20charset=US-ASCII\r\nConnection<br>SF::\x20Close\r\n\r\nInvalid\x20request\x20line:\x20\x16\x03\0\0i\x01\0\0e<br>SF:\x03\x03U\x1c\?\?random1random2random3random4\0\0\x0c\0/\0&quot;);<br>Service Info: Device: phone</pre><p>according to the information presented by the scan, this is a phone. researching about the identified services i found some interesting info.</p><p>JSONAPI is a plugin for Bukkit that allows you to access data and other information about your server and your players through a simple, yet secure, HTTP API. This allows you to make awesome websites, iPhone apps, and a way for your players to purchase goods online and automatically receive them in game.</p><p>Step 2: Port 42135 is running ES File Explorer, which creates an HTTP service bound to port 59777. By doing a search, you can find a public exploit (CVE-2019–6447).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_ehbyOzAgmSvFq4y.png" /></figure><p>Step 3: Using this exploit, I was able to read some files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/0*PXPI9qJ0dKw6g2Ft.png" /></figure><p>Step 4: After listing the pictures, I got an interesting .jpg file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/652/0*-DhWAun95V4JheAW.png" /></figure><p>Step 5: I have downloaded the file.</p><pre>python3 explorer-exploit.py listPics 10.10.10.247<br>python3 explorer-exploit.py getFile 10.10.10.247 /storage/emulated/0/DCIM/creds.jpg</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/677/0*2B9BrLCxlvGUCu-V.png" /></figure><p>Step 6: I opened the .jpg file, and it contains notes that look like credentials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/441/0*yNA3bt3jZIzGbKxA.png" /></figure><p>Step 7: As previously mentioned, the SSH service is running on port 2222. Using these credentials, we were able to log in successfully.</p><pre>ssh kristi@10.10.10.247 -p 2222</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/618/0*8gpNF4iKWU2Wj4At.png" /></figure><p>Step 8: Now I’m able to get inside this machine and find the user flag at /sdcard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/627/0*dEHB8htz02LHqUJn.png" /></figure><p>Step 9: While exploring ways to gain deeper control over the Android system, I came across information about Android Debug Bridge (adb). Adb is a development tool that allows communication between an Android device and a computer via a shell. According to some documentation, adb opens a local port (5555) as “system,” which can be accessed through USB by configuring the port accordingly. However, it is possible to bypass this restriction by using SSH to perform port forwarding to your machine.</p><pre>ssh kristi@10.10.10.247 -L 5555:localhost:5555 -p 2222</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/570/0*66Pi32Z7C4hl7fEZ.png" /></figure><p>Step 10: After inserting the password to establish the connection, the SSH shell starts. In another terminal, it is possible to see the localhost port 5555 forwarded to our machine. With that, it is possible to interact with this port using adb. Since adb is running with privileges, we can elevate our privileges to root.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/709/0*u8bUwkmhbppgdOmT.png" /></figure><p>Step 11: And now, as root, I could find the root flag using the find command to search for it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/753/0*tUTzTyAxK1AdNr9I.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=107f2582709a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HackTheBox(Easy): Shocker Walkthrough]]></title>
            <link>https://medium.com/@riazroyel/hackthebox-easy-shocker-walkthrough-4f486bb1e573?source=rss-41bd5936d4e7------2</link>
            <guid isPermaLink="false">https://medium.com/p/4f486bb1e573</guid>
            <category><![CDATA[hackthebox]]></category>
            <category><![CDATA[hackthebox-writeup]]></category>
            <category><![CDATA[hackthebox-walkthrough]]></category>
            <dc:creator><![CDATA[Riaz Royel]]></dc:creator>
            <pubDate>Wed, 19 Jun 2024 14:54:43 GMT</pubDate>
            <atom:updated>2024-06-19T15:51:25.969Z</atom:updated>
            <content:encoded><![CDATA[<p>Step 1: First, we perform Nmap scan and find that ports 80 and 2222 are open.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NwGVx2jCDAXNSQxDVpR2wA.png" /></figure><p>Step 2: After performing an Nmap scan, we see that port 80 is open. We browse the webpage to view the contents of this website, but it appears to be a simple site and we could not find anything interesting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/908/1*i6xi4gMW3uglTDmdEQmsbw.png" /></figure><p>Step 3: Now, we perform a directory brute force attack to find hidden directories.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*1bmA9JiFNI7rA7_5xyfWuA.png" /></figure><p>Step 4: We find three directories. First, we browse cgi-bin but couldn’t find anything. Then, we browse server-status, but this directory is forbidden. The index.html file is the homepage of this website. Next, we perform directory brute force again in cgi-bin with some file extensions like .php, .sh, .txt, etc. We find a user.sh file inside this directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/921/1*CjjqVmzcn3wOXBRIs5GFdg.png" /></figure><p>Step 5: Now we navigate to <a href="http://10.10.10.56/cgi-bin/user.sh.">http://10.10.10.56/cgi-bin/user.sh.</a> This link allows the user.sh file to be downloaded. After researching, we discovered that the ability to download the .sh file indicates that the web server might be vulnerable to the Shellshock vulnerability. Further research on Google led us to a GitHub repository and a one-liner command to exploit this vulnerability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*loyNTe8qY1VC-Q_w_73VtQ.png" /></figure><p>Step 6: Now we use this one-liner for exploitation. We check our attacker IP address and put it in the one-liner command. Yes! We got a reverse connection. We can see all the users in the /etc/passwd file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nd3BEg4F8mE4L_y4td8cIw.png" /></figure><p>Yes, we got the users from /etc/passwd, which means it’s vulnerable to a Shellshock attack. Now, we run Netcat to get a reverse shell connection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/643/1*Cqoq0Ri-uhb3G9F8sqQh1w.png" /></figure><p>Step 8: Now we use a Bash reverse shell to gain system access instead of the /etc/passwd command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/1*tVIRTk6L5mXz5wYrWHgtpw.png" /></figure><p>Step 9: Boooooommmmmm! We got a reverse shell connection from the victim machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*64XFpIZzo0Vl8Qn9J-IwNQ.png" /></figure><p>Step 10: Now, go to the home directory and locate the ‘shelly’ user. Enter this user’s directory, where you will find the ‘user.txt’ file. Open this file to view its contents and then submit the user flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/573/1*8Jxg53rTqFHDrLX-Yar3Xw.png" /></figure><p>Step 11: We have obtained the user flag. Now, we need to gain root access on this system to retrieve the root.txt file. We use ‘sudo -l’ to check for any SUID binary that has sudo permissions. We can see that the Perl binary has sudo permissions without requiring a password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/849/1*VOs5Fw4DPnoJm3sEzxMlxQ.png" /></figure><p>Step 12: We visit GTFOBins to find SUID binaries commands for privilege escalation. We specifically search for Perl because it can run as root without requiring a password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DCPeJrXpUUFtnSILw1h_iA.png" /></figure><p>Step 13: We modified the command to ensure it works properly. After applying this modified command, we gained root access to the system. We changed directory to /root and viewed the files in that directory. We found the root.txt file, viewed its contents, and submitted the flag. Yeeeeeess, we pwned the Shocker machine!.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*ukkVKeFEbuRM_aO4U75gDA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4f486bb1e573" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TryHackMe: Steel Mountain Walkthrough]]></title>
            <link>https://medium.com/@riazroyel/tryhackme-steel-mountain-walkthrough-3f1ae56f0382?source=rss-41bd5936d4e7------2</link>
            <guid isPermaLink="false">https://medium.com/p/3f1ae56f0382</guid>
            <dc:creator><![CDATA[Riaz Royel]]></dc:creator>
            <pubDate>Mon, 12 Jun 2023 17:54:19 GMT</pubDate>
            <atom:updated>2023-06-12T17:55:09.891Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Task 1: Introduction</strong></h3><ol><li>Deploy the machine and As always, start with nmap port scanning.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/929/1*KafcAA-WI-gNyCBnBpgTjw.png" /></figure><p>2. Let’s open our target IP in the web browser and see what’s there.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5q5cyJMeobBQZqjanzoX0A.png" /></figure><p>3. View source for finding more information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/914/1*iH_GRZLocSpzVYr08lsJng.png" /></figure><p>4. Answer for the first question .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JBmikSCstWgNc5-2FhFyUg.png" /></figure><h3>Task 2: Initial Access</h3><p>5. In our nmap scan we have seen that 8080 port running web server on this target system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/864/1*7KmtWMViRMP_wJH9590nmQ.png" /></figure><p>6. Browse 8080 port and we have seen home page and in this page we have seen server information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/854/1*qnWal4HFSR-NovlLjmc1Xw.png" /></figure><p>7. We found that this is rejetto file server. This server version is HttpFileServer 2.3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/944/1*l6pkrw2j1f-98Qqf02__Cw.png" /></figure><p>8. We searched in exploitdb for finding any exploit regarding this server version. We found multiple exploits and we assumed that this server version vulnerable to RCE.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bkKtBP6KUed_8guhL7Yh4g.png" /></figure><p>9. We opened metasploit and searched CVE and we found this exploit. we used this exploit for exploiting this vulnerability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*NffZPyXaSph6Omval1ml6g.png" /></figure><p>10. Used this exploit and set required options for exploitation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/933/1*-etUXyeQJ-OLLl9ZIemfqw.png" /></figure><p>11. After setting all options we run this exploit and we have seen that we got meterpreter session.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/860/1*5TRcJYD2z6TNZ9gWrsfjyA.png" /></figure><p>12. We went to bill user’s home directory and found user flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/691/1*L6Lqf5K68qjJCgNVNkJtVg.png" /></figure><p>13. Answers of task 2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pP9wprNbVQmvThwOCeL_rQ.png" /></figure><h3>Task 3: Privilege Escalation</h3><p>14. To enumerate this machine, we used a powershell script called PowerUp, that’s purpose is to evaluate a Windows machine and determine any abnormalities. You can download the script <a href="https://github.com/PowerShellMafia/PowerSploit/blob/master/Privesc/PowerUp.ps1">here</a>. We used upload command in Metasploit to upload the script.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/742/1*1W0ZHZ4nK1YLhuOyiPOvnw.png" /></figure><p>15. To execute this using Meterpreter, we type <strong>load powershell</strong> into meterpreter. Then we type <strong>powershell_shell </strong>for entering into powrshell. After doing this we just have to run the PowerUp Powershell script by entering: <strong>. .\PowerUp.ps1 . </strong>Then we run <strong>Invoke-AllChecks </strong>and we have seen long listing abnormalities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/918/1*ZKPi9bo6LC2bL8s369SuoQ.png" /></figure><p>16. The CanRestart option being true, allows us to restart a service on the system, the directory to the application is also write-able. This means we can replace the legitimate application with our malicious one, restart the service, which will run our infected program. We Used msfvenom to generate a reverse shell as an Windows executable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/941/1*D1sFdNEVUkTQfe9OwoXNig.png" /></figure><p>17. We leave the PowerShell and stop <strong>AdvancedSystemCareService9</strong> service.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*X8g3L6m9usPAI2vHqn5x1g.png" /></figure><p>18. Again back to PowerShell and uploaded reverse shell with the name <strong>ASCService.exe </strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/787/1*_cLAy3SaszCo2AKt0nXmPQ.png" /></figure><p>19. We started <strong>AdvancedSystemCareService9</strong> service and started <strong>netcat</strong> on <strong>9001</strong> port for getting reverse shell connection. When we started this service we got reverse shell back as <strong>nt authority/sytem</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aB4mYuLlWdN0_O8LJVaVdQ.png" /></figure><p>20. We went to Desktop directory of administrator user and found root flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/643/1*uKRmrtDyUWsHIHlavCDMaA.png" /></figure><p>21. Answers of task 3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2WSBeE1Iljzg3uV5I6vVhA.png" /></figure><h3><strong>Task 4: Access and Escalation Without Metasploit</strong></h3><p>22. Answers of task 4.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/962/1*uBXnqGaSHLHgGQ6DWnikKQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f1ae56f0382" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HackTheBox: Cap Walkthrough]]></title>
            <link>https://medium.com/@riazroyel/hackthebox-cap-walkthrough-2214ba41b55a?source=rss-41bd5936d4e7------2</link>
            <guid isPermaLink="false">https://medium.com/p/2214ba41b55a</guid>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[htb-walkthrough]]></category>
            <category><![CDATA[hackthebox-writeup]]></category>
            <dc:creator><![CDATA[Riaz Royel]]></dc:creator>
            <pubDate>Thu, 11 May 2023 05:24:32 GMT</pubDate>
            <atom:updated>2023-05-11T05:24:32.874Z</atom:updated>
            <content:encoded><![CDATA[<p>Firstly the exploit began with the scan of open ports on the target. This is the first and the most important step while enumerating a machine. Let’s jump right in with nmap scan.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/562/0*3gQfqwof-KX28I-X.png" /></figure><p>Now we investigate port 80 in a web browser which displays an interesting dashboard of monitoring results of security events.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aekn4wHaCxcMUH4l.png" /></figure><p>Seems like a monitoring application with a few metrics. By further browsing into the application, we find a dashboard which has information about TCP and UDP packets with a download button. The downloaded file seems to be a PCAP file. We open this file using wireshark tool then analysis this file and could not find any sensitive information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4snQYdTz88Tp16l-.png" /></figure><p>After directory enumeration we find 0 directory. Chang directory in the end of the URL from 20 to 0 makes a change in the number of packet information in the dashboard. Again download this PCAP file and analysis using wireshark.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*iH1tg8cZCkVH7uvH.png" /></figure><p>We find ftp user and password form PCAP file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vN9OlZUgseQ5X39k.png" /></figure><p>Lets login ftp.but nothing out there.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/569/0*e2dMrbuKP4rhVmgr.png" /></figure><p>Try to login ssh with same credential.yeah we loged in as nathan user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/614/0*fMv7IwaSOycqVXrW.png" /></figure><p>We got user flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/490/0*CuqPGg-lcOTm1mWx.png" /></figure><p>Now for the Privilege escalation part, the result of LINPEAS shows an interesting finding about cap_setuid on Python 3.8’s binary and hence the machine’s name.Then, a quick search on gtfobins led me to the root shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ulbUBBiC7xvzf6w9.png" /></figure><p>We use this command and got root access in the target system. After getting root access go to /root directory and get the root flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*GX8ait8yPdN8HpBX.png" /></figure><p><strong>Finished</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2214ba41b55a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>