added initial support for ELF misple

This commit is contained in:
jvazquez-r7 2013-03-26 01:08:31 +01:00
parent d386e6e568
commit 4fff624632
3 changed files with 52 additions and 0 deletions

View File

@ -0,0 +1,40 @@
; build with:
; nasm elf_mipsle_template.s -f bin -o template_mipsle_linux.bin
BITS 32
org 0x004006a0
ehdr: ; Elf32_Ehdr
db 0x7F, "ELF", 1, 1, 1, 0 ; e_ident
db 0, 0, 0, 0, 0, 0, 0, 0 ;
dw 2 ; e_type = ET_EXEC for an executable
dw 0x8 ; e_machine = MIPS
dd 1 ; e_version
dd _start ; e_entry
dd phdr - $$ ; e_phoff
dd 0 ; e_shoff
dd 0 ; e_flags
dw ehdrsize ; e_ehsize
dw phdrsize ; e_phentsize
dw 1 ; e_phnum
dw 0 ; e_shentsize
dw 0 ; e_shnum
dw 0 ; e_shstrndx
ehdrsize equ $ - ehdr
phdr: ; Elf32_Phdr
dd 1 ; p_type = PT_LOAD
dd 0 ; p_offset
dd $$ ; p_vaddr
dd $$ ; p_paddr
dd 0xDEADBEEF ; p_filesz
dd 0xDEADBEEF ; p_memsz
dd 7 ; p_flags = rwx
dd 0x1000 ; p_align
phdrsize equ $ - phdr
_start:

Binary file not shown.

View File

@ -120,6 +120,13 @@ require 'digest/sha1'
end
# XXX: Add PPC OS X and Linux here
end
if(arch.index(ARCH_MIPSLE))
if(plat.index(Msf::Module::Platform::Linux))
return to_linux_mipsle_elf(framework, code)
end
# XXX: Add remaining MIPSLE systems here
end
nil
end
@ -710,6 +717,11 @@ require 'digest/sha1'
return elf
end
def self.to_linux_mipsle_elf(framework, code, opts={})
elf = to_exe_elf(framework, opts, "template_mipsle_linux.bin", code)
return elf
end
def self.to_exe_vba(exes='')
exe = exes.unpack('C*')
vba = ""