Extra Credit
Mr Rebot CTF
Task1 Connect to our network
nmap扫描确认端口开启状况,靶机只开启了80/443web端口和22端口,中间件为Apache
Task2 Hack the machine
1.What is key 1?
目录扫描发现CMS wordpress,在rebots.txt文件发现两个文件,发现key-1of-3.txt文件为第一个key 073403c8a58a1f80d943455fb30724b9,fsocity.dic疑似字典文件
2.What is key 2?
在http://ip/license最下方发现ZWxsaW90OkVSMjgtMDY1Mgo=,base64解码为elliot:ER28-0652,在wordpress登录页面输入账密登录成功,fsocity.dic字典文件中也有wordpress账密。
在wordpress后台页面Appearance-Editor页面允许用户编辑主题404.php文件,修改php文件为反弹shell,使用Godzilla连接php文件路径 http://10.10.162.244/wp-content/themes/twentyfifteen/404.php
在用户/home/robot家目录下发现key-2-of-3.txt ,无法访问,但可以访问password.raw-md5文件robot:c3fcd3d76192e4007dfb496cca67e13b
在CrackStation网站解密得到robot密码为 abcdefghijklmnopqrstuvwxyz
得到robot用户账密尝试使用ssh登录,无法登录;在wordpress后台修改另一php文件为反弹shell的php文件,本地监听4444端口,浏览器访问反弹shellphp文件地址,得到反弹shell;切换robot用户提示必须在终端运行,执行python代码获取完整shell;成功切换用户。
python -c "import pty;pty.spawn('/bin/bash')"
在robot用户家目录下找到key-2-of-3.txt,得到key2为822c73956184f694993bede3eb39f959。
3.What is key 3?
sudo -l报错robot用户不能运行sudo命令;
使用语句查询靶机上所有有S权限的可执行文件
find / -type f -a \( -perm -u+s -o -perm -g+s \) -exec ls -l {} \; 2> /dev/null
发现nmap具有S标志位,可以以root权限执行,查询nmap版本,确定nmap版本为3.8.1。
nmap交互式模式可在版本 2.02 到 5.21 上使用,可用于执行shell命令。
/usr/local/bin/nmap --interactive
nmap> !sh
在root用户家目录下,发现key-3-of-3.txt,得到key3为04787ddef27c3dee1ee161b21670b4e4。
Retro
Task1 Pwn
nmap扫描发现靶机为windows server 2012或2016,开启了80与3389端口
1.A web server is running on the target. What is the hidden directory which the website lives on?
使用gobuster进行目录扫描,字典使用/wordlists/gobuster/directory-list-2.4-medium.txt,确定隐藏目录为retro
2.user.txt
Wappalyzer确定使用CMS为wordpress 5.2.1,数据库为mysql,在http://ip/retro/wp-login.php找到wordpress后台管理页面。主页面文章显示作者是wade,管理页面尝试用户名枚举,确定用户名为wade。在Ready Player One帖子下找到评论包含关键信息parzival
使用wade:parzival远程连接登录windows成功。在wade用户桌面找到user.txt,为3b99fbdc6d430bfb51c72c651a261927。
3.root.txt
查看浏览器历史记录,发现用户在搜索漏洞CVE-2019-1388且保存了一个关于CVE-2019-1388的标签。
搜索CVE-2019-1388 ,这是一个可以提权的漏洞且影响机器包括靶机系统,回收站中还有hhupd.exe正是利用该漏洞所需要的工具,将其还原进行提权。
Microsoft Windows Certificate Dialog权限提升漏洞 (CVE-2019-1388)
发布日期:2019-11-12
受影响系统:
Microsoft Windows Server 2019;Microsoft Windows Server 2016;Microsoft Windows Server 2012;Microsoft Windows Server 2008 R2;Microsoft Windows Server 2008;Microsoft Windows RT 8.1;Microsoft Windows 8.1;Microsoft Windows 7
按照Github上的提权步骤,在点击证书链接时遇到困难,无法自动跳转浏览器,即使设置默认浏览器依然无法跳转;按照教程提示提前打开浏览器依然无法自动跳转。
转向使用另一漏洞进行提权操作;
Windows COM组件提权漏洞)-CVE-2017-0213
影响版本:Windows10,包括1511、1607、1703这三个版本 Windows 7 SP1 Windows 8.1、RT8.1 Windows Server 2008 SP2、2008R2 SP1 Windows Server 2012、2012R2 Windows Server 2016
https://github.com/WindowsExploits/Exploits/tree/master/CVE-2017-0213
在Github上下载CVE-2017-0213_x64.exe后,上传至靶机运行,提权完成后会弹出拥有管理员权限的cmd窗口。
在C:\Users\Administrator\Desktop目录下找到root.txt,得到7958b569565d7bd88d10c6f22d1c4063。