arcrest.packages.ntlm3 package

Submodules

arcrest.packages.ntlm3.HTTPNtlmAuthHandler module

class arcrest.packages.ntlm3.HTTPNtlmAuthHandler.AbstractNtlmAuthHandler(password_mgr=None, debuglevel=0)[source]
http_error_authentication_required(auth_header_field, req, fp, headers)[source]
retry_using_http_NTLM_auth(req, auth_header_field, realm, headers)[source]
set_http_debuglevel(level)[source]
class arcrest.packages.ntlm3.HTTPNtlmAuthHandler.HTTPNtlmAuthHandler(password_mgr=None, debuglevel=0)[source]

Bases: arcrest.packages.ntlm3.HTTPNtlmAuthHandler.AbstractNtlmAuthHandler, urllib2.BaseHandler

auth_header = 'Authorization'
http_error_401(req, fp, code, msg, headers)[source]
class arcrest.packages.ntlm3.HTTPNtlmAuthHandler.ProxyNtlmAuthHandler(password_mgr=None, debuglevel=0)[source]

Bases: arcrest.packages.ntlm3.HTTPNtlmAuthHandler.AbstractNtlmAuthHandler, urllib2.BaseHandler

CAUTION: this class has NOT been tested at all!!! use at your own risk

auth_header = 'Proxy-authorization'
http_error_407(req, fp, code, msg, headers)[source]

arcrest.packages.ntlm3.U32 module

class arcrest.packages.ntlm3.U32.U32(value=0)[source]
set(value=0)[source]
truth()[source]
v = 0
arcrest.packages.ntlm3.U32.norm(n)[source]

arcrest.packages.ntlm3.compat module

arcrest.packages.ntlm3.des module

class arcrest.packages.ntlm3.des.DES(key_str)[source]
decrypt(crypted_text)[source]
des_c_obj = None
encrypt(plain_text)[source]
arcrest.packages.ntlm3.des.key56_to_key64(key_56)[source]
arcrest.packages.ntlm3.des.set_key_odd_parity(key)[source]
arcrest.packages.ntlm3.des.str_to_key56(key_str)[source]

arcrest.packages.ntlm3.des_c module

class arcrest.packages.ntlm3.des_c.DES(key_str)[source]
KeySched = None
decrypt(str)[source]
encrypt(plaintext)[source]
arcrest.packages.ntlm3.des_c.D_ENCRYPT(tup, u, t, s)[source]
arcrest.packages.ntlm3.des_c.HPERM_OP(tup, n, m)[source]

tup - (a, t)

arcrest.packages.ntlm3.des_c.PERM_OP(tup, n, m)[source]

tup - (a, b, t)

arcrest.packages.ntlm3.des_c.c2l(c)[source]

char[4] to unsigned long

arcrest.packages.ntlm3.des_c.des_ecb_encrypt(input, ks, encrypt)[source]
arcrest.packages.ntlm3.des_c.des_encript(input, ks, encrypt)[source]
arcrest.packages.ntlm3.des_c.des_set_key(key)[source]
arcrest.packages.ntlm3.des_c.l2c(l)[source]

unsigned long to char[4]

arcrest.packages.ntlm3.des_data module

arcrest.packages.ntlm3.ntlm module

arcrest.packages.ntlm3.ntlm.ComputeResponse(ResponseKeyNT, ResponseKeyLM, ServerChallenge, ServerName, ClientChallenge='\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa', Time='\x00\x00\x00\x00\x00\x00\x00\x00')[source]
arcrest.packages.ntlm3.ntlm.NTLM_MsAvRestrictions = 8

utility functions for Microsoft NTLM authentication

References: [MS-NLMP]: NT LAN Manager (NTLM) Authentication Protocol Specification http://download.microsoft.com/download/a/e/6/ae6e4142-aa58-45c6-8dcf-a657e5900cd3/%5BMS-NLMP%5D.pdf

[MS-NTHT]: NTLM Over HTTP Protocol Specification http://download.microsoft.com/download/a/e/6/ae6e4142-aa58-45c6-8dcf-a657e5900cd3/%5BMS-NTHT%5D.pdf

Cntlm Authentication Proxy http://cntlm.awk.cz/

NTLM Authorization Proxy Server http://sourceforge.net/projects/ntlmaps/

Optimized Attack for NTLM2 Session Response http://www.blackhat.com/presentations/bh-asia-04/bh-jp-04-pdfs/bh-jp-04-seki.pdf

arcrest.packages.ntlm3.ntlm.calc_resp(password_hash, server_challenge)[source]

calc_resp generates the LM response given a 16-byte password hash and the challenge from the Type-2 message. @param password_hash

16-byte password hash
@param server_challenge
8-byte challenge from Type-2 message
returns
24-byte buffer to contain the LM response upon return
arcrest.packages.ntlm3.ntlm.create_LM_hashed_password_v1(passwd)[source]

create LanManager hashed password

arcrest.packages.ntlm3.ntlm.create_NTLM_AUTHENTICATE_MESSAGE(nonce, user, domain, password, NegotiateFlags)[source]
arcrest.packages.ntlm3.ntlm.create_NTLM_NEGOTIATE_MESSAGE(user, type1_flags=2718478855L)[source]
arcrest.packages.ntlm3.ntlm.create_NT_hashed_password_v1(passwd, user=None, domain=None)[source]

create NT hashed password

arcrest.packages.ntlm3.ntlm.create_NT_hashed_password_v2(passwd, user, domain)[source]

create NT hashed password

arcrest.packages.ntlm3.ntlm.create_sessionbasekey(password)[source]
arcrest.packages.ntlm3.ntlm.ntlm2sr_calc_resp(ResponseKeyNT, ServerChallenge, ClientChallenge='\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa')[source]
arcrest.packages.ntlm3.ntlm.parse_NTLM_CHALLENGE_MESSAGE(msg2)[source]

Module contents