Lightweight

This is an interesting box with the accumulation of previous gained skills. Here we take advantage of the LDAP protocol along with other misconfigurations

Scanning and Enumeration

Beggining with a basic Nmap scan we get the following results

nmap -sC -sV 10.10.10.119
PORT    STATE SERVICE VERSION
22/tcp  open  ssh     OpenSSH 7.4 (protocol 2.0)
| ssh-hostkey: 
|   2048 19:97:59:9a:15:fd:d2:ac:bd:84:73:c4:29:e9:2b:73 (RSA)
|   256 88:58:a1:cf:38:cd:2e:15:1d:2c:7f:72:06:a3:57:67 (ECDSA)
|_  256 31:6c:c1:eb:3b:28:0f:ad:d5:79:72:8f:f5:b5:49:db (ED25519)
80/tcp  open  http    Apache httpd 2.4.6 ((CentOS) OpenSSL/1.0.2k-fips mod_fcgid/2.3.9 PHP/5.4.16)
|_http-title: Lightweight slider evaluation page - slendr
389/tcp open  ldap    OpenLDAP 2.2.X - 2.3.X
| ssl-cert: Subject: commonName=lightweight.htb
| Subject Alternative Name: DNS:lightweight.htb, DNS:localhost, DNS:localhost.localdomain
| Not valid before: 2018-06-09T13:32:51
|_Not valid after:  2019-06-09T13:32:51
|_ssl-date: TLS randomness does not represent time

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 403.17 seconds

Looks like we have a web server along with an ldap server running. Note that there is lightweight.htb, lets add that to our host file and visit the page.

Editing Host File

Port 80

After looking through the pages, this site will probably not run gobuster with ease, we can login however based on the following page.

It appears that we can ssh with our IP, our IP will also be our password.

Reading Passwd File

It appears that we can read the passwd file and attain usernames

Found Users

  • ldapuser1

  • ldapuser2

There really isnt much information on these, other than the usernames. Since this is really about what we can do, lets run LinEnum.sh to find infrmation

Privilege Escalation

Running LinEnum.sh on the system we see that we can run tcpdump as root, which means we can capture some packets.

Capturing packets includes the following command and opening wireshark and reloading pictures

  • ldapuser2

  • 8bc8251332abe1d7f105d3e53ad39ac2

Attaing that information, we are able to login as ldapuser2

Looks like we have a backup file, lets download it and extract it.

Found User One

On status.php found user

  • ldapuser1

  • f3ca9d298a553da117442deeb6fa932d

Getting cap

Notice how oppen ssl has an empty capability. This means you have permission to do what you want. In this case read and write to files. We will target the sudoers file.

Getting Root

Last updated

Was this helpful?