Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gather foxmail password #14218

Closed
15 changes: 15 additions & 0 deletions lib/rex/post/meterpreter/extensions/stdapi/fs/dir.rb
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,21 @@ def Dir.rmdir(path)
delete(path)
end

#
# Returns true if the remote directory exists, false otherwise.
#
def Dir.exist?(path)
begin
entries(path)
rescue ::Rex::Post::Meterpreter::RequestError => e
if e.message =~ /The system cannot find the path specified/
return false
else
raise e
end
end
end
gwillcox-r7 marked this conversation as resolved.
Show resolved Hide resolved

#
# Synonyms for delete.
#
Expand Down