Skip to content

Instantly share code, notes, and snippets.

View EMSeek's full-sized avatar

EMSeek

View GitHub Profile
@EMSeek
EMSeek / ELcheck.sh
Created May 11, 2020 23:14
Checking Java for EL injection
#!/bin/bash
# By Eldar Marcussen for SEEK 29/04/2020
echo 'Simplistic Java Expression Language Injection detection'
echo '==================================================}*>>>'
echo ' [*] Identifying use of spring eval with variables:'
grep -HrnE '<spr(ing)?:eval.*\$\{' "$1"
echo ' [*] Identifying EL code definitions.'
grep -hroE '<spr(ing)?:(message|theme).*code=[^>]+>' "$1" | sort -u | sed -e"s/.*code=[\"\']//" -e"s/[\'\"].*//" > /tmp/elcList.txt
echo ' [+] Code list saved as /tmp/elcList.txt'
echo ' [*] Shortlisting codes with arguments.'