How AI Is Changing Penetration Testing and Threat Detection?