跳至主要内容

无处不在的监控: Hacking Team:WP8 监控代码分析

原文来自乌云,备份地址

0x00 背景


最近Hacking Team被黑客入侵,近400GB的资料泄漏,在安全界炒的沸沸扬扬.其中泄漏的资料包括:源代码,0day,资料入侵项目相关信息,相关的账户密码,数据及音像资料,办公文档,邮件及图片。
Hacking Team在意大利米兰注册了一家软件公司,主要销售入侵及监视功能的软件。其远程控制系统可以监测互联网用户的通讯,解密用户的加密,文件及电子邮件,记录各种通信信息,也可以远程激活用户的麦克风及摄像头。其产品在几十个国家使用
enter image description here
在源代码中有各个操作系统平台的远程控制软件源码,RCS(Remote Control System)。经过我们的分析,发现其监控内容不可谓不详尽。Android,blackberry,ios,windows,window phone,symbian均有与之对应的监控代码。
在源码中,rcs为前缀的源码文件是其远控功能,包括代理 控制 监控数据库 隐藏ip 等,而针对特定平台架构的是以core前缀命名。其中和相关window phone监控代码在core-winphone-master.zip文件中。其主要用于实时手机系统的系统状态信息如(电池状态,设备信息,GPS地址位置),联系人,短信记录,日历日程安排,照片;同时还能录音,截取手机屏幕,开启摄像头,话筒等功能,由此可见监控信息的详细程度令人害怕。
enter image description here

0x01 WP8监控源码分析


core-winphone-master\MornellaWp8\MornellaWp8下是其主要核心代码,主要文件如下:
enter image description here
通过观察源码流程图可以看出,整个监控项目源码的逻辑还是比较复杂的,但是深入之后,发现其还是设计的比较巧妙
enter image description here

0x01-1 程序框架分析

1.项目主要分为3大块Modules,Events,Actions,主要的功能Modules核心监控代码在此处,Event等待监控事件的到来并调用对应的监控模块,Action主要负责一些行为的启动和停止
程序启动流程如下:
main->mornellaStart->BTC_Init->CoreProc->Core->Task
setLoadLibraryExW分支主要负责加载一些API函数的地址,做一些初始化工作
enter image description here
最后Task创建了3大模块的管理对象ModulesManager,EventsManager,ActionsManager
并在Task::TaskInit()中启动了events
enter image description here

0x01-2 Event模块分析

Event主要负责以下事件的监控,例如短信,日历日程安排,联系人,地址位置,电池状态,进程信息,计时器状态等信息
enter image description here
所有的event均以json格式发送,并调用conf.cpp下ParseEvent进行解析,源码部分逻辑被注释上了,经过搜索发现被注释上的功能最后没有相关的实现代码.
enter image description here
我们选择电池状态监控为例,在OnBatteryLevel函数中,首先通过RefreshBatteryStatus刷新了电池的状态,deviceObj->GetBatteryStatus()得到当前的电池状态,最后me->triggerStart()添加到ActionManage中的Action队列中
enter image description here

0x01-3 Action模块分析

Action模块主要是3个类 ActionManage,Action,SubAction其中ActionManage主要维护一个Action队列,Action是抽象的接口,而执行的实体主要是SubAction
SubAction主要处理synchronize,execute,uninstall,module,event,sms,log,destroy等行为的执行
enter image description here
而在处理module时用了start类进行启动,Start首先初始化了一个ModulesManager对象,然后在调用conf对获取对应的module信息,并调用ModulesManager->start()启动对应的模块。
enter image description here

0x01-4 Module模块分析

Module模块同上面的模块结构保持一致,也是一个ModuleManage负责维护一个Modules队列。
进行外层调度,Module类是一个抽象的接口,负责统一调用接口,主要的模块接口如下.
这些模块,完成了获取设备信息(如:操作系统版本,设备ID,电量,应用程序列表,进程列表,可用磁盘空间,内存信息,处理器架构),联系人,一些社交帐号信息,同时还能开启摄像头,话筒,截取手机屏幕等功能
enter image description here
1.获取的设备信息,代码主要在DeviceInfo.cpp中
enter image description here
2.获取联系人的以及社交网站的帐号密码,代码主要在PoomAddressBook.cpp中
enter image description here
3.日历日程安排,代码主要在PoomCalendar.cpp中
enter image description here
4.截图功能(代码在SnapshotGrabber.cpp中,但是该部分代码已经被注释)
enter image description here
5.开启摄像头(代码在NativePhotoCaptureInterface.cpp中)
enter image description here
其主要通过WP的PhotoCaptureDevice API接口来实现,当你在啪啪啪的时候,你的摄像头被开启,那是种什么样的感觉呢?
enter image description here
其他的一些监控行为就不一一叙述了,大多都可以通过调用WP的接口来实现。

0x02 感染途径


Window在新推出的WP8上做了很多对非越狱用户的保护,只能安装应用商店中的软件,但是WP8可以通过一个链接访问应用商店中的某个APP,当被攻击者被欺骗的安装了该APP应用,该APP遍可以通过WP提权的漏洞来提升运行权限,即可执行高权限代码,带来的后果非常严重,所以我们要警惕一些钓鱼欺诈的应用。
而对于越狱用户,别人可以直接把应用捆绑在越狱工具,在越狱的过程中,即可捆绑安装他们的APP应用,如果这个应用是恶意的,那么后果可想而知,然而在越狱后的WP系统安全性也将大打折扣.所以我们最好不要轻易的越狱。
Hacking Team是拥有微软的企业证书的,而具有企业证书的公司可以将自己的应用提交到商店供人下载,不用授权即可安装,不论是否越狱都可以安装上去,然而从应用商店下载的程序,用户一般都会认为是安全的。
由于Window Phone用户较少,反馈的问题可能也比较少,相关的开发维护人员也相应的比较少,可能会存在一些不为人知的安全漏洞,可以突破Window Phone8的安全限制,将恶意程序安装上去,还可能存在某些已经安装的应用存在漏洞,利用这些具有漏洞应用结合提权漏洞,将恶意的应用安装到设备上。

0x03 小结


通过Hacking Team泄漏的这些资料来看,Hacking Team团队还是具备非常专业的水平,但是强如Hacking Team的公司都被入侵了,你手机里面的那些私密照片还保险么?
建议:
1.不要随意安装不知名的应用
2.及时更新系统的安全补丁
3.社交帐号设置复杂的密码
4.给私密的照片加密

Popular posts from 产品随想的博客

Interview at the All Things Digital D5 Conference, Steve and Bill Gates spoke with journalists Kara Swisher and Walt Mossberg onstage in May 2007.

Kara Swisher: The first question I was interested in asking is what you think each has contributed to the computer and technology industry— starting with you, Steve, for Bill, and vice versa. Steve Jobs: Well, Bill built the first software company in the industry. And I think he built the first software company before anybody really in our industry knew what a software company was, except for these guys. And that was huge. That was really huge. And the business model that they ended up pursuing turned out to be the one that worked really well for the industry. I think the biggest thing was, Bill was really focused on software before almost anybody else had a clue that it was really the software that— KS: Was important? SJ: That’s what I see. I mean, a lot of other things you could say, but that’s the high-order bit. And I think building a company’s really hard, and it requires your greatest persuasive abilities to hire the best ...

产品随想 | 周刊 第43期:历史上的今天

Products Huberman Lab   https://hubermanlab.com/ 一款聚焦于健康的播客 今日热榜   https://tophub.today/ 聚合展示,国内各热门榜单,对跟进热点非常有帮助,热点运营的好帮手 SketchyBar   https://github.com/FelixKratz/SketchyBar A highly customizable macOS status bar replacement Mac菜单栏定制 自定义程度很高,看作者展示的案例,暂时没想出这样的好处(不过应用本身的编辑,确实也没啥意义)生命在于折腾吧! Thanks-Mirror   https://github.com/eryajf/Thanks-Mirror 整理记录各个包管理器,系统镜像,以及常用软件的好用镜像,Thanks Mirror。 Musicn   https://github.com/zonemeen/musicn 一个下载高品质音乐的命令行工具,音乐来源: 咪咕 Planet Minecraft A creative Minecraft community fansite sharing maps, minecraft skins, resource packs, servers, mods, and more. 里面有很多动人的故事 可能是世界上最大的Minecraft社区,从2010年至今 The Uncensored Library   https://www.uncensoredlibrary.com/en blockworks   https://www.blockworks.uk/ "Distinctive maps for Minecraft that have educated players and risen to the level of art" 游戏也可以让人有更高的实现,而不仅仅是沉迷其中,国外游戏厂商比我们做的好太多 Minecraft_Memory_Bypass_GUI   https://github.com/xingchuanzhen/Minecraft_Memory_Bypass_GUI 绕过Minecraft...

