NT Net Lib Roteiro da apresentação: diagrama de fluxo de chamadas da API Win32 explicação das chamadas apresentação da classe Uma mini-biblioteca com as.

Slides:



Advertisements
Similar presentations
Working with the Windows Registry Computer Club of the Sandhills November 12, 2012.
Advertisements

MUMS API CUEL IMAN MLIM 2010/11/18. CUEL Module Function Description – This function allows the caller to request that the module name be added to the.
Computer Programming for Engineering Applications ECE 175 Intro to Programming.
Your Friend and Mine The Windows Registry. What is the Registry? ► Think of as a giant 411 switchboard ► Simple idea of centralized one-stop shopping.
Chapter 9 Chapter 9: Managing Groups, Folders, Files, and Object Security.
Exploring the UNIX File System and File Security
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment Chapter 5: Managing File Access.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment Chapter 5: Managing File Access.
1 Case Study 2: Windows 2000 Chapter History of windows Programming windows System structure 11.4 Processes and threads in.
1 JMH Associates © 2004, All rights reserved Chapter 15 Windows System Security.
MIS Chapter 51 Chapter 5 – Managing File Access MIS 431 Created Spring 2006.
1 Security and Protection Chapter 9. 2 The Security Environment Threats Security goals and threats.
Security SIG: Introduction to Tripwire Chris Harwood John Ives.
Hands-On Microsoft Windows Server 2003 Administration Chapter 5 Administering File Resources.
Wince File systems. File system on embedded File system choice on embedded is important –File system size can be an issue –Different media are used –
1 JMH Associates © 2004, All rights reserved Chapter 2-3 Supplement Registry Programming.
1 JMH Associates © 2004, All rights reserved Chapter 1 Getting Started with Win32/64.
BR1 Protection and Security B. Ramamurthy Chapters 18 and 19.
Operating System & Application Files BACS 371 Computer Forensics.
11 SHARING FILE SYSTEM RESOURCES Chapter 9. Chapter 9: SHARING FILE SYSTEM RESOURCES2 CHAPTER OVERVIEW Create and manage file system shares and work with.
Windows Security Mechanisms Al Bento - University of Baltimore.
Security Aspects Of Directory Enabled Applications Praerit Garg Program Manager Windows NT Security Microsoft Corporation.
Security features of Windows What is computer security ? Computer security refers to the protection of all components—hardware, software, and stored.
Mastering Windows Network Forensics and Investigation Chapter 9: Registry Evidence.
Tripwire Enterprise Server Rule Sets Vincent Fox, Doreen Meyer, and Paul Singh UC Davis, Information and Educational Technology July 25, 2006.
Va-scanCopyright 2002, Marchany Unit 6 – Solaris File Security Randy Marchany VA Tech Computing Center.
Using Hard Drives Additional information.  Hierarchical Filing Systems  Why Organize a Hard Disk?  Relative and Absolute Paths  Subdirectory Markers.
CSC 2720 Building Web Applications Cookies, URL-Rewriting, Hidden Fields and Session Management.
Computer Studies (AL) File Management File system interface.
Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze Unit OS8: File System 8.5. Windows File and Directory.
7.3. Windows Security Descriptors
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment, Enhanced Chapter 5: Managing File Access.
Windows Object Manager CS Spring Overview The object paradigm NT Objects and the Object Manager Object Structure Object Naming Object Handles.
Hands-On Microsoft Windows Server 2008 Chapter 5 Configuring, Managing, and Troubleshooting Resource Access.
Module 4 Managing Access to Resources in Active Directory ® Domain Services.
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.
Chapter Two Exploring the UNIX File System and File Security.
计算机系 信息处理实验室 Lecture 4 System Mechanisms (2)
Creating Sequential Files, Adding Data, & Deleting Data.
Active Directory. Computers in organizations Computers are linked together for communication and sharing of resources There is always a need to administer.
Win32 Programming Lesson 7: Kernel Objects. Abstract  Many of the concepts we’ll look at today won’t make complete sense until you use them  However,
1 Server Design Discuss Design issues for Servers Review Server Creation in Windows.
CE Operating Systems Lecture 21 Operating Systems Protection with examples from Linux & Windows.
DAV ACLs Lisa Dusseault Microsoft. Agenda Background Scenarios Goals.
Page 1 Active Directory and DNS Lecture 2 Hassan Shuja 09/14/2004.
Access Control  privilege How does your code manage who has access to what?  authorization  permission Two OS models: Unix Windows.
EMB432 Developing Bus Agnostic Drivers for Windows CE David G. Heil Chief Engineer Solutions Division CalAmp Corporation.
Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze Unit OS2: Operating System Principles 2.4. The Windows.
Lecture 6 File, Folder and Share Security. Objectives Managing file and folder security.
Computer Programming for Engineering Applications ECE 175 Intro to Programming.
Lecture 02 File and File system. Topics Describe the layout of a Linux file system Display and set paths Describe the most important files, including.
System Programming Course introduction Getting Started …
Windows Server 2003 La migrazione da Windows NT 4.0 a Windows Server 2003 Relatore: MCSE - MCT.
Module 4: Managing Access to Resources. Overview Overview of Managing Access to Resources Managing Access to Shared Folders Managing Access to Files and.
Windows Server 2003 檔案分享管理 林寶森
Chapter 8 Server Management: Directories & Software Directory Structure Creating A Directory Directory Properties Setup Wizard Registry Installing/Uninstalling.
26 장. 레지스트리 26-1 INI 파일 26-2 레지스트리 Windows API INI 파일 정보의 저장.
Mitchell Adair Computer Security Group Feb. 10th, 2010 Enumerating Windows Users.
Mario Tayah and Jim Fawcett CSE 775 – Distributed Objects Spring 2007
CHAPTER 14 - DEBUGGING WINDOWS SERVICES
UNIX System Overview.
File Management.
Exploring the UNIX File System and File Security
File system(conti..) Lecture November 2018.
Windows APIs File Processing Copyright © 2016 Curt Hill.
Managing Data by Using NTFS
The CreateFile Function
Access Control and Audit
Chapter 6 File Systems 6.1 Files 6.2 Directories
Globalization Services: Spell Checking API
Presentation transcript:

