/* * stop all the mitm attack(s) */ static void curses_mitm_stop(void) { wdg_t *dlg; DEBUG_MSG("curses_mitm_stop"); /* create the dialog */ wdg_create_object(&dlg, WDG_DIALOG, WDG_OBJ_WANT_FOCUS); wdg_set_color(dlg, WDG_COLOR_SCREEN, EC_COLOR); wdg_set_color(dlg, WDG_COLOR_WINDOW, EC_COLOR); wdg_set_color(dlg, WDG_COLOR_FOCUS, EC_COLOR_FOCUS); wdg_set_color(dlg, WDG_COLOR_TITLE, EC_COLOR_TITLE); wdg_dialog_text(dlg, WDG_NO_BUTTONS, "Stopping the mitm attack..."); wdg_draw_object(dlg); wdg_set_focus(dlg); wdg_update_screen(); /* stop the mitm process */ mitm_stop(); wdg_destroy_object(&dlg); curses_message("MITM attack(s) stopped"); }
static void curses_load_plugin(const char *path, char *file) { int ret; DEBUG_MSG("curses_load_plugin %s/%s", path, file); /* load the plugin */ ret = plugin_load_single(path, file); /* check the return code */ switch (ret) { case ESUCCESS: curses_message("Plugin loaded successfully"); break; case -EDUPLICATE: ui_error("plugin %s already loaded...", file); break; case -EVERSION: ui_error("plugin %s was compiled for a different ettercap version...", file); break; case -EINVALID: default: ui_error("Cannot load the plugin...\nthe file may be an invalid plugin\nor you don't have the permission to open it"); break; } }
static void curses_plugin_help(void *dummy) { char help[] = "HELP: shortcut list:\n\n" " ENTER - activate/deactivate a plugin"; curses_message(help); }
/* * uload the filter chain */ static void curses_stop_filter(void) { DEBUG_MSG("curses_stop_filter"); filter_unload(GBL_FILTERS); curses_message("Filters were unloaded"); }
/* * kill the selected connection connection */ static void curses_connection_kill(void *conn) { struct conn_tail *c = (struct conn_tail *)conn; DEBUG_MSG("curses_connection_kill"); /* kill it */ switch (user_kill(c->co)) { case E_SUCCESS: /* set the status */ c->co->status = CONN_KILLED; curses_message("The connection was killed !!"); break; case -E_FATAL: curses_message("Cannot kill UDP connections !!"); break; } }
static void curses_plugin_help(void *dummy) { /* variable not used */ (void) dummy; char help[] = "HELP: shortcut list:\n\n" " ENTER - activate/deactivate a plugin"; curses_message(help); }
static void curses_connection_data_help(void) { char help[] = "HELP: shortcut list:\n\n" " ARROWS - switch between panels\n" " j - switch from split to joined view\n" " y - inject characters interactively\n" " Y - inject characters from a file\n" " k - kill the connection"; curses_message(help); }
static void curses_connection_help(void *dummy) { /* variable not used */ (void) dummy; char help[] = "HELP: shortcut list:\n\n" " ENTER - open the data panel in real time\n" " d - show details of the current connection\n" " k - kill the connection\n" " x - purge the connection list"; curses_message(help); }
void PrintMessage(const char *format, ...) { va_list args; char message[MAX_MSG_SIZE + 1 + 1]; va_start(args, format); vsnprintf((char *) &message, MAX_MSG_SIZE, format, args); va_end(args); if (rt.display_mode == DISP_CURSES){ curses_message(message); } else{ if (fwrite(message, 1, strlen(message), stdout) != strlen(message)){ return; } } delay_ms(500); return; }
static void curses_stop_msg(void) { set_msg_loglevel(LOG_FALSE, NULL); curses_message("Message logging was stopped."); }
static void curses_stop_log(void) { set_loglevel(LOG_STOP, ""); curses_message("Logging was stopped."); }