Pro Task API
Copy link

Metasploit Pro uses tasks to manage background jobs initiated by the user through the web interface. Scanning, exploiting, bruteforcing, importing, and reporting are all handled through tasks. The Pro task API provides methods for enumerating active tasks, stopping tasks, and retrieving the raw log file for a given task.

pro.task_list
Copy link

The pro.task_list method returns a hash of active tasks.

Request Example
Copy link

[ "pro.task_list", "<token>" ]

Response Example
Copy link

{ "108" => { "status" => "running", "error" => "", "created_at" => 1306792667, "progress" => 25, "description" => "Launching", "info" => "#1 ICONICS WebHMI ActiveX Buffer Overflow", "workspace" => "Branch Office", "username" => "admin", "result" => "", "path" => "tasks/task_pro.single_108.txt", "size" => 425 } }

pro.task_status
Copy link

The pro.task_status method returns the current status of a given task.

Request Example
Copy link

[ "pro.task_status", "<token>", "108" ]

Response Example
Copy link

{ "108" => { "status" => "running", "error" => "", "created_at" => 1306792667, "progress" => 25, "description" => "Launching", "info" => "#1 ICONICS WebHMI ActiveX Buffer Overflow", "workspace" => "Branch Office", "username" => "admin", "result" => "", "path" => "tasks/task_pro.single_108.txt", "size" => 425 } }

pro.task_stop
Copy link

The pro.task_stop method terminates the task specified in the task ID parameter.

Request Example
Copy link

[ "pro.task_status", "<token>", "108" ]

Response Example
Copy link

{ "task" => "108", "status" => "stopped" }

pro.task_log
Copy link

The pro.task_log method returns the status and log data for the task specified in the task ID parameter.

Request Example
Copy link

[ "pro.task_log", "<token>", "108" ]

Response Example
Copy link

{ "status" => "running", "error" => "", "created_at" => 1306792667, "progress" => 25, "description" => "Launching", "info" => "#1 ICONICS WebHMI ActiveX Buffer Overflow", "workspace" => "Branch Office", "username" => "admin", "result" => "", "path" => "tasks/task_pro.single_108.txt", "size" => 425, "log" => "<425 bytes of output data>" }

pro.task_delete_log
Copy link

The pro.task_delete_log method deletes the associated log file for a specific task.

Request Example
Copy link

[ "pro.task_delete_log", "<token>", "108" ]

Response Example
Copy link

{ "status" => "succcess" }