Created
December 9, 2015 04:19
-
-
Save wchen-r7/3d8b95aa9f3e14df8d65 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
# 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