IBM-FAN
Mitglied
- Mitglied seit
- 12 Apr 2007
- Beiträge
- 533
- Punkte für Reaktionen
- 0
- Punkte
- 0
Standard-Versionen von Debby & Ian = 1.6.2.9-2+squeeze10Welche 1.6er Version nutzt Du? Patches im SIP?
Standard-Versionen von Debby & Ian = 1.6.2.9-2+squeeze10Welche 1.6er Version nutzt Du? Patches im SIP?
Kann es sein, dass die HackBots zunächst prüfen, ob ein Asterisk/Server überhaupt per ssh manipulierbar sein könnte, bevor die Brute Force-Attacken gegen den Asterisk starten?
Anscheinend hat derselbe Hacker sich auch an meinem Asterisk versucht. Ich hatte - nachdem ich von den aktuellen Angriffen gelesen hatte - auch Verbose-Nachrichten geloggt. Hier ist ein Auszug aus meinem Log:<-- ab da hat er dann telefonieren können, und ja; das Log startet tatsächlich mit Call from extension, da hatte er vorher nichts anderes angeworfen, er hat zwar vorher direkt eine fake auth provoziert auf einen anderen Nutzernamen, aber das war es. Da hätte meine intrusion detection greifen müssen, hat sie aber nicht (ist eine pearl Lösung, die manchmal versagt), allerdings sind davor auch nur fünf verschiedene Nutzer die er probiert.
Bitte nicht böse sein, falsch ich etwas zynisch klinge, jedoch
ich wehre mich gegen den Vorwurf, der schlechten Sicherung.
[2013-02-12 05:48:25] NOTICE[1132] chan_sip.c: Registration from '<sip:1001@meine-ip>' failed for '4.59.192.170:10656' - No matching peer found
[2013-02-12 05:48:26] NOTICE[1132] chan_sip.c: Registration from '<sip:1001@meine-ip>' failed for '4.59.192.170:10656' - No matching peer found
[2013-02-12 05:48:29] VERBOSE[1132] netsock2.c: == Using SIP RTP TOS bits 184
[2013-02-12 05:48:29] VERBOSE[1132] netsock2.c: == Using SIP RTP CoS mark 5
[2013-02-12 05:48:29] VERBOSE[12661] pbx.c: -- Executing [00972599163133@from-sip-external:1] NoOp("SIP/xxx-000000a7", "Received incoming SIP connection from unknown peer to 00972599163133") in new stack
[2013-02-12 05:48:29] VERBOSE[12661] pbx.c: -- Executing [00972599163133@from-sip-external:2] Set("SIP/xxx-000000a7", "DID=00972599163133") in new stack
[2013-02-12 05:48:29] VERBOSE[12661] pbx.c: -- Executing [00972599163133@from-sip-external:3] Goto("SIP/xxx-000000a7", "s,1") in new stack
[2013-02-12 05:48:29] VERBOSE[12661] pbx.c: -- Goto (from-sip-external,s,1)
[2013-02-12 05:48:29] VERBOSE[12661] pbx.c: -- Executing [s@from-sip-external:1] GotoIf("SIP/xxx-000000a7", "0?checklang:noanonymous") in new stack
[2013-02-12 05:48:29] VERBOSE[12661] pbx.c: -- Goto (from-sip-external,s,5)
[2013-02-12 05:48:29] VERBOSE[12661] pbx.c: -- Executing [s@from-sip-external:5] Set("SIP/xxx-000000a7", "TIMEOUT(absolute)=15") in new stack
[2013-02-12 05:48:29] VERBOSE[12661] func_timeout.c: Channel will hangup at 2013-02-12 05:48:44.606 CET.
[2013-02-12 05:48:29] VERBOSE[12661] pbx.c: -- Executing [s@from-sip-external:6] Answer("SIP/xxx-000000a7", "") in new stack
[2013-02-12 05:48:30] VERBOSE[12661] pbx.c: -- Executing [s@from-sip-external:7] Wait("SIP/xxx-000000a7", "2") in new stack
[2013-02-12 05:48:32] VERBOSE[12661] pbx.c: -- Executing [s@from-sip-external:8] Playback("SIP/xxx-000000a7", "ss-noservice") in new stack
[2013-02-12 05:48:32] VERBOSE[12661] file.c: -- <SIP/xxx-000000a7> Playing 'ss-noservice.gsm' (language 'en')
@HobbyStern: Wollte Dir schon lange mal für Dein Engagement hier danken
someone@apc:/usr/src/TOOL# ./TOOL.py my-own-public-ip
| SIP Device | User Agent | Fingerprint |
--------------------------------------------------
| my-own-public-ip:5060 | brickysip | disabled |
someone@apc:/usr/src/TOOL# ./TOOL2.py my-own-public-ip
ERROR:TakeASip:SIP server replied with an authentication request for an unknown extension. Set --force to force a scan.
someone@apc:/usr/src/TOOL2# ./svwar.py my-own-public-ip --force
WARNING:TakeASip:Bad user = SIP/2.0 401 - TOOL2 will probably not work!
WARNING:TakeASip:We got an unknown response
ERROR:TakeASip:Response: 'SIP/2.0 401 Unauthorized\r\nVia: SIP/2.0/UDP my-aggressor-public-ip:5060;branch=z9hG4bK-3146033203;received=my-aggressor-public-ip;rport=5060\r\nFrom: "100"<sip:100@my-own-public-ip>;tag=31303001383633363532383635\r\nTo: "100"<sip:100@my-own-public-ip>;tag=as18460d0a\r\nCall-ID: 3425039019\r\nCSeq: 1 REGISTER\r\nUser-Agent: brickysip\r\nAllow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY\r\nSupported: replaces\r\nWWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="245fa822"\r\nContent-Length: 0\r\n\r\n'
WARNING:TakeASip:We got an unknown response
ERROR:TakeASip:Response: 'SIP/2.0 401 Unauthorized\r\nVia: SIP/2.0/UDP my-aggressor-public-ip:5060;branch=z9hG4bK-3939443820;received=my-aggressor-public-ip;rport=5060\r\nFrom: "101"<sip:101@my-own-public-ip>;tag=3130310131303830383437333231\r\nTo: "101"<sip:101@my-own-public-ip>;tag=as544247f7\r\nCall-ID: 9901961\r\nCSeq: 1 REGISTER\r\nUser-Agent: brickysip\r\nAllow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY\r\nSupported: replaces\r\nWWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="413c5fb6"\r\nContent-Length: 0\r\n\r\n'
WARNING:TakeASip:We got an unknown response
ERROR:TakeASip:Response: 'SIP/2.0 401 Unauthorized\r\nVia: SIP/2.0/UDP my-aggressor-public-ip:5060;branch=z9hG4bK-942409199;received=my-aggressor-public-ip;rport=5060\r\nFrom: "102"<sip:102@my-own-public-ip>;tag=3130320133303433363135393839\r\nTo: "102"<sip:102@my-own-public-ip>;tag=as183c4891\r\nCall-ID: 552181409\r\nCSeq: 1 REGISTER\r\nUser-Agent: brickysip\r\nAllow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY\r\nSupported: replaces\r\nWWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="58a8c105"\r\nContent-Length: 0\r\n\r\n'
WARNING:TakeASip:We got an unknown response
ERROR:TakeASip:Response: 'SIP/2.0 401 Unauthorized\r\nVia: SIP/2.0/UDP my-aggressor-public-ip:5060;branch=z9hG4bK-1665748051;received=my-aggressor-public-ip;rport=5060\r\nFrom: "103"<sip:103@my-own-public-ip>;tag=3130330133383131363639343830\r\nTo: "103"<sip:103@my-own-public-ip>;tag=as0d2dbc6e\r\nCall-ID: 2895053195\r\nCSeq: 1 REGISTER\r\nUser-Agent: brickysip\r\nAllow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY\r\nSupported: replaces\r\nWWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="5cdec92e"\r\nContent-Length: 0\r\n\r\n'
WARNING:TakeASip:We got an unknown response
ERROR:TakeASip:Response: 'SIP/2.0 401 Unauthorized\r\nVia: SIP/2.0/UDP my-aggressor-public-ip:5060;branch=z9hG4bK-3968094277;received=my-aggressor-public-ip;rport=5060\r\nFrom: "104"<sip:104@my-own-public-ip>;tag=3130340133363132363832323939\r\nTo: "104"<sip:104@my-own-public-ip>;tag=as3d962acc\r\nCall-ID: 846490985\r\nCSeq: 1 REGISTER\r\nUser-Agent: brickysip\r\nAllow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY\r\nSupported: replaces\r\nWWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="0b26e3bf"\r\nContent-Length: 0\r\n\r\n'
WARNING:TakeASip:We got an unknown response
ERROR:TakeASip:Response: 'SIP/2.0 401 Unauthorized\r\nVia: SIP/2.0/UDP my-aggressor-public-ip:5060;branch=z9hG4bK-2235380825;received=my-aggressor-public-ip;rport=5060\r\nFrom: "105"<sip:105@my-own-public-ip>;tag=31303501373332363033343336\r\nTo: "105"<sip:105@my-own-public-ip>;tag=as7658c148\r\nCall-ID: 3110844340\r\nCSeq: 1 REGISTER\r\nUser-Agent: brickysip\r\nAllow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY\r\nSupported: replaces\r\nWWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="480c0775"\r\nContent-Length: 0\r\n\r\n'
WARNING:TakeASip:We got an unknown response
ERROR:TakeASip:Response: 'SIP/2.0 401 Unauthorized\r\nVia: SIP/2.0/UDP my-aggressor-public-ip:5060;branch=z9hG4bK-1895016006;received=my-aggressor-public-ip;rport=5060\r\nFrom: "106"<sip:106@my-own-public-ip>;tag=3130360133393734323631393532\r\nTo: "106"<sip:106@my-own-public-ip>;tag=as1b8d9be7\r\nCall-ID: 1924794655\r\nCSeq: 1 REGISTER\r\nUser-Agent: brickysip\r\nAllow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY\r\nSupported: replaces\r\nWWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="51dafe30"\r\nContent-Length: 0\r\n\r\n'
WARNING:TakeASip:We got an unknown response
ERROR:TakeASip:Response: 'SIP/2.0 401 Unauthorized\r\nVia: SIP/2.0/UDP my-aggressor-public-ip:5060;branch=z9hG4bK-4004204516;received=my-aggressor-public-ip;rport=5060\r\nFrom: "107"<sip:107@my-own-public-ip>;tag=3130370132383639333032373430\r\nTo: "107"<sip:107@my-own-public-ip>;tag=as4617584d\r\nCall-ID: 2946528571\r\nCSeq: 1 REGISTER\r\nUser-Agent: brickysip\r\nAllow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY\r\nSupported: replaces\r\nWWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="548dffb4"\r\nContent-Length: 0\r\n\r\n'
WARNING:someone:found nothing
put "yes" in the Qualify field on the extension definition on the Freepbx admin interface. This will cause Asterisk to send it an OPTIONS keepalive request every 60 seconds. If there is loss of connectivity, then Asterisk will know about it in 60 seconds or less. That might fix your symptom (the SIP peers showing the device still registered), but won't tell you why the device is losing connectivity. If it is behind a NAT router, that could be the explanation (as UDP connections will generally be flushed from a NAT table after 120 seconds of no traffic). You need to check on the device config: see what its registration timeout value is set to, and check on the other registration parameters, such as how many times it tries to reregister in event of a failure, etc.
betateilchen
12.05.2007, 18:22
Grundlagenwissen :-Ö
Du mußt die Ports nehmen, die Du in der /etc/asterisk/rtp.conf angegeben hast. Standardmäßig sind das die Ports von 10000 - 20000
Every Asterisk installation only needs 3 lines in iptables to be secure if you register to or qualify your trunks for up/down status.
1
2
3
4
-A INPUT -i eth0 -p udp --dport 5060 -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -i eth0 -p udp --dport 5060 -j DROP
-A INPUT -i eth0 -p udp --dport {RTP_Start_port}:{RTP_End_port} -j ACCEPT
It's that simple.
If you need to allow registration of remote extensions, you just add the following line before the "--dport 5060 -j DROP" line.
1
2
-A INPUT -i eth0 -p udp --dport 5060 -m string --string "REGISTER sip:mypbx.domain.tld" --algo bm -j ACCEPT
.. and if you need to accept SIP URI calls, just add this pair of lines for each URI username:
1
2
3
-A INPUT -i eth0 -p udp --dport 5060 -m string --string "INVITE sip:SIPURINAMEGOESHERE" --algo bm -j ACCEPT
-A INPUT -i eth0 -p udp --dport 5060 -m string --string "BYE sip:SIPURINAMEGOESHERE" --algo bm -j ACCEPT
If you do that, your system runs 100% opaque to scans, it's 100% secure against random INVITE requests, and in order for registration attempts to go through they have to be done by DNS hostname. If you use a DNS A Record that doesn't match the reverse DNS PTR record, it would be nearly impossible for some random attacker to guess the hostname.