Last active
April 30, 2026 18:12
-
-
Save superkeyor/1d3a0107b17785f4b8b62dc38dc75bfb to your computer and use it in GitHub Desktop.
check vulnerability
This file contains hidden or 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
| #!/usr/bin/env bash | |
| DIR=$PWD; cd /tmp && \ | |
| mkdir cfc && cd cfc && \ | |
| curl -sL https://raw.githubusercontent.com/superkeyor/copy-fail-c/main/vulnerable.c -O && \ | |
| curl -sL https://raw.githubusercontent.com/superkeyor/copy-fail-c/main/utils.c -O && \ | |
| curl -sL https://raw.githubusercontent.com/superkeyor/copy-fail-c/main/utils.h -O && \ | |
| { command -v gcc >/dev/null 2>&1 || { sudo apt-get update -y >/dev/null 2>&1 && sudo apt-get install -y gcc >/dev/null 2>&1; }; } && \ | |
| gcc -O2 vulnerable.c utils.c -o cf_vulnerable 2>/dev/null && \ | |
| ./cf_vulnerable >/dev/null 2>&1; RC=$?; cd /tmp && rm -rf cfc; cd "$DIR"; [ $RC -eq 100 ] && echo "PATCH YOUR KERNEL" || echo "not vulnerable" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment