Token Kidnapping's Revenge Cesar Cerrudo Argeniss.

Slides:



Advertisements
Similar presentations
Windows Vista Security model and vulnerabilities.
Advertisements

Token Kidnapping's Revenge Cesar Cerrudo Argeniss.
Microsoft ASP.NET Security Venkat Chilakala Support Professional Microsoft Corporation.
27. to 28. March 2007 | Geneva, Switzerland. Fabrice Romelard ilem SA Level 200.
Introduction To Windows NT ® Server And Internet Information Server.
ASP.NET 2.0 Chapter 6 Securing the ASP.NET Application.
Jonas Thomsen, Ph.d. student Computer Science University of Aarhus Best Practices and Techniques for Building Secure Microsoft.
VMware vCenter Server Module 4.
Cracking Windows Access Control Andrey Kolishchak Hack.lu 2007.
Virtual techdays INDIA │ august 2010 IIS 7/7.5 Tips & Tricks Jaskirat Singh │ Technical Lead [IIS|Asp.Net team], Microsoft.
Delivering Excellence in Software Engineering ® EPAM Systems. All rights reserved. ASP.NET Authentication.
1 ASP.NET SECURITY Presenter: Van Nguyen. 2 Introduction Security is an integral part of any Web-based application. Understanding ASP.NET security will.
Edwin Sarmiento Microsoft MVP – Windows Server System Senior Systems Engineer/Database Administrator Fujitsu Asia Pte Ltd
Introduction to Application Penetration Testing
1 Infrastructure Hardening. 2 Objectives Why hardening infrastructure is important? Hardening Operating Systems, Network and Applications.
Deployment of web Site. Preparing the web site for deployment you now have two versions of web site 1 -one running in the production environment 2-one.

