Co-authored-by: root <root@simasuh.fvds.ru> Reviewed-on: https://gitea.serafimdev.com/serafim/dos/pulls/24
This commit is contained in:
parent
89a828c3fc
commit
de3085f043
|
@ -103,7 +103,7 @@ int my_check_params()
|
||||||
long_options[8] = {NULL, 0, NULL, 0};
|
long_options[8] = {NULL, 0, NULL, 0};
|
||||||
i = 0;
|
i = 0;
|
||||||
|
|
||||||
printf("begin my_check_params"); // debug
|
printf("begin my_check_params\n"); // debug
|
||||||
|
|
||||||
now_time_t = std::time(nullptr);
|
now_time_t = std::time(nullptr);
|
||||||
// Выводим информацию о времени запуска программы
|
// Выводим информацию о времени запуска программы
|
||||||
|
@ -174,7 +174,7 @@ int my_check_params()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("end my_check_params status: %i\n", status); // debug
|
printf("end my_check_params\n"); // debug
|
||||||
|
|
||||||
return -101;
|
return -101;
|
||||||
}
|
}
|
||||||
|
@ -293,7 +293,7 @@ void my_diag()
|
||||||
printf("Error: Missing required parameters for tcp syn dos attack!\n--help for more info\n");
|
printf("Error: Missing required parameters for tcp syn dos attack!\n--help for more info\n");
|
||||||
break;
|
break;
|
||||||
case -101: // Встречена неизвестная опция командной строки
|
case -101: // Встречена неизвестная опция командной строки
|
||||||
printf("Error: Unknown option!\n.--help for info\n");
|
printf("Error: Unknown option!\n--help for info\n");
|
||||||
break;
|
break;
|
||||||
case -600: // Неполные данные для Telegram-уведомлений
|
case -600: // Неполные данные для Telegram-уведомлений
|
||||||
printf("Error: To use telegram integration both telegram_id and telegram_token have to be provided!\n.--help for info\n");
|
printf("Error: To use telegram integration both telegram_id and telegram_token have to be provided!\n.--help for info\n");
|
||||||
|
@ -534,6 +534,7 @@ void my_fin()
|
||||||
std::chrono::minutes minutes; // Компонента минут времени завершения
|
std::chrono::minutes minutes; // Компонента минут времени завершения
|
||||||
std::chrono::seconds seconds; // Компонента секунд времени завершения
|
std::chrono::seconds seconds; // Компонента секунд времени завершения
|
||||||
std::chrono::milliseconds milliseconds; // Компонента миллисекунд времени завершения
|
std::chrono::milliseconds milliseconds; // Компонента миллисекунд времени завершения
|
||||||
|
double total_seconds;
|
||||||
|
|
||||||
// Иницаализация
|
// Иницаализация
|
||||||
end_time_t = std::chrono::system_clock::to_time_t(std::chrono::system_clock::now());
|
end_time_t = std::chrono::system_clock::to_time_t(std::chrono::system_clock::now());
|
||||||
|
@ -542,7 +543,6 @@ void my_fin()
|
||||||
minutes = std::chrono::duration_cast<std::chrono::minutes>(duration % std::chrono::hours(1)); // Разбиваем продолжительность на компоненты
|
minutes = std::chrono::duration_cast<std::chrono::minutes>(duration % std::chrono::hours(1)); // Разбиваем продолжительность на компоненты
|
||||||
seconds = std::chrono::duration_cast<std::chrono::seconds>(duration % std::chrono::minutes(1)); // Разбиваем продолжительность на компоненты
|
seconds = std::chrono::duration_cast<std::chrono::seconds>(duration % std::chrono::minutes(1)); // Разбиваем продолжительность на компоненты
|
||||||
milliseconds = std::chrono::duration_cast<std::chrono::milliseconds>(duration % std::chrono::seconds(1)); // Разбиваем продолжительность на компоненты
|
milliseconds = std::chrono::duration_cast<std::chrono::milliseconds>(duration % std::chrono::seconds(1)); // Разбиваем продолжительность на компоненты
|
||||||
double total_seconds;
|
|
||||||
|
|
||||||
printf("begin my_diag\n"); // debug
|
printf("begin my_diag\n"); // debug
|
||||||
|
|
||||||
|
@ -815,25 +815,27 @@ int my_dns()
|
||||||
█ █████ █ █ ███ █ █ █ ███ █ █ █ █ █ █ █ █ ███ █
|
█ █████ █ █ ███ █ █ █ ███ █ █ █ █ █ █ █ █ ███ █
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <chrono>
|
||||||
|
#include <thread>
|
||||||
|
|
||||||
int main(int arg_ctr, char **arg_ptr)
|
int main(int arg_ctr, char **arg_ptr)
|
||||||
{
|
{
|
||||||
// Инициализация глобальных переменных
|
// Инициализация глобальных переменных
|
||||||
int argc = arg_ctr;
|
argc = arg_ctr;
|
||||||
char **argv = arg_ptr;
|
argv = arg_ptr;
|
||||||
std::string attack_type = "";
|
attack_type = "";
|
||||||
std::string domain = "";
|
domain = "";
|
||||||
std::string ip = "";
|
ip = "";
|
||||||
std::string port = "";
|
port = "";
|
||||||
std::string log_file = "/var/log/DosAtk";
|
log_file = "/var/log/DosAtk";
|
||||||
std::string telegram_id = "";
|
telegram_id = "";
|
||||||
std::string telegram_token = "";
|
telegram_token = "";
|
||||||
int n_ok_requests = 0;
|
n_ok_requests = 0;
|
||||||
int n_fail_requests = 0;
|
n_fail_requests = 0;
|
||||||
std::chrono::system_clock::time_point start_timestamp = std::chrono::system_clock::now();
|
start_timestamp = std::chrono::system_clock::now();
|
||||||
std::string log_msg = "";
|
log_msg = "";
|
||||||
std::string fin_msg = "";
|
fin_msg = "";
|
||||||
std::string msg;
|
status = 0;
|
||||||
int status = 0;
|
|
||||||
|
|
||||||
status = my_check_params(); // Проверяем параметры командной строки
|
status = my_check_params(); // Проверяем параметры командной строки
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue