From a2c2c1748936c34d8f75cdf378c9844b324c9fd9 Mon Sep 17 00:00:00 2001 From: byt3bl33d3r Date: Fri, 20 Nov 2015 20:20:42 -0700 Subject: [PATCH] Added src param for --download (resolves #32) --- core/remotefilesystem.py | 4 ++-- crackmapexec.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/remotefilesystem.py b/core/remotefilesystem.py index 2bf7e1baa..96758c3d8 100644 --- a/core/remotefilesystem.py +++ b/core/remotefilesystem.py @@ -49,8 +49,8 @@ def __init__(self, host, smbconnection): self.__smbconnection = smbconnection def download(self): - out = open(settings.args.download.split('\\')[-1], 'wb') - self.__smbconnection.getFile(settings.args.share, settings.args.download, out.write) + out = open(settings.args.download[1], 'wb') + self.__smbconnection.getFile(settings.args.share, settings.args.download[0], out.write) print_succ("{}:{} Downloaded file".format(self.__host, settings.args.port)) def upload(self): diff --git a/crackmapexec.py b/crackmapexec.py index 0f4e2ec49..66ca04df9 100755 --- a/crackmapexec.py +++ b/crackmapexec.py @@ -125,7 +125,7 @@ bgroup = parser.add_argument_group("Filesystem Interaction", "Options for interacting with filesystems") bgroup.add_argument("--list", metavar='PATH', nargs='?', const='.', type=str, help='List contents of a directory (defaults to top level directory)') -bgroup.add_argument("--download", metavar="PATH", help="Download a file from the remote systems") +bgroup.add_argument("--download", nargs=2, metavar=('SRC', 'DST'), help="Download a file from the remote systems") bgroup.add_argument("--upload", nargs=2, metavar=('SRC', 'DST'), help="Upload a file to the remote systems") bgroup.add_argument("--delete", metavar="PATH", help="Delete a remote file")