Skip to content

feat(lesson): add SQL injection lesson and update tutorial guide (#84) - #131

Merged
amandewatnitrr merged 1 commit into
amandewatnitrr:mainfrom
bhushan4work:fix#84
Oct 21, 2026
Merged

amandewatnitrr merged 1 commit into
amandewatnitrr:mainfrom
bhushan4work:fix#84

Conversation

@bhushan4work

Copy link
Copy Markdown
Contributor

Summary

  • add a foundational SQL injection lesson covering attack types, vulnerable code examples, authentication bypass, safe local testing with sqlmap, and prevention techniques.
  • integrate the existing SQL injection lab and document secure database practices, parameterized queries, and least privilege.
  • add the lesson to the README Tutorial Guide.

closes #84

How I Tested This

  • python3 mask_ip_addresses.py --check passed.
  • verified all 44 table-of-contents anchors.
  • confirmed the diff against upstream/main contains only the two intended files.

…ndewatnitrr#84)

- Add comprehensive lesson-sql-injection.md covering SQLi fundamentals, code-vs-data separation, and database roles.
- Cover in-band (error-based, union-based) and blind (boolean-based, time-based) SQLi mechanisms.
- Include vulnerable PHP and Python code samples and step-by-step auth bypass (' OR '1'='1) walkthrough.
- Introduce sqlmap automated testing strictly targeting 127.0.0.1 with low-risk non-destructive flags.
- Incorporate existing repository lab (sql-injection-lab) with Docker and venv instructions.
- Prioritize parameterized queries / prepared statements with remediated PHP (PDO) and Python implementations.
- Detail defense-in-depth: allowlisting, escaping pitfalls, database hardening, and adaptive password hashing.
- Update README.md tutorial guide to index the new SQL injection lesson.
@vercel

vercel Bot commented Oct 19, 2026

Copy link
Copy Markdown

@bhushan4work is attempting to deploy a commit to the amandewatnitrr's projects Team on Vercel.

A member of the Team first needs to authorize it.

@bhushan4work

Copy link
Copy Markdown
Contributor Author

@amandewatnitrr could u plz do a final review before merge ?

@vercel

vercel Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
hacking-tutorial Ready Ready Preview Oct 21, 2026 6:51am UTC

@amandewatnitrr
amandewatnitrr requested a balanced review from Copilot October 21, 2026 06:53
@amandewatnitrr
amandewatnitrr merged commit 26a9110 into amandewatnitrr:main Oct 21, 2026
8 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

It is a documentation-only addition whose lab references, links, and anchors I verified as accurate, with only a single optional note about the "secure" Python example using un-salted SHA-256.

1 open issue
What changed in this PR

This PR adds a comprehensive, educational SQL Injection (SQLi) lesson to the ethical-hacking/ tutorial series and links it from the README Tutorial Guide. It fills the web-application-security gap identified in issue #84, covering SQLi fundamentals, classifications (in-band, blind, OOB), vulnerable PHP/Python examples, an authentication-bypass walkthrough, safe local sqlmap usage, integration with the repository's existing sql-injection-lab, and defense-in-depth remediation. The lesson is documentation-only and introduces no runtime code changes.

Changes:

  • New ethical-hacking/lesson-sql-injection.md (754 lines) with a TOC, mermaid diagrams, code examples, and a quick-reference table.
  • README Tutorial Guide updated with a link to the new lesson.
  • Lesson references and cross-links the existing sql-injection-lab (endpoints, run commands, smoke tests), which I verified against the actual lab code.
File Description
ethical-hacking/​lesson-sql-injection.md New foundational SQLi lesson; follows the existing lesson-dns.md/lesson-sni.md title+TOC convention, and its lab endpoint/command/data references match the real sql-injection-lab.
README.md Adds a Tutorial Guide link to the new lesson; path and placement are correct.

Review effort: Balanced

Comment on lines +663 to +668
def verify_password_hash(plain_password: str, stored_hash: str) -> bool:
# Example placeholder: in production use bcrypt.checkpw or argon2.PasswordHasher
import hashlib
# Simulating constant-time comparison
computed_hash = hashlib.sha256(plain_password.encode()).hexdigest()
return hmac.compare_digest(computed_hash, stored_hash)

This branch was successfully deployed

1 active deployment
Preview — 4842b18b Deployed Oct 21, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New Lesson: Comprehensive Guide to SQL Injection (SQLi) & Prevention

3 participants