CHAPTER 14 - DEBUGGING WINDOWS SERVICES

Slides:



Advertisements
Similar presentations
Lecture 10 Sharing Resources. Basics of File Sharing The core component of any server is its ability to share files. In fact, the Server service in all.
Advertisements

© Microsoft Corporation1 Windows Kernel Internals Windows Service Processes David B. Probert, Ph.D. Windows Kernel Development Microsoft Corporation.
Suite Suite Part of zTPFGI suite of products and it is VM based. Efficient and Effective management of the process of bringing up.
Lesson 17: Configuring Security Policies
CSCD 303 Essential Computer Security Fall 2010 Lecture 4 - Desktop Security Reading:
6.1 © 2004 Pearson Education, Inc. Exam Planning, Implementing, and Maintaining a Microsoft Windows Server 2003 Active Directory Infrastructure.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Component-Based Software Engineering Introducing the Bank Example Paul Krause.
IT:Network:Applications VIRTUAL DESKTOP INFRASTRUCTURE.
Chapter 5: Configuring Users and Groups. Windows Vista User Accounts User accounts are the primary means of authentication Built-in Accounts –Administrator:
Terminal Server © N. Ganesan, Ph.D.. Reference Thin-Client Concept Thin-Client concept tutorial.
MCTS Guide to Microsoft Windows Server 2008 Network Infrastructure Configuration Chapter 7 Configuring File Services in Windows Server 2008.
11 WORKING WITH COMPUTER ACCOUNTS Chapter 8. Chapter 8: WORKING WITH COMPUTER ACCOUNTS2 CHAPTER OVERVIEW Describe the process of adding a computer to.
Corso referenti S.I.R.A. – Modulo 2 Local Security 20/11 – 27/11 – 05/12 11/12 – 13/12 (gruppo 1) 12/12 – 15/12 (gruppo 2) Cristiano Gentili, Massimiliano.
Delivering Excellence in Software Engineering ® EPAM Systems. All rights reserved. ASP.NET Authentication.
Working with Workgroups and Domains
Copyright © 2007, SAS Institute Inc. All rights reserved. SAS Activity-Based Management Survey Kit (ASK): User Management & Security.
WINDOWS SERVICES. Introduction You often need programs that run continuously in the background Examples: – servers –Print spooler You often need.
1 Group Account Administration Introduction to Groups Planning a Group Strategy Creating Groups Understanding Default Groups Groups for Administrators.
Remote Desktop Services Remote Desktop Connection Remote Desktop Protocol Remote Assistance Remote Server Administration T0ols.
1 Chapter Client-Server Interaction. 2 Functionality  Transport layer and layers below  Basic communication  Reliability  Application layer.
6.1 © 2004 Pearson Education, Inc. Exam Managing and Maintaining a Microsoft® Windows® Server 2003 Environment Lesson 6: Administering User Accounts.
User Manager for Domains.  Manages the user accounts in a domain  It is located in the PDC  While User Manager exists in each NT machine, but it is.
5.1 © 2004 Pearson Education, Inc. Lesson 5: Administering User Accounts Exam Microsoft® Windows® 2000 Directory Services Infrastructure Goals 
VTP VLAN Trunking Protocol
VNC Greg Fankhanel Jessica Nunn Jennifer Romero. What is it? Stands for Virtual Network Computing It is remote control software which allows you to view.
CSAS 2009 Running Windows as a Non- Administrator or how I learned to love “User” By: Kasey Dennler.
DIT314 ~ Client Operating System & Administration CHAPTER 5 MANAGING USER ACCOUNTS AND GROUPS Prepared By : Suraya Alias.
1 Chapter Overview Configuring Account Policies Configuring User Rights Configuring Security Options Configuring Internet Options.
Windows NT Chapter 13 Key Terms By Bill Ward NT Versions NT Workstation n A desktop PC that both accesses a network and works as a stand alone PC NT.
ITN Wake Tech1 ITN270 Advanced Internet Databases Lecture 15. General MySQL Administration Topics: –Securing a New MySQL Installation –MySQL Server.
Module 4 : Installation Jong S. Bok
SECURITY ISSUES. Introduction The.NET Framework includes a comprehensive set of security tools –Low-level classes and an overall framework –Managing code.
VTP VLAN Trunking Protocol Create once and send to the other switches.
CS795.Net Impersonation… why & How? Presented by: Vijay Reddy Mara.
Working with Users and Groups Lesson 5. Skills Matrix Technology SkillObjective DomainObjective # Introducing User Account Control Configure and troubleshoot.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 The SqlConnection Object ADO.NET - Lesson 02  Training time: 10 minutes 
GUDURU PRAVEEN REDDY.NET IMPERSONATION. Contents Introduction Impersonation Enabled Impersonation Disabled Impersonation Class Libraries Impersonation.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
MA194Using WindowsNT1 Topics for the day… WindowsNT Security WindowsNT File System (NTFS) Viewing/Setting Document and Folder Permissions Access Control.
Configuring and Troubleshooting Identity and Access Solutions with Windows Server® 2008 Active Directory®
Working with Users and Groups Lesson 5. Skills Matrix Technology SkillObjective DomainObjective # Introducing User Account Control Configure and troubleshoot.
CHAPTER 5 MANAGING USER ACCOUNTS & GROUPS. User Accounts Windows 95, 98 & Me do not need a user account like Windows XP Professional to access computer.
Understand Windows Services Software Development Fundamentals LESSON 5.3.
Windows Internals 4th Chapter 4 (continued) Team 6 Service ~ Startup Errors 洪健惟 Accepting the Boot and Last Known Good ~ Service Control Program.
Windows NT ® Security Management: Extending Windows NT 5.0 Security Management Tools, Part 2 Praerit Garg Program Manager Windows NT Security Microsoft.
Lecture 5 Rootkits Hoglund/Butler (Chapters 1-3).
Settings MySQL Database and JDBC configuration Instructor: Sergey Goldman.
Monitoring Dynamic IOC Installations Using the alive Record Dohn Arms Beamline Controls & Data Acquisition Group Advanced Photon Source.
Chapter 13 FTP and Telnet Cisco Learning Institute Network+ Fundamentals and Certification Copyright ©2005 by Pearson Education, Inc. Upper Saddle River,
19 Copyright © 2008, Oracle. All rights reserved. Security.
The Distributed Application Debugger (DAD)
DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S
Module 9: Preparing to Administer a Server
Do-more Technical Training
What are they? The Package Repository Client is a set of Tcl scripts that are capable of locating, downloading, and installing packages for both Tcl and.
Chapter 2: Operating-System Structures
Chapter 3 Internet Applications and Network Programming
ACTIVE DIRECTORY ADMINISTRATION
Module 4 Remote Login.
Chapter 2: System Structures
Senior Software Engineering Student Robertas Sys
HP C/C++ Remote developer plug-in for Eclipse
Figure 6-9: Managing Users and Groups
Threads Chapter 4.
SharePoint Online Authentication Patterns
Windows Service Applications
Chapter 2: Operating-System Structures
Module 9: Preparing to Administer a Server
Designing IIS Security (IIS – Internet Information Service)
Presentation transcript:

CHAPTER 14 - DEBUGGING WINDOWS SERVICES Service Basics Creating Windows Services – The API User Accounts Debugging Windows Services – Debugging the Core Code Debugging the Basic Service

Service Basics SCM (Service Control Manager) Maintains a database of installed services. RPC Server. Can be remotely accessed. Transmits control requests to running services. Starting Services at System Startup (or on user-demand). Maintains Status Info for running services.

Service Basics The Following Programs use the functions provided by the SCM – Service Program Executable code for a service. Service Configuration Program Install / Delete services. Modify configurations / Security Settings. Service Control Program Starts , Controls services by requesting the SCM.

Creating Windows Services – The API Writing Service Program’s Main() Can use main() or WinMain(). First call the StartServiceCtrlDispatcher. Pass a SERVICE_TABLE_ENTRY structure. This structure indicates the name and main entry point for you service. StartServiceCtrlDispatcher talks to SCM to start your service. SCM starts Control Dispatcher thread.

Creating Windows Services – The API Writing the ServiceMain() Control Dispatcher thread calls into your ServiceMain(). This entry point must register a handle SERVICE_STATUS_HANDLE with RegisterServiceCtrlHandlerEx(). It must then call SetServiceStatus() to communicate to the SCM, its status (starting, stopping, pausing).

