django-rickroll-0.1.1
توضیحات
Rickrolling Django middleware to annoy potential hackers
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | django-rickroll-0.1.1 |
| نام | django-rickroll |
| نسخه کتابخانه | 0.1.1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | David Winterbottom |
| ایمیل نویسنده | david.winterbottom@gmail.com |
| آدرس صفحه اصلی | https://github.com/codeinthehole/django-rickroll |
| آدرس اینترنتی | https://pypi.org/project/django-rickroll/ |
| مجوز | Copyright (C) 2012 David Winterbottom Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
===============
Django Rickroll
===============
A novel way of handling malicious requests within a Django application.
Installation
------------
Install from PyPi (stable)::
pip install django-rickroll
or Github (dev)::
pip install -e git://github.com/codeinthehole/django-rickroll.git#egg=django-rickroll
Add ``'rickroll'`` to your ``INSTALLED_APPS`` and the following to your
``MIDDLEWARE_CLASSES``::
'rickroll.middleware.HackingAttemptMiddleware'
Usage
-----
Wherever you detect a hacking attempt, raise a ``HackingAttempt`` exception
and the middleware will rickroll the offending user.
For example, in your ``views.py``::
from rickroll.exceptions import HackingAttempt
def some_view(request):
# ...
if hacking_detected:
raise HackingAttempt()
then the user in question will get redirected to http://www.youtube.com/watch?v=dQw4w9WgXcQ.
The destination can be overridden using the setting ``RICKROLL_URL``.
Discussion
----------
If your site ever gets penetration tested, the testing company will likely manipulate
every request to your site where there are parameters being passed (query
parameters, POST params, cookies etc). When you encounter a parameter which
should be an integer but has value ``../../../../../../etc/passwd``, it's not
always clear what the "right" response should be. I thought it would be funny
to rickroll.
نحوه نصب
نصب پکیج whl django-rickroll-0.1.1:
pip install django-rickroll-0.1.1.whl
نصب پکیج tar.gz django-rickroll-0.1.1:
pip install django-rickroll-0.1.1.tar.gz