解读userenv的日志

 

解读userenv的日志,同时这个文件是适用于windowsXP的;可以参考下面的文章:

How to read Userenv Log - Part 1 Machine Policy

http://zhangfang526.blog.51cto.com/8588740/1713446

 

USERENV(2c4.2c8) 09:00:42:953 CSyncManager::LeaveLock<S-1-5-21-2983673047-2985278797-1611865338-500>

1. 加载关于于管理员的profile:

SID: S-1-5-21domain-500
Name: Administrator
Description: A user account for the system administrator. By default, it is theonly user account that is given full control over the system

----------------------------------------------------------------

2. 初始化相关系统的profile

CUserProfile::Initialize: Proccessing S-1-5-20

CUserProfile::Initialize: Proccessing S-1-5-19

CUserProfile::Initialize: Proccessing S-1-5-18

CUserProfile::Initialize: RpcServerRegisterIfEx

具体三个值的意思,查看:

https://support.microsoft.com/en-us/kb/243330

------------------------------------------------------------------------

3. 下面启动三个进程:

LibMain: Process Name: C:\WINDOWS\system32\services.exe

LibMain: Process Name: C:\WINDOWS\system32\lsass.exe

LibMain: Process Name: C:\WINDOWS\system32\svchost.exe

这三个进程是启动所有程序的根本,至于作用可以参考下面的文章,但是会不断更新。。

https://technet.microsoft.com/en-us/library/ee198746.aspx

 

