-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
Add upload/download/delete/mkdir/rmdir to smb session #18895
Add upload/download/delete/mkdir/rmdir to smb session #18895
Conversation
ff901bb
to
db87cfa
Compare
|
||
full_path = as_ntpath(Pathname.new(shell.cwd).join(remote_path).to_s) | ||
fd = simple_client.open(full_path, 'o') | ||
fd.delete |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the fd object need closed? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we ensure
this close
happens 👀
Side note; I wish the simple client offered a proc
based API so all this cleanup would happen automagically
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
close
is the first thing that happens when calling off to delete
metasploit-framework/lib/rex/proto/smb/simple_client/open_file.rb
Lines 19 to 25 in 3671f9d
def delete | |
begin | |
close | |
rescue StandardError | |
end | |
client.delete(name, tree_id) | |
end |
spec/lib/rex/post/smb/ui/console/command_dispatcher/core_spec.rb
Outdated
Show resolved
Hide resolved
spec/lib/rex/post/smb/ui/console/command_dispatcher/shares_spec.rb
Outdated
Show resolved
Hide resolved
7723904
to
065fe72
Compare
e5f6dca
to
4e6663a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from some methods needing yard docs, it looks good to me 👍
8d76c2d
to
55ed7b2
Compare
7f7088c
to
e2dd58f
Compare
@dwelch-r7 Needs a rebase 👍 |
7104bf7
to
6200642
Compare
d804706
to
cb91c98
Compare
cb91c98
to
689caf4
Compare
Release NotesThis PR adds the ability to upload/download/delete/mkdir/rmdir from within the SMB session type |
Merge after rapid7/ruby_smb#262This PR adds the ability to upload/download/delete/mkdir/rmdir from within the smb session type
Verification Steps
upload <local_file>
andupload <local_file> <remote_path>
download <remote_file>
anddownload <remote_file> <local_path>
mkdir <directory_name>
rmdir <directory_name>