wmic service get name,displayname,pathname,startmode |findstr /i “auto” |findstr /i /v “c:\windows\\” |findstr /i /v “””
# Search non-binary files for interesting strings

#(searches recursively so need to be started from C:\ and any other drive)

cd c:\

gci -r -Exclude *.exe, *.dll, *.sys, *.hlp, *.cab, *.png, *.jpg, *.msi, *.zip, *.7z, *.bmp, *.gif | select-string "password","admin","credentials","-P","net use","(domain name here)" > h:\ files_strings.txt

# Find directories with write access

#(searches recursively so need to be started from C:\ and every other drive to be searched)

cd c:\

function Get-Paths {

$group = "*Users*"

$root_folder = $args[0]

write-output "[*] Processing writable folders recursively in $root_folder"

foreach($_ in (Get-ChildItem $root_folder -recurse -ErrorAction SilentlyContinue)){

if($_.PSIsContainer)

{ try{

$res = Get-acl $_.FullName

} catch{

continue

}

foreach ($a in $res.access){

if ($a.IdentityReference -like $group){

if ( ($a.FileSystemRights -like "*Write*" -or $a.FileSystemRights -like "*CreateFiles*" ) -and $a.FileSystemRights -like "*ReadAndExecute*" ){

write-output "[+] " $_.FullName

}}}}}}