[winrm] ruff

Signed-off-by: XiaoliChan <2209553467@qq.com>
main
XiaoliChan 2023-10-31 16:25:21 +08:00
parent 9c5f7d6488
commit 9fbe8d5bec
2 changed files with 9 additions and 7 deletions

View File

@ -23,7 +23,7 @@ jobs:
cache-dependency-path: poetry.lock
- name: Install dependencies with dev group
run: |
sudo apt-get install gcc python3-dev libkrb5-dev gss-ntlmssp
sudo apt-get install gcc python3-dev libkrb5-dev gss-ntlmssp -y
poetry install --with dev
- name: Run ruff
run: |

View File

@ -259,12 +259,14 @@ class winrm(connection):
# So, we can get a TGT when doing nthash with kerberos auth
def getTGT(self):
userName = Principal(self.username, type=constants.PrincipalNameType.NT_PRINCIPAL.value)
tgt, cipher, oldSessionKey, sessionKey = getKerberosTGT(clientName = userName,
password = self.password,
domain = self.domain,
lmhash = unhexlify(self.lmhash),
nthash = unhexlify(self.nthash),
kdcHost = self.kdcHost)
tgt, cipher, oldSessionKey, sessionKey = getKerberosTGT(
clientName=userName,
password=self.password,
domain=self.domain,
lmhash=unhexlify(self.lmhash),
nthash=unhexlify(self.nthash),
kdcHost=self.kdcHost
)
ccache = CCache()
ccache.fromTGT(tgt, oldSessionKey, sessionKey)
tgt_file = os.path.join(tempfile.gettempdir(), f"{self.username}@{self.domain}.ccache")