reFlutter
reFlutter是一款功能强大的逆向工程分析工具,该工具主要针对的是Flutter应用程序。该框架使用了已编译且重新封装的Flutter库来帮助广大研究人员对Flutter应用程序进行逆向工程分析。
除此之外,reFlutter框架的代码还修改了快照反序列化进程,以方便研究人员对目标应用程序执行动态分析。
主要特征
- socket.cc可执行流量拦截和监控;
- dart.cc支持输出类、函数和某些字段;
- 方便进行自定义修改或重编译;
- 支持使用专门的Dockerfile对项目代码进行手动修改;
支持的引擎
- Android:ARM64、ARM32;
- iOS:ARM64;
- 发布版本:稳定版(Stable)、测试版(Beta);
工具安装
适用于Linux、Windows和macOS:
# Linux, Windows, MacOS pip3 install reflutter
1 2 | # Linux, Windows, MacOSpip3 install reflutter |
reFlutter使用
impact@f:~$ reflutter main.apk Please enter your Burp Suite IP: <input_ip> SnapshotHash: 8ee4ef7a67df9845fba331734198a953 The resulting apk file: ./release.RE.apk Please sign the apk file Configure Burp Suite proxy server to listen on *:8083 Proxy Tab -> Options -> Proxy Listeners -> Edit -> Binding Tab Then enable invisible proxying in Request Handling Tab Support Invisible Proxying -> true impact@f:~$ reflutter main.ipa
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | impact@f:~$reflutter main.apk Please enter your Burp Suite IP:<input_ip> SnapshotHash:8ee4ef7a67df9845fba331734198a953The resulting apk file:./release.RE.apkPlease sign the apk file Configure Burp Suite proxy server tolisten on *:8083Proxy Tab->Options->Proxy Listeners->Edit->Binding Tab Thenenable invisible proxying inRequest Handling TabSupport Invisible Proxying->true impact@f:~$reflutter main.ipa |
流量拦截
我们需要制定Burp Suite代理服务器的IP地址,且需要跟运行了目标Flutter应用程序的设备处于同一网络总。接下来,我们还需要配置代理(BurpSuite -> Listener Proxy -> Options tab):
- 添加端口:8083;
- 绑定地址:所有接口;
- 请求处理:支持隐形代理 = True
我们不需要安装任何的证书,在Android设备上我们也不需要root权限。除此之外,reFlutter还允许我们绕过某些Flutter证书绑定实现。
Android端使用
生成的apk必须对齐并签名,这里我们可以使用uber-apk-signer和下列命令:
java -jar uber-apk-signer.jar --allowResign -a release.RE.apk
1 | java-jar uber-apk-signer.jar--allowResign-arelease.RE.apk |
如果你想使用DartVM来查看哪些代码被加载了,你还需要在设备上运行应用程序,reFlutter会通过logcat和“reflutter”选项来输出结果:
impact@f:~$ adb logcat -e reflutter | sed 's/.*DartVM//' >> reflutter.txt
1 | impact@f:~$adb logcat-ereflutter|sed's/.*DartVM//'>>reflutter.txt |
代码输出结果如下:
Library:'package:anyapp/navigation/DeepLinkImpl.dart' Class: Navigation extends Object { String* DeepUrl = anyapp://evil.com/ ; Function 'Navigation.': constructor. (dynamic, dynamic, dynamic, dynamic) => NavigationInteractor { } Function 'initDeepLinkHandle':. (dynamic) => Future<void>* { } Function '_navigateDeepLink@547106886':. (dynamic, dynamic, {dynamic navigator}) => void { } } Library:'package:anyapp/auth/navigation/AuthAccount.dart' Class: AuthAccount extends Account { PlainNotificationToken* _instance = sentinel; Function 'getAuthToken':. (dynamic, dynamic, dynamic, dynamic) => Future<AccessToken*>* { } Function 'checkEmail':. (dynamic, dynamic) => Future<bool*>* { } Function 'validateRestoreCode':. (dynamic, dynamic, dynamic) => Future<bool*>* { } Function 'sendSmsRestorePassword':. (dynamic, dynamic) => Future<bool*>* { } }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | Library:'package:anyapp/navigation/DeepLinkImpl.dart'Class:NavigationextendsObject{ String*DeepUrl=anyapp://evil.com/ ; Function'Navigation.':constructor.(dynamic,dynamic,dynamic,dynamic)=>NavigationInteractor{ } Function'initDeepLinkHandle':.(dynamic)=>Future<void>*{ } Function'_navigateDeepLink@547106886':.(dynamic,dynamic,{dynamic navigator})=>void{ } }Library:'package:anyapp/auth/navigation/AuthAccount.dart'Class:AuthAccountextendsAccount{ PlainNotificationToken*_instance=sentinel;Function'getAuthToken':.(dynamic,dynamic,dynamic,dynamic)=>Future<AccessToken*>*{ } Function'checkEmail':.(dynamic,dynamic)=>Future<bool*>*{ } Function'validateRestoreCode':.(dynamic,dynamic,dynamic)=>Future<bool*>*{ } Function'sendSmsRestorePassword':.(dynamic,dynamic)=>Future<bool*>*{ } } |
iOS端使用
执行“reflutter main.ipa”命令之后,我们将拿到IPA文件。如果你想使用DartVM来查看哪些代码被加载了,你还需要在设备上运行应用程序,reFlutter会通过XCode和“reflutter”选项来输出结果:
更多帮助及说明:https://github.com/ptswarm/reFlutter
有事联系邮箱xbnbcn@126.com