How does Tencent Mobile Games expose the risk of game plug-ins early?

At present, Tencent SR mobile game security test is open for free expert appointments for a limited time! Click the link: http://wetest.qq.com/product/sr Make an appointment now!

Author: sheldon, senior security engineer 
at Tencent, please contact Tencent WeTest for authorization for commercial reprints, and please indicate the source for non-commercial reprints.

Introduction to WeTest

With a large number of illegal profit-making teams such as plug-ins, assistants, and studios taking advantage of the rapid development of the mobile game industry, it has caused a lot of damage to game developers and players. ignored premise. This article tells you how to expose these security issues and cheating risks in advance from a technical point of view.

Safety is no trivial matter - the idea of ​​safety testing

With the full popularity of smartphones and the pan-entertainment of the market, the mobile game industry has developed rapidly. No matter in terms of market revenue or user scale, mobile games have occupied half of the game market. Such a hot market has attracted a large number of illegal profit-making teams such as plug-ins, assistants, and studios, which has seriously affected the revenue and balance of the game, and shortened the life cycle of the game. Let's take a look at the harm of plug-in mobile games. 
image description

Security is no trivial matter. How to expose these security issues and plug-in risks in advance from a technical point of view? Tencent SR (SecurityRadar, a special technical solution for Tencent mobile game security testing) mobile game security testing team has been exploring and accumulating technology in the field of mobile game security since the beginning of 2011. risk, and help improve the brand and reputation of Tencent Games.

Security testing, peering with project release

In order to help the project find and fix security issues before release, the SR mobile game security special test is involved in the stage of game version transfer to functional test. 
image description

After several rounds of efficiency optimization of the SR mobile game security test, the time for one round of security test has been reduced to 3 days, and the "SR Mobile Game Security Test Report" can be output. After the project fixes the vulnerability, the SR special team will still carry out the regression check of the security vulnerability and ensure that the project is released according to the version plan.

Early disclosure of security vulnerabilities can help projects carry out security confrontation and strategy reinforcement during the development phase, and avoid the passive situation of confrontation with plug-ins during project operation. At the same time, it also fundamentally reduces the loss of players and operation losses caused by plug-ins.

image description

专家测试 
根据手游安全测试的需求,主要涉及到手游项目中的测试范围及测试内容的规定。提供专家手游安全测试服务,会有腾讯内部的手游安全测试专家进行测试、问题沟通跟进、处理优化检查等等。 
1. 测试设计,根据相应游戏的内容进行测试设计,找出游戏中的获利点,结合SR安全检查项,可以对游戏的内容进行完整覆盖 
2. 专家互评,对风险检查点进行查漏补缺,保证完整覆盖 
3. 测试执行,依据风险检查点,使用SR工具执行测试检查,主要进行函数修改、协议修改、内存修改、变速、脚本修改、静态漏洞扫描 
4. 提交漏洞,测试专家按照SR漏洞模板提交漏洞,依据《漏洞评级标准》进行漏洞定级和内容的审核 
5. 安全报告,由安全专家根据发现的问题和游戏整体对安全性进行评估并输出安全测试报告 
6. 漏洞回归,漏洞修复后,从新提交修复版本进行回归,SR评估漏洞修复情况并反馈结论

自动化测试 
1. 宕机漏洞扫描服务,通过智能分析协议来填充模糊测试case,发送到服务器,测试服务器的可靠性、健壮性 
2. 协议/函数风险扫描,通过AI算法学习安全风险模型,读取游戏函数、协议数据后进行智能分析,具备2小时输出安全测试报告的能力

SR安全测试技术方案

根据以上的规划思路,SR团队聚焦在漏洞挖掘的能力和效率提升上进行手游安全测试技术创新。整个技术方案最大的难点在于,手游与传统的APP差异很大,不同游戏的玩法、技术实现都不一样,我们如何研发一套普适的方案,来满足不同游戏的安全测试需求。经过几年的研发与优化,SR团队终于做到了,兼容了数百款腾讯自研、代理游戏,打造了业界领先的手游安全测试技术方案。

SR独创的安全测试技术

-——业界独创的动态修改手游客户端程序的安全测试技术、基于对象的手游内存安全测试技术 
-——多种领先的自动化风险扫描技术 
—— 拥有多项国家级技术专利

image description


