Formating

main
Alexander Neff 2024-02-13 01:24:42 +01:00 committed by Alex
parent 1e12cadb33
commit 7e0c0e0c07
2 changed files with 8 additions and 5 deletions

View File

@ -38,7 +38,7 @@ class winrm(connection):
connection.__init__(self, args, db, host)
def proto_logger(self):
# For more details, please check the function "print_host_info"
# For more details, please check the function "print_host_info"
logging.getLogger("pypsrp").disabled = True
logging.getLogger("pypsrp.wsman").disabled = True
self.logger = NXCAdapter(

View File

@ -9,12 +9,14 @@ def decoder(byte_string, decode_type):
else:
return int.from_bytes(byte_string, "little")
def parse_version(version_bytes):
def parse_version(version_bytes):
major_version = version_bytes[0]
minor_version = version_bytes[1]
product_build = decoder(version_bytes[2:4], "int")
return f"{major_version}.{minor_version} Build {product_build}"
def parse_target_info(target_info_bytes):
MsvAvEOL = 0x0000
MsvAvNbComputerName = 0x0001
@ -38,9 +40,9 @@ def parse_target_info(target_info_bytes):
av_id = decoder(target_info_bytes[info_offset:info_offset + 2], "int")
av_len = decoder(target_info_bytes[info_offset + 2:info_offset + 4], "int")
av_value = target_info_bytes[info_offset + 4:info_offset + 4 + av_len]
info_offset = info_offset + 4 + av_len
if av_id == MsvAvEOL:
pass
elif av_id == MsvAvNbComputerName:
@ -68,6 +70,7 @@ def parse_target_info(target_info_bytes):
target_info["MsvAvChannelBindings"] = av_value
return target_info
def parse_challenge(challenge_message):
# TargetNameFields
target_name_fields = challenge_message[12:20]
@ -97,4 +100,4 @@ def parse_challenge(challenge_message):
"target_name": target_name,
"version": version,
"target_info": target_info
}
}