入侵检测——ipc

规则不是非常严谨,没有经过实战检验,检测方式仅供参考

什么是IPC

IPC,又称ipc$,是windows系统中默认开启的一个共享空连接,用来让远程用户连接测试连接时的账号密码是否正确
在终端中输入net use \\目标IP\ipc$ 密码 /user:用户即可尝试连接目标

ipc$的利用条件:

  • 管理员开启了默认共享
  • 知道受害者的IP和登录密码
  • 开启了139、445端口

常用命令:
工作组:net use \\目标IP\ipc$ 密码 /user:用户
域内 : net use \\目标IP\ipc$ 密码 /user:domain\用户

使用举例:
在这里插入图片描述

复现抓包

由于windows是不区分大小写的,所以这里使用大小写的IPC分别进行连接,并捕获到2个数据包
在这里插入图片描述
在这里插入图片描述

下面我用绿色表示存在共同特征的请求包,蓝底表示存在共同特征的响应包,这些内容,是肉眼可见的,跟ipc有关的数据,那么,就考虑拿它作为特征
在这里插入图片描述
发现,还是有一些特征的,当然,出了上面标注的部分外,还有别的一些特征,但是由于样本有限,如果想打击的更加精准,就需要拿到设备上去实际测试了。

小写ipc特征

这里选取了如下两部分特征
在这里插入图片描述
得出规则:

flow:to_server; content:"|fe 53 4d 42 40 00 01 00 00 00 00 00 03 00 01 00 00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ff fe 00 00|"; content:"|00 5c 00 69 00 70 00 63 00 24 00|"; within:100; flowbits:set,ipc-content; metadata:service check-ports;

大写IPC特征

这里选取了如下两部分特征
在这里插入图片描述
得出规则:

flow:to_server; content:"|fe 53 4d 42 40 00 01 00 00 00 00 00 03 00 01 00 00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ff fe 00 00|"; content:"|00 5c 00 49 00 50 00 43 00 24 00|"; within:100; flowbits:set,ipc-content; metadata:service check-ports;

响应特征

由于大小写的IPC响应特征可以取共同特征,这里使用1条规则来做
在这里插入图片描述
得出规则:

flow:to_client; flowbits:isset,ipc-content; content:"|00 00 00 50 fe 53 4d 42 40 00 01 00 00 00 00 00 03 00 01 00 01 00 00 00 00 00 00 00|"; content:"|00 00 00 00 ff fe 00 00 01 00 00 00|"; distance:3; metadata:service check-ports;

综合规则:

alert tcp any any -> any any (msg:"ipc攻击方式1-尝试攻击"; flow:to_server; content:"|fe 53 4d 42 40 00 01 00 00 00 00 00 03 00 01 00 00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ff fe 00 00|"; content:"|00 5c 00 69 00 70 00 63 00 24 00|"; within:100; flowbits:set,ipc-content; metadata:service check-ports; sid:1; rev:1;)
alert tcp any any -> any any (msg:"ipc攻击方式2-尝试攻击"; flow:to_server; content:"|fe 53 4d 42 40 00 01 00 00 00 00 00 03 00 01 00 00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ff fe 00 00|"; content:"|00 5c 00 49 00 50 00 43 00 24 00|"; within:100; flowbits:set,ipc-content; metadata:service check-ports; sid:2; rev:1;)
alert tcp any any -> any any (msg:"ipc攻击成功"; flow:to_client; flowbits:isset,ipc-content; content:"|00 00 00 50 fe 53 4d 42 40 00 01 00 00 00 00 00 03 00 01 00 01 00 00 00 00 00 00 00|"; content:"|00 00 00 00 ff fe 00 00 01 00 00 00|"; distance:3; metadata:service check-ports; sid:3; rev:1;)

snort跑一下,2组规则都告警成功
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_44288604/article/details/119956985