From 5f72af87aafe4a091d9639c23956048ccde7fa17 Mon Sep 17 00:00:00 2001 From: Scott Hanselman Date: Fri, 9 Aug 2013 13:54:58 -0700 Subject: [PATCH] Dump your Windows 8 Credential Store --- DumpPasswords.csproj | 67 ++++++++++++++++++++++++++++++++++++++ DumpPasswords.sln | 20 ++++++++++++ Program.cs | 29 +++++++++++++++++ Properties/AssemblyInfo.cs | 36 ++++++++++++++++++++ app.config | 3 ++ 5 files changed, 155 insertions(+) create mode 100644 DumpPasswords.csproj create mode 100644 DumpPasswords.sln create mode 100644 Program.cs create mode 100644 Properties/AssemblyInfo.cs create mode 100644 app.config diff --git a/DumpPasswords.csproj b/DumpPasswords.csproj new file mode 100644 index 0000000..777a081 --- /dev/null +++ b/DumpPasswords.csproj @@ -0,0 +1,67 @@ + + + + + Debug + AnyCPU + {EF2AC038-0B6E-4760-BC59-E596C8A2A1B4} + Exe + Properties + ConsoleApplication1 + ConsoleApplication1 + v4.5 + 512 + + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + false + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + false + + + 8.0 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/DumpPasswords.sln b/DumpPasswords.sln new file mode 100644 index 0000000..5897bdc --- /dev/null +++ b/DumpPasswords.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DumpPasswords", "DumpPasswords.csproj", "{EF2AC038-0B6E-4760-BC59-E596C8A2A1B4}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {EF2AC038-0B6E-4760-BC59-E596C8A2A1B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EF2AC038-0B6E-4760-BC59-E596C8A2A1B4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EF2AC038-0B6E-4760-BC59-E596C8A2A1B4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EF2AC038-0B6E-4760-BC59-E596C8A2A1B4}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Program.cs b/Program.cs new file mode 100644 index 0000000..729c074 --- /dev/null +++ b/Program.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace DumpCredentials +{ + class Program + { + static void DumpCredentials(Windows.Security.Credentials.PasswordCredential cred) + { + Console.WriteLine("Resource: {0}", cred.Resource); + Console.WriteLine("UserName: {0}", cred.UserName); + Console.WriteLine("Password: {0}", cred.Password); + } + static void Main(string[] args) + { + Windows.Security.Credentials.PasswordVault vault = new Windows.Security.Credentials.PasswordVault(); + Console.WriteLine("{0}", vault.GetType()); + foreach (var cred in vault.RetrieveAll()) + { + cred.RetrievePassword(); + DumpCredentials(cred); + } + + } + } +} + diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..7a0d851 --- /dev/null +++ b/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("ConsoleApplication1")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("ConsoleApplication1")] +[assembly: AssemblyCopyright("Copyright © 2013")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("2ad5c6d6-894d-499b-8af3-38d00939c2d0")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/app.config b/app.config new file mode 100644 index 0000000..b7a7ef1 --- /dev/null +++ b/app.config @@ -0,0 +1,3 @@ + + +