Management Mechanisms

Slides:



Advertisements
Similar presentations
计算机系 信息处理实验室 Lecture 5 Startup and Shutdown
Advertisements

1 Module 7 Configuring the Windows NT Environment.
MCITP Guide to Microsoft Windows Server 2008 Server Administration (Exam #70-646) Chapter 3 Configuring the Windows Server 2008 Environment.
Lesson 17: Configuring Security Policies
2.1 © 2004 Pearson Education, Inc. Exam Managing and Maintaining a Microsoft® Windows® Server 2003 Environment Lesson 2: Installing Windows Server.
Hands-On Microsoft Windows Server 2003 Administration Chapter 10 Monitoring and Troubleshooting Windows Server 2003.
11.1 © 2004 Pearson Education, Inc. Exam Planning, Implementing, and Maintaining a Microsoft Windows Server 2003 Active Directory Infrastructure.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment Chapter 12: Managing and Implementing Backups and Disaster Recovery.
MCDST : Supporting Users and Troubleshooting a Microsoft Windows XP Operating System Chapter 5: User Environment and Multiple Languages.
Chapter 10 Chapter 10: Managing the Distributed File System, Disk Quotas, and Software Installation.
Module 2: Planning to Install SQL Server. Overview Hardware Installation Considerations SQL Server 2000 Editions Software Installation Considerations.
Operating System & Application Files BACS 371 Computer Forensics.
1 Chapter Overview Creating User and Computer Objects Maintaining User Accounts Creating User Profiles.
11 SYSTEMS ADMINISTRATION AND TERMINAL SERVICES Chapter 12.
CN1176 Computer Support Kemtis Kunanuraksapong MSIS with Distinction MCT, MCTS, MCDST, MCP, A+
OS and Application Files BACS 371 Computer Forensics.
1 Chapter Overview Monitoring Server Performance Monitoring Shared Resources Microsoft Windows 2000 Auditing.
Ch 11 Managing System Reliability and Availability 1.
Chapter 5 File and Printer Services
Users and Groups Security Architecture Editing Security Policies The Registry File Security Auditing/Logging Network Issues (client firewall, IPSec, Active.
Microsoft Windows 2003 Server. Client/Server Environment Many client computers connect to a server.
Administering Windows 7 Lesson 11. Objectives Troubleshoot Windows 7 Use remote access technologies Troubleshoot installation and startup issues Understand.
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner.
1 Microsoft Windows Internals, 4 ed Chapter 4. Management Mechanisms The Registry 謝承璋 2008 年 05 月 07 日.
Ch 11. Services A service is a specialized program that performs a function to support other programs Many services operate at a very low level – Interacting.
Chapter Fourteen Windows XP Professional Fault Tolerance.
A+ Guide to Software Managing, Maintaining and Troubleshooting THIRD EDITION Chapter 8 Managing and Supporting Windows XP.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment, Enhanced Chapter 12: Managing and Implementing Backups and Disaster Recovery.
© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 1 Third Edition Chapter 5 Windows XP Professional McGraw-Hill.
5 Chapter Five Web Servers. 5 Chapter Objectives Learn about the Microsoft Personal Web Server Software Learn how to improve Web site performance Learn.
计算机系 信息处理实验室 Lecture 6 Management Mechanisms
Chapter 13 Users, Groups Profiles and Policies. Learning Objectives Understand Windows XP Professional user accounts Understand the different types of.
A+ Guide to Managing and Maintaining Your PC Fifth Edition Chapter 13 Understanding and Installing Windows 2000 and Windows NT.
Windows Vista Inside Out Chapter 24 – Recovering From an Computer Crash Last modified am.
1 Windows 98 Ancillary Systems x The Process Scheduler provides system resources. The Windows Driver Model (WDM) allows Windows 98 and Microsoft Windows.
Supporting Windows 9x Chapter 12 Key Terms By Bill Ward.
Chapter 10 Chapter 10: Managing the Distributed File System, Disk Quotas, and Software Installation.
Chapter Thirteen Booting Windows XP. Objectives Understand the Windows XP boot process Understand the Windows XP boot process Troubleshoot system restoration.
Managing Services and Registry Chapter 16 powered by dj.
NetTech Solutions Security and Security Permissions Lesson Nine.
4P13 Week 12 Talking Points Device Drivers 1.Auto-configuration and initialization routines 2.Routines for servicing I/O requests (the top half)
© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 1 Third Edition Chapter 7 Under the Windows Desktop McGraw-Hill.
Windows Internals 4th Chapter 4 (continued) Team 6 Service ~ Startup Errors 洪健惟 Accepting the Boot and Last Known Good ~ Service Control Program.
© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 1 Third Edition Chapter 7 Under the Windows Desktop McGraw-Hill.
Troubleshooting Windows Vista Lesson 11. Skills Matrix Technology SkillObjective DomainObjective # Troubleshooting Installation and Startup Issues Troubleshoot.
Pasewark & Pasewark 1 Windows Vista Lesson 1 Windows Vista Basics Microsoft Office 2007: Introductory.
NT1110 Computer Structure and Logic Unit 8 (Module 5A) COMPUTER OPERATION AND SECURITY.
Chapter Overview Understanding Windows Name Resolution Using WINS.
Chapter Objectives In this chapter, you will learn:
Running a Forms Developer Application
Getting Started with Application Software
Chapter 2: Computer-System Structures(Hardware)
Chapter 2: Computer-System Structures
Chapter Objectives In this chapter, you will learn:
Processes and threads.
MCTS Guide to Microsoft Windows 7
Chapter 2: System Structures
Introduction to Operating System (OS)
Files Used in the Boot Process
Under the Windows Desktop
Senior Software Engineering Student Robertas Sys
CONFIGURING HARDWARE DEVICE & START UP PROCESS
Windows Internals Brown-Bag Seminar Chapter 1 – Concepts and Tools
Windows Registry: Introduction
Chapter 2: Computer-System Structures
Chapter 2: Computer-System Structures
Mr. M. D. Jamadar Assistant Professor
Windows Operating System
How to install and manage exchange server 2010 OP Saklani.
Presentation transcript:

Management Mechanisms Registry Services

Registry Plays key role in the configuration and control of windows system Repository of system wide and per-user setting Static data stored in HDD, also various memory structures

Basic Uses of Registry During the boot process, the system reads settings that specify what device drivers to load and how various subsystems—such as the memory manager and process manager— configure themselves and tune system behavior. During login, Explorer and other Windows components read per-user preferences from the registry, including network drive-letter mappings, desktop wallpaper, screen saver, menu behavior, and icon placement. During their startup, applications read system wide settings, such as a list of optionally installed components and licensing data, as well as per-user settings that might include menu and toolbar placement and a list of most-recently accessed documents. some sharewares expire after 30 days can be used again after cleaning registry !!!! Sadly, some applications poll the registry looking for changes when they should be using the registry's RegNotifyChangeKey function, which puts a thread to sleep until a change occurs to the area of the registry in which they're interested.

Registry Data Types Similar structure as of disk volume Key and value pair 15 data types Majority registry values are in REG_DWORD (numbers or Booleans) REG_BINARY (numbers larger than 32 bits or raw data such as encrypted passwords ) REG_SZ ( Unicode strings that can represent elements such as names, filenames, paths, and types. ). REG_LINK (lets a key transparently point to another key or value )

Registry Data Types

Registry Logical Structure *HKEY stands for handle (H) to the key (KEY)

HKEY_CURRENT_USER It is mapped from \Documents and Settings\<username>\Ntuser.dat

HKEY_USER Sub key for each loaded user profile and user class registration database on system .DEFAULT profile Experiment loading and unloading user profiles using runas command >runas /profile /user:<machine_name>\<user_name>

HKEY_CLASSES_ROOT Consist of two types of information: File extension association COM class registration The data under HKEY_CLASSES_ROOT comes from two sources: The per-user class registration data in HKCU\SOFTWARE\Classes (mapped to the file on hard disk \Documents and Settings\<username>\Local Settings\Application Data\Microsoft\Windows\Usrclass.dat) Systemwide class registration data in HKLM\SOFTWARE\Classes Reasons of separation: Roaming profile Closes security hole of privilege.

HKEY_LOCAL_MACHINE The HKLM\HARDWARE subkey maintains descriptions of the system's hardware and all hardware device-to-driver mappings. HKLM\SAM holds local account and group information, such as user passwords, group definitions, and domain associations. HKLM\SECURITY stores systemwide security policies and user-rights assignments. HKLM\SAM is linked into the SECURITY subkey under HKLM\SECURITY\SAM. By default, you can't view the contents of HKLM\SECURITY or HKLM\SAM\SAM because the security settings of those keys allow access only by the system account. HKLM\SOFTWARE is where Windows stores systemwide configuration information not needed to boot the system. Also, third-party applications store their systemwide settings here, such as paths to application files and directories, and licensing and expiration date information. HKLM\SYSTEM contains the systemwide configuration information needed to boot the system, such as which device drivers to load and which services to start. Because this information is critical to starting the system, Windows also maintains a copy of part of this information, called the last known good control set, under this key.

EXPERIMENT: Fun with the Hardware Key You can fool your coworkers or friends into thinking that you have the latest and greatest processor by modifying the value of the ProcessorNameString value under HKLM\HARDWARE\DESCRIPTION\System\CentralProcessor\0.

HKEY_CURRENT_CONFIG HKEY_CURRENT_CONFIG is just a link to the current hardware profile. Hardware profiles allow the administrator to configure variations to the base system driver settings. Although the underlying profile might change from boot to boot, applications can always reference the currently active profile through this key. Hardware profile management is managed through the Hardware Profiles dialog box that you access by clicking Settings in the Hardware Profiles section on the Hardware page of the Control Panel's System applet. During the boot process, Ntldr will prompt you to specify which profile it should use if there is more than one.

HKEY_PERFORMANCE_DATA The registry performance counter information can be accessed directly by opening a special key named HKEY_PERFORMANCE_DATA and querying values beneath it. You won't find this key by looking in the Registry Editor; this key is available only programmatically through the Windows registry functions, such as RegQueryValueEx. the registry functions use this key to locate the information from performance data providers. Performance Data Helper (PDH) functions available are through the Performance Data Helper API (Pdh.dll).

Troubleshooting Registry Problems using Regmon

Registry internals Hives Size limits for hives (paged pool) Experiment: manually loading and unloading hives Experiment: looking at hives handle using Process Explorer

On-Disk Files Corresponding to Paths in the Registry

Registry Optimizations ASCII-Unicode translation Minimizing memory usage by not storing full key registry pathnames Frequently used blocked in cache block as hash table Closed blocks at second level in cache

Services Processes that start at System startup time and provide services not tied to an interactive user. Rely on Windows API to interact with the system Ex. Web server

Windows Services Components Service application Windows executables with additional code to communicate with SCM. Service control program (SCP) Used by users to start, stop or configure a service Service control manager (SCM) Communicates commands to services and manages the services database

Service Applications… Application that includes a service, registers it with the system, during setup using Windows CreateService function, implemented in Advapi32.dll CreateService sends a message to the SCM on the machine where the service will reside. SCM creates a registry key for the service under HKLM\SYSTEM\CurrentControlSet\Services Services key is the nonvolatile representation of the SCM’s database Individual keys for each service define path of the executable image that contains the service with all its parameters and config options After creation, an installation or management application can start the service using StartService function When service is registered as autostart, the program requires the user to reboot the system and then let SCM start the service as system boots.

CreateService parameters Service Type – whether runs in its own process or shares a process ImagePath – location of its executable image file Display name (optional) Account name and password (optional) – to start in a particular account’s security context Start type – whether it starts automatically, when system boots or under the direction of SCP Error code – to indicate how the system should react if the service detects error when starting Other optional information (like dependencies) if the service starts automatically SCM stores each of these as a value in the service’s registery key.

Steps for starting a service SCM starts the service process The process immediately invokes the StartServiceCtrlDispatcher function StartServiceCtrlDispatcher accepts a list of entry points into services, one for each service in the process (remember.. services can share a process) Makes a named-pipe communications connection to SCM once and then sits in loop, waiting for commands to come through this pipe. For each start command received, it creates a service thread to invoke service’s entry point and implements the command loop for the service. Waits indefinitely for commands from SCM Returns control to main function only when all process’s services have stopped, allowing the service process to clean up resources before exiting.

Inside a Service process StartServiceCtrlDispatcher launches service thread Service thread registers control handler. StartServiceCtrlDispacher calls handlers in response to SCM commands. Service thread processes client requests.

Service Control Manager Executable file is \Windows\System32\Services.exe Runs as a Windows console program Started by Winlogon process, early during the system boot. Its startup function SvcCtrlMain monitors launching of autostart services Executes shortly after the screen switches to a blank desktop.

SCM working…. SvcCtrlMain creates a synchronization event named SvcCtrlEvent_A3752DX, as nonsignaled. Goes in signaled state only after SCM completes the necessary steps before taking commands from SCP. SCP uses a function OpenSCManager to establish dialog with SCM and it prevents SCP from contacting SCM by waiting for the SvcCtrlEvent_A3752DX to become signaled. Next, SvcCtrlMain calls ScCreateServiceDB, function that builds SCM’s internal service database. This function, reads and stores the contents of HKLM\SYSTEM\CurrentControlSet\Control\ServiceGroupOrder\List. Scans the contents of HKLM\SYSTEM\CurrentControlSet\Services, creates an entry for each key encountered. A database entry includes all the service-related parameters and the fields that track service status.

Service Database

SCM working… SvcCtrlMain then calls ScGetBootAndSystemDriverState to look for boot-start and system-start device driver entries in the database. This determines whether or not a driver successfully started by looking up its name in the object manager namespace directory named \Driver. (entered by IO manager on successful load) SvcCtrlMain maintains a list of failed drivers in a list named ScFailedDrivers. SCM then creates its RPC named pipe, named \Pipe\Ntsvcs which launches a thread to listen on the pipe for incoming messages from SCPs. Finally signals its initialization-complete event, SvcCtrlEvent_A3752DX.

…SCM working Service startup Startup Errors ScAutoStartServices Algorithm proceeds in phases (phase = group) and phases proceed in the sequence defined in group ordering. Circular dependencies Logon account checks Launch the service process in suspended state, create communication pipe, resume process and wait for the service to connect through StartServiceCtrlDispatcher Startup Errors IGNORE, NORMAL, SEVERE, CRITICAL Accepting the Boot and Last known Good On successful startup of autostart services or receipt of message from NotifyBootConfigStatus (invoked by Winlogon) SCM calls the system function NtInitializeRegistry to save current regisrty startup config. Service Failures Service shutdown Shared Service processes

Service Control Programs Standard Windows applications that use XSCM service management functions Ex. CreateService, OpenService, StartService, QueryServiceStatus etc. First opens a communication channel to SCM by calling OpenSCManager function Must specify what types of actions to perform, at the time of open call. Depending on the permissions set, the security descriptor that protects the internal object representing SCM database then determines if the SCP request can be granted. SCM implements security even for services and the security descriptor for these is specified by the SCP when it creates a service using CreateService function. Just like OpenSCManager, SCP must tell SCM what access it wants to a service in a call to OpenService.