Ejemplo n.º 1
0
        public byte [] ProcessMessageType3(string user, string password)
        {
            TargetName = Environment.MachineName;
            ServerName = Environment.MachineName;
            // FIXME
            DomainName    = ServerName;  // IPGlobalProperties.GetIPGlobalProperties ().DomainName;
            DnsHostName   = Dns.GetHostName();
            DnsDomainName = DnsHostName; // FIXME

            type3           = new Type3Message(NtlmVersion.Version3);
            type3.Flags     = (NtlmFlags)(unchecked ((int)0xE2188235));
            type3.Domain    = DomainName;
            type3.Host      = DnsHostName;
            type3.Challenge = type2.Nonce;
            type3.Username  = user;
            type3.Password  = password;

            return(type3.GetBytes());
        }
Ejemplo n.º 2
0
        // Example from http://www.innovation.ch/java/ntlm.html
        public void Encode1()
        {
            Type3Message msg = new Type3Message();

            msg.Challenge = nonce;
            msg.Domain    = "Ursa-Minor";
            msg.Host      = "LightCity";
            msg.Password  = "******";
            msg.Username  = "******";
            AssertEquals("Type", 3, msg.Type);
            AssertEquals("GetBytes", "4E-54-4C-4D-53-53-50-00-03-00-00-00-18-00-18-00-72-00-00-00-18-00-18-00-8A-00-00-00-14-00-14-00-40-00-00-00-0C-00-0C-00-54-00-00-00-12-00-12-00-60-00-00-00-00-00-00-00-A2-00-00-00-01-82-00-00-55-00-52-00-53-00-41-00-2D-00-4D-00-49-00-4E-00-4F-00-52-00-5A-00-61-00-70-00-68-00-6F-00-64-00-4C-00-49-00-47-00-48-00-54-00-43-00-49-00-54-00-59-00-AD-87-CA-6D-EF-E3-46-85-B9-C4-3C-47-7A-8C-42-D6-00-66-7D-68-92-E7-E8-97-E0-E0-0D-E3-10-4A-1B-F2-05-3F-07-C7-DD-A8-2D-3C-48-9A-E9-89-E1-B0-00-D3", BitConverter.ToString(msg.GetBytes()));
        }
Ejemplo n.º 3
0
        // Example for a password smaller than 8 characters - which implies a weak DES key
        public void SmallPassword()
        {
            Type3Message msg = new Type3Message();

            msg.Challenge = new byte [8] {
                0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07
            };
            msg.Domain   = "DOMAIN";
            msg.Host     = "HOST";
            msg.Password = "******";
            msg.Username = "******";
            AssertEquals("Type", 3, msg.Type);
            AssertEquals("GetBytes", "4E-54-4C-4D-53-53-50-00-03-00-00-00-18-00-18-00-64-00-00-00-18-00-18-00-7C-00-00-00-0C-00-0C-00-40-00-00-00-10-00-10-00-4C-00-00-00-08-00-08-00-5C-00-00-00-00-00-00-00-94-00-00-00-01-82-00-00-44-00-4F-00-4D-00-41-00-49-00-4E-00-75-00-73-00-65-00-72-00-6E-00-61-00-6D-00-65-00-48-00-4F-00-53-00-54-00-CA-12-00-72-3C-41-D5-77-AB-18-C7-64-C6-DE-F3-4F-A6-1B-FA-06-71-EA-5F-C8-7A-CE-90-85-AB-CC-37-59-38-0B-1C-68-62-E3-98-C3-C0-EF-9C-FC-22-E8-A2-C2", BitConverter.ToString(msg.GetBytes()));
        }
Ejemplo n.º 4
0
        // Example from http://www.innovation.ch/java/ntlm.html
        public void Encode1()
        {
            Type3Message msg = new Type3Message();

            msg.Challenge = nonce;
            // Type3Message now encodes domain and host case-sensitive.
            msg.Domain   = "URSA-MINOR";
            msg.Host     = "LIGHTCITY";
            msg.Password = "******";
            msg.Username = "******";
            Assert.AreEqual(3, msg.Type, "Type");
            Assert.AreEqual("4E-54-4C-4D-53-53-50-00-03-00-00-00-18-00-18-00-72-00-00-00-18-00-18-00-8A-00-00-00-14-00-14-00-40-00-00-00-0C-00-0C-00-54-00-00-00-12-00-12-00-60-00-00-00-00-00-00-00-A2-00-00-00-01-B2-00-00-55-00-52-00-53-00-41-00-2D-00-4D-00-49-00-4E-00-4F-00-52-00-5A-00-61-00-70-00-68-00-6F-00-64-00-4C-00-49-00-47-00-48-00-54-00-43-00-49-00-54-00-59-00-AD-87-CA-6D-EF-E3-46-85-B9-C4-3C-47-7A-8C-42-D6-00-66-7D-68-92-E7-E8-97-E0-E0-0D-E3-10-4A-1B-F2-05-3F-07-C7-DD-A8-2D-3C-48-9A-E9-89-E1-B0-00-D3", BitConverter.ToString(msg.GetBytes()), "GetBytes");
        }
Ejemplo n.º 5
0
        // Example for a password smaller than 8 characters - which implies a weak DES key
        public void SmallPassword()
        {
            Type3Message msg = new Type3Message();

            msg.Challenge = new byte [8] {
                0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07
            };
            msg.Domain = "DOMAIN";
            msg.Host   = "HOST";
            // [SuppressMessage("Microsoft.Security", "CS002:SecretInNextLine", Justification="Not a secret.")]
            msg.Password = "******";
            msg.Username = "******";
            Assert.AreEqual(3, msg.Type, "Type");
            Assert.AreEqual("4E-54-4C-4D-53-53-50-00-03-00-00-00-18-00-18-00-64-00-00-00-18-00-18-00-7C-00-00-00-0C-00-0C-00-40-00-00-00-10-00-10-00-4C-00-00-00-08-00-08-00-5C-00-00-00-00-00-00-00-94-00-00-00-01-B2-00-00-44-00-4F-00-4D-00-41-00-49-00-4E-00-75-00-73-00-65-00-72-00-6E-00-61-00-6D-00-65-00-48-00-4F-00-53-00-54-00-CA-12-00-72-3C-41-D5-77-AB-18-C7-64-C6-DE-F3-4F-A6-1B-FA-06-71-EA-5F-C8-7A-CE-90-85-AB-CC-37-59-38-0B-1C-68-62-E3-98-C3-C0-EF-9C-FC-22-E8-A2-C2", BitConverter.ToString(msg.GetBytes()), "GetBytes");
        }