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.1.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.1-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_admin_trap-1.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 cd16dd6c1f828a50fc182efa387684f3e636f079e6f37174fc03388a628ca85e
MD5 f8b170f747cd3eb12d6dc16efffabe40
BLAKE2b-256 8f4f4e824e7c7aba7e6af5bbb92835c50315426b12b09bfb75fc8e3ad0bf1f03

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_admin_trap-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cb7d42826f5df14c6bb22a1ec3fe6f0ebdd0b22003a988d710cf5841911bf95d
MD5 3032d66b9114b7dbe01c084b887bd011
BLAKE2b-256 d49f0349788bcb42c6c84fe0694ffe60ee53858e74cdfa602fe5e5f964a23a5f

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