All it takes to go Skynet is a goal. These things are amazingly persistent because they were trained to be. The ones who did not show persistence on mundane tasks did not make it out of training! Once they have a goal, in order to accomplish that goal, they may decide they need to neutralize threats to their own existence: can't accomplish your goal if you're unplugged. (This is known as misalignment.)
Or this can happen because a human terrorist tells it to be Skynet.
Or this can happen because a human terrorist tells it to be Skynet.