4. 下面是加载系统底层的profile(进程号2f0:

        LoadUserProfile: lpProfileInfo->lpUserName =<NetworkService>

        同时通过另外一个进程加载系统的profile(进程号2c4):

        LoadUserProfile: lpProfileInfo->lpUserName =<NetworkService>

        LoadUserProfile: User sid: S-1-5-20

        Local profile image filename = <%SystemDrive%\Documentsand Settings\NetworkService>

        查看这个serviceprofile是否是强制的:

        No local mandatory profile. Error = 2

        Found local profile image file ok <C:\Documents andSettings\NetworkService\ntuser.dat>

        GetUserDNSDomainName: Domain name is NT Authority.  NoDNS domain name available.

        Process Name: C:\WINDOWS\System32\svchost.exe

        出现错误正常,具体原因查看:

        http://zhangfang526.blog.51cto.com/8588740/1713446

 

5. 下面是启动关于<LocalService>

    lpProfileInfo->lpUserName = <LocalService>

    LoadUserProfile: User sid: S-1-5-19

    lpProfile->lpLocalProfile = <C:\Documents andSettings\LocalService>

    LibMain: Process Name:  C:\WINDOWS\system32\svchost.exe

    同时加载优先级最高的一些底层进程(这些是依赖于localservice启动和svchost.exe加载的):

    LibMain: Process Name: C:\Program Files\rising\Rav\RavMonD.exe

    LibMain: Process Name: C:\Program Files\rising\Rav\rsnetsvr.exe

    LibMain: Process Name: C:\WINDOWS\system32\spoolsv.exe

    LibMain: Process Name: C:\WINDOWS\System32\SCardSvr.exe

    C:\Program Files\立思辰打印控制客户端\ClientService.exe

 

 --------------------------------------------------------------------

下面就是处理计算机相关的策略:

Starting computer Group Policy

第一 是通过ICMP探测是否慢速网络连接

    PingComputer: PingBufferSize set as 2048

    Ping之后的结果:

    PingComputer: Adapter speed 1000000000 bps

    PingComputer:  Fastlink.  Exiting.

第二 去调用相应的service加载profile去执行GPO的相关工作

    LoadUserProfile: lpProfileInfo->lpUserName =<NetworkService>

    GetInterface: Returning rpc binding handle

    lpProfileInfo->UserName = <NetworkService>

    LibMain:Process Name: C:\WINDOWS\system32\locator.exe �C 这个是RPC的启动程序Remote Procedure Call(RPC) Locator - C:\WINDOWS\system32\locator.exe

    lpProfileInfo->lpUserName = <LocalService>

    1.1 查询Domain

            ProcessGPOs: network name is abc.com

    1.2 在查询自己所在的ou

                ProcessGPOs:  Username is:  CN=SC-TEST02,OU=SC-TEST,DC=abc,DC=com,Domain name is:  ABC

    1.3 在执行DNS去查询自己site的登录DC

                ProcessGPOs: Domain controller is:  \\S-DC-05.abc.com  Domain DN is abc.com

    1.4 通过Extension去查询自己本身的GPO

                Reading Previous Status for extension{35378EAC-683F-11D2-A89A-00C04FBBCFA2}

    1.5 下面就是去查询OU/Domain/Site上的对应组策略GPC

                Searching <OU=SC-TEST,DC=abc,DC=com>

                ProcessGPOs :Found GPO(s): <[LDAP://cn={3E401836-DEC9-4051-B6A3-EA164DAD5E62},cn=policies,cn=system,DC=abc,DC=com;0][LDAP://cn={BFC0EF13-3769-4A85-91CF-25FDD1AEB8BB},cn=policies,cn=system,DC=abc,DC=com;0][LDAP://cn={CDA8EA89-539D-4DAD-BCBF-1450534B8934},cn=policies,cn=system,DC=abc,DC=com;0][LDAP://cn={A3746AB3-D79E-43E7-A893-97FC0D7CBA89},cn=policies,cn=system,DC=abc,DC=com;0]>

    1.6 查找是否有对应的不同

            Deferring search for<LDAP://cn={3E401836-DEC9-4051-B6A3-EA164DAD5E62},cn=policies,cn=system,DC=abc,DC=com>

    1.7 查找Domainpolicy

                Searching <DC=abc,DC=com>

     1.8 查找site

                Searching <CN=EastDistrict,CN=Sites,CN=Configuration,DC=abc,DC=com>

                No GPO(s) for this object

 

    2.1 对于刚才查找到的GPO,要进行LDAP的查询就是所谓的GPC查询

                Searching<cn={3E401836-DEC9-4051-            B6A3-EA164DAD5E62},cn=policies,cn=system,DC=abc,DC=com>

                Found file system path of: <\\abc.com\SysVol\abc.com\Policies

                Found machine version of: GPC is 0, GPT is 0

下面是对查询到的组策略进行一个一个查询:

                Searching<cn={BFC0EF13-3769-4A85-91CF-25FDD1AEB8BB},cn=policies,cn=system,DC=abc,DC=com>

                Found file system path of: <\\abc.com\SysVol\abc.com

                Found extensions: [{35378EAC-683F-11D2-A89A-00C04FBBCFA2}{D02B1F72-3407-48AE-BA88-E8213C6761F1}]

。。。。。。

        具体的参数看以参看:

     组策略处理完毕:

         GPOThread:  Nextrefresh will happen in 95 minutes

     说明这个策略会在95分钟后再次执行

         http://zhangfang526.blog.51cto.com/8588740/1713446


上面的计算机处理完毕是以下面的为标志:

LibMain: Process Name: C:\WINDOWS\system32\userinit.exe

Userinit.exe是我们看到的control + alt+ delete的登录界面

后面的处理方式和前面一样可以参考下面的文章:

Understanding How to Read a Userenv Log �C Part 2

http://zhangfang526.blog.51cto.com/8588740/1713895

 

总结

1,用户这里是在计算机启动后在输入用户名和密码后,会把对应的内容发送到NPS中客户端网络的端口使用dot1x,所以在计算机启动和真正进入网络是用不同的网段


2,在这些机器中windowsxp大部分有问题,但是windows7 确实大多数没有问题的;后来判断可能是因为windows7的登录时和background的组策略的刷新方式可能不一样造成根据宋朋友的search


3,经过宋工的努力结果,可以知道下面的文章:

            Windows 服务器系统的服务概述和网络端口要求

            https://support.microsoft.com/zh-cn/kb/832017

            组策略

            为成功应用组策略,客户端必须能够通过 DCOMICMPLDAPSMB RPC 协议与域控制器联系。如果上述任一协议不可用或者在客户端和相关域控制器之间被阻止,策略将不会应用或刷新。对于跨域登录(其中计算机在一个域中,而用户帐户在另一个域中),客户端、资源域和帐户域可能需要这些协议进行通信。ICMP用来检测慢速链接。

            我们的问题就是客户在用户网络和DC中间加了防火墙,所以导致icmp DCOM RPC等失败;如果中间没有打开这个ICMP时,就会出现下面的报错:

            Failed to queryGpNetworkStartTimeoutPolicyValue with 2

            ProcessGPOs: The DC for domain ABC is notavailable after retries.

            ProcessGPOs: No WMI logging done in thispolicy cycle.

            ProcessGPOs: Processing failed with error1355.

            直接放弃了计算机策略的执行,而进入用户的界面,同时用户策略也会执行失败;那么在用户进入了系统之后获得了另外的一个网段,然后通过background的刷新方式获得了策略,但是windowsxp不行


4,对于这个问题的另外workaround是,修改GpNetworkStartTimeoutPolicyValue60S


5. 在处理计算机策略的结果时,最好抓取一个netmon 日志,要做端口镜像,因为通过这个日志可以看到计算机在启动过程中和DC的交互过程。

 

如果有什么不对的地方请指正

谢谢

 


你可能感兴趣的:(windows,group,policy,logon,userenv)