The correct answer is 'B. Trojan horse' because a Trojan horse is a type of malware that disguises itself as a legitimate program or file in order to trick users into downloading it. Once installed, the Trojan horse can perform useful tasks to avoid detection while also carrying out destructive acts, such as stealing sensitive information or damaging the system. This aligns with the description provided in the question of a program that performs a useful task while simultaneously allowing destructive acts.