wahaha2024-12-16文章来源:SecHub网络安全社区
想速成,那是当然不可能,语言太多啦,不说别的,就光打个包可能都要你老命。
那啥是AWDP?AWDP分为Break和Fix环节。反正就web和pwn这两个方向的,要是有pwn✌,躺平就行了。
–已攻击,说明这个题已经打下来了,交了flag,就是攻击成功,就是普通的ctf。有的给源码,有的不给,反正黑百盒自己都试试,死马当活马医,干就完了。
–已防御,说明你把这个题的漏洞通过修改源码,已经修复完了,官方打不动这个题了,就算是防御成功,能拿防御分了。
–防御异常,说明防御的过程中,你把网站原本的服务给搞没了,可能是把关键的功能删掉了。如果防御异常了,赶快第一时间重置环境,要不等到一个轮次结束之后check就会扣分,扣分就吃大亏了。
每个队伍初始分数和靶机啥乱七八糟的玩意儿都是一样的,要向平台GameBox发起攻击,拿到flag后提交;但是这期间,平台也会干你,看你们自己的漏洞有没有修,反正就是看你有没有对应漏洞的防御能力,当然前提是你得找到漏洞,漏洞都找不到的话,坐着吃盒饭吧,或者玩儿植物大战僵尸吧。
总体来说,AWDP和传统的CTF类型没啥区别,就是多了个fIX功能,就是多了个防御的分数,打进去是攻击分数,防的住是防御分
电脑环境最好有多个语言环境,例如:php java,python,go等,熟悉他们的基本语法,实在不行你写个文档,放电脑上不就完了,学会语言的编译和反编译。
提前准备一些通 waf,管他用上用不上,用得上,反正就有防御分了,比赛期间不要⼀直纠结于去攻击,可以看看如何修复。同时 Fix 或者 Break 越早越好,前期 Break / Fix 速度越快越好,得分越多。
看规则,看规则,看规则,重要的事情说三遍,如何去fix,⼀般⽐赛都会让你去写sh,看清楚⽐赛要求。
打包的话,把修改的代码⽂件和sh放在⼀起,⼀起打包成⽐赛要求的格式
提前写好过滤规则,反正就是一句话啥都提前准备好,直接就是用,现写可以吃盒饭了。
PHP
function wafrce($str){
return
!preg_match("/openlog|syslog|readlink|symlink|popepassthru|stream_socket_server|scandir
|assert|pcntl_exec|fwrite|curl|system|eval|assert|flag|passthru|exec|chroot|chgrp|chown
|shell_exec|proc_open|proc_get_status|popen|ini_alter|ini_restore/i", $str);
}
function wafsqli($str){
return
!preg_match("/select|and|\*|\x09|\x0a|\x0b|\x0c|\x0d|\xa0|\x00|\x26|\x7c|or|into|from|w
here|join|sleexml|extractvalue|+|regex|copy|read|file|create|grand|dir|insert|link|serv
er|drop|=|>|<|;|\"|\'|\^|\|/i", $str);
}
function wafxss($str){
return !preg_match("/\'|http|\"|\`|cookie|<|>|script/i", $str);
}
if (preg_match('/system|tail|flag|exec|base64/i', $_SERVER['REQUEST_URI'])) {
die('no!');
}
Go
filterList := []string{"apple", "banana", "cherry"}
str := "ana" // 匹配包含"ana"的字符串
for _, s := range filterList {
if strings.Contains(s, str) {
fmt.Println("Hacker!")
}
}
Node
const keywords = ["apple", "banana", "cherry"];
for (const i of keywords) {
if (code.includes(i)) {
console.log("Hacker!")
}
}
python
filter_list = ["apple", "banana", "cherry"]
strings = "ana" # 匹配包含"ana"的字符串
for i in filter_list:
if i in strings:
print("Hacker!" )
Java
过滤器:
https://github.com/Drun1baby/JavaSecFilters
要学会java的反编译,还有如何打包
String[] filterList = {"apple", "banana", "cherry"};
String str = "ana"; // 匹配包含"ana"的字符串
for (String s : filterList) {
if (s.contains(str)) {
System.out.println("Hacker!");
}
}
通防
https://github.com/leohearts/awd-watchbird
https://github.com/sharpleung/CTF-WAF
https://github.com/NonupleBroken/AWD_PHP_WAF
https://github.com/DasSecurity-HatLab/AoiAWD
https://github.com/dr0op/k4l0ng_WAF
patch包
python
#!/bin/sh
cp /app.py /app/app.py
ps -ef | grep python | grep -v grep | awk '{print $2}' | xargs kill -9
cd /app && nohup python app.py >> /opt/app.log 2>&1 &
Go
#!/bin/bash
kill -9 $(pidof app)
cp ezgo_patch /app
chmod +x /app
/app 2>&1 >/dev/null &
打包命令:
tar zcvf update.tar.gz send.php update.sh