mirror of
https://github.com/peass-ng/PEASS-ng.git
synced 2026-07-30 23:50:27 -07:00
- added logging to text file - updated PermissionsHelper to allow searching only for write or equivalent permissions - optimized StaticSID2GroupName - updated printing in PrintCredManag
43 lines
1.4 KiB
C#
43 lines
1.4 KiB
C#
using System.Collections.Generic;
|
|
using System.Text;
|
|
|
|
namespace winPEAS.Helpers.CredentialManager
|
|
{
|
|
internal static class CredentialManager
|
|
{
|
|
// thanks to
|
|
// https://github.com/spolnik/Simple.CredentialsManager
|
|
|
|
public static string UnicodeInfoText = "(Unicode Base64 encoded)";
|
|
|
|
internal static List<string> GetCredentials()
|
|
{
|
|
var result = new List<string>();
|
|
var credentials = Credential.LoadAll();
|
|
|
|
foreach (var credential in credentials)
|
|
{
|
|
var isUnicode = MyUtils.IsUnicode(credential.Password);
|
|
|
|
string clearTextPassword = credential.Password;
|
|
string unicodeInfo = string.Empty;
|
|
if (isUnicode)
|
|
{
|
|
clearTextPassword = System.Convert.ToBase64String(Encoding.Unicode.GetBytes(credential.Password));
|
|
unicodeInfo = UnicodeInfoText;
|
|
}
|
|
|
|
string item = $" Username: {credential.Username}\n" +
|
|
$" Password:{unicodeInfo} {clearTextPassword}\n" +
|
|
$" Target: {credential.Target}\n" +
|
|
$" PersistenceType: {credential.PersistenceType}\n" +
|
|
$" LastWriteTime: {credential.LastWriteTime}\n";
|
|
|
|
result.Add(item);
|
|
}
|
|
|
|
return result;
|
|
}
|
|
}
|
|
}
|