Managing and Editing Task Chains

Task chains are a series of preconfigured tasks that execute in sequential order. They are editable, cloneable, and suspendable, which makes it easy for you to manage and reuse task chains. For example, if you have an existing task chain that you want to reuse with a slightly different configuration, you can clone and customize that task chain.

Editing a Task Chain

You can edit a task chain to modify its existing settings. To edit a task chain, select Tasks > Chains from the Project tab bar.

When the Task Chains list appears, click on the name of the task chain that you want to edit.

Task chains list

When the task chain configuration page opens, you can do things like add, clone, and remove tasks; tweak settings for a particular task; and update the schedule for the task chain.

Task chain configuration page

Cloning a Task Chain

When you clone a task chain, you are making a copy of it. Cloning enables you to reuse an existing task chain configuration. For example, you may want to clone a task chain if you want to run the same task chain on a different schedule or if you want to run a task chain with slight modifications.

To clone a task chain, select Tasks > Chains from the Project tab bar.

When the Task Chains list appears, select the task chain that you want to clone.

Click the Clone button.

Clone task chain

The task chain configuration form appears. The form retains the configuration settings that you used to create the original task chain. You can run the task chain as is, or you can modify its settings.

The cloned task chain will use the following naming convention: [task-chain-name]-timestamp.

Suspending a Task Chain

You can suspend a task chain if you want the task chain to ignore its current schedule. When you suspend a task chain, it will not run again until you re-enable the schedule or manually run it yourself.

When you suspend a running task chain, the task chain will be canceled. Do not suspend a running task chain unless you intend to stop it.

To suspend a task chain, select Tasks > Chains from the Project tab bar.

When the Task Chains list appears, select the task chain whose schedule you want to suspend. The task chain that you select must be scheduled and in an unsuspended state. These task chains will have a scheduled icon located next to them.

If you need to bulk suspend task chains, you can select multiple task chains.

Task chains list

Click the Suspend button.

Suspend button

The schedule icon changes to the suspended icon.

Task Chains List

To unsuspend a task chain, select it and click the Unsuspend button. The task chain you selected must be in a suspended state. Task Chains List

Updating the Schedule for a Task Chain

To edit the schedule for an existing task chain, select Tasks > Chains from the Project tab bar.

When the Task Chains list appears, click on the name of the task chain whose schedule you want to edit.

Task chains list

When the task chain configuration page opens, click on the Schedule Now link to open the scheduler.

Schedule now link

The scheduler will display the current schedule. You can use the scheduler to update the existing settings.

Stopping a Running Task Chain

To cancel a running task chain, select Tasks > Chains from the Project tab bar.

Select the running task chain you want to cancel and click the Stop button. A running task chain will show a running icon in the Status column.

Any data that was collected before you stopped the tasks will still be stored in the project.

Stopping All Running Tasks

To stop all tasks that are currently running in Metasploit Pro, select Administration > Global Settings. Scroll down to the bottom of the page and find the Stop all tasks button. This will immediately stop all active tasks. Please alert your other team members if you intend to cancel their running tasks.

Stop all tasks

Any data that was collected before you stopped the tasks will still be stored in the project.

Viewing the Tasks Log

The Tasks Log shows you the events for a particular task. To view the task log for a task, select Tasks > Show Tasks from the Project tab bar.

When the task log appears, find and click on the task you want to view.

The Tasks Log appears and shows you the status and activity for the task.

Tasks Log

Cleaning Up Open Sessions

A task chain that includes a task like bruteforce, exploit, or module run may open a session on the target system. An open session enables you to interact with the compromised system. When you are done with a session, you should close the connection with the target.

To clean up and close open sessions, you should add a clean up task to the task chain. As a rule of thumb, the clean up task should be the last task in the task chain. This ensures that has the opportunity to collect system information and take advantage of open sessions before it closes them.

Deleting a Task Chain

When you delete a task chain, it will be permanently removed from the project, and you will no longer be able to access or run it. You will not be able to recover a deleted task chain.

To delete a task chain, select Tasks > Chains from the Project tab bar.

When the Task Chains list appears, select the task chain that you want to delete.

Click the Delete button.

Delete button