<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sohan Shelar on Medium]]></title>
        <description><![CDATA[Stories by Sohan Shelar on Medium]]></description>
        <link>https://medium.com/@sohanshelar01?source=rss-237b15b5661d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*SnLGiezTQ8NY1l4c</url>
            <title>Stories by Sohan Shelar on Medium</title>
            <link>https://medium.com/@sohanshelar01?source=rss-237b15b5661d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 21:02:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sohanshelar01/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[OverTheWire Bandit Level 4 → Level 5]]></title>
            <link>https://medium.com/@sohanshelar01/overthewire-bandit-level-4-level-5-07b630302a9c?source=rss-237b15b5661d------2</link>
            <guid isPermaLink="false">https://medium.com/p/07b630302a9c</guid>
            <category><![CDATA[overthewire-writeup]]></category>
            <category><![CDATA[bandit-walkthrough]]></category>
            <category><![CDATA[bandit-level-4]]></category>
            <dc:creator><![CDATA[Sohan Shelar]]></dc:creator>
            <pubDate>Wed, 21 Oct 2026 14:28:02 GMT</pubDate>
            <atom:updated>2026-10-21T14:28:02.412Z</atom:updated>
            <content:encoded><![CDATA[<h3>1. Objective</h3><p>Find the password for <strong>Bandit Level 5</strong>. The password is stored in one of the files inside the inhere directory. Only one file contains human-readable text; the others contain non-text data.</p><h3>2. Current Level Credentials</h3><ul><li><strong>Username:</strong> bandit4</li><li><strong>Password:</strong> xzTXq1rDJQVVAzdv5cHq1TQytTWufAMq</li><li><strong>Host:</strong> bandit.labs.overthewire.org</li><li><strong>Port:</strong> 2220</li></ul><h3>3. Connect to the Server</h3><p>Connect to the Bandit server using SSH:</p><pre>ssh bandit4@bandit.labs.overthewire.org -p 2220</pre><p>Enter the current level’s password when prompted.</p><h3>4. Explore the Directory</h3><p>List the files in the home directory:</p><pre>ls</pre><p>Output:</p><pre>inhere</pre><p>The inhere directory contains the files we need to investigate. Navigate into it:</p><pre>cd inhere</pre><p>List all files, including hidden entries and their details:</p><pre>ls -la</pre><p>The directory contains ten files, named -file00 through -file09.</p><h3>5. Identify the File Containing Text</h3><p>The objective is to find which file contains readable text. Instead of opening every file individually, use the file command to identify each file&#39;s type:</p><pre>file ./*</pre><p>Output:</p><pre>./-file00: data<br>./-file01: data<br>./-file02: data<br>./-file03: data<br>./-file04: data<br>./-file05: data<br>./-file06: data<br>./-file07: ASCII text<br>./-file08: data<br>./-file09: data</pre><p>The output identifies -file07 as an ASCII text file. The remaining files are classified as generic data.</p><h3>Why this works</h3><ul><li>file examines a file&#39;s contents and identifies its type.</li><li>./* expands to the entries in the current directory.</li><li>ASCII text indicates that the file contains ordinary, human-readable text.</li><li>The ./ prefix also lets us reference filenames beginning with a hyphen without confusing them with command-line options.</li></ul><h3>6. Retrieve the Next Password</h3><p>Read the identified file:</p><pre>cat ./-file07</pre><p>Output:</p><pre>6C7h9GD8M6ai5nr7wo1RonrzFjj9yIrG</pre><p>This is the password for <strong>Bandit Level 5</strong>.</p><h3>7. Next Level Credentials</h3><ul><li><strong>Next username:</strong> bandit5</li><li><strong>Password:</strong> 6C7h9GD8M6ai5nr7wo1RonrzFjj9yIrG</li><li><strong>Host:</strong> bandit.labs.overthewire.org</li><li><strong>Port:</strong> 2220</li></ul><p>Connect to the next level using:</p><pre>ssh bandit5@bandit.labs.overthewire.org -p 2220</pre><p>Enter the password retrieved from -file07 when prompted.</p><h3>Key Takeaways</h3><ul><li>Use ls -la to inspect directory contents and file details.</li><li>Use file to identify file types without manually opening every file.</li><li>Use ./filename when a filename begins with a hyphen to avoid option-parsing issues.</li><li>Filter files by their characteristics to locate relevant data efficiently.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=07b630302a9c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OverTheWire Bandit — Level 3 → Level 4]]></title>
            <link>https://medium.com/@sohanshelar01/overthewire-bandit-level-3-level-4-c8cb8846c4b3?source=rss-237b15b5661d------2</link>
            <guid isPermaLink="false">https://medium.com/p/c8cb8846c4b3</guid>
            <category><![CDATA[bandit-level-3]]></category>
            <category><![CDATA[overthewire-writeup]]></category>
            <category><![CDATA[bandit-walkthrough]]></category>
            <dc:creator><![CDATA[Sohan Shelar]]></dc:creator>
            <pubDate>Wed, 21 Oct 2026 14:26:20 GMT</pubDate>
            <atom:updated>2026-10-21T14:26:20.835Z</atom:updated>
            <content:encoded><![CDATA[<h3>1. Current Level Credentials</h3><ul><li><strong>Username:</strong> bandit3</li><li><strong>Password:</strong> 7ZZ2LFrykP2zEyvBl4m3clcL7tGYJPME</li><li><strong>SSH Host:</strong> bandit.labs.overthewire.org</li><li><strong>SSH Port:</strong> 2220</li></ul><h3>Login Command</h3><pre>ssh bandit3@bandit.labs.overthewire.org -p 2220</pre><p>Enter the Level 3 password when prompted to access the remote shell.</p><h3>2. Objective</h3><p>The objective of Bandit Level 3 → Level 4 is to find the password for the next level inside the inhere directory.</p><p>The password is stored in a <strong>hidden file</strong>. The challenge introduces Linux hidden-file conventions and the commands used to enumerate files that ordinary directory listings do not display.</p><h3>3. Concepts Learned</h3><ul><li>Navigating directories with cd.</li><li>Listing files with ls.</li><li>Identifying hidden files using ls -la.</li><li>Understanding filenames beginning with a dot (.).</li><li>Reading file contents using cat.</li><li>Using absolute and relative paths to access files.</li></ul><h3>4. Solution / Methodology</h3><h3>Step 1: Connect to the Bandit server</h3><p>Execute:</p><pre>ssh bandit3@bandit.labs.overthewire.org -p 2220</pre><p>After successful authentication, the shell opens as bandit3.</p><p>The prompt looks similar to:</p><pre>bandit3@bandit:~$</pre><p>The ~ symbol represents the current user&#39;s home directory.</p><h3>Step 2: Enumerate the home directory</h3><p>Run:</p><pre>ls</pre><p><strong>Output:</strong></p><pre>inhere</pre><p>The output shows a directory named inhere. This is the directory specified by the challenge and is the next location to investigate.</p><h3>Step 3: Enter the target directory</h3><p>Run:</p><pre>cd inhere</pre><p><strong>Explanation:</strong></p><ul><li>cd stands for <em>change directory</em>.</li><li>inhere is the relative path to the target directory.</li></ul><p>The prompt changes to:</p><pre>bandit3@bandit:~/inhere$</pre><p>This confirms that the current working directory is now inhere.</p><h3>Step 4: Enumerate hidden files</h3><p>Run:</p><pre>ls -la</pre><p><strong>Output:</strong></p><pre>total 12<br>drwxr-xr-x 2 root    root    4096 Sep 26 21:53 .<br>drwxr-xr-x 3 root    root    4096 Sep 26 21:53 ..<br>-rw-r----- 1 bandit4 bandit3   33 Sep 26 21:53 ...Hiding-From-You</pre><p>The important entry is:</p><pre>...Hiding-From-You</pre><p>The file is unusual because its name begins with three dots.</p><p><strong>Why use</strong> **ls -la**<strong>?</strong></p><ul><li>-l displays detailed file information, including permissions, ownership, file size, and modification time.</li><li>-a includes hidden entries in the listing.</li></ul><p>In Linux, filenames beginning with a dot are treated as hidden by convention. The ls command normally omits these entries unless an option such as -a is used.</p><p>The filename ...Hiding-From-You is not a special directory reference. It is an ordinary filename beginning with three dots.</p><h3>Step 5: Read the hidden file</h3><p>Run:</p><pre>cat ...Hiding-From-You</pre><p><strong>Output:</strong></p><pre>xzTXq1rDJQVVAzdv5cHq1TQytTWufAMq</pre><p>The cat command prints the contents of the specified file to standard output. Because the filename contains no spaces and does not begin with a hyphen, it can be provided directly without quoting or a ./ prefix.</p><p>The displayed string is the password required to access Level 4.</p><h3>Step 6: Exit the SSH session</h3><p>Run:</p><pre>exit</pre><p>This terminates the current shell and closes the SSH connection.</p><h3>5. Alternative Correct Methods</h3><p>The same file can be accessed using several valid approaches.</p><h3>Method 1: Use ls -a</h3><p>From inside inhere, run:</p><pre>ls -a</pre><p>This displays hidden entries, including ...Hiding-From-You. It does not show detailed metadata, but it is sufficient to discover the filename.</p><p>Then read the file:</p><pre>cat ...Hiding-From-You</pre><h3>Method 2: Use find</h3><p>From the home directory, run:</p><pre>find inhere -type f</pre><p>This searches the inhere directory for regular files, including hidden files.</p><p>To display the contents directly:</p><pre>find inhere -type f -exec cat {} \;</pre><p>Here:</p><ul><li>find inhere starts the search in the inhere directory.</li><li>-type f selects regular files.</li><li>-exec cat {} \; runs cat on each file found.</li><li>{} represents the path of the file found by find.</li><li>\; marks the end of the -exec command.</li></ul><p>For this level, the simpler ls -la followed by cat is preferable because it lets you inspect the directory before reading the file.</p><h3>Method 3: Use the full path from the home directory</h3><p>If you are in the home directory, you can read the file without changing directories:</p><pre>cat inhere/...Hiding-From-You</pre><p>The path inhere/...Hiding-From-You identifies the file relative to the current home directory.</p><h3>6. Commands Used</h3><h3>SSH</h3><pre>ssh bandit3@bandit.labs.overthewire.org -p 2220</pre><p>Connects to the remote server using SSH on port 2220.</p><h3>List directory contents</h3><pre>ls</pre><p>Displays ordinary visible entries in the current directory.</p><h3>Change directory</h3><pre>cd inhere</pre><p>Moves into the inhere directory.</p><h3>List all entries with details</h3><pre>ls -la</pre><p>Displays visible and hidden entries along with their metadata.</p><h3>Read the hidden file</h3><pre>cat ...Hiding-From-You</pre><p>Displays the file’s contents.</p><h3>Exit</h3><pre>exit</pre><p>Closes the current SSH session.</p><h3>7. Key Takeaways</h3><ul><li>Linux treats filenames beginning with a dot as hidden by convention; hidden files are not necessarily protected by special permissions.</li><li>ls does not normally display hidden entries, whereas ls -a does.</li><li>ls -la is useful during enumeration because it reveals hidden entries and provides file metadata.</li><li>A filename beginning with multiple dots is not inherently special. Only the exact names . and .. have the standard current-directory and parent-directory meanings.</li><li>find is useful when searching directories for files whose names or locations are not immediately known.</li><li>Always inspect directory contents before assuming a directory is empty. Hidden files can contain configuration data, credentials, or other sensitive information.</li></ul><h3>8. Next Level Credentials</h3><ul><li><strong>Next Level Username:</strong> bandit4</li><li><strong>Next Level Password:</strong> xzTXq1rDJQVVAzdv5cHq1TQytTWufAMq</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c8cb8846c4b3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OverTheWire Bandit — Level 2 → Level 3]]></title>
            <link>https://medium.com/@sohanshelar01/overthewire-bandit-level-2-level-3-a4f2e4106ade?source=rss-237b15b5661d------2</link>
            <guid isPermaLink="false">https://medium.com/p/a4f2e4106ade</guid>
            <category><![CDATA[overthewire-writeup]]></category>
            <category><![CDATA[bandit-walkthrough]]></category>
            <category><![CDATA[bandit-level-2]]></category>
            <dc:creator><![CDATA[Sohan Shelar]]></dc:creator>
            <pubDate>Wed, 21 Oct 2026 14:24:57 GMT</pubDate>
            <atom:updated>2026-10-21T14:24:57.966Z</atom:updated>
            <content:encoded><![CDATA[<h3>1. Current Level Credentials</h3><ul><li><strong>Username:</strong> bandit2</li><li><strong>Password:</strong> PK8fYLZg2hnHSz83plBL1iEPKdD3QToB</li><li><strong>SSH Host:</strong> bandit.labs.overthewire.org</li><li><strong>SSH Port:</strong> 2220</li></ul><h3>Login Command</h3><pre>ssh bandit2@bandit.labs.overthewire.org -p 2220</pre><p>Enter the Level 2 password when prompted. After successful authentication, you will receive an interactive shell as bandit2.</p><h3>2. Objective</h3><p>The objective of Bandit Level 2 → Level 3 is to retrieve the next level’s password from a file in the current user’s home directory.</p><p>The filename is:</p><pre>--spaces in this filename--</pre><p>This challenge focuses on handling filenames that contain spaces and begin with hyphens. The filename must be passed to the command as a single argument, and the leading hyphens must not be mistaken for command-line options.</p><h3>3. Concepts Learned</h3><ul><li>Listing files with ls.</li><li>Handling filenames containing spaces.</li><li>Quoting filenames to preserve them as a single command-line argument.</li><li>Understanding command-line option parsing.</li><li>Using -- to mark the end of command options in utilities that support it.</li><li>Understanding why backslash escaping must be applied correctly.</li></ul><h3>4. Solution / Methodology</h3><h3>Step 1: Connect to the server</h3><p>Execute:</p><pre>ssh bandit2@bandit.labs.overthewire.org -p 2220</pre><p>Enter the current level’s password when prompted.</p><p>After authentication, the terminal opens in the home directory, indicated by the prompt:</p><pre>bandit2@bandit:~$</pre><h3>Step 2: Identify the target file</h3><p>Run:</p><pre>ls</pre><p><strong>Output:</strong></p><pre>--spaces in this filename--</pre><p>The output shows a filename containing several spaces and two leading hyphens.</p><p>Normally, spaces separate command-line arguments. If the filename is entered without quoting or escaping, the shell splits it into multiple arguments, causing the command to search for several separate files.</p><p>The leading hyphens can also be interpreted as an option by some commands.</p><h3>Step 3: Attempt to access the file using an unquoted path</h3><p>You tried:</p><pre>cat ./--spaces in this filename--</pre><p><strong>Output:</strong></p><pre>cat: ./--spaces: No such file or directory<br>cat: in: No such file or directory<br>cat: this: No such file or directory<br>cat: filename--: No such file or directory</pre><p>The shell splits the unquoted filename at each space. As a result, cat receives four separate file arguments rather than one complete filename.</p><p>The ./ prefix correctly identifies a relative path, but it does not prevent word splitting.</p><h3>Step 4: Attempt to use the -- option terminator</h3><p>You also tried:</p><pre>cat -- --spaces in this filename--</pre><p>This attempt still fails because the filename is not quoted or escaped. Although -- tells compatible commands that subsequent arguments are not options, it does not combine separate arguments into a single filename.</p><p>To work correctly, the entire filename must be passed as one argument.</p><h3>Step 5: Understand why the escaping attempts failed</h3><p>You tried:</p><pre>cat ./--spaces\in\this\filename</pre><p>and:</p><pre>cat ./--spaces\in\this\filename--</pre><p>These commands fail because a backslash escapes the character immediately following it. It does not represent a space when placed before a letter.</p><p>For example:</p><pre>\i</pre><p>makes i literal; it does not insert a space. Therefore, these commands effectively remove the spaces from the intended filename.</p><p>You also tried:</p><pre>cat ./--spaces \in \this \filename--</pre><p>This still passes multiple arguments to cat, so it cannot locate the intended file.</p><p><strong>Correct escaping approach:</strong> If using backslashes, escape each actual space:</p><pre>cat ./--spaces\ in\ this\ filename--</pre><p>This preserves the spaces within a single filename argument.</p><h3>Step 6: Use quotes to read the file</h3><p>You then tried:</p><pre>cat &#39;--spaces in this filename--&#39;</pre><p><strong>Output:</strong></p><pre>error: unexpected argument &#39;--spaces in this filename--&#39; found</pre><p>Quoting successfully keeps the filename together, but the command interprets the argument beginning with -- as an option. The error message suggests using -- to mark the end of options.</p><p>The successful command is:</p><pre>cat &#39;./--spaces in this filename--&#39;</pre><p><strong>Output:</strong></p><pre>7ZZ2LFrykP2zEyvBl4m3clcL7tGYJPME</pre><p>The command works because:</p><ul><li>Single quotes preserve the entire filename as one argument.</li><li>./ explicitly identifies the file as a relative path in the current directory.</li><li>The argument begins with ./ instead of --, so it is no longer interpreted as an option.</li></ul><p>The output is the password for Level 3.</p><h3>Step 7: Exit the SSH session</h3><p>Run:</p><pre>exit</pre><p>This terminates the current shell and closes the SSH connection.</p><h3>5. Commands Used</h3><h3>SSH</h3><pre>ssh bandit2@bandit.labs.overthewire.org -p 2220</pre><p>Connects to the remote Bandit server using SSH on port 2220.</p><h3>List files</h3><pre>ls</pre><p>Displays the filenames in the current directory.</p><h3>Incorrect: Unquoted filename</h3><pre>cat ./--spaces in this filename--</pre><p>Fails because the shell splits the filename at spaces.</p><h3>Incorrect: Option terminator without quoting</h3><pre>cat -- --spaces in this filename--</pre><p>Fails because -- prevents option parsing but does not combine the filename&#39;s space-separated parts.</p><h3>Incorrect: Backslashes before letters</h3><pre>cat ./--spaces\in\this\filename--</pre><p>Fails because the backslashes escape letters instead of spaces.</p><h3>Correct: Escape each space</h3><pre>cat ./--spaces\ in\ this\ filename--</pre><p>Preserves spaces and passes the filename as a single argument.</p><h3>Correct: Quote the relative path</h3><pre>cat &#39;./--spaces in this filename--&#39;</pre><p>Reads the target file successfully by preserving the spaces and avoiding the leading-hyphen option issue.</p><h3>Exit</h3><pre>exit</pre><p>Closes the current SSH session.</p><h3>6. Key Takeaways</h3><ul><li>Filenames can contain spaces and leading hyphens, which can complicate command-line usage.</li><li>The shell normally splits unquoted text at spaces into separate arguments.</li><li>Single quotes preserve a filename containing spaces as one argument.</li><li>Backslashes escape the character immediately following them; use \ to escape a space.</li><li>The -- option terminator prevents option parsing only in commands that support that convention. It does not fix word splitting.</li><li>Prefixing a filename with ./ is a practical way to distinguish it from a command-line option.</li><li>Correctly handling unusual filenames is useful in Linux administration, shell scripting, and cybersecurity enumeration.</li></ul><h3>7. Next Level Credentials</h3><ul><li><strong>Next Level Username:</strong> bandit3</li><li><strong>Next Level Password:</strong> 7ZZ2LFrykP2zEyvBl4m3clcL7tGYJPME</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a4f2e4106ade" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OverTheWire Bandit — Level 1 → Level 2]]></title>
            <link>https://medium.com/@sohanshelar01/overthewire-bandit-level-1-level-2-a21eb3747023?source=rss-237b15b5661d------2</link>
            <guid isPermaLink="false">https://medium.com/p/a21eb3747023</guid>
            <category><![CDATA[bandit-walkthrough]]></category>
            <category><![CDATA[overthewire-writeup]]></category>
            <category><![CDATA[bandit-level-1]]></category>
            <dc:creator><![CDATA[Sohan Shelar]]></dc:creator>
            <pubDate>Wed, 21 Oct 2026 14:21:25 GMT</pubDate>
            <atom:updated>2026-10-21T14:21:25.276Z</atom:updated>
            <content:encoded><![CDATA[<h3>1. Current Level Credentials</h3><ul><li><strong>Username:</strong> bandit1</li><li><strong>Password:</strong> 6y2kwnwK6grgvwvpvLaa2T1cpFEKOhNR</li><li><strong>SSH Host:</strong> bandit.labs.overthewire.org</li><li><strong>SSH Port:</strong> 2220</li></ul><h3>Login Command</h3><pre>ssh bandit1@bandit.labs.overthewire.org -p 2220</pre><p>Enter the Level 1 password when prompted. After successful authentication, an interactive shell opens as bandit1.</p><h3>2. Objective</h3><p>The objective of Bandit Level 1 → Level 2 is to retrieve the next level’s password from a file named - located in the current user&#39;s home directory.</p><p>The challenge is that - is a special character commonly interpreted by Linux commands as an option or as a reference to standard input, depending on the command and context. Therefore, the file must be referenced in a way that clearly identifies it as a filename.</p><h3>3. Concepts Learned</h3><ul><li>Linux file and directory enumeration using ls.</li><li>Hidden files and detailed file metadata.</li><li>Special filenames and command-line argument parsing.</li><li>Relative paths using ./.</li><li>Reading files with cat.</li><li>Understanding standard input and the special meaning of - in command-line utilities.</li></ul><h3>4. Solution / Methodology</h3><h3>Step 1: Connect to the Bandit server</h3><p>Execute the following command in your terminal:</p><pre>ssh bandit1@bandit.labs.overthewire.org -p 2220</pre><p>Enter the current level’s password when prompted.</p><p>Once authenticated, the terminal prompt appears as:</p><pre>bandit1@bandit:~$</pre><p>The ~ indicates that the shell starts in the user&#39;s home directory.</p><h3>Step 2: Enumerate the home directory</h3><p>Run:</p><pre>ls -la</pre><p><strong>Output:</strong></p><pre>total 24<br>-rw-r-----   1 bandit2 bandit1   33 Sep 26 21:54 -<br>drwxr-xr-x   2 root    root    4096 Sep 26 21:54 .<br>drwxr-xr-x 150 root    root    4096 Sep 26 21:58 ..<br>-rw-r--r--   1 root    root     220 Feb 13  2026 .bash_logout<br>-rw-r--r--   1 root    root    3851 Sep 26 21:38 .bashrc<br>-rw-r--r--   1 root    root     807 Feb 13  2026 .profile</pre><p><strong>Command explanation:</strong></p><ul><li>ls lists files and directories.</li><li>-l displays detailed information, including permissions, ownership, size, and modification time.</li><li>-a includes hidden files whose names begin with a dot.</li></ul><p>The output reveals a file whose name is a single hyphen (-). Its permissions are -rw-r-----, and its size is 33 bytes.</p><p>The filename is unusual because many command-line utilities use a standalone hyphen to represent standard input or standard output.</p><h3>Step 3: Attempt to read the file</h3><p>First, you tried:</p><pre>cat -</pre><p>This does not read the file named -. In this context, cat interprets the hyphen as a request to read from standard input. The command therefore waits for input from the terminal.</p><p>You interrupted it using Ctrl+C.</p><p>Next, you tried:</p><pre>cat &quot;-&quot;</pre><p>Quoting the hyphen prevents the shell from interpreting characters inside the quotes, but it does not change how cat interprets its argument. The argument is still -, so cat continues reading standard input.</p><p>You interrupted this command as well.</p><p><strong>Important lesson:</strong> Shell quoting and command-line option parsing are different things. Quoting a filename does not necessarily prevent a program from assigning special meaning to that argument.</p><h3>Step 4: Read the file using a relative path</h3><p>Run:</p><pre>cat ./-</pre><p><strong>Output:</strong></p><pre>PK8fYLZg2hnHSz83plBL1iEPKdD3QToB</pre><p>This command successfully reads the file.</p><p><strong>Why does it work?</strong></p><ul><li>. represents the current directory.</li><li>/ separates the directory path from the filename.</li><li>- is the actual filename.</li></ul><p>Therefore, ./- explicitly identifies the file in the current directory. The argument no longer consists of a standalone hyphen, so cat treats it as a file path rather than as standard input.</p><p>The displayed string is the password required for Level 2.</p><h3>Step 5: Exit the SSH session</h3><p>Run:</p><pre>exit</pre><p>This terminates the current shell and closes the SSH connection.</p><h3>5. Commands Used</h3><h3>SSH connection</h3><pre>ssh bandit1@bandit.labs.overthewire.org -p 2220</pre><p>Connects to the remote Bandit server using SSH on port 2220.</p><h3>List all files with details</h3><pre>ls -la</pre><p>Displays visible and hidden files along with their metadata.</p><h3>Attempt to read a hyphen-named file</h3><pre>cat -</pre><p>Reads from standard input in this context rather than opening the file named -.</p><h3>Quoted hyphen</h3><pre>cat &quot;-&quot;</pre><p>Still treats the argument as standard input because quoting does not remove the special meaning assigned by cat.</p><h3>Read the file using a relative path</h3><pre>cat ./-</pre><p>Reads the file named - from the current directory. This is the successful solution.</p><h3>Exit the session</h3><pre>exit</pre><p>Closes the current shell session.</p><h3>6. Key Takeaways</h3><ul><li>ls -la is useful for identifying unusual filenames and inspecting file metadata.</li><li>A filename can contain characters that have special meanings to command-line utilities.</li><li>Shell quoting protects against shell interpretation, but it does not override how the target program parses its arguments.</li><li>A standalone - commonly represents standard input or standard output in Unix utilities.</li><li>Prefixing a filename with ./ explicitly identifies it as a relative path in the current directory.</li><li>Understanding argument parsing is important in Linux administration, shell scripting, and security testing.</li></ul><h3>7. Next Level Credentials</h3><ul><li><strong>Next Level Username:</strong> bandit2</li><li><strong>Next Level Password:</strong> PK8fYLZg2hnHSz83plBL1iEPKdD3QToB</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a21eb3747023" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OverTheWire Bandit — Level 0 → Level 1]]></title>
            <link>https://medium.com/@sohanshelar01/overthewire-bandit-level-0-level-1-14ac82378fdb?source=rss-237b15b5661d------2</link>
            <guid isPermaLink="false">https://medium.com/p/14ac82378fdb</guid>
            <category><![CDATA[bandit-walkthrough]]></category>
            <category><![CDATA[overthewire-writeup]]></category>
            <category><![CDATA[bandit-level-0]]></category>
            <dc:creator><![CDATA[Sohan Shelar]]></dc:creator>
            <pubDate>Wed, 21 Oct 2026 14:14:07 GMT</pubDate>
            <atom:updated>2026-10-21T14:14:07.333Z</atom:updated>
            <content:encoded><![CDATA[<h3>1. Current Level Credentials</h3><ul><li><strong>Username:</strong> bandit0</li><li><strong>Password:</strong> bandit0</li><li><strong>SSH Host:</strong> bandit.labs.overthewire.org</li><li><strong>SSH Port:</strong> 2220</li></ul><h3>Login Command</h3><pre>ssh bandit0@bandit.labs.overthewire.org -p 2220</pre><p><strong>Explanation:</strong></p><ul><li>ssh — Starts a Secure Shell connection to a remote system.</li><li>bandit0@bandit.labs.overthewire.org — Specifies the username and remote hostname.</li><li>-p 2220 — Specifies port 2220 instead of SSH&#39;s default port, 22.</li></ul><p>When prompted, enter the current level password: bandit0.</p><p>On the first connection, SSH displays a host authenticity warning because the server’s host key is not yet in the local known_hosts file. After verifying the server&#39;s fingerprint, accepting it adds the host key to that file, allowing SSH to recognize the server on future connections.</p><h3>2. Objective</h3><p>The objective of Bandit Level 0 → Level 1 is to log in to the Bandit server and retrieve the password for Level 1.</p><p>The password is stored in a file named readme in the current user&#39;s home directory.</p><h3>3. Concepts Learned</h3><ul><li>SSH remote authentication and connecting to a non-default port.</li><li>Linux directory and file enumeration using ls.</li><li>Reading text files using cat.</li><li>Understanding the Linux home directory and relative file paths.</li><li>Retrieving credentials required for the next level.</li></ul><h3>4. Solution / Methodology</h3><h3>Step 1: Connect to the remote server</h3><p>Execute the following command in your local terminal:</p><pre>ssh bandit0@bandit.labs.overthewire.org -p 2220</pre><p>Enter the password bandit0 when prompted.</p><p>After successful authentication, the server displays the OverTheWire welcome message and opens a shell as bandit0.</p><p>The terminal prompt is:</p><pre>bandit0@bandit:~$</pre><p>Here:</p><ul><li>bandit0 is the current username.</li><li>bandit is the hostname.</li><li>~ represents the current user&#39;s home directory.</li><li>$ indicates a regular user shell rather than a root shell.</li></ul><h3>Step 2: List the files in the home directory</h3><p>Run:</p><pre>ls</pre><p><strong>Output:</strong></p><pre>readme</pre><p>The ls command lists files and directories in the current directory. Since the output contains a file named readme, this is the first file to investigate.</p><p>No additional directory path is required because the session starts in the user’s home directory.</p><h3>Step 3: Read the contents of the file</h3><p>Run:</p><pre>cat readme</pre><p><strong>Output:</strong></p><pre>Congratulations on your first steps into the bandit game!!<br>Please make sure you have read the rules at https://overthewire.org/rules/<br>If you are following a course, workshop, walkthrough or other educational activity,<br>please inform the instructor about the rules as well and encourage them to<br>contribute to the OverTheWire community so we can keep these games free!</pre><pre>The password you are looking for is: [Level 1 password]</pre><p>The cat command reads and prints the contents of a file to standard output.</p><p>The file contains introductory information and the password needed to log in to the next level. This completes the challenge.</p><h3>Step 4: Exit the current SSH session</h3><p>Run:</p><pre>exit</pre><p><strong>Output:</strong></p><pre>logout<br>Connection to bandit.labs.overthewire.org closed.</pre><p>The exit command terminates the current shell session and closes the SSH connection.</p><h3>5. Commands Used</h3><h3>ssh</h3><pre>ssh bandit0@bandit.labs.overthewire.org -p 2220</pre><p>Establishes a secure remote shell connection using the specified username, hostname, and port.</p><h3>ls</h3><pre>ls</pre><p>Lists the files and directories in the current directory.</p><h3>cat</h3><pre>cat readme</pre><p>Displays the contents of the readme file.</p><h3>exit</h3><pre>exit</pre><p>Terminates the current shell session.</p><h3>6. Key Takeaways</h3><ul><li>SSH allows users to securely access remote systems and execute commands.</li><li>The -p option specifies a custom SSH port.</li><li>ls is useful for initial file and directory enumeration.</li><li>cat is useful for reading text files when their contents are needed.</li><li>The home directory is a logical starting point when investigating files after logging in.</li><li>In cybersecurity assessments, basic enumeration and inspecting accessible files are fundamental techniques. Always perform these activities within the scope of authorized systems.</li></ul><h3>7. Next Level Credentials</h3><ul><li><strong>Next Level Username:</strong> bandit1</li><li><strong>Next Level Password:</strong> 6y2kwnwK6grgvwvpvLaa2T1cpFEKOhNR</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=14ac82378fdb" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>