<?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: Adhishri Kothiyal</title>
    <description>The latest articles on DEV Community by Adhishri Kothiyal (@er).</description>
    <link>https://dev.to/er</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%2F1143586%2F10aea440-a75d-4a57-b528-90792157a6c1.jpg</url>
      <title>DEV Community: Adhishri Kothiyal</title>
      <link>https://dev.to/er</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/er"/>
    <language>en</language>
    <item>
      <title>Hack The Box - Synced (rsync)</title>
      <dc:creator>Adhishri Kothiyal</dc:creator>
      <pubDate>Sun, 07 Sep 2025 20:00:13 +0000</pubDate>
      <link>https://dev.to/er/hack-the-box-synced-rsync-302h</link>
      <guid>https://dev.to/er/hack-the-box-synced-rsync-302h</guid>
      <description>&lt;p&gt;I will cover solution steps of the "Synced" machine, which is part of the 'Starting Point' labs and has a difficulty rating of 'Very Easy'. This is the last machine of the Tier-0 of StartingPoint. This is a VIP machine so you'd need an upgrade from your free plan.&lt;/p&gt;




&lt;h2&gt;
  
  
  Rsync on Port 873: A Gateway for Efficient File Synchronization
&lt;/h2&gt;

&lt;p&gt;The best known file transfer service is the File Transfer Protocol (FTP), which was covered thoroughly in the &lt;a href="https://medium.com/@adhishri-kothiyal1318/hack-the-box-fawn-ftp-a0da59c420dc" rel="noopener noreferrer"&gt;Fawn&lt;/a&gt; machine. The main concern with FTP is that it is a very old and slow protocol. FTP is a protocol used for copying entire files over the network from a remote server. In many cases there is a need to transfer only some changes made to a few files and not to transfer every file every single time. For these scenarios, the rsync protocol is generally preferred.&lt;/p&gt;

&lt;p&gt;Rysnc is a versatile file synchronization tool. It is an open source tool and provides fast incremental file transfer. The official definition of rsync according to the Linux &lt;a href="https://linux.die.net/man/1/rsync" rel="noopener noreferrer"&gt;manual&lt;/a&gt; page is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Rsync is a fast and extraordinarily versatile file copying tool. It can copy locally, to/from another host over any remote shell, or to/from a remote rsync daemon. It offers a large number of options that control every aspect of its behavior and permit very flexible specification of the set of files to be copied. It is famous for its deltatransfer algorithm, which reduces the amount of data sent over the network by sending only the differences between the source files and the existing files in the destination. Rsync is widely used for backups and mirroring and as an improved copy command for everyday use.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The core strength of rsync lies in its “&lt;a href="https://en.wikipedia.org/wiki/Delta_update" rel="noopener noreferrer"&gt;delta&lt;/a&gt;-transfer” algorithm. Instead of blindly copying entire files, rsync intelligently identifies and transmits only the differences between the source and destination files, resulting in significantly faster and more network-efficient transfers.&lt;/p&gt;

&lt;p&gt;The main stages of an rsync transfer are the following:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;rsync establishes a connection to the remote host and spawns another rsync receiver process.&lt;/li&gt;
&lt;li&gt;The sender and receiver processes compare what files have changed.&lt;/li&gt;
&lt;li&gt;What has changed gets updated on the remote host.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The way rsync works makes it an excellent choice when there is a need to synchronize files between a computer and a storage drive and across networked computers. Because of the flexibility and speed it offers, it has become a standard Linux utility, included in all popular Linux distribution by default. More information about rsync can be found at the &lt;a href="https://en.wikipedia.org/wiki/Rsync" rel="noopener noreferrer"&gt;Wikipedia&lt;/a&gt; page.&lt;/p&gt;

&lt;h2&gt;
  
  
  Connecting and Interacting with the Rsync Service
&lt;/h2&gt;

&lt;p&gt;Interaction with an rsync service is primarily achieved through the &lt;code&gt;rsync&lt;/code&gt; command-line utility (pre-installed in linux distributions), a standard feature in most Unix-like operating systems. The fundamental syntax for connecting to a remote rsync daemon is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rsync [OPTIONS] [USER@]HOST::[MODULE] [DESTINATION]
rsync [USER@]HOST::   (for listing available modules)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command will attempt to connect to the rsync daemon on &lt;code&gt;HOST/IP/USER@&lt;/code&gt; and list the publicly accessible modules.&lt;/p&gt;

&lt;p&gt;Anatomy of the Connection String:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;[OPTIONS]&lt;/code&gt;: This refers to the available options in &lt;code&gt;rsync&lt;/code&gt; . The list with all valid options is available over at the official manual &lt;a href="https://linux.die.net/man/1/rsync" rel="noopener noreferrer"&gt;page &lt;/a&gt; of rsync under the section Options Summary . You can also view it by using the — &lt;code&gt;help&lt;/code&gt; command: &lt;code&gt;rsync - -help&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;[USER@]HOST&lt;/code&gt;: This specifies the remote server's hostname or IP address. You can optionally provide a username if the rsync module requires authentication. The &lt;code&gt;[USER@]&lt;/code&gt; optional parameter is used when we want to access the the remote machine in an authenticated way. In this machine (synced), we don’t have any valid credentials at our disposal so we will omit this portion and try an anonymous authentication.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;::&lt;/code&gt;: The double colon is crucial. It signifies a connection to an rsync daemon on the specified host, as opposed to using a remote shell like SSH.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;[MODULE]&lt;/code&gt;: Rsync daemons are configured with "modules," which are essentially aliases for &lt;strong&gt;files/directories on the server&lt;/strong&gt; that are made available for synchronization. You can &lt;strong&gt;think of them as shares&lt;/strong&gt;. If you omit the module, some servers might list the available modules.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;[DESTINATION]&lt;/code&gt;: This is the local path where you want to download the files to. If you want to save in the current directory then just mention the name with which you would like to save the file in the local machine.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Authentication&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Rsync modules can be configured with varying levels of security:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Anonymous&lt;/strong&gt;: Some modules may be publicly accessible without any authentication.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Password-protected&lt;/strong&gt;: Many modules require a username and password. You may be prompted for a password, or you can store it in a file and use the &lt;code&gt;--password-file&lt;/code&gt; option.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It often happens that &lt;strong&gt;rsync is misconfigured to permit anonymous login&lt;/strong&gt;, which can be exploited by an attacker to get access to sensitive information stored on the remote machine.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TASK 1&lt;/strong&gt;: What is the default port for rsync? &lt;strong&gt;873&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TASK 2&lt;/strong&gt;: How many TCP ports are open on the remote host? &lt;strong&gt;1&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TASK 3&lt;/strong&gt;: What is the protocol version used by rsync on the remote machine? &lt;strong&gt;31&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TASK 4&lt;/strong&gt;: What is the most common command name on Linux to interact with rsync? &lt;strong&gt;rsync&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TASK 5&lt;/strong&gt;: What credentials do you have to pass to rsync in order to use anonymous authentication? &lt;/p&gt;

&lt;p&gt;anonymous:anonymous,&lt;br&gt;
anonymous,&lt;br&gt;
&lt;strong&gt;None&lt;/strong&gt;,&lt;br&gt;
rsync:rsync&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TASK 6&lt;/strong&gt;: What is the option to only list shares and files on rsync? (No need to include the leading — characters) &lt;strong&gt;list-only&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Submit Flag&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;We will begin by scanning the remote host for any open ports and running services with a Nmap scan. We will be using the following flags for the scan:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nmap -p- --min-rate=1000 -sV {target_IP}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;-p-&lt;/code&gt; : This flag scans for all TCP ports ranging from 0-65535&lt;br&gt;
&lt;code&gt;-sV&lt;/code&gt; : Attempts to determine the version of the service running on a port&lt;br&gt;
&lt;code&gt;--min-rate&lt;/code&gt; : This is used to specify the minimum number of packets that Nmap should send per second; it speeds up the scan as the number goes higher&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F72jkjkeqgy9bs0rj0id3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F72jkjkeqgy9bs0rj0id3.png" alt=" " width="800" height="217"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The scan shows that only port 873 is open. Moreover, Nmap informs us that the service running on this port is rsync.&lt;/p&gt;

