#!/usr/bin/env python3
"""
Run Security Test for FreeWallet
Professional security assessment for your own application
"""

import subprocess
import sys
import os

def main():
    print("🔒 FreeWallet Security Assessment")
    print("=" * 50)
    print("⚠️  This tool is for testing YOUR OWN application only!")
    print("🎯 Target: https://app.freewallet.org/")
    print()
    
    # Check if security_assessment.py exists
    if not os.path.exists('security_assessment.py'):
        print("❌ security_assessment.py not found!")
        print("💡 Make sure you're in the correct directory")
        return
    
    # Run the security assessment
    print("🚀 Starting security assessment...")
    print("📊 This will test:")
    print("   • Authentication security")
    print("   • Session management")
    print("   • Input validation")
    print("   • Data exposure")
    print("   • Configuration security")
    print()
    
    try:
        # Run the assessment
        result = subprocess.run([
            sys.executable, 
            'security_assessment.py', 
            'https://app.freewallet.org/',
            'freewallet_security_results'
        ], capture_output=True, text=True)
        
        print("📋 Assessment Output:")
        print("-" * 30)
        print(result.stdout)
        
        if result.stderr:
            print("⚠️  Warnings/Errors:")
            print(result.stderr)
            
        print("\n✅ Security assessment completed!")
        print("📁 Results saved to: freewallet_security_results/")
        print("📄 View HTML report: freewallet_security_results/security_report.html")
        
    except Exception as e:
        print(f"❌ Error running assessment: {e}")

if __name__ == '__main__':
    main()
