Skip to content

Commit

Permalink
Add ssh.read and ssh.write aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
zachriggle committed Sep 28, 2016
1 parent 4893819 commit 869ec42
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pwnlib/tubes/ssh.py
Expand Up @@ -1387,7 +1387,6 @@ def upload_data(self, data, remote):
if result != 0:
self.error("Could not upload file %r (%r)\n%s" % (remote, result, data))


def upload_file(self, filename, remote = None):
"""Uploads a file to the remote server. Returns the remote filename.
Expand Down Expand Up @@ -1569,3 +1568,11 @@ def set_working_directory(self, wd = None):
self.info("Working directory: %r" % wd)
self.cwd = wd
return self.cwd

def write(self, path, data):
"""Wrapper around upload_data to match ``pwnlib.util.misc.write``"""
return self.upload_data(data, path)

def read(self, path):
"""Wrapper around download_data to match ``pwnlib.util.misc.read``"""
return self.download_data(path)

0 comments on commit 869ec42

Please sign in to comment.