Introduction to SQL Server 2000 Security Dave Watts CTO, Fig Leaf Software
Hands-On Microsoft Windows Server 2008 Chapter 1 Introduction to Windows Server 2008.
Module 10: Configuring Windows XP Professional to Operate in Microsoft Networks.
CN1260 Client Operating System Kemtis Kunanuraksapong MSIS with Distinction MCT, MCITP, MCTS, MCDST, MCP, A+
CSAS 2009 Running Windows as a Non- Administrator or how I learned to love “User” By: Kasey Dennler.
CN1176 Computer Support Kemtis Kunanuraksapong MSIS with Distinction MCT, MCTS, MCDST, MCP, A+
1 © 2004, Cisco Systems, Inc. All rights reserved. CISCO CONFIDENTIAL Using Internet Explorer 7.0 to Access Cisco Unity 5.0(1) Web Interfaces Unity 5.0(1)
1 Web services and security ---discuss different ways to enforce security Presenter: Han, Xue.
Computer Security and Penetration Testing Chapter 16 Windows Vulnerabilities.
Module 9 Authenticating and Authorizing Users. Module Overview Authenticating Connections to SQL Server Authorizing Logins to Access Databases Authorization.
Microsoft SharePoint Server 2010 for the Microsoft ASP.NET Developer Yaroslav Pentsarskyy
Securing ColdFusion and IIS David T Watts, CTO, Fig Leaf Software 28 July 2001.
1 © 2004, Cisco Systems, Inc. All rights reserved. CISCO CONFIDENTIAL Support for Vista Unity 5.0(1)
SharePoint Security Fundamentals Introduction to Claims-based Security Configuring Claims-based Security Development Opportunities.
Top Five Web Application Vulnerabilities Vebjørn Moen Selmersenteret/NoWires.org Norsk Kryptoseminar Trondheim
Effective Security in ASP.Net Applications Jatin Sharma: Summer 2005.
Briefing for: Hacking Windows Internals Cesar Cerrudo Argeniss.
APPLICATION PENETRATION TESTING Author: Herbert H. Thompson Presentation by: Nancy Cohen.
NT SECURITY Introduction Security features of an operating system revolve around the principles of “Availability,” “Integrity,” and Confidentiality. For.
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.
Copyright © 2006 Pilothouse Consulting Inc. All rights reserved. Impersonation in SharePoint Developers use impersonation when an application needs to.
GUDURU PRAVEEN REDDY.NET IMPERSONATION. Contents Introduction Impersonation Enabled Impersonation Disabled Impersonation Class Libraries Impersonation.
Module 8 : Configuration II Jong S. Bok
Principles of Computer Security: CompTIA Security + ® and Beyond, Third Edition © 2012 Principles of Computer Security: CompTIA Security+ ® and Beyond,
Module 5 : Security I Jong S. Bok
Security Vulnerabilities in A Virtual Environment
Impersonation Bharat Kadia CS-795. What is Impersonation ? Dictionary-: To assume the character or appearance of someone ASP.NET-: Impersonation is the.
Security E-Learning Chapter 08. Security Control access to your web site –3 Techinques for Identifying users Giving users access to your site Securing.
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP.
Computer Security By Duncan Hall.
Privilege Escalation Two case studies. Privilege Escalation To better understand how privilege escalation can work, we will look at two relatively recent.
Internet Information Server 6.0 & new management features.
Secure Data Access with SQL Server 2005 Doug Rees Associate Technologist, CM Group
ASP.NET 2.0 Security Alex Mackman CM Group Ltd
Vulnerabilities in Operating Systems Michael Gaydeski COSC December 2008.
1 BCS 4 th Semester. Step 1: Download SQL Server 2005 Express Edition Version Feature SQL Server 2005 Express Edition SP1 SQL Server 2005 Express Edition.
COMPUTER SECURITY Ashesi University College Benson Wachira Julateh Mulbah.
Securing a Host Computer BY STEPHEN GOSNER. Definition of a Host  Host  In networking, a host is any device that has an IP address.  Hosts include.
NETWORK SECURITY LAB 1170 REHAB ALFALLAJ CT1406. Introduction There are a number of technologies that exist for the sole purpose of ensuring that the.
Microsoft OS Vulnerabilities April 1, 2010 MIS 4600 – MBA © Abdou Illia.
Jean-Philippe Baud, IT-GD, CERN November 2007
Manuel Brugnoli, Elisa Heymann UAB
Penetration Test Debrief
Introduction to SQL Server 2000 Security
Microsoft’s Security Strategy
Introduction to .net Impersonation
Lecture 2 - SQL Injection
Operating System Security
Chapter 7 – and 8 pp 155 – 202 of Web security by Lincoln D. Stein
NAVIGATING THE MINEFIELD
Designing IIS Security (IIS – Internet Information Service)
Mark Quirk Head of Technology Developer & Platform Group
Presentation transcript:

Token Kidnapping's Revenge Cesar Cerrudo Argeniss

Who am I? Argeniss Founder and CEO I have been working on security for +8 years I have found and helped to fix hundreds of vulnerabilities in software such as MS Windows, MS SQL Server, Oracle Database Server, IBM DB2, and many more vulnerabilities found on MS products (+20 on Windows operating systems) I have researched and created novel attacks and exploitation techniques

Agenda Introduction What is impersonation and what are tokens? Windows XP and 2003 services security Windows 7, Vista and 2008 services security Token Kidnapping's revenge time Threats scenarios Recommendations Fixes Conclusions

Introduction In the past all Windows services ran as Local SYSTEM account – Compromise of a service==full system compromise Then MS introduced NETWORK SERVICE and LOCAL SERVICE accounts – Compromise of a service!=full system compromise Windows Vista, Windows 2008 and Windows 7 introduced new protections First Token Kidnapping issues were fixed, but as we are going to see Windows is still not perfect...

