<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: qwezii</title>
    <description>The latest articles on DEV Community by qwezii (@qwezii).</description>
    <link>https://dev.to/qwezii</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F334991%2Fd38d8ded-d89f-4fc9-9cf2-ff76b87fa65c.png</url>
      <title>DEV Community: qwezii</title>
      <link>https://dev.to/qwezii</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/qwezii"/>
    <language>en</language>
    <item>
      <title>Walkthrough - Bounty Hacker - TryHackMe</title>
      <dc:creator>qwezii</dc:creator>
      <pubDate>Sat, 01 Aug 2020 16:43:53 +0000</pubDate>
      <link>https://dev.to/qwezii/walkthrough-bounty-hacker-tryhackme-37kc</link>
      <guid>https://dev.to/qwezii/walkthrough-bounty-hacker-tryhackme-37kc</guid>
      <description>&lt;p&gt;This is a walkthrough on the &lt;a href="https://tryhackme.com/room/cowboyhacker"&gt;Bounty Hacker room&lt;/a&gt; in &lt;a href="https://tryhackme.com/"&gt;TryHackMe&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is a beginner room.&lt;/p&gt;

&lt;p&gt;I think this could be helpful for CEH preparation, this is not too complex.&lt;/p&gt;




&lt;p&gt;These are the steps I followed to get all the answers in the room.&lt;/p&gt;

&lt;p&gt;I used nmap to do a port scan on the system.&lt;br&gt;
&lt;code&gt;nmap -sS &amp;lt;IP-address&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;I found three open ports:&lt;br&gt;
  -- 21 ftp&lt;br&gt;
  -- 22 ssh&lt;br&gt;
  -- 80 http&lt;/p&gt;

&lt;p&gt;We see a website and we have some information on the website.&lt;br&gt;
Then I tried to do a sub-directory scan using &lt;a href="https://github.com/OJ/gobuster"&gt;Gobuster&lt;/a&gt;, available in Kali Linux.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gobuster dir -u HTTP://&amp;lt;IP-address&amp;gt;/ -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -t 100
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Here the option&lt;br&gt;
  dir is for directory scan&lt;br&gt;
  -u is for URL&lt;br&gt;
  -w is for wordlist&lt;br&gt;
  -t is for number of threads to run the scan&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mOws1Mtw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/c1fo3a078jbfvxxngtoy.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mOws1Mtw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/c1fo3a078jbfvxxngtoy.PNG" alt="Gobuster"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The scan does not show much either.&lt;/p&gt;

&lt;p&gt;And with this information, we can't do much. So, I went through an aggressive scan:&lt;br&gt;
&lt;code&gt;nmap -A &amp;lt;IP-address&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TOyBu1ys--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/xtmweufudjqjhembe5po.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TOyBu1ys--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/xtmweufudjqjhembe5po.PNG" alt="nmap"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can see that the ftp is vulnerable with anonymous login.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.howtoforge.com/tutorial/how-to-use-ftp-on-the-linux-shell/"&gt;Found this useful for this step&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--x4nEGbh5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ilzfru0z1n15o645m6lo.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--x4nEGbh5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ilzfru0z1n15o645m6lo.PNG" alt="ftp"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ftp &amp;lt;IP-address&amp;gt;&lt;/code&gt;&lt;br&gt;
And type Name as &lt;code&gt;anonymous&lt;/code&gt; and then no need for a password.&lt;/p&gt;

&lt;p&gt;When in FTP can use &lt;code&gt;?&lt;/code&gt; to display a help menu.&lt;/p&gt;

&lt;p&gt;To list all the files in your FTP session use &lt;code&gt;ls&lt;/code&gt;&lt;br&gt;
We see two files available. &lt;code&gt;task.txt&lt;/code&gt; and &lt;code&gt;locks.txt&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;We can set the local directory using &lt;code&gt;lcd&lt;/code&gt; command.&lt;/p&gt;

