irisambericon / homura_pwn_waf

基于patchkit和seccomp的自定义过滤syscall的pwn通防

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

homura_pwn_waf

Use patchkit to patch the ELF(Add seccomp rules) Dependencies

How to use:

  • 先将hpwnwaf.py 中 main_addr 改为需要修改的二进制文件中main函数入口地址,然后执行./patch ELF hpwnwaf.py

  • 暂时只支持linux 64位程序

  • hpwnwaf 中的过滤规则为

  scmp_filter_ctx ctx;
  ctx = seccomp_init(SCMP_ACT_ALLOW);
  seccomp_rule_add(ctx, SCMP_ACT_KILL, SCMP_SYS(socket), 0);
  seccomp_rule_add(ctx, SCMP_ACT_KILL, SCMP_SYS(connect), 0);
  seccomp_rule_add(ctx, SCMP_ACT_KILL, SCMP_SYS(bind), 0);
  seccomp_rule_add(ctx, SCMP_ACT_KILL, SCMP_SYS(listen), 0);
  seccomp_rule_add(ctx, SCMP_ACT_KILL, SCMP_SYS(clone), 0);  
  seccomp_rule_add(ctx, SCMP_ACT_KILL, SCMP_SYS(execve), 0); 
  • hpwnwaf2中的过滤规则为
  scmp_filter_ctx ctx;
  ctx = seccomp_init(SCMP_ACT_ALLOW);
  seccomp_rule_add(ctx, SCMP_ACT_KILL, SCMP_SYS(bind), 0);
  seccomp_rule_add(ctx, SCMP_ACT_KILL, SCMP_SYS(listen), 0);
  seccomp_rule_add(ctx, SCMP_ACT_KILL, SCMP_SYS(execve), 0); 

如需要自定义,可以参考我这篇文章: http://homura.cc/blog/archives/145

About

基于patchkit和seccomp的自定义过滤syscall的pwn通防

License:Other


Languages

Language:C 82.0%Language:Python 17.7%Language:Shell 0.2%Language:Makefile 0.1%