import struct from parsers.parser import Parser class Kerberos(Parser): name = 'Kerberos' def TCP_Parser(self, payload, src_ip_port, dst_ip_port): kerb = str(pkt)[14:] d={} d['header_len']=ord(kerb[0]) & 0x0f d['data']=kerb[4*d['header_len']:] Data = d['data'][20:] ''' Taken from Pcredz because I didn't want to spend the time doing this myself I should probably figure this out on my own but hey, time isn't free, why reinvent the wheel? Maybe replace this eventually with the kerberos python lib Parses Kerberosv5 hashes from packets ''' try: MsgType = Data[21:22] EncType = Data[43:44] MessageType = Data[32:33] except IndexError: return if MsgType == "\x0a" and EncType == "\x17" and MessageType =="\x02": if Data[49:53] == "\xa2\x36\x04\x34" or Data[49:53] == "\xa2\x35\x04\x33": HashLen = struct.unpack('