unregister attack in sip - owasp · 2020-01-17 · voice over internet protocol (voip) • a...

46
Unregister Attack in SIP Unregister Attack in SIP Anat Bremler-Barr Ronit Halachmi-Bekel Interdisciplinary center Herzliya Jussi Kangasharju Darmstadt University of Technology

Upload: others

Post on 05-Jun-2020

6 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Unregister Attack in SIP - OWASP · 2020-01-17 · Voice Over Internet Protocol (VoIP) • A technology that allows phone calls to be made over the internet • Packet switching •

Unregister Attack in SIPUnregister Attack in SIP

Anat Bremler-Barr Ronit Halachmi-Bekel

Interdisciplinary center Herzliya

Jussi Kangasharju

Darmstadt University of Technology

Page 2: Unregister Attack in SIP - OWASP · 2020-01-17 · Voice Over Internet Protocol (VoIP) • A technology that allows phone calls to be made over the internet • Packet switching •

Unregister AttackUnregister Attack

• We present a new VoIP Denial Of Service/impersonating attack

• Attacker cancels the registration of the phone number in the systemphone number in the system

• The victim can no longer be reached• The victim has no idea that he cannot be

reached

Page 3: Unregister Attack in SIP - OWASP · 2020-01-17 · Voice Over Internet Protocol (VoIP) • A technology that allows phone calls to be made over the internet • Packet switching •
Page 4: Unregister Attack in SIP - OWASP · 2020-01-17 · Voice Over Internet Protocol (VoIP) • A technology that allows phone calls to be made over the internet • Packet switching •

• Introduction to Telephony• VoIP• SIP• SIP• Unregister Attack• SOHA Solution• Conclusion

Page 5: Unregister Attack in SIP - OWASP · 2020-01-17 · Voice Over Internet Protocol (VoIP) • A technology that allows phone calls to be made over the internet • Packet switching •

Introduction to TelephonyIntroduction to Telephony

• Manual switchboards• Electronic switchboards • VoIP phones• The technology is still changing • The technology is still changing

dramatically

Page 6: Unregister Attack in SIP - OWASP · 2020-01-17 · Voice Over Internet Protocol (VoIP) • A technology that allows phone calls to be made over the internet • Packet switching •

Circuit SwitchingCircuit Switching• Two sides of the call creates an electric circuit

between them.• All the communication of the call travels this

circuit, and the channels are fully dedicated to the call

• Waste of resources when there is silence• Designated specifically to phone calls• Considered secure

Page 7: Unregister Attack in SIP - OWASP · 2020-01-17 · Voice Over Internet Protocol (VoIP) • A technology that allows phone calls to be made over the internet • Packet switching •

Packet SwitchingPacket Switching• No physical link between source and

destination, the path between them varies• Resources are shared by all users

(Internet)• No meaning to physical location• No meaning to physical location• Vulnerable

Page 8: Unregister Attack in SIP - OWASP · 2020-01-17 · Voice Over Internet Protocol (VoIP) • A technology that allows phone calls to be made over the internet • Packet switching •

• Introduction to Telephony• VoIP• SIP• SIP• Unregister Attack• SOHA Solution• Conclusion

Page 9: Unregister Attack in SIP - OWASP · 2020-01-17 · Voice Over Internet Protocol (VoIP) • A technology that allows phone calls to be made over the internet • Packet switching •

Voice Over Internet Protocol (VoIP)Voice Over Internet Protocol (VoIP)

• A technology that allows phone calls to be made over the internet

• Packet switching• Use of existing technology• Two Phases:• Two Phases:

– Registration (dynamic / static)– Calls

• Signaling: SIP, MGCP, H323• Media: RTP

Page 10: Unregister Attack in SIP - OWASP · 2020-01-17 · Voice Over Internet Protocol (VoIP) • A technology that allows phone calls to be made over the internet • Packet switching •

VoIP AdvantagesVoIP Advantages

• Resources are shared by all users.

• Mobility

• Functionality• Functionality– Forking – Advanced call flows

• Cost– Uses existing platforms– Decreased price of domestic and

international calls

Page 11: Unregister Attack in SIP - OWASP · 2020-01-17 · Voice Over Internet Protocol (VoIP) • A technology that allows phone calls to be made over the internet • Packet switching •

• Introduction to Telephony• VoIP• SIP• SIP• Unregister Attack• SOHA Solution• Conclusion

Page 12: Unregister Attack in SIP - OWASP · 2020-01-17 · Voice Over Internet Protocol (VoIP) • A technology that allows phone calls to be made over the internet • Packet switching •

Session Initiation Protocol (SIP)Session Initiation Protocol (SIP)

• A text based signaling protocol

• Works mostly over UDP

• Used for internet telephony, instant messaging and presence services

Page 13: Unregister Attack in SIP - OWASP · 2020-01-17 · Voice Over Internet Protocol (VoIP) • A technology that allows phone calls to be made over the internet • Packet switching •

SIP (Cont.)SIP (Cont.)

• Client-server model– Client: telephone (endpoint)– Server

• Messages– Request– Responses

Page 14: Unregister Attack in SIP - OWASP · 2020-01-17 · Voice Over Internet Protocol (VoIP) • A technology that allows phone calls to be made over the internet • Packet switching •

Call 2000

Can you accept

the call?

Do you know 2000?

Call

yes

Call accepted

Call 2000

Call

Record list:1xxx

Record list:2xxx

User

1000

ServerServer

User

2000

Look for 2000 location

No record for 2000

Look for 2000 location

Found address

Call accepted

accepted Call accepted

media

Page 15: Unregister Attack in SIP - OWASP · 2020-01-17 · Voice Over Internet Protocol (VoIP) • A technology that allows phone calls to be made over the internet • Packet switching •

RegistrationRegistration• Set of messages that eventually forms a record

at the server

• Record: a foursome of the typeName, Number, IP, Port

• Authorization and authentication are possible:– Handled per request– A challenge/response mechanism– The server SHOULD authenticate the

endpoint (RFC 3261)

Page 16: Unregister Attack in SIP - OWASP · 2020-01-17 · Voice Over Internet Protocol (VoIP) • A technology that allows phone calls to be made over the internet • Packet switching •

Registration (Cont.)Registration (Cont.)

• Expiry field - indicates how long the record will be valid for

• Call-id – unique identifier that groups • Call-id – unique identifier that groups together a series of messages.

•It MUST be the same for all requests and responses related to the same dialog.•It SHOULD be the same in each registration.

• Cseq - identify and order transactions

Page 17: Unregister Attack in SIP - OWASP · 2020-01-17 · Voice Over Internet Protocol (VoIP) • A technology that allows phone calls to be made over the internet • Packet switching •

Registration server without authentication

Registration server without authentication

Initialization

Register

OK

User 1000

serverPeriodically

OK

Record list: 1000

Page 18: Unregister Attack in SIP - OWASP · 2020-01-17 · Voice Over Internet Protocol (VoIP) • A technology that allows phone calls to be made over the internet • Packet switching •

Registration server with authentication

Registration server with authentication

Initialization

Register

407 Proxy authentication required

User 1000

server

Periodically

407 Proxy authentication required

RegisterProxy authorization

OK

Record list: 1000

Page 19: Unregister Attack in SIP - OWASP · 2020-01-17 · Voice Over Internet Protocol (VoIP) • A technology that allows phone calls to be made over the internet • Packet switching •

Endpoint removalEndpoint removal

• Endpoint removal:– Record expires according to the expiry

value– User sent unregister message – a – User sent unregister message – a

register message with expiry value of zero .

• Server SHOULD support the unregister message (RFC 3261).

Page 20: Unregister Attack in SIP - OWASP · 2020-01-17 · Voice Over Internet Protocol (VoIP) • A technology that allows phone calls to be made over the internet • Packet switching •

• Introduction to Telephony• VoIP• SIP• Unregister Attack• SOHA Solution• Conclusion

Page 21: Unregister Attack in SIP - OWASP · 2020-01-17 · Voice Over Internet Protocol (VoIP) • A technology that allows phone calls to be made over the internet • Packet switching •

The Unregister AttackThe Unregister Attack

• A new kind of Denial of Service/impersonating attack on SIP servers

• The attacker sends a spoof unregister • The attacker sends a spoof unregister packet

• As a result the server removes the victim’s record

