通过java agent去修复awd的java赛题,现有如下规则策略
- com.ctfagent.rule.SpringBootFilterMem.SpringBootFilterMem :根据配置文件动态拦截需要拦截的流量
- com.ctfagent.rule.SaveRequestsDataRule :根据配置文件补充请求的流量
- com.ctfagent.rule.RequestForwarderRule :根据规则文件转发全部或者特定的流量到指定目标
指定参数启动:
java -javaagent:./CtfAgent-1.0-SNAPSHOT.jar -jar vuln-0.0.1-SNAPSHOT.jar
远程注入启动:
https://github.com/jattach/jattach 下载jattach,获取到java进程pid执行如下命令
chmod +x ./jattach
./jattach 42 load instrument false ./CtfAgent-1.0-SNAPSHOT.jar
流量转发规则
# 流量转发配置文件
# 目标队伍服务器,按需修改IP和端口
target_urls:
- "http://www.baidu.com"
# 是否转发所有流量(true)或只转发check流量(false)
forward_all_traffic: true
# 是否转发check流量(通常设为true)
forward_check_traffic: true
# check流量特征(用于识别check请求)
check_patterns:
- user_agent_contains: "check"
- remote_addr_starts_with: "10.0."
- remote_addr_equals: "127.0.0.1"
- uri_contains: "/check"
# 转发策略(轮询/随机/健康优先)
strategy: "round_robin"