┌──(root㉿kali)-[~/miaosec] └─# nmap -sn 192.168.2.0/24 Starting Nmap 7.98 ( https://nmap.org ) at 2026-03-26 09:53 +0800 Nmap scan report for 192.168.2.1 Host is up (0.00079s latency). MAC Address: 0A:00:27:00:00:06 (Unknown) Nmap scan report for 192.168.2.2 Host is up (0.00052s latency). MAC Address: 08:00:27:AE:E2:AB (Oracle VirtualBox virtual NIC) Nmap scan report for 192.168.2.8 Host is up (0.0011s latency). MAC Address: 08:00:27:85:A9:33 (Oracle VirtualBox virtual NIC) Nmap scan report for 192.168.2.4 Host is up. Nmap done: 256 IP addresses (4 hosts up) scanned in 7.64 seconds 靶机IP:`192.168.2.8`
2、端口扫描
1.全端口扫描
1 2 3 4 5 6 7 8 9 10 11 12 13
┌──(root㉿kali)-[~/miaosec] └─# nmap --min-rate 10000 -p- 192.168.2.8 Starting Nmap 7.98 ( https://nmap.org ) at 2026-03-26 09:54 +0800 Nmap scan report for 192.168.2.8 Host is up (0.00045s latency). Not shown: 65532 closed tcp ports (reset) PORT STATE SERVICE 22/tcp filtered ssh 80/tcp open http 65535/tcp open unknown MAC Address: 08:00:27:85:A9:33 (Oracle VirtualBox virtual NIC)
Nmap done: 1 IP address (1 host up) scanned in 14.16 seconds
┌──(root㉿kali)-[~/miaosec] └─# nmap --min-rate 10000 -sT -sC -sV -O -p22,80,65535 192.168.2.8 Starting Nmap 7.98 ( https://nmap.org ) at 2026-03-26 09:54 +0800 Nmap scan report for 192.168.2.8 Host is up (0.00074s latency).
PORT STATE SERVICE VERSION 22/tcp filtered ssh 80/tcp open http Apache httpd 2.4.38 ((Debian)) |_http-server-header: Apache/2.4.38 (Debian) |_http-title: Apache2 Debian Default Page: It works 65535/tcp open ftp pyftpdlib 1.5.4 | ftp-syst: | STAT: | FTP server status: | Connected to: 192.168.2.8:65535 | Waiting for username. | TYPE: ASCII; STRUcture: File; MODE: Stream | Data connection closed. |_End of status. MAC Address: 08:00:27:85:A9:33 (Oracle VirtualBox virtual NIC) Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port Device type: general purpose|router Running: Linux 4.X|5.X, MikroTik RouterOS 7.X OS CPE: cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:5 cpe:/o:mikrotik:routeros:7 cpe:/o:linux:linux_kernel:5.6.3 OS details: Linux 4.15 - 5.19, OpenWrt 21.02 (Linux 5.4), MikroTik RouterOS 7.2 - 7.5 (Linux 5.6.3) Network Distance: 1 hop
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 14.80 seconds
3.udp扫描
1 2 3 4 5 6 7 8 9 10
┌──(root㉿kali)-[~/miaosec] └─# nmap -sU --top-ports 100 192.168.2.8 Starting Nmap 7.98 ( https://nmap.org ) at 2026-03-26 09:55 +0800 Nmap scan report for 192.168.2.8 Host is up (0.0011s latency). All 100 scanned ports on 192.168.2.8 are in ignored states. Not shown: 53 closed udp ports (port-unreach), 47 open|filtered udp ports (no-response) MAC Address: 08:00:27:85:A9:33 (Oracle VirtualBox virtual NIC)
Nmap done: 1 IP address (1 host up) scanned in 53.72 seconds
┌──(root㉿kali)-[~/miaosec] └─# nmap -6 -p- fe80:0000:0000:0000:0a00:27ff:fe85:a933%eth1 Starting Nmap 7.98 ( https://nmap.org ) at 2026-03-26 14:55 +0800 Nmap scan report for fe80::a00:27ff:fe85:a933 Host is up (0.00040s latency). Not shown: 65533 closed tcp ports (reset) PORT STATE SERVICE 22/tcp open ssh 80/tcp open http MAC Address: 08:00:27:85:A9:33 (Oracle VirtualBox virtual NIC)
Nmap done: 1 IP address (1 host up) scanned in 9.71 secondss
发现开放着22和80端口
四、Ftp-pyftpdlib
端口65535开放的服务是pyftpdlibpyftpdlib 1.5.4 是一个用 Python 编写的 FTP 服务器库,它允许你快速搭建一个功能完整的 FTP(File Transfer Protocol)服务,和ftp服务一样
┌──(root㉿kali)-[~/miaosec] └─# ssh -i id_rsa -6 cromiphi@'fe80:0000:0000:0000:0a00:27ff:fe85:a933%eth1' ** WARNING: connection is not using a post-quantum key exchange algorithm. ** This session may be vulnerable to "store now, decrypt later" attacks. ** The server may need to be upgraded. See https://openssh.com/pq.html Enter passphrase for key 'id_rsa': Linux hat 4.19.0-17-amd64 #1 SMP Debian 4.19.194-3 (2021-07-18) x86_64 -bash: warning: setlocale: LC_ALL: cannot change locale (zh_CN.UTF-8) cromiphi@hat:~$ id uid=1000(cromiphi) gid=1000(cromiphi) groups=1000(cromiphi)
七、权限提升
查看sudo -l
1 2 3 4 5 6
cromiphi@hat:~$ sudo -l Matching Defaults entries for cromiphi on hat: env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin
User cromiphi may run the following commands on hat: (root) NOPASSWD: /usr/bin/nmap