Closed AH-M-ED closed 1 year ago
Hello,
After further testing,I can confirm that the same issue happen sipinvite.py (not just sipsend.py)
Thanks.
Hi
I've tried it and it works fine. Maybe you must set -fu with the same user in --user, or maybe pplsip user-agent is filtered:
$ ./sipsend.py -i sip.myserver.com -m register --user MYUSER --pass MYPASS -fu MYUSER
☎️ SIPPTS BY 🅿 🅴 🅿 🅴 🅻 🆄 🆇
█████████████████████████████████████████████
█─▄▄▄▄█▄─▄█▄─▄▄─███─▄▄▄▄█▄─▄▄─█▄─▀█▄─▄█▄─▄▄▀█
█▄▄▄▄─██─███─▄▄▄███▄▄▄▄─██─▄█▀██─█▄▀─███─██─█
▀▄▄▄▄▄▀▄▄▄▀▄▄▄▀▀▀▀▀▄▄▄▄▄▀▄▄▄▄▄▀▄▄▄▀▀▄▄▀▄▄▄▄▀▀
💾 https://github.com/Pepelux/sippts
🐦 https://twitter.com/pepeluxx
[✓] Target: sip.myserver.com:5060/UDP
[✓] Customized From User: MYUSER
[+] Sending to sip.myserver.com:5060/UDP ...
REGISTER sip:sip.myserver.com SIP/2.0
Via: SIP/2.0/UDP 192.168.2.102:39109;branch=cc5cbwj7s0u7kchv50hnfuyw3xqikllm3u9aqtcxu2d4sj8u7lmwwdt1iexhznzln0jr2r6
From: <sip:MYUSER@sip.myserver.com>;tag=b84da350
To: <sip:MYUSER@sip.myserver.com>
Contact: <sip:MYUSER@192.168.2.102:39109;transport=UDP>
Call-ID: 0e1047a549f1e9af48157c9f487dbcbb
CSeq: 1 REGISTER
Max-Forwards: 70
User-Agent: pplsip
Allow: INVITE,REGISTER,ACK,CANCEL,BYE,NOTIFY,REFER,OPTIONS,INFO,SUBSCRIBE,UPDATE,PRACK,MESSAGE
Expires: 10
Content-Length: 0
[-] Receiving from sip.myserver.com:5060/UDP ...
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.2.102:39109;rport=39109;received=X.X.X.X;branch=cc5cbwj7s0u7kchv50hnfuyw3xqikllm3u9aqtcxu2d4sj8u7lmwwdt1iexhznzln0jr2r6
From: <sip:MYUSER@sip.myserver.com>;tag=b84da350
To: <sip:MYUSER@sip.myserver.com>;tag=199f6dbec561f48acc074724c17bad7f.4dc20000
Call-ID: 0e1047a549f1e9af48157c9f487dbcbb
CSeq: 1 REGISTER
WWW-Authenticate: Digest realm="sip.myserver.com", nonce="Y33v32N97rMlpm0Hvw5brvKaONnmm7x+", qop="auth"
Server: MySIPServer
Content-Length: 0
[+] Request ACK
ACK sip:sip.myserver.com SIP/2.0
Via: SIP/2.0/UDP 192.168.2.102:39109;rport=39109;received=X.X.X.X;branch=cc5cbwj7s0u7kchv50hnfuyw3xqikllm3u9aqtcxu2d4sj8u7lmwwdt1iexhznzln0jr2r6
From: <sip:MYUSER@sip.myserver.com>;tag=b84da350
To: <sip:MYUSER@sip.myserver.com>;tag=199f6dbec561f48acc074724c17bad7f.4dc20000
Call-ID: 0e1047a549f1e9af48157c9f487dbcbb
CSeq: 1 ACK
Max-Forwards: 70
Content-Length: 0
[+] Sending to sip.myserver.com:5060/UDP ...
REGISTER sip:sip.myserver.com SIP/2.0
Via: SIP/2.0/UDP 192.168.2.102:39109;rport=39109;received=X.X.X.X;branch=cc5cbwj7s0u7kchv50hnfuyw3xqikllm3u9aqtcxu2d4sj8u7lmwwdt1iexhznzln0jr2r6
From: <sip:MYUSER@sip.myserver.com>;tag=b84da350
To: <sip:MYUSER@sip.myserver.com>
Contact: <sip:MYUSER@192.168.2.102:39109;transport=UDP>
Call-ID: 0e1047a549f1e9af48157c9f487dbcbb
Authorization: Digest username="MYUSER", realm="sip.myserver.com", nonce="Y33v32N97rMlpm0Hvw5brvKaONnmm7x+", uri="sip:MYUSER@sip.myserver.com", response="35d30464c0a6d8e9b5907f83a874590e", algorithm=MD5, qop=auth, cnonce="xh96r1bo", nc=00000001
CSeq: 2 REGISTER
Max-Forwards: 70
User-Agent: pplsip
Allow: INVITE,REGISTER,ACK,CANCEL,BYE,NOTIFY,REFER,OPTIONS,INFO,SUBSCRIBE,UPDATE,PRACK,MESSAGE
Expires: 10
Content-Length: 0
[-] Receiving from sip.myserver.com:5060/UDP ...
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.2.102:39109;rport=39109;received=X.X.X.X;branch=cc5cbwj7s0u7kchv50hnfuyw3xqikllm3u9aqtcxu2d4sj8u7lmwwdt1iexhznzln0jr2r6
From: <sip:MYUSER@sip.myserver.com>;tag=b84da350
To: <sip:MYUSER@sip.myserver.com>;tag=199f6dbec561f48acc074724c17bad7f.4dc20000
Call-ID: 0e1047a549f1e9af48157c9f487dbcbb
CSeq: 2 REGISTER
Contact: <sip:MYUSER@X.X.X.X:15075;transport=udp>;expires=15;+sip.instance="<urn:uuid:153797d5-f4b9-004e-91cb-26876292d997>"
Supported: outbound
Server: MySIPServer
Content-Length: 0
I just committed an update to set From-User to the same value as --user (if it is set)
Thanks,still having a problem with registering and what i see is that the nonce on the second register request is empty,maybe this is the cause of the register issue!
./sipsend.py -i 192.168.235.140 -m register --user 100 --pass xxx -fu 100
☎️ SIPPTS BY 🅿 🅴 🅿 🅴 🅻 🆄 🆇
█████████████████████████████████████████████
█─▄▄▄▄█▄─▄█▄─▄▄─███─▄▄▄▄█▄─▄▄─█▄─▀█▄─▄█▄─▄▄▀█
█▄▄▄▄─██─███─▄▄▄███▄▄▄▄─██─▄█▀██─█▄▀─███─██─█
▀▄▄▄▄▄▀▄▄▄▀▄▄▄▀▀▀▀▀▄▄▄▄▄▀▄▄▄▄▄▀▄▄▄▀▀▄▄▀▄▄▄▄▀▀
💾 https://github.com/Pepelux/sippts
🐦 https://twitter.com/pepeluxx
[✓] Target: 192.168.235.140:5060/UDP
[+] Sending to 192.168.235.140:5060/UDP ...
REGISTER sip:192.168.235.140 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.112:51639;branch=4s82qm4pofn7qmfcjybqmzg9z1vdy5l38wsikvwqgt3ywdmujbafahkxphz5f4jeqam73mo
From: <sip:100@192.168.235.140>;tag=e2a19cfb
To: <sip:100@192.168.235.140>
Contact: <sip:100@192.168.1.112:51639;transport=UDP>
Call-ID: d7e2209acfabcf7ca099a492e13d83ce
CSeq: 1 REGISTER
Max-Forwards: 70
User-Agent: pplsip
Allow: INVITE,REGISTER,ACK,CANCEL,BYE,NOTIFY,REFER,OPTIONS,INFO,SUBSCRIBE,UPDATE,PRACK,MESSAGE
Expires: 10
Content-Length: 0
[-] Receiving from 192.168.235.140:5060/UDP ...
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.1.112:51639;rport=51639;received=192.168.235.1;branch=4s82qm4pofn7qmfcjybqmzg9z1vdy5l38wsikvwqgt3ywdmujbafahkxphz5f4jeqam73mo
Call-ID: d7e2209acfabcf7ca099a492e13d83ce
From: <sip:100@192.168.235.140>;tag=e2a19cfb
To: <sip:100@192.168.235.140>;tag=4s82qm4pofn7qmfcjybqmzg9z1vdy5l38wsikvwqgt3ywdmujbafahkxphz5f4jeqam73mo
CSeq: 1 REGISTER
WWW-Authenticate: Digest realm="asterisk",nonce="1669214131/ee76a3843d9bb9553a32d4d511b92c85",opaque="3e2cc12d1bc5d6ee",algorithm=MD5,qop="auth"
Server: FPBX-16.0.26(16.28.0)
Content-Length: 0
[+] Request ACK
ACK sip:192.168.235.140 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.112:51639;rport=51639;received=192.168.235.1;branch=4s82qm4pofn7qmfcjybqmzg9z1vdy5l38wsikvwqgt3ywdmujbafahkxphz5f4jeqam73mo
From: <sip:100@192.168.235.140>;tag=e2a19cfb
To: <sip:100@192.168.235.140>;tag=4s82qm4pofn7qmfcjybqmzg9z1vdy5l38wsikvwqgt3ywdmujbafahkxphz5f4jeqam73mo
Call-ID: d7e2209acfabcf7ca099a492e13d83ce
CSeq: 1 ACK
Max-Forwards: 70
Content-Length: 0
[+] Sending to 192.168.235.140:5060/UDP ...
REGISTER sip:192.168.235.140 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.112:51639;rport=51639;received=192.168.235.1;branch=4s82qm4pofn7qmfcjybqmzg9z1vdy5l38wsikvwqgt3ywdmujbafahkxphz5f4jeqam73mo
From: <sip:100@192.168.235.140>;tag=e2a19cfb
To: <sip:100@192.168.235.140>
Contact: <sip:100@192.168.1.112:51639;transport=UDP>
Call-ID: d7e2209acfabcf7ca099a492e13d83ce
Authorization: Digest username="100", realm="asterisk", nonce="", uri="sip:100@192.168.235.140", response="1a4d44860cb1f4f7b6f214ffc04c5fce", algorithm=MD5, qop=auth, cnonce="v7lq2vsk", nc=00000001
CSeq: 2 REGISTER
Max-Forwards: 70
User-Agent: pplsip
Allow: INVITE,REGISTER,ACK,CANCEL,BYE,NOTIFY,REFER,OPTIONS,INFO,SUBSCRIBE,UPDATE,PRACK,MESSAGE
Expires: 10
Content-Length: 0
[-] Receiving from 192.168.235.140:5060/UDP ...
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.1.112:51639;rport=51639;received=192.168.235.1;branch=4s82qm4pofn7qmfcjybqmzg9z1vdy5l38wsikvwqgt3ywdmujbafahkxphz5f4jeqam73mo
Call-ID: d7e2209acfabcf7ca099a492e13d83ce
From: <sip:100@192.168.235.140>;tag=e2a19cfb
To: <sip:100@192.168.235.140>;tag=4s82qm4pofn7qmfcjybqmzg9z1vdy5l38wsikvwqgt3ywdmujbafahkxphz5f4jeqam73mo
CSeq: 2 REGISTER
WWW-Authenticate: Digest realm="asterisk",nonce="1669214131/ee76a3843d9bb9553a32d4d511b92c85",opaque="5b108e0566703a13",stale=true,algorithm=MD5,qop="auth"
Server: FPBX-16.0.26(16.28.0)
Content-Length: 0
thanks.
Hello, I managed to fix the issue by just deleting the \s here https://github.com/Pepelux/sippts/blob/master/lib/functions.py#L623 Closing this issue as resolved,thanks a lot for your assistance.
Fixed. Thanks
Hello, First of all,thanks for the great work here!
Target: FreePBX server
I was trying to send a register request using
python3 sipsend.py -i 192.168.235.140 -r 5060 -m register --user 100 --pass xxx
output
It should be something like this
It seems that sipsend.py don't do the authentication when doing a Register request,hence you will always get a SIP/2.0 401 Unauthorized response. as you can see ,the Authorization header is missing.
Thanks.