Pro Updates API
The Pro Updates API provides the ability to check for, download, and apply the latest Metasploit Pro updates. This API also includes a method for restarting the Metasploit Pro services.
pro.update_available
The pro.update_available method provides the ability to check for available updates to the Metasploit Pro instance. The UpdateCheckOptions hash can either be empty or include the 'proxy_host', 'proxy_port', 'proxy_user', and 'proxy_pass' elements to use a HTTP proxy for the check. The return value includes a hash that indicates whether an update is available, what the version number of this update is, and a description of what the update contains. Note that the description may contain HTML formatting.
Request Example
shell
1[ "pro.update_available", "<token>", { } ]
Response Example
json
1{2"status" => "success",3"result" => "update",4"current" => "1",5"version" => "20120125000001",6"info" => "This updates adds new features and fixes…"7}
pro.update_install
The pro.update_install method provides the ability to install an update package by name, specified through the 'version' element of the InstallOptions hash. The 'proxy_host', 'proxy_port', 'proxy_user', and 'proxy_pass' elements can be supplied in this hash to indicate that a HTTP proxy should be used. This method returns a hash indicating whether the update was started successfully and what the current status of the installation is. The download and installation process is completed as a single step as the progress can be tracked through calls to the pro.update_status method. Note that the pro.restart_service method must be called to finalize the update.
Request Example
shell
1[ "pro.update_install", "<token>", { "version" => "20120125000001" } ]
Response Example
json
1{2"status" => "success",3"result" => "Downloading",4"error" => ""5}
pro.update_install_offline
The pro.update_install_offline method provides the ability install an update package from a local filesystem. Customers that require offline updates should contact Rapid7 Support to be notified of the download location of each update package. The status of the offline package installation can be monitored by calling the pro.update_status method. Note that the pro.restart_service method must be called to finalize the update.
Request Example
shell
1[ "pro.update_install_offline", "<token>", "/tmp/metasploit_pro_update.zip" ]
Response Example
json
1{2"status" => "success",3"result" => "Installing",4"error" => ""5}
pro.update_status
The pro.update_status method returns a hash indicating the current status of the update installation process. If the update is still being retrieved from the server, the current progress of the download will be returned in the 'download_total', 'download_done', and 'download_pcnt' elements.
Request Example
shell
1[ "pro.update_status", "<token>" ]
Response Example
json
1{2"status" => "success",3"result" => "Downloading",4"error" => "",5"download_total" => "1000000",6"download_done" => "100000",7"download_pcnt" => "10"8}
pro.update_stop
The pro.update_stop method forcibly stops any existing update process, whether it is downloading the update package or installing the contents.
Request Example
shell
1[ "pro.update_stop", "<token>" ]
Response Example
json
1{ "status" => "success" }
pro.restart_service
The pro.restart_service method causes the Metasploit Pro RPC Service (prosvc) and the Metasploit Pro Web Service to restart. This is necessary to complete the installation of an update package.
Request Example
shell
1[ "pro.restart_service", "<token>" ]
Response Example
json
1{ "status" => "success" }