#!/usr/bin/env python3 import sys, os, time, subprocess url = sys.argv[1] if len(url) % 15 == 0: url += "\0" while len(url) % 15 != 0: url += "\0" for i in range(len(url) // 15): subprocess.check_call(["ping", "-c", "1", "-p", "64" + "".join("{:02X}".format(ord(x)) for x in url[15*i:15*i+15]), "127.0.0.1"], stdout=subprocess.DEVNULL) while True: out = subprocess.check_output(["ping", "-c", "1", "-p", "65", "127.0.0.1"], stderr=subprocess.STDOUT).decode("utf-8") if out.find("icmp_seq=1 ") != -1: break time.sleep(0.2) while True: out = subprocess.check_output(["ping", "-c", "1", "-p", "66", "127.0.0.1"], stderr=subprocess.STDOUT).decode("utf-8") idx = out.find("icmp_seq=") idx2 = out.find(" ", idx) seqnum = int(out[idx+9:idx2]) n0 = seqnum % 256 n1 = seqnum >> 8 if n0 == 0: break print(chr(n0), end="") if n1 == 0: break print(chr(n1), end="")