Windows network services for Samba folks



Similar documents
Windows network services internals HiverCon 2003

MSRPC NULL sessions. Exploitation and protection. Jean-Baptiste Marchand

Active Directory network protocols and traffic

Active Directory network protocols and traffic

Fingerprinting Through RPC

Web. Security Options Comparison

<Samba status report>

Windows Server 2008/2012 Server Hardening

Solaris CIFS Service CIFS. Alan Wright

Integrating LANGuardian with Active Directory

Windows servers. NT networks

Contents. Supported Platforms. Event Viewer. User Identification Using the Domain Controller Security Log. SonicOS

Univention Corporate Server. Operation of a Samba domain based on Windows NT domain services

Security Options... 1

How To - Implement Clientless Single Sign On Authentication with Active Directory

Configuring Security Features of Session Recording

Default configuration for the Workstation service and the Server service

Nessus scanning on Windows Domain

Hands-On Ethical Hacking and Network Defense Second Edition Chapter 8 Desktop and Server OS Vulnerabilities

REMOTE ADMINISTRATION TOOLS: A COMPARATIVE STUDY

OV Operations for Windows 7.x

Samba and Vista with IPv6

Computer Security: Principles and Practice

EMC VNX Series. Configuring and Managing CIFS on VNX. Version VNX1, VNX2 P/N REV. 03

How To - Implement Clientless Single Sign On Authentication in Single Active Directory Domain Controller Environment

About Microsoft Windows Server 2003

Microsoft Auditing Events for Windows 2000/2003 Active Directory. By Ed Ziots Version 1.6 9/20/2005

Kepware Technologies Remote OPC DA Quick Start Guide (DCOM)

Windows Assessment. Vulnerability Assessment Course

Charles Firth Managing Macs in a Windows World

Chapter 15 Windows Operating Systems

Windows Server 2003 default services

SMB a protocol example

Integration with Active Directory. Jeremy Allison Samba Team

Using Logon Agent for Transparent User Identification

NETASQ SSO Agent Installation and deployment

Samba as an Active Directory Domain Controller

Communication Ports Used by Citrix Technologies. April 2011 Version 1.5

Defense Security Service Office of the Designated Approving Authority Standardization of Baseline Technical Security Configurations

Windows security for n00bs part 1 Security architecture & Access Control

Managing Celerra for the Windows Environment

RELEASE NOTES. Release Notes. Introduction. Platform. Product/version/build: Remote Control ( ) ActiveX Guest 11.

The Win32 Network Management APIs

Intel Entry Storage System SS4200-E Active Directory Implementation and Troubleshooting

Before deploying SiteAudit it is recommended to review the information below. This will ensure efficient installation and operation of SiteAudit.

Setting Up Scan to SMB on TaskALFA series MFP s.

Windows8 Internals, Sixth Edition, Part 1

Windows Security Environment

Defense Security Service Office of the Designated Approving Authority

DCOM settings for computer-to-computer communication between OPC servers and OPC clients

CROSSPOINTE AT SABLE SUITE CHERRY PALM DRIVE TAMPA, FL UNITED STATES OF AMERICA TEL: (813) FAX:

CONFIGURING ACTIVE DIRECTORY IN LIFELINE

Adjust account settings. [/FORCELOGOFF:{minutes NO}] [/MINPWLEN:length] [/MAXPWAGE:{days UNLIMITED}] [/MINPWAGE:days] [/UNIQUEPW:number] [/DOMAIN]

EMC Celerra Network Server

Exploiting Transparent User Identification Systems

SerNet. Samba Status Update. Linuxkongress Hamburg October 10, Volker Lendecke SerNet Samba Team. Network Service in a Service Network

Communication ports used by Citrix Technologies. July 2011 Version 1.5

Configuring and Managing CIFS on VNX

How To - Implement Single Sign On Authentication with Active Directory

Advanced Certificate in Networking (Microsoft) G5J9 17. Group Award Requirements

How to Configure Active Directory based User Authentication

Troubleshooting Kerberos Errors

DIGIPASS Authentication for Windows Logon Product Guide 1.1

Installation Notes for Outpost Network Security (ONS) version 3.2

ACS 5.x and later: Integration with Microsoft Active Directory Configuration Example

Using SUSE Linux Enterprise Desktop with Microsoft * Active Directory Infrastructure

TrueEdit Remote Connection Brief

Macintosh Clients and Windows Print Queues

Guide to SASL, GSSAPI & Kerberos v.6.0

User-ID Best Practices

Service Name Startup Type Log On As. ActiveX Installer (AxInstSV) Manual Local System. Adaptive Brightness Manual Local Service

Understanding MAPI. Julien Kerihuel,

Integrating Red Hat Enterprise Linux 6 with Microsoft Active Directory Presentation

WINDOWS PROCESSES AND SERVICES

Troubleshooting Citrix MetaFrame Procedures

Citrix TCP Ports Communication Ports Used By Citrix Technologies. August 2009 Version 1.0

NetIQ Advanced Authentication Framework - MacOS Client

