Skip to content

Commit 16b7457

Browse files
committed
updated plugins to 0.8.0
1 parent 5e93fa0 commit 16b7457

File tree

40 files changed

+4047
-362
lines changed

40 files changed

+4047
-362
lines changed

Android.mk

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ ettercap_pl_includes := \
55
external/libpcre\
66
external/libpcap\
77
external/libnet/libnet/include\
8-
external/libbthread
8+
external/libbthread\
9+
external/libcurl/include
910

1011

1112
include $(call all-subdir-makefiles)

plug-ins/arp_cop/arp_cop.c

+6-7
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
along with this program; if not, write to the Free Software
2020
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2121
22-
$Id: arp_cop.c,v 1.4 2004/05/13 09:54:55 alor Exp $
2322
*/
2423

2524

@@ -43,17 +42,17 @@ LIST_HEAD(, hosts_list) arp_cop_table;
4342

4443
struct plugin_ops arp_cop_ops = {
4544
/* ettercap version MUST be the global EC_VERSION */
46-
ettercap_version: EC_VERSION,
45+
.ettercap_version = EC_VERSION,
4746
/* the name of the plugin */
48-
name: "arp_cop",
47+
.name = "arp_cop",
4948
/* a short description of the plugin (max 50 chars) */
50-
info: "Report suspicious ARP activity",
49+
.info = "Report suspicious ARP activity",
5150
/* the plugin version. */
52-
version: "1.1",
51+
.version = "1.1",
5352
/* activation function */
54-
init: &arp_cop_init,
53+
.init = &arp_cop_init,
5554
/* deactivation function */
56-
fini: &arp_cop_fini,
55+
.fini = &arp_cop_fini,
5756
};
5857

5958
/**********************************************************/

plug-ins/autoadd/autoadd.c

+6-7
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
along with this program; if not, write to the Free Software
1818
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1919
20-
$Id: autoadd.c,v 1.6 2004/10/25 20:35:15 alor Exp $
2120
*/
2221

2322

@@ -39,17 +38,17 @@ static int add_to_victims(void *group, struct packet_object *po);
3938

4039
struct plugin_ops autoadd_ops = {
4140
/* ettercap version MUST be the global EC_VERSION */
42-
ettercap_version: EC_VERSION,
41+
.ettercap_version = EC_VERSION,
4342
/* the name of the plugin */
44-
name: "autoadd",
43+
.name = "autoadd",
4544
/* a short description of the plugin (max 50 chars) */
46-
info: "Automatically add new victims in the target range",
45+
.info = "Automatically add new victims in the target range",
4746
/* the plugin version. */
48-
version: "1.2",
47+
.version = "1.2",
4948
/* activation function */
50-
init: &autoadd_init,
49+
.init = &autoadd_init,
5150
/* deactivation function */
52-
fini: &autoadd_fini,
51+
.fini = &autoadd_fini,
5352
};
5453

5554
/**********************************************************/

plug-ins/chk_poison/chk_poison.c

+20-10
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
along with this program; if not, write to the Free Software
2121
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2222
23-
$Id: chk_poison.c,v 1.4 2004/07/28 08:06:31 alor Exp $
2423
*/
2524

2625

@@ -32,6 +31,7 @@
3231
#include <ec_mitm.h>
3332

3433
#include <pthread.h>
34+
#include <time.h>
3535

3636
struct poison_list {
3737
struct ip_addr ip[2];
@@ -57,17 +57,17 @@ static void parse_icmp(struct packet_object *po);
5757

5858
struct plugin_ops chk_poison_ops = {
5959
/* ettercap version MUST be the global EC_VERSION */
60-
ettercap_version: EC_VERSION,
60+
.ettercap_version = EC_VERSION,
6161
/* the name of the plugin */
62-
name: "chk_poison",
62+
.name = "chk_poison",
6363
/* a short description of the plugin (max 50 chars) */
64-
info: "Check if the poisoning had success",
64+
.info = "Check if the poisoning had success",
6565
/* the plugin version. */
66-
version: "1.1",
66+
.version = "1.1",
6767
/* activation function */
68-
init: &chk_poison_init,
68+
.init = &chk_poison_init,
6969
/* deactivation function */
70-
fini: &chk_poison_fini,
70+
.fini = &chk_poison_fini,
7171
};
7272

7373
/**********************************************************/
@@ -89,6 +89,12 @@ static int chk_poison_init(void *dummy)
8989
struct poison_list *p;
9090
char poison_any, poison_full;
9191
u_char i;
92+
93+
#if !defined(OS_WINDOWS)
94+
struct timespec tm;
95+
tm.tv_sec = GBL_CONF->arp_storm_delay;
96+
tm.tv_nsec = 0;
97+
#endif
9298

9399
/* don't show packets while operating */
94100
GBL_OPTIONS->quiet = 1;
@@ -123,8 +129,12 @@ static int chk_poison_init(void *dummy)
123129
/* Send spoofed ICMP echo request to each victim */
124130
SLIST_FOREACH(p, &poison_table, next) {
125131
for (i = 0; i <= 1; i++) {
126-
send_L3_icmp_echo(ICMP_ECHO, &(p->ip[i]), &(p->ip[!i]));
127-
usleep(GBL_CONF->arp_storm_delay * 1000);
132+
send_L3_icmp_echo(&(p->ip[i]), &(p->ip[!i]));
133+
#if !defined(OS_WINDOWS)
134+
nanosleep(&tm, NULL);
135+
#else
136+
usleep(GBL_CONF->arp_storm_delay);
137+
#endif
128138
}
129139
}
130140

@@ -151,7 +161,7 @@ static int chk_poison_init(void *dummy)
151161
if (!poison_any)
152162
INSTANT_USER_MSG("chk_poison: No poisoning at all :(\n");
153163
else if (poison_full)
154-
INSTANT_USER_MSG("chk_poison: Poisoning process succesful!\n");
164+
INSTANT_USER_MSG("chk_poison: Poisoning process successful!\n");
155165
else
156166
SLIST_FOREACH(p, &poison_table, next) {
157167
for (i=0; i<=1; i++)

0 commit comments

Comments
 (0)