巴菲特致股东信-1976年

 笔记: 为什么选择轻资产行业:当竞争疯狂时,不会强迫加入降价大战 最终选择了费雪的思想,选择能理解的优秀企业,以合理的价格买入并长期拥有 翻译: 雪球:https://xueqiu.com/6217262310/131440258 备份:https://archive.ph/XLK0S 原文: To the Stockholders of Berkshire Hathaway Inc, After two dismal years, operating results in 1976 improved significantly. Last year we said the degree of progress in insurance underwriting would determine whether our gain in earnings would be "moderate" or "major." As it turned out, earnings exceeded even the high end of our expectations. In large part, this was due to the outstanding efforts of Phil Liesche's managerial group at National Indemnity Company. In dollar terms, operating earnings came to $16,073,000, or $16.47 per share. While this is a record figure, we consider return on shareholders' equity to be a much more significant yardstick of economic performance. Here our result was 17.3%, moderately above our long-term average and even further above the average o...

Commencement Address at Stanford University--“Stay hungry. Stay foolish.”

I am honored to be with you today for your commencement from one of the finest universities in the world. Truth be told— I never graduated from college. This is the closest I’ve ever gotten to a college graduation. Today I want to tell you three stories from my life. That’s it. No big deal. Just three stories. The first story is about connecting the dots. I dropped out of Reed College after the first six months but then stayed around as a drop-in for another eighteen months or so before I really quit. So why did I drop out? It started before I was born. My biological mother was a young, unwed graduate student, and she decided to put me up for adoption. She felt very strongly that I should be adopted by college graduates, so everything was all set for me to be adopted at birth by a lawyer and his wife. Except that when I popped out they decided at the last minute that they really wanted a girl. So my parents, who were on a waiting...

巴菲特致股东信-1975年

 笔记: 华盛顿邮报已成为伯克希尔第一重仓股 翻译: 雪球:https://xueqiu.com/6217262310/131409324 备份:https://archive.ph/4hgK3 原文: To the Stockholders of Berkshire Hathaway Inc.: Last year, when discussing the prospects for 1975, we stated “the outlook for 1975 is not encouraging.” This forecast proved to be distressingly accurate. Our operating earnings for 1975 were $6,713,592, or $6.85 per share, producing a return on beginning shareholders ’ equity of 7.6%. This is the lowest return on equity experienced since 1967. Furthermore, as explained later in this letter, a large segment of these earnings resulted from Federal income tax refunds which will not be available to assist performance in 1976. On balance, however, current trends indicate a somewhat brighter 1976. Operations and prospects will be discussed in greater detail below, under specific industry titles. Our expectation is that significantly better results in textiles, earnings added from recent acquisitio...

产品随想 | 周刊 第90期:史家之绝唱,无韵之离骚

Why AI Will Save the World   https://a16z.com/2023/06/06/ai-will-save-the-world/ Marc Andreessen的雄文,十分有說服力,邏輯清晰 辯證了現今AI監管拋出的5個可能的AI問題 讀的過程中,腦海裏浮現的都是編程隨想那篇文章 为什么马克思是错的?——全面批判马列主义的知名著作导读   https://program-think.blogspot.com/2018/09/Book-Review-The-Errors-of-Marxism-Leninism.html 兩者的思維鏈條、敘事方式,非常相似 人民聖殿教   https://zh.wikipedia.org/zh-hk/人民圣殿教?useskin=vector 瓊斯自稱是神的化身,幾千年前轉世為釋迦牟尼,創建了佛教;後來又轉世為耶穌基督,創建了基督教;之後短期化身轉世為巴孛,建立巴哈伊信仰;最後轉世為列寧,將社會主義發揚光大。 邪教徒聲稱自己轉世成了列寧,這說明了什麼? Apple Vision   https://stratechery.com/2023/apple-vision Omnivore   https://github.com/omnivore-app/omnivore Omnivore is a complete, open source read-it-later solution for people who like reading. How the YouTube Algorithm Works in 2023: The Complete Guide   https://blog.hootsuite.com/how-the-youtube-algorithm-works/#A_brief_history_of_the_YouTube_algorithm 外人眼中的YouTube推薦算法變遷 Histography   https://histography.io/ “Histography" is interactive timeline that spans across 14 billion years of history, f...

