PoshC2_Python/Modules/Get-ServicePerms.ps1

29 lines
15 KiB
PowerShell
Raw Normal View History

2018-07-23 08:55:15 +00:00
# Service Permission Checker
# Ben Turner @benpturner
<#
.Synopsis
Service Permission Checker
.DESCRIPTION
Service Permission Checker
.EXAMPLE
PS C:\> Get-ServicePerms -Path C:\temp\
#>
$sploaded = $null
Function Get-ServicePerms {
if ($sploaded -ne "TRUE") {
$script:sploaded = "TRUE"
echo "Loading Assembly"
$i = "TVqQAAMAAAAEAAAA//8AALgAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAA4fug4AtAnNIbgBTM0hVGhpcyBwcm9ncmFtIGNhbm5vdCBiZSBydW4gaW4gRE9TIG1vZGUuDQ0KJAAAAAAAAABQRQAATAEDAK47qFoAAAAAAAAAAOAAIiALATAAACQAAAAGAAAAAAAAwkMAAAAgAAAAYAAAAAAAEAAgAAAAAgAABAAAAAAAAAAEAAAAAAAAAACgAAAAAgAAAAAAAAMAQIUAABAAABAAAAAAEAAAEAAAAAAAABAAAAAAAAAAAAAAAHBDAABPAAAAAGAAALgDAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAwAAAA4QgAAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAACAAAAAAAAAAAAAAACCAAAEgAAAAAAAAAAAAAAC50ZXh0AAAAyCMAAAAgAAAAJAAAAAIAAAAAAAAAAAAAAAAAACAAAGAucnNyYwAAALgDAAAAYAAAAAQAAAAmAAAAAAAAAAAAAAAAAABAAABALnJlbG9jAAAMAAAAAIAAAAACAAAAKgAAAAAAAAAAAAAAAAAAQAAAQgAAAAAAAAAAAAAAAAAAAACkQwAAAAAAAEgAAAACAAUAHC0AABwVAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABswBQBTAgAAAQAAEQNvDgAACnIB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by8AAApvMAAACnM/AAAKEw4RDm9AAAAKExUSFf4WHAAAAW8wAAAKEw0RDm9BAAAKExIRDm9CAAAKExMRDm9DAAAKExQdjTIAAAElFhENoiUXcmsCAHCiJRgSEihEAAAKoiUZcp0CAHCiJRoSEyhEAAAKoiUbcrkCAHCiJRwSFChEAAAKoihFAAAKEw3eFRMWctsCAHARFihGAAAKKEcAAAreAAdvDgAACnLfAABwbxAAAApvIgAAChuNDwAAASUWCXLnAgBwby8AAApvMAAACnL/AgBwCXJhAgBwby8AAApvMAAACnIFAwBwKEgAAAqiJRcRBqIlGAlyuQEAcG8vAAAKbzAAAAqiJRkRCaIlGhENom8jAAAKJghvSQAACjrZ+///3goILAYIbyEAAArcBgcoAQAABioAQXwAAAAAAAD7AAAANQAAADABAAADAAAADwAAAQIAAAAFAgAANQEAADoDAAAVAAAAAAAAAAAAAADdAQAAdAEAAFEDAAAWAAAADwAAAQAAAAD9AwAAfQAAAHoEAAAVAAAAHQAAAQIAAADjAAAALgQAABEFAAAKAAAAAAAAABswAwAMAgAAAwAAEQItC3IJAwBwc0oAAAp6c0sAAAoKBnIhAwBwb0wAAAomBnIvAwBwb0wAAAomBnI9AwBwb0wAAAomBnJNAwBwb0wAAAomBihNAAAKCxIB/hYgAAABbzAAAApvTAAACiYGclkDAHBvTAAACiYGcmsDAHBvTAAACiYGcnsDAHBvTAAACiYGcokDAHBvTAAACiYGciwEAHBvTAAACiYGcpYEAHBvTAAACiYGcv4EAHBvTAAACiYCbxEAAApvTgAACgwrMQhvGQAACnQhAAABDQZyPAUAcG9MAAAKJgYJb08AAApvTAAACiYGcnoFAHBvTAAACiYIbyAAAAotx94UCHUVAAABEwQRBCwHEQRvIQAACtwGcoYFAHBvTAAACiYCbyIAAApvTgAACgw4lAAAAAhvGQAACnQiAAABEwUGcv4EAHBvTAAAC
$dllbytes = [System.Convert]::FromBase64String($i)
$assembly = [System.Reflection.Assembly]::Load($dllbytes)
}
[ServicePerms]::dumpservices()
$computer = $env:COMPUTERNAME
$complete = "[+] Writing output to C:\Temp\Report.html"
echo "[+] Completed Service Permissions Review"
echo "$complete"
}