>давай так,
>
>host:
>
>ifconfig -a
>ipfw l
>netstat -rn а не -rm
>nmap: whereis nmap
>cd /usr/ports/security/nmap
>make && make install
>nmap -v hostname
>
>server:
>
>тоже что и для host
>
>а то непонятно что где выполняется
сервер (он же роутер):
# ifconfig -a
rl0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
inet 192.168.1.1 netmask 0xffffff00 broadcast 192.168.1.255
ether 00:c0:26:a7:a0:e7
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active
ed0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
inet 212.16.5.2 netmask 0xfffffff0 broadcast 255.255.255.0
ether 00:80:ad:7d:0b:5e
ds0: flags=8008<LOOPBACK,MULTICAST> mtu 65532
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
inet 127.0.0.1 netmask 0xff000000
# ipfw l
01000 deny ip from 192.168.1.0/24 to any in recv ed0
01010 deny ip from 212.16.5.0/24 to any in recv rl0
01100 deny ip from any to 10.0.0.0/8 via ed0
01110 deny ip from any to 172.16.0.0/12 via ed0
01120 deny ip from any to 192.168.0.0/16 via ed0
01130 deny ip from any to 127.0.0.0/8 via ed0
01200 deny ip from any to 0.0.0.0/8 via ed0
01210 deny ip from any to 255.255.255.255 via ed0
01220 deny ip from any to 169.254.0.0/16 via ed0
01230 deny ip from any to 192.0.2.0/24 via ed0
01240 deny ip from any to 224.0.0.0/4 via ed0
01250 deny ip from any to 240.0.0.0/4 via ed0
01300 deny tcp from any to any via ed0 frag
01310 deny icmp from any to any via ed0 frag
01400 deny log logamount 100 tcp from any to any 1024-65535 in recv ed0 setup
01410 deny log logamount 100 udp from any to any 1080,2000,2001,2049 in recv ed0
04000 divert 8668 ip from any to any via ed0
06000 allow ip from any to any via lo0
06010 allow ip from any to any via rl0
06020 allow ip from any to 192.168.1.0/24 via ed0
07000 allow tcp from any to any via ed0 established
07100 allow tcp from any to 212.16.5.2 20,21,22,25,80 via ed0 setup
07110 allow tcp from 212.16.5.2 20,21,22,25,80 to any via ed0 setup
07120 allow udp from any to 212.16.5.2 20,21,22,25,80 via ed0
07130 allow udp from 212.16.5.2 20,21,22,25,80 to any via ed0
07200 allow tcp from 212.16.5.2 1024-65535 to any 20-23,25,43,53,80 via ed0 setup
07210 allow tcp from 212.16.5.2 1024-65535 to any 110,113,119,123,143,443 via ed0 setup
07220 allow tcp from 212.16.5.2 1024-65535 to any 1024-65535 via ed0 setup
07230 allow udp from 212.16.5.2 1024-65535 to any 20-23,25,43,53,80 via ed0
07240 allow udp from 212.16.5.2 1024-65535 to any 110,113,119,123,143,443 via ed0
07250 allow udp from any 20-23,25,43,53,80 to 212.16.5.2 1024-65535 via ed0
07260 allow udp from any 110,113,119,123,143,443 to 212.16.5.2 1024-65535 via ed0
07300 allow udp from any 33434-33523 to 212.16.5.2 32769-65535 keep-state via ed0
07310 allow udp from 212.16.5.2 32769-65535 to any 33434-33523 keep-state via ed0
07500 allow icmp from 212.16.5.2 to any via ed0 icmptype 0,3,4,8,11,12
07510 allow icmp from any to 212.16.5.2 via ed0 icmptype 0,3,4,8,11,12
65535 deny ip from any to any
# netstat -rn
Routing tables
Internet:
Destination Gateway Flags Refs Use Netif Expire
default 212.16.5.1 UGSc 9292 347499 ed0
127.0.0.1 127.0.0.1 UH 0 10 lo0
192.168.1 link#1 UC 2 0 rl0
192.168.1.2 0:c0:26:a7:b5:8e UHLW 19 6536786 rl0 704
192.168.1.255 ff:ff:ff:ff:ff:ff UHLWb 1 8673 rl0
212.16.5. link#2 UC 4 0 ed0
212.16.5.13 0:c0:df:f9:ca:ed UHLW 7 0 ed0 1110
212.16.5.15 link#2 UHLW 3 32 ed0
212.16.5.16 link#2 UHLW 19 52 ed0
212.16.5.17 link#2 UHLW 1 12 ed0
# /usr/local/bin/nmap -v aliot
Starting nmap V. 2.54BETA30 ( www.insecure.org/nmap/ )
No tcp,udp, or ICMP scantype specified, assuming vanilla tcp connect() scan. Use -sP if you really don't want to portscan (and just want to see what hosts are up).
Host aliot (192.168.1.1) appears to be up ... good.
Initiating Connect() Scan against aliot (192.168.1.1)
Adding open port 22/tcp
Adding open port 143/tcp
Adding open port 139/tcp
Adding open port 25/tcp
Adding open port 80/tcp
Adding open port 21/tcp
The Connect() Scan took 7 seconds to scan 1549 ports.
Interesting ports on aliot (192.168.1.1):
(The 1543 ports scanned but not shown below are in state: closed)
Port State Service
21/tcp open ftp
22/tcp open ssh
25/tcp open smtp
80/tcp open http
139/tcp open netbios-ssn
143/tcp open imap2
Nmap run completed -- 1 IP address (1 host up) scanned in 8 seconds
это был скан роутера с внутренней стороны, с внешней -- то же самое, за исключением самбы.
хост, сеть которого не работает:
# ifconfig -a
dc0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
inet 192.168.2.1 netmask 0xffffff00 broadcast 192.168.2.255
ether 00:08:a1:1c:35:35
media: Ethernet autoselect (none)
status: active
dc1: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
inet 192.168.1.3 netmask 0xffffff00 broadcast 192.168.1.255
ether 00:08:a1:1c:34:49
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active
ds0: flags=8008<LOOPBACK,MULTICAST> mtu 65532
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
inet 127.0.0.1 netmask 0xff000000
ppp0: flags=8010<POINTTOPOINT,MULTICAST> mtu 1500
sl0: flags=c010<POINTIPOINT,LINK2,MULTICAST> mtu 552
!!! Интерфейс dc0 -- "свободный", т.е. на момент выполнения команды "ifconfig" к нему ничего не было подключено !!!
# ipfw l
00100 allow ip from any to any via lo0
00200 deny ip from any to 172.0.0.0/8
00300 deny ip from 172.0.0.0/8 to any
65000 allow ip from any to any
65535 deny ip from any to any
# netstat -rn
Routing tables
Destination Gateway Flags Refs Use Netif Expire
default 192.168.1.1 UGSc 0 0 dс1
127.0.0.1 127.0.0.1 UH 0 0 lo0
192.168.1 link#2 UC 1 0 dc1
192.168.1.1 link#2 UHLW 1 0 dc1
192.168.2 link#1 UC 0 0 dc0
#nmap: nmap на этой машине нет, т.к. она не подключена к сети.
я открытые порты через sockstat посмотрел.
так вот, ничего кроме sshd (*:22) порты не прослушивает.