President Obama warned Russia on Friday not to wage cyberwarfare against the United States, saying, “We can do stuff to you” as he defended his handling of Moscow’s alleged hacking of Democrats’ emails to influence the 2016 election.