当前位置:网站首页>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 .
边栏推荐
- Svg+js drag slider round progress bar
- Lightweight deployment of firefoxsend temporary file sharing service using Tencent cloud
- Four methods of object merging and four methods of object merging in JS
- Quick completion guide for mechanical arm (II): application of mechanical arm
- Niuke-top101-bm28
- Apple's legendary design team disbanded after jobs refused to obey cook
- Outils de capture de paquets
- [ei sharing] the 6th International Conference on ship, ocean and Maritime Engineering in 2022 (naome 2022)
- Pycharm shortcut keys
- JMeter interface test tool foundation - badboy tool
猜你喜欢

Outils de capture de paquets

What you must know about distributed systems -cap

MYSQL_ Elaborate on database data types
![[IEEE publication] International Conference on natural language processing and information retrieval in 2022 (ecnlpir 2022)](/img/d6/8c20944ce354c9619a61a73f2c72b1.png)
[IEEE publication] International Conference on natural language processing and information retrieval in 2022 (ecnlpir 2022)

喜歡就去行動

Shape change loader loads jsjs special effect code

Distributed transaction principle and solution

Hbuilder makes hero skin lottery games
![[activities this Saturday] NET Day in China](/img/33/c0e8eeb8f673232a7c27bbaf5e713f.jpg)
[activities this Saturday] NET Day in China

Quick completion guide for mechanical arm (I): development overview of mechanical arm
随机推荐
[IEEE publication] 2022 International Conference on service robots (iwosr 2022)
Distribute proofs of manuscripts by scanning
Lightweight deployment of firefoxsend temporary file sharing service using Tencent cloud
HBuilder制作英雄皮肤抽奖小游戏
Many of my friends asked me what books and online classes I recommended. This time, I contributed all the materials that I had been hiding for a long time (Part 1)
Niuke-top101-bm29
js数组求和的5种方法
Functions of document management what functions does the document management software have
A method of generating non repeated numbers in nodejs
Quick completion guide for manipulator (III): mechanical structure of manipulator
常用的第三方ui框架
Quick completion guide for mechanical arm (zero): main contents and analysis methods of the guide
When the data security law comes, how can enterprises prepare for a rainy day? Tencent security has something to say
Tencent wetest platform will bring new benefits in 2021 with 618 special offers!
What is the knowledge map? What does it do
splice()方法的使用介绍
[data analysis data source] coordinates of provinces, cities and administrative regions across the country (including boundary coordinate points and central coordinate points)
Does the depth system work?
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 >)
Dedecms template file explanation and homepage label replacement