[Problem] Geblockte IP im Asterisk Log

xbrainbug

Neuer User
Hallo,

ich habe eine Problem mit zugriffen auf meine Asterisk. Ich benutze fail2ban um IP´s zu blocken und laut iptables werden auch IP´s geblockt aber wenn ich dann im SIP-Log schaue, sehe ich immer noch zugriffe von diesen IP´s. Dann habe ich mal zum Spaß meine IP geblockt und versucht per SSH zuzugreifen, was nicht funktioniert hat. Wie schaffen es die Angreifer an meiner Firewall vorbei?

Was ich auch nicht verstehe, wieso steht im FROM und TO jeweils nach dem @ meine IP?

Meine iptables rules:

Chain f2b-ASTERISK (2 references)
target prot opt source destination
REJECT all -- 185.53.88.164 0.0.0.0/0 reject-with icmp-port-unreachable
REJECT all -- 77.247.109.56 0.0.0.0/0 reject-with icmp-port-unreachable
REJECT all -- 51.15.156.40 0.0.0.0/0 reject-with icmp-port-unreachable
REJECT all -- 5.62.41.69 0.0.0.0/0 reject-with icmp-port-unreachable
REJECT all -- 185.53.88.158 0.0.0.0/0 reject-with icmp-port-unreachable
REJECT all -- 185.53.88.152 0.0.0.0/0 reject-with icmp-port-unreachable
REJECT all -- 185.53.88.14 0.0.0.0/0 reject-with icmp-port-unreachable
REJECT all -- 139.99.119.241 0.0.0.0/0 reject-with icmp-port-unreachable
RETURN all -- 0.0.0.0/0 0.0.0.0/0
Chain f2b-recidive (2 references)
target prot opt source destination
REJECT all -- 62.210.247.151 0.0.0.0/0 reject-with icmp-port-unreachable
REJECT all -- 81.7.14.107 0.0.0.0/0 reject-with icmp-port-unreachable
REJECT all -- 77.247.109.80 0.0.0.0/0 reject-with icmp-port-unreachable
REJECT all -- 77.247.109.56 0.0.0.0/0 reject-with icmp-port-unreachable
REJECT all -- 77.247.109.24 0.0.0.0/0 reject-with icmp-port-unreachable
REJECT all -- 62.210.53.229 0.0.0.0/0 reject-with icmp-port-unreachable
REJECT all -- 51.15.156.40 0.0.0.0/0 reject-with icmp-port-unreachable
REJECT all -- 5.62.41.69 0.0.0.0/0 reject-with icmp-port-unreachable
REJECT all -- 195.154.38.45 0.0.0.0/0 reject-with icmp-port-unreachable
REJECT all -- 185.53.88.74 0.0.0.0/0 reject-with icmp-port-unreachable
REJECT all -- 185.53.88.164 0.0.0.0/0 reject-with icmp-port-unreachable
REJECT all -- 185.53.88.161 0.0.0.0/0 reject-with icmp-port-unreachable
REJECT all -- 185.53.88.158 0.0.0.0/0 reject-with icmp-port-unreachable
REJECT all -- 185.53.88.152 0.0.0.0/0 reject-with icmp-port-unreachable
REJECT all -- 185.53.88.14 0.0.0.0/0 reject-with icmp-port-unreachable
REJECT all -- 185.53.88.105 0.0.0.0/0 reject-with icmp-port-unreachable
REJECT all -- 167.86.82.26 0.0.0.0/0 reject-with icmp-port-unreachable
REJECT all -- 163.172.224.41 0.0.0.0/0 reject-with icmp-port-unreachable
REJECT all -- 147.135.39.196 0.0.0.0/0 reject-with icmp-port-unreachable
RETURN all -- 0.0.0.0/0 0.0.0.0/0


Hier der Eintrag aus dem LOG von Asterisk:

Retransmitting #4 (NAT) to 62.210.247.151:49786:
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 62.210.247.151:49786;branch=z9hG4bK1486429495;received=62.210.247.151;rport=49786
From: <sip:lissette@MEINEIP>;tag=1953932026
To: <sip:48413828015@MEINEIP>;tag=as0c611970
Call-ID: 1191492635-905746166-580971484
CSeq: 1 INVITE
Server: Asterisk PBX 13.1.0~dfsg-1.1ubuntu4.1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="31e404fb"
Content-Length: 0
 
du solltest per z.B.
Code:
iptables -t filter -nvL | less
auf der fraglichen Kiste mal nachsehen, welche Ports genau fuer 'f2b-recidive ' eigentlich gesperrt werden.
 
du solltest per z.B.
Code:
iptables -t filter -nvL | less
auf der fraglichen Kiste mal nachsehen, welche Ports genau fuer 'f2b-recidive ' eigentlich gesperrt werden.

Hier das Ergebnis, es wird alles geblockt, wenn ich es richtig lese:

