跳至主要内容

Hacking Team Android Browser Exploit代码分析

原文来自乌云,备份地址

0x00 前言


Hacking Team 415G泄露资料的vector-exploit-master\src\ht-webkit-Android4-src目录中,包含一份Android Browser exploit代码。用户在浏览器中点击攻击者的链接,便会执行恶意代码。恶意代码利用漏洞获取root权限,并静默安装木马apk。影响Android4.0-4.3版本。

00x1 漏洞利用的艺术


Exploit代码利用了三个已知的libxslt漏洞,获得对内存地址的完整控制能力。
  1. information leak (CVE-2011-1202)。
  2. Arbitrary memory read (CVE-2012-2825)
  3. Heap-buffer-overflow (CVE-2012-2871)
关键流程:
enter image description here

00x2 利用分析


1 申请330块1M大小的内存,并给每一块内存区域打上标记(0x70747468,‘HTTP’)。
enter image description here
2 进行内存搜索,利用CVE-2012-2825可以检查任意内存地址是否为0x70747468(’HTTP’)的能力,找出第一步的标记内存,得到标记内存所在的地址。这里查找内存的时候涉及一个技术细节。
When parsing a XSLT stylesheet containing a DTD, a structure of type xmlEntity is accessed as another type. The value of cur->ns->href is then compared with a string(“http://www.w3.org/1999/XSL/Transform"). If not equal, return null.
enter image description here
将ns->href和ns->prefix的值改为addr,然后利用二分法在[0x7a703030, 0x79303030]这块内存空间遍历addr,如果找到"http://www.w3.org/1999/XSL/Transform",会返回一个正确的documentElement。
enter image description here
由于这块地址在第一步中已经申请。这块内存我们知道地址并可以随意使用,这一步很关键。可控制的内存约4MB,称为ZoneX。
3 精心修改ZoneX,利用CVE-2011-1202泄漏堆对象的地址和CVE-2012-2871写特定内存地址为特定值的能力,把ZoneX标记为已释放,但JS仍然有读写的能力。
enter image description here
enter image description here
enter image description here
这一过程相当复杂,暂且跳过。
4 立即申请大量新的ArrayBuffer覆盖ZoneX,由于JS仍然有读写ZoneX的能力,可以马上修改一块符合条件的ArrayBuffer的起始地址为0x00000000,结束地址为0xFFFFFFFF,即整个内存区域。
enter image description here
5 利用BufferMemoryObject对象,封装对内存地址的操作,至此JS已经得到整个RING3内存的完整读写能力。
enter image description here
6 下载小马module.so
enter image description here
7 结合CVE-2011-1202信息泄漏漏洞,获得libwebcore.so的基址进而获得libc.so的基址。
enter image description here
然后在libc和libwebcore中搜索可用的gadget。
enter image description here
8 操作内存,覆盖JS对象的虚表,构造假的vtable完成两个gadget的拼接。并使用ROP攻击手法,通过mprotect给堆上的shellcode代码执行的权限,并将执行流程跳转到真正的shellcode。
enter image description here
enter image description here
9 shellcode中激活已经下载好的小马module.so;
enter image description here
10 接下来小马下载ROOT提权程序(exploit,ELF)获取ROOT权限;并留下一个shell /system/bin/rilcap,过程和rcs完全一致。
enter image description here
用IDA打开小马,发现其使用了Obfuscator-clang对代码进行了混淆。
enter image description here
所涉及的两种root方法,第一种是put_user,另一种是towel。
11 随后,小马在ROOT权限下静默安装黑客指定的木马程序。ALL DONE。

00x4 总结


从三个POC到一套完整的远程代码执行exploit,是一个复杂而艰难的过程。Hacking Team 的exploit演绎相当之精彩,不得不说是漏洞利用的艺术。从远程代码执行,到下载rcs远程控制客户端,Hacking Team构建了一条完整的黑色链条。看完之后,各位看官会不会和小编一样,背后吓出了一身冷汗。Android Browser Exploit仅仅是Hacking Team泄漏资料中的一个项目,其中的技术点便相当复杂。其所泄漏的项目,不仅包括源代码,还包括大量工程化的工具以及技术文档。仅需简单地配置和修改即可自动化生成黑客工具,很容易被不法分子利用。可想而知,这将大大降低黑产的技术门槛。黑产水平将在短时间内显著提升。守护用户安全之路将任重而道远。

Popular posts from 产品随想的博客

黑客讲述渗透Hacking Team全过程

原文地址在 Freebuf ,后来已经被删除 Wayback Machine 备份 近期,黑客 Phineas Fisher在pastebin.com上讲述了入侵Hacking Team的过程,以下为其讲述的原文情况,文中附带有相关文档、工具及网站的链接,请在安全环境下进行打开,并合理合法使用。作者部分思想较为激进,也请以辩证的观点看待之。 1、序言 在这里,可能你会注意到相比于前面的一个版本,这个版本的内容及语言有了一些变化,因为这将是最后一个版本了 [1] 。对于黑客技术,英语世界中已经有了许多书籍,讲座,指南以及关于黑客攻击的知识。在那个世界,有许多黑客比我优秀,但他们埋没了他们的天赋,而为所谓的“防护”服务商(如Hacking Team之流的),情报机构服务工作。黑客文化作为一项非主流文化诞生于美国,但它现在只保留了它本质的魅力,其他均被同化了。从黑客的本质出发,至少他们可以穿着一件T恤,把头发染成蓝色,用自己的黑客的名字,随意 洒脱 地做着自己喜欢的事件,而当他们为别人(前文所指的 Hacking Team及情报机构 )工作的时候,会感觉自己像个反抗者。 如果按照传统的方式,你不得不潜入办公室偷偷拿到文件[2],或者你不得不持枪抢劫银行。但现在你仅仅需要一台笔记本,躺在床上动动手指便可做得这一切[3][4]。像CNT在入侵伽玛集团(Gamma Group)之后说的,“让我们以一种新的斗争方式向前迈进吧”[5]。 [ 1 ] http: / /pastebin.com/raw .php?i=cRYvK4jb [ 2 ] https: / /en.wikipedia.org/wiki /Citizens%27_Commission_to_Investigate_the_FBI [3] http:/ /www.aljazeera.com/news /2015/ 09/algerian-hacker-hero-hoodlum- 15092108 3914167 .html [ 4 ] https: / /securelist.com/files /2015/ 02 /Carbanak_APT_eng.pdf  [ 5 ] http: / /madrid.cnt.es/noticia /consideraci...

360T7 刷机步骤及固件

https://cmi.hanwckf.top/p/360t7-firmware/   360T7的固件支持由immortalwrt-mt798x项目提供支持,请参考: https://cmi.hanwckf.top/p/immortalwrt-mt798x https://github.com/hanwckf/immortalwrt-mt798x 刷机步骤 参考 此处 的办法开启原厂固件的UART和telnet功能 在以下链接下载360T7测试固件(纯净版,无任何插件) https://wwd.lanzout.com/b0bt9idwd 密码:ezex (此固件已过时,请选择其它更新的固件) 接下来将刷入修改版uboot。修改版uboot的优点有: 固件分区可达108MB,原厂uboot只能使用36M 自带一个简单的webui恢复页面 到以下仓库的Release页面下载uboot,目前暂时仅支持360T7,后续将支持更多mt798x路由器。 推荐使用 mt7981_360t7-fip-fixed-parts.bin , fixed-parts 代表uboot分区表在编译期间固定,不会随着uboot环境变量变化。 https://github.com/hanwckf/bl-mt798x/releases/latest 将 mt7981_360t7-fip-fixed-parts.bin 通过HFS等方式上传到路由器,使用以下命令刷入uboot mtd write mt7981_360t7-fip-fixed-parts.bin fip 确认刷入完毕后,拔掉路由器电源。然后将电脑的IP地址设置为固定的 192.168.1.2 ,接着按住路由器的RESET按钮后通电开机,等待8s后用浏览器进入 192.168.1.1 在uboot恢复页面选择要刷入的固件。immortalwrt-mt798x目前编译两个版本的360T7固件。 建议修改版uboot直接使用 immortalwrt-mediatek-mt7981-mt7981-360-t7-108M-squashfs-factory.bin ,两种固件区别如下: mt7981-360-t7-108M 为108M固件分区,原厂uboot不可启动,需要修改版u...

产品爱好者周刊 第26期:PRISM, XKeyscore, Trust No One

  Products Gitea - Git with a cup of tea   https://gitea.io/en-us/ A painless self-hosted Git service. 自建Git服务,避免GitHub隐私侵犯 https://github.com/objective-see/LuLu LuLu is the free macOS firewall 监视Mac的出站流量,且阻断 OverSight   https://github.com/objective-see/OverSight OverSight monitors a mac's mic and webcam, alerting the user when the internal mic is activated, or whenever a process accesses the webcam. 监视是否有应用调用Mac的麦克风、摄像头 Mozilla Hubs   https://github.com/mozilla/hubs The client-side code for Mozilla Hubs, an online 3D collaboration platform that works for desktop, mobile, and VR platforms. 开源的多人虚拟空间,Mozilla打造,企业级VR诉求 数字移民   https://shuziyimin.org 关于内容源、工具的推荐,适合刚接入国际的新人 SimpleLogin   https://simplelogin.io/ 匿名邮箱工具,转发用,Michael Bazzell推荐 Telegram 群组、频道、机器人 - 汇总分享   https://congcong0806.github.io/2018/04/24/Telegram/#机器人-bot https://archive.ph/iJMBj 献给那些将来到Telegram的朋友 Design Patrick Wardle   https://www.instagram.com/patrickwardle/?hl=en 他的IG,摄影也精彩,审美...

UNstudio实习经验分享

再过一周,我就将离开UNstudio阿姆斯特丹总部,到其上海分部了,鉴于上海分部目前还不承担设计任务,因此可以视为我UNstudio参与设计的体验即将告一段落。这个实习,原定3个月,后来被要求延长到了6个月,后来又延长到9个月,现在看来最终大概有11个月——那天一问,发现我的合同已经到了9月份了,赶紧声明不能这么长,我8月得回学校了。

文明、现代化、价值投资与中国 By 李录

 价值投资的概念/框架: 1)股票是对公司的所有权,而不仅仅是一张纸; 2)安全边际;(预测未来,但要留好安全边际) 3)市场先生;(让市场来服务你,而不是被指导) 4)能力圈;(建立属于自己的能力圈) 公司的来源: 欧洲扩张,从国王到贵族,到有钱人,到平民 《价值线》-几千家公司过去10年的财务情况

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 ...

