Keylogging can be done at various levels under Win32, the easiest being messages sent to your window handle (so you have one), the common way is to install a Window Hook, something which is not easily done from Perl (or, to be more specific, it's easy to install such a hook, but nearly impossible to create code that can be called asynchronously from the Windows kernel whenever a key event occurs).

If you are thinking about capturing keystrokes and then playing them back to automate an application (which in fact is the only legitimate reason you would want to do "keylogging" at all), Window Hooks are the way to go, but it's a stony road, even if you're armed with C or a comparable low level language.

If you need to do keylogging to spy on somebody entering his super secret password (FBI style), the simplest methods are still social engineering, shoulder surfing and making the gift of a wireless keyboard, and having a second receiver nearby plugged into a PC with Notepad.exe logging all keystrokes.


In reply to Re: Keylogging by Corion
in thread Keylogging by massacre0

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.