Powershell is Awesome....well so far

I just recently started to mess around with MS Powershell and have found it very useful. As a Nessus Audit Writer, I'm able to perform checks like I could on linux/unix.

Here is an example just one of items you can do with Powershell.

Find file/drive shares that have the user 'Everyone' assigned to them
PS C:>get-wmioject -namespace root\cimv2 -class win32_share | where-object {$_.path -ne ""} -erroraction silentlycontinue| get-acl | where-object {$_.accesstostring -match "everyone"} | format-list -property path,accesstostring

Path : Microsoft.PowerShell.Core\FileSystem::C:\
AccessToString : Everyone Allow ReadAndExecute, Synchronize
CREATOR OWNER Allow 268435456
NT AUTHORITY\SYSTEM Allow FullControl
BUILTIN\Administrators Allow FullControl
BUILTIN\Users Allow AppendData
BUILTIN\Users Allow CreateFiles
BUILTIN\Users Allow ReadAndExecute, Synchronize

This command returned all share(s) that have the user 'Everyone' listed. In this case I added the user to the 'C' drive.

There are a ton of other cool uses for it too.

Useful link to Powershell Owner's Manual

Comments

Popular posts from this blog

And now for something completely different...

Testing Joomla for CVE-2015-8562

Been awhile hasn't it.