1

Temat: [Firewall] Niebezpieczna domyślna konfiguracja

Witam,

Nie wiem czy to coś u mnie się sypnęło, czy tak ma być [wątpię], ale mój TP-Link 1043ND z Gargoyle [Gargoyle PL 1.6.0.1 (f70487a)] ma intrygującą konfigurację iptables (a ja tego nigdy nie ruszałem). Ostatnio chciałem przekierować sobie dwa porty, co też zrobiłem za pomocą nie do końca jasnego GUI (jakoś do mnie bardziej przemawiają określenia port lokalny/zdalny, a nie 'z/do'). Właśnie ta niejasność skłoniła mnie to sprawdzenia czy wszystko poszło OK i jakże byłem zaskoczony gdy okazało się, że router aktywnie odrzuca (REJECT) połączenia na wszystkich portach, poza tymi, które przekierowałem oraz kilkoma innymi...

W tym momencie nmap (SYN Scan, ale inne też łapią) po skanowaniu 1-1024 (ja otwierałem wyżej, więc tu nie ma):

Host is up (0.020s latency).
Not shown: 1018 unfiltered ports
PORT    STATE    SERVICE
135/tcp filtered msrpc
136/tcp filtered profile
137/tcp filtered netbios-ns
138/tcp filtered netbios-dgm
139/tcp filtered netbios-ssn
445/tcp filtered microsoft-ds

1. Po pierwsze istotne jest to:
"Not shown: 1018 unfiltered ports" -> wszystkie porty poza w.w. mają REJECT tzn. router aktywnie odmawia połączenia z nimi przez co ujawniając swoje istnienie. Powinno być DROP tzn. olanie wink Próbowałem popatrzeć na reguły z konsoli, ale jest do dla mnie kompletnie nieczytelnie przy takiej skomplikowanej konfiguracji jak OpenWRT tam dorzuca.

2. Po drugie intryguje mnie czemu akurat w.w. są wyfiltrowane? Rozumiem, że gdyby pkt.1 był poprawnie obsłużony, to nie byłoby tego problemu, bo wtedy z zewnątrz wszystko wyglądałoby na wyfiltrowane ergo zabezpieczone. Zakładam, że router tych portów faktycznie używa do jakiś wewnętrznych celów i usługi te odmawiają współpracy ze światem zewnętrznym. Zaczynam się zastanawiać czy przypadkiem nie jest tak, że ten firewall w ogóle nie działa, a że nie mam na routerze żadnych usług to sam Linux aktywnie odmawia połączeń (tzn. świat zewnętrzny nie zatrzymuje już się na firewallu, ale  dopiero 'na' systemie).


Może po aktualizacji systemu problem zniknie, ale ciekawe jest skąd się wziął? Nigdy nie ruszałem tego systemu z konsoli - tylko GUI i to do tego tylko podstawy (WiFi itp), a nie firewall...

Pozdrawiam,
QmQ

2

Odp: [Firewall] Niebezpieczna domyślna konfiguracja

Czy ty skanujesz będąc w lan? Jeżeli tak to nie rób tego w taki sposób.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

3 (edytowany przez QmQ 2014-07-07 10:04:16)

Odp: [Firewall] Niebezpieczna domyślna konfiguracja

O jezu, nie sądziłem że padnie takie pytanie wink
Nie, skanuję z pracy.

UPDATE:
I nie, nie mam VPNa itp. Skanuję z zewnątrz.

Pozdrawiam,
QmQ

4

Odp: [Firewall] Niebezpieczna domyślna konfiguracja

Zresztą, co to za tajemnica...
Sam sprawdź: 89-68-136-223 (nawet wygląda jak numer telefonu tongue)

Pozdrawiam,
QmQ

5

Odp: [Firewall] Niebezpieczna domyślna konfiguracja

Pokaż wynik

iptables -v -L
iptables -v -L -t nat

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

6

Odp: [Firewall] Niebezpieczna domyślna konfiguracja

root@Router:~# iptables -v -L
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
  233 54788 bw_ingress  all  --  eth0.2 any     anywhere             anywhere
  304 66260 delegate_input  all  --  any    any     anywhere             anywhere

Chain FORWARD (policy DROP 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
  562  390K bw_ingress  all  --  eth0.2 any     anywhere             anywhere
  754  647K ingress_restrictions  all  --  eth0.2 any     anywhere             anywhere
  575  104K egress_restrictions  all  --  any    eth0.2  anywhere             anywhere
 1329  751K delegate_forward  all  --  any    any     anywhere             anywhere

Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
  123 13315 delegate_output  all  --  any    any     anywhere             anywhere

Chain MINIUPNPD (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain bw_ingress (2 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0            all  --  any    any     anywhere             anywhere            bandwidth --id total1-download-2-449 --type combined --current_bandwidth 0 --reset_interval 2 --reset_time 2 --intervals_to_save 449
    0     0            all  --  any    any     anywhere             anywhere            match-set local_addr_set dst bandwidth --id bdist1-download-minute-15 --type individual_dst --reset_interval minute --intervals_to_save 15
    0     0            all  --  any    any     anywhere             anywhere            bandwidth --id total2-download-minute-359 --type combined --current_bandwidth 0 --reset_interval minute --intervals_to_save 359
    0     0            all  --  any    any     anywhere             anywhere            match-set local_addr_set dst bandwidth --id bdist2-download-900-24 --type individual_dst --reset_interval 900 --reset_time 900 --intervals_to_save 24
    0     0            all  --  any    any     anywhere             anywhere            bandwidth --id total3-download-180-479 --type combined --current_bandwidth 0 --reset_interval 180 --reset_time 180 --intervals_to_save 479
    0     0            all  --  any    any     anywhere             anywhere            match-set local_addr_set dst bandwidth --id bdist3-download-hour-24 --type individual_dst --reset_interval hour --intervals_to_save 24
    0     0            all  --  any    any     anywhere             anywhere            bandwidth --id total4-download-7200-359 --type combined --current_bandwidth 0 --reset_interval 7200 --reset_time 7200 --intervals_to_save 359
    0     0            all  --  any    any     anywhere             anywhere            match-set local_addr_set dst bandwidth --id bdist4-download-day-31 --type individual_dst --reset_interval day --intervals_to_save 31
    0     0            all  --  any    any     anywhere             anywhere            bandwidth --id total5-download-day-365 --type combined --current_bandwidth 0 --reset_interval day --intervals_to_save 365
    0     0            all  --  any    any     anywhere             anywhere            match-set local_addr_set dst bandwidth --id bdist5-download-month-12 --type individual_dst --reset_interval month --intervals_to_save 12

Chain delegate_forward (1 references)
 pkts bytes target     prot opt in     out     source               destination
 1329  751K forwarding_rule  all  --  any    any     anywhere             anywhere            /* user chain for forwarding */
 1232  740K ACCEPT     all  --  any    any     anywhere             anywhere            ctstate RELATED,ESTABLISHED
   97 10976 zone_lan_forward  all  --  br-lan any     anywhere             anywhere
    0     0 zone_wan_forward  all  --  eth0.2 any     anywhere             anywhere
    0     0 reject     all  --  any    any     anywhere             anywhere

Chain delegate_input (1 references)
 pkts bytes target     prot opt in     out     source               destination
    2   189 ACCEPT     all  --  lo     any     anywhere             anywhere
  302 66071 input_rule  all  --  any    any     anywhere             anywhere            /* user chain for input */
   37  3470 ACCEPT     all  --  any    any     anywhere             anywhere            ctstate RELATED,ESTABLISHED
   44  1956 syn_flood  tcp  --  any    any     anywhere             anywhere            tcp flags:FIN,SYN,RST,ACK/SYN
   26  2126 zone_lan_input  all  --  br-lan any     anywhere             anywhere
  239 60475 zone_wan_input  all  --  eth0.2 any     anywhere             anywhere

Chain delegate_output (1 references)
 pkts bytes target     prot opt in     out     source               destination
    2   189 ACCEPT     all  --  any    lo      anywhere             anywhere
  121 13126 output_rule  all  --  any    any     anywhere             anywhere            /* user chain for output */
   97 11709 ACCEPT     all  --  any    any     anywhere             anywhere            ctstate RELATED,ESTABLISHED
    2    88 zone_lan_output  all  --  any    br-lan  anywhere             anywhere
   22  1329 zone_wan_output  all  --  any    eth0.2  anywhere             anywhere

Chain egress_restrictions (1 references)
 pkts bytes target     prot opt in     out     source               destination
  575  104K egress_whitelist  all  --  any    any     anywhere             anywhere

Chain egress_whitelist (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain forwarding_lan_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain forwarding_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain forwarding_wan_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain ingress_restrictions (1 references)
 pkts bytes target     prot opt in     out     source               destination
  754  647K ingress_whitelist  all  --  any    any     anywhere             anywhere

Chain ingress_whitelist (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain input_lan_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain input_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain input_wan_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain output_lan_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain output_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain output_wan_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain pf_loopback_B (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain reject (3 references)
 pkts bytes target     prot opt in     out     source               destination
   50  2711 REJECT     tcp  --  any    any     anywhere             anywhere            reject-with tcp-reset
    7   878 REJECT     all  --  any    any     anywhere             anywhere            reject-with icmp-port-unreachable

Chain syn_flood (1 references)
 pkts bytes target     prot opt in     out     source               destination
   44  1956 RETURN     tcp  --  any    any     anywhere             anywhere            tcp flags:FIN,SYN,RST,ACK/SYN limit: avg 25/sec burst 50
    0     0 DROP       all  --  any    any     anywhere             anywhere

Chain zone_lan_dest_ACCEPT (1 references)
 pkts bytes target     prot opt in     out     source               destination
    2    88 ACCEPT     all  --  any    br-lan  anywhere             anywhere

Chain zone_lan_forward (1 references)
 pkts bytes target     prot opt in     out     source               destination
   87 10465 pf_loopback_B  all  --  any    any     anywhere             anywhere
    0     0 ACCEPT     all  --  br-lan br-lan  anywhere             anywhere
   97 10976 forwarding_lan_rule  all  --  any    any     anywhere             anywhere            /* user chain for forwarding */
   97 10976 zone_wan_dest_ACCEPT  all  --  any    any     anywhere             anywhere            /* forwarding lan -> wan */
    0     0 zone_lan_src_REJECT  all  --  any    any     anywhere             anywhere

Chain zone_lan_input (1 references)
 pkts bytes target     prot opt in     out     source               destination
   26  2126 input_lan_rule  all  --  any    any     anywhere             anywhere            /* user chain for input */
   26  2126 zone_lan_src_ACCEPT  all  --  any    any     anywhere             anywhere

Chain zone_lan_output (1 references)
 pkts bytes target     prot opt in     out     source               destination
    2    88 output_lan_rule  all  --  any    any     anywhere             anywhere            /* user chain for output */
    2    88 zone_lan_dest_ACCEPT  all  --  any    any     anywhere             anywhere

Chain zone_lan_src_ACCEPT (1 references)
 pkts bytes target     prot opt in     out     source               destination
   26  2126 ACCEPT     all  --  br-lan any     anywhere             anywhere

Chain zone_lan_src_REJECT (1 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 reject     all  --  br-lan any     anywhere             anywhere

Chain zone_wan_dest_ACCEPT (2 references)
 pkts bytes target     prot opt in     out     source               destination
  119 12305 ACCEPT     all  --  any    eth0.2  anywhere             anywhere

Chain zone_wan_forward (1 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 MINIUPNPD  all  --  any    any     anywhere             anywhere
    0     0 forwarding_wan_rule  all  --  any    any     anywhere             anywhere            /* user chain for forwarding */
    0     0 zone_wan_src_REJECT  all  --  any    any     anywhere             anywhere

Chain zone_wan_input (1 references)
 pkts bytes target     prot opt in     out     source               destination
  239 60475 input_wan_rule  all  --  any    any     anywhere             anywhere            /* user chain for input */
  172 56606 ACCEPT     udp  --  any    any     anywhere             anywhere            udp dpt:bootpc /* Allow-DHCP-Renew */
   10   280 DROP       icmp --  any    any     anywhere             anywhere            icmp echo-request /* Allow-Ping */
   57  3589 zone_wan_src_REJECT  all  --  any    any     anywhere             anywhere

Chain zone_wan_output (1 references)
 pkts bytes target     prot opt in     out     source               destination
   22  1329 output_wan_rule  all  --  any    any     anywhere             anywhere            /* user chain for output */
   22  1329 zone_wan_dest_ACCEPT  all  --  any    any     anywhere             anywhere

Chain zone_wan_src_REJECT (2 references)
 pkts bytes target     prot opt in     out     source               destination
   57  3589 reject     all  --  eth0.2 any     anywhere             anywhere
root@Router:~# iptables -v -L -t nat
Chain PREROUTING (policy ACCEPT 177 packets, 16688 bytes)
 pkts bytes target     prot opt in     out     source               destination
  191 18264 delegate_prerouting  all  --  any    any     anywhere             anywhere

Chain INPUT (policy ACCEPT 23 packets, 1973 bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain OUTPUT (policy ACCEPT 22 packets, 1369 bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain POSTROUTING (policy ACCEPT 2 packets, 120 bytes)
 pkts bytes target     prot opt in     out     source               destination
  162 13836 delegate_postrouting  all  --  any    any     anywhere             anywhere

Chain MINIUPNPD (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain delegate_postrouting (1 references)
 pkts bytes target     prot opt in     out     source               destination
  162 13836 postrouting_rule  all  --  any    any     anywhere             anywhere            /* user chain for postrouting */
    1    48 zone_lan_postrouting  all  --  any    br-lan  anywhere             anywhere
  160 13716 zone_wan_postrouting  all  --  any    eth0.2  anywhere             anywhere

Chain delegate_prerouting (1 references)
 pkts bytes target     prot opt in     out     source               destination
  191 18264 prerouting_rule  all  --  any    any     anywhere             anywhere            /* user chain for prerouting */
  123 13480 zone_lan_prerouting  all  --  br-lan any     anywhere             anywhere
   68  4784 zone_wan_prerouting  all  --  eth0.2 any     anywhere             anywhere

Chain pf_loopback_A (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain pf_loopback_C (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain postrouting_lan_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain postrouting_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination
    1    48 pf_loopback_C  all  --  any    br-lan  anywhere             anywhere

Chain postrouting_wan_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain prerouting_lan_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain prerouting_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain prerouting_wan_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain zone_lan_postrouting (1 references)
 pkts bytes target     prot opt in     out     source               destination
    1    48 postrouting_lan_rule  all  --  any    any     anywhere             anywhere            /* user chain for postrouting */

Chain zone_lan_prerouting (1 references)
 pkts bytes target     prot opt in     out     source               destination
    3   152 pf_loopback_A  all  --  any    any     anywhere             89-68-136-223.dynamic.chello.pl
  123 13480 prerouting_lan_rule  all  --  any    any     anywhere             anywhere            /* user chain for prerouting */

Chain zone_wan_postrouting (1 references)
 pkts bytes target     prot opt in     out     source               destination
  160 13716 postrouting_wan_rule  all  --  any    any     anywhere             anywhere            /* user chain for postrouting */
  160 13716 MASQUERADE  all  --  any    any     anywhere             anywhere

Chain zone_wan_prerouting (1 references)
 pkts bytes target     prot opt in     out     source               destination
   68  4784 MINIUPNPD  all  --  any    any     anywhere             anywhere
   68  4784 prerouting_wan_rule  all  --  any    any     anywhere             anywhere            /* user chain for prerouting */
Pozdrawiam,
QmQ

7

Odp: [Firewall] Niebezpieczna domyślna konfiguracja

I jeszcze
uci show firewall
cat /etc/firewall.user

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

8

Odp: [Firewall] Niebezpieczna domyślna konfiguracja

root@Router:~# uci show firewall
firewall.@defaults[0]=defaults
firewall.@defaults[0].syn_flood=1
firewall.@defaults[0].input=ACCEPT
firewall.@defaults[0].output=ACCEPT
firewall.@defaults[0].forward=REJECT
firewall.@zone[0]=zone
firewall.@zone[0].name=lan
firewall.@zone[0].network=lan
firewall.@zone[0].input=ACCEPT
firewall.@zone[0].output=ACCEPT
firewall.@zone[0].forward=REJECT
firewall.@zone[1]=zone
firewall.@zone[1].name=wan
firewall.@zone[1].network=wan wan6
firewall.@zone[1].input=REJECT
firewall.@zone[1].output=ACCEPT
firewall.@zone[1].forward=REJECT
firewall.@zone[1].masq=1
firewall.@zone[1].mtu_fix=1
firewall.@forwarding[0]=forwarding
firewall.@forwarding[0].src=lan
firewall.@forwarding[0].dest=wan
firewall.@rule[0]=rule
firewall.@rule[0].name=Allow-DHCP-Renew
firewall.@rule[0].src=wan
firewall.@rule[0].proto=udp
firewall.@rule[0].dest_port=68
firewall.@rule[0].target=ACCEPT
firewall.@rule[0].family=ipv4
firewall.@rule[1]=rule
firewall.@rule[1].name=Allow-Ping
firewall.@rule[1].src=wan
firewall.@rule[1].proto=icmp
firewall.@rule[1].icmp_type=echo-request
firewall.@rule[1].family=ipv4
firewall.@rule[1].target=DROP
firewall.@rule[2]=rule
firewall.@rule[2].name=Allow-DHCPv6
firewall.@rule[2].src=wan
firewall.@rule[2].proto=udp
firewall.@rule[2].src_ip=fe80::/10
firewall.@rule[2].src_port=547
firewall.@rule[2].dest_ip=fe80::/10
firewall.@rule[2].dest_port=546
firewall.@rule[2].family=ipv6
firewall.@rule[2].target=ACCEPT
firewall.@rule[3]=rule
firewall.@rule[3].name=Allow-ICMPv6-Input
firewall.@rule[3].src=wan
firewall.@rule[3].proto=icmp
firewall.@rule[3].icmp_type=echo-request echo-reply destination-unreachable packet-too-big time-exceeded bad-header unknown-header-type router-solicitation neighbour-solicitation router-advertisement neighbour-advertisement
firewall.@rule[3].limit=1000/sec
firewall.@rule[3].family=ipv6
firewall.@rule[3].target=ACCEPT
firewall.@rule[4]=rule
firewall.@rule[4].name=Allow-ICMPv6-Forward
firewall.@rule[4].src=wan
firewall.@rule[4].dest=*
firewall.@rule[4].proto=icmp
firewall.@rule[4].icmp_type=echo-request echo-reply destination-unreachable packet-too-big time-exceeded bad-header unknown-header-type
firewall.@rule[4].limit=1000/sec
firewall.@rule[4].family=ipv6
firewall.@rule[4].target=ACCEPT
firewall.@include[0]=include
firewall.@include[0].path=/etc/firewall.user
firewall.@include[0].reload=1
firewall.@include[1]=include
firewall.@include[1].type=script
firewall.@include[1].path=/usr/lib/gargoyle_firewall_util/gargoyle_additions.firewall
firewall.@include[1].family=IPv4
firewall.@include[1].reload=1
firewall.miniupnpd=include
firewall.miniupnpd.type=script
firewall.miniupnpd.path=/usr/share/miniupnpd/firewall.include
firewall.miniupnpd.family=IPv4
firewall.miniupnpd.reload=1
firewall.openvpn_include_file=include
firewall.openvpn_include_file.path=/etc/openvpn.firewall
firewall.openvpn_include_file.reload=1

W /etc/firewall.user pustki poza komentarzami.

Pozdrawiam,
QmQ

9

Odp: [Firewall] Niebezpieczna domyślna konfiguracja

Ciekawie się robi.

netstat -anp
ifconfig

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

10

Odp: [Firewall] Niebezpieczna domyślna konfiguracja

root@Router:~# netstat -anp
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      844/portmap
tcp        0      0 0.0.0.0:53              0.0.0.0:*               LISTEN      1668/dnsmasq
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1355/dropbear
tcp        0    132 192.168.1.1:22          192.168.1.114:52333     ESTABLISHED 5270/dropbear
tcp        0      0 :::80                   :::*                    LISTEN      1406/httpd_gargoyle
tcp        0      0 :::53                   :::*                    LISTEN      1668/dnsmasq
tcp        0      0 :::22                   :::*                    LISTEN      1355/dropbear
tcp        0      0 :::443                  :::*                    LISTEN      1406/httpd_gargoyle
udp        0      0 0.0.0.0:53              0.0.0.0:*                           1668/dnsmasq
udp        0      0 0.0.0.0:67              0.0.0.0:*                           1668/dnsmasq
udp        0      0 0.0.0.0:111             0.0.0.0:*                           844/portmap
udp        0      0 :::53                   :::*                                1668/dnsmasq
Active UNIX domain sockets (servers and established)
Proto RefCnt Flags       Type       State         I-Node PID/Program name    Path
unix  2      [ ]         DGRAM                      1914 1134/hostapd        /var/run/hostapd-phy0/wlan0
unix  2      [ ACC ]     STREAM     LISTENING       1215 749/ubusd           /var/run/ubus.sock
unix  9      [ ]         DGRAM                      1009 735/syslogd         /dev/log
unix  2      [ ]         DGRAM                      2810 1668/dnsmasq
unix  2      [ ]         DGRAM                      2483 1406/httpd_gargoyle
unix  2      [ ]         DGRAM                      2327 1355/dropbear
unix  2      [ ]         DGRAM                      1973 1134/hostapd
unix  2      [ ]         DGRAM                      1496 858/netifd
unix  2      [ ]         DGRAM                      1479 858/netifd
unix  3      [ ]         STREAM     CONNECTED       1477 749/ubusd           /var/run/ubus.sock
unix  3      [ ]         STREAM     CONNECTED       1476 858/netifd
unix  2      [ ]         DGRAM                      1422 844/portmap
unix  2      [ ]         DGRAM                      1144 737/klogd
root@Router:~# ifconfig
br-lan    Link encap:Ethernet  HWaddr 94:0C:6D:AC:5A:70
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::960c:6dff:feac:5a70/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2173069 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3038658 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1188064166 (1.1 GiB)  TX bytes:3585922206 (3.3 GiB)

eth0      Link encap:Ethernet  HWaddr 94:0C:6D:AC:5A:70
          inet6 addr: fe80::960c:6dff:feac:5a70/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4189322 errors:0 dropped:0 overruns:59305 frame:0
          TX packets:4885841 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:3808613835 (3.5 GiB)  TX bytes:996171142 (950.0 MiB)
          Interrupt:4

eth0.1    Link encap:Ethernet  HWaddr 94:0C:6D:AC:5A:70
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:707076 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2734317 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:46712049 (44.5 MiB)  TX bytes:4058322733 (3.7 GiB)

eth0.2    Link encap:Ethernet  HWaddr 94:0C:6D:AC:5A:70
          inet addr:89.68.136.223  Bcast:89.68.139.255  Mask:255.255.252.0
          inet6 addr: fe80::960c:6dff:feac:5a70/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3482094 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2151519 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:3686458562 (3.4 GiB)  TX bytes:1213270910 (1.1 GiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:280 errors:0 dropped:0 overruns:0 frame:0
          TX packets:280 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:23251 (22.7 KiB)  TX bytes:23251 (22.7 KiB)

wlan0     Link encap:Ethernet  HWaddr 94:0C:6D:AC:5A:70
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4881890 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3800191 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:966746915 (921.9 MiB)  TX bytes:3716860478 (3.4 GiB)
Pozdrawiam,
QmQ

11

Odp: [Firewall] Niebezpieczna domyślna konfiguracja

Tylko że... ty nie masz samby uruchomionej. Nic nie słucha na portach 135 itd, więc co to jest?

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

12

Odp: [Firewall] Niebezpieczna domyślna konfiguracja

No właśnie smile

Teraz z domu to puszczam test z www.grc.com i nadal mam większość REJECT, a kilka DROP. Co ciekawe inne niż rano... neutral
[obecnie 1028 i 1720]

Pozdrawiam,
QmQ

13

Odp: [Firewall] Niebezpieczna domyślna konfiguracja

Zrób sobie normalny test -- http://www.yougetsignal.com/tools/open-ports/ Mi tam pokazuje, że mam pozamykane all z tych co podałeś w pierwszy poście. Mam ten sam router (jeśli to v2) i firmware instalowałem z gargoyle-1.6.1.4-ar71xx-tl-wr1043nd-v2-squashfs-factory.bin

14

Odp: [Firewall] Niebezpieczna domyślna konfiguracja

Normalny to jest nmap, a z domu GRC zdecydowanie wystarcza. To co podałeś nie rozróżnia DENY od REJECT, a więc się do dupy nie nadaje smile. Sprawdziłem tym mój drugi serwer, który ma wszystko pozamykane jak trzeba i też uparcie mówi 'closed', a tymczasem porty są wyfiltrowane.

@Cezary
Jeśli nie masz pomysłów [ja nie mam, to żyje własnym życiem] to wgram najnowszy Gargoyle bez backup-u konfiguracji i zobaczę. Albo sam router umiera [to możliwe, ale to w kolejnym wątku wink]

Pozdrawiam,
QmQ

15

Odp: [Firewall] Niebezpieczna domyślna konfiguracja

Nie mam. Nie wiem dlaczego Ci tak pokazuje.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

16

Odp: [Firewall] Niebezpieczna domyślna konfiguracja

Wgrałem najnowsze, wszystkie porty REJECT. Robiłem sysupgrade -n więc jest na czysto. To przecież nie może być tylko u mnie...

Pozdrawiam,
QmQ

17

Odp: [Firewall] Niebezpieczna domyślna konfiguracja

Najciemniej zawsze pod latarnią:
http://wiki.openwrt.org/doc/uci/firewal … .vs.reject
https://www.gargoyle-router.com/phpbb/v … t=148#p670
http://www.chiark.greenend.org.uk/~pete … -vs-reject

18

Odp: [Firewall] Niebezpieczna domyślna konfiguracja

@pepe2k:
Dziękuję, to wyjaśnia sprawę. Co prawda nadal dziwi mnie aktualna konfiguracja (domyślna po nocnym sysupgrade, nic nie ruszałem), gdzie mam wszystko w zakresie 1-1024 REJECT, ale:

135/tcp filtered msrpc
136/tcp filtered profile
137/tcp filtered netbios-ns
138/tcp filtered netbios-dgm
139/tcp filtered netbios-ssn
445/tcp filtered microsoft-ds

To powinno być albo tak albo tak, a nie mix wink

A IMHO (artykuł zaraz przeczytam - ciekawa sprawa) dla małego domowego routera, który nie spodziewa się aktywności z zewnątrz DROP jest lepszy, a to że komuś coś się na chwilę przywiesi to mnie absolutnie nic nie obchodzi, a wręcz cieszy o ile ta osoba próbuje się do mnie dostać smile
Zresztą tak robią wszystkie routery domyślnie - jedyny OpenWRT jest widać wyjątkiem. Poszukam gdzie to się zmienia i zobaczymy...

Pozdrawiam,
QmQ

19

Odp: [Firewall] Niebezpieczna domyślna konfiguracja

No i zrobione. Efekt taki jakiego spodziewałem się od początku:

Note: Host seems down. If it is really up, but blocking our ping probes, try -Pn

a z -Pn:

All 1024 scanned ports on 89.68.136.223 are filtered

Dla potomnych:
Początek pliku /etc/config/firewall po zmianach wygląda tak:

config defaults
        option syn_flood '1'
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'DROP'

config zone
        option name 'lan'
        list network 'lan'
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'REJECT'

config zone
        option name 'wan'
        list network 'wan'
        list network 'wan6'
        option input 'DROP'
        option output 'ACCEPT'
        option forward 'DROP'
        option masq '1'
        option mtu_fix '1'

Ważne zmiany są w sekcji dotyczącej WANu (2x REJECT->DROP), ale w default też dałem (1x REJECT->DROP) - bo nie wiem na co to ma wpływ i gdzie jest stosowane, a DROP i REJECT są można by rzecz "wymienne". W sumie trzy linijki zmian.


Dziękuję za pomoc smile
Temat można zamknąć [chociaż nadal nie wiem czemu część się filtrowała, ale strzelam, że takie usługi tam faktycznie są i stąd wynikała różnica, której źródło jest pewnie gdzieś w gąszczu tych domyślnych reguł].

Pozdrawiam,
QmQ

20

Odp: [Firewall] Niebezpieczna domyślna konfiguracja

System ma jakąś domyślną konfigurację i w podanych linkach jest wyjaśnione dlaczego akurat taką, a nie inną.
A jak ktoś chce inaczej, to sobie to zmienia - proste.

PS. To już drugi raz kiedy używam Google za Ciebie, to naprawdę nie jest trudne:
http://comments.gmane.org/gmane.comp.em … .user/1303

21

Odp: [Firewall] Niebezpieczna domyślna konfiguracja

O, tego się nie spodziewałem... Jak "miło" z ich strony.
Widać Ty lepiej używasz Google niż ja wink
W każdym razie sprawa się wyjaśniła w 100%, serdecznie dziękuję za pomoc smile

Pozdrawiam,
QmQ

22

Odp: [Firewall] Niebezpieczna domyślna konfiguracja

Dziwna sprawa, ja przeskanowałem sobie właśnie router i mam taki log:

# nmap -v -sS ***************

Starting Nmap 6.46 ( [url]http://nmap.org[/url] ) at 2014-07-08 12:29 CEST
Initiating Ping Scan at 12:29
Scanning *************** [4 ports]
Completed Ping Scan at 12:29, 0.85s elapsed (1 total hosts)
Initiating Parallel DNS resolution of 1 host. at 12:29
Completed Parallel DNS resolution of 1 host. at 12:29, 0.83s elapsed
Initiating SYN Stealth Scan at 12:29
Scanning *************** [1000 ports]
Increasing send delay for *************** from 0 to 5 due to 50 out of 165 dropped probes since last increase.
SYN Stealth Scan Timing: About 44.36% done; ETC: 12:30 (0:00:39 remaining)
Completed SYN Stealth Scan at 12:30, 88.45s elapsed (1000 total ports)
Nmap scan report for ***************
Host is up (0.65s latency).
All 1000 scanned ports on *************** are closed

Read data files from: /usr/bin/../share/nmap
Nmap done: 1 IP address (1 host up) scanned in 90.47 seconds
           Raw packets sent: 1215 (53.436KB) | Rcvd: 1106 (44.268KB)

I mam taki kawałek w

# cat /etc/config/firewall

config defaults
        option syn_flood '1'
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'REJECT'

config zone
        option name 'lan'
        list network 'lan'
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'REJECT'

config zone
        option name 'wan'
        list network 'wan'
        list network 'wan6'
        option input 'REJECT'
        option output 'ACCEPT'
        option forward 'REJECT'
        option masq '1'
        option mtu_fix '1'

Póki co jeszcze nic nie ruszałem fw, poza jednym przekierowanym portem.

23

Odp: [Firewall] Niebezpieczna domyślna konfiguracja

Ale co w tym dziwnego? Zeskanowałeś 1000 portów i wszystkie są zamknięte tzn. router aktywnie odpowiedział, że tam nic nie ma (REJECT).
Zgadza się to z konfiguracją i z tym, co teraz już wiemy o domyślnej konfiguracji.

Chyba że czegoś nie zauważyłem w tych logach?

Pozdrawiam,
QmQ