20. Module boxes - Easy

We were commissioned by the company `Inlanefreight Ltd` to test three different servers in their internal network. The company uses many different services, and the IT security department felt that a penetration test was necessary to gain insight into their overall security posture.

The first server is an internal DNS server that needs to be investigated. In particular, our client wants to know what information we can get out of these services and how this information could be used against its infrastructure. Our goal is to gather as much information as possible about the server and find ways to use that information against the company. However, our client has made it clear that it is forbidden to attack the services aggressively using exploits, as these services are in production.

Additionally, our teammates have found the following credentials "ceil:qwer1234", and they pointed out that some of the company's employees were talking about SSH keys on a forum.

The administrators have stored a `flag.txt` file on this server to track our progress and measure success. Fully enumerate the target and submit the contents of this file as proof.

nmap

┌──(root㉿kali)-[~/cpts/oracle]
└─# nmap -sC -sV -p- 10.129.175.225
Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-07-17 01:18 EDT
Nmap scan report for 10.129.175.225
Host is up (0.045s latency).
Not shown: 65519 closed tcp ports (reset)
PORT      STATE    SERVICE VERSION
21/tcp    open     ftp?
| fingerprint-strings:
|   GenericLines:
|     220 ProFTPD Server (ftp.int.inlanefreight.htb) [10.129.175.225]
|     Invalid command: try being more creative
|_    Invalid command: try being more creative
22/tcp    open     ssh     OpenSSH 8.2p1 Ubuntu 4ubuntu0.2 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
|   3072 3f:4c:8f:10:f1:ae:be:cd:31:24:7c:a1:4e:ab:84:6d (RSA)
|   256 7b:30:37:67:50:b9:ad:91:c0:8f:f7:02:78:3b:7c:02 (ECDSA)
|_  256 88:9e:0e:07:fe:ca:d0:5c:60:ab:cf:10:99:cd:6c:a7 (ED25519)
53/tcp    open     domain  ISC BIND 9.16.1 (Ubuntu Linux)
| dns-nsid:
|_  bind.version: 9.16.1-Ubuntu
927/tcp   filtered unknown
2121/tcp  open     ftp
| fingerprint-strings:
|   GenericLines:
|     220 ProFTPD Server (Ceil's FTP) [10.129.175.225]
|     Invalid command: try being more creative
|_    Invalid command: try being more creative
4757/tcp  filtered unknown
7685/tcp  filtered unknown
8853/tcp  filtered unknown
10421/tcp filtered unknown
11299/tcp filtered unknown
14819/tcp filtered unknown
19293/tcp filtered unknown
39103/tcp filtered unknown
51157/tcp filtered unknown
54529/tcp filtered unknown
62369/tcp filtered unknown
2 services unrecognized despite returning data. If you know the service/version, please submit the following fingerprints at https://nmap.org/cgi-bin/submit.cgi?new-service :
==============NEXT SERVICE FINGERPRINT (SUBMIT INDIVIDUALLY)==============
SF-Port21-TCP:V=7.94SVN%I=7%D=7/17%Time=66975444%P=x86_64-pc-linux-gnu%r(G
SF:enericLines,9D,"220\x20ProFTPD\x20Server\x20\(ftp\.int\.inlanefreight\.
SF:htb\)\x20\[10\.129\.175\.225\]\r\n500\x20Invalid\x20command:\x20try\x20
SF:being\x20more\x20creative\r\n500\x20Invalid\x20command:\x20try\x20being
SF:\x20more\x20creative\r\n");
==============NEXT SERVICE FINGERPRINT (SUBMIT INDIVIDUALLY)==============
SF-Port2121-TCP:V=7.94SVN%I=7%D=7/17%Time=66975444%P=x86_64-pc-linux-gnu%r
SF:(GenericLines,8E,"220\x20ProFTPD\x20Server\x20\(Ceil's\x20FTP\)\x20\[10
SF:\.129\.175\.225\]\r\n500\x20Invalid\x20command:\x20try\x20being\x20more
SF:\x20creative\r\n500\x20Invalid\x20command:\x20try\x20being\x20more\x20c
SF:reative\r\n");
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

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

first thing we do is see a ftp server on 2121 so i just grabbed all the files:

┌──(root㉿kali)-[~/cpts/module-enum/easy]
└─# wget -m --no-passive ftp://ceil:qwer1234@10.129.175.225:2121
drwxr-xr-x 2 root root 4096 Jul 17 01:25 .ssh

and there's a .ssh dir, with a private key. going to use this and try to login to ssh

![](/img/Pasted image 20240717002808.png) easy foothold i guess

sudo -l needs a password

# File marks:
'0  1  58  ~/flag/flag.txt
|4,48,1,58,1636523468,"~/flag/flag.txt"

# Jumplist (newest first):
-'  1  58  ~/flag/flag.txt
|4,39,1,58,1636523468,"~/flag/flag.txt"

# History of marks within files (newest to oldest):

> ~/flag/flag.txt
        *       1636523468      0
        "       1       58
        ^       1       59
        .       1       58
        +       1       58
find / -name flag.txt 2>/dev/null

and we find flag in /home/flag/flag.txt

pretty easy honestly