@KingKang wrote:
在尝试时遇到的问题:
1、直接将改过的ipa拖进MD工程报错如下
尝试将.dylib拷贝到/opt/MonkeyDev/Frameworks下,并修改install_path依然报这个错2、用未修改过得ipa,只用他的dylib,依然会如上报错。我是按照庆哥的Wiki添加的
请问各位大佬:
1、可不可以这样干
2、如果可以应该怎样操作,能不能hook他dylib中的方法
Posts: 4
Participants: 2
@KingKang wrote:
在尝试时遇到的问题:
1、直接将改过的ipa拖进MD工程报错如下
尝试将.dylib拷贝到/opt/MonkeyDev/Frameworks下,并修改install_path依然报这个错2、用未修改过得ipa,只用他的dylib,依然会如上报错。我是按照庆哥的Wiki添加的
请问各位大佬:
1、可不可以这样干
2、如果可以应该怎样操作,能不能hook他dylib中的方法
Posts: 4
Participants: 2
@syx wrote:
砸壳失败
1:文件已经放到了沙盒
2:执行砸壳报错
看起来是版本问题,但是不知道具体是什么问题
手机 6p 系统版本 12.4.4
xcode 11.2.1 (11B53)
Posts: 2
Participants: 2
@syx wrote:
今天早上使用checkra1n越狱了设备,配置了一天的环境,到了lldb的时候,页面突然加载不出来,页面是WKWebView。
自己写了一个简单的demo测试了一下,UIWebView能够加载,WKWebView加载不出来
有遇到过这个问题的没
设备6P 系统12.4.4
Posts: 1
Participants: 1
@Linke wrote:
公司信息
深圳BAT公司专家岗位,坐标南山区。
职位名称
IOT技术专家高级专家
职位职责
负责刷脸、视觉收货柜、扫码、收银POS等IOT产品的开发与优化工作;
负责核心技术问题公关;
独立owner若干个项目,带领小组开展工作;职位要求
计算机相关专业,从事Android相关开发工作三年以上;
业务理解能力强,具备良好的架构设计能力,能够很好地抽象业务需求;
有激情,能抗压,有一定的产品和业务sense,能够与业务团队流畅沟通;
熟悉Android平台摄像头相关开发,对OpenGL熟练应用;
熟悉uv/usb等接口协议优先;
Android平台Framework/HAL层相关开发经验;
熟悉跨平台开发优先;
联系方式
17665360619(同微信号)
工作地点
深圳市南山区
Posts: 4
Participants: 2
@wzbbj wrote:
一. 职位
ios逆向分析工程师二.岗位职责
- 调试、测试与分析我方或第三方API,提供技术分析报告
三. 岗位要求
1、熟练掌握Xcode开发调试环境,有iOS应用开发经验
2、熟悉c/c++, 有良好的编码习惯
3、熟悉ARM汇编, 会静态、动态调试APP
4、写过越狱插件
5、对技术有热情,有耐心,善于钻研加分项:
1、在github上有相关开源项目
2、有安全编程相关经验, 熟悉安全对抗常见的技术手段
3、熟悉ios系统框架,App运行的沙箱环境,签名校验机制
4、熟悉mach-o文件结构
5、熟悉OpenGLES2.0
6、安全行业从业者优先
7、有android开发经验,熟悉android逆向分析工作地点: 北京市海淀区
公司规模:5000+人
福利:1-5工作日 加班双薪 免费自助食堂 租房补贴 健身房 等等
简历请投: 793979901@qq.com(支持实习生,可不需要工作经验,但必须有一定逆向经验)
Posts: 1
Participants: 1
@44269597 wrote:
NSXPCDecoder这种数据是不是从其他进程传递过来的数据?如何跟踪?
最近跟踪一组数据,其中包括一段加密数据,最后发现数据源是
<NSXPCConnection: 0xXXXXX> 这数据应该是跨进程传递过来的数据吧。
这种跨进程数据通过什么方法查找他的源头那。
Posts: 1
Participants: 1
@lycoder wrote:
各位朋友在执行下边命令后
dump.py cn.chesupai.b进度一直停留在如下
Dumping 车速拍 to /tmp [frida-ios-dump]: Load Flutter.framework success. [frida-ios-dump]: Load App.framework success. start dump /private/var/containers/Bundle/Application/29CA52C8-0B85-4F2A-8C44-A86829646C0D/CheSuPaiApp.app/CheSuPaiApp CheSuPaiApp.fid: 51%|██████████████████████████████████████████████████▋ | 10.9M/21.4M [00:01<00:02, 5.27MB/s]查看ssh输出
Requesting connecion to device handle == 15 (serial: 2dd2e464fdb1fe171a3a6c2908e4d71201765ddc), port 22
run_ctos_loop: fd = 6
run_stoc_loop: fd = 6
recv failed: Resource temporarily unavailable
recv failed: Operation not permitted请问大家这个是什么原因导致的呢?
Posts: 3
Participants: 2
@ChiChou wrote:
各种砸壳失败的帖子实在是太蛋疼了,有坚持用 old school 的 DYLD_ 模块注入的,有 python 环境折腾不对的……
来试试这个?
- Windows 需要专门安装 iTunes 以支持 USB 连接 iOS。Store 版本的 iTunes 似乎不稳定,最好在官网下独立安装包版的
- 下载最新的 Node.js LTS(长期支持版,也就是左边那个安装包)https://nodejs.org/
使用 Latest release 可能导致找不到匹配的二进制包
npm install -g bagbak安装砸壳命令工具。如有异常最好上代理- USB 连接越狱并装了 frida 的 iOS 设备
bagbak [App 名字或者 bundle id]搞定
录屏演示:http://t.cn/A6vUKQnt
以上适用于 macOS 和 Windows。Linux 暂未真机测试,求小白鼠
一些提醒:
- 如果不知道目标应用的 bundle id,可以输入
bagbak -l列出全部 App 的信息bagbak -H参数可以使用另一种非 USB 的方式,即 tcp 连接。不建议这么做,这样相当于开了一个没有密码的 SSH 在内网- 在 Windows 下砸壳会丢失原始安装包的许多文件属性(修改时间、可执行属性等),这是由于 NTFS 和 iOS 的文件系统不兼容导致的。如果使用 Windows 下砸壳再压缩成 ipa,可能会无法重打包安装——但是想想,重打包这件事本来就离不开 mac 的工具链。
项目地址和 Bug 反馈:https://github.com/ChiChou/bagbak
Posts: 1
Participants: 1
@nu11 wrote:
Ios12 app目录怎么一一对应的? 这个帖子里问怎么对应的。中间一串字母烦得很。
其实就是个命令行工具,用nic.pl 新建
[10.] iphone/tool
名字叫 lsapp
修改文件main.mm:#import <objc/runtime.h> #include <dlfcn.h> int main(int argc, char **argv, char **envp) { dlopen("/System/Library/PrivateFrameworks/ScreenshotServices.framework/ScreenshotServices", RTLD_LAZY); Class LSApplicationWorkspace_class = objc_getClass("LSApplicationWorkspace"); NSObject* workspace = [LSApplicationWorkspace_class performSelector:@selector(defaultWorkspace)]; NSArray*apps = [workspace performSelector:@selector(allApplications)]; // LSApplicationProxy for (id obj in apps) { //obj is LSApplicationProxy NSString * applicationIdentifier = [obj performSelector:@selector(applicationIdentifier)]; NSString * localizedName = [obj performSelector:@selector(localizedName)]; NSString * canonicalExecutablePath = [obj performSelector:@selector(canonicalExecutablePath)]; printf("%s(%s)===>%s\n",localizedName.UTF8String,applicationIdentifier.UTF8String,canonicalExecutablePath.UTF8String); } return 0; }
make clean && make && make package && make install安装到bin目录,直接
lsapp运行即可运行截图:
Posts: 2
Participants: 2
@tbag wrote:
FridaNSLogger
FridaNSLogger可以在Frida中将日志信息通过socket连接发送至Mac端查看。
Mac端日志查看工具FridaNSLoggerViewer基于 NSLogger 修改实现。特点
- 可以在Frida TypeScript代码中直接发送日志消息;
- 支持 string 和 binary 类型日志消息;
- 支持简单的断线重连;
- 完备的Mac端日志查看器FridaNSLoggerViewer(支持日志分级,过滤,保存等);
快速使用
在Mac端启动日志查看器FridaNSLoggerViewer,默认监听 127.0.0.1:50010 ,并获取该Mac系统内网IP(比如192.168.2.10)
在Frida TypeScript工程中引用:
import { Logger } from "./logger"; import { swapInt64 } from "./logger"; // 连接到局域网内的FridaNSLoggerViewer,注意修改IP。 // 如果Frida脚本 const logger = new Logger('192.168.2.10', 50010); logger.logStr('helloworld'); //发送string类型日志 const testS64 = new Int64('0x0102030405060708'); const testBuf = Memory.alloc(8).writeS64( swapInt64(testS64) ).readByteArray(8); logger.logBinary(testBuf as ArrayBuffer); //发送binary类型日志FridaNSLoggerViewer 效果如下图:
原理
Frida脚步内作为client,利用Frida的 SocketConnection 接口,将日志编码后发送;
FridaNSLoggerViewer作为socket服务端,可监听局域网内多个client发来的连接。NSLogger原有实现需要加密后的socket数据,FridaNSLoggerViewer对其修改,去掉了加密,支持 raw tcp packet.新加入的client默认第一条消息发送设备信息,包含Frida版本,系统版本等信息。后续每条日志打包为一个LogMessage发送。
NSLogger接收的单个二进制数据包格式为:
uint32_t totalSize //(total size for the whole message excluding this 4-byte count) uint16_t partCount //(number of parts below) [repeat partCount times]: uint8_t partKey //the part key uint8_t partType //(string, binary, image, int16, int32, int64) uint32_t partSize //(only for string, binary and image types, others are implicit) .. `partSize' data bytes举例:
一个LogMessage的数据包拆分如下:00000073 //totalSize,占4byte。数值为整个包的字节数减去4,即后续部分长度 000a //0xa=10 parts,2byte,有多少个parts 0104 00000000 5e13fedb //01=PART_KEY_TIMESTAMP_S, 04=PART_TYPE_INT64 0304 00000000 00011402 //03=PART_KEY_TIMESTAMP_US 0400 00000008 54687265 61642036 //PART_KEY_THREAD_ID 0003 00000003 // PART_KEY_MESSAGE_TYPE PART_TYPE_INT32 1500 00000001 31 //0x15=21,PART_KEY_CLIENT_VERSION 1400 0000000f 4e534c6f 67676572 54657374 417070 // 0x14=20,PART_KEY_CLIENT_NAME 1900 00000008 6950686f 6e652058 //0x19=25=PART_KEY_UNIQUEID 1700 00000004 31322e32 //0x17=23=PART_KEY_OS_VERSION 1600 00000003 694f53 //0x16=22=PART_KEY_OS_NAME 1800 00000006 6950686f6e65 //0x18=24=PART_KEY_CLIENT_MODEL(完)
Posts: 1
Participants: 1
@jonyIve wrote:
在monkeydev模板创建项目 hook主应用的某个方法时,最多只能9个参数的方法,当超过9个的时候,应该如何hook,比如如下方法:
- (void)addWaterMarkWithUrl:(id)arg1 composeOptions:(long long)arg2 model:(id)arg3 shouldMuteVideo:(_Bool)arg4 needSaveToAlbum:(_Bool)arg5 userName:(id)arg6 videoOutputSize:(struct CGSize)arg7 edgeData:(id)arg8 canDirectAddVideoheader:(_Bool)arg9 progress:(CDUnknownBlockType)arg10 complete:(CDUnknownBlockType)arg11 onlyForCrop:(_Bool)arg12 ;
应该用哪种方法hook呢?
Posts: 1
Participants: 1
@MOMO wrote:
系统环境: iOS 13.1.2
前几周,ssl kill switch2还在用的,突然不能用了,我今天又去github上装了最新的,设置里面还是没有开关。你们遇到这种情况了吗
Posts: 1
Participants: 1
@EdwardChan wrote:
需求: app在刚开始会检测越狱,然后跳到safari提示设备越狱. 现在已经hook了openURL函数,并成功进入断点. lldb调试信息如下:
(lldb) bt * thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1 * frame #0: 0x00000001052ee894 libfootballDylib.dylib`_logos_method$_ungrouped$UIApplication$openURL$options$completionHandler$(self=0x000000010631ea60, _cmd="openURL:options:completionHandler:", arg1="https://c-notification.klabgames.com/?BundleID=com.abiu.dev.football&DateTime=1579161505.277681&Carrier=(null)&Country=(null)&Platform=iPhone7%2C2&Version=12.4.4&Architecture=ARM64&Error=32", arg2=0x0000000280278080, arg3=0x0000000000000000) at footballDylib.xm:54:27 frame #1: 0x0000000102dbbeac captain283`___lldb_unnamed_symbol252863$$captain283 + 1104 frame #2: 0x00000001041fbe00 captain283 frame #3: 0x0000000103a8596c captain283`___lldb_unnamed_symbol302627$$captain283 + 36 frame #4: 0x000000010585f6f4 libdispatch.dylib`_dispatch_call_block_and_release + 24 frame #5: 0x0000000105860c78 libdispatch.dylib`_dispatch_client_callout + 16 frame #6: 0x000000010586e6fc libdispatch.dylib`_dispatch_main_queue_callback_4CF + 1360 frame #7: 0x0000000220f9cb20 CoreFoundation`__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12 frame #8: 0x0000000220f97a58 CoreFoundation`__CFRunLoopRun + 1924 frame #9: 0x0000000220f96fb4 CoreFoundation`CFRunLoopRunSpecific + 436 frame #10: 0x000000022319879c GraphicsServices`GSEventRunModal + 104 frame #11: 0x000000024d7f8c38 UIKitCore`UIApplicationMain + 212 frame #12: 0x0000000100c92f6c captain283`___lldb_unnamed_symbol1$$captain283 + 156 frame #13: 0x0000000220a5a8e0 libdyld.dylib`start + 4做了三个尝试皆失败
frame #1: 0x0000000102dbbeac这个函数确实是执行跳转的函数, 在ida中找到该函数地址为
sub_10212FA5C, 却提示无xrefs.frame #2: 0x00000001041fbe00这地址跳转到如下…__objd:000000010356FDFD DCB 1 __objd:000000010356FDFE DCB 0x3F ; ? __objd:000000010356FDFF DCB 0xD6 __objd:000000010356FE00 DCB 8
- 在
frame #1函数的最下面打点,lldb 输入ni 程序退出了
请问 怎么正确找到上一层函数调用位置呢?![]()
Posts: 3
Participants: 2
@intersys wrote:
Hi guys. I’m having trouble with finding a function of an object I’m really interested debugging. I loaded the application in ida but it cannot find the object or it’s methods (in string or just general search). I tried to find it with frida or cycript, but couldn’t do that, as it’s too complicated for me (I’m a beginner with IOS RE, but I do know re in general).
I though maybe finding the address of the function and then removing the ASLR offset to find it in IDA. I don’t know how to find the function’s address, however.
P.S I’m reversing the health application (built-in with the iphone)
Thanks!
Posts: 1
Participants: 1
@detecyang wrote:
需求: 使用SVC指令获取系统时间
日志:无
代码:
sub sp, sp, #32
str xzr, [sp]
str xzr, [sp, #8]
str xzr, [sp, #16]
str xzr, [sp, #24]
add x0, sp, #8
str x0, [sp]
mov x0, sp
mov x1, #0
mov x16, 116 ; SYS_gettimeofday
svc #0x80
ldr x0, [sp]
add sp, sp, #32
ret操作步骤: 编译,设备上执行,打印结果,值不对
03 5f 61 f4 a5 06 00 00 a5 b4 08 00 00 00 00 00
任何其他描述: gettimeofday(struct timeval *, struct timezone *); 正确的值应该是类似这样
29 c1 23 5e 00 00 00 00 9b 13 00 00 00 00 00 00
0x5e23c129=1579401513,可是我用SVC方式获取的值明显不对,问题出在哪?
环境: Xcode11, iOS11
Posts: 1
Participants: 1
@nu11 wrote:
0x00 懒是第一生产力
狗神的书上和帖子里都有写如何配置debugserver。配置完之后用起来还是有些麻烦,至少要开两个终端窗口,一个手机端的开启debugserver,另外一个开启lldb。在手机端的shell,需要先ssh登录,然后各种ls+grep找到要调试的app,然后敲debugserver xxx 把各种参数配置好。 https://github.com/4ch12dy/issh 对上述操作有封装和优化,但是还是需要敲命令找App,运行debugServer。所以做个tweak提升一下生产力。双击应用图标,一键启动debugserver。 代码zip包和运行截图在本文末尾。
我的开发环境是iOS13.3,但是并没有用到特殊版本的API,低版本手机应该也OK。
0x01 通过图标找到应用执行路径
从界面找逻辑,逆向发现SpringBoard的图标是SBIconView。并且有一个叫属性 applicationBundleIdentifierForShortcuts 返回的是图标对应的App的bundle id。通过bundle id构造LSApplicationProxy对象,并且拿到canonicalExecutablePath属性,也就是应用的可执行文件路径。
Class LSApplicationProxy_class = objc_getClass("LSApplicationProxy"); NSObject* proxyObj = [LSApplicationProxy_class performSelector:@selector(applicationProxyForIdentifier:) withObject:bundle]; NSString * canonicalExecutablePath = [proxyObj performSelector:@selector(canonicalExecutablePath)];0x02 寻找注入点添加扩展
接续看SBIconView,图标上有两个手势对象:
- 单击,用来启动App。
- 长按,进入编辑状态,执行删除和排列图标等操作。
所以,我们来给图标交互加个双击扩展。
%hook SBIconView
- (void)didMoveToWindow { %orig; UITapGestureRecognizer *doubleTap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(handleDoubleClick:)]; [doubleTap setNumberOfTapsRequired:2]; [self addGestureRecognizer:doubleTap]; NSArray * ges = self.gestureRecognizers; for(UITapGestureRecognizer * each in ges){ if([each isKindOfClass:[UITapGestureRecognizer class]]){ [each requireGestureRecognizerToFail: doubleTap]; } } }这里额外说一句
[each requireGestureRecognizerToFail: doubleTap]添加了双击手势指挥,由于iOS内部维护了手势的状态机,我们单击操作发生的时候,其实产生了两种Possible State。第一种是识别为单击,然后结束。第二种是识别为双击的第一下并等待第二下的发生,然后根据两次点击之时间间隔阈值来判断是不是合法的双击。所以我们手动加个约束,相当于指定了识别的优先级,只有双击失败了,才继续执行单击回调。这种操作会带来一点几乎无感的瑕疵:单击等待双击识别失败的延迟,延迟的值就是双击识别执行的阈值(大约零点几秒)。0x03 debugserver启动和关闭
debugserver是一个二进制文件,狗神的教程里有如何重签,issh把这些过程给简化了。先看一下debugserver的权限:
-rwxr-xr-x 1 root admin 9876848 Jan 19 11:28 /iOSRE/tools/debugserver*再来看一下SpringBoard的权限:
-rwxr-xr-x 1 root wheel 71264 Dec 5 13:15 SpringBoard*属主用户都是root,没毛病。找个函数调用一下:
- system函数
- posix_spawn函数
- NSTask ,面向对象方便管理,异步执行,不会block UI,就用它了。
代码
task = [[NSTask alloc]init]; [task setLaunchPath:bin_serverpath]; [task setArguments:args]; [task launch];每次server在launch之前,要把之前的task结束掉。
- (void)interrupt; // Not always possible. Sends SIGINT. - (void)terminate; // Not always possible. Sends SIGTERM.NSTask头文件里竟然告诉我 Not always possible。事实上我调用的时候,还真的不怎么possible,实际测试第一次server正常启动,后续由于没成功关闭,所以第二次就没法启动了。所以还是换种方式关闭吧。简单粗暴的 kill 函数:
NSTask * task = [TaskManager sharedManager].runningTask; if(task){ kill(task.processIdentifier,SIGKILL); task = nil; }0x04 添加UI交互
直接用Alert,又有按钮又有输入框,不过UIAlertView已经被废弃掉了,需要用UIAlertController。由于弹出Controller需要父Controller,通过View找到当前的Controller,做正向的应该都写过这段代码吧。。
@implementation UIView(find) -(UIViewController*)findViewController { UIResponder* target= self; while (target) { target = target.nextResponder; if ([target isKindOfClass:[UIViewController class]]) { break; } } return (UIViewController*)target; } @end0x05 优化一下用户体验
输入框里的ip和debugserver的path,每个人都不一样,所以在第一次输入完成之后,把这些值用NSUserDefault持久化存储起来,下次直接读取填充。0x06后记
之前看坛子里一些帖子讨论用Root身份运行App的帖子,学习完帖子里的技巧,增强对操作系统的理解以及实践之后。如果真的想RootApp运行,其实SpringBoard本身就是一个RootApp,我们吧SpringBoard当做RootViewController,很容易把一些系统工具做出界面,从而提升生产力。比如砸壳,重签,拷贝App等。
上代码
tap2debug.zip (53.5 KB)
Posts: 1
Participants: 1
@cxwewe wrote:
前面越狱都是可以的,看了下mobilesubstrate.dylib也都加载了,不知道为什么不行。
另外自带的debugserver也不能用,只有issh的debugserver能用,直接用lldb命令还不是很方便。其实最主要想用的是xcode里面memory graph的功能,或者lldb有这样同样功能的命令不。
Posts: 1
Participants: 1
@Windyzzzzz wrote:
需求: 一个方法的参数是个结构体,怎么查看这个结构体的具体参数
代码:
– (void)getMessageInfo:(const struct Message *)arg1 command:(unsigned long long)arg2;
断点断在这一步之后我需要查看arg1中到底有什么。
菜鸟另外想问下这个为什么不能跟一个object对象一样查看呢?这是个很难的问题还是一个简单的问题?
当然最终问题肯定是如何查看arg1信息
环境: MonkeyDev
Posts: 1
Participants: 1