Last active
October 26, 2015 20:00
-
-
Save WJDigby/c1193589539b0e787166 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 | |
## | |
require 'msf/core' | |
class Metasploit3 < Msf::Auxiliary | |
def initialize | |
super( | |
'Name' => 'Launch rdesktop', | |
'Description' => %q{ | |
This module uses msfconsole options to launch the external rdesktop program. | |
}, | |
'Author' => 'Andy Whitmer', | |
'License' => MSF_LICENSE, | |
) | |
register_options( | |
[ | |
OptString.new('RHOST', [true, 'Remote host IP' ]), | |
OptString.new('RPORT', [false, 'Remote host port', 3389]), | |
OptString.new('SMBUser', [false, 'Username to login with' ]), | |
OptString.new('SMBPass', [false, 'Password to login with' ]), | |
OptString.new('SMBDomain', [false, 'Domain name']), | |
OptString.new('LPATH', [false, 'Redirect a local disk to the client as a share named "local"']) | |
], self.class) | |
end | |
def run() | |
rdesktop = Rex::FileUtils::find_full_path('rdesktop') | |
unless (rdesktop) | |
print_error("rdesktop not installed or not detected.") | |
return | |
end | |
cmd = rdesktop | |
cmd << " -d #{datastore['SMBDomain']}" if datastore['SMBDomain'].to_s != '' | |
cmd << " -u #{datastore['SMBUser']}" if datastore['SMBUser'].to_s != '' | |
cmd << " -p #{datastore['SMBPass']}" if datastore['SMBPass'].to_s != '' | |
cmd << " -r disk:local=#{datastore['LPATH']}" if datastore['LPATH'].to_s != '' | |
cmd << " #{datastore['RHOST']}" | |
cmd << ":#{datastore['RPORT']}" | |
self.view = framework.threads.spawn("rdesktopWrapper", false) { | |
system(cmd) | |
} | |
end | |
attr_accessor :view # :nodoc: | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment