egg-hunt

作者: clive0x | 来源:发表于2021-06-07 14:13 被阅读0次

当栈空间较小时,shellcode需要分stage,stage1 把shellcode写入可写位置,stage2 就是egg-hunt,在内容搜索shellcode并且jmp。

egg-hunt分两阶段:

1.在process virtual address space,判断地址是不是已经映射,paper介绍了两种方法:a. error handler,代码体量大,不建议。b.使用syscall,如果地址失效,返回EFLAG,不会crash进程执行。

paper采用

int access(const char *pathname, int mode); 一次判断一个地址是否有效(参数pathname)

int sigaction(int signum, const struct sigaction *act, struct

sigaction *oldact);一次判断16个bytes是否有效(参数act)

第二阶段,地址包含的内含是否是egg(nop,pop eax 0x50905090 0x50905090  )

Paper使用了cmp jz和scasd,后者更为简洁。

http://www.hick.org/code/skape/papers/egghunt-shellcode.pdf

相关文章

  • egg-hunt

    当栈空间较小时,shellcode需要分stage,stage1 把shellcode写入可写位置,stage2 ...

网友评论

      本文标题:egg-hunt

      本文链接:https://www.haomeiwen.com/subject/nlxosltx.html