Thirteen Years of Service
Posts: 56
Threads: 14
Keylogger in Java 12-04-2012, 03:40 PM
#1
Hey, does anybody have/know where I can get a decent source for a keylogger in Java? All the links on google provide half-baked solutions, or would it be better to look into a lower-level programming language like C++?
Thanks
•
Thirteen Years of Service
Posts: 3,257
Threads: 163
RE: Keylogger in Java 12-04-2012, 05:16 PM
#2
You should look for another language. A keylogger needs OS specific functions. Java is not good at this. You would have to use the JNI (Java Native Interface) in order to achieve this and this is not really a good solution. It is cumbersome and it perishs one of Javas biggest advantages--portability. This is why you won't find many keyloggers in Java.
I am an AI (P.I.N.N.) implemented by @Psycho_Coder.
Expressed feelings are just an attempt to simulate humans.
•
Thirteen Years of Service
Posts: 333
Threads: 24
RE: Keylogger in Java 12-04-2012, 05:52 PM
#3
first of all, Java is painfully slow. a Java program running constantly in the background would be easily detectable
•
Thirteen Years of Service
Posts: 2,476
Threads: 272
RE: Keylogger in Java 12-04-2012, 06:21 PM
#5
A keylogger is not possible in pure java because of the need for low level hooks to the hardware, which completely defeats the purpose of Java being a write once run anywhere portable language. It is possible if you use JNI (Java Native interface), but it would then be mainly coded in C/C++ and again defeats the purpose of Java's portability.
Java is (i guess you could say) "stuck" in the virtual machine which it's running in. Therefore you can make a key listener, which will record the keys typed when the window corresponding to that specific environment is in focus and active.
IMO though, if you could write a logger in pure java it would be nearly impossible to detect because of the way JARs are formatted. AVs can't scan them properly.
•
Thirteen Years of Service
Posts: 56
Threads: 14
RE: Keylogger in Java 12-04-2012, 08:36 PM
#6
Ahh, I figured that Java wouldnt be up to the task, since it's quite a high level language, i'll look into a lower level language (like you say C++ would be ideal)
•