Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
##
# This module requires Metasploit: http://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
load "./lib/msf/core/exploit/exe.rb"
require 'msf/core'
class Metasploit3 < Msf::Exploit::Remote
Rank = NormalRanking
include Msf::Exploit::EXE
def initialize(info = {})
super(update_info(info,
'Name' => 'generate_payload_exe Test',
'Description' => %q{
generate_payload_exe test
},
'Author' => [ 'sinn3r' ],
'License' => MSF_LICENSE,
'Platform' => 'linux',
'Arch' => ARCH_X86,
'References' => [ ['URL', 'http://metasploit.com'] ],
'DisclosureDate' => 'Dec 8 2015',
'Targets' =>
[
[ 'Default', {} ],
[ 'Windows', { 'Platform' => 'win', 'Arch' => ARCH_X86 }],
[ 'Linux', { 'Platform' => 'linux', 'Arch' => ARCH_X86 }],
[ 'OSX', { 'Platform' => 'osx', 'Arch' => ARCH_X86 }],
],
'DefaultTarget' => 0
))
end
def exploit
exe = generate_payload_exe
case exe
when /^MZ/
print_status("This is a Windows binary.")
when /.ELF/
print_status("This is a Linux binary.")
when /__PAGEZERO/
print_status("This is an OS X binary")
else
print_status("Something else:")
print_line(Rex::Text.to_hex_dump(exe))
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.