imagepress CR Server A7000 Powered by Creo Color Server Technology For the Canon imagepress C7000VP/C6000VP/ C6000

Windows 7 Core Services: Application Experience. Application Information. Background Intelligent Transfer. Base Filtering Engine.

EMC Celerra Network Server

Oracle Database Security and Audit

Windows XP Exchange Client Installation Instructions

qliqdirect Active Directory Guide

Likewise Open Installation and Administration Guide

Field Description Example. IP address of your DNS server. It is used to resolve fully qualified domain names

Apple Technical White Paper Best Practices for Integrating OS X with Active Directory

FreeIPA 3.3 Trust features

Troubleshooting Windows monitoring 2007 Intellipool AB

How-to: Single Sign-On

Hardening IIS Servers

Getting Started Guide

ecopy ShareScan v4.3 Pre-Installation Checklist

Introduction to PsPing - a new Microsoft Windows tool for measuring network performance. Bartek Gajda gajda@man.poznan.pl

Millbeck Communications. Secure Remote Access Service. Internet VPN Access to N3. VPN Client Set Up Guide Version 6.0

Introduction to Computer Security

Windows Advanced Audit Policy Configuration

Transcription:

Windows network services for Samba folks Jean-Baptiste Marchand <jbm@hsc.fr> Hervé Schauer Consultants 1

Agenda SMB/CIFS implementation MSRPC implementation Network authentication Interesting tools References 2

SMB/CIFS architecture kernel-mode components Client-side: redirector Server-side: server (srv.sys) User-mode services rdr.sys (NT), mrxsmb.sys (W2K and >) lanmanserver and lanmanworkstation configuration of kernel-mode components 3

SMB/CIFS transport Typical SMB/CIFS transports NetBT (TCP port 139) or raw (TCP port 445) NetBios over TCP/IP driver (netbt.sys) Ports: UDP 137 and 138, TCP 139 and 445 (kernel mode) NetBT: one device per network adapter (NetBT_Tcpip_) raw SMB: unique device (NetbiosSmb) MSKB #204279 (http://support.microsoft.com/?id=204279) SmbDeviceEnabled registry value (NetBT\Parameters\) 4

TCPView TCPView (sysinternals) displays processes that owns a TCP or UDP endpoint System process: endpoints opened by a driver 5

raw SMB preferred over NetBT transport If both transports are active, the redirector resets the TCP connection to port 139 (NetBT) to port NetBT and raw SMB transport 6

Transport configuration {server,redirector} transport configuration GUI: network adapter properties server: File and Printer Sharing for Microsoft Networks redirector: Client for Microsoft networks server and redirector: Enable NetBIOS over TCP/IP CLI: net config srv, net config rdr Raw SMB redirector transport always available even with Client for Microsoft networks disabled 7

net config and nbtstat 8

Using the redirector Establishing an SMB session: use records net use command Ex: net use * \\unc_name\share (cached credentials) Ex: net use * \\192.168.1.42\myshare /u:jbm * (alternate credentials) Ex: net use \\192.168.1.42\IPC$ /u: * (null session) net use : enumerate use records in the current logon session SMB sessions are established (and reestablished) seamlessly, once a use record is active 9

net use 10

LSA credentials cache Local Security Authority credentials cache {LM,NT} hashes caching in each logon session Used by the MSV1_0 (NTLM) authentication package And by Kerberos as well, once a TGT has expired and is no longer renewable Transparent network authentication current username and password are seamlessly reused Alternate credentials can be specified with net use 11

Redirector sessions cache Sessions cache Established sessions are seamlessly used Ex: using a remote administration tool on a remote machine Any session established to the IPC$ share of the remote machine will be reused Administration trick: Establish a session with administrator credentials (using net use) to IPC$, before using remote administration tools 12

Sessions cache internals A session is uniquely identified by Server: server name Client: logon session id and network address A different server name must be used to establish multiple sessions (with different credentials) to a given server System error 1219 (The credentials supplied conflict with an existing set of credentials) Trick: using NetBIOS name, IPv4 address or fqdn DNS name to establish multiple sessions to the same server, with different credentials 13

Multiple SMB sessions 14

File server administration Administration (net command) Shares management: net share Sessions management: net sessions displays a list of established SMB sessions can disconnect any session (/delete) displays a list of accessed local resources can close any shared resource (/close) Shared resources management: net files 15

SMB session (IPC$) 16

MSRPC Microsoft implementation of DCE RPC Transport independent TCP/IP, IPX/SPX, NETBEUI,... Used in all versions of Windows NT, at all levels Typical use: NT domains, remote administration, DCOM SMB transport (Windows-specific), using named pipes as DCE RPC endpoints DCE RPC Protocol Data Units (PDUs) are sent over named pipes, using SMB commands 17

Named pipes Inter-Process Communication (IPC) mechanism Locally or over the network (using SMB) Implemented by a file system driver npfs.sys (Ex: \Device\NamedPipes\lsass) Named pipes enumeration pipelist (sysinternals.com) 18

Named pipes (Windows 2K) 19

