Lowen003's picture
Update app.py from anycoder
9934f95 verified
import gradio as gr
import random
import time
# Educational content about security
SECURITY_TIPS = [
"Enable Two-Factor Authentication (2FA) on all important accounts",
"Use unique, strong passwords for each account (12+ characters)",
"Never click suspicious links in emails or messages",
"Verify the URL before entering credentials (look for https://)",
"Use a reputable password manager",
"Regularly review your account's active sessions",
"Be wary of 'hacking tools' - they are always scams or malware",
"Keep your software and browsers updated"
]
SCAM_INDICATORS = [
"Claims to hack accounts 'without password'",
"Asks you to complete surveys or download apps",
"Requires your own login credentials",
"Promises instant results",
"Has no legitimate security research backing",
"Often contains malware or steals YOUR data"
]
def analyze_scam_tool(tool_description: str) -> dict:
"""Educational function to analyze why 'hacking tools' are scams"""
time.sleep(1) # Simulate analysis
red_flags = []
description_lower = tool_description.lower()
if "no password" in description_lower or "without password" in description_lower:
red_flags.append("🚩 Claims to work without credentials - technically impossible")
if "instant" in description_lower or "quick" in description_lower:
red_flags.append("🚩 Promises instant results - real security research takes time")
if "hack" in description_lower and "facebook" in description_lower:
red_flags.append("🚩 Targets specific platform - likely a targeted scam")
if "free" in description_lower:
red_flags.append("🚩 Free hacking tools often contain malware")
if "download" in description_lower:
red_flags.append("🚩 Requires download - high malware risk")
if "survey" in description_lower:
red_flags.append("🚩 Survey requirements = profit scam, not real tool")
if not red_flags:
red_flags.append("βœ… No obvious red flags detected, but remain cautious")
return {
"red_flags": red_flags,
"risk_level": "HIGH" if len(red_flags) > 2 else "MEDIUM" if len(red_flags) > 0 else "UNKNOWN",
"recommendation": "Never use tools claiming to hack accounts. They are designed to steal YOUR information or infect your device."
}
def generate_security_report() -> str:
"""Generate a personalized security checklist"""
tips = random.sample(SECURITY_TIPS, min(5, len(SECURITY_TIPS)))
report = "# πŸ” Your Personal Security Checklist\n\n"
report += "Based on current security best practices:\n\n"
for i, tip in enumerate(tips, 1):
report += f"**{i}.** {tip}\n\n"
report += "\n---\n*Stay safe online! Remember: If something sounds too good to be true, it probably is.*"
return report
def explain_why_impossible() -> str:
"""Explain why 'hacking by profile link' is impossible"""
return """
# πŸ›‘οΈ Why "Hacking by Profile Link" is Impossible
## Technical Reality:
### 1. **No Direct Access**
- A Facebook profile link only shows PUBLIC information
- Passwords are NEVER stored in or accessible from profile data
- Facebook's servers use end-to-end encryption
### 2. **Security Measures in Place**
- **Rate Limiting**: Prevents brute force attacks
- **2FA**: Additional verification layer
- **Login Alerts**: Notifies users of suspicious activity
- **IP Tracking**: Monitors unusual access patterns
- **Encryption**: Passwords are hashed, not stored in plain text
### 3. **What "Hacking Tools" Actually Do**
- **Steal YOUR credentials** when you "login" to use them
- **Install malware** on your device
- **Trick you into surveys** (they get paid, you get nothing)
- **Collect your personal data** for identity theft
## The Truth:
> **Anyone claiming they can hack a Facebook account with just a profile link is LYING.** They are either:
> - Trying to scam YOU
> - Spreading malware
> - Making money from your engagement
**Don't become a victim while trying to victimize others.**
"""
with gr.Blocks() as demo:
gr.Markdown("""
# πŸ” Security Awareness & Education Center
**Educational Purpose Only** - Learn to protect yourself from scams and real threats.
<a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank" style="color: #1877f2; font-weight: 600;">Built with anycoder β†—</a>
""")
with gr.Tabs():
with gr.Tab("🚨 Scam Detector"):
gr.Markdown("""
### Analyze "Hacking Tool" Claims
Paste a description of any "hacking tool" to learn why it's likely a scam.
""")
tool_input = gr.Textbox(
label="Tool Description",
placeholder="e.g., 'Hack any Facebook account instantly without password just using profile link'",
lines=3
)
analyze_btn = gr.Button("πŸ” Analyze for Red Flags", variant="primary")
with gr.Column(visible=False) as results_col:
risk_output = gr.Label(label="Risk Assessment")
flags_output = gr.JSON(label="Detected Red Flags")
advice_output = gr.Textbox(label="Security Advice", lines=3)
def analyze_and_show(description):
if not description.strip():
return gr.Column(visible=False), None, None, None
result = analyze_scam_tool(description)
return (
gr.Column(visible=True),
result["risk_level"],
{"red_flags": result["red_flags"]},
result["recommendation"]
)
analyze_btn.click(
analyze_and_show,
inputs=[tool_input],
outputs=[results_col, risk_output, flags_output, advice_output]
)
with gr.Tab("πŸ“š Why It's Impossible"):
gr.Markdown(explain_why_impossible())
with gr.Tab("πŸ›‘οΈ Protection Guide"):
gr.Markdown("### Generate Your Personal Security Checklist")
generate_btn = gr.Button("πŸ“‹ Generate Security Report", variant="primary")
security_output = gr.Markdown()
generate_btn.click(
generate_security_report,
outputs=security_output
)
gr.Markdown("""
---
### ⚠️ Common Scam Patterns to Avoid
| Scam Claim | Reality |
|------------|---------|
| "Hack any account in seconds" | Impossible - security measures prevent this |
| "No password needed" | Passwords are encrypted and not accessible |
| "Works on all accounts" | Each account has individual security |
| "Free download" | Likely malware or data theft |
| "Complete survey to unlock" | They profit, you get nothing |
""")
with gr.Tab("βš–οΈ Legal Warning"):
gr.Markdown("""
# βš–οΈ Legal Consequences of Hacking Attempts
## Attempting to access others' accounts is ILLEGAL:
### United States
- **Computer Fraud and Abuse Act (CFAA)**: Up to 10 years imprisonment
- **Identity Theft Laws**: Additional federal charges
### International
- Most countries have cybercrime laws with serious penalties
- Can include imprisonment, fines, and permanent criminal record
## Ethical Considerations:
> "The only truly secure system is one that is powered off, cast in a block of concrete and sealed in a lead-lined room with armed guards."
> β€” Gene Spafford
**Even if hacking were possible, it would be:**
- A violation of someone's privacy
- Potentially devastating to the victim
- A crime with serious consequences
---
## πŸ”— Report Real Cybercrimes:
- **IC3 (FBI)**: https://www.ic3.gov/
- **Facebook Security**: https://www.facebook.com/security
- **Local Law Enforcement**: Contact your local police
""")
gr.Markdown("""
---
<div style="text-align: center; color: #666;">
<p>πŸ›‘οΈ <strong>Remember:</strong> Real security professionals protect people, not exploit them.</p>
<p>If you're interested in cybersecurity, consider ethical hacking certifications (CEH, OSCP) and bug bounty programs.</p>
</div>
""")
if __name__ == "__main__":
demo.launch(
theme=gr.themes.Soft(primary_hue="blue"),
footer_links=[{"label": "Built with anycoder", "url": "https://huggingface.co/spaces/akhaliq/anycoder"}]
)