&lt;p&gt;Now we will try to connect and simply list all the available directories to an anonymous user. Reading through the manual page we can spot the option — list-only , which according to the definition is used to “list the files instead of copying them”. To interact with the machine we execute the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rsync --list-only {target_IP}::
or 
rsync {target_IP}::
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3l83jvdot5lwk7xh4ct3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3l83jvdot5lwk7xh4ct3.png" alt=" " width="800" height="444"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Looking at the output, we can see that we can access a directory called public with the description Anonymous Share . It is a common practice to call shared directories just shares . Let’s go a step further and list the files inside the public share. The trailing slash on the module name is important; it signifies that you want to see the contents of the directory.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rsync --list-only {target_IP}::public/
or 
rsync {target_IP}::public/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We notice a file called flag.txt inside the public share. Our last step would be to download/copy/sync the entire content of the &lt;code&gt;flag.txt&lt;/code&gt; file to our local machine. To do that, we simply follow the general syntax by specifying the SRC as &lt;code&gt;public/flag.txt&lt;/code&gt; and the DEST as &lt;code&gt;flag.txt&lt;/code&gt; to transfer the file to our local machine.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rsync {target_IP}::[SRC] [DESTI]
rsync {target_IP}::public/flag.txt flag.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Executing this command returns no output. But, on our local directory we have a new file called flag.txt . Let’s read its contents : &lt;code&gt;cat flag.txt&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0igji7xci0mmd4dguhol.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0igji7xci0mmd4dguhol.png" alt=" " width="800" height="275"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Congratulations! You have successfully captured the flag file from the remote machine using the &lt;code&gt;rsync&lt;/code&gt; protocol.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F41bdrlm4ii7x5x2znmxq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F41bdrlm4ii7x5x2znmxq.png" alt=" " width="800" height="734"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And this marks an end to Tier -0 of &lt;a href="https://app.hackthebox.com/starting-point" rel="noopener noreferrer"&gt;Starting Point&lt;/a&gt; machines in &lt;a href="https://app.hackthebox.com/home" rel="noopener noreferrer"&gt;Hack The Box Labs&lt;/a&gt;. Go Start Pwning Machines now… :) Happy Hacking!🪅&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb6gsfv1m0k5lvkw6zdr9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb6gsfv1m0k5lvkw6zdr9.png" alt=" " width="800" height="474"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe03caqqe1dxghn28gypv.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe03caqqe1dxghn28gypv.gif" alt=" " width="498" height="280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Credits: The Internet 🛜&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Dear Gentle Reader feel free to reach out for queries and feedback.&lt;/em&gt;🥷&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>htb</category>
      <category>writeup</category>
      <category>cybersecurity</category>
    </item>
    <item>
      <title>Hack The Box — Mongod (MongoDB)</title>
      <dc:creator>Adhishri Kothiyal</dc:creator>
      <pubDate>Sat, 06 Sep 2025 18:31:27 +0000</pubDate>
      <link>https://dev.to/er/hack-the-box-mongod-mongodb-3o12</link>
      <guid>https://dev.to/er/hack-the-box-mongod-mongodb-3o12</guid>
      <description>&lt;p&gt;I will cover solution steps of the “Mongod” machine, which is part of the ‘Starting Point’ labs and has a difficulty rating of ‘Very Easy’. This is a VIP machine so you’d need an upgrade from your free plan.&lt;/p&gt;




&lt;h2&gt;
  
  
  What is MongoDB?
&lt;/h2&gt;

&lt;p&gt;There are different types of databases and one among them is MongoDB.&lt;/p&gt;

&lt;p&gt;MongoDB is a document-oriented NoSQL database. Instead of using tables and rows like in traditional relational databases, MongoDB makes use of collections and documents.&lt;/p&gt;

&lt;p&gt;It is crucial to be aware of how the data is stored in different types of databases and how we can connect to these remote database servers and retrieve the desired data. In a document-oriented NoSQL database, the data is organized into a hierarchy of the following levels:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;databases&lt;/li&gt;
&lt;li&gt;collections&lt;/li&gt;
&lt;li&gt;documents&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fred3ooojjxb569gxoo9n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fred3ooojjxb569gxoo9n.png" alt=" " width="800" height="380"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How MongoDB stores data?
&lt;/h2&gt;

&lt;p&gt;Each database contains collections which in turn further contain documents.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Database&lt;/strong&gt; → Think of it like a big &lt;strong&gt;filing cabinet&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Collections&lt;/strong&gt; → Inside the cabinet, you have *&lt;em&gt;folders *&lt;/em&gt;(collections).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Documents&lt;/strong&gt; → Inside each folder, you have *&lt;em&gt;files *&lt;/em&gt;(documents).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data&lt;/strong&gt; → Inside each file, you have the &lt;strong&gt;actual information&lt;/strong&gt; (like text, numbers, or dates).&lt;/p&gt;

&lt;p&gt;The format looks like &lt;strong&gt;JSON&lt;/strong&gt; (a simple way to store data with key-value pairs, like &lt;code&gt;"name": "Adhishri"&lt;/code&gt;). Normally, to access a database, you should have a username and password. But sometimes the MongoDB server is set up wrongly (misconfigured) and allows &lt;strong&gt;anyone to log in without credentials&lt;/strong&gt;. This is called &lt;strong&gt;anonymous login&lt;/strong&gt;. It’s like leaving the filing cabinet unlocked in a public place — anyone can open it and read all the files.&lt;/p&gt;

&lt;p&gt;To connect to the server we use a tool called &lt;code&gt;mongosh&lt;/code&gt; (Mongo Shell). It’s like a remote terminal for MongoDB. With it, we can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Connect to the MongoDB server&lt;/li&gt;
&lt;li&gt;List all databases&lt;/li&gt;
&lt;li&gt;Go inside collections&lt;/li&gt;
&lt;li&gt;Look at the documents&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To install &lt;a href="https://www.mongodb.com/try/download/shell" rel="noopener noreferrer"&gt;MongoDB Shell Utility&lt;/a&gt; follow the below mentioned commands:&lt;/p&gt;

