Pro License API

The Pro License API provides methods for registering and activating the Metasploit Pro product.

pro.register

The pro.register method accepts a product key as the only parameter, validates that the product key matches the correct format, and saves the product key internally. The pro.activate method must be used to fully activate the product. This method returns a hash indicating the result of the register call and the current state of the product.

Request Example

shell
1
[ "pro.register", "<token>", "ProductKey" ]

Response Example

json
1
{
2
"result" => "success",
3
"product_key" => "XXXX-XXXX-XXXX-XXXX",
4
"product_serial" => "4dde9e80-c0b2cb0b-6d31b554",
5
"product_type" => "Metasploit Pro",
6
"product_version" => "4.11.0",
7
"product_revision" => "1",
8
"registered" => true,
9
"activated" => false,
10
"expiration" => 0,
11
"person" => "",
12
"organization" => "",
13
"email" => "",
14
"users" => 1,
15
"hardware" => true
16
}

pro.activate

The pro.activate method causes the Metasploit Pro installation to attempt an online activation with the previously registered product key and the specified ActivationOptions. If a 'product_key' element is provided in the ActivationOptions hash, this key will be registered prior to the activation process. In most cases, an empty hash can be specified in place of the ActivationOptions. If the Metasploit Pro instance does not have direct access to the internet, the ActivationOptions can be used to specify an internal HTTP proxy server.

Proxy options can be specified in the 'proxy_host', 'proxy_port', 'proxy_user', and 'proxy_pass' elements of the ActivationOptions hash. Only standard HTTP proxies are supported. The response to the activate call will either contain a hash of license information, as the pro.register method does, or a hash containing a 'result' element with the value set to 'failure', and a second element, 'reason', indicating the reason for this failure.

Every product key can only be activated a limited number of times, with the count determined by the license type. In the event that activation limit has been reached, Rapid7 Support must be contacted to reset the activation count.

Request Example

shell
1
[ "pro.activate", "<token>",
2
{
3
"proxy_host" => "1.2.3.4",
4
"proxy_port" => 80
5
}
6
]

Response Example

json
1
{
2
"result" => "success",
3
"product_key" => "XXXX-XXXX-XXXX-XXXX",
4
"product_serial" => "4dde9e80-c0b2cb0b-6d31b554",
5
"product_type" => "Metasploit Pro",
6
"product_version" => "4.11.0",
7
"product_revision" => "1",
8
"registered" => true,
9
"activated" => true,
10
"expiration" => 1325376000,
11
"person" => "Licensed Person",
12
"organization" => "Licensed Organization",
13
"email" => "bob_admin@example.org",
14
"users" => 2,
15
"hardware" => true
16
}

pro.activate_offline

The pro.activate_offline method causes the Metasploit Pro installation to load a pre-generated offline activation file from the specified local filesystem path. Offline activation files are reserved for customers with network isolation requirements and are available through Rapid7 Support.

Request Example

shell
1
[ "pro.activate_offline", , "<token>", "/tmp/metasploit_pro_activation.zip" ]

Response Example

json
1
{
2
"result" => "success",
3
"product_key" => "XXXX-XXXX-XXXX-XXXX",
4
"product_serial" => "4dde9e80-c0b2cb0b-6d31b554",
5
"product_type" => "Metasploit Pro",
6
"product_version" => "4.11.0",
7
"product_revision" => "1",
8
"registered" => true,
9
"activated" => true,
10
"expiration" => 1325376000,
11
"person" => "Licensed Person",
12
"organization" => "Licensed Organization",
13
"email" => "bob_admin@example.org",
14
"users" => 2,
15
"hardware" => true
16
}

pro.license

The pro.license method will return a hash indicating the current Metasploit Pro license.

Request Example

shell
1
[ "pro.license", "<token>"]

Response Example

json
1
{
2
"result" => "success",
3
"product_key" => "XXXX-XXXX-XXXX-XXXX",
4
"product_serial" => "4dde9e80-c0b2cb0b-6d31b554",
5
"product_type" => "Metasploit Pro",
6
"product_version" => "4.11.0",
7
"product_revision" => "1",
8
"registered" => true,
9
"activated" => true,
10
"expiration" => 1325376000,
11
"person" => "Licensed Person",
12
"organization" => "Licensed Organization",
13
"email" => "bob_admin@example.org",
14
"users" => 2,
15
"hardware" => true
16
}

pro.revert_license

The pro.revert_license method attempts to switch to the last successfully activated product license before the current one. Only one backup license copy is kept and this method does nothing if there is no backup license available when it is called. The return value is identical to the pro.license call in that it provides the newly chosen license information as a hash. This method is used to temporarily use a license that may provide more users or other capabilities and then fall back to the original license when that temporary license expires.

Request Example

shell
1
[ "pro.license", "<token>"]

Response Example

json
1
{
2
"result" => "success",
3
"product_key" => "XXXX-XXXX-XXXX-XXXX",
4
"product_serial" => "4dde9e80-c0b2cb0b-6d31b554",
5
"product_type" => "Metasploit Pro",
6
"product_version" => "4.11.0",
7
"product_revision" => "1",
8
"registered" => true,
9
"activated" => true,
10
"expiration" => 1325376000,
11
"person" => "Licensed Person",
12
"organization" => "Licensed Organization",
13
"email" => "bob_admin@example.org",
14
"users" => 5,
15
"hardware" => false
16
}