peass-ng / PEASS-ng

PEASS - Privilege Escalation Awesome Scripts SUITE (with colors)
https://book.hacktricks.xyz
Other
15.82k stars 3.06k forks source link

winPEAS.ps1 powershell script does not work on non-english systems #434

Open shaaati opened 2 weeks ago

shaaati commented 2 weeks ago

This happens to me quite often, as I am mostly pentesting German companies. It should be a general issue with every non-english system, though.

In certain lines, winPEAS references command output by its column names. At least the following two lines are affected:

https://github.com/peass-ng/PEASS-ng/blob/7979c470a175fe9dc3ebb7ceca6f9b18724b493c/winPEAS/winPEASps1/winPEAS.ps1#L70

https://github.com/peass-ng/PEASS-ng/blob/7979c470a175fe9dc3ebb7ceca6f9b18724b493c/winPEAS/winPEASps1/winPEAS.ps1#L1228

On non-english systems, the property "group name" does not exist and therefore the command fails. I am no Powershell/Windows CLI expert and therefore do not know how this should be implemented in a language-agnostic way. Can columns be adressed by their index?

Currently, I sed "s/group name/Gruppenname/", but this is obviously not the way to go.

@RandolphConley since you are the maintainer of the powershell script, it probably makes sense to tag you.

Edit: This also affects the "USER INFO" block where local groups are accessed by their English names: https://github.com/peass-ng/PEASS-ng/blob/7979c470a175fe9dc3ebb7ceca6f9b18724b493c/winPEAS/winPEASps1/winPEAS.ps1#L1236-L1249

carlospolop commented 5 days ago

Any news about this @RandolphConley ?

RandolphConley commented 4 days ago

I am looking into this. Hopefully will have a solution soon.