MacOS/iOS Mach-O应用程序代码混淆
2023-1-15 08:34:58 Author: 哆啦安全(查看原文) 阅读量:34 收藏

商务合作

2023年招聘

2023年逆向分析资料汇总

MachObfuscator混淆器

MachObfuscator是一个Apple MacOS平台上与编程语言无关的Mach-O二进制符号混淆器。专业术语:

(1).混淆器

一种使软件难以逆向的工具

(2).二进制混淆器

一种混淆器,它在机器代码上运行,而不是在源代码上运行

(3).符号混淆器

一种仅混淆符号名称的混淆器,不会改变程序控制流。

MachObfuscator直接转换Mach-O文件中的符号。Mach-O格式主要用于Apple平台,作为可执行文件和库的机器代码容器。MachObfuscator不需要访问应用程序源代码以对其进行模糊处理。

MachObfuscator混淆器,演示效果

MachObfuscator混淆SampleApp.app应用


通过在MachOView中打开app的主要可执行文件可以看到结果。MachOView显示模糊的Objc选择器:

混淆的Objc类名:

上面仅显示了样本部分混淆前后的效果。

使用说明

$ ./MachObfuscatorusage: ./MachObfuscator [-qvdhtD] [-m mangler_key] APP_BUNDLE
Obfuscates application APP_BUNDLE in-place.
Options: -h, --help help screen (this screen) -q, --quiet quiet mode, no output to stdout -v, --verbose verbose mode, output verbose info to stdout -d, --debug debug mode, output more verbose info to stdout --dry-run analyze only, do not save obfuscated files
--erase-methtype erase methType section (objc/runtime.h methods may work incorrectly) -D, --machoview-doom MachOViewDoom, MachOView crashes after trying to open your binary (doesn't work with caesarMangler) --swift-reflection obfuscate Swift reflection sections (typeref and reflstr). May cause problems for Swift >= 4.2
--objc-blacklist-selector NAME[,NAME...] do not obfuscate given selectors --objc-blacklist-selector-regex REGEXP do not obfuscate selectors matching given regular expression
--preserve-symtab do not erase SYMTAB strings --erase-section SEGMENT,SECTION erase given section, for example: __TEXT,__swift5_reflstr
--erase-source-file-names PREFIX erase source file paths from binary. Erases paths starting with given prefix by replacing them by constant string --replace-cstring STRING replace arbitrary __cstring with given replacement (use with caution). Matches entire string, --replace-cstring-with STRING adds padding 0's if needed. These options must be used as a pair.
--skip-all-frameworks do not obfuscate frameworks --skip-framework framework do not obfuscate given framework --obfuscate-framework framework obfuscate given framework (whitelist for --skip-all-frameworks)
-m mangler_key, --mangler mangler_key select mangler to generate obfuscated symbols
Development options: --xx-no-analyze-dependencies do not analyze dependencies
Available manglers by mangler_key: caesar - ROT13 all objc symbols and dyld info realWords - replace objc symbols with random words (dyld info obfuscation supported)

MachObfuscator混淆

(1).查找应用包中的所有可执行文件,

(2).以递归方式搜索所有依赖库,这些库的依赖关系等等,

(3).搜索应用包中的所有NIB文件,

(4).区分可模糊文件(应用程序包中的文件)和不可模糊文件(应用程序包外部的文件)

(5).从整个依赖图中收集Obj-C符号,导出尝试和导入列表,

(6).创建符号白名单和符号黑名单(在不可混淆的文件中使用的符号),

(7).使用选定的漫游器修改白名单符号,导出尝试和导入列表,

(8).替换可混淆文件中的符号,

(9).清除可选的部分,

(10).一次保存所有文件。

https://github.com/nigel193/ios-developer-toolshttps://github.com/kam800/MachObfuscatorhttps://github.com/zayki/MachObfuscator

点击关注"哆啦安全"视频号

推荐阅读

Android混淆规则

JS逆向常见混淆总结

App代码混淆(自定义字典)

最全Android及资源混淆方法汇总

利用de4dot解密被混淆的.NET代码

AntiOllvm去混淆视频(即将发布正式版产品)

AntiOllvm去除二进制代码Ollvm混淆并回编译

Android App Bundle混淆加密加壳加固保护的解决方案

商务合作

点击原文底部左下角的"阅读原文"


文章来源: http://mp.weixin.qq.com/s?__biz=Mzg2NzUzNzk1Mw==&mid=2247494930&idx=1&sn=fe204fc86ead9846d2802f94186af2d8&chksm=ceb8a85cf9cf214a94ef8dc1509c2a645ad2cde0ea4a3d7e2736157af1d2ef6c950f766e5569#rd
如有侵权请联系:admin#unsafe.sh