Skip to main content

Posts

Showing posts from December, 2023

Natas Level 9 Walkthrough: Code Injection

URL: http://natas9.natas.labs.overthewire.org Objective Gain access to the password for natas10. Procedure: Open the website and inspect the PHP source code. Identify the vulnerable passthru function in the source code: passthru("grep -i $key dictionary.txt"); Realize the potential for command injection by exploiting this vulnerability. Find the current directory by searching for: zzz; pwd; ls Explanation: Utilize the semicolon to separate different commands. Use zzz to ensure that grep returns no result. Include pwd to print the current working directory. Add ls to list the contents of the directory, avoiding issues with the word "dictionary.txt" hanging on its own. Use the find command to locate any file related to natas10: zzz; find / -type f -name natas10 2>/dev/null; ls ...

Natas Level 8 Writeup: String manipulation

URL: http://natas8.natas.labs.overthewire.org Introduction Natas Level 8 introduces a captivating web security challenge where the primary objective is to unveil the password for the succeeding level, natas9. Initial Exploration Begin the challenge by accessing the website through the provided URL.    Delve into the source code, scrutinizing it for potential hints and vulnerabilities. Decoding the Password Upon inspecting the PHP source code, identify the presence of an encoded password. The encoding process involves converting the secret to base64, reversing the string, and then converting it to hex. To retrieve the original secret, these steps must be reversed. To decode the password, follow these steps: Copy the encoded password. Utilize a tool like CyberChef or a preferred method. In reverse order, perform the following operations: Convert the string from hex. Reverse the resulting string to obtain a base64 string. Convert from base64 to reveal the original secret. Succes...

Natas Level 7 Writeup: Directory Traversal

  URL: http://natas7.natas.labs.overthewire.org Open the Website : Exploration : Page Navigation: Clicking on the "home" and "about" pages reveals the following links: http://natas7.natas.labs.overthewire.org/index.php?page=home http://natas7.natas.labs.overthewire.org/index.php?page=about Hint in Source Code: Inspecting the source code provides a hint about how the application includes pages. Exploit : URL Parameter Manipulation: Replace the page parameter with the desired file path: http://natas7.natas.labs.overthewire.org/index.php?page=/etc/natas_webpass/natas8   Success : You have successfully manipulated the URL parameter to access the password for natas8. Proceed to the next level using the acquired information.   PS: In Natas0, it was stated that    All passwords are also stored in /etc/natas_webpass/. E.g. the password for natas5 is stored in the file /etc/natas_webpass/natas5 and only readable by natas4 and natas5 That is how we know that the file...

Natas 6 Writeup: Unauthorized Access

ChatGP URL: http://natas6.natas.labs.overthewire.org Open the Website:   Challenge: To access the password for the next level, we need to discover a secret message. Exploration: 1. View Source Code: After clicking on the "View source" button, we find PHP code that has somehow been included.    2. Navigate to secrets.inc: Check the link in the PHP code, which leads to includes/secrets.inc .    The secret is revealed in the PHP file: 3. Success:   Enter the secret into the text field to reveal the password for the next level Proceed to the next level using the acquired information.   ______________________________________ NthApostle

Natas 5 Writeup: Cookies

URL: http://natas5.natas.labs.overthewire.org Open the Website: Inspect Cookies using Developer Console: Open the developer console, navigate to the "Application" tab, and select "Cookies." There is a cookie with the name loggedin Cookie Manipulation: Change the value of the loggedin cookie to 1 .   Refresh the page. Access Granted: Voila! With the manipulated cookie, access is granted.   Proceed to the next level with the acquired password.   ______________________________________ NthApostle  

Natas 4 Writeup: Referrer

  Natas Level 4: Referrer Header Trick URL: http://natas4.natas.labs.overthewire.org Open the Website:     Challenge: The goal is to change the Referer header to a specific URL. Tools Needed: Use an add-on like Requestly (an open-source HTTP debugging proxy for Chrome) or Burp Suite for this task. Modify the Referer Header: Install Requestly: If using Requestly, install the addon for your browser. Configure Referer: Add a rule to modify the Referer header to match the required URL.    Capture the Password: Refresh the page after modifying the Referer header.   Access Granted: Voila! The password for natas5 is revealed. Proceed to the next level using the acquired password.   ______________________________________ NthApostle

Natas Level 3 Writeup: Robots

  URL: http://natas3.natas.labs.overthewire.org Open the Website:       View the Source Code:       Key Points: The line emphasizing not even Google will find it hints at a robots.txt file. Explore the Robots.txt: Discover the Secret Page:     Reveal the Password: Proceed to Level 4   ______________________________________ NthApostle    

Natas Level 2 Writeup: View Source

  URL: http://natas2.natas.labs.overthewire.org Open the Website Upon accessing the provided URL, you are presented with the Natas Level 2 webpage. View the Source Code Inspecting the source code reveals a clue—an image tag referencing a file on the server:                 Explore the Image URL The image file is located at http://natas2.natas.labs.overthewire.org/files/pixel.png Attempting to open the URL directly leads to a blank page Navigate to the Files Directory Navigate back one directory to the "files" directory, revealing all available files: http://natas2.natas.labs.overthewire.org/files/     Open the users.txt File Select the "users.txt" file, and you will find the password to the next level Proceed to Level 3   ______________________________________ NthApostle    

Natas1: Overcoming Right-Click Restriction

To proceed to Level 2, log in using the password obtained in Level 0. On the Natas 1 homepage, we encounter a scenario similar to Level 0, but this time right-click functionality is disabled. Options to Bypass Right-Click Restriction: Ctrl + Right Click: Attempt to use the keyboard shortcut Ctrl along with the right-click. Ctrl + U: Press Ctrl + U to view the page's source code directly. Ctrl + Shift + C: Use Ctrl + Shift + C to open the browser's developer tools and inspect the elements. Explore these options to access the page's source code and find the password. In this challenge, the password is hidden in the source code close to the bottom, just like in Level 0.               Solution: Upon gaining access to the source code, look for the password, usually embedded as a comment. Here's an image depicting the solution for Natas 1.                   Proceed to Level 2   ____________________________...

Natas Level 0 WriteUp: View Source

In this series of blog posts, I'll be walking you through the steps I took to conquer each level of the Natas series on Over The Wire, a set of challenges designed to teach the fundamentals of server-side web security. Before diving into the solutions, I recommend attempting each level yourself to maximize the learning experience. Let's begin with the instructions for Level 0: Username: natas0 Password: natas0 URL: http://natas0.natas.labs.overthewire.org Upon logging in, a hint informs us that the password for the next level is somewhere on the page. The suggested approach is to examine the page's source code: Access the Page Source: Right-click on the page and select "View Page Source." Locate the Password: Check the source code for comments, particularly towards the bottom                  Proceed to Level 1.     ______________________________________ NthApostle