简介
对于使用自解压文件的场景,攻击者可以创建一个自解压的exe文件,该文件解压后自动执行解压出来的文件。然后,通过插入RLO字符,将这个exe文件伪装成另一种看似安全的文件类型,比如文本文件或图片文件。当用户打开这个看似安全的文件时,实际上是在运行恶意的exe文件
RLO(Start of right-to-left override)是Unicode定义的一种特殊字符,其ASCII码为0x3F。这个字符被设计来兼容从右至左阅读的文字系统,如阿拉伯语。当在一行字符前加入一个0x3F字符,系统可以实现文本的反向排列。
在Windows系统中,如果一个字符串中包含RLO字符,系统会将该字符右侧的文本逆序显示。比如,原始字符串 “image[RLO]gpj.exe” 在Windows下会显示为 “imageexe.jpg”。
步骤
1.压缩图片和木马
将木马程序和图片文件添加到压缩文件

在常规->压缩选项
, 勾选上创建自解压格式压缩文件

点击高级->自解压选项

在高级自解压选项->常规
处, 将解压路径修改为程序的解压目录, 例如此处我填写的是C:\windows\temp

在高级自解压选项->设置
处, 填写木马程序和图片文件的解压路径,此处我填写的是C:\windows\temp\hacker.png
和C:\windows\temp\beacon.exe

在高级自解压选项->模式->静默模式
, 勾选上全部隐藏

在高级自解压选项->更新
, 勾选上解压并更新文件
和覆盖所有文件

2.修改自解压程序图标
使用resource hacker替换自解压程序的图标, 最好将图标修改为你之前压缩进去的图片

以下是一个图片文件转图标文件的python代码
from PIL import Image
Open the image file
img = Image.open('hacker.png')
Resize the image
Most .ico files are 32x32 or 16x16, according to the standard Windows icon size
img = img.resize((32,32))
Convert and save the image
img.save('hacker.ico', format='ICO')
图标修改完后点击保存

3.RLO反转后缀
将自解压程序的文件名修改为图片gpj.exe
,然后在图片
和gpj
之间插入RLO

插入RLO后的文件名变成了图片exe.jpg
,这样自解压程序就拥有了一个图片文件的后缀。点击自解压程序,随即会同时执行木马程序和图片文件

参考链接
-
https://wolke.cn/post/5653cc29.html
-
https://blog.csdn.net/weixin_44747030/article/details/123972595