Selaa lähdekoodia

Include outputs and forwards in domain blocks

Bob Mottram 8 vuotta sitten
vanhempi
commit
da18dc225e
1 muutettua tiedostoa jossa 8 lisäystä ja 0 poistoa
  1. 8
    0
      src/freedombone-utils-firewall

+ 8
- 0
src/freedombone-utils-firewall Näytä tiedosto

408
         hexstr=$(domain_to_hex_string $blocked_domain)
408
         hexstr=$(domain_to_hex_string $blocked_domain)
409
         iptables -A INPUT -p udp --dport 53 -m string --hex-string "$hexstr" --algo bm -j DROP
409
         iptables -A INPUT -p udp --dport 53 -m string --hex-string "$hexstr" --algo bm -j DROP
410
         iptables -A INPUT -p tcp --dport 53 -m string --hex-string "$hexstr" --algo bm -j DROP
410
         iptables -A INPUT -p tcp --dport 53 -m string --hex-string "$hexstr" --algo bm -j DROP
411
+        iptables -A OUTPUT -p udp --dport 53 -m string --hex-string "$hexstr" --algo bm -j DROP
412
+        iptables -A OUTPUT -p tcp --dport 53 -m string --hex-string "$hexstr" --algo bm -j DROP
413
+        iptables -I FORWARD -p udp --dport 53 -m string --hex-string "$hexstr" --algo bm -j DROP
414
+        iptables -I FORWARD -p tcp --dport 53 -m string --hex-string "$hexstr" --algo bm -j DROP
411
         echo "${blocked_domain}" >> $FIREWALL_DOMAINS
415
         echo "${blocked_domain}" >> $FIREWALL_DOMAINS
412
         save_firewall_settings
416
         save_firewall_settings
413
     fi
417
     fi
419
         hexstr=$(domain_to_hex_string $unblocked_domain)
423
         hexstr=$(domain_to_hex_string $unblocked_domain)
420
         iptables -D INPUT -p udp --dport 53 -m string --hex-string "$hexstr" --algo bm -j DROP
424
         iptables -D INPUT -p udp --dport 53 -m string --hex-string "$hexstr" --algo bm -j DROP
421
         iptables -D INPUT -p tcp --dport 53 -m string --hex-string "$hexstr" --algo bm -j DROP
425
         iptables -D INPUT -p tcp --dport 53 -m string --hex-string "$hexstr" --algo bm -j DROP
426
+        iptables -D OUTPUT -p udp --dport 53 -m string --hex-string "$hexstr" --algo bm -j DROP
427
+        iptables -D OUTPUT -p tcp --dport 53 -m string --hex-string "$hexstr" --algo bm -j DROP
428
+        iptables -D FORWARD -p udp --dport 53 -m string --hex-string "$hexstr" --algo bm -j DROP
429
+        iptables -D FORWARD -p tcp --dport 53 -m string --hex-string "$hexstr" --algo bm -j DROP
422
         sed -i "/${unblocked_domain}/d" $FIREWALL_DOMAINS
430
         sed -i "/${unblocked_domain}/d" $FIREWALL_DOMAINS
423
         save_firewall_settings
431
         save_firewall_settings
424
     fi
432
     fi