&lt;p&gt;Then we can use the &lt;code&gt;get&lt;/code&gt; command to get the files from the system to our system to analyze them.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GBREFg_9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/u89xn5i9b4hdcecjgef9.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GBREFg_9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/u89xn5i9b4hdcecjgef9.PNG" alt="GetFile"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Check the files using &lt;code&gt;cat&lt;/code&gt; command.&lt;br&gt;
First I checked the task.txt file I see that the author is named &lt;code&gt;lin&lt;/code&gt;. I assumed that must be the user of the system.&lt;/p&gt;

&lt;p&gt;Now I checked the lock.txt this file looks like a password list for the user.&lt;/p&gt;

&lt;p&gt;Now we have to brute-force the login for ssh, assuming the username is &lt;code&gt;lin&lt;/code&gt; and passwords must be from this list (lock.txt).&lt;/p&gt;

&lt;p&gt;I then used the &lt;a href="https://linuxconfig.org/ssh-password-testing-with-hydra-on-kali-linux"&gt;hydra&lt;/a&gt; password cracking tool.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;hydra -l lin -P locks.txt 10.10.234.166 -t 4 -e nsr ssh&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Cracked the password.&lt;br&gt;
Logged in as the user &lt;code&gt;lin&lt;/code&gt; with the cracked password.&lt;br&gt;
And at this point, we can exit the FTP connection.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--f88kONwl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/lur5uridmgqgxotor2rk.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--f88kONwl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/lur5uridmgqgxotor2rk.PNG" alt="SSH Login"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Checked the files in the user directory using &lt;code&gt;ls&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;We see the &lt;code&gt;user.txt&lt;/code&gt; file containing the user flag.&lt;br&gt;
&lt;code&gt;cat user.txt&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_8hy6wMK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/1kxf96e4fx16s4mb7tem.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_8hy6wMK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/1kxf96e4fx16s4mb7tem.PNG" alt="UserFlag"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then I tried to pivot to the root directory, to see that we do not have sufficient permissions.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cE7NWvxm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/k3kaznzxwko5qlma92dn.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cE7NWvxm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/k3kaznzxwko5qlma92dn.PNG" alt="root directory"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So can we do when we do not have enough permissions?&lt;br&gt;
We can check what else we can do as the user &lt;code&gt;lin&lt;/code&gt; using the command &lt;code&gt;sudo -l&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;We can see that the user &lt;code&gt;lin&lt;/code&gt; can run tar as root.&lt;br&gt;
Then I tried to check that in &lt;a href="https://gtfobins.github.io/gtfobins/tar/#sudo"&gt;gtfobins&lt;/a&gt;. Found the exploit for that.&lt;/p&gt;

&lt;p&gt;Ran the mentioned command and could pivot to root.&lt;/p&gt;

&lt;p&gt;Then &lt;code&gt;cd&lt;/code&gt; into the root user directory to find the root flag.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--AsZpePue--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ug3b6pslql6j75ik2izn.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--AsZpePue--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ug3b6pslql6j75ik2izn.PNG" alt="root flag"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There were some dead ends but I could go around them.&lt;br&gt;
Found this room a fun one.&lt;/p&gt;

</description>
      <category>cybersecurity</category>
      <category>tryhackme</category>
    </item>
    <item>
      <title>Walkthrough - OWASP Top 10 - TryHackMe</title>
      <dc:creator>qwezii</dc:creator>
      <pubDate>Fri, 17 Jul 2020 18:17:30 +0000</pubDate>
      <link>https://dev.to/qwezii/walkthrough-owasp-top-10-tryhackme-26lk</link>
      <guid>https://dev.to/qwezii/walkthrough-owasp-top-10-tryhackme-26lk</guid>
      <description>&lt;p&gt;Hi Guys!&lt;br&gt;
This is my very first Walkthrough/Write-Up.&lt;br&gt;
This is a Walkthrough on the &lt;a href="https://tryhackme.com/room/owasptop10"&gt;OWASP Top 10 room&lt;/a&gt; in &lt;a href="https://tryhackme.com/"&gt;TryHackMe&lt;/a&gt;.&lt;br&gt;
This is a beginner room - as in &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The challenges are designed for beginners and assume no previous knowledge of security.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;br&gt;
I am going to walk you through the steps I followed to find the answers.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
Day 1 Injection

