Skip to content

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

License

Notifications You must be signed in to change notification settings

wjbsyc/homura_pwn_waf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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通防

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages