This commit is contained in:
worawit
2017-07-25 21:26:55 +07:00
parent 5c2bcc0364
commit a7e9d3d44d

View File

@@ -907,6 +907,7 @@ def smb_send_file(smbConn, localSrc, remoteDrive, remotePath):
smbConn.putFile(remoteDrive + '$', remotePath, fp.read)
# based on impacket/examples/serviceinstall.py
# Note: using Windows Service to execute command same as how psexec works
def service_exec(conn, cmd):
import random
import string
@@ -918,7 +919,7 @@ def service_exec(conn, cmd):
rpcsvc = conn.get_dce_rpc('svcctl')
rpcsvc.connect()
rpcsvc.bind(scmr.MSRPC_UUID_SCMR)
svnHandle = None
svcHandle = None
try:
print("Opening SVCManager on %s....." % conn.get_remote_host())
resp = scmr.hROpenSCManagerW(rpcsvc)