Last active
May 8, 2023 09:35
-
-
Save fortuna/78d2c5c340e47c0f0e06afdeca866421 to your computer and use it in GitHub Desktop.
ClientHello splitting in Bash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Author: Vinicius Fortuna | |
# Example practical usage at https://github.com/pypi/support/issues/2751#issuecomment-1535248888 | |
mkfifo in.fifo | |
nc -l localhost 8443 < in.fifo | { dd bs=100 count=1; sleep 0.1; cat; } | nc files.pythonhosted.org 443 > in.fifo & | |
time curl --connect-to ::localhost:8443 'https://files.pythonhosted.org/packages/84/a9/2bf119f3f9cff1f376f924e39cfae18dec92a1514784046d185731301281/scipy-1.10.1.tar.gz' > /dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This code is running a local server on port 8443 that intercepts the outgoing flow, splits it on byte 100 using
dd
, then forwards tofiles.pythonhosted.org:443
. We use in.fifo to connect the twonc
commands for the incoming flow.Here is a diagram of what's going on: