☆ "netstat.exe -nr"的实现方式 https://scz.617.cn/network/200506240926.txt 2005-06-24 09:26 scz 今天发现Windows XP SP1的一个猫腻。 netstat.exe -nr route.exe print 以前一直以为这两条命令是不同的实现方式。现在发现netstat.exe -nr实际是在调 用"route print": > strings netstat.exe | grep route route print 注意,不是"route.exe print",这意味着如果当前目录下有一个route.vbs,执行 "netstat.exe -nr"时,实际将去执行"route.vbs print"。由于VBS脚本缺省是由 wscript.exe解释执行,最终相当于执行"wscript.exe route.vbs print"。事实上我 正是这样发现这个猫腻的,因为会弹框啊。 > cscript.exe //nologo //h:cscript 目前设定的默认脚本宿主是“cscript.exe”。 这样操作之后,VBS脚本缺省由cscript.exe解释执行,"netstat.exe -nr"最终相当 于执行"cscript.exe route.vbs print"。有时想更隐蔽一些,需要//nologo的效果, 但这次总不能去修改netstat.exe吧。可以执行wscript.exe,在GUI界面上有一个复 选框: X 当脚本在命令控制台中执行时显示徽标 缺省情况下该复选框是选中状态,清除它,再调用cscript.exe时默认就是//nologo。 当然,所有的这些都没有什么实际意义,只是你知道了总比不知道要好些,Grin。 2007-04-11 20:37 scz XP SP2悄悄修正了"netstat.exe -nr"的实现方式: > strings netstat.exe | grep route \route.exe" print