【发布时间】:2017-09-06 19:48:22
【问题描述】:
我正在学习 shellcode。
我在教程中找到了这个 shellcode:
python -c 'print "\x90\x90\x90\x90\x90\x90\x90\x90\x90\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x50\x53\x89\xe1\xb0\x0b\xcd\x80 "' > shellcode
我想做的是反汇编这个非常基本的shellcode,以了解它是如何工作的。
这是我所做的:
$ objdump -D -b binary -m i8086 shellcode
shellcode: file format binary
Disassembly of section .data:
00000000 <.data>:
0: 90 nop
1: 90 nop
2: 90 nop
3: 90 nop
4: 90 nop
5: 90 nop
6: 90 nop
7: 90 nop
8: 90 nop
9: 31 c0 xor %ax,%ax
b: 50 push %ax
c: 68 2f 2f push $0x2f2f
f: 73 68 jae 0x79
11: 68 2f 62 push $0x622f
14: 69 6e 89 e3 50 imul $0x50e3,-0x77(%bp),%bp
19: 53 push %bx
1a: 89 e1 mov %sp,%cx
1c: b0 0b mov $0xb,%al
1e: cd 80 int $0x80
或者:
$ ndisasm shellcode
00000000 90 nop
00000001 90 nop
00000002 90 nop
00000003 90 nop
00000004 90 nop
00000005 90 nop
00000006 90 nop
00000007 90 nop
00000008 90 nop
00000009 31C0 xor ax,ax
0000000B 50 push ax
0000000C 682F2F push word 0x2f2f
0000000F 7368 jnc 0x79
00000011 682F62 push word 0x622f
00000014 696E89E350 imul bp,[bp-0x77],word 0x50e3
00000019 53 push bx
0000001A 89E1 mov cx,sp
0000001C B00B mov al,0xb
0000001E CD80 int 0x80
这个 shellcode 包含被解释为 x86 指令的字符串。 有没有办法在跳跃上贴上正确的标签?
有没有办法显示字符串而不是解码字符串上的 x86 指令。我知道这并不容易,因为没有带有节和标题的精灵......
【问题讨论】:
-
嗯,这确实是stackoverflow.com/questions/1737095/… 的复制品,其中提到了不同的模式(例如in this answer。)但我想我们可以将这个问题看作是关于如何在您反汇编时实现在错误的模式下......(虽然也有可能是重复的:/)
标签: x86 disassembly shellcode