SR手游安全测试团队将审核的内容分为静态安全漏洞和动态安全漏洞。不同类型的问题测试思路和分析手段会有不同,对测试工具和测试方法也会有差别。

image description


静态漏洞扫描 
主要通过静态扫描的方式,对游戏apk中配置档、资源文件、脚本文件、manifest.xml、so文件,通过自动扫描的方式来进行检查项的确认。(目前此块内容已集成到SR手游安全测试方案中,覆盖了120+条安全检查项和信息安全测试项)

动态风险分析 
动态安全测试涉及的内容广泛,主要是根据游戏特定的内容和玩法,针对性地分析安全风险点,通过协议、函数、内存、脚本等技术,多维度检查游戏服务器对相应的风险点是否有完善的校验或反外挂策略。

image description

根据对漏洞类型的提炼,SR手游安全测试团队总结了根据游戏中的获利点而生成的风险点,然后在不同的游戏中,结合具体玩法,又推导出相应的获益方式。通常根据风险点分析的方式,可以完整覆盖到游戏中涉及到安全的部分,结合检查点,就生成了可以在实际操作中执行的用例,形成闭环。

image description

手游安全测试对于技术的要求也是非常高的,需要专业的技术人员进行逆向分析和工具支持,否则上述的测试点很有可能是纸上谈兵,但毫不夸大地说SR手游安全测试已经拥有了这些技术积累。根据对测试检查点的分析,我们需要的安全测试工具包括:函数修改、内存修改、变速修改、协议修改、脚本修改。

SR手游安全测试深度解密

在SR工具最新的版本上已经集成了所有安全测试的辅助功能。下面从技术实现和工具效果上来展示各大功能的情况。

1、双端协议修改 
image description


SR工具通过直接注入游戏的组包函数,自动解析协议结构,免去了需要依赖测试人员分析二进制数据进行协议破解。在没有协议结构文件时也能自动解析协议结构。手机和web端都可以进行协议数据展示,在手机上可以实施地显示协议发包的效果,在web上可以动态一键修改相应字段,互补不足。

SR protocol double-end tool web effect display


从目前支持和接入的游戏来看,SR工具已经对目前腾讯在研和运营的游戏达到了100%的支持,从协议类型上支持和引擎类型来看,也基本覆盖了当前所有的游戏类型: 
Mobile game types/protocols supported by the SR protocol tool

2、函数动态修改

The principle of dynamic modification of functions


对于单局类玩法的手游,函数动态修改具备最强的漏洞能力。但是早期的测试方法效率非常低下,需要每个函数单独编写hook函数、定义函数指针变量、申请独立hook资源、重新编译代码。同时,使用门槛很高,只有专业的安全专项测试人员才能操作。SR函数动态修改通过动态通用hook技术,不需要测试人员再进行hook函数编码。

Function dynamic web effect display


方案效果: 
—— 函数动态修改方案共覆盖安全检查风险项81项 
—— 安全审核单个版本时间由15天减少到3天 
—— 函数修改测试成本降低70%

3、内存对象修改 
image description

业界首创手游内存修改技术,为测试人员直接展示出游戏中对象列表、对象属性名称、属性值等信息,并且可以对象为单位进行搜索,以革新方式告别传统手游内存测试工具搜索“内存数值”方式定位目标内存地址的低效方案,实现该项测试成本降低70%。 
—— 内存对象 一目了然 
获取内存中所有对象、对象名、地址、属性值 
—— 对象数据 动态更新 
动态更新内存对象 
—— 动态修改 实时生效 
直接修改对象属性,游戏内即时生效

4、协议字段模糊测试: 
拒绝服务攻击即攻击者想办法让目标机器停止提供服务,是黑客常用的攻击手段之一。玩家的异常操作、黑客异常发包、批量发包等都可能导致服务器宕机,影响游戏的正常运营,玩家不能正常游戏。早期的协议测试中有设计异常发包case,检查是否会导致服务器宕机。但是这种方式测试效率很低,覆盖的异常点非常少。SR结合外网模糊测试工具和长期协议测试积累的宕机case,研发了这套系统。 
SR字段模糊测试的case覆盖的协议用例类型包括: 
image description

通过对于字段类型的分析后,自动填充相关的字段的异常类型值,来组包发送给服务器,进行服务器的模糊测试。解决了传统协议测试执行效率低、定位问题慢、覆盖分支少的问题。

测试流程如下: 
image description

