mirror of
https://github.com/Py-KMS-Organization/py-kms.git
synced 2025-05-20 11:19:25 +02:00
uploaded version 2018_11_15 for python3
This commit is contained in:
parent
7130486efc
commit
e98858c9d0
18 changed files with 1204 additions and 853 deletions
|
@ -2,19 +2,15 @@
|
|||
|
||||
import binascii
|
||||
import logging
|
||||
import struct
|
||||
import uuid
|
||||
|
||||
from dcerpc import MSRPCRequestHeader, MSRPCRespHeader
|
||||
import kmsBase
|
||||
import rpcBase
|
||||
from formatText import justify, shell_message, byterize
|
||||
|
||||
|
||||
class handler(rpcBase.rpcBase):
|
||||
def parseRequest(self):
|
||||
request = MSRPCRequestHeader(self.data)
|
||||
|
||||
shell_message(nshell = 14)
|
||||
request = byterize(request)
|
||||
logging.debug("RPC Message Request Bytes: \n%s\n" % justify(binascii.b2a_hex(self.data).decode('utf-8')))
|
||||
|
@ -22,9 +18,7 @@ class handler(rpcBase.rpcBase):
|
|||
|
||||
return request
|
||||
|
||||
def generateResponse(self):
|
||||
request = self.requestData
|
||||
|
||||
def generateResponse(self, request):
|
||||
responseData = kmsBase.generateKmsResponseData(request['pduData'], self.config)
|
||||
envelopeLength = len(responseData)
|
||||
|
||||
|
@ -45,7 +39,7 @@ class handler(rpcBase.rpcBase):
|
|||
shell_message(nshell = 17)
|
||||
response = byterize(response)
|
||||
logging.debug("RPC Message Response: \n%s\n" % justify(response.dump(print_to_stdout = False)))
|
||||
logging.debug("RPC Message Response Bytes: \n%s\n" % justify(binascii.b2a_hex(str(response).encode('latin-1')).decode('utf-8'))) #*2to3*
|
||||
logging.debug("RPC Message Response Bytes: \n%s\n" % justify(binascii.b2a_hex(str(response).encode('latin-1')).decode('utf-8')))
|
||||
|
||||
return response
|
||||
|
||||
|
@ -64,7 +58,7 @@ class handler(rpcBase.rpcBase):
|
|||
shell_message(nshell = 11)
|
||||
request = byterize(request)
|
||||
logging.debug("RPC Message Request: \n%s\n" % justify(request.dump(print_to_stdout = False)))
|
||||
logging.debug("RPC Message Request Bytes: \n%s\n" % justify(binascii.b2a_hex(str(request).encode('latin-1')).decode('utf-8'))) #*2to3*
|
||||
logging.debug("RPC Message Request Bytes: \n%s\n" % justify(binascii.b2a_hex(str(request).encode('latin-1')).decode('utf-8')))
|
||||
|
||||
return request
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue