ec_interface_sniff.c
上传用户:nilegod
上传日期:2007-01-08
资源大小:220k
文件大小:21k
源码类别:

网络截获/分析

开发平台:

C/C++

  1. /*
  2.     ettercap -- ncurses interface for connection list
  3.     Copyright (C) 2001  ALoR <alor@users.sourceforge.net>, NaGA <crwm@freemail.it>
  4.     This program is free software; you can redistribute it and/or modify
  5.     it under the terms of the GNU General Public License as published by
  6.     the Free Software Foundation; either version 2 of the License, or
  7.     (at your option) any later version.
  8.     This program is distributed in the hope that it will be useful,
  9.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  10.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  11.     GNU General Public License for more details.
  12.     You should have received a copy of the GNU General Public License
  13.     along with this program; if not, write to the Free Software
  14.     Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  15. */
  16. #include "include/ec_main.h"
  17. #ifdef HAVE_NCURSES  // don't compile if ncurses interface is not supported
  18. #include <string.h>
  19. #include <ncurses.h>
  20. #include <unistd.h>
  21. #include <signal.h>
  22. #include <sys/time.h>
  23. #include "include/ec_interface.h"
  24. #include "include/ec_interface_sniff_data.h"
  25. #include "include/ec_decodedata.h"
  26. #include "include/ec_illithid.h"
  27. #include "include/ec_doppleganger.h"
  28. #include "include/ec_inet.h"
  29. #include "include/ec_inet_forge.h"
  30. #include "include/ec_inet_structures.h"
  31. #include "include/ec_buffer.h"
  32. #ifdef DEBUG
  33.    #include "include/ec_debug.h"
  34. #endif
  35. #define BOTTOM_COLOR 1        // color schemes
  36. #define TITLE_COLOR  2
  37. #define MAIN_COLOR   3
  38. #define POINT_COLOR  4
  39. #define SEL_COLOR    5
  40. #define HELP_COLOR   6
  41. #define SNIFF_COLOR  7
  42. #define KEY_RETURN   10       // they aren't defined in ncurses.h :(
  43. #define KEY_CTRL_L   12
  44. // protos...
  45. void Interface_Sniff_Run(short mode);
  46. void Interface_Sniff_PointItem(char direction);
  47. void Interface_Sniff_InitList(void);
  48. void Interface_Sniff_RefreshList(void);
  49. void Interface_Sniff_KillConn(void);
  50. void Interface_Sniff_ActiveDissecor(short mode);
  51. // global variables
  52. extern WINDOW *main_window, *bottom_window, *top_window;
  53. extern int W_MAINX1, W_MAINY1, W_MAINX2, W_MAINY2;
  54. extern int W_BOTTOMX1, W_BOTTOMY1, W_BOTTOMX2, W_BOTTOMY2;
  55. extern int W_SELECTCONN;
  56. short LeftMargin = 0;
  57. int Conn_Base_Pointer = 0;
  58. int Conn_Pointer = 0;
  59. extern int Sel_Number;
  60. //---------------------------
  61. void Interface_Sniff_InitList(void)
  62. {
  63.    int j;
  64.    int Conn_Top_Pointer;
  65.    char info[100];
  66. //#ifdef DEBUG
  67. // Debug_msg("Interface_Sniff_InitList");
  68. //#endif
  69.    if (has_colors())
  70.       wbkgdset(main_window, COLOR_PAIR(MAIN_COLOR));
  71.    else
  72.       wattroff(main_window,A_REVERSE);
  73.    werase(main_window);
  74.    if (number_of_connections == 0)     // no connection... no action... ;)
  75.    {
  76.       wnoutrefresh(main_window);
  77.       doupdate();
  78.       return;
  79.    }
  80.    Conn_Top_Pointer = (Conn_Base_Pointer+Sel_Number < number_of_connections) ? Conn_Base_Pointer + Sel_Number : number_of_connections ;
  81.    for(j=Conn_Base_Pointer; j<Conn_Top_Pointer; j++)     // prints connections within the main_window height
  82.    {
  83.       wmove(main_window, j-Conn_Base_Pointer, LeftMargin );
  84.       wprintw(main_window, "%3d) %15s:%d", j+1, Conn_Between_Hosts[j].ip_source, Conn_Between_Hosts[j].source_port);
  85.       mvwprintw(main_window, j-Conn_Base_Pointer, 28," <--> %15s:%d", Conn_Between_Hosts[j].ip_dest , Conn_Between_Hosts[j].dest_port);
  86.       wmove(main_window, j-Conn_Base_Pointer, LeftMargin + 56);  waddch(main_window, ACS_VLINE);
  87.       wprintw(main_window, " %s", Conn_Between_Hosts[j].status);
  88.       wmove(main_window, j-Conn_Base_Pointer, LeftMargin + 65);  waddch(main_window, ACS_VLINE);
  89.       wprintw(main_window, " %s", Conn_Between_Hosts[j].type);
  90.    }
  91.    if (has_colors())
  92.       wbkgdset(main_window, COLOR_PAIR(POINT_COLOR));
  93.    else
  94.       wattron(main_window,A_REVERSE);
  95.    wmove(main_window, Conn_Pointer - Conn_Base_Pointer, LeftMargin );
  96.    whline(main_window, ' ', W_SELECTCONN);
  97.    wprintw(main_window, "%3d) %15s:%d", Conn_Pointer+1, Conn_Between_Hosts[Conn_Pointer].ip_source, Conn_Between_Hosts[Conn_Pointer].source_port);
  98.    mvwprintw(main_window, Conn_Pointer-Conn_Base_Pointer, 28," <--> %15s:%d", Conn_Between_Hosts[Conn_Pointer].ip_dest , Conn_Between_Hosts[Conn_Pointer].dest_port);
  99.    wmove(main_window, Conn_Pointer-Conn_Base_Pointer, LeftMargin + 56);  waddch(main_window, ACS_VLINE);
  100.    wprintw(main_window, " %s", Conn_Between_Hosts[Conn_Pointer].status);
  101.    wmove(main_window, Conn_Pointer - Conn_Base_Pointer, LeftMargin + 65); waddch(main_window, ACS_VLINE);
  102.    wprintw(main_window, " %s", Conn_Between_Hosts[Conn_Pointer].type);
  103.    werase(bottom_window);
  104.    mvwprintw(bottom_window, 0, 1, " %s", Conn_Between_Hosts[Conn_Pointer].user);
  105.    mvwprintw(bottom_window, 1, 1, " %s", Conn_Between_Hosts[Conn_Pointer].pass);
  106.    snprintf(info, W_MAINX2 - 23, "%s", Conn_Between_Hosts[Conn_Pointer].info);
  107.    mvwprintw(bottom_window, 1, 25, " %s", info);
  108.    wnoutrefresh(bottom_window);
  109.    wnoutrefresh(main_window);
  110.    doupdate();
  111. }
  112. void Interface_Sniff_PointItem(char direction)
  113. {
  114.    int Old_Conn_Pointer;
  115.    char info[100];
  116.    if (number_of_connections == 0) return;   // no connection... no action... ;)
  117.    Old_Conn_Pointer = Conn_Pointer;
  118.    Conn_Pointer += direction;
  119.    if (Conn_Pointer > number_of_connections -1 ) Conn_Pointer = number_of_connections - 1;
  120.    if (Conn_Pointer < 0) Conn_Pointer = 0;
  121.    if ( (Conn_Pointer - Conn_Base_Pointer + direction  >= Sel_Number) && (direction > 0) )      // scroll down
  122.    {
  123.       if (Conn_Base_Pointer + Sel_Number <= number_of_connections)
  124.          Conn_Base_Pointer = (Conn_Base_Pointer + direction < number_of_connections) ? Conn_Base_Pointer + direction : number_of_connections - Sel_Number;
  125.       Interface_Sniff_InitList();
  126.    }
  127.    else if ( (Conn_Pointer - Conn_Base_Pointer + direction < 0) && (direction < 0) )         // scroll up
  128.    {
  129.       if (Conn_Base_Pointer > 0)
  130.          Conn_Base_Pointer = (Conn_Base_Pointer + direction > 0) ? Conn_Base_Pointer + direction : 0;
  131.       Interface_Sniff_InitList();
  132.    }
  133.    if (has_colors())
  134.       wbkgdset(main_window, COLOR_PAIR(MAIN_COLOR));
  135.    else
  136.       wattroff(main_window,A_REVERSE);
  137.    if ( (Old_Conn_Pointer >= Conn_Base_Pointer) && (Old_Conn_Pointer <= Conn_Base_Pointer + Sel_Number -1)) // DON'T redraw previous selected item if it is out of view
  138.    {
  139.       wmove(main_window, Old_Conn_Pointer - Conn_Base_Pointer, LeftMargin);
  140.       whline(main_window,' ', W_SELECTCONN);                         //deletes the previous position
  141.       wprintw(main_window, "%3d) %15s:%d", Old_Conn_Pointer+1, Conn_Between_Hosts[Old_Conn_Pointer].ip_source, Conn_Between_Hosts[Old_Conn_Pointer].source_port);
  142.       mvwprintw(main_window, Old_Conn_Pointer-Conn_Base_Pointer, 28," <--> %15s:%d", Conn_Between_Hosts[Old_Conn_Pointer].ip_dest , Conn_Between_Hosts[Old_Conn_Pointer].dest_port);
  143.       wmove(main_window, Old_Conn_Pointer - Conn_Base_Pointer, LeftMargin + 56);  waddch(main_window, ACS_VLINE);
  144.       wprintw(main_window, " %s", Conn_Between_Hosts[Old_Conn_Pointer].status);
  145.       wmove(main_window, Old_Conn_Pointer - Conn_Base_Pointer, LeftMargin + 65);  waddch(main_window, ACS_VLINE);
  146.       wprintw(main_window, " %s", Conn_Between_Hosts[Old_Conn_Pointer].type);
  147.    }
  148.    if (has_colors())
  149.       wbkgdset(main_window, COLOR_PAIR(POINT_COLOR));
  150.    else
  151.       wattron(main_window,A_REVERSE);
  152.    wmove(main_window, Conn_Pointer - Conn_Base_Pointer, LeftMargin);
  153.    whline(main_window, ' ', W_SELECTCONN);                           //select new position
  154.    wprintw(main_window, "%3d) %15s:%d", Conn_Pointer+1, Conn_Between_Hosts[Conn_Pointer].ip_source, Conn_Between_Hosts[Conn_Pointer].source_port);
  155.    mvwprintw(main_window, Conn_Pointer-Conn_Base_Pointer, 28," <--> %15s:%d", Conn_Between_Hosts[Conn_Pointer].ip_dest , Conn_Between_Hosts[Conn_Pointer].dest_port);
  156.    wmove(main_window, Conn_Pointer - Conn_Base_Pointer, LeftMargin + 56);  waddch(main_window, ACS_VLINE);
  157.    wprintw(main_window, " %s", Conn_Between_Hosts[Conn_Pointer].status);
  158.    wmove(main_window, Conn_Pointer - Conn_Base_Pointer, LeftMargin + 65);  waddch(main_window, ACS_VLINE);
  159.    wprintw(main_window, " %s", Conn_Between_Hosts[Conn_Pointer].type);
  160.    werase(bottom_window);
  161.    mvwprintw(bottom_window, 0, 1, " %s", Conn_Between_Hosts[Conn_Pointer].user);
  162.    mvwprintw(bottom_window, 1, 1, " %s", Conn_Between_Hosts[Conn_Pointer].pass);
  163.    snprintf(info, W_MAINX2 - 23, "%s", Conn_Between_Hosts[Conn_Pointer].info);
  164.    mvwprintw(bottom_window, 1, 25, " %s", info);
  165.    wnoutrefresh(bottom_window);
  166.    wnoutrefresh(main_window);
  167.    doupdate();
  168. }
  169. void Interface_Sniff_RefreshList(void)
  170. {
  171.    WINDOW *message_window;
  172. #ifdef DEBUG
  173.    Debug_msg("Interface_Sniff_RefreshList");
  174. #endif
  175.    message_window = newwin(5, strlen("updating list...") + 4,0,0);
  176.    mvwin(message_window, W_MAINY1+(W_MAINY2-W_MAINY1)/2-2, W_MAINX2/2 - (strlen("updating list...") + 4)/2 );
  177.    wbkgdset(message_window, COLOR_PAIR(TITLE_COLOR));
  178.    wattron(message_window, A_BOLD);
  179.    box(message_window,ACS_VLINE,ACS_HLINE);
  180.    mvwprintw(message_window,  2, 2, "updating list...");
  181.    wnoutrefresh(message_window);
  182.    doupdate();
  183.    number_of_connections = Decodedata_RefreshConnectionList();
  184.    Conn_Pointer = 0;
  185.    Conn_Base_Pointer = 0;
  186.    delwin(message_window);
  187.    werase(bottom_window);
  188.    wnoutrefresh(bottom_window);
  189.    wnoutrefresh(main_window);
  190.    doupdate();
  191. }
  192. void Interface_Sniff_KillConn(void)
  193. {
  194.    u_char *buf;
  195.    char *MACD, MACS[6];
  196.    u_long IPS, IPD;
  197.    int sock;
  198. //   char answer;
  199.    if (Conn_Between_Hosts[Conn_Pointer].proto == 'U')
  200.    {
  201.       Interface_PopUp("Trying to kill an UDP connection ?!? Ehi Kiddie, go home !!");
  202.       return;
  203.    }
  204. //   answer = Interface_PopUp("Do U really want to kill this connection (y/n)?");
  205. //   if ((answer != 'y') && (answer != 'Y'))
  206. //      return;
  207. #ifdef DEBUG
  208.    Debug_msg("Interface_Sniff_KillConn -- %s:%d -> %s:%d  %lu %lu", Conn_Between_Hosts[Conn_Pointer].ip_source,
  209.                                                                     Conn_Between_Hosts[Conn_Pointer].source_port,
  210.                                                                     Conn_Between_Hosts[Conn_Pointer].ip_dest,
  211.                                                                     Conn_Between_Hosts[Conn_Pointer].dest_port,
  212.                                                                     Conn_Between_Hosts[Conn_Pointer].source_seq,
  213.                                                                     Conn_Between_Hosts[Conn_Pointer].dest_seq );
  214. #endif
  215.    Inet_GetMACfromString(Inet_MyMACAddress(), MACS);
  216.    IPS = inet_addr(Conn_Between_Hosts[Conn_Pointer].ip_source);
  217.    IPD = inet_addr(Conn_Between_Hosts[Conn_Pointer].ip_dest);
  218.    MACD=Inet_MacFromIP(IPD);
  219.    buf = Inet_Forge_packet( ETH_HEADER + IP_HEADER + TCP_HEADER );
  220.    Inet_Forge_ethernet( buf, MACS, MACD, ETH_P_IP );
  221.    Inet_Forge_ip( buf + ETH_HEADER, IPS, IPD, TCP_HEADER, 0xe77e, 0, IPPROTO_TCP );    // to source
  222.    Inet_Forge_tcp( buf + ETH_HEADER + IP_HEADER, Conn_Between_Hosts[Conn_Pointer].source_port,
  223.                                                  Conn_Between_Hosts[Conn_Pointer].dest_port,
  224.                                                  Conn_Between_Hosts[Conn_Pointer].source_seq,
  225.                                                  0,
  226.                                                  TH_RST,
  227.                                                  0, 0 );
  228.    sock = Inet_OpenRawSock(Options.netiface);
  229.    MACD=Inet_MacFromIP(IPS);
  230.    Inet_SendRawPacket(sock, buf, ETH_HEADER + IP_HEADER + TCP_HEADER );
  231.    Inet_Forge_ethernet( buf, MACS, MACD, ETH_P_IP );
  232.    Inet_Forge_ip( buf + ETH_HEADER, IPD, IPS, TCP_HEADER, 0xe77e, 0, IPPROTO_TCP );    // to dest
  233.    Inet_Forge_tcp( buf + ETH_HEADER + IP_HEADER, Conn_Between_Hosts[Conn_Pointer].dest_port,
  234.                                                  Conn_Between_Hosts[Conn_Pointer].source_port,
  235.                                                  Conn_Between_Hosts[Conn_Pointer].dest_seq,
  236.                                                  0,
  237.                                                  TH_RST,
  238.                                                  0, 0 );
  239.    Inet_SendRawPacket(sock, buf, ETH_HEADER + IP_HEADER + TCP_HEADER );
  240.    Inet_Forge_packet_destroy( buf );
  241.    strcpy(Conn_Between_Hosts[Conn_Pointer].status, "KILLED");
  242.    close(sock);
  243. }
  244. void Interface_Sniff_ActiveDissecor(short mode)
  245. {
  246. #ifdef DEBUG
  247.    Debug_msg("Interface_Sniff_ActiveDissecor %d", active_dissector);
  248. #endif
  249.    wbkgdset(top_window, COLOR_PAIR(HELP_COLOR));
  250.    mvwprintw(top_window, 2, 31, "Active Dissector: ");
  251.    switch(active_dissector)
  252.    {
  253.       case 1:  wbkgdset(top_window, COLOR_PAIR(BOTTOM_COLOR));
  254.                mvwprintw(top_window, 2, 49, "ON ");
  255.                break;
  256.       case 0:  wbkgdset(top_window, COLOR_PAIR(BOTTOM_COLOR));
  257.                mvwprintw(top_window, 2, 49, "OFF");
  258.                break;
  259.    }
  260.    wnoutrefresh(top_window);
  261.    doupdate();
  262. }
  263. void Interface_Sniff_Run(short mode)
  264. {
  265.    int KeyPress;
  266.    int Illithid_pid = 0, Dopple_pid = 0;
  267.    fd_set msk_fd;
  268.    struct timeval TimeOut;
  269.    CONNECTION data_from_illithid;
  270. #ifdef DEBUG
  271.    Debug_msg("Interface_Sniff_Run -- mode %d", mode);
  272. #endif
  273.    wbkgdset(main_window, COLOR_PAIR(MAIN_COLOR));
  274.    werase(main_window);
  275.    werase(bottom_window);
  276.    wmove(bottom_window, 0, 0);
  277.    wnoutrefresh(main_window);
  278.    wnoutrefresh(bottom_window);
  279.    doupdate();
  280.    if (mode != ARPBASED )
  281.       active_dissector = 0;
  282.    Interface_Sniff_ActiveDissecor(mode);
  283.    number_of_connections = 0;
  284.    Interface_Sniff_RefreshList();
  285.    Interface_Sniff_InitList();
  286.    Buffer_Flush(pipe_with_illithid);
  287.    switch (mode)
  288.    {
  289.       case ARPBASED:
  290.       case PUBLICARP:
  291.                      Dopple_pid = Doppleganger_Run(Options.netiface, Host_Source.ip, Host_Dest.ip, Host_Source.mac, Host_Dest.mac);
  292.                      if ( mode == ARPBASED )
  293.                         Illithid_pid = Illithid_ARPBased_GetConnections(Options.netiface, Host_Source.ip, Host_Dest.ip, Host_Source.mac, Host_Dest.mac);
  294.                      else
  295.                         Illithid_pid = Illithid_PublicARP_GetConnections(Options.netiface, Host_Source.ip, Host_Dest.ip, Host_Source.mac, Host_Dest.mac);
  296.                      break;
  297.       case IPBASED:
  298.                      Illithid_pid = Illithid_IPBased_GetConnections(Options.netiface, Host_Source.ip, Host_Dest.ip);
  299.                      break;
  300.       case MACBASED:
  301.                      Illithid_pid = Illithid_MACBased_GetConnections(Options.netiface, Host_Source.mac, Host_Dest.mac);
  302.                      break;
  303.    }
  304.    memset(&TimeOut, 0, sizeof(TimeOut));  //  timeout = 0
  305.    FD_ZERO(&msk_fd);
  306.    loop
  307.    {
  308.       int datalen;
  309.       FD_SET(0, &msk_fd);
  310.       select(FOPEN_MAX, &msk_fd, (fd_set *) 0, (fd_set *) 0, &TimeOut);
  311.       memset(&data_from_illithid, 0, sizeof(CONNECTION));
  312.       datalen = Buffer_Get(pipe_with_illithid, &data_from_illithid, sizeof(CONNECTION));
  313.       if (datalen > 0)
  314.       {
  315.          number_of_connections = Decodedata_MakeConnectionList(data_from_illithid);
  316.          Interface_Sniff_InitList();
  317.       }
  318.       else  // workaround for the 100% CPU usage...
  319.          usleep(5);
  320.       if (FD_ISSET(0, &msk_fd))
  321.       {
  322.          KeyPress = wgetch(main_window);
  323.          switch (KeyPress)
  324.          {
  325.             case KEY_DOWN:
  326.                      Interface_Sniff_PointItem(1);
  327.                      break;
  328.             case KEY_UP:
  329.                      Interface_Sniff_PointItem(-1);
  330.                      break;
  331.             case KEY_NPAGE:
  332.                      Interface_Sniff_PointItem(Sel_Number-1);  //PGDOWN
  333.                      break;
  334.             case KEY_PPAGE:
  335.                      Interface_Sniff_PointItem(-Sel_Number+1); //PGUP
  336.                      break;
  337.             case KEY_RETURN:
  338.                      if (Conn_Between_Hosts[Conn_Pointer].ip_source == NULL) break;   // no connections
  339.                      wmove(bottom_window, 0, 0);
  340.                      if ( mode == PUBLICARP )
  341.                          kill(Dopple_pid,SIGTERM);    // kill publicARP doppleganger...
  342.                      kill(Illithid_pid, SIGUSR2);
  343.                      Interface_Sniff_Data_Run(Conn_Between_Hosts[Conn_Pointer].ip_source,
  344.                                               Conn_Between_Hosts[Conn_Pointer].source_port,
  345.                                               Conn_Between_Hosts[Conn_Pointer].ip_dest,
  346.                                               Conn_Between_Hosts[Conn_Pointer].dest_port,
  347.                                               Conn_Between_Hosts[Conn_Pointer].mac_source,
  348.                                               Conn_Between_Hosts[Conn_Pointer].mac_dest,
  349.                                               Conn_Between_Hosts[Conn_Pointer].proto,
  350.                                               Conn_Between_Hosts[Conn_Pointer].type,
  351.                                               mode);
  352.                      // wait and then...
  353.                      kill(Illithid_pid, SIGUSR2);
  354.                      if ( mode == PUBLICARP )
  355.                          Dopple_pid = Doppleganger_Run(Options.netiface, Host_Source.ip, Host_Dest.ip, Host_Source.mac, Host_Dest.mac);
  356.                      Interface_Sniff_InitList();
  357.                      break;
  358.             case 'K':
  359.             case 'k':
  360.                      if (Conn_Between_Hosts[Conn_Pointer].ip_source == NULL) break;   // no connections
  361.                      Interface_Sniff_KillConn();      // with TH_RST !  i'm too tired to implement FIN handshaking
  362.                      Interface_Sniff_InitList();
  363.                      break;
  364.             case 'D':
  365.             case 'd':
  366.                      {
  367.                         char source[40];
  368.                         char dest[40];
  369.                         char mesg[80];
  370.                         if (Conn_Between_Hosts[Conn_Pointer].ip_source == NULL) break;   // no connections
  371.                         snprintf(source, 40, " %s (%s) <-->", Inet_HostName(Conn_Between_Hosts[Conn_Pointer].ip_source),
  372.                                                               Conn_Between_Hosts[Conn_Pointer].ip_source);
  373.                         snprintf(dest, 40, " %s (%s)", Inet_HostName(Conn_Between_Hosts[Conn_Pointer].ip_dest),
  374.                                                        Conn_Between_Hosts[Conn_Pointer].ip_dest);
  375.                         snprintf(mesg, 80, "%s%s", source, dest);
  376.                         Interface_PopUp(mesg);
  377.                      }
  378.                      break;
  379.             case 'R':
  380.             case 'r':
  381.                      Interface_Sniff_RefreshList();
  382.                      Interface_Sniff_InitList();
  383.                      break;
  384.             case 'A':
  385.             case 'a':
  386.                      if (mode == ARPBASED)
  387.                      {
  388.                         kill(Illithid_pid, SIGUSR1);  // activate/deactivate special dissector
  389.                         active_dissector = 0;
  390.                         Interface_Sniff_ActiveDissecor(mode);
  391.                      }
  392.                      else
  393.                      {
  394.                         Interface_PopUp("ACTIVE dissector is available only in ARP BASED mode !!");
  395.                      }
  396.                      break;
  397.             case KEY_CTRL_L:  // CTRL+L refresh the screen
  398.                      Interface_Redraw();
  399.                      break;
  400.             case KEY_F(1):
  401.             case 'H':
  402.             case 'h':{
  403.                         static char *help[] = {
  404.                            "[qQ][F10] - quit",
  405.                            "[return]  - sniff the selected connection",
  406.                            "[aA]      - enable/disable ACTIVE password collector",
  407.                            "[kK]      - kill the connection (be careful !)",
  408.                            "[dD]      - resolve ip via DNS",
  409.                            "[rR]      - refresh the list",
  410.                            NULL};
  411.                         Interface_HelpWindow(help);
  412.                      }
  413.                      Interface_Redraw();
  414.                      break;
  415.             case 'Q':
  416.             case 'q':
  417.                      kill(Illithid_pid, SIGTERM);
  418.                      if (Dopple_pid) kill(Dopple_pid, SIGTERM);
  419.                      #ifdef DEBUG
  420.                         Debug_msg("Interface_Sniff_END");
  421.                      #endif
  422.                      if (Options.silent) Interface_WExit("They are safe!!  for now... ");
  423.                      werase(bottom_window);
  424.                      wnoutrefresh(bottom_window);
  425.                      doupdate();
  426.                      return;
  427.                      break;
  428.             case KEY_F(10):
  429.                      #ifdef DEBUG
  430.                         Debug_msg("Interface_Sniff_END");
  431.                         Debug_msg("Interface_Run_END");
  432.                      #endif
  433.                      kill(Illithid_pid, SIGTERM);
  434.                      if (Dopple_pid) kill(Dopple_pid, SIGTERM);
  435.                      Interface_WExit("They are safe!!  for now... ");
  436.                      break;
  437.          }
  438.       }
  439.    }
  440. }
  441. #endif
  442. /* EOF */