Skip to content

Instantly share code, notes, and snippets.

@sumonst21
Forked from jonaslejon/find.sh
Created June 16, 2022 21:07
Show Gist options
  • Save sumonst21/aa8c96ba27391a709985757cd8650a1d to your computer and use it in GitHub Desktop.
Save sumonst21/aa8c96ba27391a709985757cd8650a1d to your computer and use it in GitHub Desktop.
Find Trojan Source unicode characters (CVE-2021-42694 and CVE-2021-42574.)
#/bin/sh
# Usage instructions: sh find.sh php|tr '\n' '; '
# Then copy and paste the output and execute it
ext=$1
C="\u200E \u200F \u202A \u202B \u202C \u202D \u202E \u2066 \u2067 \u2068 \u2069 \u202C"
for a in $C; do echo find . -type f -name \"*.$ext\" -exec grep -H \$\'$a\' {} \\\; ; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment