Update Putty.cs

Updated Putty's stored session enumeration functionality, now also showing the \\Software\\SimonTatham\\PuTTY\\Sessions registry keys itself
This commit is contained in:
Bighound 2023-04-25 12:44:20 +02:00 committed by GitHub
parent 5356d3f2ec
commit fad2771dfb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -129,6 +129,24 @@ namespace winPEAS.KnownFileCreds
else else
{ {
string[] subKeys = RegistryHelper.GetRegSubkeys("HKCU", "Software\\SimonTatham\\PuTTY\\Sessions\\"); string[] subKeys = RegistryHelper.GetRegSubkeys("HKCU", "Software\\SimonTatham\\PuTTY\\Sessions\\");
RegistryKey selfKey = Registry.CurrentUser.OpenSubKey(@"Software\\SimonTatham\\PuTTY\\Sessions"); // extract own Sessions registry keys
if (selfKey != null)
{
string[] subKeyNames = selfKey.GetValueNames();
foreach (string name in subKeyNames)
{
Dictionary<string, string> putty_sess_key = new Dictionary<string, string>()
{
{ "RegKey Name", name },
{ "RegKey Value", (string)selfKey.GetValue(name) },
};
results.Add(putty_sess_key);
}
selfKey.Close();
}
foreach (string sessionName in subKeys) foreach (string sessionName in subKeys)
{ {
Dictionary<string, string> putty_sess = new Dictionary<string, string>() Dictionary<string, string> putty_sess = new Dictionary<string, string>()