Hacking Voip Takes a Dual Approach to Voip and Home Voip Solutions Like Yahoo! and Security, Explaining Its Many Security Holes to Vonage Hackers and Administrators
Total Page:16
File Type:pdf, Size:1020Kb
HA “I CaN HEAR YOU NOW.” HACKING CKIN VoIP HIMANSHU PROTOCOLS, ATTACKS, AND COUNTERMEASURES DWIVEDI G Voice over Internet Protocol (VoIP) networks security assessment tools, the inherent vulner- abilities of common hardware and software have freed users from the tyranny of big telecom, V allowing people to make phone calls over the packages, and how to: Internet at very low or no cost. But while VoIP is o > Identify and defend against VoIP security easy and cheap, it’s notoriously lacking in secu- I attacks such as eavesdropping, audio injection, rity. With minimal effort, hackers can eavesdrop P caller ID spoofing, and VoIP phishing on conversations, disrupt phone calls, change > Audit VoIP network security caller IDs, insert unwanted audio into existing > Assess the security of enterprise-level VoIP phone calls, and access sensitive information. networks such as Cisco, Avaya, and Asterisk, Hacking VoIP takes a dual approach to VoIP and home VoIP solutions like Yahoo! and security, explaining its many security holes to Vonage hackers and administrators. If you’re serious > Use common VoIP protocols like H.323, SIP, about security, and you either use or administer and RTP as well as unique protocols like IAX VoIP, you should know where VoIP’s biggest > Identify the many vulnerabilities in any VoIP weaknesses lie and how to shore up your security. network And if your intellectual curiosity is leading you to explore the boundaries of VoIP, Hacking VoIP is Whether you’re setting up and defending your your map and guidebook. VoIP network against attacks or just having sick Hacking VoIP will introduce you to every aspect fun testing the limits of VoIP networks, Hacking of VoIP security, both in home and enterprise VoIP is your go-to source for every aspect of VoIP implementations. You’ll learn about popular security and defense. HIMANSHU DWIVEDI is a leading security expert and researcher. He has written four additional books, Hacking Exposed: Web 2.0 (McGraw-Hill), Securing Storage (Addison Wesley), Hacker’s Challenge 3 (McGraw-Hill), and Implementing SSH (Wiley). A founder of iSEC Partners, Dwivedi manages iSEC’s product development and engineering, specialized security solutions, and the creation of security testing tools for customers. DWIVEDI THE FINEST IN GEEK ENTERTAINMENT™ www.nostarch.com $44.95 ($44.95 CDN) SHELVE IN: NETWORKING/SECURITY ISBN: 978-1-59327-163-3 5 4495 9 781593 271633 6 89145 71638 2 HACKING VOIP San Francisco HACKING VOIP. Copyright © 2009 by Himanshu Dwivedi. All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the publisher. 12 11 10 09 08 1 2 3 4 5 6 7 8 9 ISBN-10: 1-59327-163-8 ISBN-13: 978-1-59327-163-3 Publisher: William Pollock Production Editor: Megan Dunchak Cover Design: Octopod Studios Developmental Editors: William Pollock and Adam Wright Technical Reviewer: Zane Lackey Copyeditor: Eric Newman Compositors: Riley Hoffman and Kathleen Mish Proofreader: Gabriella West Indexer: Nancy Guenther For information on book distributors or translations, please contact No Starch Press, Inc. directly: No Starch Press, Inc. 555 De Haro Street, Suite 250, San Francisco, CA 94107 phone: 415.863.9900; fax: 415.863.9950; [email protected]; www.nostarch.com Library of Congress Cataloging-in-Publication Data: Dwivedi, Himanshu. Hacking VoIP : protocols, attacks, and countermeasures / Himanshu Dwivedi. p. cm. Includes index. ISBN-13: 978-1-59327-163-3 ISBN-10: 1-59327-163-8 1. Internet telephony--Security measures. 2. Computer networks--Security measures. I. Title. TK5105.8865.P37 2009 004.69'5--dc22 2008038559 No Starch Press and the No Starch Press logo are registered trademarks of No Starch Press, Inc. Other product and company names mentioned herein may be the trademarks of their respective owners. Rather than use a trademark symbol with every occurrence of a trademarked name, we are using the names only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. The information in this book is distributed on an “As Is” basis, without warranty. While every precaution has been taken in the preparation of this work, neither the author nor No Starch Press, Inc. shall have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in it. This book is FOR MY DAD, quite simply the best human being I have ever met. This book is dedicated to my family, specifically: My daughter, Sonia Raina Dwivedi, for her smiles, laughs, persistence, flexibility, inflexibility, vocabulary, and the ability to make everybody around her happy. My son, whose presence brings more happiness to everyone around him. My wife, Kusum Pandey, who simply makes it all worthwhile . and then some! BRIEF CONTENTS Acknowledgments ........................................................................................................ xiii Introduction ....................................................................................................................1 Chapter 1: An Introduction to VoIP Security ........................................................................7 PART I: VOIP PROTOCOLS Chapter 2: Signaling: SIP Security...................................................................................19 Chapter 3: Signaling: H.323 Security..............................................................................49 Chapter 4: Media: RTP Security ......................................................................................73 Chapter 5: Signaling and Media: IAX Security .................................................................93 PART II: VOIP SECURITY THREATS Chapter 6: Attacking VoIP Infrastructure.........................................................................113 Chapter 7: Unconventional VoIP Security Threats ............................................................131 Chapter 8: Home VoIP Solutions ...................................................................................153 PART III: ASSESS AND SECURE VOIP Chapter 9: Securing VoIP.............................................................................................179 Chapter 10: Auditing VoIP for Security Best Practices ......................................................189 Index .........................................................................................................................199 CONTENTS IN DETAIL ACKNOWLEDGMENTS xiii INTRODUCTION 1 Book Overview ........................................................................................................ 1 Lab Setup ................................................................................................................ 3 SIP/IAX/H.323 Server ................................................................................. 4 SIP Setup .................................................................................................... 5 H.323 Setup (Ekiga) .................................................................................... 5 IAX Setup ................................................................................................... 5 1 AN INTRODUCTION TO VOIP SECURITY 7 Why VoIP ............................................................................................................... 8 VoIP Basics .............................................................................................................. 9 How It Works ............................................................................................. 9 Protocols .................................................................................................... 9 Deployments ............................................................................................. 11 VoIP Security Basics ................................................................................................ 13 Authentication ........................................................................................... 13 Authorization ............................................................................................ 14 Availability ............................................................................................... 14 Encryption ................................................................................................ 15 Attack Vectors ........................................................................................................ 15 Summary ............................................................................................................... 16 PART I VOIP PROTOCOLS 2 SIGNALING: SIP SECURITY 19 SIP Basics .............................................................................................................. 20 SIP Messages ........................................................................................................ 21 Making a VoIP Call with SIP Methods ....................................................................... 22 Registration .............................................................................................. 22 The INVITE Request ................................................................................... 23 Enumeration and Registration .................................................................................