• The victim has no indication that he is not registered at the server

Page 22: Unregister Attack in SIP - OWASP · 2020-01-17 · Voice Over Internet Protocol (VoIP) • A technology that allows phone calls to be made over the internet • Packet switching •

ExperimentsExperiments

• The attacker uses a simple script written in C• Tested on 3 different common servers• Servers with/without authentication• Attacker with/without traffic knowledge• Attacker with/without traffic knowledge

Attacker with traffic knowledge

Attacker without traffic knowledge

Server without authentication

Server with authentication

Page 23: Unregister Attack in SIP - OWASP · 2020-01-17 · Voice Over Internet Protocol (VoIP) • A technology that allows phone calls to be made over the internet • Packet switching •

Traffic knowledge – possible to receive

Traffic knowledge – possible to receive

• Frustrated employee scenario• Wireless

– Public services without authentication– Some of wireless encryption is possible to – Some of wireless encryption is possible to

decrypt

Page 24: Unregister Attack in SIP - OWASP · 2020-01-17 · Voice Over Internet Protocol (VoIP) • A technology that allows phone calls to be made over the internet • Packet switching •

Server without authenticationAttacker without traffic knowledge

Server without authenticationAttacker without traffic knowledge

• Pre knowledge: – IP address of the victim– Phone number of the victim– IP address of the server– IP address of the server

• Prevention:– Verification call-id and cseq fields

• In practice the attack succeeded on two different common servers

Page 25: Unregister Attack in SIP - OWASP · 2020-01-17 · Voice Over Internet Protocol (VoIP) • A technology that allows phone calls to be made over the internet • Packet switching •

Victim phone number

1000

OKFrom: 1000Expiry: 1800Call-id: abcdefgCseq: 5

Register From: 1000Expiry: 0Call-id: ffffffff

Register From: 1000Expiry: 1800Call-id: abcdefgCseq 5

server

Attacker

Worried mother

Call-id: ffffffffCseq 1

OKFrom: 1000Expiry : 0Call-id: ffffffffCseq: 1

Invite To: 1000

404 not found

Record list: 1000

Page 26: Unregister Attack in SIP - OWASP · 2020-01-17 · Voice Over Internet Protocol (VoIP) • A technology that allows phone calls to be made over the internet • Packet switching •

AttacksAttacksAttacker with traffic

knowledgeAttacker without traffic

knowledge

Permissive definitionServer without

authenticationauthenticationcall – id and cseq

verification

Server with authentication

SolutionProblem

Page 27: Unregister Attack in SIP - OWASP · 2020-01-17 · Voice Over Internet Protocol (VoIP) • A technology that allows phone calls to be made over the internet • Packet switching •

Server without authenticationAttacker with traffic knowledgeServer without authenticationAttacker with traffic knowledge

• Pre knowledge: – IP address of the victim– Phone number of the victim– IP address of the server– IP address of the server– Call-id and Cseq

• Without encryption of the packet there isno way to prevent the attack

Page 28: Unregister Attack in SIP - OWASP · 2020-01-17 · Voice Over Internet Protocol (VoIP) • A technology that allows phone calls to be made over the internet • Packet switching •

Victim phone number

1000

OKFrom: 1000Expiry: 1800Call-id: abcdefgCseq: 5

Register From: 1000Expiry: 0Call-id: abcdefg

RegisterFrom: 1000Expiry: 1800Call-id: abcdefgCseq 5

server

Attacker

Worried mother

Call-id: abcdefgCseq 6

OKFrom: 1000Expiry : 0Call-id: abcdefgCseq: 6

InviteTo: 1000

404 not found

Record list: 1000

Page 29: Unregister Attack in SIP - OWASP · 2020-01-17 · Voice Over Internet Protocol (VoIP) • A technology that allows phone calls to be made over the internet • Packet switching •

AttacksAttacks

Attacker with traffic knowledge

Attacker without traffic knowledge

Not covered in the RFCPermissive definitionServer without authentication

SOHA solution (our solution)

call – id and cseq verification

Server with authentication

SolutionProblem

Page 30: Unregister Attack in SIP - OWASP · 2020-01-17 · Voice Over Internet Protocol (VoIP) • A technology that allows phone calls to be made over the internet • Packet switching •

Server with authenticationAttacker without traffic knowledge

Server with authenticationAttacker without traffic knowledge

• No way to perform the attack

Page 31: Unregister Attack in SIP - OWASP · 2020-01-17 · Voice Over Internet Protocol (VoIP) • A technology that allows phone calls to be made over the internet • Packet switching •

Victim phone number

407 Proxy authentication required

RegisterFrom: 1000Expiry: 1800Call-id: abcdefgCseq 5

RegisterFrom: 1000Call-id: abcdefg…Cseq 6Proxy-authorization: xyzxyz…Expiry: 1800

OKFrom: 1000Expiry: 1800Call-id: abcdefgCseq: 6

phone number 1000

server

Attacker

RegisterFrom: 1000Expiry: 0Call-id: ffffffffCseq 1Proxy-authorization: fgkhlfdkfkd…

Cseq: 6

407 Proxy authentication required

Record list: 1000

Worried mother

Invite To: 1000

OK

Page 32: Unregister Attack in SIP - OWASP · 2020-01-17 · Voice Over Internet Protocol (VoIP) • A technology that allows phone calls to be made over the internet • Packet switching •

AttacksAttacks

Attacker with traffic knowledge

Attacker without traffic knowledge

Not covered in the RFCPermissive definitionServer without authentication

SOHA solution (our solution)

call – id and cseq verification

Impossible to attack Server with authentication

------------------

SolutionProblem

Page 33: Unregister Attack in SIP - OWASP · 2020-01-17 · Voice Over Internet Protocol (VoIP) • A technology that allows phone calls to be made over the internet • Packet switching •

Server with authenticationAttacker with traffic knowledge

Server with authenticationAttacker with traffic knowledge

• Replay attack –– Attacker uses the authentication data from the

captured packet• Pre knowledge:

– IP address of the victim– IP address of the victim– Phone number of the victim– IP address of the server– Call-id and Cseq– Previous authorization field value

• Prevention– Server should ask for new authorization value for

every packet it receives

Page 34: Unregister Attack in SIP - OWASP · 2020-01-17 · Voice Over Internet Protocol (VoIP) • A technology that allows phone calls to be made over the internet • Packet switching •

Victim phone number

1000

OKFrom: 1000Expiry: 1800Call-id: abcdefgCseq:6

407 Proxy authentication required

Register From: 1000Expiry: 1800Call-id: abcdefgCseq 5

Register From: 1000Call-id: abcdefg…Cseq 6Proxy-authorization: xyzxyz…Expiry: 1800

1000

server

Attacker

Worried mother

Cseq:6

Register From: 1000Expiry: 0Call-id: abcdefgCseq 7Proxy-authorization: xyzxyz…

OKFrom: 1000Expiry : 0Call-id: abcdefgCseq: 7

Invite To: 1000

404 not found

Record list: 1000

Page 35: Unregister Attack in SIP - OWASP · 2020-01-17 · Voice Over Internet Protocol (VoIP) • A technology that allows phone calls to be made over the internet • Packet switching •

Attacks summaryAttacks summaryAttacker with traffic

knowledgeAttacker without traffic

knowledge

Not covered in the RFCPermissive definitionServer without authentication

Attacker with traffic knowledge

Attacker without traffic knowledge

Not covered in the RFCPermissive definitionServer without authentication

SOHA solution (our solution)

call – id and cseq verification

Permissive implementation

Impossible to attack Server with authentication

Zero duration nonce value------------------

SolutionProblem

SOHA solution (our solution)

call – id and cseq verification

Permissive implementation

Impossible to attack Server with authentication

Zero duration nonce value------------------

Page 36: Unregister Attack in SIP - OWASP · 2020-01-17 · Voice Over Internet Protocol (VoIP) • A technology that allows phone calls to be made over the internet • Packet switching •

• Introduction to Telephony• VoIP• SIP• SIP• Unregister Attack• SOHA Solution• Conclusion

Page 37: Unregister Attack in SIP - OWASP · 2020-01-17 · Voice Over Internet Protocol (VoIP) • A technology that allows phone calls to be made over the internet • Packet switching •

Sip One way Hash function Algorithm - SOHA