巴菲特致股东信-1973年

 笔记: 在上一年度预测的今年竞争加剧导致利润下滑,真的发生了 翻译Link: 雪球:https://xueqiu.com/6217262310/131257618 备份:https://archive.ph/KIfdT 原文: To the Stockholders of Berkshire Hathaway Inc.: Our financial results for 1973 were satisfactory, with operating earnings of $11,930,592, producing a return of 17.4% on beginning stockholders' equity. Although operating earnings improved from $11.43 to $12.18 per share, earnings on equity decreased from the 19.8% of 1972. This decline occurred because the gain in earnings was not commensurate with the increase in shareholders' investment. We had forecast in last year's report that such a decline was likely. Unfortunately, our forecast proved to be correct. Our textile, banking, and most insurance operations had good years, but certain segments of the insurance business turned in poor results. Overall, our insurance business continues to be a most attractive area in which to employ capital. Management'...

Steve Jobs introduced the iPhone on January 9, 2007.

This is a day I’ve been looking forward to for two and a half years. Link Every once in a while, a revolutionary product comes along that changes everything. And Apple has been— well, first of all, one’s very fortunate if you get to work on just one of these in your career. Apple’s been very fortunate. It’s been able to introduce a few of these into the world. In 1984, we introduced the Macintosh. It didn’t just change Apple, it changed the whole computer industry. In 2001, we introduced the first iPod, and it didn’t just change the way we all listen to music, it changed the entire music industry. Well, today, we’re introducing three revolutionary products of this class. The first one is a widescreen iPod with touch controls. The second is a revolutionary mobile phone. And the third is a breakthrough internet communications device. So, three things: a widescreen iPod with touch controls; a revolutionary mobile phone; and a breakthrough internet communicat...

犀流研习班第十期001-2讲听课笔记

一. 杂谈   1. Max  逼真的效果图和视频   2. SU  显示模式,费力可以作出好看的效果图   3. Maya  支持Nurbs,但不快捷,对CAD导出也不方便

产品随想 | 周刊 第69期:Do not go gentle into that good night

Products Windows Apps That Amaze Us   https://amazing-apps.gitbook.io/windows-apps-that-amaze-us/ 令人精细的Windows App 文物出版社   https://book.douban.com/press/2456/ 这是一个宝藏出版社,出品书籍质量非常高,大开眼界 blind   https://www.teamblind.com/ 老外的匿名职场社交工具,挺有意思,看看硅谷的meme 中国科学技术大学测速网站   https://test.ustc.edu.cn/ 看着还不错,挺靠谱的 底层代码是LibreSpeed   https://github.com/librespeed/speedtest 能不能好好说话?   https://github.com/itorr/nbnhhsh 也是我的一个痛点 Tree Style Tab (aka TST)   https://github.com/piroor/treestyletab 一个超强的浏览器扩展插件,树状呈现浏览器标签 Failory Pitch Decks   https://www.failory.com/pitch-deck 超级多的融资计划投资板,Pitch Book AutoCut   https://github.com/mli/autocut 用文本编辑器剪视频 全网漫游指南   https://tagly.notion.site/tagly/a333efd8c3e54e12b123acd541e8d3e6 数字时代的指引,希望他们成功 IT eBooks   https://it-ebooks.info/ IT书籍下载 ToastFish   https://github.com/Uahh/ToastFish 一个利用摸鱼时间背单词的软件。 利用Win10通知栏,出现、背单词 Ideas 沈向洋:IDEA 如何找到创新的「甜区」   https://mp.weixin.qq.com/s/OlI5VUxQKU_ijWZClQCG0Q AIGC How Did Nor...