2023-06-12 07:00:33 +03:00
|
|
|
#include <stdio.h>
|
2023-10-08 14:43:34 +03:00
|
|
|
#include <arpa/inet.h>
|
2023-06-12 07:00:33 +03:00
|
|
|
|
2023-06-03 22:52:10 +03:00
|
|
|
enum demode {
|
|
|
|
DESYNC_NONE,
|
|
|
|
DESYNC_SPLIT,
|
|
|
|
DESYNC_DISORDER,
|
|
|
|
DESYNC_FAKE
|
|
|
|
};
|
|
|
|
|
2023-07-07 23:07:27 +03:00
|
|
|
#define DESYNC_UDP_FAKE 1
|
|
|
|
|
2023-06-03 22:52:10 +03:00
|
|
|
struct params {
|
2023-10-08 14:43:34 +03:00
|
|
|
char de_known;
|
2023-06-03 22:52:10 +03:00
|
|
|
int ttl;
|
|
|
|
int split;
|
|
|
|
size_t sfdelay;
|
|
|
|
enum demode attack;
|
2023-07-07 23:07:27 +03:00
|
|
|
int desync_udp;
|
2023-06-03 22:52:10 +03:00
|
|
|
char split_host;
|
|
|
|
int def_ttl;
|
|
|
|
int mod_http;
|
|
|
|
|
|
|
|
char ipv6;
|
|
|
|
char resolve;
|
2023-07-07 21:30:53 +03:00
|
|
|
char udp;
|
2023-06-03 22:52:10 +03:00
|
|
|
int max_open;
|
|
|
|
int debug;
|
|
|
|
size_t bfsize;
|
2023-10-08 14:43:34 +03:00
|
|
|
int nodelay;
|
2023-06-03 22:52:10 +03:00
|
|
|
int send_bfsz;
|
2023-10-08 14:43:34 +03:00
|
|
|
int recv_bfsz;
|
|
|
|
struct sockaddr_in6 baddr;
|
2023-06-03 22:52:10 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
extern struct params params;
|
|
|
|
|
|
|
|
struct packet {
|
2023-10-08 14:43:34 +03:00
|
|
|
ssize_t size;
|
|
|
|
char *data;
|
2023-06-03 22:52:10 +03:00
|
|
|
};
|
|
|
|
extern struct packet fake_tls;
|
|
|
|
extern struct packet fake_http;
|
2023-07-07 23:07:27 +03:00
|
|
|
extern struct packet fake_udp;
|
2023-06-03 22:52:10 +03:00
|
|
|
|
|
|
|
#define LOG_S 1
|
|
|
|
#define LOG_L 2
|
|
|
|
|
|
|
|
#define LOG(s, str, ...) \
|
2023-06-12 11:01:40 +03:00
|
|
|
if (params.debug >= s) printf(str, ##__VA_ARGS__)
|
2023-10-08 14:43:34 +03:00
|
|
|
|