From b71dc6cd56cc885a488d69f700a22fc0febcb0c7 Mon Sep 17 00:00:00 2001 From: "random-toto@localhost" Date: Mon, 30 May 2016 14:32:42 +0200 Subject: [PATCH] =?UTF-8?q?r=C3=A8gles=20iptables=20pour=20limiter=20samba?= =?UTF-8?q?=20au=20r=C3=A9seau=20local=20192.168.0.0/16?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shell/forbid_samba.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 shell/forbid_samba.sh diff --git a/shell/forbid_samba.sh b/shell/forbid_samba.sh new file mode 100644 index 0000000..b672685 --- /dev/null +++ b/shell/forbid_samba.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +iptables -A INPUT -p tcp --destination-port 135 -m iprange --src-range 192.168.0.0-192.168.10.255 -j ACCEPT +iptables -A INPUT -p tcp --destination-port 139 -m iprange --src-range 192.168.0.0-192.168.10.255 -j ACCEPT +iptables -A INPUT -p tcp --destination-port 445 -m iprange --src-range 192.168.0.0-192.168.10.255 -j ACCEPT +iptables -A INPUT -p tcp --destination-port 137 -m iprange --src-range 192.168.0.0-192.168.10.255 -j ACCEPT +iptables -A INPUT -p tcp --destination-port 138 -m iprange --src-range 192.168.0.0-192.168.10.255 -j ACCEPT + + +iptables -A INPUT -p tcp --destination-port 135 -j REJECT +iptables -A INPUT -p tcp --destination-port 139 -j REJECT +iptables -A INPUT -p tcp --destination-port 445 -j REJECT +iptables -A INPUT -p tcp --destination-port 137 -j REJECT +iptables -A INPUT -p tcp --destination-port 138 -j REJECT +