Skip to content

Commit

Permalink
Merge pull request Pennyw0rth#107 from XiaoliChan/winrm-missport
Browse files Browse the repository at this point in the history
[winrm] disable logger & add miss port args
  • Loading branch information
Marshall-Hallenbeck authored Nov 9, 2023
2 parents ad27442 + fef8028 commit 49d4441
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions nxc/protocols/winrm.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import requests
import urllib3
import contextlib
import logging
import xml.etree.ElementTree as ET

from io import StringIO
Expand Down Expand Up @@ -38,6 +39,8 @@ def __init__(self, args, db, host):
connection.__init__(self, args, db, host)

def proto_logger(self):
logging.getLogger("pypsrp").disabled = True
logging.getLogger("pypsrp.wsman").disabled = True
self.logger = NXCAdapter(
extra={
"protocol": "WINRM",
Expand Down Expand Up @@ -242,6 +245,7 @@ def plaintext_login(self, domain, username, password):
try:
self.conn = Client(
self.host,
port=self.port,
auth="ntlm",
username=f"{self.domain}\\{self.username}",
password=self.password,
Expand Down Expand Up @@ -291,6 +295,7 @@ def hash_login(self, domain, username, ntlm_hash):
try:
self.conn = Client(
self.host,
port=self.port,
auth="ntlm",
username=f"{self.domain}\\{self.username}",
password=f"{self.lmhash}:{self.nthash}",
Expand Down

0 comments on commit 49d4441

Please sign in to comment.