Skip to content

Instantly share code, notes, and snippets.

@chinmaydd
Last active June 23, 2018 16:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chinmaydd/dc66274ee136b85f974be15f25cbfde0 to your computer and use it in GitHub Desktop.
Save chinmaydd/dc66274ee136b85f974be15f25cbfde0 to your computer and use it in GitHub Desktop.
1d151e00011d00415e244e4f4a06001e112d1e003a0a191b111e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
4357475e5e7d0022281600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
6a07111b0a1e480e1311070700187b2bc0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
6a07111b0a1e480e1311070700187b2b49c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
6a07111b0a1e480e1311070700187b2b495ec000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
6a07111b0a1e480e1311070700187b2b495e4bc0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
6a07111b0a1e480e1311070700187b2b495e4b2ac00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
6a07111b0a1e480e1311070700187b2b495e4bea000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
6a07111b0a1e480e1311070700187b2b495ecb2a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
6a07111b0a1e480e1311070700187b2b49de4b2a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
6a07111b0a1e480e1311070700187b2bc95e4b2a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
6a07111b0a1e480e1311070700187b2b00c95e4b2a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
6a07111b0a1e480e1311070700187b2b0049de4b2a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
6a07111b0a1e480e1311070700187b2b00495ecb2a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
6a07111b0a1e480e1311070700187b2b00495e4bea0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
6a07111b0a1e480e1311070700187b2b00495e4b2ac000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
6a07111b0a1e480e1311070700187b2b00495e4b2a13c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
6a07111b0a1e480e1311070700187b2b00495e4b2a132ec00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
6a07111b0a1e480e1311070700187b2b00495e4b2a132e19c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
6a07111b0a1e480e1311070700187b2b00495e4b2a132e1911c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
6a07111b0a1e480e1311070700187b2b00495e4b2a132e19d100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
6a07111b0a1e480e1311070700187b2b00495e4b2a132ed91100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
6a07111b0a1e480e1311070700187b2b00495e4b2a13d9110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
6a07111b0a1e480e1311070700187b2b00495e4b2a132ed91100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
6a07111b0a1e480e1311070700187b2b00495e4b2a13d9110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
6a07111b0a1e480e1311070700187b2b00495e4b2a1302d91100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
6a07111b0a1e480e1311070700187b2b00495e4b2a130219d100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
6a07111b0a1e480e1311070700187b2b00495e4b2a13021911c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
6a07111b0a1e480e1311070700187b2b00495e4b2a1302191138c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
6a07111b0a1e480e1311070700187b2b00495e4b2a130219113801c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
6a07111b0a1e480e1311070700187b2b00495e4b2a1302191138011dc0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
6a07111b0a1e480e1311070700187b2b00495e4b2a1302191138011d19c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
6a07111b0a1e480e1311070700187b2b00495e4b2a1302191138011d1938c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
6a07111b0a1e480e1311070700187b2b00495e4b2a1302191138011d19380ec0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
6a07111b0a1e480e1311070700187b2b00495e4b2a1302191138011d19380e3cc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
6a07111b0a1e480e1311070700187b2b00495e4b2a1302191138011d19380e3c3cc000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
6a07111b0a1e480e1311070700187b2b00495e4b2a1302191138011d19380e3cc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
6a07111b0a1e480e1311070700187b2b00495e4b2a1302191138011d19380ec0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
6a07111b0a1e480e1311070700187b2b00495e4b2a1302191138011d19380e12c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
6a07111b0a1e480e1311070700187b2b00495e4b2a1302191138011d19380e1212c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
6a07111b0a1e480e1311070700187b2b00495e4b2a1302191138011d19380e121205c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
6a07111b0a1e480e1311070700187b2b00495e4b2a1302191138011d19380e1212053bc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
1d151e00011d00415e244e4f4a06001e112d1e003a0a191b111e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
# Analysis:
# packetType: 'B' - EB_BRAILLE_DISPLAY
# packetSubType: 'S' - EB_BRAILLE_DISPLAY_STATIC
import textwrap
import string
class Packet:
def __init__(self, packetSize=None, packetType=None, packetSubType=None, packetData=None):
self.packetSize = packetSize
self.packetType = packetType
self.packetSubType = packetSubType
self.packetData = packetData
# Packet info is of the form:
# 02:00:04:53:49:03:55:55:55:55:55:55:55:
def load_raw(self, packet_info):
sections = packet_info.split(':')
stx = sections[0]
packetSize = int(sections[1] + sections[2], 16)
packetType = int(sections[3], 16)
packetSubType = int(sections[4], 16)
etx = sections.index("03")
packetData = (''.join(sections[5:etx]))
self.packetSize = packetSize
self.packetType = packetType
self.packetSubType = packetSubType
self.packetData = packetData
if __name__ == "__main__":
conversation = open('final_conversations.txt', 'r').read().splitlines()
p_list = []
for packet in conversation[1:]:
t_p = Packet()
t_p.load_raw(packet)
p_list.append(t_p)
temp = textwrap.wrap(t_p.packetData, 2)
print ''.join([x.decode('hex') for x in temp if x.decode('hex') in string.printable])
init_packet = conversation[0]
config_packet = Packet()
config_packet.load_raw(init_packet)
'''
print "[+] Config Packet:"
print "[+] packetType:" + hex(config_packet.packetType)
print "[+] packetSubType:" + hex(config_packet.packetSubType)
print "[+] ***********"
'''
# Loading up some more config packets for analysis
s_config = open('data', 'r').read().splitlines()
for s_packet in s_config:
packet = Packet()
packet.load_raw(s_packet)
'''
print "[+] S_CONFIG Packet: "
print "[+] packetType:" + hex(packet.packetType)
print "[+] packetSubType:" + hex(packet.packetSubType)
print "[+] packetData:" + packet.packetData
print "[+] ***********"
'''
if packet.packetSubType == 0x47:
# print "[+] Display Length: " + str(int(packet.packetData, 16))
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment