Pastebin

Paste #39335: No description

< previous paste - next paste>

Pasted by Anonymous Coward

Download View as text

from mitmproxy import http
from datetime import datetime, timezone
import email.utils

# The raw sync-like data you gave me
RAW_SYNC_DATA = (
    b"|\x0b\x10\x01\x1afZ:ADqtAZwyEteq8VKaiQEhQGn7IfkEun0/djK8Sbcv2nCsSCCI1d5jImY/"
    b"RnPukgmrlBuZRxcZrDd49ac3z6Oy5JgXvd5pkeT5Qg==0\xc2\xba\xa7\xc2\xa3\xc3\x9e\xc3\x87"
    b"\xc2\x8f\xc2\x8f\x03P\xc5\xa0\xc3\x87\xc3\x8b\xc5\xa1\xc2\x8b3\x0c 2%z0000016d-4a02-"
    b"d35f-0000-00005971d448:\t\x08\xc3\x80p\x10\xc3\xa0\xc2\xa8\x01\x18Zr\xc2\x81\x01\n"
    b"\x7f\x12}Chrome CHROMEOS 139.0.7258.137 "
    b"(d819ee6e41c5bc8887c57b44a7fa1fac411d1433-refs/branch-heads/7258) channel(dev),"
    b"gzip(gfe)"
)

def request(flow: http.HTTPFlow) -> None:
    if flow.request.method == "POST" and flow.request.pretty_url.startswith("https://clients4.google.com/chrome-sync/command/"):
        date_str = email.utils.format_datetime(datetime.now(timezone.utc))

        headers = {
            "content-type": "application/vnd.google.octet-stream-compressible",
            "vary": "Sec-Fetch-Dest, Sec-Fetch-Mode, Sec-Fetch-Site",
            "cache-control": "no-cache, no-store, max-age=0, must-revalidate",
            "pragma": "no-cache",
            "expires": "Mon, 01 Jan 1990 00:00:00 GMT",
            "date": date_str,
            "content-disposition": 'attachment; filename="response"',
            "cross-origin-opener-policy": "same-origin-allow-popups",
            "server": "ESF",
            "x-xss-protection": "0",
            "x-frame-options": "SAMEORIGIN",
            "x-content-type-options": "nosniff",
            "alt-svc": 'h3=":443"; ma=2592000,h3-29=":443"; ma=2592000',
            "content-length": str(len(RAW_SYNC_DATA)),
        }

        flow.response = http.Response.make(
            200,
            RAW_SYNC_DATA,
            headers
        )

New Paste


Do not write anything in this field if you're a human.

Go to most recent paste.