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.0.0.tar.gz (7.0 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.0.0-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_admin_trap-1.0.0.tar.gz
  • Upload date:
  • Size: 7.0 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.0.0.tar.gz
Algorithm Hash digest
SHA256 805a8a2646baf31b20c3246e2b4b3b700bf9a9ccf7342838bdd378df3540402e
MD5 2c93e971d6a9dbea3a523c26d27ebe67
BLAKE2b-256 c31c48662f8b60fecd4e154ddaa7c6bf0ad26093f60a2324ef88f6c31c9075c0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_admin_trap-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b7d5fc2fa6867e4048128537558d4e2572521bb312d990d8b08256f9e80b431a
MD5 cd889544b5786049cfa69fa7f71135d3
BLAKE2b-256 fbe91ba17bd883423c03e19415462a141292286864c2ef0329bc82caa77aa89b

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