《软件加密与解密》(Surreptitious Software_ Obfuscation) 一书中介绍了如下几种技术。
对于这些技术的讲解,我们把对软件进行保护的操作,统称为 “加壳”,对这些保护技术进行过程,统称为 “脱壳”。
All U.S. Army Project Executive Offices (PEOs) and Project Managers (PMs) are now charged with executing Army and Department of Defense (DoD) AT policies in the design and implementation of their systems. Embedded software is at the core of modern weapon systems and is one of the most critical technologies to be protected. AT provides protection of U.S. technologies against exploitation via reverse engineering. Standard compiled code with no AT is easy to reverse engineer, so the goal of employed AT techniques will be to make that effort more difficult. In attacking software, reverse engineers have a wide array of tools available to them, including debuggers, decompilers, disassemblers, as well as static and dynamic analysis techniques. AT techniques are being developed to combat the loss of the U.S. technological advantage, but further advances are necessary to provide useful, effective and varied toolsets to U.S. Army PEOs and PMs. ... The goal of software AT technologies/techniques developed is to provide a substantial layer of protection against reverse engineering, allowing for maximum delay in an adversary compromising the protected code. This capability will allow the U.S. time to advance its own technology or otherwise mitigate any losses of weapons technologies. As a result, the U.S. Army can continue to maintain a technological edge in support of its warfighters.
听一位从事游戏开发的朋友说,某家游戏公司为了杜绝外挂,给很多函数添加 VMP 保护,一天之间,游戏垮台了。(在这里讲个笑话)
On the downside, adding software protection to your program can cause problems in terms of cost, performance, a more complex software development cycle, and last but not least, annoyance to your legitimate users.
引入一个概念,叫做 “攻击/防御模型” 。
防御模型即在编写软件保护时假设攻击者的水平、攻击方式、组织能力。防御模型在密码学研究中,我们通常假设如下条件
防御模型的例子:
看雪论坛搜索: 看雪CTF从入门到存活系列
在此,推荐看雪 密码学板块 这里有着丰富、激烈的思想碰撞,对于大家学习逆向有不错的帮助。 当然,大家如果在讨论希望遵守规则。
看雪-密码学板块:https://bbs.kanxue.com/forum-132.htm
看场雪前辈:https://bbs.kanxue.com/homepage-post-697893-1.htm
攻击模型例子: 在 IDA 中个静态分析工具中提供了所识别的函数列表,其中信息包括
这四个信息就可以演变为四种攻击模型,甚至演变为组合技,产生多种攻击模型。
当然,攻击模型的产生方式多样,我们可以通过自己的经验(研究方向)去创造出属于自己的攻击模型。(像不像设计模式?哈哈。)
分为静态分析和动态分析。 在这里不过多解释了~
代码混淆这一技术是一把双刃剑
代码混淆软件:VMP、SE、TMD、SP等
代码混淆开源:OLLVM、ADVobfuscator-master、movfuscator等
混淆呢,就是把代码变成难以被对手理解的样子。(变的连他亲妈都不认识~)
混淆例子: 52pojie论坛中看到的一个例子
在这个程序中,程序的导出表遭到了混淆。使得 IDA 识别符号出了问题。似乎是添加了 65535 个无意义符号。
在上面俩个例子中,我们看到了符号混淆、控制流混淆。 还差个数据流混淆。 当然,日后如有新发现,将回来添加。
这个开源项目的功能就能当做一个水印功能,当然,解决掉它的方法也很简单:直接给这个函数添加个混淆就好了。 REpsych
代码相似性对比可以用来辅助分析,也可以用来取证~
略,没有研究过。也许日后会回来补充。