Git Product home page Git Product logo

ctf-waf's Introduction

CTF-WAF

描述

项目年久失修,直接重构了,删除原有的过滤功能,毕竟规则不够完善拦截是没法拦截了,因此修改为黑名单BAN-IP功能。在比赛前可以将选手的IP都放在black.txt中,如果是选手的IP对我们靶机访问则返回404.同时优化了了日志记录功能可以记录文件上传等信息。

该项目针对CTF线下AWD比赛临时开发的WAF,能够拦截XSS、SQl、反序列化、菜刀/蚁剑、以及一些CTF常见的危险函数流量。可以绕过对页面检测的check,拦截返回正常页面的html。并且能够对简单payload进行流量转发,自动反打设置好的IP。如果比赛禁止使用通防也可以一键关闭通防,作为流量监控审计所用。欢迎各位大佬对项目进行改进。使用时候可以使用.user.ini将其包含于所有php文件。

联系方式

目录结构

CTF_WAF.php(WAF主要文件)
log.php(日志审计系统)

使用方法

  • CTF_WAF.php包含进需要保护的文件

设置黑名单IP以及日志地址

方法一

在代码CTF_WAF.php第二行直接设置IP即可,第一行即可设置日志地址,建议设置绝对路径如:/tmp/log.txt

image-20221126004745717

方法二

批量设置,在同文件夹新建一个black.txt存放要BAN的IP地址。

image-20221126004845378

效果

封禁前:

image-20221126005215483

封禁后:

image-20221126005322868

显示404

image-20221126005355454

日志审计系统

日志审计系统与上一版基本一致:

image-20221126005630822

输入账号密码即可登录,密码在log.php膝盖即可,同理需要设置日志路径。

image-20221126005729676

使用效果,匹配到疑似攻击事件,上传事件均会告警。

image-20221126005850831

ctf-waf's People

Contributors

sharpleung avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

ctf-waf's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.