柚子Nan--回归原点

Everything can be as easy as you like or as complex as you need.
posts - 232, comments - 984, trackbacks - 17, articles - 29
  博客园 :: 首页 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理

Windows OS 是如何保护系统文件的

Posted on 2005-10-09 16:06 柚子Nan 阅读(1554) 评论(5)  编辑 收藏 所属分类: [Focus Win]

    故事还要追溯到上大学的时候,上汇编课程,老师教我们使用Debug命令,很多同学搞恶作剧(包括我),把copy, dir 等常见的命令改成了 format, delete等有攻击性的命令。这样如果运行dir,实际上就是执行的format, delete,一不小心就毁坏了操作系统,当时就在想为什么这些文件没有保护起来,呵呵,想不明白,就放下了,毕业这么多年就忘记了。

 

    最近在看一些Windows 2003 Server的资料,忽然看到一个名词Windows File Protection,干吗的呢?从名字看,就是保护Windows文件系统的。想想看也是,Windows这么大一个操作系统,有很多很多文件,而这些文件都是由Microsoft定义的,如果我们把里面的文件全部替换掉,文件名字还是一样的,操作系统会怎样?很显然,当然不能工作了。

 

    那么Microsoft是如何保护系统文件的呢?查了一点资料,都是些皮毛,不过原理是这样的,具体怎么实现,就不晓得了。一句话概括,微软使用了数字签名。 

 

  • Windows File Protection

It is a component that runs in the background and prevents replacement of system files. To verify a file, Windows File Protection checks its digital signature. If the file is not of the correct version, Windows File Protection replaces it with a copy from the Windows Server 2003 CD or the backup maintained in the DllCache folder on the hard disk. If the correct file cannot be found, Windows File Protection will promote the user for the file location.

 

  • System File Checker

It is a part of the Windows File Protection component. It is a command-line utility that scans and verifies all system files and device drivers. The command is sfc.

 

  • File Signature Verification

It is also a command-line utility, and the command is sigverif.

You can use the File Signature Verification tool to identify the signed and unsigned files on your computer. You can use this tool to view the name, location, date of modification, type, and version number of each file.

 

有兴趣地可以试试看上边两个cmd命令sfc   sigverif,呵呵,好玩啊!

Feedback

#1楼 [楼主]   回复  引用  查看    

2005-10-09 16:13 by 柚子Nan      
sigverif大概花2分钟就可以扫描结束。
这里是一部分扫描结果
netoc.dll 8/4/2004 2:5.1 Signed nt5.cat Microsoft Windows Publisher
ntoc.dll 8/4/2004 2:5.1 Signed nt5.cat Microsoft Windows Publisher
ocgen.dll 8/4/2004 2:5.1 Signed nt5.cat Microsoft Windows Publisher
ocmsn.dll 8/4/2004 2:5.1 Signed sp2.cat Microsoft Windows Publisher
setupqry.dll 8/4/2004 2:5.1 Signed nt5.cat Microsoft Windows Publisher
tabletoc.dll 8/4/2004 2:5.1 Signed sp2.cat Microsoft Windows Publisher
tsoc.dll 8/4/2004 2:5.1 Signed nt5.cat Microsoft Windows Publisher
zoneoc.dll 8/23/2001 2:5.1 Signed nt5inf.cat Microsoft Windows Publisher
[c:\windows\system32\spool\drivers\color]
srgb color space pro 8/23/2001 2:5.0,2:5.1 Signed ntprint.cat Microsoft Windows Publisher
[c:\windows\system32\spool\drivers\w32x86\3]
addreso.dll 3/21/2003 4.83.1.1 Not Signed N/A
fx6hce.hlp 5/11/2004 None Not Signed N/A
fx6hcec.dll 9/23/2004 0.3.0.0 Not Signed N/A
fx6hcej.dll 9/23/2004 0.3.0.0 Not Signed N/A
fx6hcek.dll 9/23/2004 0.3.0.0 Not Signed N/A

#2楼 [楼主]   回复  引用  查看    

2005-10-09 16:39 by 柚子Nan      
各位看过的有什么联想吗?.net程序上的

#3楼    回复  引用  查看    

2005-10-09 21:54 by 丁丁      
照这个趋势,以后破解软件困难了

#4楼    回复  引用    

2005-10-10 15:07 by just4zzfer [未注册用户]
请问这根破解软件有什么关系么,在技术层面上的?

#5楼 [楼主]   回复  引用  查看    

2005-10-11 10:26 by 柚子Nan      
是StrongName.
为什么每个dll最好有个strongName,需要用sn工具去产生private和public key来保护呢? 想想看,万一有人攻破了你的服务器,这个人又不是一般的人,呵呵,是什么人呢?Developer/Programmer, 他可以看到你的dll,那么利用一些工具可以看到所有函数的原型,他没有恶劣到把你的dll、或者重要文件删除。
而是自己写了一个一模一样的dll覆盖了你的dll,那么你现在还是没有感觉到系统发生了什么变化。其实你的商业数据已经被盗走了, 呵呵,这样的攻击是否比删除dll更加可恶?

strongName在这里就起到了作用,不过请保护好你的private key.

标题  
姓名  
主页
Email (博主才能看到) 
验证码 *  看不清,换一张 [登录][注册]
内容(请不要发表任何与政治相关的内容)  
  登录  使用高级评论  新用户注册  返回页首  恢复上次提交      


相关链接: