VulnHub靶场学习:Me and My Girlfriend 1

Me and My Girlfriend 1

靶机下载地址:https://www.vulnhub.com/entry/me-and-my-girlfriend-1,409/

靶机说明:

Description: 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!

Notes: there are 2 flag files

Learning: Web Application | Simple Privilege Escalation

靶机难度:初级

运行环境:攻击机kali linux和主机  靶机Me and My Girlfriend: 1

网络设置:均为Nat模式

下载靶场后运行:

靶机环境连接方式为nat,开启kali用扫同网段,找到该虚拟机ip,同时扫描开放端口:

访问,只有一段话

查看源码,有提示

Maybe you can search how to use x-forwarded-for

 

X-Forwarded-For:简称XFF头,它代表客户端,也就是HTTP的请求端真实的IP,只有在通过了HTTP 代理或者负载均衡服务器时才会添加该项, 它是可以伪造的。

抓包在下面添加X-Forwarded-For: 127.0.0.1,告诉服务器为本地ip访问

Forward,继续添加X-Forwarded-For: 127.0.0.1

Forward后,页面会跳转

 

每访问一个页面都要自行添加X-Forwarded-For: 127.0.0.1,可以使用火狐的X-ForWarded-For插件

点击login,有登录框,尝试简单的万能密钥和弱口令,无果,均会弹出失败

 

点击注册按钮,跳到注册页面‘,点击了注册发现不用填任何东西,会直接跳转到登陆页面,再次点击登陆就会登陆进去

 

 

 

点击第一个dashboard按钮,还是同样的页面

第二个Profile按钮会跳到一个类似密码修改的页面,change无法点击

当然可以从前端修改按钮的属性,但是没有账号密码不知道修改什么。

第三个Logout按钮会返回到首页。

惊奇的发现访问修改页面的时候发现url上有user_id=12,改为1,居然存有账号密码

审查元素修改type为text,得到了密码

 

搜集了id=12之前的所有账号密码,可能有什么用

想起来有开22端口,拿这些账号密码用hydra跑一下

 

将pass文件放到root下,kali开启hydra,使用-c命令

-C 当用户名和密码存储到一个文件时使用此参数。注意,文件(字典)存储的格式必须为 "用户名:密码" 的格式。

hydra -C /root/pass.txt ssh://192.168.175.143

alice:4lic3爆破成功,xshell连接:

一通乱翻,80端口的是apache服务,访问默认根目录/var/www/html试试看

 

找到mysql的连接账号密码'root', 'ctf_pasti_bisa',现在貌似用不上

继续查看里面的其他文件,没发现啥,想起平常做题很多作者喜欢把文件放到home里面,翻一下:再home文件夹里有个alice文件夹,查看果然有隐藏的秘密

拿到第一个flag

Greattttt my brother! You saw the Alice's note! Now you save the record information to give to bob! I know if it's given to him then Bob will be hurt but this is better than Bob cheated!

Now your last job is get access to the root and read the flag ^_^

Flag 1 : gfriEND{2f5f21b2af1b8c3e227bcf35544f8f09}

文字提示了要拿到root下的flag,也就是要提权,前面获得的mysql的config文件里有root的账号和密码,先拿这个试一试。

居然成功了,找了一下再root下找到了flag2.txt

Yeaaahhhh!结束

 

posted @ 2020-03-03 10:26  hclly  阅读(709)  评论(0编辑  收藏  举报