{"id":25406192,"url":"https://github.com/sharpleung/CTF-WAF","last_synced_at":"2025-10-31T02:30:20.381Z","repository":{"id":43533095,"uuid":"209558935","full_name":"sharpleung/CTF-WAF","owner":"sharpleung","description":"针对CTF线下赛的通用WAF，日志审计功能。","archived":false,"fork":false,"pushed_at":"2022-11-27T12:14:05.000Z","size":123,"stargazers_count":195,"open_issues_count":1,"forks_count":34,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-11-07T17:16:50.126Z","etag":null,"topics":["awd","ctf","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sharpleung.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-19T13:17:39.000Z","updated_at":"2023-11-03T03:38:27.000Z","dependencies_parsed_at":"2023-01-21T17:18:16.174Z","dependency_job_id":null,"html_url":"https://github.com/sharpleung/CTF-WAF","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharpleung%2FCTF-WAF","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharpleung%2FCTF-WAF/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharpleung%2FCTF-WAF/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharpleung%2FCTF-WAF/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sharpleung","download_url":"https://codeload.github.com/sharpleung/CTF-WAF/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239088390,"owners_count":19579435,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["awd","ctf","php"],"created_at":"2025-02-16T05:08:13.701Z","updated_at":"2025-10-31T02:30:17.559Z","avatar_url":"https://github.com/sharpleung.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"## CTF-WAF\n## 描述\n\n项目年久失修，直接重构了，删除原有的过滤功能，毕竟规则不够完善拦截是没法拦截了，因此修改为黑名单BAN-IP功能。在比赛前可以将选手的IP都放在black.txt中，如果是选手的IP对我们靶机访问则返回404.同时优化了了日志记录功能可以记录文件上传等信息。\n\n~~该项目针对CTF线下AWD比赛临时开发的WAF，能够拦截XSS、SQl、反序列化、菜刀/蚁剑、以及一些CTF常见的危险函数流量。可以绕过对页面检测的check,拦截返回正常页面的html。并且能够对简单payload进行流量转发，自动反打设置好的IP。如果比赛禁止使用通防也可以一键关闭通防，作为流量监控审计所用。欢迎各位大佬对项目进行改进。使用时候可以使用.user.ini将其包含于所有php文件。~~\n\n## 联系方式\n- ![](https://img.shields.io/badge/%E4%BD%9C%E8%80%85-Gqleung-brightgreen.svg)  \n\n- [![](https://img.shields.io/badge/%E5%8D%9A%E5%AE%A2-xiao%20leung's%20Blog-blueviolet)](https://www.plasf.cn)\n##  目录结构\n\n```http\nCTF_WAF.php(WAF主要文件)\nlog.php(日志审计系统)\n```\n\n## 使用方法\n\n- 将`CTF_WAF.php`包含进需要保护的文件\n\n### 设置黑名单IP以及日志地址\n\n#### 方法一\n\n在代码`CTF_WAF.php`第二行直接设置IP即可，第一行即可设置日志地址，建议设置绝对路径如:`/tmp/log.txt`\n\n![image-20221126004745717](https://gqleung.oss-cn-guangzhou.aliyuncs.com/img/202211260048967.png)\n\n#### 方法二\n\n批量设置，在同文件夹新建一个`black.txt`存放要BAN的IP地址。\n\n![image-20221126004845378](https://gqleung.oss-cn-guangzhou.aliyuncs.com/img/202211260049258.png)\n\n#### 效果\n\n封禁前：\n\n![image-20221126005215483](https://gqleung.oss-cn-guangzhou.aliyuncs.com/img/202211260052352.png)\n\n封禁后：\n\n![image-20221126005322868](https://gqleung.oss-cn-guangzhou.aliyuncs.com/img/202211272013500.png)\n\n显示404\n\n![image-20221126005355454](https://gqleung.oss-cn-guangzhou.aliyuncs.com/img/202211260053844.png)\n\n### 日志审计系统\n\n日志审计系统与上一版基本一致：\n\n![image-20221126005630822](https://gqleung.oss-cn-guangzhou.aliyuncs.com/img/202211260056957.png)\n\n输入账号密码即可登录，密码在`log.php`膝盖即可，同理需要设置日志路径。\n\n![image-20221126005729676](https://gqleung.oss-cn-guangzhou.aliyuncs.com/img/202211272013681.png)\n\n使用效果，匹配到疑似攻击事件，上传事件均会告警。\n\n![image-20221126005850831](https://gqleung.oss-cn-guangzhou.aliyuncs.com/img/202211260059553.png)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsharpleung%2FCTF-WAF","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsharpleung%2FCTF-WAF","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsharpleung%2FCTF-WAF/lists"}