Creating Windows Services – The API So what ??

Creating Windows Services – The API Your Service Program’s main() must call the StartServiceCtrlDispatcher within 30 seconds of starting. Your ServiceMain() must call SetServiceStatus within 82 seconds of starting. Else the SCM will terminate your service.

Creating Windows Service – User Account Every Service has an associated account. (Default = LocalService account). When a Service starts, the SCM logs on to the account. The System produces an access tokens and attaches it to the service process. The system compares the service’s access token to a securable object’s Security Descriptor before granting access.

Creating Windows Service – User Account Alternative for User Accounts – LocalService Anonymous Network Access (no password required) SE_AUDIT_NAME SE_CHANGE_NOTIFY_NAME SE_UNDOCK_NAME NetworkService Credentials Supplied to Remote Servers

Creating Windows Service – User Account Alternative for User Accounts – LocalSystem Account SE_ASSIGNPRIMARYTOKEN_NAME, SE_AUDIT_NAME SE_BACKUP_NAME, SE_CHANGE_NOTIFY_NAME SE_CREATE_PAGEFILE_NAME, SE_CREATE_PERMANENT_NAME SE_DEBUG_NAME, SE_INC_BASE_PRIORITY_NAME SE_INCREASE_QUOTA_NAME, SE_LOAD_DRIVER_NAME SE_CREATE_TOKEN_NAME, SE_LOCK_MEMORY_NAME SE_PROF_SINGLE_PROCESS_NAME, SE_RESTORE_NAME SE_SECURITY_NAME, SE_SHUTDOWN_NAME SE_SYSTEM_ENVIRONMENT_NAME, SE_TCB_NAME SE_SYSTEMTIME_NAME, SE_SYSTEM_PROFILE_NAME, SE_TAKE_OWNERSHIP_NAME , SE_UNDOCK_NAME

Debugging – The Core Code Ensure that – Service core code is on the same machine. Client code is also on the same machine. Log in using your developer account. Hence you do not have to worry about nasty security or network issues while debugging your logic. These pleasures are reserved for later !

Debugging – The Service Step 1 – Allow Service to interact with Desktop

Debugging – The Service Step 2 – Set your Service Identity Set you service to start under an administrator privilege to avoid security problems.

Debugging – The Service Step 3 – Attach to your Service

Debugging – The Service Step 3 – Attach to your Service

Debugging – The Service Alternative Method – (Attach to your Service) Key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\YOUR SERVICE Value: Full path of the Debugger (REG_SZ)

Debugging – The Service Yet Another Method – (Attach to your Service) DebugBreakProcess() – Generates breakpoint exception in specified process. Invokes the debugger for just-in-time debugging.

Debugging – The Service A Reminder……… Your Service Program’s main() must call the StartServiceCtrlDispatcher within 30 seconds of starting. Your ServiceMain() must call SetServiceStatus within 82 seconds of starting. Else the SCM will terminate your service

Debugging – The Service Solutions – Use DebugView. Change SCM timeout limit typedef struct _SERVICE_STATUS { DWORD dwServiceType; DWORD dwCurrentState; DWORD dwControlsAccepted; DWORD dwWin32ExitCode; DWORD dwServiceSpecificExitCode; DWORD dwCheckPoint; SET TO ZERO DWORD dwWaitHint; INCREMENT } SERVICE_STATUS, *LPSERVICE_STATUS;