找回密码
 注册
搜索
热搜: 超星 读书 找书
查看: 448|回复: 0

[【求助】] 使用Bat文件自定义入侵检测脚本

[复制链接]
发表于 2007-7-16 08:49:03 | 显示全部楼层 |阅读模式
===========================================

暗地工作组已经开发了该类软件.具体请:
http://bbs.blueidea.com/viewthread.php?tid=1308957

本站下载:
Http://bbs.Cnunder.com/info/soft/Autoscan.exe

Administrator By http://www.Reistlin.com

===========================================

[Copy to clipboard] [ - ]CODE:
Time /t >> IIS-Scan.log
Find /i \"需要查找的字符\" C:\\WINDOWS\\system32\\LogFiles\\Httperr\\*.* >> IIS-Scan.log
上面这个 Bat 呢.可以很方便的查找 IIS 6.0 的日志文件里的入侵数据.
我们都知道.Windows 2003 Server的IIS里面有个专有的 \"Httperr\" 这个文件夹.
专门记录相关的错误.当然.如果你用扫描软件对服务器进行扫描的话呢.
肯定都会被记录在这里.这个 Bat 文件使用了 Find.exe 命令.

第一行是记录服务器时间.并写入名为 IIS-Scan.Log 这个文件里.
第二行.查找.参数 i 是不区分大小写.然后在 \"\" 里面输入自己需要查找的字符串.
比如经常会出现 \"../..\" 这样的扫描记录.或者是 \"%&\" 这样的U码试探.
\"*.*\" 是查询 \"Httperr\" 这整个目录的所有文件.并把查找的结果写入IIS-Scan.log.

下面是我自己服务器上用的一套完整的脚本!

[Copy to clipboard] [ - ]CODE:
@Cd \\
Rem ******** Auto Scan IIS 6.0 LogFiles By www.Reistlin.com ********
Rem     ******** Scaning...Please...Waiting... ********
@Echo Off
Time /t >> IIS-Scan.log
Find /i \"..\" C:\\WINDOWS\\system32\\LogFiles\\Httperr\\*.* >> IIS-Scan.log
Find /i \"\\\\\" C:\\WINDOWS\\system32\\LogFiles\\Httperr\\*.* >> IIS-Scan.log
Find /i \"//\" C:\\WINDOWS\\system32\\LogFiles\\Httperr\\*.* >> IIS-Scan.log
Find /i \"windows\" C:\\WINDOWS\\system32\\LogFiles\\Httperr\\*.* >> IIS-Scan.log
Find /i \"private\" C:\\WINDOWS\\system32\\LogFiles\\Httperr\\*.* >> IIS-Scan.log
Find /i \"printer\" C:\\WINDOWS\\system32\\LogFiles\\Httperr\\*.* >> IIS-Scan.log
Find /i \"session\" C:\\WINDOWS\\system32\\LogFiles\\Httperr\\*.* >> IIS-Scan.log
Find /i \"admin\" C:\\WINDOWS\\system32\\LogFiles\\Httperr\\*.* >> IIS-Scan.log
Find /i \"winnt\" C:\\WINDOWS\\system32\\LogFiles\\Httperr\\*.* >> IIS-Scan.log
Find /i \"null\" C:\\WINDOWS\\system32\\LogFiles\\Httperr\\*.* >> IIS-Scan.log
Find /i \"boot\" C:\\WINDOWS\\system32\\LogFiles\\Httperr\\*.* >> IIS-Scan.log
Find /i \"www\" C:\\WINDOWS\\system32\\LogFiles\\Httperr\\*.* >> IIS-Scan.log
Find /i \"asa\" C:\\WINDOWS\\system32\\LogFiles\\Httperr\\*.* >> IIS-Scan.log
Find /i \"mdb\" C:\\WINDOWS\\system32\\LogFiles\\Httperr\\*.* >> IIS-Scan.log
Find /i \"dat\" C:\\WINDOWS\\system32\\LogFiles\\Httperr\\*.* >> IIS-Scan.log
Find /i \"bat\" C:\\WINDOWS\\system32\\LogFiles\\Httperr\\*.* >> IIS-Scan.log
Find /i \"rpc\" C:\\WINDOWS\\system32\\LogFiles\\Httperr\\*.* >> IIS-Scan.log
Find /i \"bin\" C:\\WINDOWS\\system32\\LogFiles\\Httperr\\*.* >> IIS-Scan.log
Find /i \"vti\" C:\\WINDOWS\\system32\\LogFiles\\Httperr\\*.* >> IIS-Scan.log
Find /i \"doc\" C:\\WINDOWS\\system32\\LogFiles\\Httperr\\*.* >> IIS-Scan.log
Find /i \"cgi\" C:\\WINDOWS\\system32\\LogFiles\\Httperr\\*.* >> IIS-Scan.log
Find /i \"log\" C:\\WINDOWS\\system32\\LogFiles\\Httperr\\*.* >> IIS-Scan.log
Find /i \"iis\" C:\\WINDOWS\\system32\\LogFiles\\Httperr\\*.* >> IIS-Scan.log
Find /i \"ida\" C:\\WINDOWS\\system32\\LogFiles\\Httperr\\*.* >> IIS-Scan.log
Find /i \"idc\" C:\\WINDOWS\\system32\\LogFiles\\Httperr\\*.* >> IIS-Scan.log
Find /i \"idq\" C:\\WINDOWS\\system32\\LogFiles\\Httperr\\*.* >> IIS-Scan.log
Start IIS-Scan.log
===========================================

[Copy to clipboard] [ - ]CODE:
Time /t >> Port.log
Netstat -NA -P Tcp 600 >> Port.log
上面这个.使用NETSTAT -NA命令.查询连接数和端口数.并写入Port.log.
注意那个 600 的意思是 600秒.也就是每 600 秒记录一次.
慎重使用.因为一分钟记录一次.会导致 Port.log 文件随着时间的推移而越来越大.
我们还是推荐使用6000吧.或者3000秒也可以.半个小时记录一次不过分吧.

===========================================

[Copy to clipboard] [ - ]CODE:
Time /t >> 3389.log
Netstat -n -p tcp | Find \":3389\" >> 3389.log
这个就更不需要我多说了.这是一个终端服务监视脚本.
将这个BAT文件加到终端服务登陆脚本里面.
每次登陆就会运行.记录登陆时间.登陆端口等信息.




http://bbs.blueidea.com/viewthread.php?tid=1304500&highlight=
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|网上读书园地

GMT+8, 2024-6-2 12:25 , Processed in 0.368773 second(s), 6 queries , Redis On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表