sam格式的结构和意义_SAM文件基础知识

windows NT及win2000中对用户帐户的安全管理使用了安全帐号管理器(security account manager)的机制,安全帐号管理器对帐号的管理是通过安全标识进行的,安全标识在帐号创建时就同时创建,一旦帐号被删除,安全标识也同时被删除。安全标识是唯一的,即使是相同的用户名,在每次创建时获得的安全标识都时完全不同的。因此,一旦某个帐号被删除,它的安全标识就不再存在了,即使用相同的用户名重建帐号,也会被赋予不同的安全标识,不会保留原来的权限。

安全账号管理器的具体表现就是%SystemRoot%\\system32\\config\\sam文件。sam文件是windows NT的用户帐户数据库,所有NT用户的登录名及口令等相关信息都会保存在这个文件中。sam文件可以认为类似于unix系统中的passwd文件,不过没有这么直观明了。passwd使用的是存文本的格式保存信息,这是一个linux passwd文件内容的例子

bitsCN_com

0: root:8L7v6:0:0:root:/root:/bin/bash

1: bin:*:1:1:bin:/bin:

2: daemon:*:2:2:daemon:/sbin:

3: adm:*:3:4:adm:/var/adm:

4: lp:*:4:7:lp:/var/spool/lpd:

5: sync:*:5:0:sync:/sbin:/bin/sync

6: shutdown:*:6:0:shutdown:/sbin:/sbin/shutdown

7: halt:*:7:0:halt:/sbin:/sbin/halt

8: mail:*:8:12:mail:/var/spool/mail:

Array: news:*:Array:13:news:/var/spool/news:

10: uucp:*:10:14:uucp:/var/spool/uucp:

11: operator:*:11:0perator:/root:

12: games:*:12:100:games:/usr/games:

13: gopher:*:13:30:gopher:/usr/lib/gopher-data:

14: ftp:*:14:50:FTP User:/home/ftp:

15: nobody:I0iJ.:ArrayArray:ArrayArray:Nobody:/home/httpd:/bin/bash

16: david:c6CuzM:500:500::/home/david:/bin/bash

17: dummy:fIVTl4IgU:501:503::/home/dummy:/bin/bash

18: msql:!!:502:504::/home/msql:/bin/bash

unix中的passwd文件中每一行都代表一个用户资料,每一个账号都有七部分资料,不同资料中使用":"分割格式如下

账号名称:密码:uid:gid:个人资料:用户目录:shell

除了密码是加密的以外(这里的密码部分已经shadow了)其他项目非常清楚明了。 www.bitsCN.com

而NT中就不是这样,虽然他也是用文件保存账号信息,不过如果我们用编辑器打开这些NT的sam文件,除了乱码什么也看不到。因为NT系统中将这些资料全部进行了加密处理,一般的编辑器是无法直接读取这些信息的。注册表中的

HKEY_LOCAL_MACHINE\\SAM\\SAM

HKEY_LOCAL_MACHINE\\SECURITY\\SAM

保存的就是SAM文件的内容,在正常设置下仅对system是可读写的。

*** NT的帐号信息在SAM文件中是如何存储的呢?***

在SAM文件中保存了两个不同的口令信息:LanManager(LM)口令散列算法和更加强大的加密NT版。LM就是NT口令文件的弱点。我们来看看LM口令算法是如何加密口令的,考虑这样一个口令:Ba01cK28tr,这样的口令已经可以称的上是一个安

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
国外经典SAM结构分析资料。 偶尔从google上获得,从网上搜集了一大会,发现比国内的资料简直UP了好些年。 Security Accounts Manager Author: clark@hushmail.com Last updated: 3rd April 2005 ________________________________________ This article is based primarily on a local default setup of NT5.0 Professional or 2K (Windows 2000), however there maybe additional verified references to XP Professional and Server Editions. Much will apply across the NT range, but not all has been verified. Note that this is a partial update from the orginal version, there will be more additions, I just thought it was time to consolidate some stuff. This article has been written concisely and progressively, it is advisable not to skim read. Some stuff is advanced, use a test machine where possible. Special thanks to: (alphabetically ordered) esrever_otua: For pointing out something which I had missed about group memberships. fishy5: For coding XORCheck.exe which calculates the registry hive checksum. mirrorshades: For inspiring a hash database space optimzation technique rattle: For coding ntdate.exe which calculates the NT time format and the LastPolicyTime; a couple of programs for the #DAD8636F687BF15B section and for working on the LM Hash Decoder V1/V2 projects. Serg Wasilenkow: For working on the LM Hash Decoder V1/V2 projects. Vladimir Katalov: For the PWSEx product key and working on the LM Hash Decoder V1/V2 projects. xavic: For inspiring a hash database space optimzation technique Due to length and my decision not to divide this article into separate pages I have split the article into 4 main chapters. 01. Users and Groups 02. (some) Security Settings 03. Registry Structure 04. Passwords

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值