产品爱好者周刊 第10期:乔布斯逝世10年

  产品爱好者周刊 第10期: 2021.10.14 Products 经济学人、卫报、Wired等电子周刊: https://github.com/hehonghui/the-economist-ebooks 每周均更新 Immersed: https://immersed.com/ 桌面端软件,可以虚拟出5个VR桌面,能模拟出在海滩、宇宙等地方,工作 它的员工写了篇自己工作流,非常酷 Working From Orbit: https://blog.immersed.team/working-from-orbit-39bf95a6d385 bilibili视频下载工具(开源) 哔哩下载姬 downkyi: https://github.com/leiurayer/downkyi Windows Only BilibiliVideoDownload: https://github.com/blogwy/BilibiliVideoDownload 多平台 BiliDuang:  https://github.com/kengwang/BiliDuang Versus: https://versus.com/cn 万物皆可比较 官网的范例,基本都是数码产品,可能是标准化产品有具体参数,容易比较些? News Jony Ive on What He Misses Most About Steve Jobs:  https://www.wsj.com/articles/jony-ive-steve-jobs-memories-10th-anniversary-11633354769 中文译本: https://archive.ph/EZihd Ideas Weather Spark:  https://weatherspark.com 全球城市的全年气候,用于去陌生城市、旅行规划了解城市天气,会有帮助 Long Now Foundation:  https://twitter.com/longnow 以10000年的跨度,去思考未来的可能性,真是一件很浪漫的事情 Outside interests Notion会私自查看用户的内容