What is impersonation and what are tokens? Impersonation is the ability of a thread to execute using different security information than the process that owns the thread – ACL checks are done against the impersonated users – Impersonation APIs: ImpersonateNamedPipeClient(), ImpersonateLoggedOnUser(), RpcImpersonateClient() – Impersonation can only be done by processes with “Impersonate a client after authentication” (SeImpersonatePrivilege) – When a thread impersonates it has an associated impersonation token

What is impersonation and what are tokens? Access token is a Windows object that describes the security context of a process or thread – It includes the identity and privileges of the user account associated with the process or thread – They can be Primary or Impersonation tokens Primary are those that are assigned to processes Impersonation are those that can be get when impersonation occurs – Four impersonation levels: SecurityAnonymous, SecurityIdentity, SecurityImpersonation, SecurityDelegation

Windows XP and 2003 services security Services run under Network Service, Local Service, Local System and user accounts – All services can impersonate Fixed weaknesses – A process running under X account could access processes running under the same X account After fixes – RPCSS and a few services that impersonate SYSTEM account are now properly protected – WMI processes are protected now

Windows Vista, 2008 and 7 services security Per service SID (new protection) – Nice feature, now service processes are really protected, unique SID assigned to process ACL Fixed weaknesses in Windows Vista and 2008 – While regular threads were properly protected, threads from thread pools were not – WMI processes running under LOCAL SERVICE and NETWORK SERVICE were not protected After fixes – Threads from thread pools are properly protected – WMI processes are protected now

Token Kidnapping's revenge time Demo

Token Kidnapping's revenge time First I found on Windows 7 that TAPI service had process handles with duplicate handle permissions Then I started to examine the TAPI service – Found weak registry permissions HKLM\SOFTWARE\Microsoft\Tracing HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Te lephony – Found lineAddProvider() API, Network Service and Local Service accounts can load arbitrary dlls inside TAPI service TAPI service runs as System in Windows 2003

Token Kidnapping's revenge time Previous findings lead to other interesting findings in Windows 2003 – When WMI is invoked, DCOMLaunch service reads Network and Local Service users registry keys If values are found then HKCR keys are not used Allows WMI process protection bypass Finally I could elevate privileges from Local/Network Service in all Windows versions and bypass protections

Token Kidnapping's revenge time Windows 2003 IIS 6 exploit – Bypass WMI protection Windows 2003 IIS 6 and Windows 2008 IIS 7 exploit – Exploits lineAddProvider() API issue Windows 2008 and Windows 7 IIS 7.5 exploit – Exploits weak registry permissions

Threat scenarios Web hosting running IIS in default configuration, users with $5 can fully compromise the server. In-company developers that can upload ASP.NET web pages, they can fully compromise the server and from there the network SQL Server administrators (that aren't Windows administrators) can fully compromise the server Post exploitation, exploiting a less privileged service and then elevating privileges to SYSTEM

Recommendations – On IIS don't run ASP.NET in full trust and don't run web sites under Network Service or Local Service accounts – Avoid running services under Network Service or Local Service accounts Use regular user accounts to run services Remove permissions to Users group from HKLM\Software\Microsoft\Tracing registry key Disable Telephony service

Fixes – On August Microsoft released a fix for HKLM\Software\Microsoft\Tracing registry key permissions issue and a related elevation of privileges vulnerability. – Microsoft also releasing an advisory to address the TAPI lineAddProvider() issue, non-security fix. – WMI issue on Windows 2003 is not fixed yet.

Conclusions Windows services security model still has flaws and new protections can be bypassed Finding vulnerabilities is not difficult if you know what tools to use and were to look for On Windows XP and Windows 2003 – If a user can execute code under Network Service or Local Service account User can execute code as SYSTEM On Windows 7, Vista and 2008 – If a user can impersonate User can execute code as SYSTEM

References Token Kidnapping Impersonate a client after authentication Access tokens Process Explorer and Process Monitor API Impersonation Functions us/library/cc246062(PROT.10).aspx

Fin Questions? Thanks Contact: cesar>at dot<com Argeniss WE BREAK ANYTHING