Basic Pentesting

Target IP: 10.10.41.135

1. Scanning for Open Ports

Using nmap, the following ports were discovered:

  • 22SSH (accessible)

  • 80HTTP (web service available)

  • 139NetBIOS

  • 445SMB


2. Web Enumeration

  • Accessed the website via a browser.

  • Checked the page source and found a hint about a hidden directory.

  • Used gobuster to discover hidden directories:

    gobuster dir -u http://10.10.41.135 -w /usr/share/wordlists/dirb/common.txt
    • Hidden directory found: development

Source Code


3. User Enumeration & Brute-Forcing

Enumerating users using enum4linux:

- Found two users on the system

  • The first user: jan

Brute-forcing SSH password using Hydra:

  • Discovered password: armando

Service used to access the server: SSH


4. Privilege Escalation

1. System Enumeration using linPEAS

  • Transferred linpeas.sh to the target machine:

Copy linpeas To Victim Account
  • Found another user: kay, but lacked permissions to access their files.

2. Gaining Root Access

  • Inside kay's home directory, an RSA private key was found:

The key was password-protected, so it needed to be cracked.

  • Converted the RSA key to a hash format using ssh2john:

  • Cracked the password using John the Ripper:

  • Discovered password: beeswax

3. Switching to Kay’s User Account

  • Changed the permissions for the RSA key:

  • Used the key to log in as kay:

  • Confirmed user: kay

  • Found the final flag inside pass.bak:

    Flag: heresareallystrongpasswordthatfollowsthepasswordpolicy$$

Last updated