mirror of
https://github.com/Py-KMS-Organization/py-kms.git
synced 2025-05-24 03:57:15 -04:00
Made all pretty-print process handy
This commit is contained in:
parent
dddc02530b
commit
19e5abbbbd
10 changed files with 149 additions and 122 deletions
|
@ -7,7 +7,8 @@ import uuid
|
|||
import pykms_RpcBase
|
||||
from pykms_Dcerpc import MSRPCHeader, MSRPCBindAck
|
||||
from pykms_Structure import Structure
|
||||
from pykms_Format import justify, byterize, enco, deco, ShellMessage
|
||||
from pykms_Format import justify, byterize, enco, deco
|
||||
from pykms_Misc import pretty_printer
|
||||
|
||||
#--------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
@ -77,7 +78,7 @@ class MSRPCBind(Structure):
|
|||
class handler(pykms_RpcBase.rpcBase):
|
||||
def parseRequest(self):
|
||||
request = MSRPCHeader(self.data)
|
||||
ShellMessage.Process(3).run()
|
||||
pretty_printer(None, num_text = 3)
|
||||
request = byterize(request)
|
||||
loggersrv.debug("RPC Bind Request Bytes: \n%s\n" % justify(deco(binascii.b2a_hex(self.data), 'utf-8')))
|
||||
loggersrv.debug("RPC Bind Request: \n%s\n%s\n" % (justify(request.dump(print_to_stdout = False)),
|
||||
|
@ -121,7 +122,7 @@ class handler(pykms_RpcBase.rpcBase):
|
|||
resp = preparedResponses[ts_uuid]
|
||||
response['ctx_items'] += str(resp)
|
||||
|
||||
ShellMessage.Process(4).run()
|
||||
pretty_printer(None, num_text = 4)
|
||||
response = byterize(response)
|
||||
loggersrv.debug("RPC Bind Response: \n%s\n" % justify(response.dump(print_to_stdout = False)))
|
||||
loggersrv.debug("RPC Bind Response Bytes: \n%s\n" % justify(deco(binascii.b2a_hex(enco(str(response), 'latin-1')), 'utf-8')))
|
||||
|
@ -161,8 +162,8 @@ class handler(pykms_RpcBase.rpcBase):
|
|||
request['flags'] = self.packetFlags['firstFrag'] | self.packetFlags['lastFrag'] | self.packetFlags['multiplex']
|
||||
request['call_id'] = self.srv_config['call_id']
|
||||
request['pduData'] = str(bind)
|
||||
|
||||
ShellMessage.Process(0).run()
|
||||
|
||||
pretty_printer(None, num_text = 0)
|
||||
bind = byterize(bind)
|
||||
request = byterize(request)
|
||||
loggersrv.debug("RPC Bind Request: \n%s\n%s\n" % (justify(request.dump(print_to_stdout = False)),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue