Do not use redirected stdout for shares

This commit is contained in:
Oleksii Shevchuk 2016-10-21 23:17:18 +03:00
parent f239180818
commit 19093c13e9
1 changed files with 16 additions and 17 deletions

View File

@ -1,6 +1,5 @@
# -*- coding: UTF8 -*-
from pupylib.PupyModule import *
from pupylib.utils.rpyc_utils import redirected_stdo
from netaddr import *
__class_name__="Shares"
@ -43,8 +42,7 @@ class Shares(PupyModule):
self.client.load_package("wmi")
self.client.load_package("pupwinutils.drives")
with redirected_stdo(self.client.conn):
self.client.conn.modules['pupwinutils.drives'].shared_folders()
print self.client.conn.modules['pupwinutils.drives'].shared_folders()
else:
self.warning('this module works only for windows. Try using: run shares remote -t 127.0.0.1')
@ -68,7 +66,8 @@ class Shares(PupyModule):
self.client.load_package("impacket")
self.client.load_package("calendar")
self.client.load_package("pupyutils.share_enum")
with redirected_stdo(self.client.conn):
for host in hosts:
self.info("Connecting to the remote host: %s" % host)
self.client.conn.modules["pupyutils.share_enum"].connect(host, args.port, args.user, args.passwd, args.hash, args.domain)
print self.client.conn.modules["pupyutils.share_enum"].connect(
host, args.port, args.user, args.passwd, args.hash, args.domain
)