&lt;ol&gt;
&lt;li&gt;Strange Text&lt;/li&gt;
&lt;li&gt;Number Of Users&lt;/li&gt;
&lt;li&gt;User&lt;/li&gt;
&lt;li&gt;User shell as&lt;/li&gt;
&lt;li&gt;Ubuntu Version&lt;/li&gt;
&lt;li&gt;MOTD&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;
Day 2 Broken Authentication

&lt;ol&gt;
&lt;li&gt;Darren's Account&lt;/li&gt;
&lt;li&gt;Arthur's Account&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;
Day 3 Sensitive Data Exposure

&lt;ol&gt;
&lt;li&gt;Sensitive Directory&lt;/li&gt;
&lt;li&gt;DB File&lt;/li&gt;
&lt;li&gt;Sensitive Data&lt;/li&gt;
&lt;li&gt;Admin Password&lt;/li&gt;
&lt;li&gt;Admin Flag&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Day 1 Injection
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Strange Text:
&lt;/h4&gt;

&lt;p&gt;A strange text file in the website root directory:&lt;br&gt;
    I used &lt;code&gt;ls&lt;/code&gt;. We see the output something like this:&lt;br&gt;
    &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_vt40BnS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/kyapd3z1xjoaxg5s0c5o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_vt40BnS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/kyapd3z1xjoaxg5s0c5o.png" alt="lsOutput"&gt;&lt;/a&gt;&lt;br&gt;
    &lt;code&gt;ls&lt;/code&gt; command lists all the available files and folders in the current directory. And with that output, we understand that &lt;code&gt;drpepper.txt&lt;/code&gt; is a strange text file.&lt;br&gt;
Take me to Top&lt;/p&gt;

&lt;h4&gt;
  
  
  Number Of Users
&lt;/h4&gt;

&lt;p&gt;The number of non-root/non-service/non-daemon users:&lt;br&gt;
    We can use the command: &lt;code&gt;cat /etc/passwd | cut -d: -f1&lt;/code&gt;&lt;br&gt;
    I found this command here: &lt;a href="https://linuxhandbook.com/linux-list-users/"&gt;LinuxHandBook&lt;/a&gt;&lt;br&gt;
    &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vHvFwKsG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/6e4rvsj1swapyz5lhjyk.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vHvFwKsG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/6e4rvsj1swapyz5lhjyk.PNG" alt="UserList"&gt;&lt;/a&gt;&lt;br&gt;
    And the output from the command shows there are no users that are non-root/non-service/non-daemon. And therefore the number is 0. The &lt;code&gt;cat&lt;/code&gt; command prints all the contents of a file mentioned and we are using pipe - &lt;code&gt;|&lt;/code&gt; to send the output of the cat to the following command i.e, &lt;code&gt;cut -d: -f1&lt;/code&gt; which cuts(or only prints) a repeating part of an output. In our case - we mention the delimiter as &lt;code&gt;:&lt;/code&gt; and the &lt;code&gt;-f1&lt;/code&gt; would print the first part of the delimited string.&lt;br&gt;
Take me to Top&lt;/p&gt;

&lt;h4&gt;
  
  
  User:
&lt;/h4&gt;

&lt;p&gt;The user of the app:&lt;br&gt;
    &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Dkxa7OTQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/wwpdj9sb8s5twhnfhzha.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Dkxa7OTQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/wwpdj9sb8s5twhnfhzha.PNG" alt="user"&gt;&lt;/a&gt;&lt;br&gt;
    &lt;code&gt;whoami&lt;/code&gt; is a command that shows the current user of the application through which the shell/bash is running. So the user is &lt;code&gt;www-data&lt;/code&gt;&lt;br&gt;
Take me to Top&lt;/p&gt;

