mirror of
https://github.com/SystemRage/py-kms.git
synced 2025-08-09 21:56:27 +08:00
uploaded version 2018_11_15 for python3
This commit is contained in:
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user