Ettercap / ettercap

Ettercap Project
http://www.ettercap-project.org
GNU General Public License v2.0
2.38k stars 494 forks source link

Ettercap 0.8.3.1 crash after removing comment from redir_command_on #1135

Closed xenSlayer closed 3 years ago

xenSlayer commented 3 years ago
geoip_data_file_v6 = "/usr/local/share/GeoIP/GeoIPv6.dat"

#####################################
#       redir_command_on/off
#####################################
# you must provide a valid script for your operating system in order to have
# the SSL dissection available
# note that the cleanup script is executed without enough privileges (because
# they are dropped on startup). so you have to either: provide a setuid program
# or set the ec_uid to 0, in order to be sure the cleanup script will be
# executed properly
# NOTE: the script must fit into one line with a maximum of 255 characters

#---------------
#     Linux 
#---------------

redir_command_on = "iptables -t nat -A PREROUTING -i %iface -p tcp -d %destination --dport %port -j REDIRECT --to-port %rport"
redir_command_off = "iptables -t nat -D PREROUTING -i %iface -p tcp -d %destination --dport %port -j REDIRECT --to-port %rport"

# pendant for IPv6 - Note that you need iptables v1.4.16 or newer to use IPv6 redirect
   #redir6_command_on = "ip6tables -t nat -A PREROUTING -i %iface -p tcp -d %destination --dport %port -j REDIRECT --to-port %rport"
   #redir6_command_off = "ip6tables -t nat -D PREROUTING -i %iface -p tcp -d %destination --dport %port -j REDIRECT --to-port %rport"

#---------------
#    Mac Os X
#---------------

   #redir_command_on = "(pfctl -sn 2> /dev/null; echo 'rdr pass on %iface inet proto tcp from any to %destination port %port -> localhost port %rport') | pfctl -f - 2> /dev/null"
   #redir_command_off = "pfctl -Psn 2> /dev/null | egrep -v 'inet .+ any to %destination port = %port' | pfctl -f - 2> /dev/null"

# BSD PF for IPv6:
   #redir6_command_on = "(pfctl -sn 2> /dev/null; echo 'rdr pass on %iface inet6 proto tcp from any to %destination port %port -> localhost port %rport') | pfctl -f - 2> /dev/null"
   #redir6_command_off = "pfctl -Psn 2> /dev/null | egrep -v 'inet6 .+ any to %destination port = %port' | pfctl -f - 2> /dev/null"

#---------------
#   FreeBSD
#---------------

# Before PF can be used, make sure the kernel module has been loaded by
# `kldstat | grep pf.ko`. If the rusult is empty, you can load it by
# `kldload pf.ko` or add 'pf_enable="YES"' to the /etc/rc.conf and reboot.

# Check if the PF status is enabled by 

^G Help          ^O Write Out     ^W Where Is      ^K Cut           ^T Execute       ^C Location      M-U Undo         M-A Set Mark     M-] To Bracket   M-Q Previous     ^B Back          ^◀ Prev Word
^X Exit          ^R Read File     ^\ Replace       ^U Paste         ^J Justify       ^_ Go To Line    M-E Redo         M-6 Copy         ^Q Where Was     M-W Next         ^F Forward       ^▶ Next Word
koeppea commented 3 years ago

Hi @xenSlayer This is a known issue from previous versions of ettercap. Please use the version 0.8.3.1 where this issue is fixed.

koeppea commented 3 years ago

Sorry the explanation may be a bit too short. Crashing means an abnormal exit condition. But the described condition leads to a "normal" fatal error exit condition that the IPv6 redirect rules couldn't be installed. It means that you have to enable the IPv6 pendant for ettercap versions where IPv6 support has been compiled in.

xenSlayer commented 3 years ago

I am using ettercap 0.8.3.1 and whenever I remove the comment lines in config file Edit : "/etc/ettercap/etter.conf"

#---------------
#     Linux 
#---------------

redir_command_on = "iptables -t nat -A PREROUTING -i %iface -p tcp -d %destination --dport %port -j REDIRECT --to-port %rport"
redir_command_off = "iptables -t nat -D PREROUTING -i %iface -p tcp -d %destination --dport %port -j REDIRECT --to-port %rport"

the app crash when I start ARP poisoning. It works fine if I re-comment those two lines

koeppea commented 3 years ago

Set the values of ec_uid and ec_gid to 0. Then uncomment the redir6_... lines in the Linux section. Then try again.