A hacker has discovered a way to force ATMs to disgorge their cash by hijacking the computers inside them.