NT Net Lib Roteiro da apresentação: diagrama de fluxo de chamadas da API Win32 explicação das chamadas apresentação da classe Uma mini-biblioteca com as seguintes classes: Segurança de arquivos Percorrer diretório de arquivos Mudar entradas do Registry

File ACL SD SID Account NameAccess Mask LookupAccountNameInitializeAclAddAccessAllowedAce SetSecurityDescriptorDaclSetSecurityDescriptorOwnerInitializeSecurityDescriptor SID Account Name SetFileSecurity File Name LookupAccountName FileSecurity

LookupAccountName PSID_NAME_USE peUse // address of SID-type indicator LPDWORD cbReferencedDomainName// address of size of domain string LPTSTR ReferencedDomainName// address of string for referenced domain LPDWORD cbSid// address of size of security identifier PSID Sid// address of security identifier LPCTSTR lpAccountName// address of string for account name LPCTSTR lpSystemName// address of string for system name pType\ aponta para um inteiro 1000 &\ aponta para um inteiro cujo valor é 1000 pDomain\ aponta para um buffer de 1000 bytes 1000 & pSID\ aponta para um buffer de 1000 bytes " Administrator" " Susy" Call LookupAccountName.

InitializeAcl DWORD dwAclRevision // revision level of access-control list DWORD nAclLength// size of access-control list PACL pAcl// address of access-control list ACL_REVISION\ constante da API 1000 pACL\ aponta para um buffer de 1000 bytes Call InitializeAcl.

AddAccessAllowedAce PSID pSid // address of security identifier DWORD AccessMask// access mask DWORD dwAceRevision// ACL revision level PACL pAcl// address of access-control list pSID FILE_GENERIC_READ\ constante da API ACL_REVISION\ constante da API pACL Call AddAccessAllowedAce.

InitializeSecurityDescriptor DWORD dwRevision // revision level PSECURITY_DESCRIPTOR pSecurityDescriptor// address of security descriptor SECURITY_DESCRIPTOR_REVISION\ constante da API pSD\ aponta para um buffer Call InitializeSecurityDescriptor.

SetSecurityDescriptorOwner BOOL fOwnerDefaulted // flag for default PSID psidOwner,// address of SID for owner PSECURITY_DESCRIPTOR psd,// address of security descriptor 0\ default pSID\ new owner pSD Call SetSecurityDescriptorOwner.

SetSecurityDescriptorDacl BOOL fDaclDefaulted // flag for default discretionary ACL PACL pAcl,// address of discretionary ACL BOOL fDaclPresent,// flag for presence of discretionary ACL PSECURITY_DESCRIPTOR psd,// address of security descriptor 0\ default pACL 1\ present pSD Call SetSecurityDescriptorDacl.

SetFileSecurity PSECURITY_DESCRIPTOR psd // address of security descriptor SECURITY_INFORMATION si// type of information to set LPCTSTR lpszFile// address of string for filename pSD DACL_SECURITY_INFORMATION OWNER_SECURITY_INFORMATION or " arquivo.txt" Call SetFileSecurity.

