A powerful WAF Middleware for Flask with SQLi, XSS, and Logic protection
Project description
WAF Middleware for Flask
Đây là thư viện tường lửa ứng dụng Web (WAF) mạnh mẽ dành cho Flask, được xây dựng như một đồ án chuyên ngành.
Tính năng Chính
- Chống Injection: Ngăn chặn SQL Injection, Command Injection.
- Chống Web Attacks: XSS (Cross-Site Scripting), LFI (Local File Inclusion).
- Phòng thủ Logic:
- Honeypot: Bẫy hacker và tự động Ban IP.
- GeoIP: Chặn truy cập từ các quốc gia không mong muốn.
- Anti-CSRF: Bảo vệ người dùng khỏi giả mạo request.
- Chống DDoS: Rate Limiting (Giới hạn tần suất truy cập).
- Hệ thống Cảnh báo: Tích hợp Bot Telegram báo cáo thời gian thực.
Cài đặt
Bạn có thể cài đặt thư viện thông qua file .whl (đã đóng gói):
pip install waf_middleware-1.0.0-py3-none-any.whl
Hướng dẫn Sử dụng
Tích hợp WAF vào ứng dụng Flask của bạn chỉ với 2 dòng code:
Python
from flask import Flask
from waf_middleware import Firewall
app = Flask(__name__)
# Cấu hình Secret Key (Bắt buộc cho Session)
app.config['SECRET_KEY'] = 'your-secret-key'
# Khởi chạy WAF
# Lưu ý: Điền Token Telegram trong file cấu hình nếu muốn nhận cảnh báo
waf = Firewall(app)
@app.route('/')
def index():
return "Web này đã được bảo vệ bởi WAF Middleware!"
if __name__ == "__main__":
app.run(debug=True)
Yêu cầu hệ thống
Python 3.8+
Flask
SQLAlchemy
Requests
Tác giả: Nguyễn Hoài Thoại
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 waf_middleware_hoaithoai35-1.1.9.tar.gz.
File metadata
- Download URL: waf_middleware_hoaithoai35-1.1.9.tar.gz
- Upload date:
- Size: 8.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cfc4065366be6253ee427099dc55727fcbea9cdadd0f3166a63056f7291be1ba
|
|
| MD5 |
e707cf1b9bfe2da8e176d43e1fd1779c
|
|
| BLAKE2b-256 |
c348f237bb1907c536285772b0f7ee2ecfa12c1270b9949cae50d1d6bbe082c7
|
File details
Details for the file waf_middleware_hoaithoai35-1.1.9-py3-none-any.whl.
File metadata
- Download URL: waf_middleware_hoaithoai35-1.1.9-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cf2e2d75ec4f1185ac85901d079f2036d29601a468559b8b624e864f23c4c647
|
|
| MD5 |
add294579d081a55a2716ea79ec125fc
|
|
| BLAKE2b-256 |
e0d2e3f9cd881a65481331d3255db136044f149cfa3dda95eef36c1627405222
|