VOIP Hacking
VOIP Hacking
VOIP Hacking
VOIP Hacking
(What is VOIP and How to Hack VOIP
Services)
19.02.2022
Okan YILDIZ
Senior Security Engineer / Senior Software Developer
| CASE .NET | CEH | CTIA | ECIH | CCISO |
Okan YILDIZ | CASE .NET | CEH | CTIA | ECIH | CCISO | [email protected] Senior Security Engineer / Senior Software Developer
Secure Debug Limited / [email protected] 17 Green Lanes, London, England, N16 9BS
Okan YILDIZ | CASE .NET | CEH | CTIA | ECIH | CCISO | [email protected] Senior Security Engineer / Senior Software Developer
Secure Debug Limited / [email protected] 17 Green Lanes, London, England, N16 9BS
The process works similarly to a regular phone, but VoIP uses an internet
connection instead of a telephone company's wiring. VoIP is enabled by a
group of technologies and methodologies to deliver voice communications
over the internet, including enterprise local area networks or wide area
networks.
A VoIP service will convert a user's voice from audio signals to digital data
and then send that data through the internet. If another user calls from a
regular phone number, the signal is converted back to a telephone signal
before reaching that user.
VoIP can also route incoming and outgoing calls through existing telephone
networks. However, some VoIP services may only work over a computer or
VoIP phone.
Okan YILDIZ | CASE .NET | CEH | CTIA | ECIH | CCISO | [email protected] Senior Security Engineer / Senior Software Developer
Secure Debug Limited / [email protected] 17 Green Lanes, London, England, N16 9BS
VoIP creates this network by allowing users to make calls and hold web
conferences using devices like computers, smartphones or other mobile
devices.
● audio calls;
● video calls;
● voicemail;
● instant messaging;
● team chats;
● e-mail;
● SMS texts;
● mobile and desktop apps; and
● mobile and local number portability (allows a subscriber to choose
a new telephone carrier without needing a new number).
Okan YILDIZ | CASE .NET | CEH | CTIA | ECIH | CCISO | [email protected] Senior Security Engineer / Senior Software Developer
Secure Debug Limited / [email protected] 17 Green Lanes, London, England, N16 9BS
Okan YILDIZ | CASE .NET | CEH | CTIA | ECIH | CCISO | [email protected] Senior Security Engineer / Senior Software Developer
Secure Debug Limited / [email protected] 17 Green Lanes, London, England, N16 9BS
Okan YILDIZ | CASE .NET | CEH | CTIA | ECIH | CCISO | [email protected] Senior Security Engineer / Senior Software Developer
Secure Debug Limited / [email protected] 17 Green Lanes, London, England, N16 9BS
Okan YILDIZ | CASE .NET | CEH | CTIA | ECIH | CCISO | [email protected] Senior Security Engineer / Senior Software Developer
Secure Debug Limited / [email protected] 17 Green Lanes, London, England, N16 9BS
Okan YILDIZ | CASE .NET | CEH | CTIA | ECIH | CCISO | [email protected] Senior Security Engineer / Senior Software Developer
Secure Debug Limited / [email protected] 17 Green Lanes, London, England, N16 9BS
Okan YILDIZ | CASE .NET | CEH | CTIA | ECIH | CCISO | [email protected] Senior Security Engineer / Senior Software Developer
Secure Debug Limited / [email protected] 17 Green Lanes, London, England, N16 9BS
Despite these advantages, VoIP services may still come with some
disadvantages. These disadvantages include:
Okan YILDIZ | CASE .NET | CEH | CTIA | ECIH | CCISO | [email protected] Senior Security Engineer / Senior Software Developer
Secure Debug Limited / [email protected] 17 Green Lanes, London, England, N16 9BS
History of VoIP
VoIP historically referred to using internet protocols to connect private
branch exchanges (PBXs) but is now used interchangeably with IP
telephony. Paul Baran and other researchers worked on early
developments of packet network designs. In 1973, Danny Cohen was the
first to demonstrate a form of packet voice over an early ARPANET. One
year later, the first successful real-time conversation was had over
ARPANET. In 1977, UDP was added to carry real-time traffic three years
after this.
The 1990s
In 1991, the first VoIP application released was Speak Freely. A year later,
soft-launched a desktop conferencing product, Communique. Communique
notably included options for video conferences. InSoft is often credited for
creating the first generation of commercial VoIP services in the United
States.
Okan YILDIZ | CASE .NET | CEH | CTIA | ECIH | CCISO | [email protected] Senior Security Engineer / Senior Software Developer
Secure Debug Limited / [email protected] 17 Green Lanes, London, England, N16 9BS
The 2000s
Another codec, the G.729.1 protocol, was unveiled in 2006. A year after
this, VoIP device manufacturers began to expand in Asia. The SILK codec
was introduced in 2009, notable for being used for voice calling on Skype.
Before starting the pentesting process, we need to add the Viproy-VoIP kit to our
Metasploit. We need to install some dependencies. We will first update our fonts and then
install the following dependencies:
- sudo apt update && Sudo apt install -y git Autoconf build-essential libcap-dev
libpq-dev zliblg-dev libsqlite3-dev
Okan YILDIZ | CASE .NET | CEH | CTIA | ECIH | CCISO | [email protected] Senior Security Engineer / Senior Software Developer
Secure Debug Limited / [email protected] 17 Green Lanes, London, England, N16 9BS
Once all dependencies have been installed, it’s time to clone the Viproy Repository on the
Kali Linux system. This contains the modules that we need to add to our Metasploit.
Here we see that we have a lib directory, a module directory, and a kaliinstall script. Before
running the script, pentesting experts recommend manually copying the contents of the
lib directory and module directory to the lib directory and Metasploit modules,
respectively.
- cp lib/MSF/core/auxiliary/* /usr/share/Metasploit-framework/lib/MSF/core/auxiliary/
- cp modules/auxiliary/VoIP/viproy-VoIPkit*
/usr/share/Metasploit-framework/modules/auxiliary/VoIP/
- cp modules/auxiliary/spoof/cisco/viproy-VoIPkit_cdp.RB
/usr/share/Metasploit-framework/modules/auxiliary/spoof/cisco/
Okan YILDIZ | CASE .NET | CEH | CTIA | ECIH | CCISO | [email protected] Senior Security Engineer / Senior Software Developer
Secure Debug Limited / [email protected] 17 Green Lanes, London, England, N16 9BS
Now we need to register the modules we copy to the Mixins files located in
/usr/share/Metasploit-framework/lib/MSF/core/Additional/.
This can be done manually or with another text editor mentioned by pentesting experts.
Next, we clone the precompiled version of GitHub.
- cd Metasploit-framework-with-viproy/
- gem install bundler
Okan YILDIZ | CASE .NET | CEH | CTIA | ECIH | CCISO | [email protected] Senior Security Engineer / Senior Software Developer
Secure Debug Limited / [email protected] 17 Green Lanes, London, England, N16 9BS
- bundle install
It’ll take a little time. After that, we’ll have to reload the modules into Metasploit.
This completes the installation of the Viproy Toolkit, so now you can start with pentesting
on your target VoIP server. In a VoIP network, useful information can be found on VoIP
gateways or servers, IP-PBX systems, VoIP client/phone software, and user extensions.
Let’s take a look at some of the most commonly used fingerprinting and counting tools.
Using the Metasploit SIP scanner module to identify systems by providing a single IP or a range
of IP addresses, pentesting experts can scan all VoIP servers and their enabled parameters.
Okan YILDIZ | CASE .NET | CEH | CTIA | ECIH | CCISO | [email protected] Senior Security Engineer / Senior Software Developer
Secure Debug Limited / [email protected] 17 Green Lanes, London, England, N16 9BS
- use auxiliary/scanner/sip/options
- set rhosts 192.168.1.0/24
- run
Here, the scan throws a VoIP server running on 192.168.1.7. We can also see that it has a
User-Agent like "Asterisk", and we can see that it has multiple requests enabled.
It is then possible to use a brute force attack on the target server to extract your passwords. In
this example, pentesting experts created a username and password dictionary. The next step is
to define the extensions, for which it is possible to select a range from 0000000 to 99999999 and
finally launch the exploit.
- use auxiliary/VoIP/viproy_sip_bruteforce
- set rhosts 192.168.1.7
- set minext 00000000
- set maxext 99999999
- set user_file /home/kali/user.txt
- set pass_file /home/kali/pass.txt
- exploit
Okan YILDIZ | CASE .NET | CEH | CTIA | ECIH | CCISO | [email protected] Senior Security Engineer / Senior Software Developer
Secure Debug Limited / [email protected] 17 Green Lanes, London, England, N16 9BS
Here we can see that ten extensions have been extracted. We will need to ensure that the secret
created for this extension is difficult to guess and thus prevent brute force attacks.
Now it's time to go one step further and record the extensions so we can initiate calls from the
attacker's computer. We chose extension 99999999. We discovered the secret of 999. Now, all
we had to do was provide the server's IP address, extension and mystery.
As soon as we started the support device, we received a 200 OK response from the server,
which said the extension was registered with this IP address.
- use auxiliary/VoIP/viproy_sip_register
- set rhosts 192.168.1.7
- set username 99999999
- set password 999
- run
Okan YILDIZ | CASE .NET | CEH | CTIA | ECIH | CCISO | [email protected] Senior Security Engineer / Senior Software Developer
Secure Debug Limited / [email protected] 17 Green Lanes, London, England, N16 9BS
Here we need to register the software as we do not have a trunk line, PSTN line or PRI line for
outgoing calls. Therefore, we are testing the extension to invoke it.
Here we can forge the caller ID at will. According to the pentesting experts, we need to set the
login to true so we can log in to the server with secret 999. We also need to set the numeric user
to true so that it can accept numeric extensions.
- use auxiliary/VoIP/viproy_sip_invite
- set rhosts 192.168.1.7
- set to 00000000
- set from 99999999
- set login true
- set fromname hacker
- set username 99999999
- set password 999
- set numeric users true
- run
Okan YILDIZ | CASE .NET | CEH | CTIA | ECIH | CCISO | [email protected] Senior Security Engineer / Senior Software Developer
Secure Debug Limited / [email protected] 17 Green Lanes, London, England, N16 9BS
As soon as we launch the auxiliary device, we will see that there is a call from extension
999999999 to extension 00000000, which we configure in our Zoiper client. We can also see that
we have the hacker’s caller ID that we have identified on the assistive device.
We can monitor logs on the VoIP server, which contains information about all initiated,
connected, and disconnected calls. According to the pentesting experts, you can check the
default credentials. First, we will connect the server using ssh and then run the following
command to open the Asterisk console panel.
- ssh 192.168.1.7
- asterisk –rvvvvvvvvvvvvvvv
Okan YILDIZ | CASE .NET | CEH | CTIA | ECIH | CCISO | [email protected] Senior Security Engineer / Senior Software Developer
Secure Debug Limited / [email protected] 17 Green Lanes, London, England, N16 9BS
When users initiate a phone call, hackers or researchers could monitor intercepted SIP traffic
using Wireshark. To do this, start Wireshark and select the network adapter on which the VoIP
server is running, and then we begin capturing packets. If you pay more attention, you will see a
tab in the Wireshark menu called "Telephony". The drop-down menu has the first option, VoIP
Calls.
Okan YILDIZ | CASE .NET | CEH | CTIA | ECIH | CCISO | [email protected] Senior Security Engineer / Senior Software Developer
Secure Debug Limited / [email protected] 17 Green Lanes, London, England, N16 9BS
As soon as we click on VoIP calls, a window will open with all intercepted calls while listening.
We see a sequence of packets from one IP address to another.
Okan YILDIZ | CASE .NET | CEH | CTIA | ECIH | CCISO | [email protected] Senior Security Engineer / Senior Software Developer
Secure Debug Limited / [email protected] 17 Green Lanes, London, England, N16 9BS
If we click the "Flow Sequence" button below, we can see the SIP handshakes we learned in the
introduction. There are multiple SIP transactions in the SIP call flow. A SIP transaction consists
of multiple requests and responses. To group them into a transaction, use the parameter CSeq:
103.
The first is to register the extension. After renewal, the log matches the session settings. Since
extension 99999999, the session consists of an INVITE request from the user to 00000000.
Immediately, the proxy sends TRYING 100 to stop transmission and redirect the request to
extension 00000000.
Okan YILDIZ | CASE .NET | CEH | CTIA | ECIH | CCISO | [email protected] Senior Security Engineer / Senior Software Developer
Secure Debug Limited / [email protected] 17 Green Lanes, London, England, N16 9BS
Extension 00000000 sends a 180 ring when the phone starts ringing and also redirects the proxy
to user A. Finally, an OK 200 message follows the receiving process (extension 000000000
answers the call). After calling the call server, try assigning the RTP ports, and the RTP transport
will start with the SDP configuration (ports, addresses, codecs, etc.). The last transaction
corresponds to the end of the session. This is only done with a BYE request to the proxy and
then redirected to extension 00000000.
The given user responds with an OK 200 message to confirm that the last message was
received successfully. The call was initiated by a user named hacker with extension 99999999 to
extension 00000000. The duration of the ring and the current state can be seen in the previous
example. Wireshark collected call packets, and now we can hear the whole call. After
disconnecting, we reproduce all the conversions of the phone call.
Okan YILDIZ | CASE .NET | CEH | CTIA | ECIH | CCISO | [email protected] Senior Security Engineer / Senior Software Developer
Secure Debug Limited / [email protected] 17 Green Lanes, London, England, N16 9BS
When we press the "Play Sequences" button, the output device is requested according to your
laptop driver. Then we can click the Play button and listen to the conversation during this VoIP
call.
Okan YILDIZ | CASE .NET | CEH | CTIA | ECIH | CCISO | [email protected] Senior Security Engineer / Senior Software Developer
Secure Debug Limited / [email protected] 17 Green Lanes, London, England, N16 9BS
Our Services:
Vision and Mission: At Secure Debug Limited, our mission is to utilize the latest
technologies and best practices to protect our clients' digital assets and provide a
Okan YILDIZ | CASE .NET | CEH | CTIA | ECIH | CCISO | [email protected] Senior Security Engineer / Senior Software Developer
Secure Debug Limited / [email protected] 17 Green Lanes, London, England, N16 9BS
Technological Innovations:
Contact Information:
Our Founder and Leader: Okan YILDIZ, Senior Security Engineer / Software
Developer, is the founder and leader of Secure Debug Limited. Okan YILDIZ holds
several prestigious certifications, including CASE .NET, CEH, CTIA, ECIH, and
CCISO, and possesses extensive expertise in cybersecurity.
References: Secure Debug Limited serves a diverse range of clients across various
sectors, including finance, healthcare, energy, and government. Our successful
projects and high customer satisfaction rates have established us as a trusted
partner in cybersecurity.
Okan YILDIZ | CASE .NET | CEH | CTIA | ECIH | CCISO | [email protected] Senior Security Engineer / Senior Software Developer