Attacking PowerShell Clixml Deserialization
truesec.com
truesec.com
The root of the problem is IMHO is having code with arbitrary semantics; it's undoubtedly quite handy to use but the price is the inherent uncertainty about the security implications. I mean, who is aware that if you feed Get-ItemProperty something that starts with two backslashes, then it will blindly send your credentials to whatever domain is written after those backslashes? Why is it even doing that? Oh, right, because that's how you make remote shares look like local directories.
I don't think the problem is even the Get-ItemProperty itself, even though you'd probably want to use Select-Object instead wherever you can, but the fact that deserializer allows ridiculous PSPath values in the nested objects/properties; why does it do it? Is there no actual schema for e.g. Microsoft.Win32.RegistryKey type?
https://news.ycombinator.com/item?id=41392128 :rolling-eyes:
As an interactive shell I'm getting used to powershell on Windows, but I have too much bash muscle memory for now.
I'm not sure I follow. Surely you need to learn PowerShell. What other DSL do you need to learn to use bash?
If you mean, for example, grep syntax: primary use case of a shell is running shell commands, you need to know regex to search using PowerShell too.
I agree that powershell is a better programming language than bash, but I don't really write programs in bash (or fish, which I primarily use). And for serious scripts I prefer Python anyway
>Also, unlike bash, you can use the output of commands like ls directly without worrying that some characters might break your code,
Actually, unlike bash, you can't use the output of arbitrary command. In bash, everything is a text that you can prices generically, grep, less, tail, etc. Unlike in powershell.
Think of Powershell as replacement for bash AND python with built in CLI library. You can run interactively to do little stuff but if you need heavier lifts that requires a script with prompts and all that, you got it.