&lt;h4&gt;
  
  
  User Shell As:
&lt;/h4&gt;

&lt;p&gt;I used &lt;code&gt;id&lt;/code&gt; to find the user id. Which is 33. &lt;code&gt;id&lt;/code&gt; prints the current user-id and group-id.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--sJ8Wbhc3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/lemp2g2isnhy8ifuem3o.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sJ8Wbhc3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/lemp2g2isnhy8ifuem3o.PNG" alt="UserId"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And then I used &lt;code&gt;cat /etc/passwd/&lt;/code&gt; to print all the list of user information.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7wL0Mbye--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ckkwaa0dqh7bgvdo0fba.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7wL0Mbye--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ckkwaa0dqh7bgvdo0fba.PNG" alt="passwd"&gt;&lt;/a&gt;&lt;br&gt;
     With the command, we see a lot of information here, and we need to find the one with the id 33, or the one with the user as &lt;code&gt;www-data&lt;/code&gt; as we found in question 3. And we see that the user is set as &lt;code&gt;/usr/sbin/nologin&lt;/code&gt;.&lt;br&gt;
Take me to Top&lt;/p&gt;

&lt;h4&gt;
  
  
  Ubuntu Version
&lt;/h4&gt;

&lt;p&gt;The version of Ubuntu:&lt;br&gt;
    I found this command &lt;code&gt;cat /etc/os-release&lt;/code&gt;, can print comprehensive information on the Operating System. &lt;br&gt;
    &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gGUiAdr---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/6el8shm1xtoo67yttujs.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gGUiAdr---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/6el8shm1xtoo67yttujs.PNG" alt="OS"&gt;&lt;/a&gt;&lt;br&gt;
    Here we see the version as &lt;code&gt;18.04.4&lt;/code&gt;.&lt;br&gt;
Take me to Top&lt;/p&gt;

&lt;h4&gt;
  
  
  MOTD:
&lt;/h4&gt;

&lt;p&gt;I first could not find the motd as I first thought its at &lt;code&gt;/etc/motd&lt;/code&gt;. Then I found that it's a different directory.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qIEmyqZY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/o660p8fy85nggk6a7v66.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qIEmyqZY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/o660p8fy85nggk6a7v66.PNG" alt="motdDir"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With the command &lt;code&gt;ls /etc/update-motd.d/&lt;/code&gt; I could see the files and one of them is &lt;code&gt;00-header&lt;/code&gt; and this is mentioned in the hint. So I used the command &lt;code&gt;cat /etc/update-motd.d/00-header&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--RNFX2jHN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/st8tjbat0liz4ygygdd5.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--RNFX2jHN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/st8tjbat0liz4ygygdd5.PNG" alt="motd-00-header"&gt;&lt;/a&gt;&lt;br&gt;
Now we can see in the last line of the output talks about "Dr Pepper" and that is the favorite beverage.&lt;/p&gt;

&lt;p&gt;Take me to Top&lt;/p&gt;

&lt;h3&gt;
  
  
  Day 2 Broken Authentication
&lt;/h3&gt;

&lt;p&gt;I found this type of attack cool. Now, if we just follow the instructions we can find the answers to the given questions.&lt;/p&gt;

&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Darren's Account:
&lt;/h4&gt;

&lt;p&gt;We try to register a new account using the name "darren" but we see a message saying user already exists. But the problem with this is in the backend of the application, with this step we now have overridden the password for darren with what we have used for the registration. Now we just have to login using the same password but add a space to the username: " darren".&lt;/p&gt;

&lt;p&gt;Now we are logged in as darren and we see the flag.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SFNMK7ix--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/he3e6jz3u0s7t0wf7bll.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SFNMK7ix--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/he3e6jz3u0s7t0wf7bll.PNG" alt="Darren's Account"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Take me to Top&lt;/p&gt;

&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Arthur's Account:
&lt;/h4&gt;

&lt;p&gt;We follow the same steps that we followed for darren's account.&lt;br&gt;
We try to register using username "arthur" and some password.&lt;br&gt;
Then we see the message that user already exists.&lt;br&gt;
Then we login as " arthur" and the same password we used to register. We are taken to arthur's account.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IyeWryWl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/d6gfa05hwoxk0vtjya6d.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IyeWryWl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/d6gfa05hwoxk0vtjya6d.PNG" alt="Arthur's Account"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Take me to Top&lt;/p&gt;

&lt;h3&gt;
  
  
  Day 3 Sensitive Data Exposure
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Sensitive Directory:
&lt;/h4&gt;

&lt;p&gt;For this task, I used a subdirectory enumerator software called DirBuster that is available in Kali Linux by default.&lt;/p&gt;

&lt;p&gt;I used the following settings:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vy7MBiyS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/tbqg9fipbf7ghu2e3yxs.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vy7MBiyS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/tbqg9fipbf7ghu2e3yxs.PNG" alt="Dirbuster Settings"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I used the wordlist file that is available by default here:&lt;br&gt;
&lt;code&gt;/usr/share/dirbuster/wordlists/directory-list-2.3-medium.txt&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then I let it run for a while and found.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2tcAz2jv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ztffbx4yxy5p7ko8etlm.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2tcAz2jv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ztffbx4yxy5p7ko8etlm.PNG" alt="Dibuster"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But it will be a lot simpler if we use the hint. We see that there is something in the login page source code.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--y5LQf3WV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/c1knubdinxs5buksz48j.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--y5LQf3WV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/c1knubdinxs5buksz48j.PNG" alt="Login Source"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We see that the developer has stored something in the &lt;code&gt;/assets&lt;/code&gt; directory.&lt;/p&gt;

&lt;p&gt;Take me to Top&lt;/p&gt;

&lt;h4&gt;
  
  
  DB File:
&lt;/h4&gt;

&lt;p&gt;When you open the directory you will see the &lt;code&gt;.db&lt;/code&gt; file. Click on it to download. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2lI39rG3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/75jadsymfrtumjzz6a60.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2lI39rG3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/75jadsymfrtumjzz6a60.PNG" alt="Assets"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Or you could directly go to &lt;code&gt;http://MACHINE_IP/assets/webapp.db&lt;/code&gt; to download.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ds_Ns5Vj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/u0shejhr93i6th30njhc.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ds_Ns5Vj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/u0shejhr93i6th30njhc.PNG" alt="Webapp"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Take me to Top&lt;/p&gt;

&lt;h4&gt;
  
  
  Sensitive Data:
&lt;/h4&gt;

&lt;p&gt;Then I used the mentioned commands in the given Material. And found the following:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4kkYslOl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/g8j68olz1urhdqyknp34.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4kkYslOl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/g8j68olz1urhdqyknp34.PNG" alt="db data"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We see the Admin, Bob, Alice users and their password hash.&lt;/p&gt;

&lt;h4&gt;
  
  
  Admin Password:
&lt;/h4&gt;

&lt;p&gt;I used the website &lt;a href="https://crackstation.net/"&gt;Crackstation&lt;/a&gt; mentioned in the given material to crack the password hash.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5WLu2Cq---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/od3t8kme01rydigllsj0.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5WLu2Cq---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/od3t8kme01rydigllsj0.PNG" alt="Admin Password"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Take me to Top&lt;/p&gt;

&lt;h4&gt;
  
  
  Admin Flag:
&lt;/h4&gt;

&lt;p&gt;I used the login page to login as admin and found the flag.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--C9gmUNoZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/dn691cnjjefe7x56zgz6.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--C9gmUNoZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/dn691cnjjefe7x56zgz6.PNG" alt="Admin Flag"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Take me to Top&lt;/p&gt;

&lt;p&gt;The current room is a progressive room and releases one task per day. I will try to update this page as and when I find the answers.&lt;/p&gt;

</description>
      <category>cybersecurity</category>
      <category>tryhackme</category>
      <category>owasptop10</category>
    </item>
  </channel>
</rss>
