Skip to main content

🚨 Django Admin Trap - The Ultimate Admin Protection System | Fake admin login page for security & honeypots

Project description

Django Admin Trap 🔐

A completely fake Django admin login page that mimics the real Django admin perfectly. Perfect for security through obscurity, honeypots, or just confusing attackers.

Warning: This is a trap! It looks exactly like the real Django admin but doesn't actually log anyone in.

🚀 Features

  • Perfect Disguise: Looks identical to the real Django admin login
  • No Database: Zero database interactions - completely stateless
  • No Logging: Doesn't store any credentials or attempt data
  • Always Fails: Every login attempt shows "invalid credentials" error
  • Plug & Play: Setup in 2 minutes
  • Django Native: Uses Django's actual admin templates and styling

📦 Installation

pip install django-admin-trap

⚡ Quick Setup

  1. Add to INSTALLED_APPS in settings.py:
INSTALLED_APPS = [
    # ...
    'django_admin_trap',
]
  1. Include URLs in your main urls.py:

Option A: Replace real admin (recommended for traps):

urlpatterns = [
    path('admin/', include('django_admin_trap.urls')),  # Fake admin
    # ... your other URLs
]

Option B: Use alongside real admin:

urlpatterns = [
    path('admin/', include('django_admin_trap.urls')),  # Fake admin
    path('real-admin/', admin.site.urls),  # Real admin (hidden)
    # ... your other URLs
]

Option C: Multiple trap endpoints:

urlpatterns = [
    path('admin/', include('django_admin_trap.urls')),
    path('wp-admin/', include('django_admin_trap.urls')),
    path('administrator/', include('django_admin_trap.urls')),
    path('real-admin/', admin.site.urls),  # Your actual admin
]

🎯 How It Works

  • Any URL under the trap path shows the fake login page
  • All login attempts fail with "invalid credentials" error
  • Shows proper username for authenticated non-staff users
  • Uses Django's actual admin templates for perfect disguise
  • No data is stored, logged, or processed

🛡️ Use Cases

1. Honeypot Security

# Put traps on common admin URLs
urlpatterns = [
    path('admin/', include('django_admin_trap.urls')),  # Main trap
    path('wp-admin/', include('django_admin_trap.urls')),  # WordPress trap
    path('real-admin/', admin.site.urls),  # Your actual admin
]

2. Development Mock

# settings.py
if DEBUG:
    urlpatterns = [
        path('admin/', include('django_admin_trap.urls')),  # Fake admin for dev
    ]
else:
    urlpatterns = [
        path('admin/', admin.site.urls),  # Real admin for production
    ]

3. Client Demos

# Show clients the admin interface without giving access
urlpatterns = [
    path('demo-admin/', include('django_admin_trap.urls')),
]

🔧 Configuration

No configuration needed! The trap works out of the box.

Optional: Custom Template

If you want to customize the login page, create your own template:

  1. Create templates/admin_trap/login.html in your project
  2. Extend the base template:
{% extends "admin/login.html" %}

❓ FAQ

Q: Does this store any data?

A: No. Zero database interactions. Completely stateless.

Q: Can attackers detect this is a trap?

A: It uses Django's actual admin templates and responses, making it very hard to distinguish from a real admin.

Q: What about performance?

A: Minimal performance impact - just template rendering.

Q: Can I use this alongside the real admin?

A: Yes! Put the real admin on a different URL path.

🚨 Security Notes

  • This is a deterrent, not a security solution
  • Use in combination with proper security measures
  • Keep your actual admin secure and hidden
  • Monitor your traps for suspicious activity

📄 License

MIT License - feel free to use in any project.

🔗 Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_admin_trap-1.1.0.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_admin_trap-1.1.0-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file django_admin_trap-1.1.0.tar.gz.

File metadata

  • Download URL: django_admin_trap-1.1.0.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for django_admin_trap-1.1.0.tar.gz
Algorithm Hash digest
SHA256 6174c4fb6f76ce4001e266be796234f747653a58241756daa4851b4b1e6d67de
MD5 ed2cc8ab9e4384dad23eadabe2caa507
BLAKE2b-256 a24498756005e6ae652add6c2b4f97b8ad8d413fb7fac36cea5fa78f586478f9

See more details on using hashes here.

File details

Details for the file django_admin_trap-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_admin_trap-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8f23d7b1adb12e55c8cc81f4d9f7ec706505c72d9084883af0c363642b4446c4
MD5 02361dd84685d16eafb9ea9c056b5d3e
BLAKE2b-256 5f927c055b4945b04781825fad5c55a0a1c205e8964e951f7524e8b84d62452c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page