예제 #1
0
/*
 * kill the capturing threads, but leave untouched the others
 */
void stop_unified_sniff(void)
{
   pthread_t pid;
   
   DEBUG_MSG("stop_unified_sniff");
   
   if (GBL_SNIFF->active == 0) {
      USER_MSG("Unified sniffing is not running...\n");
      return;
   }
  
   /* kill it */
   capture_stop(GBL_IFACE);

   if(GBL_OPTIONS->secondary)
      secondary_sources_foreach(capture_stop);
   
   pid = ec_thread_getpid("sslwrap");
   if (!pthread_equal(pid, EC_PTHREAD_NULL))
      ec_thread_destroy(pid);

   USER_MSG("Unified sniffing was stopped.\n");

   GBL_SNIFF->active = 0;
}
예제 #2
0
void capture_stop(struct iface_env *iface)
{
   pthread_t pid;
   char thread_name[64];

   snprintf(thread_name, sizeof(thread_name), "capture[%s]", iface->name);
   pid = ec_thread_getpid(thread_name);
   if(!pthread_equal(pid, EC_PTHREAD_NULL))
      ec_thread_destroy(pid);
}
예제 #3
0
/*
 * kill the capturing threads, but leave untouched the others
 */
void stop_unified_sniff(void)
{
   pthread_t pid;
   
   DEBUG_MSG("stop_unified_sniff");
   
   if (GBL_SNIFF->active == 0) {
      USER_MSG("Unified sniffing is not running...\n");
      return;
   }
  
   /* get the pid and kill it */
   pid = ec_thread_getpid("capture");
   if (!pthread_equal(pid, EC_PTHREAD_NULL))
      ec_thread_destroy(pid);
   
   pid = ec_thread_getpid("sslwrap");
   if (!pthread_equal(pid, EC_PTHREAD_NULL))
      ec_thread_destroy(pid);

   USER_MSG("Unified sniffing was stopped.\n");

   GBL_SNIFF->active = 0;
}
예제 #4
0
static int dos_attack_fini(void *dummy) 
{
   pthread_t pid;

   /* Remove the hooks */
   hook_del(HOOK_PACKET_ARP_RQ, &parse_arp);
   hook_del(HOOK_PACKET_TCP, &parse_tcp);
   
   pid = ec_thread_getpid("golem");
   
   /* the thread is active or not ? */
   if (!pthread_equal(pid, EC_PTHREAD_NULL))
      ec_thread_destroy(pid);

   INSTANT_USER_MSG("dos_attack: plugin terminated...\n");

   return PLUGIN_FINISHED;   
}