ec_arp_poisoning.c (ettercap-0.8.3) | : | ec_arp_poisoning.c (ettercap-0.8.3.1) | ||
---|---|---|---|---|
skipping to change at line 157 | skipping to change at line 157 | |||
struct hosts_list *h; | struct hosts_list *h; | |||
struct hosts_list *g1, *g2; | struct hosts_list *g1, *g2; | |||
pthread_t pid; | pthread_t pid; | |||
DEBUG_MSG("arp_poisoning_stop"); | DEBUG_MSG("arp_poisoning_stop"); | |||
/* destroy the poisoner thread */ | /* destroy the poisoner thread */ | |||
pid = ec_thread_getpid("arp_poisoner"); | pid = ec_thread_getpid("arp_poisoner"); | |||
/* the thread is active or not ? */ | /* the thread is active or not ? */ | |||
if (!pthread_equal(pid, EC_PTHREAD_NULL)) | if (!pthread_equal(pid, ec_thread_getpid(NULL))) | |||
ec_thread_destroy(pid); | ec_thread_destroy(pid); | |||
else | else | |||
return; | return; | |||
/* stop confirming ARP requests with poisoned answers */ | /* stop confirming ARP requests with poisoned answers */ | |||
hook_del(HOOK_PACKET_ARP_RQ, &arp_poisoning_confirm); | hook_del(HOOK_PACKET_ARP_RQ, &arp_poisoning_confirm); | |||
USER_MSG("ARP poisoner deactivated.\n"); | USER_MSG("ARP poisoner deactivated.\n"); | |||
USER_MSG("RE-ARPing the victims...\n"); | USER_MSG("RE-ARPing the victims...\n"); | |||
skipping to change at line 289 | skipping to change at line 289 | |||
send_arp(ARPOP_REQUEST, &g2->ip, EC_GBL_IFACE->mac, &g1->ip, g1-> mac); | send_arp(ARPOP_REQUEST, &g2->ip, EC_GBL_IFACE->mac, &g1->ip, g1-> mac); | |||
/* only send from T2 to T1 */ | /* only send from T2 to T1 */ | |||
if (!poison_oneway) | if (!poison_oneway) | |||
send_arp(ARPOP_REQUEST, &g1->ip, EC_GBL_IFACE->mac, &g2->ip, g 2->mac); | send_arp(ARPOP_REQUEST, &g1->ip, EC_GBL_IFACE->mac, &g2->ip, g 2->mac); | |||
} | } | |||
ec_usleep(MILLI2MICRO(EC_GBL_CONF->arp_storm_delay)); | ec_usleep(MILLI2MICRO(EC_GBL_CONF->arp_storm_delay)); | |||
} | } | |||
} | } | |||
/* if smart poisoning is enabled only poison inital and then only on reque st */ | /* if smart poisoning is enabled only poison initial and then only on requ est */ | |||
if (EC_GBL_CONF->arp_poison_smart && i >= 3) | if (EC_GBL_CONF->arp_poison_smart && i >= 3) | |||
return NULL; | return NULL; | |||
/* | /* | |||
* wait the correct delay: | * wait the correct delay: | |||
* for the first 5 time use the warm_up | * for the first 5 time use the warm_up | |||
* then use normal delay | * then use normal delay | |||
*/ | */ | |||
if (i < 5) { | if (i < 5) { | |||
ec_usleep(SEC2MICRO(EC_GBL_CONF->arp_poison_warm_up)); | ec_usleep(SEC2MICRO(EC_GBL_CONF->arp_poison_warm_up)); | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added |