Skip to content

Latest commit

 

History

History
489 lines (278 loc) · 13.3 KB

_lib_sspi_d_.sspi.md

File metadata and controls

489 lines (278 loc) · 13.3 KB

node-expose-sspiGlobals"lib/sspi.d"Sspi

Interface: Sspi

Hierarchy

  • Sspi

Index

Methods

Methods

AcceptSecurityContext

AcceptSecurityContext(input: AcceptSecurityContextInput): ServerSecurityContext

Defined in lib/sspi.d.ts:261

AcceptSecurityContext must be used only on server side. Its purpose is to setup a client/server security context

memberof Sspi

Parameters:

Name Type
input AcceptSecurityContextInput

Returns: ServerSecurityContext


AcquireCredentialsHandle

AcquireCredentialsHandle(input: AcquireCredHandleInput): CredentialWithExpiry

Defined in lib/sspi.d.ts:241

Get the credentials of a user, to be used with a specified SSP package. The credentials will be used according the specified flags.

FreeCredentialsHandle must be used to free the credentials pointer.

memberof Sspi

Parameters:

Name Type
input AcquireCredHandleInput

Returns: CredentialWithExpiry


AllocateAndInitializeSid

AllocateAndInitializeSid(): SidPointer

Defined in lib/sspi.d.ts:341

Allocate an sid. Limitations: get only the NtAuthority sid (for admin check use case)

Note: the sid returned must be freed with FreeSid().

memberof Sspi

Returns: SidPointer


CheckTokenMembership

CheckTokenMembership(sid: SidPointer): boolean

Defined in lib/sspi.d.ts:350

check if the sid belongs to the user thread/process token.

memberof Sspi

Parameters:

Name Type
sid SidPointer

Returns: boolean


CloseHandle

CloseHandle(handle: HANDLE): void

Defined in lib/sspi.d.ts:380

Free allocated memory referenced by the handle.

memberof Sspi

Parameters:

Name Type
handle HANDLE

Returns: void


DeleteSecurityContext

DeleteSecurityContext(ctxtHandle: CtxtHandle): void

Defined in lib/sspi.d.ts:426

Free a context handle.

memberof Sspi

Parameters:

Name Type
ctxtHandle CtxtHandle

Returns: void


EnumerateSecurityPackages

EnumerateSecurityPackages(): SecPkgInfo[]

Defined in lib/sspi.d.ts:219

EnumerateSecurityPackages get a list of SSP provider with some info.

memberof Sspi

Returns: SecPkgInfo[]


FreeCredentialsHandle

FreeCredentialsHandle(credential: CredHandle): void

Defined in lib/sspi.d.ts:271

Free a allocated credential memory. Must be used after AcquireCredentialsHandle.

memberof Sspi

Parameters:

Name Type
credential CredHandle

Returns: void


FreeSid

FreeSid(sid: SidPointer): void

Defined in lib/sspi.d.ts:360

Free the given sid.

Warning: this function may crash the system if not used with a good sid.

memberof Sspi

Parameters:

Name Type
sid SidPointer

Returns: void


GetTokenInformation

GetTokenInformation(input: GetTokenInformationInput): Groups | TokenPrivileges

Defined in lib/sspi.d.ts:370

Get information from a user token.

memberof Sspi

Parameters:

Name Type
input GetTokenInformationInput

Returns: Groups | TokenPrivileges


GetUserName

GetUserName(): string

Defined in lib/sspi.d.ts:298

Get the username of the current thread. (TODO: to be moved outside of SSPI)

memberof Sspi

Returns: string


GetUserNameEx

GetUserNameEx(extendedNameFormat: ExtendedNameFormatFlag): string

Defined in lib/sspi.d.ts:307

Get the username and much more of the current thread.

memberof Sspi

Parameters:

Name Type
extendedNameFormat ExtendedNameFormatFlag

Returns: string


ImpersonateSecurityContext

ImpersonateSecurityContext(handle: CtxtHandle): void

Defined in lib/sspi.d.ts:282

Must be used only on server side.

Change the server user temporarely with the client user. Allocated resource must be freed with RevertSecurityContext.

memberof Sspi

Parameters:

Name Type
handle CtxtHandle

Returns: void


InitializeSecurityContext

InitializeSecurityContext(input: InitializeSecurityContextInput): SecurityContext

Defined in lib/sspi.d.ts:250

This function must be used only by a client. Its purpose is to setup a client/server security context.

memberof Sspi

Parameters:

Name Type
input InitializeSecurityContextInput

Returns: SecurityContext


LookupAccountName

LookupAccountName(username: string): SidObject

Defined in lib/sspi.d.ts:389

Get the SID of username.

memberof Sspi

Parameters:

Name Type
username string

Returns: SidObject


OpenProcessToken

OpenProcessToken(flags?: AccessTokenFlag[]): AccessToken

Defined in lib/sspi.d.ts:330

Get the user token associated with the current process. You will get always the user that has started the process, and never the impersonated user.

CloseHandle must be used for freeing the token.

memberof Sspi

Parameters:

Name Type
flags? AccessTokenFlag[]

Returns: AccessToken


OpenThreadToken

OpenThreadToken(flags?: AccessTokenFlag[]): AccessToken

Defined in lib/sspi.d.ts:318

Get the user token associated with the current thread. Used with ImpersonateSecurityContext.

Token must be freed with CloseHandle.

memberof Sspi

Parameters:

Name Type
flags? AccessTokenFlag[]

Returns: AccessToken


QueryContextAttributes

QueryContextAttributes(ctxtHandle: CtxtHandle, attribute: string): Props

Defined in lib/sspi.d.ts:409

Query what can be done with a given context handle.

memberof Sspi

Parameters:

Name Type
ctxtHandle CtxtHandle
attribute string

Returns: Props


QueryCredentialsAttributes

QueryCredentialsAttributes(credential: CredHandle, attribute: string): Props

Defined in lib/sspi.d.ts:399

Query what can be done with a given credential.

memberof Sspi

Parameters:

Name Type
credential CredHandle
attribute string

Returns: Props


QuerySecurityContextToken

QuerySecurityContextToken(ctxtHandle: CtxtHandle): AccessToken

Defined in lib/sspi.d.ts:418

Get a client user token.

memberof Sspi

Parameters:

Name Type
ctxtHandle CtxtHandle

Returns: AccessToken


QuerySecurityPackageInfo

QuerySecurityPackageInfo(packageName: SecuritySupportProvider): SecPkgInfo

Defined in lib/sspi.d.ts:228

Get info about one SSP provider given its name.

memberof Sspi

Parameters:

Name Type
packageName SecuritySupportProvider

Returns: SecPkgInfo


RevertSecurityContext

RevertSecurityContext(handle: CtxtHandle): void

Defined in lib/sspi.d.ts:290

Revert the server user back to its original. Must be used with ImpersonateSecurityContext.

memberof Sspi

Parameters:

Name Type
handle CtxtHandle

Returns: void


hello

hello(): string

Defined in lib/sspi.d.ts:211

Just a hello world function. Useless... ;)

memberof Sspi

Returns: string