Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add missing method to_linux_x86_elf_dll #9091

Merged
merged 1 commit into from
Oct 17, 2017
Merged

add missing method to_linux_x86_elf_dll #9091

merged 1 commit into from
Oct 17, 2017

Conversation

qdbp
Copy link

@qdbp qdbp commented Oct 16, 2017

I was using msfvenom as follows:
msfvenom -a x86 --platform linux -f elf-so -p linux/x86/adduser
It failed with:

Error: undefined method `to_linux_x86_elf_dll' for Msf::Util::EXE:Class
Did you mean?  to_linux_x64_elf_dll
               to_linux_x86_elf

It looked like the formulaic method definition for to_linux_x86_elf_dll was missing, even though the template file template_x86_linux_dll.bin was there. Therefore, I added the method.

Verification

After this change, the command above seems to produce a valid ELF-32 shared object.

  • Start msfconsole
  • Start msfvenom -a x86 --platform linux -f elf-so -p linux/x86/adduser
  • Verify the thing does what it should

@timwr timwr self-assigned this Oct 17, 2017
@timwr timwr merged commit d5cdd25 into rapid7:master Oct 17, 2017
timwr added a commit that referenced this pull request Oct 17, 2017
@timwr
Copy link
Contributor

timwr commented Oct 17, 2017

Great fix! Many thanks.

$ msfvenom -f elf-so -p linux/x86/exec CMD="echo so" -o elf.so
No platform was selected, choosing Msf::Module::Platform::Linux from the payload
No Arch selected, selecting Arch: x86 from the payload
No encoder or badchars specified, outputting raw payload
Payload size: 43 bytes
Final size of elf-so file: 289 bytes
Saved as: elf.so
$ LD_PRELOAD=$(realpath elf.so) ./elf-Linux-x86-bash
so

@timwr
Copy link
Contributor

timwr commented Oct 17, 2017

Release Notes

This fix resolves an issue with Linux x86 elf shared object generation.

@tdoan-r7 tdoan-r7 added the rn-fix release notes fix label Nov 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug msfvenom rn-fix release notes fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants