<?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 Usman AR on Medium]]></title>
        <description><![CDATA[Stories by Usman AR on Medium]]></description>
        <link>https://medium.com/@usman8529?source=rss-1011524813fa------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*xkpDJNUTmszr46vDVsca5A.jpeg</url>
            <title>Stories by Usman AR on Medium</title>
            <link>https://medium.com/@usman8529?source=rss-1011524813fa------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 25 Nov 2026 01:33:05 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@usman8529/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[TryHackMe Writeup — Wgel CTF]]></title>
            <link>https://medium.com/@usman8529/tryhackme-writeup-wgel-ctf-5b713dff2be5?source=rss-1011524813fa------2</link>
            <guid isPermaLink="false">https://medium.com/p/5b713dff2be5</guid>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[writeup]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Usman AR]]></dc:creator>
            <pubDate>Sat, 12 Sep 2020 20:45:30 GMT</pubDate>
            <atom:updated>2020-09-12T20:48:18.316Z</atom:updated>
            <content:encoded><![CDATA[<h3>TryHackMe Writeup — Wgel CTF</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/607/1*SScs7ISCEn829vEpT6_-mw.png" /></figure><p>Link — <a href="https://tryhackme.com/room/wgelctf">https://tryhackme.com/room/wgelctf</a></p><p>In this writeup I am going to walk you through the beginner level box on TryHackMe which is named Wgel CTF and it involves web recon including directory busting and port scanning.</p><p>So Let’s Begin</p><p>As usual lets kick start a nmap scan to see all the active ports and stuff</p><p>First we’ll run a scan with tag “-A” which will Enable OS detection, version detection, script scanning, and traceroute and the second tag “-T4” for faster timingmode.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/965/1*ivJulqfJglNOd377OFxoWQ.png" /><figcaption>nmap scan</figcaption></figure><p>We have two ports open port 80 which is running http and port 22 which is running ssh.</p><p>Lets open the web page and see what we got !!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yDC3D4LSaN-6CTB-fB92Yg.png" /><figcaption>Apache2 Ubuntu Default Page</figcaption></figure><p>We are greeted with a default Ubuntu web page which doesn’t seem to be interesting . Also its good to have a look at the code of the page which may hide some useful information in the form of comments for use to further in the box .</p><p>For this I developed a little tool which will extract all the HTML comments from the web page it is fed.</p><p>Link for the tool — <a href="https://github.com/UsmanAR/Comments-Out/">https://github.com/UsmanAR/Comments-Out/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/937/1*qmBFTQbmZ8ut6WoSBDuZ2g.png" /><figcaption>Comments-Out</figcaption></figure><p><strong>BOOM!!</strong> We find something interesting</p><p><em>&lt;! — Jessie dont forget to update the website --&gt;</em></p><p>“Jessie” looks like a potential username so lets just keep that in mind..</p><p>Now as you can see we have two open ports . Port 80 for http and port 22 having ssh being run on it.<br>Lets go ahead and launch gobuster against the machine and see what we get<br>I usually use the common.txt file from dirb initially and jump onto bigger lists if I dont find anything with the common.txt file .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XN_HD8_Dakjw6jshTzFIJw.png" /><figcaption>gobuster</figcaption></figure><p><strong>“/sitemap”</strong> ..now that looks interesting as well. Lets open it and see what it has to offer .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lzfg_qWhHo5Qr1vWJJMS5A.png" /><figcaption>UNAPP</figcaption></figure><p>We find a decent web page with several pages and don’t seem to find anything interesting on the pages.</p><p>gobuster may have something to offer so lets just run it against it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zo9Sx63aDgclOi89CpRGNg.png" /><figcaption>gobuster</figcaption></figure><p>Wow! <strong>“/.ssh” </strong>looks weird..lets quickly open it and see what it has !</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/474/1*luRJcQ0rK6V4hXGJIGo5Sw.png" /><figcaption>id_rsa</figcaption></figure><p>Beautiful!! We have the id_rsa of the possible user “Jessie”</p><p><strong>id_rsa</strong> is an <strong>RSA</strong> key and it can be used with the SSH protocol to login to ssh .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/855/1*Xsk_4oEUFArxGLLCV_LCIQ.png" /><figcaption>ssh</figcaption></figure><p><strong>We’re in !!!</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/859/1*3S97AYxMj1wKN4chMofxPw.png" /><figcaption>user_flag.txt</figcaption></figure><p>List the documents and boom we have the user flag ready to be submitted ..</p><p>Now let’s poke around and see if there’s anyway we can to escalate our privileges</p><p>I used the <strong>“sudo -l” </strong>command to list the commands that jessie can run as root and here’s what I found</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T1qk7ClyRLiSTUyt8PH9RA.png" /><figcaption>sudo -l</figcaption></figure><p><strong>(root) NOPASSWD: /usr/bin/wget</strong></p><p>This implies that jessie (i.e you) can run <strong>wget </strong>command as root without password.</p><p>So we start a netcat listener on port 4444</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/494/1*WbzgpCBpfXGrxFY_dEA9Hg.png" /><figcaption>netcat</figcaption></figure><p>And then we open another terminal and launch another ssh instance to send root_flag.txt to ourselves on port 4444 . And remember to use <strong>sudo </strong>command while doing so</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*KnVfL5vCyAF2snldy25fEA.png" /><figcaption>wget</figcaption></figure><p>And <strong>BOOM!!! </strong>we have the root flag</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/759/1*vEkLmX-Oo_aKIoZPRfu6cg.png" /><figcaption>root_flag.txt</figcaption></figure><p>Hope you enjoyed reading the writeup and learning with me !!</p><p>Show some love and support for more ❤!!</p><p>Thanks ! :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5b713dff2be5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>