Constants

NTLMSIG

NTLMSIG

NTLM constants

DESCONST

DESCONST

Methods

getAuthKeyword()

getAuthKeyword() : string

Get the name of the AUTH mechanism this Authenticator handles

Returns

string

authenticate()

authenticate(\Pop\Mail\Transport\Smtp\AgentInterface  $agent, string  $username, string  $password) : boolean

Try to authenticate the user with $username and $password

Parameters

\Pop\Mail\Transport\Smtp\AgentInterface $agent
string $username
string $password

Throws

\LogicException

Returns

boolean

si2bin()

si2bin(mixed  $si, integer  $bits = 32) : null|string

si2bin method

Parameters

mixed $si
integer $bits

Returns

null|string

sendMessage1()

sendMessage1(\Pop\Mail\Transport\Smtp\AgentInterface  $agent) : string

Send our auth message and returns the response

Parameters

\Pop\Mail\Transport\Smtp\AgentInterface $agent

Returns

string —

SMTP Response

parseMessage2()

parseMessage2(string  $response) : array

Fetch all details of our response (message 2)

Parameters

string $response

Returns

array —

our response parsed

readSubBlock()

readSubBlock(  $block) : array

Read the blob information in from message2

Parameters

$block

Returns

array

sendMessage3()

sendMessage3(string  $response, string  $username, string  $password, string  $timestamp, string  $client, \Pop\Mail\Transport\Smtp\AgentInterface  $agent, boolean  $v2 = true) : string

Send our final message with all our data

Parameters

string $response

Message 1 response (message 2)

string $username
string $password
string $timestamp
string $client
\Pop\Mail\Transport\Smtp\AgentInterface $agent
boolean $v2

Use version2 of the protocol

Returns

string

createMessage1()

createMessage1() : string

Create our message 1

Returns

string

createMessage3()

createMessage3(string  $domain, string  $username, string  $workstation, string  $lmResponse, string  $ntlmResponse) : string

Create our message 3

Parameters

string $domain
string $username
string $workstation
string $lmResponse
string $ntlmResponse

Returns

string

createBlob()

createBlob(string  $timestamp, string  $client, string  $targetInfo) : string

Create blob method

Parameters

string $timestamp

Epoch timestamp in microseconds

string $client

Random bytes

string $targetInfo

Returns

string

getDomainAndUsername()

getDomainAndUsername(string  $name) : array

Get domain and username from our username

Parameters

string $name

Returns

array

Examples

** File not found : DOMAIN/username **

createLMPassword()

createLMPassword(string  $password, string  $challenge) : string

Create LMv1 response

Parameters

string $password
string $challenge

Returns

string

createNTLMPassword()

createNTLMPassword(string  $password, string  $challenge) : string

Create NTLMv1 response

Parameters

string $password
string $challenge

Returns

string

getCorrectTimestamp()

getCorrectTimestamp(string  $time) : string

Convert a normal timestamp to a tenth of a microtime epoch time

Parameters

string $time

Returns

string

createLMv2Password()

createLMv2Password(string  $password, string  $username, string  $domain, string  $challenge, string  $client) : string

Create LMv2 response

Parameters

string $password
string $username
string $domain
string $challenge

NTLM Challenge

string $client

Random string

Returns

string

createNTLMv2Hash()

createNTLMv2Hash(string  $password, string  $username, string  $domain, string  $challenge, string  $targetInfo, string  $timestamp, string  $client) : string

Create NTLMv2 response

Parameters

string $password
string $username
string $domain
string $challenge

Hex values

string $targetInfo

Hex values

string $timestamp
string $client

Random bytes

Returns

string

createDesKey()

createDesKey(  $key) : string

Create DES key

Parameters

$key

Returns

string

createSecurityBuffer()

createSecurityBuffer(string  $value, integer  $offset, boolean  $is16 = false) : string

Create our security buffer depending on length and offset

Parameters

string $value

Value we want to put in

integer $offset

start of value

boolean $is16

Do we 16bit string or not?

Returns

string

readSecurityBuffer()

readSecurityBuffer(string  $value) : array

Read our security buffer to fetch length and offset of our value

Parameters

string $value

Securitybuffer in hex

Returns

array —

array with length and offset

castToByte()

castToByte(integer  $v) : integer

Cast to byte java equivalent to (byte)

Parameters

integer $v

Returns

integer

uRShift()

uRShift(integer  $a, integer  $b) : integer

Java unsigned right bitwise $a >>> $b

Parameters

integer $a
integer $b

Returns

integer

createByte()

createByte(string  $input, integer  $bytes = 4, boolean  $isHex = true) : string

Right padding with 0 to certain length

Parameters

string $input
integer $bytes

Length of bytes

boolean $isHex

Did we provided hex value

Returns

string

getRandomBytes()

getRandomBytes(  $length) : string

Create random bytes

Parameters

$length

Returns

string

desEncrypt()

desEncrypt(string  $value, string  $key) : string

DES Encryption

Parameters

string $value

An 8-byte string

string $key

Returns

string

md5Encrypt()

md5Encrypt(string  $key, string  $msg) : string

MD5 Encryption

Parameters

string $key

Encryption key

string $msg

Message to encrypt

Returns

string

md4Encrypt()

md4Encrypt(string  $input) : string

MD4 Encryption

Parameters

string $input

Returns

string

convertTo16bit()

convertTo16bit(string  $input) : string

Convert UTF-8 to UTF-16

Parameters

string $input

Returns

string

hex2bin()

hex2bin(string  $hex) : string

Hex2bin replacement for < PHP 5.4

Parameters

string $hex

Returns

string —

Binary

debug()

debug(string  $message) 

Debug method

Parameters

string $message