Page cover

[Linux] Basic Pentesting

Reconnaissance

As usual, we start our penetration testing journey with classical reconnaissance using Nmap.

sudo nmap 10.10.81.18

Enumeration

HTTP

Generally, starting the enumeration process on HTTP is easier and more practical. Let’s see what is hidden on the website.

It seems that the website is under maintenance. However, we may find interesting pages for the maintainers. We will enumerate web pages using a wordlist with Dirb.

We found a web page called /development. There are some interesting files we can examine.

SMB

As indicated in dev.txt, SMB has been configured. Let’s see if we can gather some information there. First, we will use enum4linux to obtain potential information on the host system.

We discovered two Unix users: kay and jan. According to j.txt, the user j (which matches Jan's initials) has a weak password on the system. We will conduct a dictionary attack on the SSH service, as this protocol enables remote connections to a machine.

Initial Access

SSH

We will perform our dictionary attack with Hydra. This allows us to discover Jan's password.

circle-info

Sorry for the inconvenience, I had to continue the pentest on another kali linux machine

Escalation

Jan can access the SSH private key of Kay, who is a sudoer.

We download the private key to our local machine, but we cannot use it to connect via SSH because it is protected with a passphrase.

Don't worry, John will help us obtain the password.

We can use this passphrase to unlock the private key file. The hidden word is in the file pass.bak.

Remediation

Last updated