keytweeter

I wrote a keylogger that tweets every 140 characters I type http://twitter.com/keytweeter

I know this is more conceptual than the usual ofw-interactive-installation-stuff, but still – it wouldn’t have been possible without ofw :slight_smile:

I used:

  • ofxXmlSettings to store some information like username, password, and filtered words (passwords, credit card numbers, ssn) that I consider “control” rather than “information”.

  • ofxThread to do the posting and keylogging asynchronously, so keys aren’t lost when posts are being made.

  • Some code I posted at http://forum.openframeworks.cc/t/hiding-command-window-and-minimizing-to-system-tray/1244/0 for handling window hiding (I use the Home and End keys to show and hide the debug console)

  • ofEvents were used for the keylogger’s callbacks. e.g.:

  
  
ofAddListener(logger.keyPressed, this, &AutoTweet::keyPressed);  
  

See ofxKeyLogger for my windows-specific keylogger implementation. I know Arturo has some linux specific code and zach has some osx specific code – both from oflab – for doing keylogging. I tried to write ofxKeyLogger so that it could be extended for other OSes.

The biggest pain was getting some unicode sent to Twitter correctly to represent the arrow and return keys. I could represent the unicode in a string using \u escape sequences, but it would store it in multiple bytes – so the character count was off. wstring correctly reported the size() of the buffer, but didn’t like being sent to _wsystem. In the end I wrote a wrapper called ofxString that let me store ints instead of characters, with the ints corresponding to the OF_KEY mappings.

If you’d like to run the app yourself, just add a bin/data/config.xml that looks like this:

  
  
<username>twitterUsername</username>  
<password>twitterPassword</password>  
<safe>somePassword</safe>  
<safe>creditCardNumber</safe>  
<safe>SSN</safe>  
  

And be sure to add the cURL binary to /bin or your system path.

keytweeter.zip

awesome!
I could see a lot of evil and very fun uses for an ofxKeyLogger addon :smiley:

Theo

Yeah! You could totally do whole-machine tourettes :slight_smile:

The tourettes thing is nice because it’s kind of a diy/try it yourself sort of thing, while this is more “check this out – it’s fun conceptual-hacking-art”. I’d like to try some more fffffatish stuff, but this is the first thing that came to mind.

Score #3 for ofw + hackaday! http://hackaday.com/2009/07/01/twittering-keylogger/

Also, I posted the binaries w/ a readme if you’d like to play with it. http://kylemcdonald.net/keytweeter/keytweeter.zip

hehe just trying wank out damn the tourretes honkey machine… pretty funny!

Cool!

There’s already a reference in this article to it…
:slight_smile:

http://www.neural.it/art/2009/07/keytwe-…-t-fi.phtml

Yeah! I’m super excited about the neural article, it’s the most “legitimate” thing I’ve been mentioned in yet :slight_smile: I also think it’s a great analysis of the idea, so it was encouraging to read.

Haha! Good to hear you’re becoming more legit Kyle :wink:
Yeah the article is really nice…