Reputation: 21
I deployed a windows machine on AWS with a key pair. I want the windows administrator password.
I got the windows encrypted password using:
var myEC2GetPasswordDataResult = ec2Client2.getPasswordData(myEC2GetPasswordDataRequest);
myEC2GetPasswordDataResult = myEC2GetPasswordDataResult.withInstanceId("instanceID");
System.log( myEC2GetPasswordDataResult.toString());
myEC2GetPasswordDataResult.getPasswordData()
Now how can I decrypt this password?
I tried many options with castlebouncy but none of them worked.
Upvotes: 2
Views: 4173
Reputation: 166755
If you don't want to use AWS SDK, another way to decrypt the password is to use OpenSSL.
Here is the example using command-line:
printf 'BASE64ENCODEDSTRING==' | openssl rsautl -decrypt -inkey mykey.pem
Related: Windows Password won't decrypt on AWS EC2 even with the correct private key.
Upvotes: 3