[smb] smbexec: try in 'hRCreateServiceW'
Signed-off-by: XiaoliChan <2209553467@qq.com>main
parent
b9ef2d1b91
commit
ed0a295435
|
@ -127,16 +127,24 @@ class SMBEXEC:
|
||||||
self.logger.debug("Command to execute: " + command)
|
self.logger.debug("Command to execute: " + command)
|
||||||
|
|
||||||
self.logger.debug(f"Remote service {self.__serviceName} created.")
|
self.logger.debug(f"Remote service {self.__serviceName} created.")
|
||||||
resp = scmr.hRCreateServiceW(
|
|
||||||
self.__scmr,
|
try:
|
||||||
self.__scHandle,
|
resp = scmr.hRCreateServiceW(
|
||||||
self.__serviceName,
|
self.__scmr,
|
||||||
self.__serviceName,
|
self.__scHandle,
|
||||||
lpBinaryPathName=command,
|
self.__serviceName,
|
||||||
dwStartType=scmr.SERVICE_DEMAND_START,
|
self.__serviceName,
|
||||||
)
|
lpBinaryPathName=command,
|
||||||
service = resp["lpServiceHandle"]
|
dwStartType=scmr.SERVICE_DEMAND_START,
|
||||||
|
)
|
||||||
|
service = resp["lpServiceHandle"]
|
||||||
|
except Exception as e:
|
||||||
|
if "rpc_s_access_denied" in str(e):
|
||||||
|
self.logger.fail("SMBEXEC: Create services got blocked.")
|
||||||
|
return self.__outputBuffer
|
||||||
|
else:
|
||||||
|
pass
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.logger.debug(f"Remote service {self.__serviceName} started.")
|
self.logger.debug(f"Remote service {self.__serviceName} started.")
|
||||||
scmr.hRStartServiceW(self.__scmr, service)
|
scmr.hRStartServiceW(self.__scmr, service)
|
||||||
|
|
Loading…
Reference in New Issue