目录
下载地址:https://www.vulnhub.com/entry/lampiao-1,249/

信息搜集
获取IP地址

扫描开放的端口

80端口
80端口没有任何发现

1898端口
发现启动了Drupal 7


列举目录
发现有熟悉的rebots.txt


在CHANGELOG.txt文件里面发现了Drupal 的版本是7.54
getshell
通过Kali中的Searchsploit工具可以确定Drupal 7.54这个版本有Drupalgeddon3和Drupalgeddon2漏洞
但是Drupalgeddon3需要身份验证,到目前为止,还没有获取任何用户名密码,所以Drupalgeddon2看起来很有希望

通过百度知道了Drupalgeddon2的利用方法
参考链接:https://www.oreilly.com/library/view/hands-on-web-penetration/9781789953527/7a4d442c-493b-4cae-9962-28eae680bf47.xhtml


使用python打开交互式shell
python3 -c 'import pty;pty.spawn("/bin/bash")'

提权
查看用户

查看系统版本和内核版本
发现这是一台Ubuntu 14.04

脏牛内核提权
https://www.exploit-db.com/exploits/40847
将exp下载到靶机

编译并执行

成功获取root用户的密码
切换到root用户,成功得到flag

其他提权脚本
https://github.com/mzet-/linux-exploit-suggester
https://gist.github.com/rverton/e9d4ff65d703a9084e85fa9df083c679










