You don't have to write any program, just look for a keylogger, that's enough to get things that are typed in locally, at least that what I understood, or do you mean remote password guessing?