The new feature is immediately available for users and "secret" codes can be accessed via SMS or through the Google Authenticator app.
The unsuccessful attacks were the result of email addresses being publicly posted on an electric company's website.
Electronic road signs in St. Charles, Ill. were hacked on Thursday, displaying messages that had nothing to do with a pipeline project taking place nearby.
Of the companies polled in a recent survey, eight in 10 indicated that they experienced web attacks in 2012.
A new do-it-yourself botnet generating tool has leaked in the wild, but miscreants believe it's not worth its $10,000 price tag.