【发布时间】:2011-09-15 13:52:21
【问题描述】:
我正在学习计算机安全的基础知识,并且正在尝试执行我编写的一些 shellcode。我按照这里给出的步骤进行操作
http://dl.packetstormsecurity.net/papers/shellcode/own-shellcode.pdf
http://webcache.googleusercontent.com/search?q=cache:O3uJcNhsksAJ:dl.packetstormsecurity.net/papers/shellcode/own-shellcode.pdf+own+shellcode&cd=1&hl=nl&ct=clnk&gl=nl
$ cat pause.s
xor %eax,%eax
mov $29,%al
int $0x80
$ as -o pause.o pause.s
$ ld -o pause pause.o
ld: warning: cannot find entry symbol _start; defaulting to <<some address here>>
$ ./pause
^C
$ objdump -d ./pause
pause: file format elf64-x86_64
Disassembly of section .text:
08048054 <.text>:
8048054: 31 c0 xor %eax,%eax
8048056: b0 1d mov $0x1d,%al
8048058: cd 80 int $0x8
$
自从我的暂停程序开始工作后,我只是将 objdump 输出复制到了一个 c 文件中。
test.c:
int main()
{
char s[] = "\x31\xc0\xb0\x1d\xcd\x80";
(*(void(*)())s)();
}
但这会产生段错误。现在,这只能归因于 Arch Linux (?) 的安全措施。那么我怎样才能让它工作呢?
【问题讨论】:
-
可能
s所在的页面没有映射到执行权限?既然你是 x86_64,你肯定在硬件上有 NX 支持。 -
将链接替换为指向 google 文档的“更安全”链接。你能确认它是同一份文件吗?另一个链接使用 adobe reader 9.1.0 冻结了 PC
-
@awoodland 是的!我当然对 NX 位一无所知。对于任何想要映射 exec 权限(使用 mmap)的人,说明如下:thexploit.com/tag/shellcode
-
@sehe 我无法打开您发布的链接。我已经把它恢复到原来的样子了。也许是 Adobe?
-
@Ram:嗯,嗯。还有什么。请发出警告?我认为发布具有 DoS 潜力的文档是不可接受的。尤其是关于 shellcode 漏洞利用的帖子。
标签: linux-kernel x86-64 archlinux shellcode