Hack The Box(HTB)Lame -Walkthrough-

yu1ch1
4 min readAug 30, 2020

Hi! Today I’m going to write a walkthrough for Hack The Box.

The targeted machine is Lame.

lame’s infocard
Lame’s Info Card

01-nmap

Run nmap to scan the machine.

Adding the -oN option is useful because you can check it later.
What hackers should know is -sS option :)

nmap -A -Pn -sS -oN lame 10.10.10.3
Nmap scan report for 10.10.10.3
Host is up (0.22s latency).
Not shown: 996 filtered ports
PORT STATE SERVICE VERSION
21/tcp open ftp vsftpd 2.3.4
|_ftp-anon: Anonymous FTP login allowed (FTP code 230)
| ftp-syst:
| STAT:
| FTP server status:
| Connected to 10.10.14.17
| Logged in as ftp
| TYPE: ASCII
| No session bandwidth limit
| Session timeout in seconds is 300
| Control connection is plain text
| Data connections will be plain text
| vsFTPd 2.3.4 - secure, fast, stable
|_End of status
22/tcp open ssh OpenSSH 4.7p1 Debian 8ubuntu1 (protocol 2.0)
| ssh-hostkey:
| 1024 60:0f:cf:e1:c0:5f:6a:74:d6:90:24:fa:c4:d5:6c:cd (DSA)
|_ 2048 56:56:24:0f:21:1d:de:a7:2b:ae:61:b1:24:3d:e8:f3 (RSA)
139/tcp open netbios-ssn Samba smbd 3.X - 4.X (workgroup: WORKGROUP)
445/tcp open netbios-ssn Samba smbd 3.0.20-Debian (workgroup: WORKGROUP)
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Aggressive OS guesses: Arris TG862G/CT cable modem (92%), Dell Integrated Remote Access Controller (iDRAC6) (92%), Linksys WET54GS5 WAP, Tranzeo TR-CPQ-19f WAP, or Xerox WorkCentre Pro 265 printer (92%), Linux 2.4.21 - 2.4.31 (likely embedded) (92%), Linux 2.4.27 (92%), Linux 2.6.22 (92%), Linux 2.6.27 - 2.6.28 (92%), Linux 2.6.8 - 2.6.30 (92%), Dell iDRAC 6 remote access controller (Linux 2.6) (92%), Supermicro IPMI BMC (Linux 2.6.24) (92%)
No exact OS matches for host (test conditions non-ideal).
Network Distance: 2 hops
Service Info: OSs: Unix, Linux; CPE: cpe:/o:linux:linux_kernel
Host script results:
|_clock-skew: mean: 2h07m48s, deviation: 2h49m44s, median: 7m46s
| smb-os-discovery:
| OS: Unix (Samba 3.0.20-Debian)
| Computer name: lame
| NetBIOS computer name:
| Domain name: hackthebox.gr
| FQDN: lame.hackthebox.gr
|_ System time: 2020-08-26T08:08:38-04:00
| smb-security-mode:
| account_used: <blank>
| authentication_level: user
| challenge_response: supported
|_ message_signing: disabled (dangerous, but default)
|_smb2-time: Protocol negotiation failed (SMB2)

At first I focus on 21 port.
“vsftpd 2.3.4” has a famous vulnerability.

02-searchsploit

Run searchsploit to search the exploit code.

There is EXPLOIT DATABESE the same one.
https://www.exploit-db.com/exploits/17491

03-metasploit

Run msfconsole to exploit.

I look for vsftpd…found.
I copy a column of Name.

Use payload.

Set target host IP address.

Check options.

Run exploit.

I faild. :(

Exploit completed, but no session was created.

I didn’t understand the meaning of this error. So I wasted my time.
But ,The answer was written in the EXPLOIT DATABASE.

This module exploits a malicious backdoor that was added to the VSFTPD download archive. This backdoor was introdcued into the vsftpd-2.3.4.tar.gz archive between June 30th 2011 and July 1st 2011 according to the most recent information available. This backdoor was removed on July 3rd 2011.

The vulnerability was for a limited time. Probably not usable now.
I learned that I must read the explanation carefully.

04-Check nmap results again and serchsploit

At second I focus on 139 and 445 port of samba.

There are vulnerabilities.

05-Challange the exploit again

Find the location of the exploit code to Google search.

Use a module. Show options.

Remember that “RHOSTS” and “LHOST” must be set.
Otherwise you will get a bad session error again.

Check my setting “tun0” with the ifconfig command.

Set IP addresses.

Confirm options.

Run exploit

Hard to understand but successful.

I found root.

Thank you for reading. bye:)

--

--

yu1ch1

I’m a Japanese high school student.I’m interested in hacking. I will be a super hacker like “Spooky”, who I respect the most. I have to study hacking for that.