Rotten simply required you to use a caesar cipher to decode the text it sent you. Luckily, once decoded, all the text contained the word send and this allowed us to filter out the correct shift.
import socketfrom caesarcipher import CaesarCipherhost ="jh2i.com"port =50034count =0flag = [" "] *30print(len(flag))whileTrue: s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((host, port))whileTrue:try: data = s.recv(1024).decode("utf-8")for i inrange(1, 27, 1): x =CaesarCipher(data, offset=i).encodedif"send"in x:breakif count >0: pos = x.split(" ")[6] char = x.split(" ")[11].replace("\n","")print(pos, char) flag[int(pos)]= char s.sendall(data.encode())iflen(data)==0:break count +=1except:print("error", flag) s.close() count =0breakif" "notin flag:break u =""for i in flag: u += iprint(u)