Sip One way Hash function Algorithm - SOHA

• Provides a protection from the attack of server without authentication and attacker with traffic knowledge

• Provides protection from all other attacks as well• Provides protection from all other attacks as well

• Does not require configuration changes

• Based on “first is exclusive ” rule - the first user to capture the record becomes the exclusive user

Page 38: Unregister Attack in SIP - OWASP · 2020-01-17 · Voice Over Internet Protocol (VoIP) • A technology that allows phone calls to be made over the internet • Packet switching •

SOHA (cont.)SOHA (cont.)

• Hash function –– Takes a variable-length string as the input – Produces a fixed-length value as the output.

• One way function - a function that follows the following • One way function - a function that follows the following rules:– The description of the function is known and does not

require any secret information for its operation. – H(x) => Y– Y => H(?)

Page 39: Unregister Attack in SIP - OWASP · 2020-01-17 · Voice Over Internet Protocol (VoIP) • A technology that allows phone calls to be made over the internet • Packet switching •

n,x – random numbers

h(h(h(h(..h(x))..)= z

z’ = h(h(h(h(..h(x))..)

User

OKX-soha

RegisterX-hash-authenticate: z

n times

n-1 times

h – one way hash function

User

serverIf h(z’) = z OKX-soha

If h(z’) != z RejectX-soha

Record list:1000,

Z

Register/InviteX-hash-authenticate: z’

Record list:1000,

Z’

Page 40: Unregister Attack in SIP - OWASP · 2020-01-17 · Voice Over Internet Protocol (VoIP) • A technology that allows phone calls to be made over the internet • Packet switching •

When n is close to zero or upon user’s choice user reset z value by adding x-hash-reset to x-hash-authenticate

Register/InviteX-hash-authenticate: z’X-hash-reset : new value

User

server

OKX-soha

Record list:1000, new valRecord list:

1000, Z

Page 41: Unregister Attack in SIP - OWASP · 2020-01-17 · Voice Over Internet Protocol (VoIP) • A technology that allows phone calls to be made over the internet • Packet switching •

SOHA (cont.)SOHA (cont.)

• Does not verify the identity of the user

• Ensures that a correctly registered user will not be removed from the server by the will not be removed from the server by the attacker

Page 42: Unregister Attack in SIP - OWASP · 2020-01-17 · Voice Over Internet Protocol (VoIP) • A technology that allows phone calls to be made over the internet • Packet switching •

SOHA (cont.)SOHA (cont.)

• Fully backward compatible• Requires an addition of header fields (supported

by SIP RFC):– x-hash-authenticate – used by the client.– x-hash-authenticate – used by the client.– x-hash-reset – used by the client.– x-soha – used by the server to indicate it

supports SOHA• SOHA similar to one time key password (RFC

2289)

Page 43: Unregister Attack in SIP - OWASP · 2020-01-17 · Voice Over Internet Protocol (VoIP) • A technology that allows phone calls to be made over the internet • Packet switching •

• Introduction to Telephony• VoIP• SIP• SIP• Unregister Attack• SOHA Solution• Conclusion

Page 44: Unregister Attack in SIP - OWASP · 2020-01-17 · Voice Over Internet Protocol (VoIP) • A technology that allows phone calls to be made over the internet • Packet switching •

ConclusionConclusion

• With advancement of telephony comes a new set of possible attacks

• The attacks are either on VoIP protocols • The attacks are either on VoIP protocols or on supplementary protocols (UDP,DNS etc)

Page 45: Unregister Attack in SIP - OWASP · 2020-01-17 · Voice Over Internet Protocol (VoIP) • A technology that allows phone calls to be made over the internet • Packet switching •

Conclusion (cont.)Conclusion (cont.)

• Some of the attacks can be prevented with strict implementation of the RFC

• It is worth considering changing some of the RFC requirements from SHOULD to MUST to RFC requirements from SHOULD to MUST to prevent possible attacks

• The consequence of implementing a SHOULD mechanism is not clear– non authentication in the server =>

unregister attack

Page 46: Unregister Attack in SIP - OWASP · 2020-01-17 · Voice Over Internet Protocol (VoIP) • A technology that allows phone calls to be made over the internet • Packet switching •

Questions? Questions?