Re: [問題] shellcode會core dump

看板LinuxDev作者 (Wayne)時間15年前 (2010/12/30 17:05), 編輯推噓0(002)
留言2則, 1人參與, 最新討論串2/4 (看更多)
看原PO的想法是想要改 stack 裡的 return address 自己改寫成以下的程式執行無誤(我是64bit,所以用long) ------ #include <stdio.h> #include <stdlib.h> void foo2() { puts("foo2"); exit(1); } void foo1() { long *ret; ret = ((long *)&ret) + 2; *ret = (long)foo2; puts("foo1"); } int main() { foo1(); return 0; } ------ 不過將 foo2 改成你的 shellcode 結果就 code dump 了 如果你的shellcode沒錯的話,我猜測的原因是: http://en.wikipedia.org/wiki/Executable_space_protection 原PO你覺得呢? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.112.30.141

12/30 17:49, , 1F
我剛剛也查到了,用readelf可以看到STACK的flag是RW
12/30 17:49, 1F

12/30 17:51, , 2F
感謝回應
12/30 17:51, 2F
文章代碼(AID): #1D74j9QL (LinuxDev)
文章代碼(AID): #1D74j9QL (LinuxDev)