update readable? for directories

This commit is contained in:
pingport80
2021-08-17 16:39:23 +05:30
parent 235aae068f
commit a7bed49e8a
+3 -3
View File
@@ -254,11 +254,11 @@ module Msf::Post::File
verification_token = Rex::Text::rand_text_alpha(8)
return false unless exists?(path)
if session.type == 'powershell'
if file?(path)
unless directory?(path)
return cmd_exec("[System.IO.File]::OpenRead(\"#{path}\");if($?){echo\
#{verification_token}}").include?(verification_token)
elsif directory?(path)
return cmd_exec("Get-ChildItem -Path \"#{path}\"; if($?) {echo #{verification_token}}").include?(verification_token)
else
return cmd_exec("[System.IO.Directory]::GetFiles('#{path}'); if($?) {echo #{verification_token}}").include?(verification_token)
end
end