A Django library to secure the admin panel by faking login pages and logging attempts.
Project description
djadminshield
A Django library to secure the admin panel by faking login pages and logging attempts.
Installation
pip install djadminshield
Usage
Migrate the database by executing the django migrate command.
python manage.py migrate
If you didn't create your superuser please create the superuser.
python manage.py createsuperuser
Installed the library in the settings.py file
INSTALLED_APPS = [
.....,
'djadminshield',
]
Now go to the project directory urls.py file and add the below code.
from django.contrib import admin
from django.urls import include, path
from djadminshield import views
urlpatterns = [
path('admin/', views.fake_admin_login, name='fake_admin_login'),
path('real-admin-url/', admin.site.urls),
]
In above code we import the views from the djadminshield library so we can use the djadminshield view functions.
Then we added the fake admin login page to the 'admin/' url route. You can see we using the djadminshield fake_admin_login function to render the fake admin login pages.
second url route is for the actual admin user login page, for demonstration purposes we named it as 'real-admin-url/' but you can give what ever you want. Please make sure to the given url route is not guessable by hackers.
How to try
Then you can this by directing to the admin URL like www.example.com/admin then this will directed to the fake admin dashboard login page. This login page is exactly same as the real django admin login page.
If someone trying to login as admin those attempt will be recorded and website real admin user can see them by simply going to the admin dashboard. In the Django admin dashboard, under the “DJADMINSHIELD” there’s a table called “Unauthorized Access Attempts”. In there by using that table you can get information such as ip address, attempt time, browser, operating system, device type, prefer languages by unauthorized hacker, and a description. This description might be helpful because let’s say a hacker successfully find the username and password and trying to login to the dashboard via the fake login page that action is captured and this description is showing to the real admin user someone is somehow get the real username and password. Then the real admin can update the password immediately. Even if hacker guess or get the real username and password the fake login page might not be log them in instead it showing the same error that password and username is not correct.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file djadminshield-0.1.0.tar.gz.
File metadata
- Download URL: djadminshield-0.1.0.tar.gz
- Upload date:
- Size: 9.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fad768ea46d08b06d95d1717c5bdc863bf97643d52e5e47a91e003bf900ad856
|
|
| MD5 |
849e39c2a3e4dbbcbb65b8ecb380a5e0
|
|
| BLAKE2b-256 |
b3373a0a3df247ea1eac7d95861cb680cefabde430242a14e81d193ef12a5eb4
|
File details
Details for the file djadminshield-0.1.0-py3-none-any.whl.
File metadata
- Download URL: djadminshield-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d4649cb6ebaa68e837f3ea472255d772d5235bd092231351af193a1f79544c68
|
|
| MD5 |
767ebda019fbf3e54a490a18c5d2e03c
|
|
| BLAKE2b-256 |
76a48e59a50d3e7204b62d85c0ff7d110521c5304b7adb4494e21b1cf03657d5
|