Named pipes (Windows XP) 20

npfs aliases Named pipes aliases \pipe\lsass aliases \pipe\ntsvcs aliases: Npfs\Aliases registry value Windows NT, 2K, XP, Server 2003: \pipe\{netlogon, lsarpc, samr} Windows NT, 2K: \pipe\{srvsvc, wkssvc, eventlog, browse, msgsvc, svcctl, w32time (W2K only)} Windows XP, Server 2003: \pipe\{eventlog, svcctl} \pipe\lanman (used by RAP calls) is not a real named pipe 21

npfs aliases (NT, 2K, {XP, 2K3}) 22

DCE RPC remote management interface DCE RPC mgmt interface management interface ifids tool (Todd Sabin) interface: set of related operations Implicitly supported by any DCE RPC service Identification of named pipes used as MSRPC endpoints, using ifids ifids -p ncacn_np -e \pipe\pipe_name \\UNC_name 23

ifids: named pipes endpoints 24

MSRPC supported interfaces Multiple interfaces Inside a given process, all RPC services can be accessed using any endpoint on any transport Most Windows services (daemons) are implemented in shared processes (services.exe, svchost.exe) Consequence: ifids gives the list of all interfaces of all in-process RPC services 25

services.exe RPC services 26

Network authentication SMB sessions are typically authenticated Network authentication protocols NTLM Kerberos A network logon session is established on the remote system System threads servicing clients requests run in this logon session, with the security context of the authenticated user (impersonation token) 27

Auditing on a server Auditing policy Audit logon events (Success/Failure) Security events Logon events Windows NT: 528 (Successful Logon) Logon Type == 3 (network logon session) Interesting fields Windows 2K>: 540 (Successful Network Logon) User Name, Domain, Logon Type (3), Authentication Package, Workstation Name (NetBIOS name), Source Network Address (Windows Server 2003) 28

Security event 540 29

Auditing on a domain controller Auditing policy: Kerberos: 672-677 Audit account logon: Success/Failure Security events for domain authentications Successes: 672 (Authentication Ticket Granted), 673 (Service Ticket Granted), 674 (Ticket Granted Renewed) Failures: 675 (Pre-authentication failed), 676 (Authentication Ticket Request Failed), 677 (Service Ticket Request Failed) NTLM: 680 (Success), 681 (Failure) 30

Kerberos administration Kerberos logging Audit account logon auditing category Ticket granting and service tickets requests logging Event 672-677 (security log) Service tickets usage logging MSKB #262177 (system log) Kerberos tools Tickets management: klist, kerbtray, TktView 31

http://www.sysinternals.com/ Reference tools for advanced system administration and internals digging Maintained by Mark Russinovitch (Inside Windows 2000 author), Windows NT internals expert Tools Sysinternals tools Monitoring tools: Filemon, Regmon, Tokenmon, TDImon... Administration tools: Process Explorer, Pstools, TCPView... 32

Monitoring file systems with Filemon Filemon Can monitor all Windows file systems accesses (NTFS, NPFS (named pipes), MSFS (mailslots)) Can be used to debug many file systems related problems Ex: permissions problems Can monitor local redirector accesses 33

Filemon: example 34

Monitoring registry accesses with Regmon Regmon Can log all registry accesses at system boot Can also be used to discover undocumented registry values Ex: starting a driver or service with net start while regmon is running Sometimes, the (driver or service) Parameters\ key must be manually created, to see queries for undocumented values 35

kd (kernel debugger) kd (Microsoft Debugging tools) Some useful commands Resuming execution: kd> g Displaying stack backtrace: kd> k Examining foo.sys driver symbols: kd> x foo!* Setting a breakpoint for bar() function: kd> bp foo!bar Executing a single instruction: kd> t or kd> p 36

srv.sys: SMB implementation 37

References Books Inside Windows 2000, Mark Russinovitch & David Salomon. Microsoft Press. Programming Windows Security, Keith Brown. Addison Wesley. DCE/RPC over SMB: Samba and Windows NT Domain Internals, Luke Kenneth Casson Leighton. MTP. Implementing CIFS, Christopher R. Hertel. Prentice Hall (soon). Available online: http://www.ubiqx.org/cifs/ 38

References Internals tools dcedump, ifids Sysinternals tools (www.sysinternals.com) Filemon, Regmon, Process Explorer, PsTools, TCPView... Todd Sabin s tools (razor.bindview.com) RPC tools, PipeACL tools, ACL tools SPIKE (Dave Aitel, www.immunitysec.com) 39

References Kerberos tools klist and kerbtray (http://www.microsoft.com/ windows2000/techinfo/reskit/tools/existing/{klisto,kerbtray-o}.asp) TktView (http://www.develop.com/kbrown/security/ samples.htm) 40

References Documentation Security events Audit Account Logon Events (http://www.winnetmag.com/ Articles/Index.cfm?ArticleID=19677) Tracking Logon and Logoff Activity in Win2K (http:// www.win2000mag.com/articles/index.cfm?articleid=16430 41

Questions? Thank you! 42