Sitemap
Scorpion

Scorpion

INE CTF Web Application

4 min read4 days ago

--

🌐 Initial Information

  • Target: http://target.ine.local
  • Environment: Kali Linux (GUI access provided).
  • Provided Wordlists:
  • /usr/share/wordlists/dirb/common.txt
  • /usr/share/seclists/Usernames/top-usernames-shortlist.txt
  • /root/Desktop/wordlists/100-common-passwords.txt

🚩 Flag 1: Local File Inclusion (LFI)

Hint: β€œSometimes, important files are hidden in plain sight. Check the root (β€˜/’) directory for a file named β€˜flag.txt’…”
Explanation: The web application allows users to view files by passing a filename in the URL parameter, which is vulnerable to LFI.

Steps:

  1. Open your browser and navigate to http://target.ine.local.
  2. Browse the site and click on any file viewing links. You will notice the URL looks something like this: http://target.ine.local/view.php?file=about.txt.
  3. To exploit the LFI and read the file in the root directory, modify the file parameter to traverse up the directory tree:

http://target.ine.local/view.php?file=../../flag.txt

(Note: You may need to add more ../ depending on the server's directory depth, or you can simply try the absolute path: ?file=/flag.txt).

4. The contents of flag.txt will be displayed on the screen. Copy this value into the Flag 1 submission box.

Press enter or click to view image in full size
flag 1

β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” -

🚩 Flag 2: Directory Enumeration

Hint: β€œExplore the structure of the server’s directories. Enumeration might reveal hidden treasures.”
Explanation: We need to use a directory brute-forcing tool to find hidden directories on the web server.

Steps:

  1. Open a Terminal in your Kali Linux machine.
  2. Use the dirb tool with the provided wordlist to scan for hidden directories:

dirb http://target.ine.local /usr/share/wordlists/dirb/common.txt

3. Wait for the scan to complete. Look through the output for interesting directories (e.g., /secured, /hidden, /admin).

Get Scorpion’s stories inΒ yourΒ inbox

Join Medium for free to get updates fromΒ thisΒ writer.

4. Navigate to the discovered directory in your browser. For example:

http://target.ine.local/secured/

5. Look inside this directory. You will likely find a flag.txt file or the flag itself displayed on the page. Copy it into the Flag 2 submission box.

Press enter or click to view image in full size
flag 2

β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€”

🚩 Flag 3: Weak Login Form (Brute Force)

Hint: β€œThe login form seems a bit weak. Trying out different combinations might just reveal the next flag.”
Explanation: The login page lacks rate-limiting or lockout mechanisms. We will use Hydra with the provided lists to brute-force the credentials.

Steps:

  1. Navigate to the login page in your browser (e.g., http://target.ine.local/login).
  2. Try a dummy login (e.g., admin:admin) and note the exact error message (e.g., β€œInvalid username or password”).
  3. Open your terminal and use Hydra. Assuming the form uses POST with the fields username and password:

hydra -L /usr/share/seclists/Usernames/top-usernames-shortlist.txt -P /root/Desktop/wordlists/100-common-passwords.txt target.ine.local http-post-form β€œ/login:username=^USER^&password=^PASS^:F=Invalid username or password”

(Note: Adjust the /login path and the exact error message F=... if they differ on the actual page).

4. Hydra will output the valid credentials (e.g., guest:password123)

5. Go back to the browser, log in with these credentials, and the Flag 3 will be visible on your dashboard. Submit it.

Press enter or click to view image in full size
flag 3

β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€”

🚩 Flag 4: SQL Injection (SQLi)

Hint: β€œThe login form behaves oddly with unexpected inputs. Think of injection techniques to access the β€˜admin’ account and find the flag.”
Explanation: The login form is vulnerable to SQL Injection, allowing us to bypass authentication and log in as the admin user without knowing the password.

Steps:

  1. Go back to the login page.
  2. In the Username field, enter the following payload:

admin'--

' OR 1=1--

(Alternative payloads if the first one doesn’t work: admin' OR 1=1-- - or admin'#)

3. In the Password field, type anything random (e.g., 123456). The SQL comment -- will cause the database to ignore the password check.

4. Click the Login button. You will bypass authentication and be logged in directly as the administrator (admin).

5. The Flag 4 will be displayed on the admin dashboard. Copy and submit it.

Press enter or click to view image in full size
flag 4

β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€” β€”

Author: Scorpion

Cybersecurity | Penetration Testing | Linux Security | Red Teaming

Learning, practicing, and documenting one lab at a time.

--

--