模糊测试执行过程中不需要测试人员过多参与,就可以发现大量的安全问题。支持设备并发执行,智能分配测试机执行任务,执行任务的效率之高。发现问题后可以智能定位协议与字段,帮助开发人员快速定位问题。扫描覆盖检查规则31项,包括数值溢出、sql注入、格式字符串、缓冲区溢出,已经完全覆盖协议模糊测试的类型,且数据还在不断增加中。

自动化效果: 
—— 通过自动化扫描发现服务器宕机问题83例 
—— 检查所有协议字段的异常值填充,平均每款游戏执行协议异常用例120000+条,填补手工测试无法完成的空缺 
—— 单个游戏1小时内可测试用例10000条以上,效率提升巨大 
—— 扫描覆盖检查规则31项,包括空指针、数值溢出、sql注入、格式字符串、缓冲区溢出等测试项

5、函数风险扫描技术: 
Functional Risk Scanning Technology Schematic


对大量安全漏洞进行风险定义、特征定义与分类,引入模式识别技术,建立手游安全风险分析模型,自动分析出游戏高危风险函数,有效帮助测试人员省掉最为耗时的风险分析环节,实现单个手游版本漏洞测试时长从3个工作日降低到1个工作日。

SR手游安全测试支持项目情况:

image description

SR手游安全测试方案在工具上已经支持所有腾讯在研和运营的手游项目,依靠自身的技术积累来提高专业程度,持续保持漏洞的发现率。目前在SR手游安全测试团队过审的项目漏洞发现率为100%,得到了越来越多的项目认可。通过对腾讯高星级手游的安全测试发现2213个安全漏洞,且整体的数据呈上升的趋势。各大手游厂商在关注运营留存,收入的同时,这些数据同样值得思考!!

image description

通过数据统计我们发现,高危的漏洞反而在手游安全测试的过程中更容易被发现,带来的风险也是更致命的。在腾讯内部,通过SR手游安全测试的推动,这些安全问题也在项目组得到了修复,为腾讯游戏创造了一个公平竞技,安全运营的游戏生态环境。现在SR手游安全测试正式入驻腾讯WeTest,正式将安全测试能力开放对外,有需要的厂商可以联系腾讯WeTest预约服务(wetest.qq.com)。

和大家分享部分案例,案例中的所有问题都已得到了解决。

【案例1】 
PVE模式中,动态修改游戏进程中多处代码逻辑,实现“无敌+全屏秒杀外挂” 
image description

【案例2】 
韩信 [无情冲锋]技能超远距离释放,利用漏洞进行全图范围内的突进功能。 
[无情冲锋]属于子弹型技能,即释放时需要指定一个突进的方向。将技能类型强制修改为指定施法坐标的类型,指定技能落点位置坐标,就能够获得全图突进效果。 
image description

【案例3】 
篡改攻击对象list与伤害逻辑,造成全屏秒杀效果 
image description

【案例4】 
篡改使用物品协议请求中消耗数量,实现无限开箱子刷装备 
image description

安全漏洞说明:以上安全漏洞在正式环境中都已修复,或加入了反外挂机制。本文以白帽渗透测试的角度,介绍在游戏版本发布前的测试阶段,通过“黑盒测试”的方式逐步分析游戏业务逻辑中的风险点,主动挖掘潜在安全漏洞,最大程度避免最终发布版本中的游戏外挂风险。

SR手游安全测试提供的服务

[Expert Security Test] 
No vulnerability, no charge, just provide the apk package, and you can get a security assessment report within the appointed time. 
【Security Test Tool】 (coming soon) 
Open Tencent security test professional tool to reduce the security test of enterprise mobile games technical threshold


After years of exploration and technical accumulation in the field of mobile game security, Tencent's SR mobile game security testing team has created an industry-leading mobile game security testing technical solution - SR mobile game security testing solution, which has supported all Tencent's research and development tools. The operating mobile game projects rely on their own technical accumulation to improve their professionalism and continue to maintain the discovery rate of vulnerabilities. At present, expert testing and automated testing are provided, hoping to help improve the brand and reputation of Tencent Games by discovering security vulnerabilities in game versions in advance and early warning of risks.

At present, Tencent SR mobile game security test is open for free expert appointments for a limited time! Click the link: http://wetest.qq.com/product/sr Make an appointment now!

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326450501&siteId=291194637