Author Topic: [Linux x86] - copy a file to another directory  (Read 1672 times)

0 Members and 1 Guest are viewing this topic.

xor

  • Guest
[Linux x86] - copy a file to another directory
« on: December 11, 2010, 05:20:48 pm »
Code: (asm) [Select]
.section .data
        .globl _start

_start:
        nop
        jmp  loadstring

main:
        xor  %eax, %eax
       
        pop  %ebx          # load our string
        movb %al, 7(%ebx)  # terminate string
        movb %al, 15(%ebx)
        movb %al, 23(%ebx)
        mov  %ebx, 24(%ebx)

loadstring:
        call main
        .ascii "/bin/cpS/bin/shS/tmp/shN"

First part and second part of the .ascii string are which file to be copied, and last part is where to copy it to. The S and N are just for padding and string termination.

xor

  • Guest
Re: [Linux x86] - copy a file to another directory
« Reply #1 on: January 15, 2011, 08:30:44 am »
Obviously no one noticed, but this ASM is incomplete. It prepares the command line arguments for moving a file, but doesn't actually execute the syscall to start the move. Lets see if any of you can complete it. :)

Offline ande

  • Owner
  • Titan
  • *
  • Posts: 2664
  • Cookies: 256
    • View Profile
Re: [Linux x86] - copy a file to another directory
« Reply #2 on: January 15, 2011, 04:39:38 pm »
Code: (asm) [Select]
int 0x80
if($statement) { unless(!$statement) { // Very sure } }
https://evilzone.org/?hack=true