uploaded version 2018_11_15 for python3

This commit is contained in:
Matteo ℱan 2018-11-14 23:13:51 +01:00 committed by GitHub
parent 7130486efc
commit e98858c9d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 1204 additions and 853 deletions

View file

@ -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