Chain INPUT (policy ACCEPT 1306 packets, 335K bytes)
pkts bytes target prot opt in out source destination
74841 46M f2b-ASTERISK all -- * * 0.0.0.0/0 0.0.0.0/0
21558 16M f2b-recidive tcp -- * * 0.0.0.0/0 0.0.0.0/0
88 68643 DROP udp -- * * 0.0.0.0/0 0.0.0.0/0 udp dpt:5060 STRING match "sipcli" ALGO name bm TO 65535
0 0 DROP udp -- * * 0.0.0.0/0 0.0.0.0/0 udp dpt:5060 STRING match "sip-scan" ALGO name bm TO 65535
0 0 DROP udp -- * * 0.0.0.0/0 0.0.0.0/0 udp dpt:5060 STRING match "iWar" ALGO name bm TO 65535
77 33815 DROP udp -- * * 0.0.0.0/0 0.0.0.0/0 udp dpt:5060 STRING match "sipvicious" ALGO name bm TO 65535
0 0 DROP udp -- * * 0.0.0.0/0 0.0.0.0/0 udp dpt:5060 STRING match "sipsak" ALGO name bm TO 65535
0 0 DROP udp -- * * 0.0.0.0/0 0.0.0.0/0 udp dpt:5060 STRING match "sundayddr" ALGO name bm TO 65535
19 8396 DROP udp -- * * 0.0.0.0/0 0.0.0.0/0 udp dpt:5060 STRING match "VaxSIPUserAgent" ALGO name bm TO 65535
3 1281 DROP udp -- * * 0.0.0.0/0 0.0.0.0/0 udp dpt:5060 STRING match "friendly-scanner" ALGO name bm TO 65535
155 117K DROP udp -- * * 0.0.0.0/0 0.0.0.0/0 udp dpt:5060 STRING match "test" ALGO name bm TO 65535
0 0 f2b-asterisk-tcp tcp -- * * 0.0.0.0/0 0.0.0.0/0 multiport dports 5060,5061
136K 71M f2b-ASTERISK all -- * * 0.0.0.0/0 0.0.0.0/0
52884 24M f2b-recidive tcp -- * * 0.0.0.0/0 0.0.0.0/0
856K 411M f2b-asterisk-udp udp -- * * 0.0.0.0/0 0.0.0.0/0 multiport dports 5060,5061
0 0 f2b-asterisk-tcp tcp -- * * 0.0.0.0/0 0.0.0.0/0 multiport dports 5060,5061
0 0 ACCEPT udp -- * * 0.0.0.0/0 0.0.0.0/0 udp dpt:6070


Chain f2b-recidive (2 references)
pkts bytes target prot opt in out source destination
0 0 REJECT all -- * * 62.210.247.151 0.0.0.0/0 reject-with icmp-port-unreachable
0 0 REJECT all -- * * 81.7.14.107 0.0.0.0/0 reject-with icmp-port-unreachable
0 0 REJECT all -- * * 77.247.109.80 0.0.0.0/0 reject-with icmp-port-unreachable
0 0 REJECT all -- * * 77.247.109.56 0.0.0.0/0 reject-with icmp-port-unreachable
0 0 REJECT all -- * * 77.247.109.24 0.0.0.0/0 reject-with icmp-port-unreachable
0 0 REJECT all -- * * 62.210.53.229 0.0.0.0/0 reject-with icmp-port-unreachable
0 0 REJECT all -- * * 51.15.156.40 0.0.0.0/0 reject-with icmp-port-unreachable
0 0 REJECT all -- * * 5.62.41.69 0.0.0.0/0 reject-with icmp-port-unreachable
0 0 REJECT all -- * * 195.154.38.45 0.0.0.0/0 reject-with icmp-port-unreachable
0 0 REJECT all -- * * 185.53.88.74 0.0.0.0/0 reject-with icmp-port-unreachable
0 0 REJECT all -- * * 185.53.88.164 0.0.0.0/0 reject-with icmp-port-unreachable
0 0 REJECT all -- * * 185.53.88.161 0.0.0.0/0 reject-with icmp-port-unreachable
0 0 REJECT all -- * * 185.53.88.158 0.0.0.0/0 reject-with icmp-port-unreachable
0 0 REJECT all -- * * 185.53.88.152 0.0.0.0/0 reject-with icmp-port-unreachable
0 0 REJECT all -- * * 185.53.88.14 0.0.0.0/0 reject-with icmp-port-unreachable
0 0 REJECT all -- * * 167.86.82.26 0.0.0.0/0 reject-with icmp-port-unreachable
0 0 REJECT all -- * * 163.172.224.41 0.0.0.0/0 reject-with icmp-port-unreachable
43116 32M RETURN all -- * * 0.0.0.0/0 0.0.0.0/0
 
das 'f2b-recidive ' bezieht sich nur auf TCP. Aber deine Logs zeigen Traffic zu 62.210.247.151 ueber UDP. Insofern ist klar, dass die 62.210.247.151 weiterhin im Log auftaucht.
 
das 'f2b-recidive ' bezieht sich nur auf TCP. Aber deine Logs zeigen Traffic zu 62.210.247.151 ueber UDP. Insofern ist klar, dass die 62.210.247.151 weiterhin im Log auftaucht.

Aber weiter unten im "Chain f2b-recidive" steht doch "0 0 REJECT all -- * * 62.210.247.151 0.0.0.0/0 reject-with icmp-port-unreachable". das bezieht sich auf TCP und UDP. Warum greift das nicht?
 
er laeuft in die 'f2b-recidive' fuer UDP schon gar nicht rein
 
OK, Recidive macht wohl im Standard kein UDP, habs jetzt eingetragen, Danke.

Ist aber dann auch blöd, wenn mein UDP Filter greift und die IP sperrt ist alles gut. Wenn dann aber nach mehrmaligen versuchen Recidive greift, hebt der quasi UDP wieder auf, und es gibt keine Sperre mehr...
 

Neueste Beiträge

Statistik des Forums

Themen
244,998
Beiträge
2,222,436
Mitglieder
371,773
Neuestes Mitglied
silverstar_ms
Zurück
Oben