# ettercap segmentation fault



## dead_rabbit (Jul 8, 2010)

I have compiled ettercap from ports without incident. However when I attempt to run ettercap to preform an ARP poisoning attack the program crashes and I am presented with this error message:

```
Ooops ! This shouldn't happen...
Segmentation Fault...

Please recompile in debug mode, reproduce the bug and send a bugreport
```

I have removed and recompiled the program to no avail. I do not know how to "recompile in debug mode"; if this is the appropriate course of action, could somebody please take me through the steps? 

`$ pkg_info | grep ettercap`

```
ettercap-gtk2-0.7.3_10,1 A network sniffer/interceptor/injector/logger for switched
```

`$ uname -a`

```
FreeBSD  8.0-RELEASE FreeBSD 8.0-RELEASE #0: Sat Nov 21 15:02:08 UTC 2009     root@mason.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64
```


----------



## bsdgooch (Feb 1, 2011)

Try this:

Before building the port (if you're starting from scratch), run:


```
# cd /usr/ports/net-mgmt/ettercap
# make fetch
# make extract
```

In the file /usr/ports/net-mgmt/ettercap/work/ettercap-NG-0.7.3/src/protocols/ec_tcp.c on line 119, change the following line from:


```
opt_end = (u_char *)((int)tcp + tcp->off * 4);
```

To:


```
opt_end = (u_char *)(tcp + tcp->off * 4);
```

...using your favorite text editor.

Then, run the typical:


```
# make config
# make build
# make install
```

After all of that, give the program a run or two, and see if it's working.

Let us all know.


----------

