Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/lib/rex/proto/ntlm/constants.rb
Views: 11704
# -*- coding: binary -*-1module Rex2module Proto3module NTLM4class Constants56SSP_SIGN = "NTLMSSP\0"7BLOB_SIGN = 0x000001018LM_MAGIC = "KGS!@\#$%"9TIME_OFFSET = 1164447360010MAX64 = 0xffffffffffffffff1112FLAGS = {13:UNICODE => 0x00000001,14:OEM => 0x00000002,15:REQUEST_TARGET => 0x00000004,16#:UNKNOWN => 0x00000008,17:SIGN => 0x00000010,18:SEAL => 0x00000020,19#:UNKNOWN => 0x00000040,20:NETWARE => 0x00000100,21:NTLM => 0x00000200,22#:UNKNOWN => 0x00000400,23#:UNKNOWN => 0x00000800,24:DOMAIN_SUPPLIED => 0x00001000,25:WORKSTATION_SUPPLIED => 0x00002000,26:LOCAL_CALL => 0x00004000,27:ALWAYS_SIGN => 0x00008000,28:TARGET_TYPE_DOMAIN => 0x00010000,29:TARGET_INFO => 0x00800000,30:NTLM2_KEY => 0x00080000,31:KEY128 => 0x20000000,32:KEY56 => 0x8000000033}3435FLAG_KEYS = FLAGS.keys.sort{|a, b| FLAGS[a] <=> FLAGS[b] }3637DEFAULT_FLAGS = {38:TYPE1 => FLAGS[:UNICODE] | FLAGS[:OEM] | FLAGS[:REQUEST_TARGET] | FLAGS[:NTLM] | FLAGS[:ALWAYS_SIGN] | FLAGS[:NTLM2_KEY],39:TYPE2 => FLAGS[:UNICODE],40:TYPE3 => FLAGS[:UNICODE] | FLAGS[:REQUEST_TARGET] | FLAGS[:NTLM] | FLAGS[:ALWAYS_SIGN] | FLAGS[:NTLM2_KEY]41}4243# NTLM Response Type44NTLM_V1_RESPONSE = 145NTLM_V2_RESPONSE = 246NTLM_2_SESSION_RESPONSE = 34748#the same flags but merged from lib/rex/proto/smb/constants and keeped for compatibility49# NTLMSSP Message Flags50NEGOTIATE_UNICODE = 0x00000001 # Only set if Type 1 contains it - this or oem, not both51NEGOTIATE_OEM = 0x00000002 # Only set if Type 1 contains it - this or unicode, not both52REQUEST_TARGET = 0x00000004 # If set in Type 1, must return domain or server53NEGOTIATE_SIGN = 0x00000010 # Session signature required54NEGOTIATE_SEAL = 0x00000020 # Session seal required55NEGOTIATE_LMKEY = 0x00000080 # LM Session Key should be used for signing and sealing56NEGOTIATE_NTLM = 0x00000200 # NTLM auth is supported57NEGOTIATE_ANONYMOUS = 0x00000800 # Anonymous context used58NEGOTIATE_DOMAIN = 0x00001000 # Sent in Type1, client gives domain info59NEGOTIATE_WORKSTATION = 0x00002000 # Sent in Type1, client gives workstation info60NEGOTIATE_LOCAL_CALL = 0x00004000 # Server and client are on same machine61NEGOTIATE_ALWAYS_SIGN = 0x00008000 # Add signatures to packets62TARGET_TYPE_DOMAIN = 0x00010000 # If REQUEST_TARGET, we're adding the domain name63TARGET_TYPE_SERVER = 0x00020000 # If REQUEST_TARGET, we're adding the server name64TARGET_TYPE_SHARE = 0x00040000 # Supposed to denote "a share" but for a webserver?65NEGOTIATE_NTLM2_KEY = 0x00080000 # NTLMv2 Signature and Key exchanges66NEGOTIATE_TARGET_INFO = 0x00800000 # Server set when sending Target Information Block67NEGOTIATE_128 = 0x20000000 # 128-bit encryption supported68NEGOTIATE_KEY_EXCH = 0x40000000 # Client will supply encrypted master key in Session Key field of Type3 msg69NEGOTIATE_56 = 0x80000000 # 56-bit encryption supported7071end72end73end74end757677