我最近一直在调查一些实例,其中 SIP UDP 流量以某种方式逃避了 iptables 中定义的规则集,这导致我怀疑我们的规则中存在漏洞,因此我正在寻找有关如何加强本地系统防御的建议。我们在此服务器之前有一个可以改进的防火墙,但是在我们研究其他措施之前了解这个问题似乎很重要,因为这个问题直接与本地服务器防御有关 - 特别是 iptables。
SIP 数据包开始包含 SQL 注入尝试,我担心如果不直接处理,应用程序最终可能会受到损害。目前,“呼叫者”设法建立一个简单地播放我们的无服务通知的呼叫,因此他们正在与本地服务器开始 SIP 对话 - 不理想!
我已经使用一致的编辑方案复制了下面的详细信息,但是如果需要其他信息,请在下面发表评论,我会提出来。
感谢任何建议,感谢您的关注!
源IP:185.107.83.35 SIP服务器IP:200.200.114.207
我将从一个攻击性 SIP 数据包的示例开始:
INVITE sip:00*31203697460@200.200.114.207:5060;transport=UDP SIP/2.0
Via: SIP/2.0/UDP 185.107.83.35:5060;branch=z9hG4bK-524287-1---i9aif7pifkudxkd8
Max-Forwards: 70
Contact: <sip:...hi'or...x...='x';@185.107.83.35:5060;transport=UDP>
To: <sip:00*31203697460@200.200.114.207;transport=UDP>
From: <sip:...hi'or...x...='x';@200.200.114.207;transport=UDP>;tag=gj0njz16
Call-ID: LztInRxh5KJSOAGxCOGB0T..
CSeq: 1 INVITE
Content-Type: application/sdp
User-Agent: Avaya one-X Deskphone
Allow-Events: presence, kpml, talk
Content-Length: 515
v=0
o=Avaya 0 0 IN IP4 185.107.83.35
s=Avaya
c=IN IP4 185.107.83.35
t=0 0
m=audio 8000 RTP/AVP 18 3 110 8 0 97 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:97 iLBC/8000
a=rtpmap:3 GSM/8000
a=rtpmap:98 AMR/8000
a=rtpmap:9 G722/8000
a=rtpmap:100 SPEEX/8000
a=rtpmap:99 AMR-WB/16000
a=rtpmap:102 SPEEX/16000
a=rtpmap:121 G7221/16000
a=fmtp:121 bitrate=24000
a=rtpmap:105 opus/48000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=sendrecv
主机IP配置:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: em1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
link/ether 00:11:22:33:44:7d brd ff:ff:ff:ff:ff:ff
inet 192.168.20.20/24 brd 255.255.255.255 scope global em1
inet6 aaaa::aaaa:aaaa:aaaa:aaaa/64 scope link
valid_lft forever preferred_lft forever
3: em2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
link/ether 00:11:22:33:44:7f brd ff:ff:ff:ff:ff:ff
inet 200.200.114.207/26 brd 200.200.114.255 scope global em2
inet6 aaaa::aaaa:aaaa:aaaa:aaaa/64 scope link
valid_lft forever preferred_lft forever
4: em3: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
link/ether 00:11:22:33:44:81 brd ff:ff:ff:ff:ff:ff
5: em4: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
link/ether 00:11:22:33:44:83 brd ff:ff:ff:ff:ff:ff
这是来自的输出iptables -v -n --list
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
4769K 538M ACCEPT icmp -- * * 0.0.0.0/0 0.0.0.0/0 /* 000 accept all icmp */
645M 276G ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0 /* 001 accept all to lo interface */
11G 2946G ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 /* 002 accept related established rules */ state RELATED,ESTABLISHED
4036K 238M ACCEPT tcp -- em1 * 0.0.0.0/0 0.0.0.0/0 multiport ports 22 /* 101 accept SSH from internal interface */
36907 2036K ACCEPT all -- em1 * 192.168.4.0/24 0.0.0.0/0 /* 102 accept all traffic from site 1 LAN */
160K 6397K ACCEPT all -- em1 * 192.168.5.0/24 0.0.0.0/0 /* 103 accept all traffic from site 1 LAN */
8651K 527M ACCEPT all -- em1 * 192.168.20.0/24 0.0.0.0/0 /* 105 accept all traffic from site 2 LAN */
0 0 ACCEPT tcp -- em2 * 190.190.89.10 0.0.0.0/0 multiport ports 22 /* 106 accept SSH from WAN */
0 0 ACCEPT tcp -- em1 * 0.0.0.0/0 0.0.0.0/0 multiport ports 2812 /* 107 accept monit from LAN */
41878 19M ACCEPT udp -- em2 * 190.190.89.0/26 0.0.0.0/0 multiport ports 5060 /* 150 accept SIP from WAN */
144K 55M ACCEPT udp -- em2 * 200.200.114.192/26 0.0.0.0/0 multiport ports 5060 /* 152 accept SIP from WAN */
0 0 ACCEPT udp -- em2 * 180.180.63.32/27 0.0.0.0/0 multiport ports 5060 /* 201 accept SIP from carrier */
0 0 ACCEPT udp -- em2 * 180.180.63.32/27 0.0.0.0/0 multiport ports 8000:60000 /* 202 accept RTP from carrier */
0 0 ACCEPT udp -- em2 * 170.170.67.2 0.0.0.0/0 multiport ports 5060 /* 210 accept SIP from carrier */
0 0 ACCEPT udp -- em2 * 170.170.67.2 0.0.0.0/0 multiport ports 8000:60000 /* 211 accept RTP from carrier */
55M 8576M ACCEPT udp -- em2 * 0.0.0.0/0 0.0.0.0/0 multiport ports 16384:32768 /* 300 accept all RTP */
489K 219M REJECT all -- * * 0.0.0.0/0 0.0.0.0/0 /* 999 reject all other requests */ reject-with icmp-host-prohibited
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
0 0 REJECT all -- * * 0.0.0.0/0 0.0.0.0/0 /* 998 reject all FORWARD */ reject-with icmp-host-prohibited
Chain OUTPUT (policy ACCEPT 12G packets, 3230G bytes)
pkts bytes target prot opt in out source destination