Advanced persistent threats refer to the type of attacks in which the perpetrators gain unauthorized access to the target system…