[winrm] platform check when doing kerberos auth

Signed-off-by: XiaoliChan <2209553467@qq.com>
This commit is contained in:
XiaoliChan
2023-10-31 21:43:36 +08:00
parent 9fbe8d5bec
commit e2bc4bdd97
+16 -1
View File
@@ -5,6 +5,7 @@ import requests
import urllib3
import tempfile
import contextlib
import platform
import xml.etree.ElementTree as ET
from io import StringIO
@@ -43,6 +44,20 @@ class winrm(connection):
connection.__init__(self, args, db, host)
def proto_flow(self):
if self.kerberos and (platform.system() != "Linux"):
self.logger.info("Doing kerberos auth with WINRM only support Linux platform!")
return False
self.proto_logger()
if self.create_conn_obj():
self.enum_host_info()
self.print_host_info()
if self.login():
if hasattr(self.args, "module") and self.args.module:
self.call_modules()
else:
self.call_cmd_args()
def proto_logger(self):
self.logger = NXCAdapter(
extra={
@@ -496,4 +511,4 @@ class winrm(connection):
perSecretCallback=lambda secret_type, secret: self.logger.highlight(secret),
)
LSA.dumpCachedHashes()
LSA.dumpSecrets()
LSA.dumpSecrets()