检查IIS 6.0使用LogParser 2.2loginFTPlogin

我一直在为他的IIS FTP LogParser 2.2查询使用“ 奋进人生”网站。 我唯一的问题是,我似乎无法结合这两个查询,使成功的login和他们的帐户名称。 谁能帮忙?

正如我所说,我想两全其美。 谢谢提前!

好的。

因此,让我们根据我们想要的数据和我们正在查看的数据将其分解成更小的部分。

这给了我们以下基础:

logparser "select cs-uri-stem, cs-method, c-ip from \\192.168.1.104\wwwroot\ex*.log" 

基于我们的条件,我们有以下几点:

 logparser "select cs-uri-stem, cs-method, c-ip, sc-status from \\192.168.1.104\wwwroot\ex*.log where cs-method like '%USER'" logparser "select cs-uri-stem, cs-method, c-ip, sc-status from \\192.168.1.104\wwwroot\ex*.log where sc-status = '230'" 

现在,如果你这样做,你可以看到问题; 像'%USER'这样的cs-method会返回一个sc状态331,所以如果我们试图把它们结合起来,那就不行了。

状态码230是'用户已login,继续' – http://support.microsoft.com/kb/318380 – 而331只是说用户名是好的。

所以让我们退后一步,看看用户login时的日志.cs-username,因为他们被authentication,将填充他们正在使用的帐户的名称。

 logparser "select cs-username, cs-method, c-ip, sc-status from \\192.168.1.104\wwwroot\ex*.log where sc-status = '230'" 

这意味着这应该是我们想要的:

 logparser "select cs-username, c-ip, count(*) from \\192.168.1.104\wwwroot\ex*.log where sc-status = '230' group by cs-username, c-ip order by count(*), cs-username, c-ip" 

基于文件的扫描 – http://media.jamesrskemp.com/articles/IIS6FTPSample.log.txt – 看起来是正确的。

这有帮助吗?


再次看到我的post,错过的关键部分是第一个帮助“确定用户名是用来login, 还是尝试login到FTP站点”。 如果在上面的示例日志中searchFTPUser3,即使我没有创buildFTPUser3帐户,也会看到331由IIS返回。 似乎出于安全的目的,似乎IIS 6 FTP返回331任一方式。