A Sister’s Eulogy for Steve Jobs

I grew up as an only child, with a single mother. Because we were poor and because I knew my father had emigrated from Syria, I imagined he looked like Omar Sharif. I hoped he would be rich and kind and would come into our lives (and our not yet furnished apartment) and help us. Later, after I’d met my father, I tried to believe he’d changed his number and left no forwarding address because he was an idealistic revolutionary, plotting a new world for the Arab people. Even as a feminist, my whole life I’d been waiting for a man to love, who could love me. For decades, I’d thought that man would be my father. When I was 25, I met that man and he was my brother. By then, I lived in New York, where I was trying to write my first novel. I had a job at a small magazine in an office the size of a closet, with three other aspiring writers. When one day a lawyer called me — me, the middle-class girl from California who hassled the boss to buy us health insurance — and said his cl...

《Becoming Steve Jobs》Chapter 16 Blind Spots, Grudges, and Sharp Elbows

Steve could be pretty thin-skinned when someone prominent criticized the aesthetics of his products. He took great umbrage that Neil would, as Steve put it, “pop off in public like that without coming to talk to us about his technical concerns first.” From that point on he had rebuffed all of Neil’s attempts to smoke the peace pipe. 有趣 He had blind spots, grating behavioral habits, and a tendency to give in to emotional impulse that persisted his entire life. These characteristics are often used to make the case that Steve was an “asshole” or a “jerk,” or perhaps simply “binary”—that odd adjective often used to convey the sense that he was half asshole/half genius from birth to death. These aren’t useful, interesting, or enlightening descriptions. What’s more illuminating is to take a look at the specific ways in which Steve failed to do an effective job of tempering some of his weaknesses and antisocial traits, and to consider how, when, and why some of them continued to flare up even...