版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、安卓应用保护技术分析技术创新,变革未来AGENDA Why app packing services are becoming popular The main app packing/unpacking techniquesNew trends3APP REPACKAGING4 Given10,305 popular apps, 954,986 repackaged apps are found*27.505582.5110SOFTWAREGAME*Datasource LinkTHE CONSEQUENCES OF APP REPACKAGING Developers Users5How
2、easily to repackage an app?Video DemoAPP PACKING SERVICE PROVIDERS7FREE SERVICEDOUBLE-EDGED SWORD Packing services create problem for both good and bad guys Bad guys: malware authors, (重)打包党 hard to repackage popular apps Good guys: app markets maintainers, security researchers(?)8IN REALITY App pac
3、king services are abused by bad guys9*Datasource LinkMAIN TYPES OF APP PACKING TECHNIQUES Static: cheat static analysis tools Dynamic Memory dex loading: directly load encrypted dex file into memory and execute Anti-analysis: raise the bar for dynamic analysis10MAIN TYPES OF APP UNPACKING TECHNIQUES
4、 Static: reverse engineer the encryption algorithm Pros: one method to kill all samples protected by one packer Cons: hard usually the encryption algorithm is in the native code, and continuously changing11MAIN TYPES OF APP UNPACKING TECHNIQUES Dynamic: memory dump Basic idea: the unencrypted byteco
5、de will be eventually in memory Lack of self-modifying (and JITed bytecode) support12ENCRYPTED CODEDVMDECRYPTED CODEPACKERMETA DATAApp Packing Techniques: StaticMANIFEST CHEATING Manifest file: define package name, permissions, components When parsed, attributes are translated into ids If we insert
6、an id to represent an undefined Java class aapt: ignore this apktool: honor this- app repackaged by apktool will crash due to unimplemented Java classes14FAKE ENCRYPTION Apk file isindeed a normal zip file Set the encryption flag to true Old Android system does NOT check this flag, but static analys
7、t tool does15BYTECODE-OBFUSCATION Depends on the disassembly algorithm Linear Recursive16Image source: DexLabs(LONG)FILE-NAME TRICKS Limited length of a file name17OVERVIEW Pros: easy to implement, better compatibility, low performance overhead Cons: easy to be bypassed, Small tricks, not a systemat
8、ic way to protect app18App Packing Techniques: DynamicBACKGROUND Dex Header20BACKGROUND class_def21BACKGROUND Original dex file is embedded in the OAT file22THE BASIC IDEA OF APP PACKING23ORIGINAL DEX CODEPACKER SOENCRYPTED DEX CODEloadInjected ApplicationDVMDECRYPTED DEX CODEdecryptMETA DATAload de
9、x from memoryAPP PACKING: DALVIK24BASICLASSLOADERPATHLISTDEXELEMENTSDEXFILEDEXFILEMEMORY LOADED DEXFILE STRUCTUREAPP PACKING: ART OAT file can still be executed in the interpreter mode cost: performance loss The embedded dex file Dex2oat is responsible for translating dex file into oat file when the
10、 app is being installed25APP PACKING: ART (CONTINUED) Propose I: run the app in the interpreter mode HowCreate an empty dex file (with all classes but empty methods real methods are encrypted)and the corresponding oat file will be createdDecrypt the real methods and make up the empty method structur
11、e in memory26APP PACKING: ART (CONTINUED) Propose II: Encrypt the generated oat file How?27APP PACKER: PROTECT THE PACKER ITSELF Packer is usually in the format of so library o-LLVM upx init functions Based on custom so loader VMP engine to protect key functions28App UNPacking Techniques: StaticAPP
12、UNPACKING: STATIC Understand the encryption/decryption logic of the packer Pros: one effort to kill all (apps with one packer) Cons: so packer (VMP engine), encryption method/key is continuously changing But it is efficient if we have an insider30App UNPacking Techniques: DynamicTHE KEY VULNERABLE P
13、OINT OF APP PACKING Dalvik VM executes unencrypted dex code requires the integrity of some meta data32点穴RUNTIME MEMORY STATE33Dexfile ViewImage source: AppSpear paperDalvik ViewAPP UNPACKING 101 Basic idea: locate the dex file in memory and dump How: locate “dex. 035” When: hook key functions (mmap,
14、 strcmp and etc) Countermeasure: corrupt the header, inline key functions34APP UNPACKING 102 Basic idea: dump the memory and reconstruct the dex file without relying on the dex header DexHunter, and AppSpear How: modify libdvm, dump memory, reconstruct dex35APP UNPACKING 102: DEXHUNTER36Image source
15、: DexHunter HitCon2015 slidesAPP UNPACKING 102: APPSPEAR37Image source: AppSpear paperCountermeasuresINCREMENTAL UNPACKING When to refill these instructions?39ANTI-DISASSEMBLY Change the value of debug_info_off40ANTI-PTRACE/DEBUG Check files: /proc/$pid/status, etc Check process name SIGTRAP Multi-p
16、rocess Inotify Hook read/write APIs41New TrendsDEX2NATIVE The dex code could be dumped from memory (as long as Dalvik is still used) Dex code could be recovered Native code is much harder to understand4344DEX2NATIVE: 101 Hide the control flowABCABCDISPATCHER( JNI)DISPATCHER (JNI)DEAD CODE?DEX2NATIVE 102 Completely convert the bytecode to another format of bytecode: how to maintain the sema
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 药物微生物检定员安全生产基础知识能力考核试卷含答案
- 高分子防水卷材生产工变更管理知识考核试卷含答案
- 两栖类繁育工班组协作考核试卷含答案
- 化学铣切工班组建设模拟考核试卷含答案
- 扬声器装调工安全实践竞赛考核试卷含答案
- 圆珠笔制造工岗前基础实战考核试卷含答案
- 四年级数学下册第三单元第七课时《手拉手》教学设计
- 2025年辽宁省公需课学习-主要污染物总量减排监测办法
- 护理护理心理支持课件制作
- 2026年高标准农田建设中心招聘真题及参考答案
- 6.1.2 有性生殖(教学设计)生物新教材人教版八年级下册
- GB/T 46584-2025精细陶瓷界面恒定振幅下室温拉伸和剪切疲劳性能试验方法十字交叉法
- 程序员私人合同范本
- 截肢护理小讲课
- 2025年考研法硕(非法学)真题含答案解析
- 脑疝护理应急预案
- 学习与解读国家十五五规划
- 2025年内蒙化工单招考试题及答案
- 2025年重庆市公务员考试公安岗位专项卷
- 2025年学位英语山东题库及答案
- 《教育系统重大事故隐患判定指南》深度解读课件
评论
0/150
提交评论