específico para arquivos: FILE_READ_DATA FILE_WRITE_DATA FILE_APPEND_DATA FILE_EXECUTE específico para diretórios: FILE_LIST_DIRECTORY FILE_ADD_FILE FILE_ADD_SUBDIRECTORY FILE_TRAVERSE FILE_DELETE_CHILD Access Mask específico para ambos: FILE_READ_EA FILE_WRITE_EA FILE_READ_ATTRIBUTES FILE_WRITE_ATTRIBUTES genérico: GENERIC_ALL GENERIC_EXECUTE GENERIC_READ GENERIC_WRITE geral: DELETE READ_CONTROL WRITE_DAC WRITE_OWNER SYNCHRONIZE ACCESS_SYSTEM_SECURITY

Class FileSecurity AccountName Owner AccountName Read AccountName Change FileName Set FileSecurity sysFile " Administrator" Owner: sysFile " Users" Read: sysFile " gaga.txt" Set: sysFile

Handle Key Name Value Name RegOpenKeyEx Value Handle Computer Name RegConnectRegistryRegSetValueEx Registry Entry RegCloseKey Registry

RegConnectRegistry PHKEY phkResult // address of buffer for remote registry handle HKEY hKey,// predefined registry handle LPTSTR lpszComputerName,// address of name of remote computer pConnectHandle\ aponta para um inteiro HKEY_LOCAL_MACHINE\ constante da API " SUSY" Call RegConnectRegistry.

RegOpenKeyEx PHKEY phkResult // address of handle of open key REGSAM samDesired,// security access mask DWORD dwReserved,// reserved LPCTSTR lpszSubKey,// address of name of subkey to open HKEY hKey,// handle of open key pKeyHandle\ aponta para um inteiro KEY_WRITE\ constante da API 0\ reservado " System\CurrentControlSet\Services\Browser" ConnectHandle\ o valor mesmo Call RegOpenKeyEx.

RegSetValueEx DWORD cbData // size of value data CONST BYTE * lpData,// address of value data DWORD dwType,// flag for value type DWORD Reserved,// reserved LPCTSTR lpValueName,// address of value to set HKEY hKey,// handle of key to set value for 4\ 4 bytes de dados 2 &\ aponta para um inteiro cujo valor é 2 REG_DWORD\ tipo é dword - constante da API 0\ reservado " Start" KeyHandle\ o valor mesmo Call RegSetValueEx.

RegCloseKey HKEY hKey // handle of key to close KeyHandle\ o valor mesmo Call RegCloseKey.

Class Registry ClientNumber Connect KeyName ValueName IntegerValue SetDWORD KeyName ValueName StringValue SetSZ KeyName ValueName StringValue SetESZ Registry remoto 23 Connect: remoto " System\CurrentControlSet\Services\Browser” " Start" 2 SetDWORD: remoto Disconnect: remoto Disconnect

FindNextFile Handle *.* FindFirstFile WIN32_FIND_DATA GetLastErrorFindClose SetCurrentDirectory FILE_ATTRIBUTE_DIRECTORY ERROR_NO_ MORE_FILES FALSE TRUE Browse

FindFirstFile LPWIN32_FIND_DATA lpFindFileData // address of returned information LPCTSTR lpFileName,// address of name of file to search for pFIND_DATA\ aponta para um buffer " *.*" Call FindFirstFile to hFindFile

FindNextFile LPWIN32_FIND_DATA lpFindFileData // address of structure for data on found file HANDLE hFindFile,// handle of search pFIND_DATA\ aponta para um buffer hFindFile Call FindNextFile.

typedef struct _WIN32_FIND_DATA { DWORDdwFileAttributes; FILETIMEftCreationTime; FILETIMEftLastAccessTime; FILETIMEftLastWriteTime; DWORDnFileSizeHigh; DWORDnFileSizeLow; DWORDdwReserved0; DWORDdwReserved1; TCHARcFileName[ MAX_PATH ]; TCHARcAlternateFileName[ 14 ]; } WIN32_FIND_DATA; WIN32_FIND_DATA

dwFileAttributes FILE_ATTRIBUTE_ARCHIVE FILE_ATTRIBUTE_COMPRESSED FILE_ATTRIBUTE_DIRECTORY FILE_ATTRIBUTE_HIDDEN FILE_ATTRIBUTE_NORMAL FILE_ATTRIBUTE_READONLY FILE_ATTRIBUTE_SYSTEM FILE_ATTRIBUTE_TEMPORARY

FindClose HANDLE hFindFile,// handle of search hFindFile Call FindClose.

SetCurrentDirectory LPCTSTR lpszCurDir // address of name of new current directory " Tese" Call SetCurrentDirectory.

GetLastError Call GetLastError.

Class DirBrowse pAvoidList Avoid Show pFunction ProcessFiles DirBrowse List : PrintFileName CR Show: List ;\ definir função ' PrintFileName ProcessFiles: List\ executar função para cada arquivo