2017年4月26日星期三

iOS/Malware(八)FlexiSpy间谍概览

(整理搬运39,四月 26, 2017)

背景

4月22日,黑客FlexiDie公布了大量来自监控软件厂商FlexiSPY的文件,泄露的文件包括源码和一些内部文档。
这家监控公司其实是一家总部位于泰国(一说位于香港)的小公司,官网显示其主要的目标客户包括希望监控员工的老板、想要监控孩子手机的父母,还有想要监控伴侣的夫妻,第三类客户显然是最多的。《福布斯》今年2月曾对这类监控软件进行过报道,报道指出,在2015年妇女援助组织对693名妇女的调查中,有29%的受访者表示,他们的手机或电脑上曾被伴侣或者前任安装间谍软件或GPS定位器。
但FlexiSPY的客户可不止官网上宣传的这些。此次遭泄密的文件还显示,旗下的监控软件还出售给了土耳其、沙特阿拉伯和巴林政府。
FlexiSPY还与其他监控软件厂商存在一定的联系,FlexiSPY软件可能还被用在了另一款由Gamma公司开发的软件中,这家公司是英德监控公司。
根据泄露的文档, FlexiSPY的工作人员曾协助Gamma工作人员安装软件“Cyclops”,这款软件被用在Gamma自己的监控程序FinSpy上。
Gamma在2012年将FinSpy卖给巴林政府。2015年,有证据显示包括埃及,沙特阿拉伯,土库曼斯坦和委内瑞拉在内的国家政府使用这些监控软件。维基解密SpyFiles系列声称,FinSpy被用来监视“记者,活动家和政治异议人士”。2014年,一名黑客入侵了Gamma International内网,公开了40GB的内部文档和恶意程序源代码(BT种子)

源码结构

    • 路径项目/程序平台平台版本说明时间戳hash
      1.00.1Android只有2.x版本以下的一小部分功能Wed, 27 Apr 2011 (autogen.properties)
      2012-01-11_v.1.03.2BlackBerry<=7Jan 04, 2012(Release Note.txt更新说明最新版本时间)
      bin5000_1.1.4.sisxsymbian9.xd46af65cb7bd12ce77b4d88bbdd4a005
      5002_-2.25.1_green.APKAndroid编译代码。没有注释。最新版本2017.2.9(内嵌文件时间戳)a5b589f4edac1aea9952d3faff261817
      5002_2.24.3_green.APK比泄漏的源代码版本新。有更多功能。有混淆,且有大量的额外的Modules/assets.2017.2.8(内嵌文件时间戳)39be87178c84d4afd07a80323a1d4b91
      5003_1.4.2.jadBlackBerry<=7软件配置信息文件(文本),缺少程序主体(cod or jar 文件)306adab7cfcb0d9a13956ca9e9dbd59a
      5006_-1.0.12.exeWindows2016.12.21(内嵌文件时间戳)eb295fe2e40f12014cdb05de07edcae2
      5006_1.0.13.exe 5006_1.0.13.ZIP2017.1.11(内嵌文件时间戳)8f6a42defdc8632c1baf961d7d9c3e5b fa26d3c6fe253a354ed95e5dbb5067c6
      5007_1.1.1.pkgmacOS2017.1.7(内嵌文件时间戳)4efd37a38a56c650906d2ed76ceaaa6a
      Cyclops -1.00.4application-mainAndroid2012.3.26(jar包内嵌文件时间戳)
      process-main
      FlexiSPY Phoenix 4.9.1ApricotiOS>=6.0iOS程序主体(最二版本)07/06/2013(version.xml)
      ApricotV2iOS程序主体(第三版本)23/01/2015(version.xml)
      BlueBloodmacOS程序13/07/2016(version.xml)
      codebase>=6.0

      iOS恶意代码各个功能模块2011-2016
      CyclopsiOS代码主体(最早版本)26/06/2012(version.xml)
      FeelSecureiOS代码主体(各部分打包存放)
      FlexiSPYiOS程序主体(最终版本)29/07/2016(version.xml)
      GreenBloodmacOS程序,与BlueBlood模块一样15/07/2016(version.xml)
      KnowIT>=6.0iOS程序主体(第五版本)15/07/2016(version.xml)
      KnowITEiOS程序主体(第四版本)26/11/2015(version.xml)
      Panic+iOS代码主体(各部分打包存放)
      Tools
      GammaDEV-Certsymbian-开发证书,cer cnf csr key 文件2011.5.25-2014.5.24(证书有效期)
      TC-Cert上部分cer、key文件(key文件hash相同,cer不同)2010.11.30-2011.11.30(证书有效期)
      TC-ConvertP12 TC-ConvertP12.zipp12证书2007.4.26(zip包内嵌文件时间戳)
    • bin目录下为生成的可执行文件,包含了symbian(sisx)、Android、BlackBerry(jad)、Win、macOS(pkg) 平台的监控程序
      • pkg文件解包:xar -xf *.pkg
      • cpio文件解包:cpio -idmv < *.cpio

FlexiSpy监控软件

  • 平台
    • Win,macOS,Android,iOS,BlackBerry,symbian
  • 功能
    • 移动版
  • 售价(植入方式需要接触目标手机,且iOS版本必须先越狱)


2017年4月17日星期一

Intelligece(四)CIA_vault7_MarbleFramework 反取证框架分析




  • 框架代码
    • 框架使用VS工具,C++语言
    • 框架结构
      • Marble: A Marble is a specific algorithm that scrambles and unscrambles data.
        Mibster: The Mibster is the utility that does the scrambling and altering of source files. The Mibster starts by choosing a Marble (an algorithm) from the filtered list of available algroithms. The Mibster then scans the directories containing source, looking for an strings and data to scramble. The Mibster keeps a clean copy of the original source and replaces it with the scrambled versions of strings/data as well as supplies the unscramble function. The source should compile after Mibster modifies source.
        Mender: The Mender restores the source files to their original state. If, for any reason, the Mibster fails or breaks the code, the Meder can always restore the state to its original.
        Warble: A Warble is a wide-character string (wchar_t *) that needs to be scrambled by the Mibster.
        Carble: A Carble is a multi-byte string (char *) that needs to be scrambled by the Mibster.
        Validator: The Validator is a utility that takes (as an input) the receipt file generated by the Mibster. The Validator uses the receipt file to verify that all the strings intended to be scrambled are not contained in the final binary. 
    • 植入语言部分,有Unicode和UTF8两种编码
  • 混淆的语言
    • 两种混淆方式,都是随机植入
      • 二进制(CARBLE)
      • 文本字符串(WARBLE)
        • 有阿拉伯、中文、俄罗斯文、韩文、波斯文(farsi,阿富汗、伊朗等地使用)
        • 从语言内容来看,语义不明,混淆效果有限(可手动修改为有明确意义的文本)
        • 阿拉伯文
        • 中文无任何意义
        • 俄文(但是被google检测为蒙古文,但依然翻译不出来,
        • 韩文
        • 波斯文
    • 小结
      • 混淆工具随机化植入其他国家语言文本,用于误导分析人员,但目前使用的文本语义不明,混淆效果有限
        • 语言误导,个人认为关键信息替换为其他国家语言更有效果,如log输出、回传信息等
      • 而且對於嚴格的溯源技術來說,需要基於多種因素來判定,僅靠Marble並不足以令經驗豐富的網路取證人員上當

CVE/CNVD list

报告记录&poc: 最近fuzz出了不少crash,提交记录git: https://github.com/gandalf4a/crash_report 其中CVE记录如下: (不定期持续更新) 2025 CVE-2025-22134:heap-buffer-o...