&lt;p&gt;(This method installed the latest MongoDB client while later I found out that the server was using older version so I again installed another client with older version. Skip this installation if you don't want to download latest version.)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo dpkg -i mongodb-mongosh_2.5.7_amd64.deb  (to install)
sudo apt-get install -f                       (to install any missing dependencies)
which mongosh                                 (to see where was mongosh installed)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyfj821d1u1fzsl0vgpwu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyfj821d1u1fzsl0vgpwu.png" alt=" " width="800" height="402"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk5fvvrpx9p2ajnwg6j0o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk5fvvrpx9p2ajnwg6j0o.png" alt=" " width="541" height="108"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To connect to the mongosh server I executed below command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mongosh mongodb://&amp;lt;$IP&amp;gt;:27017
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy2aax2b0p2ull1jvhza3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy2aax2b0p2ull1jvhza3.png" alt=" " width="800" height="81"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I encountered an error that states that “the machine is using an older server version of mongodb (wire version 6 = MongoDB 3.6) while the mongosh client that we installed is too new and expects at least wire version 8 (MongoDB 4.2).”&lt;/p&gt;

&lt;p&gt;I decided to use an older Mongosh shell. To install the older version of &lt;code&gt;mongosh&lt;/code&gt; shell that matches the server version I used the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl -O https://downloads.mongodb.com/compass/mongosh-2.3.2-linux-x64.tgz
tar xvf mongosh-2.3.2-linux-x64.tgz
cd mongosh-2.3.2-linux-x64
cd bin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fow05955tj6qmuc29gujk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fow05955tj6qmuc29gujk.png" alt=" " width="800" height="353"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F497oh1euergj320ast4a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F497oh1euergj320ast4a.png" alt=" " width="800" height="496"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then to connect:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;./mongosh mongodb://10.129.118.68:27017
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9mu8mq6qdbfg2ldfklre.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9mu8mq6qdbfg2ldfklre.png" alt=" " width="800" height="299"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we have successfully connected to remote MongoDB instance as an anonymous user. Using the following command, we can list the databases present on the MongoDB server.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;show dbs;
use sensitive_information;
show collections;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;show dbs&lt;/code&gt; : to list databases&lt;/p&gt;

&lt;p&gt;&lt;code&gt;use&lt;/code&gt; : This command switches the current context to the specified database. If the database does not exist, MongoDB will create it implicitly upon the first data insertion into a collection within that database.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;db&lt;/code&gt; : To check current database. This command returns the name of the database currently in use within the shell.&lt;/p&gt;

&lt;p&gt;We can dump the contents of any documents present in the collection by using the db.collectionName.find() command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;db.collectionName.find()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;TASK 1&lt;/strong&gt;: How many TCP ports are open on the machine? &lt;strong&gt;2&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nmap -p- --min-rate=1000 -sV &amp;lt;$IP&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;-p-&lt;/code&gt; : This flag scans for all TCP ports ranging from 0–65535&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-sV&lt;/code&gt; : Attempts to determine the version of the service running on a port&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;- - min-rate&lt;/code&gt; : This is used to specify the minimum number of packets that Nmap should send per second; it speeds up the scan as the number goes higher&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvi1b6gslwcsrmvcfq5hk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvi1b6gslwcsrmvcfq5hk.png" alt=" " width="800" height="225"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TASK 2&lt;/strong&gt;: Which service is running on port 27017 of the remote host? &lt;strong&gt;MongoDB 3.6.8&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TASK 3&lt;/strong&gt;: What type of database is MongoDB? (Choose: SQL or NoSQL) &lt;strong&gt;NoSQL&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TASK 4&lt;/strong&gt;: What command is used to launch the interactive MongoDB shell from the terminal? &lt;strong&gt;mongosh&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TASK 5&lt;/strong&gt;: What is the command used for listing all the databases present on the MongoDB server? (No need to include a trailing ;) &lt;strong&gt;show dbs&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TASK 6&lt;/strong&gt;: What is the command used for listing out the collections in a database? (No need to include a trailing ;) &lt;strong&gt;show collections&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TASK 7&lt;/strong&gt;: What command is used to dump the content of all the documents within the collection named &lt;code&gt;flag&lt;/code&gt;? &lt;strong&gt;db.flag.find()&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Submit Flag&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;First I performed a basic nmap scan to check the open ports&lt;/li&gt;
&lt;li&gt;I saw 2 TCP ports are open out of which one was a mongodb server running at 27017&lt;/li&gt;
&lt;li&gt;Then I tried to connect to the mongodb server r running on the target box using &lt;code&gt;mongosh&lt;/code&gt; (MongoDB shell utility)&lt;/li&gt;
&lt;li&gt;Then I saw a database with the name &lt;code&gt;sensetive_information&lt;/code&gt; which had a collection&lt;/li&gt;
&lt;li&gt;To list the content of the collection named &lt;code&gt;flag&lt;/code&gt;:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;db.flag.find()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And the flag would be displayed. Congratulations, you’ve captured the flag!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxittr2j3qhoqmwf3oqsp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxittr2j3qhoqmwf3oqsp.png" alt=" " width="800" height="715"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On submitting it you will receive message as “Mongod has been Pwned”.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fid4pwk6dzzh6tedox28v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fid4pwk6dzzh6tedox28v.png" alt=" " width="800" height="668"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foig9srkwx6uhqserb0t4.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foig9srkwx6uhqserb0t4.gif" alt=" " width="220" height="202"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Credits: The Internet 🛜&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Dear Gentle Reader feel free to reach out for queries and feedback.&lt;/em&gt;🥷&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>htb</category>
      <category>walkthrough</category>
      <category>cybersecurity</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Hack The Box -Preignition Write-up (dir busting)</title>
      <dc:creator>Adhishri Kothiyal</dc:creator>
      <pubDate>Tue, 02 Sep 2025 16:44:11 +0000</pubDate>
      <link>https://dev.to/er/hack-the-box-preignition-write-up-dir-busting-3eip</link>
      <guid>https://dev.to/er/hack-the-box-preignition-write-up-dir-busting-3eip</guid>
      <description>&lt;p&gt;I will cover solution steps of the "Preignition" machine, which is part of the 'Starting Point' labs and has a difficulty rating of 'Very Easy'. This is a VIP machine so you'd need an upgrade from your free plan.&lt;/p&gt;




&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Web servers are central to most infrastructures, often public-facing and accessible from the Internet. They typically host applications like WordPress, which provides both a public-facing site and a private admin panel (/wp-admin) for managing content, themes, and scripts. While these panels are login-protected, outdated components or misconfigurations can introduce critical vulnerabilities. For pentesters, understanding how these administrative mechanisms work is key, as exploiting them can provide attackers with an initial foothold and a path to pivot deeper into a network.&lt;/p&gt;

&lt;p&gt;Thus, Web enumeration, specifically directory busting (dir busting), is one of the most essential skills any Penetration Tester must possess. While manually navigating websites and clicking all the available links may reveal some data, most of the links and pages may not be published to the public and, hence, are less secure. Suppose we did not know the wp-admin page is the administrative section of the WordPress site we exemplified above. How else would we have found it out if not for web enumeration and directory busting?&lt;/p&gt;

&lt;p&gt;Check &lt;a href="https://dev.to/er/hack-the-box-meow-telnet-301g"&gt;Hack the Box - Meow&lt;/a&gt; on how to connect to the VPN and spawn the machine.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F53c5e15mq616nux221uv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F53c5e15mq616nux221uv.png" alt=" " width="800" height="202"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TASK 1&lt;/strong&gt;: Directory Brute-forcing is a technique used to check a lot of paths on a web server to find hidden pages. Which is another name for this? (i) Local File Inclusion, (ii) &lt;strong&gt;dir busting&lt;/strong&gt;, (iii) hash cracking.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TASK 2&lt;/strong&gt;: What switch do we use for nmap's scan to specify that we want to perform version detection. &lt;strong&gt;-sV&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TASK 3&lt;/strong&gt;: What does Nmap report is the service identified as running on port 80/tcp? &lt;strong&gt;http&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TASK 4&lt;/strong&gt;: What server name and version of service is running on port 80/tcp? &lt;strong&gt;nginx 1.14.2&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TASK 5&lt;/strong&gt;: What switch do we use to specify to Gobuster we want to perform dir busting specifically? &lt;strong&gt;dir&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TASK 6&lt;/strong&gt;: When using gobuster to dir bust, what switch do we add to make sure it finds PHP pages? &lt;strong&gt;-x php&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TASK 7&lt;/strong&gt;: What page is found during our dir busting activities? &lt;strong&gt;admin.php&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TASK 8&lt;/strong&gt;: What is the HTTP status code reported by Gobuster for the discovered page? &lt;strong&gt;200&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Submit Flag&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;We start with a preliminary scan of the target using &lt;code&gt;nmap&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo nmap -Pn &amp;lt;$IP&amp;gt; -sV -A
or
sudo nmap &amp;lt;$IP&amp;gt; -sV
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo53ss4clq9k7m0ijyhad.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo53ss4clq9k7m0ijyhad.png" alt=" " width="800" height="239"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo nmap -Pn &amp;lt;$IP&amp;gt; -sV -A
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fai9ok6iakmvpf3i83bkd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fai9ok6iakmvpf3i83bkd.png" alt=" " width="800" height="827"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From the scan we can see port 80 open. Obvious next step is to open a web browser of our choice and navigate to the target's IP address in the URL bar at the top of the window. This will automatically address the target's port 80 for the client-server communication and load the web page's contents. &lt;code&gt;&amp;lt;$IP&amp;gt;:80&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fisiwo3hor6g79drkbwb7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fisiwo3hor6g79drkbwb7.png" alt=" " width="800" height="289"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I just see a mention of nginx and realize that the target is a web server.  What we are looking at on our browser screen is the default post-installation page for the nginx service, meaning that there is the possibility that this web application might not be adequately configured yet, or that default credentials are used to facilitate faster configuration up to the point of live deployment. This, however, also means that there are no buttons or links on the web page to assist us with navigation between web directories or other content. When browsing a website, links simply point to other directories or pages. Beyond these visible links, web servers may host hidden content. Instead of manually guessing URLs, a technique called directory busting (dir busting) is used to discover such content. Tools like Gobuster, written in Go, automate this process by scanning for hidden directories and files.&lt;/p&gt;

&lt;p&gt;To install gobuster:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt install golang-go
sudo apt install gobuster
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo44w5go1s39m2eakl6hu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo44w5go1s39m2eakl6hu.png" alt=" " width="800" height="396"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can use the &lt;code&gt;common.txt&lt;/code&gt; wordlist which can be downloaded from here. &lt;/p&gt;

&lt;p&gt;For those who want a more comprehensive grasp of Gobuster's directory hunting mode, invoking the help function for the directory mode is a valuable resource. Simply use the command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo gobuster dir -h
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We will be using -w and -u flags.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4uxogdm1tgkf1xjzsyd7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4uxogdm1tgkf1xjzsyd7.png" alt=" " width="800" height="404"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo gobuster dir -w /usr/share/wordlists/seclists/Discovery/Web-Content/common.txt -u &amp;lt;$IP&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I was unable to get results from gobuster so I decided to use &lt;code&gt;ffuf&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo ffuf -w /usr/share/wordlists/seclists/Discovery/Web-Content/common.txt -u http://&amp;lt;$IP&amp;gt;/FUZZ.php
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhw52s6gnm99loxnr3bqw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhw52s6gnm99loxnr3bqw.png" alt=" " width="800" height="291"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The output of our performed dir busting attempt revealed the directory &lt;code&gt;/admin.php&lt;/code&gt;.  Alongside this discovery came its associated HTTP status code 200. This status code, denoting "OK", is the standard response for a successful HTTP request. I opened the browser and accessed &lt;code&gt;http://target_IP/admin.php&lt;/code&gt;. This URL takes us to an admin console login (see below):&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F59501qj16n1j5lcvexne.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F59501qj16n1j5lcvexne.png" alt=" " width="800" height="337"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then I tried a bunch of possible combinations:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;code&gt;{admin:admin}&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;{admin:password}&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;{administrator:password}&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;{admin:password1}&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;{administrator:password1}&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;And &lt;code&gt;{admin:admin}&lt;/code&gt; worked. Once logged in, the root flag is displayed. Congratulations, you've captured the root flag!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fulc6uyy6tb7vex466urk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fulc6uyy6tb7vex466urk.png" alt=" " width="800" height="152"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On submitting it you will receive message as "Preignition has been Pwned".&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyhzaz97eu1lvqoo0lijp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyhzaz97eu1lvqoo0lijp.png" alt=" " width="800" height="728"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj0320ib7nl81k1wut5vc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj0320ib7nl81k1wut5vc.png" alt=" " width="800" height="241"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjc1yl1qbwu1vyz9vcii2.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjc1yl1qbwu1vyz9vcii2.gif" alt=" " width="400" height="224"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Credits: The Internet 🛜&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&amp;gt; Dear Gentle Reader feel free to reach out for queries and feedback.🥷&lt;/em&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Hack The Box - Explosion (RDP)</title>
      <dc:creator>Adhishri Kothiyal</dc:creator>
      <pubDate>Mon, 01 Sep 2025 18:22:21 +0000</pubDate>
      <link>https://dev.to/er/hack-the-box-explosion-rdp-512a</link>
      <guid>https://dev.to/er/hack-the-box-explosion-rdp-512a</guid>
      <description>&lt;p&gt;I will cover solution steps of the "Explosion" machine, which is part of the 'Starting Point' labs and has a difficulty rating of 'Very Easy'. This is a VIP machine so you'd need an upgrade from your free plan. &lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Introduction&lt;/strong&gt;&lt;br&gt;
Remote access software represents a legitimate way to connect to other hosts to perform actions or offer support. The interactions involved by using any type of remote access tool can either be CLI-based (Command Line Interface) or GUI-based (Graphical User Interface). These tools use the same protocol at their base to communicate with the other hosts, which is RDP. RDP (Remote Desktop Protocol) operates on ports 3389 TCP and 3389 UDP. The only difference consists of how the information relayed by this protocol is presented to the end-user.&lt;/p&gt;

&lt;p&gt;Command Line Interface-based Remote Access Tools have been around forever. A rudimentary example of this is Telnet , which was explored briefly in the Meow machine. . In its most basic configuration, Telnet is considered insecure due to lacking the ability to encrypt the data being sent through it securely. This implies that an attacker with access to a network TAP (Traffic Access Point) could easily intercept the packets being sent through a Telnet connection and read the contents, be they login credentials, sensitive files, or anything else. Telnet, which runs on port 23 TCP by default, has mainly been replaced by its more secure counterpart, SSH , running on port 22 TCP by default. &lt;/p&gt;

&lt;p&gt;SSH, which stands for Secure Shell Protocol, adds the required layers of authentication and encryption to the communication model, making it a much more viable approach to perform remote access and remote file transfers. It is used both for patch delivery, file transfers, log transfer, and remote management in today's environment.&lt;/p&gt;

&lt;p&gt;SSH uses public-key cryptography to verify the remote host's identity, and the communication model is based on the Client-Server architecture , as seen previously with FTP, SMB, and other services. The local host uses the server's public key to verify its identity before establishing the encrypted tunnel connection. Once the tunnel is established, symmetric encryption methods and hashing algorithms are used to ensure the confidentiality and integrity of the data being sent over the tunnel.&lt;/p&gt;

&lt;p&gt;In order to be able to see the remote host's display, one can resort to CLI-based tools such as xfreerdp . Tools such as this one are called Remote Desktop Tools , despite being part of the Remote Access family.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F610ooce8cqtxljj7akgj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F610ooce8cqtxljj7akgj.png" alt=" " width="800" height="570"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffv6lor0t9jxu782lvcj4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffv6lor0t9jxu782lvcj4.png" alt=" " width="800" height="241"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Check Hack the Box - Meow on how to connect to the VPN and spawn the machine.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2psl5fyd0pnkjwcx93yh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2psl5fyd0pnkjwcx93yh.png" alt=" " width="800" height="156"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TASK 1&lt;/strong&gt;: What does the 3-letter acronym RDP stand for? &lt;strong&gt;Remote Desktop Protocol&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TASK 2&lt;/strong&gt;: What is a 3-letter acronym that refers to interaction with the host through a command line interface? &lt;strong&gt;CLI&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TASK 3&lt;/strong&gt;: What about graphical user interface interactions? &lt;strong&gt;GUI&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TASK 4&lt;/strong&gt;: What is the name of an old remote access tool that came without encryption by default and listens on TCP port 23? &lt;strong&gt;telnet&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TASK 5&lt;/strong&gt;: What is the name of the service running on port 3389 TCP? &lt;strong&gt;ms-wbt-server&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TASK 6&lt;/strong&gt;: What is the switch used to specify the target host's IP address when using xfreerdp? &lt;strong&gt;/v:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TASK 7&lt;/strong&gt;: What username successfully returns a desktop projection to us with a blank password? &lt;strong&gt;Administrator&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Submit Flag&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;We start, as always, with an nmap scan, resulting in open ports running RDP. We have run the scan with the version scanning switch enabled to determine the exact versions of all the services running on open ports on the target, thus assessing the actual operating system of the machine and any additional potential vulnerabilities due to outdated software.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo nmap &amp;lt;$IP&amp;gt; -Pn -sV -A 
or
sudo nmap -sV &amp;lt;$IP&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;-sV&lt;/code&gt; : Probe open ports to determine service/version info.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6vlrkfmtie4j9pztavl4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6vlrkfmtie4j9pztavl4.png" alt=" " width="800" height="964"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It is always a good idea to research the ports found in order to understand the big picture. SpeedGuide is a good resource for those just starting out with their networking basics and interested in understanding more common ports at a glance. &lt;/p&gt;

&lt;p&gt;Looking at the SpeedGuide entry for port 3389 TCP. It is typically used for Windows Remote Desktop and Remote Assistance connections (over RDP - Remote Desktop Protocol). We can quickly check for any misconfigurations in access control by attempting to connect to this readily available port without any valid credentials, thus confirming whether the service allows guest or anonymous connections or not.&lt;/p&gt;

&lt;p&gt;If you need to install xfreerdp , you can proceed with one of the following commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get install freerdp2-x11
sudo apt-get install freerdp3-x11
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can first try to form an RDP session with the target by not providing any additional information for any switches other than the target IP address. This will make the script use your own username as the login username for the RDP session, thus testing guest login capabilities.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;/v:{target_IP}&lt;/code&gt; : Specifies the target IP of the host we would like to connect to.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdn3nk6ubvydr8h7hqhxy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdn3nk6ubvydr8h7hqhxy.png" alt=" " width="800" height="485"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can try a myriad of other default accounts, such as &lt;code&gt;user&lt;/code&gt;, &lt;code&gt;admin&lt;/code&gt;, &lt;code&gt;Administrator&lt;/code&gt;, and so&lt;br&gt;
on. In reality, this would be a time-consuming process. I tried with the username  &lt;code&gt;Administrator&lt;/code&gt;. We will also be specifying to the script that we would like to bypass all requirements for a security certificate so that our own script does not request them. The target, in this case, already does not expect any. Let us take a look at the switches we will need to use with xfreerdp in order to connect to our target in this scenario successfully:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;/cert:ignore&lt;/code&gt; : Specifies to the scrips that all security certificate usage should be&lt;br&gt;
ignored.&lt;br&gt;
&lt;code&gt;/u:Administrator&lt;/code&gt; : Specifies the login username to be "Administrator".&lt;br&gt;
&lt;code&gt;/v:{target_IP}&lt;/code&gt; : Specifies the target IP of the host we would like to connect to.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbrx7ute6eki0mgqdfjl8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbrx7ute6eki0mgqdfjl8.png" alt=" " width="800" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can see a file on the desktop with the name flag. And Congratulations! We have successfully retrieved the flag value.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftnx5wridh99ggepr5jnk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftnx5wridh99ggepr5jnk.png" alt=" " width="800" height="664"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On submitting it you will receive message as "Explosion has been Pwned".&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd2u2ygk5763v457f8o0w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd2u2ygk5763v457f8o0w.png" alt=" " width="800" height="832"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv76jg3mnb1o9tr30mxja.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv76jg3mnb1o9tr30mxja.png" alt=" " width="800" height="156"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F54he6x8ddgtxlqiyperq.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F54he6x8ddgtxlqiyperq.gif" alt=" " width="498" height="368"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Credits: HTB Official Write-up&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Dear Gentle Reader feel free to reach out for queries and feedback.&lt;/em&gt; 🥷&lt;/p&gt;
&lt;/blockquote&gt;

</description>
    </item>
    <item>
      <title>Hack The Box - Redeemer (Redis)</title>
      <dc:creator>Adhishri Kothiyal</dc:creator>
      <pubDate>Mon, 01 Sep 2025 13:58:35 +0000</pubDate>
      <link>https://dev.to/er/hack-the-box-redeemer-redis-4dnh</link>
      <guid>https://dev.to/er/hack-the-box-redeemer-redis-4dnh</guid>
      <description>&lt;p&gt;I will cover solution steps of the "Redeemer" machine, which is part of the 'Starting Point' labs and has a difficulty rating of 'Very Easy'.&lt;/p&gt;




&lt;h2&gt;
  
  
  Introduction 
&lt;/h2&gt;

&lt;p&gt;Databases are a collection of organized information that can be easily accessed. In most environments, database systems are very important because they communicate information related to your sales transactions, product inventory, customer profiles and marketing activities.&lt;/p&gt;

&lt;p&gt;There are different types of databases and one among them is Redis, which is an 'in-memory' database. In-memory databases are the ones that rely essentially on the primary memory for data storage (meaning that the database stores data in the server's RAM); in contrast to databases that store data on the disk or SSDs. In-memory databases like Redis are typically used to cache data that is frequently requested for quick retrieval. For example, if there is a website that returns some prices on the front page of the site. As the primary memory is significantly faster than the secondary memory, the data retrieval time in the case of 'in-memory' databases is very small, thus offering very efficient &amp;amp; minimal response times.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is Redis?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Redis (REmote DIctionary Server) is an open-source advanced NoSQL key-value data store used as a database, cache, and message broker. The data is stored in a dictionary format having key-value pairs. It is typically used for short term storage of data that needs fast retrieval. Redis does backup data to hard drives to provide consistency. It's often referred to as a "Swiss Army knife" for developers because of its versatility.&lt;/p&gt;

&lt;p&gt;In-memory databases like Redis are typically used to cache data that is frequently requested for quick retrieval. For Example, if there is a website that returns some prices on the front page of the site. The website may be written to first check if the needed prices are in Redis, and if not, then check the traditional database (like MySQL or MongoDB). When the value is loaded from the database, it is then stored in Redis for some shorter period of time (seconds or minutes or hours), to handle any similar requests that arrive during that timeframe. For a site with lots of traffic, this configuration allows for much faster retrieval for the majority of requests, while still having stable long term storage in the main database.&lt;/p&gt;

&lt;p&gt;At its core, Redis is a key-value store, means data is stored like a dictionary. You have a &lt;code&gt;key&lt;/code&gt; (like a label) and a &lt;code&gt;value&lt;/code&gt; (the data itself). For example: &lt;code&gt;key = "user:1:password"&lt;/code&gt;, &lt;code&gt;value = "P@ssw0rd123"&lt;/code&gt;. Unlike simple key-value stores that only handle strings, Redis has built-in support for a variety of complex data structures, including strings, lists,sets,hashes,Sorted Sets, etc. For developers, Redis is a powerful tool for caching, session management, and real-time data. For a pentester, it's often a treasure chest left wide open.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The Super Simple Analogy&lt;/em&gt;: A Public Whiteboard. When you're scanning a target and you see port 6379 open, your brain should immediately think: "There's a public whiteboard here. Is the door unlocked? And what's written on it?" &lt;/p&gt;

&lt;p&gt;A server configuration (&lt;code&gt;requirepass&lt;/code&gt;) is used for setting up a password. The default is "no" and the port will listen for connections from ANYONE on the internet. This misconfiguration is extremely common. The developers just installed it and forgot to secure it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The server&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Redis runs as server-side software so its core functionality is in its server component. The server listens for connections from clients, programmatically or through the command-line interface.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The CLI&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The command-line interface (CLI) is a powerful tool that gives you complete access to Redis’s data and its functionalities if you are developing a software or tool that needs to interact with it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Database&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The database is stored in the server's RAM to enable fast data access. Redis also writes the contents of the database to disk at varying intervals to persist it as a backup, in case of failure&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;redis-cli&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To be able to interact remotely with the Redis server, we need to download the &lt;code&gt;redis-cli&lt;/code&gt; utility using the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt install redis-tool
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Alternatively, we can also connect to the Redis server using the netcat utility, but we will be using &lt;code&gt;redis-cli&lt;/code&gt; in this write-up as it is more convenient to use.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm6wc3jyjiggth5wy9rgk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm6wc3jyjiggth5wy9rgk.png" alt=" " width="800" height="312"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;P.S. The target was spawn more than once hence the article might have screenshots from different IP addresses in different networks but they represent the same target.&lt;/p&gt;

&lt;p&gt;Check Hack the Box - Meow on how to connect to the VPN and spawn the machine.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TASK 1&lt;/strong&gt;: Which TCP port is open on the machine? &lt;strong&gt;6379&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo nmap -p- -Pn &amp;lt;$IP&amp;gt; --min-rate 10000 -v
sudo nmap &amp;lt;$IP&amp;gt; -p- -sV
sudo nmap -p- &amp;lt;$IP&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fel05frhw4d1zq4scsrns.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fel05frhw4d1zq4scsrns.png" alt=" " width="800" height="93"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4346a1wbmz0g74lduara.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4346a1wbmz0g74lduara.png" alt=" " width="800" height="343"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0ptzmyn97q1uvi6668c9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0ptzmyn97q1uvi6668c9.png" alt=" " width="800" height="751"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TASK 2&lt;/strong&gt;: Which service is running on the port that is open on the machine? &lt;strong&gt;redis&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;TASK 3&lt;/strong&gt;: What type of database is Redis? Choose from the following options: (i) &lt;strong&gt;In-memory Database&lt;/strong&gt;  (ii) Traditional Database&lt;br&gt;
&lt;strong&gt;TASK 4&lt;/strong&gt;: Which command-line utility is used to interact with the Redis server? Enter the program name you would enter into the terminal without any arguments.  &lt;strong&gt;redis-cli&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;TASK 5&lt;/strong&gt;: Which flag is used with the Redis command-line utility to specify the hostname? &lt;strong&gt;-h&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk516w46ebmcxjm3e3ooi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk516w46ebmcxjm3e3ooi.png" alt=" " width="800" height="839"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Connect to the redis-cli server :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;redis-cli -h &amp;lt;$IP&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxrzo0fge14mq1vux86r6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxrzo0fge14mq1vux86r6.png" alt=" " width="800" height="77"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TASK 6&lt;/strong&gt;: Once connected to a Redis server, which command is used to obtain the information and statistics about the Redis server? &lt;strong&gt;info&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flkoe9ehpciy649tdduh2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flkoe9ehpciy649tdduh2.png" alt=" " width="800" height="1194"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The keyspace section provides statistics on the main dictionary of each database. The statistics include the number of keys, and the number of keys with an expiration. In our case, under the Keyspace section, we can see that only one database exists with index 0.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Famr45xwaq4kc16gpvmf2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Famr45xwaq4kc16gpvmf2.png" alt=" " width="683" height="172"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TASK 7&lt;/strong&gt;: What is the version of the Redis server being used on the target machine? &lt;strong&gt;5.0.7&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TASK 8&lt;/strong&gt;: Which command is used to select the desired database in Redis? &lt;strong&gt;select&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To select a database we can use &lt;code&gt;select&lt;/code&gt; command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;select 0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fifx7jced8ia18yxcyqu4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fifx7jced8ia18yxcyqu4.png" alt=" " width="534" height="149"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TASK 9&lt;/strong&gt;: How many keys are present inside the database with index 0? &lt;strong&gt;4&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TASK 10&lt;/strong&gt;: Which command is used to obtain all the keys in a database? *&lt;em&gt;keys *&lt;/em&gt;*&lt;/p&gt;

&lt;p&gt;We can list all the keys present in the database using the command :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;keys *
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Submit Flag&lt;/strong&gt;:&lt;br&gt;
We can view the values stored for a corresponding key using the get command followed by the keynote. I used get flag to see the value of the key named flag. And Congratulations! We have successfully retrieved the flag value from the Redis database.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;get &amp;lt;key&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzv1ioa5ofitftvwouprt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzv1ioa5ofitftvwouprt.png" alt=" " width="742" height="445"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On submitting it you will receive message as "Redeemer has been Pwned" and Challenge solved successfully.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1qo0z7f6mhptq4n4vu2v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1qo0z7f6mhptq4n4vu2v.png" alt=" " width="800" height="670"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3n6mps11yxc9kt3kb4rr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3n6mps11yxc9kt3kb4rr.png" alt=" " width="694" height="243"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyjuorh9zp9c2rwuae3zo.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyjuorh9zp9c2rwuae3zo.gif" alt=" " width="498" height="245"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Credits: HTB Official Write-up&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Dear Gentle Reader feel free to reach out for queries and feedback.&lt;/em&gt;🥷&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>programming</category>
      <category>pentest</category>
      <category>hackthebox</category>
      <category>security</category>
    </item>
    <item>
      <title>[Boost]</title>
      <dc:creator>Adhishri Kothiyal</dc:creator>
      <pubDate>Wed, 27 Aug 2025 21:48:18 +0000</pubDate>
      <link>https://dev.to/er/-4h53</link>
      <guid>https://dev.to/er/-4h53</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/er/hack-the-box-dancing-2jpo" class="crayons-story__hidden-navigation-link"&gt;Hack the box - Dancing (SMB)&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/er" class="crayons-avatar  crayons-avatar--l  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1143586%2F10aea440-a75d-4a57-b528-90792157a6c1.jpg" alt="er profile" class="crayons-avatar__image"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/er" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Adhishri Kothiyal
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Adhishri Kothiyal
                
              
              &lt;div id="story-author-preview-content-2803891" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/er" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1143586%2F10aea440-a75d-4a57-b528-90792157a6c1.jpg" class="crayons-avatar__image" alt=""&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Adhishri Kothiyal&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/er/hack-the-box-dancing-2jpo" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Aug 27 '25&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/er/hack-the-box-dancing-2jpo" id="article-link-2803891"&gt;
          Hack the box - Dancing (SMB)
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/hackthebox"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;hackthebox&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/security"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;security&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/cybersecurity"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;cybersecurity&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/computerscience"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;computerscience&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
            &lt;a href="https://dev.to/er/hack-the-box-dancing-2jpo#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              Comments


              &lt;span class="hidden s:inline"&gt;Add Comment&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            2 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
      <category>hackthebox</category>
      <category>security</category>
      <category>cybersecurity</category>
      <category>computerscience</category>
    </item>
    <item>
      <title>Hack the box - Dancing (SMB)</title>
      <dc:creator>Adhishri Kothiyal</dc:creator>
      <pubDate>Wed, 27 Aug 2025 20:39:38 +0000</pubDate>
      <link>https://dev.to/er/hack-the-box-dancing-2jpo</link>
      <guid>https://dev.to/er/hack-the-box-dancing-2jpo</guid>
      <description>&lt;p&gt;I will cover solution steps of the “Dancing” machine, which is part of the ‘Starting Point’ labs and has a difficulty rating of ‘Very Easy’.&lt;/p&gt;

&lt;p&gt;Refresh the page in browser to see the new connection and then we can activate the machine by clicking the ‘Spawn Machine’ button. The machine is now active and showing a target IP address&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxzaq8u26raj6gxf437lh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxzaq8u26raj6gxf437lh.png" alt=" " width="800" height="169"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TASK 1&lt;/strong&gt;: What does the 3-letter acronym SMB stand for? &lt;strong&gt;Server Message Block&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TASK 2&lt;/strong&gt;: What port does SMB use to operate at? &lt;strong&gt;445&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TASK 3&lt;/strong&gt;: What is the service name for port 445 that came up in our Nmap scan? &lt;strong&gt;microsoft-ds&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcsd3nfsxtr1prc69ad3s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcsd3nfsxtr1prc69ad3s.png" alt=" " width="800" height="598"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TASK 4&lt;/strong&gt;: What is the 'flag' or 'switch' that we can use with the smbclient utility to 'list' the available shares on Dancing? &lt;strong&gt;-L&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4imanstinhsmvbe638mq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4imanstinhsmvbe638mq.png" alt=" " width="800" height="167"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;TASK 5: How many shares are there on Dancing? &lt;strong&gt;4&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TASK 6&lt;/strong&gt;: What is the name of the share we are able to access in the end with a blank password? &lt;strong&gt;WorkShares&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TASK 7&lt;/strong&gt;:What is the command we can use within the SMB shell to download the files we find? &lt;strong&gt;get&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Submit root Flag&lt;/strong&gt;:&lt;br&gt;
Let's run nmap to find the open ports using the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nmap -sV -sC {IP Address}
nmap -sV -sC 10.129.4.215
or
nmaap -p 137,139,445 10.129.4.215 -A
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg4b5rh5k7kk3or1rub3w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg4b5rh5k7kk3or1rub3w.png" alt=" " width="800" height="598"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4fmf033cmzk6vlj1v0gn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4fmf033cmzk6vlj1v0gn.png" alt=" " width="800" height="589"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Alright, so we've got ourselves a Windows box here with three ports open. After a bit of sleuthing, it turns out Port 445 is running SMB (version 3.1.1).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;smbclient -L &amp;lt;IP&amp;gt;
smbclient -L 10.129.4.215
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Using the -L flag with the smbclient command, like smbclient -L {IP Address}, gives us a sneak peek into the shares hanging out on our target machine. We've got four sharenames staring back at us. Time to crack them open and see what goodies they've got stashed away. Let's dive in and explore each one!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkv0tdg7hkcheyga0b83q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkv0tdg7hkcheyga0b83q.png" alt=" " width="800" height="167"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's see if we can access any of these shares using the below commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;smbclient //10.129.4.215/Admin$
smbclient //10.129.4.215/C$
smbclient //10.129.4.215/IP$ 
smbclient //10.129.4.215/Workshares
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We wear able to access Ip but it had no files and finally we were able to access Workshares without a password. Workshares has 2 directories. I accessed James.P and found a flags.txt file. I downlaoded the file using the get command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;get flag.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu6j7ghsv25d97cg2zl7m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu6j7ghsv25d97cg2zl7m.png" alt=" " width="800" height="504"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7e4wbqcnhmgdnbodam4y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7e4wbqcnhmgdnbodam4y.png" alt=" " width="611" height="216"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And there we get the flag! On submitting it you will receive message as "&lt;em&gt;&lt;strong&gt;Dancing has been Pwned&lt;/strong&gt;&lt;/em&gt;" and Challenge solved successfully.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3697p2511zc51efo7uis.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3697p2511zc51efo7uis.png" alt=" " width="800" height="721"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqxczkvjgor8miyguxifj.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqxczkvjgor8miyguxifj.gif" alt=" " width="498" height="282"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&amp;gt; Gentle Reader feel free to reach out for queries and feedback.&lt;/em&gt; 🥷&lt;/p&gt;

</description>
      <category>hackthebox</category>
      <category>security</category>
      <category>cybersecurity</category>
      <category>computerscience</category>
    </item>
    <item>
      <title>Hack the Box — Meow (telnet)</title>
      <dc:creator>Adhishri Kothiyal</dc:creator>
      <pubDate>Wed, 27 Aug 2025 19:48:45 +0000</pubDate>
      <link>https://dev.to/er/hack-the-box-meow-telnet-301g</link>
      <guid>https://dev.to/er/hack-the-box-meow-telnet-301g</guid>
      <description>&lt;p&gt;I will cover solution steps of the “Meow” machine, which is part of the ‘Starting Point’ labs and has a difficulty rating of ‘Very Easy’.&lt;/p&gt;

&lt;p&gt;Login to Hack the Box portal and navigate to Starting Point’s page, where you will be prompted to choose between a PWNBOX or an OVPN (i.e. OpenVPN) connection. A PWNBOX is a pre-configured, browser-based virtual machine and requires a HackTheBox VIP+ membership for unlimited access. I have used the OVPN method and Kali Linux through VMWare Workstation for this challenge.&lt;/p&gt;

&lt;p&gt;Download the VPN (.ovpn) configuration file and open a terminal window and run below mentioned command.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sudo openvpn [path/to/filename].ovpn&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Note: [filename] should be replaced with the name of your downloaded .ovpn file for the Starting Point lab.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv1mo8rtev2dmb7cht0zh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv1mo8rtev2dmb7cht0zh.png" alt=" " width="800" height="258"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3y4x05sbs0v9m4cbp2fq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3y4x05sbs0v9m4cbp2fq.png" alt=" " width="800" height="388"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You will see the Initialization Sequence Completed line at the end, which confirms we have now connected to the Meow machine.&lt;/p&gt;

&lt;p&gt;Refresh the page in browser to see the new connection and then we can activate the machine by clicking the ‘Spawn Machine’ button. The machine is now active and showing a target IP address.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F69mefe2kze3idsca41sd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F69mefe2kze3idsca41sd.png" alt=" " width="800" height="106"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TASK 1&lt;/strong&gt;: What does the acronym VM stand for?: Virtual Machine&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TASK 2&lt;/strong&gt;: What tool do we use to interact with the operating system in order to issue commands via the command line, such as the one to start our VPN connection? It’s also known as a console or shell: Terminal&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Task 3&lt;/strong&gt;: What service do we use to form our VPN connection into HTB labs? : openvpn&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Task4&lt;/strong&gt;: What tool do we use to test our connection to the target with an ICMP echo request?: ping&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Task5&lt;/strong&gt;: What is the name of the most common tool for finding open ports on a target? : nmap&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TASK 6&lt;/strong&gt;: What service do we identify on port 23/tcp during our scans? : &lt;strong&gt;telnet&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TASK 7&lt;/strong&gt;: What username is able to log into the target over telnet with a blank password? &lt;strong&gt;root&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Submit Flag:&lt;/p&gt;

&lt;p&gt;To find the flag we’d run an nmap scan:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nmap -p- &amp;lt;IP&amp;gt; 
nmap -p- 10.129.77.62 
or 
nmap -v 10.129.77.62
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjq803jcyu7newk4yxvtk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjq803jcyu7newk4yxvtk.png" alt=" " width="800" height="266"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We’d find port 23 open and now we’ll try to connect to telnet using below command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;telnet &amp;lt;IP&amp;gt; 
telnet 10.129.77.62

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flvl3yubyfpozpjra66xa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flvl3yubyfpozpjra66xa.png" alt=" " width="800" height="414"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It asks for Meow Login. Let’s try:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;username:root 
password: [just enter without entering any password]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fww5qm8vfrcdxumm6azzm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fww5qm8vfrcdxumm6azzm.png" alt=" " width="800" height="1002"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Lastly run the below commands to check for existing files and to check its contents.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ls -al 
cat flag.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff7yhghbf1ldsm9ktur7t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff7yhghbf1ldsm9ktur7t.png" alt=" " width="550" height="179"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You will receive message as “Meow has been Pwned” and Challenge solved successfully.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz42csif8o5mraxfti2xr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz42csif8o5mraxfti2xr.png" alt=" " width="800" height="736"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn8y7g80c20mmf8gbqqnk.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn8y7g80c20mmf8gbqqnk.gif" alt=" " width="498" height="280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Dear Reader feel free to reach out for queries and feedback.&lt;/em&gt;🥷&lt;/p&gt;
&lt;/blockquote&gt;

</description>
    </item>
    <item>
      <title>Tic-Tac-Toe: Python3</title>
      <dc:creator>Adhishri Kothiyal</dc:creator>
      <pubDate>Mon, 16 Oct 2023 11:42:54 +0000</pubDate>
      <link>https://dev.to/er/tic-tac-toe-python3-1n8g</link>
      <guid>https://dev.to/er/tic-tac-toe-python3-1n8g</guid>
      <description>&lt;p&gt;Hello Dev(s),&lt;/p&gt;

&lt;p&gt;This is my first blog post of &lt;a href="https://dev.to"&gt;&lt;strong&gt;DEV&lt;/strong&gt;&lt;/a&gt; and I am doing this as a part of my CS 101 course.&lt;/p&gt;

&lt;p&gt;Lately I have been brushing up my coding skills. I haven't coded since past 6 years and all the concepts are very blurry right now. To start fresh I decided to take up a &lt;a href="https://www.codecademy.com/" rel="noopener noreferrer"&gt;&lt;strong&gt;Codecademy&lt;/strong&gt;&lt;/a&gt; learning path. I enrolled myself in Computer Science career path. The first part of the path's curriculum includes learning a language &amp;amp; its basics. I have invested my time so far in learning Python3. The last assignment of the first section is to build a terminal based game. The objectives of this project were:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Build a terminal program using Python&lt;/li&gt;
&lt;li&gt;Add at least one interactive feature using input()&lt;/li&gt;
&lt;li&gt;Use Git version control&lt;/li&gt;
&lt;li&gt;Use the command line and file navigation&lt;/li&gt;
&lt;li&gt;Write a technical blog post on the project&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Thinking about what to build was kind of scary. Since I have never made any game before I was scared about few things like: from where will I begin, what the logic would be and how will I end. I decided to take one step at a time and not think much about the next. Gathering all the courage and lot of motivation from my lovely husband I decided to pick up something simple and a game who's rules I already knew hence &lt;em&gt;Tic-tac-toe&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here's a rundown to my program:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;First I printed down a small welcome message for the players. I also created a 1-D list (&lt;em&gt;g_board&lt;/em&gt;) to store the markers (&lt;em&gt;X&lt;/em&gt; or &lt;em&gt;0&lt;/em&gt;) or the empty blocks in the game board. Initial value of each item in list is &lt;code&gt;" "&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft14gkrlacpzqsvrn0joy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft14gkrlacpzqsvrn0joy.png" alt="Welcome Message and a default game board" width="800" height="475"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then I created a function to print the board when a player makes a move. For players the blocks are numbered from 1-9 while in the program the &lt;em&gt;g_board&lt;/em&gt; list is accessed from 0-8, thus while printing the player's choice I decreased 1 and then tried to access the game board. Every print statement is 1 row in the game board. Each block in the game board was accessed by &lt;code&gt;g_board[block_number]&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fptz2xx6k0s9t0x9ja148.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fptz2xx6k0s9t0x9ja148.png" alt="Print the game board" width="800" height="317"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next functions are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;To switch the player for turns and decide the marker symbol for each player. &lt;em&gt;Player A&lt;/em&gt; marks on the board as &lt;em&gt;X&lt;/em&gt; and &lt;em&gt;Player B&lt;/em&gt; as &lt;em&gt;0&lt;/em&gt; (&lt;em&gt;which_playerNmarker()&lt;/em&gt;).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;To take the choice input from each player in their respective turns (&lt;em&gt;player_ip()&lt;/em&gt;). The &lt;code&gt;input()&lt;/code&gt; function takes in an input as a string thus I am using &lt;code&gt;int()&lt;/code&gt; function to change typer from string -&amp;gt; integer.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;To check for empty strings in the game board (&lt;code&gt;contains()&lt;/code&gt;). We need to check empty strings because if we have no empty blocks then it means the game board is full and if there is no winner then there is a tie.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flbhaad3h8m0jqxaug876.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flbhaad3h8m0jqxaug876.png" alt="Decide the player &amp;amp; marker, take the i/p from the player, check for an empty string in the game board" width="800" height="801"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next was a function to check for win or tie (&lt;em&gt;winORtie()&lt;/em&gt;) and last but not the least a loop to keep the game running until someone either wins or it's a tie. In the end the winner gets printed.&lt;/p&gt;

&lt;p&gt;Logic for &lt;em&gt;winORtie()&lt;/em&gt;: If the winner is none then the loop runs and checks 8 possible options for a player to win. If the marker is on the following blocks the player wins:&lt;br&gt;
1, 2, 3&lt;br&gt;
4, 5, 6&lt;br&gt;
7, 8, 9&lt;br&gt;
1, 4, 7&lt;br&gt;
2, 5, 8&lt;br&gt;
3, 6, 9&lt;br&gt;
1, 5, 9&lt;br&gt;
3, 5, 7&lt;br&gt;
Lastly the function checks if there is no empty string and none of the above conditions were fulfilled then it's a tie.  &lt;/p&gt;

&lt;p&gt;&lt;em&gt;(Note: This is the best I could think at that time and I was not sure if that was the best solution. For now I know 2 more logics that can be implemented but I haven't tried them personally. That's a task for some other day. I haven't implemented file system as well. Also  I did realize that I need a way to determine if a particular block has been marked by the other player. In this program if Player B chooses a block already marked by Player A the program will rewrite the block with Player B's marker. This shouldn't happen. I haven't figured out how to solve that problem, so I'll probably improve my code down in the future.)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxxh5kmkmzognjyvnbaek.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxxh5kmkmzognjyvnbaek.png" alt="Win or Tie" width="800" height="782"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;REFACTORING:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Later I refactored the &lt;em&gt;winORtie()&lt;/em&gt; function to make it simpler and neater. The logic remains the same though.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6jgc8093mm5rtsf0iofd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6jgc8093mm5rtsf0iofd.png" alt="[rf] Win Or Tie" width="800" height="355"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Wanna see how it runs? ⚡️&lt;br&gt;
&lt;a href="https://i.giphy.com/media/v1.Y2lkPTc5MGI3NjExMzZ4aHl5NHMwaThpeDFobmltdWd2MXVwbzFzOXg0MmU5em00YXBkbCZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/VbhO2XcJr5T4Rm1XU7/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/v1.Y2lkPTc5MGI3NjExMzZ4aHl5NHMwaThpeDFobmltdWd2MXVwbzFzOXg0MmU5em00YXBkbCZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/VbhO2XcJr5T4Rm1XU7/giphy.gif" width="480" height="249"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Haha Fun eh? If you are still interested to look at my code then check out my &lt;em&gt;&lt;strong&gt;GitHub&lt;/strong&gt;&lt;/em&gt; repo &lt;a href="https://github.com/AdhishriKothiyal/Codecademy/tree/main/Computer%20Science/Python%203/TicTacToe" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>programming</category>
      <category>computerscience</category>
      <category>codenewbie</category>
    </item>
  </channel>
</rss>
