通行证│用户名: 密码: 验证码: 验证码,看不清楚?请点击刷新验证码 爱心红客 电信网通铁通移动 在线
文章搜索:
热门搜索:红客 黑鹰 红客技术 安全动画 红客培训
首页 文章 软件 动画 资源 励志 论坛 邮箱 会员 军事 科技 博客 爱心红客 最近更新 800g资源
 业内新闻 漏洞公告 病毒公告 电脑知识 网络知识 菜鸟入门 攻防教程 黑客攻防 安全编程 工具使用 综合安全 个人安全 安全相关 Q Q安全 原创精华 红客人物 站内事件
您现在的位置: 爱国者安全网 > 文章类 > 安全防御 > 安全相关 > 文章正文
检测注册表中的ProgID信息
责任编辑:酷酷の鱼   更新日期:2008-7-31
 

来源:安全中国

检测注册表中的ProgID信息 
例如输入wscript.shell就可以查询 

’要用到regtool.ocx,用前请regsvr32   regtool.ocx 

’ 我们需要这个对象来访问注册表! 
set wshshell = CreateObject("WScript.Shell") 
    ’我们需要这个自定义对象列举子键,确定你安装了这个com对象 
set registry = CreateObject("regtool.tob") 
     ’我们需要这个对象创建一份文本文件 
’ 输出调查结果: 
set fs = CreateObject("Scripting.FileSystemObject") 
name = InputBox("Type in the ProgID of the Object you are interestedin!") 
keyA = "HKCR\" & name & "\" 
’ 检查这个对象是否注册 
objectname = ReadKey(keyA, ok) 
if not ok then 
MsgBox name & " was not found." 
WScript.Quit 
end if 
’ 创建一个记录文件: 
outputfile = "C:\OBJECT.TXT" 
set output = fs.CreateTextFile(outputfile, true) 
Print name & ": " & objectname 
’ 找出当前版本 
curver = ReadKey(keyA & "CurVer\", ok) 
clsid = ReadKey(keyA & "CLSID\", ok) 
keyB = "HKCR\CLSID\" & clsid & "\" 
physfile = ReadKey(keyB & "InprocServer32\", ok) 
vidpid = ReadKey(keyB & "VersionIndependentProgID\", ok) 
typelib = ReadKey(keyB & "TypeLib\", ok) 
Print "Generic ProgID: " & vidpid 
Print "Physical File: " & physfile 
Print "File Version Information: " & GetVersion(physfile) 
Print "Current Version: " & curver 
Print "Class-ID: " & clsid 
Print "TypeLibrary ClassID: " & typelib 
keyC = "HKCR\Component Categories\" 
Print "Kind of Object:" 
cats = ReadKey(keyB & "Implemented Categories\", ok) 
if ok then 
set categories = registry.RegEnum(keyB _ 
& "Implemented Categories\") 
for each cat in categories 
catKey = keyC & cat & "\" 
if KeyExists(catKey) then 
set entries = registry.ListChildNames(catKey) 
for each entry in entries 
if entry<>"" then Print ReadKey(catKey _ 
& entry, ok) 
next 
else 
Print "Category information is missing!" 
end if 
next 
else 
Print "No Category Information" 
end if 
cats = ReadKey(keyB & "Required Categories\", ok) 
if ok then 
set categories = registry.RegEnum(keyB _ 
& "Required Categories\") 
for each cat in categories 
catKey = keyC & cat & "\" 
if KeyExists(catKey) then 
set entries = registry.ListChildNames(catKey) 
for each entry in entries 
if entry<>"" then Print ReadKey(catKey _ 
& entry, ok) 
next 
else 
Print "Category information is missing!" 
end if 
next 
else 
Print "No Required Categories" 
end if 
keyD = "HKCR\TypeLib\" & typelib & "\" 
if typelib="" then 
Print "No TypeLib available. Use physical file " _ 
& "and search application folder." 
else 
set typelibs = registry.RegEnum(keyD) 
for each typelib in typelibs 
if typelib<>"" then Print "TypeLib Version " _ 
& typelib & ": " & ReadKey(keyD & typelib _ 
& "\0\win32\", ok) 
next 
end if 
’ 关闭记录并且显示 
output.close 
wshshell.run outputfile 
function KeyExists(key) 
on error resume next 
check = wshshell.RegRead(key) 
if not err.Number=0 then 
KeyExists = false 
else 
KeyExists = true 
end if 
end function 
function ReadKey(key, status) 
on error resume next 
ReadKey = wshshell.RegRead(key) 
if not err.Number=0 then 
value="" 
err.clear 
status=false 
else 
status=true 
end if 
end function 
sub Print(text) 
’写信息到记录文件 
output.WriteLine text 
end sub 
function GetVersion(path) 
on error resume next 
GetVersion = fs.GetFileVersion(path) 
if not err=0 then 
err.clear 
GetVersion = -1 
end if 
end function  

  • 上一篇文章:
  • 下一篇文章:
  • 最近更新
    普通文章 防范ARP攻击策略面面观及技巧一则
    普通文章 为什么我很少中病毒?!使用电脑的进来看看!
    普通文章 妙用优化大师 ,网速将会提升到你的最高点
    普通文章 如何对PHP程序中的常见漏洞进行攻击与防护
    推荐文章 自己打造XP的安全防线
    普通文章 研究称黑客攻击速度加快
    普通文章 DNS漏洞发布者遭DNS攻击
    普通文章 Websense:带有恶意代码的合法网站快速增长
    普通文章 IBM:Internet Security Systems X-Force报告
    普通文章 360杀毒被指误杀瑞星防火墙
    热门文章
    普通文章微软副总裁公开承认Vista存在问题
    普通文章微软表示将帮助用户降级Vista到XP
    普通文章Web QQ爬上邮箱页面 低调试用测试
    普通文章DirectX 11属Windows 7操作系统
    普通文章微软整体操作系统份额正在下降
    普通文章美最大银行将Firefox列入支持名单
    普通文章六月Mac用户增长32% Windows下降
    普通文章微软:未成年人中盗版情况很严重
    普通文章微软计划八月发布SQLServer 2008
    普通文章服务器不能启动的几种解决方案
    精彩专题