You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
INVITE Initiate a dialog for establishing a call. RFC 3261
32
+
ACK Confirm that an entity has received. RFC 3261
33
+
BYE Signal termination of a dialog and end a call. RFC 3261
34
+
CANCEL Cancel any pending request. RFC 3261
35
+
UPDATE Modify the state of a session without changing the state of the dialog. RFC 3311
36
+
REFER Ask recipient to issue a request for the purpose of call transfer. RFC 3515
37
+
PRACK Provisional acknowledgement. RFC 3262
38
+
SUBSCRIBE Initiates a subscription for notification of events from a notifier. RFC 6665
39
+
NOTIFY Inform a subscriber of notifications of a new event. RFC 6665
40
+
PUBLISH Publish an event to a notification server. RFC 3903
41
+
MESSAGE Deliver a text message. Used in instant messaging applications. RFC 3428
42
+
INFO Send mid-session information that does not modify the session state. RFC 6086
43
+
OPTIONS Query the capabilities of an endpoint RFC 3261
44
+
```
45
+
46
+
## Response Codes
47
+
48
+
**1xx—Provisional Responses**
49
+
50
+
```
51
+
100 Trying
52
+
180 Ringing
53
+
181 Call is Being Forwarded
54
+
182 Queued
55
+
183 Session Progress
56
+
199 Early Dialog Terminated
57
+
```
58
+
59
+
**2xx—Successful Responses**
60
+
61
+
```
62
+
200 OK
63
+
202 Accepted
64
+
204 No Notification
65
+
```
66
+
67
+
**3xx—Redirection Responses**
68
+
69
+
```
70
+
300 Multiple Choices
71
+
301 Moved Permanently
72
+
302 Moved Temporarily
73
+
305 Use Proxy
74
+
380 Alternative Service
75
+
```
76
+
77
+
**4xx—Client Failure Responses**
78
+
79
+
```
80
+
400 Bad Request
81
+
401 Unauthorized
82
+
402 Payment Required
83
+
403 Forbidden
84
+
404 Not Found
85
+
405 Method Not Allowed
86
+
406 Not Acceptable
87
+
407 Proxy Authentication Required
88
+
408 Request Timeout
89
+
409 Conflict
90
+
410 Gone
91
+
411 Length Required
92
+
412 Conditional Request Failed
93
+
413 Request Entity Too Large
94
+
414 Request-URI Too Long
95
+
415 Unsupported Media Type
96
+
416 Unsupported URI Scheme
97
+
417 Unknown Resource-Priority
98
+
420 Bad Extension
99
+
421 Extension Required
100
+
422 Session Interval Too Small
101
+
423 Interval Too Brief
102
+
424 Bad Location Information
103
+
425 Bad Alert Message
104
+
428 Use Identity Header
105
+
429 Provide Referrer Identity
106
+
430 Flow Failed
107
+
433 Anonymity Disallowed
108
+
436 Bad Identity-Info
109
+
437 Unsupported Certificate
110
+
438 Invalid Identity Header
111
+
439 First Hop Lacks Outbound Support
112
+
440 Max-Breadth Exceeded
113
+
469 Bad Info Package
114
+
470 Consent Needed
115
+
480 Temporarily Unavailable
116
+
481 Call/Transaction Does Not Exist
117
+
482 Loop Detected
118
+
483 Too Many Hops
119
+
484 Address Incomplete
120
+
485 Ambiguous
121
+
486 Busy Here
122
+
487 Request Terminated
123
+
488 Not Acceptable Here
124
+
489 Bad Event
125
+
491 Request Pending
126
+
493 Undecipherable
127
+
494 Security Agreement Required
128
+
```
129
+
130
+
**5xx—Server Failure Responses**
131
+
132
+
```
133
+
500 Internal Server Error
134
+
501 Not Implemented
135
+
502 Bad Gateway
136
+
503 Service Unavailable
137
+
504 Server Time-out
138
+
505 Version Not Supported
139
+
513 Message Too Large
140
+
555 Push Notification Service Not Supported
141
+
580 Precondition Failure
142
+
```
143
+
144
+
**6xx—Global Failure Responses**
145
+
146
+
```
147
+
600 Busy Everywhere
148
+
603 Decline
149
+
604 Does Not Exist Anywhere
150
+
606 Not Acceptable
151
+
607 Unwanted
152
+
608 Rejected
153
+
```
154
+
25
155
## VoIP Enumeration
26
156
27
157
### Telephone Numbers
@@ -80,6 +210,11 @@ Any other OSINT enumeration that helps to identify VoIP software being used will
80
210
### Network Enumeration
81
211
82
212
***`nmap`** is capable of scanning UDP services, but because of the number of UDP services being scanned, it's very slow and might not be very accurate with this kind of services.
***`svmap`** from SIPVicious (`sudo apt install sipvicious`): Will locate SIP services in the indicated network.
84
219
*`svmap` is **easy to block** because it uses the User-Agent `friendly-scanner`, but you could modify the code from `/usr/share/sipvicious/sipvicious` and change it.
85
220
@@ -88,18 +223,17 @@ Any other OSINT enumeration that helps to identify VoIP software being used will
88
223
svmap 10.10.0.0/24 -p 5060-5070 [--fp]
89
224
```
90
225
91
-
***`sipscan.py`** from [**sippts**](https://github.com/Pepelux/sippts)**:**Sipscan is a very fast scanner for SIP services over UDP, TCP or TLS. It uses multithread and can scan large ranges of networks. It allows to easily indicate a port range, scan both TCP & UDP, use another method (by default it will use OPTIONS) and specify a different User-Agent (and more).
226
+
***`SIPPTS scan`** from [**sippts**](https://github.com/Pepelux/sippts)**:**SIPPTS scan is a very fast scanner for SIP services over UDP, TCP or TLS. It uses multithread and can scan large ranges of networks. It allows to easily indicate a port range, scan both TCP & UDP, use another method (by default it will use OPTIONS) and specify a different User-Agent (and more).
@@ -124,10 +258,24 @@ The PBX could also be exposing other network services such as:
124
258
125
259
### Methods Enumeration
126
260
127
-
It's possible to find **which methods are available** to use in the PBX using `sipenumerate.py` from [**sippts**](https://github.com/Pepelux/sippts)
261
+
It's possible to find **which methods are available** to use in the PBX using `SIPPTS enumerate` from [**sippts**](https://github.com/Pepelux/sippts)
128
262
129
263
```bash
130
-
python3 sipenumerate.py -i 10.10.0.10 -r 5080
264
+
sippts enumerate -i 10.10.0.10
265
+
```
266
+
267
+
### Analysing server responses
268
+
269
+
It is very important to analyse the headers that a server sends back to us, depending on the type of message and headers that we send. With `SIPPTS send` from [**sippts**](https://github.com/Pepelux/sippts) we can send personalised messages, manipulating all the headers, and analyse the response.
It is also possible to obtain data if the server uses websockets. With `SIPPTS wssend` from [**sippts**](https://github.com/Pepelux/sippts) we can send personalised WS messages.
276
+
277
+
```bash
278
+
sippts wssend -i 10.10.0.10 -r 443 -path /ws
131
279
```
132
280
133
281
### Extension Enumeration
@@ -140,10 +288,10 @@ Extensions in a PBX (Private Branch Exchange) system refer to the **unique inter
140
288
svwar 10.10.0.10 -p5060 -e100-300 -m REGISTER
141
289
```
142
290
143
-
***`sipextend.py`** from [**sippts**](https://github.com/Pepelux/sippts)**:**Sipexten identifies extensions on a SIP server. Sipexten can check large network and port ranges.
291
+
***`SIPPTS exten`** from [**sippts**](https://github.com/Pepelux/sippts)**:**SIPPTS exten identifies extensions on a SIP server. Sipexten can check large network and port ranges.
***metasploit**: You can also enumerate extensions/usernames with metasploit:
@@ -162,7 +310,7 @@ enumiax -v -m3 -M3 10.10.0.10
162
310
163
311
## VoIP Attacks
164
312
165
-
### Password Brute-Force
313
+
### Password Brute-Force - online
166
314
167
315
Having discovered the **PBX** and some **extensions/usernames**, a Red Team could try to **authenticate via the `REGISTER` method** to an extension using a dictionary of common passwords to brute force the authentication.
svcrack -u100 -r1-9999 -z4 10.0.0.1 #Check username in extensions
180
328
```
181
329
182
-
***`sipcrack.py`** from [**sippts**](https://github.com/Pepelux/sippts)**:**SIP Digest Crack is a tool to crack the digest authentications within the SIP protocol.
330
+
***`SIPPTS rcrack`** from [**sippts**](https://github.com/Pepelux/sippts)**:**SIPPTS rcrack is a remote password cracker for SIP services. Rcrack can test passwords for several users in different IPs and port ranges.
[Check this example to understand better a **SIP REGISTER communication**](basic-voip-protocols/sip-session-initiation-protocol.md#sip-register-example) to learn how are **credentials being sent**.
***`siptshar.py`, `sipdump.py`, `sipcrack.py`** from [**sippts**](https://github.com/Pepelux/sippts)**:**
219
-
***SipTshark** extracts data of SIP protocol from a PCAP file.
220
-
***SipDump** Extracts SIP Digest authentications from a PCAP file.
221
-
***SIP Digest Crack** is a tool to crack the digest authentications within the SIP protocol.
364
+
***`SIPPTS dump`** from [**sippts**](https://github.com/Pepelux/sippts)**:** SIPPTS dump can extract digest authentications from a pcap file.
365
+
366
+
```bash
367
+
sippts dump -f capture.pcap -o data.txt
368
+
```
369
+
370
+
***`SIPPTS dcrack`** from [**sippts**](https://github.com/Pepelux/sippts)**:** SIPPTS dcrack is a tool to crack the digest authentications obtained with SIPPTS dump.
371
+
372
+
```bash
373
+
sippts dcrack -f data.txt -w wordlist/rockyou.txt
374
+
```
375
+
376
+
377
+
***`SIPPTS tshark`** from [**sippts**](https://github.com/Pepelux/sippts)**:** SIPPTS tshark extracts data of SIP protocol from a PCAP file.
@@ -311,17 +465,17 @@ Anyone will be able to use the **server to call to any other number** (and the a
311
465
Moreover, by default the **`sip.conf`** file contains **`allowguest=true`**, then **any** attacker with **no authentication** will be able to call to any other number.
312
466
{% endhint %}
313
467
314
-
***`sipinvite.py`** from [**sippts**](https://github.com/Pepelux/sippts)**:**Sipinvite checks if a **PBX server allows us to make calls without authentication**. If the SIP server has an incorrect configuration, it will allow us to make calls to external numbers. It can also allow us to transfer the call to a second external number.
468
+
***`SIPPTS invite`** from [**sippts**](https://github.com/Pepelux/sippts)**:**SIPPTS invite checks if a **PBX server allows us to make calls without authentication**. If the SIP server has an incorrect configuration, it will allow us to make calls to external numbers. It can also allow us to transfer the call to a second external number.
315
469
316
470
For example, if your Asterisk server has a bad context configuration, you can accept INVITE request without authorization. In this case, an attacker can make calls without knowing any user/pass.
317
471
318
472
{% code overflow="wrap" %}
319
473
```bash
320
474
# Trying to make a call to the number 555555555 (without auth) with source number 200.
Therefore, a call to the extension **`101`** and **`123123123`** will be send and only the first one getting the call would be stablished... but if an attacker use an **extension that bypasses any match** that is being performed but doesn't exist, he could be **inject a call only to the desired number**.
376
530
377
-
## SIPDigestLeak
531
+
## SIPDigestLeak vulnerability
378
532
379
533
The SIP Digest Leak is a vulnerability that affects a large number of SIP Phones, including both hardware and software IP Phones as well as phone adapters (VoIP to analogue). The vulnerability allows **leakage of the Digest authentication response**, which is computed from the password. An **offline password attack is then possible** and can recover most passwords based on the challenge response.
380
534
381
535
**[Vulnerability scenario from here**](https://resources.enablesecurity.com/resources/sipdigestleak-tut.pdf):
382
536
383
-
1. An IP Phone (victim) is listening on port 5060, accepting phone calls
537
+
1. An IP Phone (victim) is listening on any port (for example: 5060), accepting phone calls
384
538
2. The attacker sends an INVITE to the IP Phone
385
539
3. The victim phone starts ringing and someone picks up and hangs up (because no one answers the phone at the other end)
386
540
4. When the phone is hung up, the **victim phone sends a BYE to the attacker**
387
541
5. The **attacker issues a 407 response** that **asks for authentication** and issues an authentication challenge
388
542
6. The **victim phone provides a response to the authentication challenge** in a second BYE
389
543
7. The **attacker can then issue a brute-force attack** on the challenge response on his local machine (or distributed network etc) and guess the password
390
544
391
-
***sipdigestleak.py** from [**sippts**](https://github.com/Pepelux/sippts)**:**SipDigestLeak exploits this vulnerability.
545
+
***SIPPTS leak** from [**sippts**](https://github.com/Pepelux/sippts)**:**SIPPTS leak exploits the SIP Digest Leak vulnerability that affects a large number of SIP Phones. The output can be saved in SipCrack format to bruteforce it using SIPPTS dcrack or the SipCrack tool.
392
546
393
547
```bash
394
-
python3 sipdigestleak.py -i 10.10.0.10
548
+
sippts leak -i 10.10.0.10
395
549
396
550
[!] Target: 10.10.0.10:5060/UDP
397
551
[!] Caller: 100
@@ -467,7 +621,7 @@ You could also even make Asterisk **execute a script that will leak the call** w
467
621
exten => h,1,System(/tmp/leak_conv.sh&)
468
622
```
469
623
470
-
### RTCPBleed
624
+
### RTCPBleed vulnerability
471
625
472
626
**RTCPBleed** is a major security issue affecting Asterisk-based VoIP servers (published in 2017). The vulnerability allows **RTP (Real Time Protocol) traffic**, which carries VoIP conversations, to be **intercepted and redirected by anyone on the Internet**. This occurs because RTP traffic bypasses authentication when navigating through NAT (Network Address Translation) firewalls.
473
627
@@ -479,28 +633,28 @@ Asterisk and FreePBX have traditionally used the **`NAT=yes` setting**, which en
479
633
480
634
For more info check [https://www.rtpbleed.com/](https://www.rtpbleed.com/)
481
635
482
-
***`rtpbleed.py`** from [**sippts**](https://github.com/Pepelux/sippts)**:**It detects the RTP Bleed vulnerability sending RTP streams
636
+
***`SIPPTS rtpbleed`** from [**sippts**](https://github.com/Pepelux/sippts)**:**SIPPTS rtpbleed detects the RTP Bleed vulnerability sending RTP streams.
483
637
484
638
```bash
485
-
python3 rtpbleed.py -i 10.10.0.10
639
+
sippts rtpbleed -i 10.10.0.10
486
640
```
487
641
488
-
***`rtcpbleed.py`** from [**sippts**](https://github.com/Pepelux/sippts)**:**It detects the RTP Bleed vulnerability sending RTP streams
642
+
***`SIPPTS rtcpbleed`** from [**sippts**](https://github.com/Pepelux/sippts)**:**SIPPTS rtcpbleed detects the RTP Bleed vulnerability sending RTCP streams.
489
643
490
644
```bash
491
-
python3 rtcpbleed.py -i 10.10.0.10
645
+
sippts rtcpbleed -i 10.10.0.10
492
646
```
493
647
494
-
***`rtpbleedflood.py`** from [**sippts**](https://github.com/Pepelux/sippts)**:**Exploit the RTP Bleed vulnerability sending RTP streams
648
+
***`SIPPTS rtpbleedflood`** from [**sippts**](https://github.com/Pepelux/sippts)**:**SIPPTS rtpbleedflood exploit the RTP Bleed vulnerability sending RTP streams.
***`rtpbleedinject.py`** from [**sippts**](https://github.com/Pepelux/sippts)**:**Exploit the RTP Bleed vulnerability sending RTP streams (from an audio file)
654
+
***`SIPPTS rtpbleedinject`** from [**sippts**](https://github.com/Pepelux/sippts)**:**SIPPTS rtpbleedinject exploit the RTP Bleed vulnerability injecting an audio file (WAV format).
***`SIPPTS flood`** from [**sippts**](https://github.com/Pepelux/sippts)**: SIPPTS flood sends unlimited messages to the target.
699
+
*`sippts flood -i 10.10.0.10 -m invite -v`
700
+
***`SIPPTS ping`** from [**sippts**](https://github.com/Pepelux/sippts)**: SIPPTS ping makes a SIP ping to see the server response time.
701
+
*`sippts ping -i 10.10.0.10`
546
702
*[**IAXFlooder**](https://www.kali.org/tools/iaxflood/): DoS IAX protocol used by Asterisk
547
703
*[**inviteflood**](https://github.com/foreni-packages/inviteflood/blob/master/inviteflood/Readme.txt): A tool to perform SIP/SDP INVITE message flooding over UDP/IP.
548
704
*[**rtpflood**](https://www.kali.org/tools/rtpflood/): Send several well formed RTP packets. Its needed to know the RTP ports that are being used (sniff first).
549
705
*[**SIPp**](https://github.com/SIPp/sipp): Allows to analyze and generate SIP traffic. so it can be used to DoS also.
550
706
*[**SIPsak**](https://github.com/nils-ohlmeier/sipsak): SIP swiss army knife. Can also be used to perform SIP attacks.
***`sipsend.py`** from [**sippts**](https://github.com/Pepelux/sippts)**:** SIPSend allow us to send a **customized SIP message** and analyze the response.
553
-
***`wssend.py`** from [**sippts**](https://github.com/Pepelux/sippts)**:** WsSend allow us to send a customized SIP message over WebSockets and analyze the response.
554
708
555
709
### OS Vulnerabilities
556
710
@@ -559,6 +713,7 @@ The easiest way to install a software such as Asterisk is to download an **OS di
0 commit comments