You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
title: Decode any PowerShell Secure String under Linux
3
+
date: 2024-04-10T20:48:34
4
+
draft: false
5
+
tags:
6
+
- PowerShell
7
+
---
8
+
9
+
This is not a big deal, as *secure strings* are not encrypted under Unix systems. The password will instead be obfuscated as hexadecimal representation of the string's bytes.
10
+
11
+
According to [a user on reddit](https://www.reddit.com/r/PowerShell/comments/dtggfn/comment/f6wmpfu/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button), converting a string to a *secure string* it is basically doing this:
Under Windows this will not lead to a useful value for `$decodedPassword`, as Windows systems encrypt the *secure string* based on the profile of the current User and Host. Under Linux the value for `$password` and `$decodedPassword` will be identical.
31
+
32
+
So better find another way to store your automation secrets under Linux or even better: avoid them alltogether by using certificates or managed identities if possible.
0 commit comments