Skip to main content

Non-intrusive Security Assessment Tool - Educational Security Scanner

Project description

🧪 Mini Pentest Lab

สนามทดลองสำหรับการศึกษาและป้องกันช่องโหว่

⚠️ คำเตือนสำคัญ

ใช้เพื่อการศึกษาเท่านั้น!

  • ❌ ไม่ควรใช้ใน production
  • ❌ ไม่ควรเปิดให้เข้าถึงจาก internet
  • ❌ ไม่ควรใช้ข้อมูลจริง
  • ✅ ใช้เพื่อเรียนรู้และป้องกันช่องโหว่

🎯 เป้าหมาย

สร้าง "สนามทดลอง" ที่ทำให้เห็นว่า:

  • ช่องโหว่เกิดยังไง
  • ความเสี่ยงคืออะไร
  • ควรแก้ยังไง

🏗️ โครงสร้างโปรเจกต์

mini-pentest-lab/
│
├── vulnerable-app/        # เว็บเป้าหมาย (มีช่องโหว่)
│   ├── app/
│   ├── database/
│   ├── templates/
│   └── README.md
│
├── secure-app/            # เว็บที่แก้ไขช่องโหว่แล้ว ✅
│   ├── app/
│   ├── database/
│   ├── templates/
│   └── README.md
│
├── scanner/               # โปรแกรมวิเคราะห์ช่องโหว่
│   ├── core/
│   ├── checks/
│   └── scanner.py
│
├── dashboard/             # เว็บแสดงผล
│   ├── backend/
│   └── frontend/
│
├── tests/                 # Test cases
│   └── test_vulnerabilities.py
│
├── reports/               # รายงานที่ generate
│
├── docs/                  # เอกสารประกอบ
│   ├── BEST_PRACTICES.md
│   └── THREAT_MODEL.md
│
└── README.md

🚀 Quick Start

สำหรับผู้ที่เก็บ Python ไว้ที่ D:\py

วิธีที่ง่ายที่สุด (แนะนำ):

cd D:\H123\mini-pentest-lab
RUN_ALL.bat

หรือใช้ QUICK_RUN.bat - จะรันทุกอย่างอัตโนมัติ!


วิธีแบบละเอียด

1. ติดตั้ง Dependencies (ทำครั้งเดียว)

cd D:\H123\mini-pentest-lab
setup.bat

2. รัน Vulnerable App (มีช่องโหว่)

Terminal 1:

cd D:\H123\mini-pentest-lab
start_vulnerable_app.bat

เปิดเบราว์เซอร์: http://127.0.0.1:5000

3. รัน Tests

Terminal 2:

cd D:\H123\mini-pentest-lab\tests
run_tests_custom.bat

ดู SIMPLE_GUIDE.md สำหรับคู่มือง่ายๆ


สำหรับผู้ที่ Python อยู่ใน PATH

1. Vulnerable App (มีช่องโหว่)

cd vulnerable-app
pip install -r requirements.txt
python -m app.main

เปิดเบราว์เซอร์: http://127.0.0.1:5000

2. Secure App (แก้ไขช่องโหว่แล้ว)

cd secure-app
pip install -r requirements.txt
python -m app.main

เปิดเบราว์เซอร์: http://127.0.0.1:5002

3. Scanner

cd scanner
pip install -r requirements.txt
python scanner.py http://127.0.0.1:5000

4. Dashboard

cd dashboard/backend
pip install -r requirements.txt
python app.py

เปิดเบราว์เซอร์: http://127.0.0.1:5001

5. Tests

cd tests
pip install requests
python test_vulnerabilities.py

👤 บัญชีผู้ใช้เริ่มต้น

Admin

  • Username: admin
  • Password: admin123

User

  • Username: user1
  • Password: password123

🔍 ช่องโหว่ที่จงใจสร้าง (ใน Vulnerable App)

  1. SQL Injection - Login, Register, Search
  2. Cross-Site Scripting (XSS) - Search, Post creation
  3. Insecure Direct Object Reference (IDOR) - Profile view
  4. Weak Authentication - MD5 hashing, no rate limiting
  5. Session Management Issues - No session regeneration
  6. Information Disclosure - Error messages, Debug endpoint
  7. Cross-Site Request Forgery (CSRF) - Form submissions
  8. Path Traversal - File viewer

📚 วิธีศึกษา

Phase 1: สังเกตและเข้าใจ

  1. ใช้ Vulnerable App (login, สร้าง post, ดู profile)
  2. เปิด Browser DevTools ดู Request/Response
  3. สังเกต error messages
  4. ดูโค้ดใน vulnerable-app/app/

Phase 2: วิเคราะห์ความเสี่ยง

  1. ระบุช่องโหว่แต่ละจุด
  2. ประเมินความรุนแรง
  3. คิดว่าผู้โจมตีจะใช้ประโยชน์อย่างไร

Phase 3: เรียนรู้การป้องกัน

  1. ดู Secure App เปรียบเทียบ
  2. อ่าน Best Practices
  3. ดู Threat Model

Phase 4: ทดสอบ

  1. รัน Scanner
  2. รัน Tests
  3. ใช้ Dashboard ดูผล

📖 เอกสาร

📚 คู่มือหลัก

  • USER_MANUAL.md - 📖 คู่มือการใช้งานแบบละเอียด (แนะนำ!)
  • QUICKSTART.md - คู่มือเริ่มต้นใช้งาน
  • START_HERE.md - คู่มือสำหรับ Python ที่ D:\py
  • SIMPLE_GUIDE.md - คู่มือง่ายๆ

📋 เอกสารเทคนิค

📦 เอกสารส่วนประกอบ

🛠️ Tech Stack

Vulnerable App & Secure App

  • Backend: Flask (Python)
  • Database: SQLite
  • Frontend: HTML/CSS

Scanner

  • Language: Python
  • Libraries: requests

Dashboard

  • Backend: Flask API
  • Frontend: HTML/CSS/JavaScript

🧠 แนวคิดสำคัญ

ไม่สอนเจาะ แต่สอนป้องกัน

Lab นี้ไม่ได้สอนให้เจาะระบบ แต่สอนให้:

  • ✅ เข้าใจว่าช่องโหว่เกิดจากอะไร
  • ✅ วิเคราะห์ความเสี่ยงได้
  • ✅ รู้วิธีป้องกันที่ถูกต้อง
  • ✅ สื่อสารผลได้

Mindset ที่ถูกต้อง

  • ❌ ไม่ใช่: "ฉันใช้ tool เก่ง"
  • ✅ แต่คือ: "ฉันเข้าใจความเสี่ยงและป้องกันได้"

📊 Phase 2+ Features

✅ Scanner

  • ตรวจสอบ SQL Injection
  • ตรวจสอบ XSS
  • ตรวจสอบ IDOR
  • ตรวจสอบ Information Disclosure
  • ตรวจสอบ Authentication Issues
  • ตรวจสอบ Session Management

✅ Dashboard

  • Web interface สำหรับสแกน
  • แสดงผล real-time
  • สถิติการสแกน
  • รายละเอียดช่องโหว่

✅ Best Practices

  • คู่มือป้องกันช่องโหว่
  • Code examples
  • Security guidelines

✅ Test Cases

  • Unit tests สำหรับช่องโหว่
  • Automated testing
  • Test documentation

✅ Secure App

  • แก้ไขช่องโหว่ทั้งหมด
  • เปรียบเทียบกับ Vulnerable App
  • Security best practices

🤝 การมีส่วนร่วม

โปรเจกต์นี้สร้างเพื่อการศึกษา หากพบปัญหาหรือมีข้อเสนอแนะ กรุณาแจ้งมาได้

📝 License

ใช้เพื่อการศึกษาเท่านั้น


จำไว้เสมอ: ใช้เพื่อการศึกษาเท่านั้น! 🎓

Security is a process, not a product! 🔒

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

mini_pentest_scanner-1.0.0.tar.gz (98.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mini_pentest_scanner-1.0.0-py3-none-any.whl (129.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mini_pentest_scanner-1.0.0.tar.gz
  • Upload date:
  • Size: 98.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.8

File hashes

Hashes for mini_pentest_scanner-1.0.0.tar.gz
Algorithm Hash digest
SHA256 78c3b4b8a2fa60160c8e0a09f20496fa71a2df0a63bcf65e8ca37b17e325c09f
MD5 c9ca78544745db97f8e3843993c234e0
BLAKE2b-256 de105d9aee4980592e06cc33e3e1294a6b1f117052eec7b0acd1272262f02797

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mini_pentest_scanner-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9764e132554f43d6085ed40148271a4345fc251910849256448a53c13128deb3
MD5 bc33633efa0271671e63fbc1aecfaf97
BLAKE2b-256 c037be6e05e6be8b5f1d1abec7eb1555a11164d8e8442f11fabcf878ee09dff1

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