当前位置:网站首页>Reliable remote code execution (1)
Reliable remote code execution (1)
2022-06-24 10:54:00 【franket】
Leading to the global offensive of the anti terrorist elite ( hereinafter referred to as “CS:GO”) One of the most popular factors is that anyone can host their own community server . These community servers can be downloaded and installed for free , And allow high-level customization . Server administrators can create and leverage custom assets ( For example, maps ), So as to realize the innovative game mode .
However , This design choice opens up a large attack surface . Players can connect to potentially malicious servers , Exchange complex binary assets such as game messages and textures .
We managed to find and exploit two mistakes , When they come together , When connecting to our malicious server , It can reliably execute code remotely on the player's machine . The first error is information leakage , It allows us to destroy the client during the game ASLR. The second mistake is .data Out of bounds access to the global array in the game loading module section , Causes control of the instruction pointer .
Community server list
Players can use the built-in user-friendly server browser to join the community server :
Once the player joins the server , Their game clients and community servers will start talking to each other . As a security researcher , Our task is to understand CS:GO The network protocol used and the type of message sent , So that we can find the vulnerability .
The fact proved that ,CS:GO Use your own UDP To serialize 、 Compress 、 Segment and encrypt data sent between client and server . We won't go into details about the network code , Because it has nothing to do with the errors we will present .
what's more , This is based on UDP The custom protocol carries Protobuf Serialized payload .Protobuf yes Google A technology developed , It allows you to define messages and provides the... For serializing and deserializing these messages API.
Here are CS:GO Defined and used by developers protobuf Message example :
message CSVCMsg_VoiceInit {
optional int32 quality = 1;
optional string codec = 2;
optional int32 version = 3 [default = 0];
}Found in CS:GO Use Protobuf after , We found this message definition through Google search . We encountered a problem that included Protobuf Message definition list SteamDatabase GitHub The repository .
As the name of the message implies , It is used to initialize some kind of voice message transmission from a player to the server . The message body carries some parameters , For example, the codec and version used to interpret voice data .
Development CS:GO agent
With this message list and its definition , We can gain insight into the types of data sent between the client and the server . However , We still don't know in what order messages will be sent and what values are expected . for example , We know that there is a message to initialize the voice message with some codec , But we don't know CS:GO Which codecs are supported .
For this reason , We are CS:GO Developed an agent , Allow us to view communications in real time . The idea is that we can start CS:GO Game and connect to any server through proxy , Then dump any messages received by the client and send them to the server . So , We reverse engineer the network code to decrypt and unpack the messages .
We also added changes to be sent / The function of the value of any message received . Because the attacker finally controls the messages sent between the client and the server Protobuf Serialize any value in the message , So it becomes a possible attack surface . We can find the error in the code responsible for initializing the connection , Instead of reverse engineering the message by changing interesting fields .
following GIF Shows how the game sends messages and is dumped in real time by the agent , Corresponding to shooting 、 Events such as changing weapons or moving :
Equipped with this tool , Now it's up to us to flip protobuf Some bits in the message to find the error .
OOB visit CSVCMsg_SplitScreen
We found that CSVCMsg_SplitScreen A field in a message can be represented by ( malice ) The server sends it to the client , Can lead to OOB visit , This leads to controlled virtual function calls .
The definition of this message is :
message CSVCMsg_SplitScreen {
optional .ESplitScreenMessageType type = 1 [default = MSG_SPLITSCREEN_ADDUSER];
optional int32 slot = 2;
optional int32 player_index = 3;
}CSVCMsg_SplitScreen It looks interesting , Because the called field player_index Controlled by the server . However , Contrary to intuition ,player_index Fields are not used to access arrays ,slot The fields are . The fact proved that , The slot Field is used as a location in the file .data The index of the split screen player object array in the section ,engine.dll No, whatever Boundary check .
Watching the crash , We can already observe some interesting facts :
- The array is stored in
.dataInternal departmentengine.dll - After accessing the array , An indirect function call to the access object occurs
The following screenshot of the decompiled code shows how to player_splot Used as an index without any checks . If the first byte of the object is not 1, Then enter a branch :
This mistake proved to be very promising , Because some instructions entering the branch will dereference a vtable And call a function pointer . This is shown in the next screenshot :
Considering the information leakage , We are very excited about this loophole , Because it seems easy to use . Because the pointer to the object is from From the global array within engine.dll, At the time of writing this article, it is a 6MB Binary array , So we are sure that we can find pointers to the data we control . Pointing the above object to the data controlled by the attacker will result in arbitrary code execution .
however , We still have to forge one at a known location vtable, Then point the function pointer to something useful . Because of this limitation , We decided to look for another error that could lead to information leakage .
边栏推荐
- 突然想到老家的木屋
- 2008R2 precautions for configuring L2TP pre shared key VPN
- What is a compressed file? What are the advantages of different methods of compressing files?
- What is the bin file for? How to open the file correctly
- Does the depth system work?
- 26.删除有序数组的重复项
- Window function row in SQL Server_ number()rank()dense_ rank()
- [activities this Saturday] NET Day in China
- 【IEEE出版】2022年自然语言处理与信息检索国际会议(ECNLPIR 2022)
- Cookie 、Session、localstorage、Sessionstorage的区别
猜你喜欢

机械臂速成小指南(三):机械臂的机械结构

Rising bubble canvas breaking animation JS special effect

88. merge ordered arrays

2022 the most complete and detailed JMeter interface test tutorial and detailed interface test process in the whole network - JMeter test plan component (thread < user >)

Use the process monitor tool to monitor process operations on registries and files

A group of skeletons flying canvas animation JS special effect

機械臂速成小指南(二):機械臂的應用

MYSQL_ Elaborate on database data types

Apple's legendary design team disbanded after jobs refused to obey cook

程序员大部分时间不是写代码,而是。。。
随机推荐
Fais ce que tu veux.
[data analysis data source] coordinates of provinces, cities and administrative regions across the country (including boundary coordinate points and central coordinate points)
[resource sharing] 2022 International Conference on Environmental Engineering and Biotechnology (coeeb 2022)
Lightweight deployment of firefoxsend temporary file sharing service using Tencent cloud
[resource sharing] the 5th International Conference on civil, architectural and environmental engineering in 2022 (iccaee 2022)
Thread operation principle
2022 International Symposium on intelligent robots and systems (isoirs 2022)
How to use arbitrarygen code generator what are the characteristics of this generator
Smart energy: scenario application of intelligent security monitoring technology easycvr in the petroleum energy industry
Tencent's open source project "Yinglong" has become a top-level project of Apache: the former long-term service wechat payment can hold a million billion level of data stream processing
SF Technology Smart logistics Campus Technology Challenge (June 19, 2022) [AK]
突然想到老家的木屋
js中对象合并的4种方式,对象合并的4种方法
System design: key features of distributed systems
International Symposium on energy and environmental engineering in 2022 (coeee 2022)
Hill sorting graphic explanation + code implementation
Which map navigation is easy to use and accurate?
[net action!] Cos data escort helps SMEs avoid content security risks!
I pushed my younger brother into Tencent. Look at his benchmark resume!
常用的第三方ui框架