Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion evillimiter/common/globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
BROADCAST = 'ff:ff:ff:ff:ff:ff'

BIN_TC = shell.locate_bin('tc')
BIN_IPTABLES = shell.locate_bin('iptables')
BIN_IPTABLES = shell.locate_iptables_bin('iptables')
BIN_SYSCTL = shell.locate_bin('sysctl')

IP_FORWARD_LOC = 'net.ipv4.ip_forward'
5 changes: 5 additions & 0 deletions evillimiter/console/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ def output_suppressed(command, root=True):
return subprocess.check_output('sudo ' + command if root else command, shell=True, stderr=DEVNULL).decode('utf-8')


def locate_iptables_bin(name):
if "nf_tables" in output_suppressed("{} --version".format(name)):
return locate_bin("iptables-legacy")
return locate_bin(name)

def locate_bin(name):
try:
return output_suppressed('which {}'.format(name)).replace('\n', '')
Expand Down