mitm.py: Intercept phonebook request

This commit is contained in:
Christina Quast
2015-05-04 17:50:32 +02:00
parent 789a4013b4
commit 34d4eb3f5f
2 changed files with 15 additions and 0 deletions

View File

@@ -12,6 +12,18 @@ PHONE_INT = 0x86
CMD_CHANGE_FIDI = array('B', [0xff, 0x00, 0xff])
CHANGE_FIDI = array('B', [0xff, 0xff, 0xff, 0x00, 0xff])
# Phone book
PHONE_BOOK_REQ = array('B', [0xa0, 0xb2, 0x01, 0x04, 0x1a])
PHONE_BOOK_RESP = array('B', [0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0xff, 0xff, 0xff, 0xff, 0x09, 0x81, 0x22, 0x22,
0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0xff, 0xff, 0xff, 0xff, 0x90, 0x00])
PHONE_BOOK_RESP_MITM = array('B', [0x6d, 0x69, 0x74, 0x6d, 0x20, 0x21, 0x21, 0x21, 0xff, 0xff, 0xff, 0xff, 0x09, 0x81, 0x22, 0x22,
0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0xff, 0xff, 0xff, 0xff, 0x90, 0x00])
PHONE_BOOK_RESP2 = array('B', [0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x90, 0x00])
PHONE_BOOK_RESP_MITM2 = array('B', [0x6d, 0x69, 0x74, 0x6d, 0x20, 0x21, 0x21, 0x21, 0xff, 0xff, 0xff, 0xff, 0x09, 0x81, 0x22, 0x22,
0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0xff, 0xff, 0xff, 0xff, 0x90, 0x00])
CMD_SEL_ROOT = array('B', [0xA0, 0xA4, 0x00, 0x00, 0x02, 0x3F, 0x00])
CMD_SEL_FILE = array('B', [0xA0, 0xA4, 0x00, 0x00, 0x02, 0x7F, 0x20])
CMD_GET_DATA = array('B', [0xA0, 0xC0, 0x00, 0x00, 0x16])

View File

@@ -56,6 +56,9 @@ def replace(data):
elif data[0] == 0x9F:
print("*** Replace return val")
# return array('B', [0x60, 0x00])
elif data == PHONE_BOOK_RESP:
print("*** Replace phone book")
return PHONE_BOOK_RESP_MITM
except ValueError:
print("*** Value error! ")
return data