Formating
parent
1e12cadb33
commit
7e0c0e0c07
|
@ -38,7 +38,7 @@ class winrm(connection):
|
||||||
connection.__init__(self, args, db, host)
|
connection.__init__(self, args, db, host)
|
||||||
|
|
||||||
def proto_logger(self):
|
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").disabled = True
|
||||||
logging.getLogger("pypsrp.wsman").disabled = True
|
logging.getLogger("pypsrp.wsman").disabled = True
|
||||||
self.logger = NXCAdapter(
|
self.logger = NXCAdapter(
|
||||||
|
|
|
@ -9,12 +9,14 @@ def decoder(byte_string, decode_type):
|
||||||
else:
|
else:
|
||||||
return int.from_bytes(byte_string, "little")
|
return int.from_bytes(byte_string, "little")
|
||||||
|
|
||||||
def parse_version(version_bytes):
|
|
||||||
|
def parse_version(version_bytes):
|
||||||
major_version = version_bytes[0]
|
major_version = version_bytes[0]
|
||||||
minor_version = version_bytes[1]
|
minor_version = version_bytes[1]
|
||||||
product_build = decoder(version_bytes[2:4], "int")
|
product_build = decoder(version_bytes[2:4], "int")
|
||||||
return f"{major_version}.{minor_version} Build {product_build}"
|
return f"{major_version}.{minor_version} Build {product_build}"
|
||||||
|
|
||||||
|
|
||||||
def parse_target_info(target_info_bytes):
|
def parse_target_info(target_info_bytes):
|
||||||
MsvAvEOL = 0x0000
|
MsvAvEOL = 0x0000
|
||||||
MsvAvNbComputerName = 0x0001
|
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_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_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]
|
av_value = target_info_bytes[info_offset + 4:info_offset + 4 + av_len]
|
||||||
|
|
||||||
info_offset = info_offset + 4 + av_len
|
info_offset = info_offset + 4 + av_len
|
||||||
|
|
||||||
if av_id == MsvAvEOL:
|
if av_id == MsvAvEOL:
|
||||||
pass
|
pass
|
||||||
elif av_id == MsvAvNbComputerName:
|
elif av_id == MsvAvNbComputerName:
|
||||||
|
@ -68,6 +70,7 @@ def parse_target_info(target_info_bytes):
|
||||||
target_info["MsvAvChannelBindings"] = av_value
|
target_info["MsvAvChannelBindings"] = av_value
|
||||||
return target_info
|
return target_info
|
||||||
|
|
||||||
|
|
||||||
def parse_challenge(challenge_message):
|
def parse_challenge(challenge_message):
|
||||||
# TargetNameFields
|
# TargetNameFields
|
||||||
target_name_fields = challenge_message[12:20]
|
target_name_fields = challenge_message[12:20]
|
||||||
|
@ -97,4 +100,4 @@ def parse_challenge(challenge_message):
|
||||||
"target_name": target_name,
|
"target_name": target_name,
|
||||||
"version": version,
|
"version": version,
|
||||||
"target_info": target_info
|
"target_info": target_info
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue