Merge pull request #1071 from winnie22/psagent_dirinfo

More informative PS agent directory listing
fix-for-1142
Chris Ross 2018-04-22 13:26:05 -04:00 committed by GitHub
commit f3a057a533
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -281,11 +281,11 @@ function Invoke-Empire {
switch -regex ($cmd) {
'(ls|dir)' {
if ($cmdargs.length -eq "") {
$output = Get-ChildItem -force | select lastwritetime,length,name
$output = Get-ChildItem -force | select mode,@{Name="Owner";Expression={ (Get-Acl $_.FullName).Owner }},lastwritetime,length,name
}
else {
try{
$output = IEX "$cmd $cmdargs -Force -ErrorAction Stop | select lastwritetime,length,name"
$output = IEX "$cmd $cmdargs -Force -ErrorAction Stop | select mode,@{Name="Owner";Expression={ (Get-Acl $_.FullName).Owner }},lastwritetime,length,name"
}
catch [System.Management.Automation.ActionPreferenceStopException] {
$output = "[!] Error: $_ (or cannot be accessed)."