PowerShellEmpire / PowerTools

PowerTools is a collection of PowerShell projects with a focus on offensive operations.
Other
2.03k stars 817 forks source link

Get-GptTmpl non domain joined User/PC #57

Closed Meatballs1 closed 8 years ago

Meatballs1 commented 8 years ago

Using runas /netonly technique, for some reason Test-Path returns false unless you have the drive mapped?

e.g. net use * \target.com

Then Test-Path will start returning true...

HarmJ0y commented 8 years ago

Hrmmm. What do you think about a -MapDrives argument to anything that uses remote Test-Path's, something like "New-PSDrive –Name $RandName –PSProvider FileSystem –Root “\SERVER\share” . Could also supply alternate credentials.

HarmJ0y commented 8 years ago

The version_2.0 branch just got a push to hopefully support this- Get-GptTmpl, Get-GroupsXML, Get-NetGPOGroup, Find-GPOComputerAdmin, Find-GPOLocation and Get-DomainPolicy nowhave a "-UsePSDrive" switch that should automate the creation of a randomized session-only PSDrive for the mounting of locations to search for policy files. Let me know if this does/doesn't work, and I'll close the issue when it's a confirmed fix.

Also, Find-InterestingFile and Invoke-FileFinder received the flag as well, along with a -Credential option to specify alternate credentials for file searching. Again, minimally tested, so let me know what breaks :)