Bettercap: [ ] brackets around iptables arguments causing error

Created on 16 Jun 2018  路  3Comments  路  Source: bettercap/bettercap

  • Bettercap version you are using.
    2.6

  • OS version and architecture you are using.
    Gentoo GNU/Linux (64-bit)

  • Go version if building from sources.
    1.10.2

  • Command line arguments you are using.
    sudo ./bettercap -debug -caplet ./caplets/web-override.cap

  • Full debug output while reproducing the issue ( bettercap -debug ... ).

bettercap v2.6 (type 'help' for a list of commands)

[19:51:08] [mod.started] update
[19:51:08] [sys.log] [inf] Reading from caplet ./caplets/web-override.cap ...
[19:51:08] [sys.log] [inf] Checking latest stable release ...
[19:51:08] [sys.log] [inf] Loading proxy script caplets/web-override.js ...
[19:51:08] [sys.log] [dbg] Proxy script caplets/web-override.js loaded.
[19:51:08] [sys.log] [inf] Enabling forwarding.
ERROR for 'iptables [-t nat -A PREROUTING -i eth0 -p TCP --dport 80 -j DNAT --to 10.0.0.10:8080]': exit status 3
10.0.0.0/24 > 10.0.0.10  禄 [19:51:08] [sys.log] [err] Error while running caplet ./caplets/web-override.cap: exit status 3
10.0.0.0/24 > 10.0.0.10  禄 [19:51:08] [sys.log] [inf] You are running 2.6 which is the latest stable version.
10.0.0.0/24 > 10.0.0.10  禄 [19:51:08] [mod.stopped] update
10.0.0.0/24 > 10.0.0.10  禄 exit
[19:51:13] [mod.stopped] events.stream

Stopping modules and cleaning session state ...
ERROR for 'iptables [-t nat -D PREROUTING -i eth0 -p TCP --dport 80 -j DNAT --to 10.0.0.10:8080]': exit status 3

This happens with any other module or caplet that has to set iptables rules.

bug

Most helpful comment

Okay, apparently I didn't search far enough...
Fixed it by enabling CONFIG_IP_NF_NAT in my kernel.

All 3 comments

I don't think it's because of the brackets, that's how Go prints a slice of strings (the shell command arguments in this case).

Trying to find the meaning of exit status 3 for iptables

@d33r what is your iptables --version ?

Okay, apparently I didn't search far enough...
Fixed it by enabling CONFIG_IP_NF_NAT in my kernel.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cyrus104 picture cyrus104  路  5Comments

Giorgiofox picture Giorgiofox  路  3Comments

vasiliyph picture vasiliyph  路  4Comments

buffermet picture buffermet  路  3Comments

s3gm3nt4ti0nf4ult picture s3gm3nt4ti0nf4ult  路  6Comments