oops that was broken

This commit is contained in:
JJTech0130 2023-04-07 20:51:15 -04:00
parent f30178a70c
commit 3b26a9eeb4
No known key found for this signature in database
GPG key ID: 23C92EBCCF8F93D6

View file

@ -94,11 +94,11 @@ def proxy(conn1: tlslite.TLSConnection, conn2: tlslite.TLSConnection, prefix: st
conn1.close() conn1.close()
conn2.close() conn2.close()
def repl(conn: tlslite.TLSConnection): def repl(conn1: tlslite.TLSConnection, conn2: tlslite.TLSConnection):
while True: while True:
i = input(">>> ") i = input(">>> ")
if "ro" in i: if "ro" in i:
print("Replaying last outgoing packet") #print("Replaying outgoing packet")
try: try:
index = int(i[2:]) index = int(i[2:])
except ValueError: except ValueError:
@ -108,7 +108,7 @@ def repl(conn: tlslite.TLSConnection):
print("Invalid index") print("Invalid index")
continue continue
print("Replaying outgoing packet") print("Replaying outgoing packet")
conn.write(outgoing_list[index]) conn2.write(outgoing_list[index])
# Print the packet # Print the packet
printer.pretty_print_payload("[REPLAY] apsd -> APNs", apns._deserialize_payload_from_buffer(outgoing_list[index])) printer.pretty_print_payload("[REPLAY] apsd -> APNs", apns._deserialize_payload_from_buffer(outgoing_list[index]))
@ -128,7 +128,7 @@ def repl(conn: tlslite.TLSConnection):
print(f" {payload[1][i][0]}: {payload[1][i][1]}") print(f" {payload[1][i][0]}: {payload[1][i][1]}")
elif "ri" in i: elif "ri" in i:
print("Replaying last outgoing packet") #print("Replaying incoming packet")
try: try:
index = int(i[2:]) index = int(i[2:])
except ValueError: except ValueError:
@ -137,8 +137,8 @@ def repl(conn: tlslite.TLSConnection):
if index >= len(incoming_list): if index >= len(incoming_list):
print("Invalid index") print("Invalid index")
continue continue
print("Replaying outgoing packet") print("Replaying incoming packet")
conn.write(incoming_list[index]) conn1.write(incoming_list[index])
# Print the packet # Print the packet
printer.pretty_print_payload("[REPLAY] APNs -> apsd", apns._deserialize_payload_from_buffer(incoming_list[index])) printer.pretty_print_payload("[REPLAY] APNs -> apsd", apns._deserialize_payload_from_buffer(incoming_list[index]))
@ -174,7 +174,7 @@ def handle(conn: socket.socket):
apns = connect() apns = connect()
print("Connected to APNs") print("Connected to APNs")
threading.Thread(target=repl, args=(s_conn,)).start() threading.Thread(target=repl, args=(s_conn,apns)).start()
global global_cnt global global_cnt
global_cnt += 1 global_cnt += 1