The Local_State is a JSON file we can view. The reason we want this file is because there is a key in here
And the Login_Data is a database.
The passwords here are encrypted with the key that is also encrypted. We need to first extract the key
We saw this GUID before in /protect - 000001eb-0900-bd10-a8ac-f2ca4392668e
We already have this file. We can use pypykatz again to generate a prekey. It returns some prekeys
Now we can extract the Master Key
Now previously we saw the encrypted passwords inside logins table of the Login_Data db. We can now decrypt it. By feeding the Local_State, Login_Data and masterkey
Edge Chrome same thing.
We get bob.woodADM password smeT-Worg-wer-m024
I was able to authenticate and get a ticket
And we can WinRM
AppLocker Bypass Method
I ran the previous command again to read Applocker Policies, put it in a file and downloaded it to read.
Lets examine it.
We can see that it allows us to run .exe inside %WINDIR% directory, and S-1-1-0 means everyone. But it does have exceptions. There is a whole list.
There are some directories inside %WINDIR% that is world-writable for us to put files in. This github repo lists them. We can compare them to our exceptions list.
I put the exceptions in a list as is and then:
(?<=Path=")[^"]+ → Extracts text after Path=" but before the closing " .
Comparing them:
We see C:\windows\debug\wia is writable to us, we can test it.
I was able to download SharpChrome in this folder.
Via InstallUtil.exe
There is another method of doing it. On the exceptions we see %WINDIR%\Microsoft.NET\Framework64\v4.0.30319\InstallUtil.exe path is blocked. But there is another binary on a different path that we find if we search
*Evil-WinRM* PS C:\Users\Bob.Wood\Documents> ./m.exe
Program 'm.exe' failed to run: This program is blocked by group policy. For more information, contact your system administratorAt line:1 char:1
+ ./m.exe
+ ~~~~~~~.
At line:1 char:1
+ ./m.exe
+ ~~~~~~~
+ CategoryInfo : ResourceUnavailable: (:) [], ApplicationFailedException
+ FullyQualifiedErrorId : NativeCommandFailed