mirror of https://github.com/n1nj4sec/pupy.git
SSH: use exec_command directly without sh to transfer data
This commit is contained in:
parent
eebf843c66
commit
c0b0c81121
|
@ -295,7 +295,6 @@ class SSH(object):
|
|||
transport = self._client.get_transport()
|
||||
|
||||
session = transport.open_session()
|
||||
session.exec_command('sh')
|
||||
|
||||
commands = []
|
||||
|
||||
|
@ -323,9 +322,9 @@ class SSH(object):
|
|||
if delete:
|
||||
commands.append('rm -f {}'.format(repr(remote_path)))
|
||||
|
||||
header = ' && '.join(commands) + '\n'
|
||||
command = ' && '.join(commands)
|
||||
|
||||
session.sendall(header)
|
||||
session.exec_command(command)
|
||||
|
||||
def _reader_cb():
|
||||
data = reader_cb(transport.default_max_packet_size - 1024)
|
||||
|
|
Loading…
Reference in New Issue