Putin, speaking to international media at an economic forum in St Petersburg, was answering a question about allegations Moscow might try to interfere in this year's German elections.
Moscow's attitude towards cyber crime is under intense scrutiny after U.S. intelligence officials alleged that Russian hackers had tried to help Republican Donald Trump win the White House, something Russia has flatly denied.
"If they (hackers) are patriotically-minded, they start to make their own contribution to what they believe is the good fight against those who speak badly about Russia. Is that possible? Theoretically it is possible," said Putin.
Likening hackers to free-spirited artists acting according to their moods, he said cyber attacks could be made to look like they had come from Russia when they had not.
"On a state level we haven't been involved in this (hacking), we aren't planning to be involved in it. Quite the opposite, we are trying to combat it inside our country," said Putin.
(Reporting by Denis Pinchuk; Writing by Alexander Winning; Editing by Andrew Osborn)
(Except for the headline, this story has not been edited by NDTV staff and is published from a syndicated feed.)