┌──(root㉿kali)-[/miaosec] └─# nmap -sn 192.168.2.0/24 Starting Nmap 7.94SVN ( https://nmap.org ) at 2026-01-15 14:47 CST Nmap scan report for 192.168.2.1 Host is up (0.00087s latency). MAC Address: 0A:00:27:00:00:07 (Unknown) Nmap scan report for 192.168.2.2 Host is up (0.00059s latency). MAC Address: 08:00:27:89:E2:25 (Oracle VirtualBox virtual NIC) Nmap scan report for 192.168.2.46 Host is up (0.00092s latency). MAC Address: 08:00:27:1C:63:73 (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 2.17 seconds
靶机IP:192.168.2.46
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.46 Starting Nmap 7.94SVN ( https://nmap.org ) at 2026-01-15 14:47 CST Nmap scan report for 192.168.2.46 Host is up (0.00050s latency). Not shown: 65533 closed tcp ports (reset) PORT STATE SERVICE 22/tcp open ssh 80/tcp open http MAC Address: 08:00:27:1C:63:73 (Oracle VirtualBox virtual NIC)
Nmap done: 1 IP address (1 host up) scanned in 40.96 seconds
┌──(root㉿kali)-[/miaosec] └─# nmap --min-rate 10000 -sT -sV -sC -O -p22,80 192.168.2.46 Starting Nmap 7.94SVN ( https://nmap.org ) at 2026-01-15 14:48 CST Nmap scan report for 192.168.2.46 Host is up (0.00076s latency).
PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 8.4p1 Debian 5+deb11u1 (protocol 2.0) | ssh-hostkey: | 3072 f0:e6:24:fb:9e:b0:7a:1a:bd:f7:b1:85:23:7f:b1:6f (RSA) | 256 99:c8:74:31:45:10:58:b0:ce:cc:63:b4:7a:82:57:3d (ECDSA) |_ 256 60:da:3e:31:38:fa:b5:49:ab:48:c3:43:2c:9f:d1:32 (ED25519) 80/tcp open http Apache httpd 2.4.56 ((Debian)) |_http-server-header: Apache/2.4.56 (Debian) |_http-title: Site doesn't have a title (text/html). MAC Address: 08:00:27:1C:63:73 (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 Running: Linux 4.X|5.X OS CPE: cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:5 OS details: Linux 4.15 - 5.8 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.81 seconds
3.udp扫描
1 2 3 4 5 6 7 8 9 10 11 12
┌──(root㉿kali)-[/miaosec] └─# nmap -sU --top-ports 100 192.168.2.46 Starting Nmap 7.94SVN ( https://nmap.org ) at 2026-01-15 14:49 CST Nmap scan report for 192.168.2.46 Host is up (0.0010s latency). Not shown: 98 closed udp ports (port-unreach) PORT STATE SERVICE 68/udp open|filtered dhcpc 69/udp open|filtered tftp MAC Address: 08:00:27:1C:63:73 (Oracle VirtualBox virtual NIC)
Nmap done: 1 IP address (1 host up) scanned in 115.40 seconds
┌──(root㉿kali)-[/tmp/miao/backup] └─# ssh boris@192.168.2.46 -i id_rsa Are you sure you want to continue connecting (yes/no/[fingerprint])? yes Warning: Permanently added '192.168.2.46' (ED25519) to the list of known hosts. boris@beginner:~$ id uid=1000(boris) gid=1000(boris) grupos=1000(boris)
四、权限提升
查看sudo -l
1 2 3 4 5 6
boris@beginner:~$ sudo -l Matching Defaults entries for boris on beginner: env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin
User boris may run the following commands on beginner: (root) NOPASSWD: /usr/bin/html2text