Pro Task API
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
The pro.task_list method returns a hash of active tasks.
Request Example
shell
1[ "pro.task_list", "<token>" ]
Response Example
json
1{ "108" =>2{3"status" => "running",4"error" => "",5"created_at" => 1306792667,6"progress" => 25,7"description" => "Launching",8"info" => "#1 ICONICS WebHMI ActiveX Buffer Overflow",9"workspace" => "Branch Office",10"username" => "admin",11"result" => "",12"path" => "tasks/task_pro.single_108.txt",13"size" => 42514}15}
pro.task_status
The pro.task_status method returns the current status of a given task.
Request Example
shell
1[ "pro.task_status", "<token>", "108" ]
Response Example
json
1{ "108" =>2{3"status" => "running",4"error" => "",5"created_at" => 1306792667,6"progress" => 25,7"description" => "Launching",8"info" => "#1 ICONICS WebHMI ActiveX Buffer Overflow",9"workspace" => "Branch Office",10"username" => "admin",11"result" => "",12"path" => "tasks/task_pro.single_108.txt",13"size" => 42514}15}
pro.task_stop
The pro.task_stop method terminates the task specified in the task ID parameter.
Request Example
shell
1[ "pro.task_status", "<token>", "108" ]
Response Example
json
1{ "task" => "108", "status" => "stopped" }
pro.task_log
The pro.task_log method returns the status and log data for the task specified in the task ID parameter.
Request Example
shell
1[ "pro.task_log", "<token>", "108" ]
Response Example
json
1{2"status" => "running",3"error" => "",4"created_at" => 1306792667,5"progress" => 25,6"description" => "Launching",7"info" => "#1 ICONICS WebHMI ActiveX Buffer Overflow",8"workspace" => "Branch Office",9"username" => "admin",10"result" => "",11"path" => "tasks/task_pro.single_108.txt",12"size" => 425,13"log" => "<425 bytes of output data>"14}
pro.task_delete_log
The pro.task_delete_log method deletes the associated log file for a specific task.
Request Example
shell
1[ "pro.task_delete_log", "<token>", "108" ]
Response Example
json
1{ "status" => "succcess" }
Did this page help you?