Skip to content

Instantly share code, notes, and snippets.

@superkeyor
Last active April 30, 2026 18:12
Show Gist options
  • Select an option

  • Save superkeyor/1d3a0107b17785f4b8b62dc38dc75bfb to your computer and use it in GitHub Desktop.

Select an option

Save superkeyor/1d3a0107b17785f4b8b62dc38dc75bfb to your computer and use it in GitHub Desktop.
check vulnerability
#!/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