Dataset Preview
Full Screen
The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
The dataset generation failed
Error code:   DatasetGenerationError
Exception:    TypeError
Message:      Couldn't cast array of type
list<item: struct<page_number: int64, text: string>>
to
{'page_number': Value(dtype='int64', id=None), 'text': Value(dtype='string', id=None)}
Traceback:    Traceback (most recent call last):
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1870, in _prepare_split_single
                  writer.write_table(table)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/arrow_writer.py", line 622, in write_table
                  pa_table = table_cast(pa_table, self._schema)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2292, in table_cast
                  return cast_table_to_schema(table, schema)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2245, in cast_table_to_schema
                  arrays = [
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2246, in <listcomp>
                  cast_array_to_feature(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 1795, in wrapper
                  return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 1795, in <listcomp>
                  return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2108, in cast_array_to_feature
                  raise TypeError(f"Couldn't cast array of type\n{_short_str(array.type)}\nto\n{_short_str(feature)}")
              TypeError: Couldn't cast array of type
              list<item: struct<page_number: int64, text: string>>
              to
              {'page_number': Value(dtype='int64', id=None), 'text': Value(dtype='string', id=None)}
              
              The above exception was the direct cause of the following exception:
              
              Traceback (most recent call last):
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1417, in compute_config_parquet_and_info_response
                  parquet_operations = convert_to_parquet(builder)
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1049, in convert_to_parquet
                  builder.download_and_prepare(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 924, in download_and_prepare
                  self._download_and_prepare(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1000, in _download_and_prepare
                  self._prepare_split(split_generator, **prepare_split_kwargs)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1741, in _prepare_split
                  for job_id, done, content in self._prepare_split_single(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1897, in _prepare_split_single
                  raise DatasetGenerationError("An error occurred while generating the dataset") from e
              datasets.exceptions.DatasetGenerationError: An error occurred while generating the dataset

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

pages
dict
{ "page_number": 1, "text": "" }
{ "page_number": 2, "text": "Kali Linux – Assuring Security \nby Penetration Testing\nMaster the art of penetration testing with Kali Linux\nLee Allen\nTedi Heriyanto\nShakeel Ali\n BIRMINGHAM - MUMBAI\n" }
{ "page_number": 3, "text": "[ FM-2 ]\nKali Linux – Assuring Security by Penetration Testing\nCopyright © 2014 Packt Publishing\nAll rights reserved. No part of this book may be reproduced, stored in a retrieval \nsystem, or transmitted in any form or by any means, without the prior written \npermission of the publisher, except in the case of brief quotations embedded in \ncritical articles or reviews.\nEvery effort has been made in the preparation of this book to ensure the accuracy \nof the information presented. However, the information contained in this book is \nsold without warranty, either express or implied. Neither the authors, nor Packt \nPublishing, and its dealers and distributors will be held liable for any damages \ncaused or alleged to be caused directly or indirectly by this book.\nPackt Publishing has endeavored to provide trademark information about all of the \ncompanies and products mentioned in this book by the appropriate use of capitals. \nHowever, Packt Publishing cannot guarantee the accuracy of this information.\nFirst published: April 2011\nSecond Edition: April 2014\nProduction Reference: 2310314\nPublished by Packt Publishing Ltd.\nLivery Place\n35 Livery Street\nBirmingham B3 2PB, UK.\nISBN 978-1-84951-948-9\nwww.packtpub.com\nCover Image by Riady Santoso (dzign.art@gmail.com)\n" }
{ "page_number": 4, "text": "[ FM-3 ]\nCredits\nAuthors\nLee Allen\nTedi Heriyanto\nShakeel Ali\nReviewers\nAlex Gkiouros\nNeil Jones\nAcquisition Editors\nHarsha Bharwani\nUsha Iyer\nRubal Kaur\nContent Development Editor\nSweny M. Sukumaran\nTechnical Editors\nMrunal Chavan\nPankaj Kadam\nGaurav Thingalaya\nCopy Editors\nJanbal Dharmaraj\nDipti Kapadia\nSayanee Mukherjee\nStuti Srivastava\nProject Coordinator\nSanchita Mandal\nProofreaders\nSimran Bhogal\nMaria Gould\nPaul Hindle\nIndexer\nHemangini Bari\nGraphics\nYuvraj Mannari\nAbhinash Sahu\nProduction Coordinator\nAlwin Roy\nCover Work\nAlwin Roy\n" }
{ "page_number": 5, "text": "[ FM-4 ]\nAbout the Authors\nLee Allen is currently working as a security architect at a prominent university. \nThroughout the years, he has continued his attempts to remain up to date with \nthe latest and greatest developments in the security industry and the security \ncommunity. He has several industry certifications including the OSWP and has been \nworking in the IT industry for over 15 years.\nLee Allen is the author of Advanced Penetration Testing for Highly-Secured \nEnvironments: The Ultimate Security Guide, Packt Publishing.\nI would like to thank my wife, Kellie, and our children for allowing \nme to give the time I needed to work on this book. I would also \nlike to thank my grandparents, Raymond and Ruth Johnson, and \nmy wife's parents, George and Helen Slocum. I appreciate your \nencouragement and support throughout the years.\n" }
{ "page_number": 6, "text": "[ FM-5 ]\nTedi Heriyanto currently works as a principal consultant in an Indonesian \ninformation security company. In his current role, he has been engaged with various \npenetration testing assignments in Indonesia and other countries. In his previous \nrole, he was engaged with several well-known business institutions across Indonesia \nand overseas. Tedi has an excellent track record in designing secure network \narchitecture, deploying and managing enterprise-wide security systems, developing \ninformation security policies and procedures, performing information security audits \nand assessments, and providing information security awareness training. In his \nspare time, he manages to research, learn, and participate in the Indonesian Security \nCommunity activities and has a blog http://theriyanto.wordpress.com. \nHe shares his knowledge in the security field by writing several information \nsecurity books.\nI would like to thank my family for supporting me during the whole \nbook-writing process. I would also like to thank my boss for trusting, \nhelping, and supporting me in my work. I would like to thank \nmy colleagues and customers for the great learning environment. \nThanks to the great people at Packt Publishing: Rubal Kaur, Sweny \nSukumaran, Joel Goveya, Usha Iyer, and Abhijit Suvarna, whose \ncomments, feedbacks, and support made this book development \nproject successful. Thanks to the technical reviewers, Alex Gkiouros \nand Neil Jones, who have provided their expertise, time, efforts, \nand experiences in reviewing the book's content. Last but not least, \nI would like to give my biggest thanks to the co-authors, Lee Allen \nand Shakeel Ali, whose technical knowledge, motivation, ideas, \nchallenges, questions, and suggestions made this book-writing \nprocess a wonderful journey. \n \nFinally, I would like to thank you for buying this book. I hope you \nenjoy reading the book as I enjoyed writing it. I wish you good luck \nin your information security endeavor.\n" }
{ "page_number": 7, "text": "[ FM-6 ]\nShakeel Ali is a Security and Risk Management consultant at Fortune 500. \nPreviously, he was the key founder of Cipher Storm Ltd., UK. His expertise in the \nsecurity industry markedly exceeds the standard number of security assessments, \naudits, compliance, governance, and forensic projects that he carries out in day-to-day \noperations. He has also served as a Chief Security Officer at CSS Providers SAL. As a \nsenior security evangelist and having spent endless nights without taking a nap, he \nprovides constant security support to various businesses, educational organizations, \nand government institutions globally. He is an active, independent researcher who \nwrites various articles and whitepapers and manages a blog at Ethical-Hacker.net. \nAlso, he regularly participates in BugCon Security Conferences held in Mexico, \nto highlight the best-of-breed cyber security threats and their solutions from \npractically driven countermeasures.\nI would like to thank all my friends, reviewers, and colleagues \nwho were cordially involved in this book project. Special thanks \nto the entire Packt Publishing team and their technical editors and \nreviewers, who have given invaluable comments, suggestions, \nfeedbacks, and support to make this project successful. I also want \nto thank my co-authors, Lee Allen and Tedi Heriyanto, whose \ncontinual dedication, contributions, ideas, and technical discussions \nled to the production of such a useful product you see today. Last \nbut not least, thanks to my pals from past and present with whom \nthe sudden discovery never ends and their vigilant eyes that turn \nthe IT industry into a secure and stable environment.\n" }
{ "page_number": 8, "text": "[ FM-7 ]\nAbout the Reviewers\nAlex Gkiouros is currently an independent IT professional who's been assigned \nvarious projects around Greece and has been working in the IT industry since 2006. \nHe holds two entry-level ISACA certifications, and he's studying for his CCNP. He \nis so passionate about what he does that he spends an inordinate amount of time in \nthe network security area, especially pentesting with Kali Linux or Backtrack. His \npersonal website or blog can be found at http://www.voovode.net/.\nNeil Jones is a security consultant, working for a global security company based \nin the UK. His goal was to work in the security industry from a young age and now \nhe has achieved that goal, while gaining multiple industry-recognized security \ncertifications along the way.\nHe eats, sleeps, and breathes security and is actively involved in security research to \nadvance his knowledge and to develop new open source tools in order to benefit the \nsecurity community.\n" }
{ "page_number": 9, "text": "[ FM-8 ]\nwww.PacktPub.com\nSupport files, eBooks, discount offers and more\nYou might want to visit www.PacktPub.com for support files and downloads related \nto your book. \nDid you know that Packt offers eBook versions of every book published, with PDF \nand ePub files available? You can upgrade to the eBook version at www.PacktPub.\ncom and as a print book customer, you are entitled to a discount on the eBook copy. \nGet in touch with us at service@packtpub.com for more details.\nAt www.PacktPub.com, you can also read a collection of free technical articles, sign \nup for a range of free newsletters and receive exclusive discounts and offers on Packt \nbooks and eBooks.\nTM\nhttp://PacktLib.PacktPub.com \nDo you need instant solutions to your IT questions? PacktLib is Packt's online digital \nbook library. Here, you can access, read and search across Packt's entire library of \nbooks. \nWhy Subscribe?\n•\t\nFully searchable across every book published by Packt\n•\t\nCopy and paste, print and bookmark content\n•\t\nOn demand and accessible via web browser\nFree Access for Packt account holders\nIf you have an account with Packt at www.PacktPub.com, you can use this to access \nPacktLib today and view nine entirely free books. Simply use your login credentials \nfor immediate access.\n" }
{ "page_number": 10, "text": "[ FM-9 ]\nDisclaimer\nThe content within this book is for educational purposes only. It is designed to help \nusers test their own system against information security threats and protect their IT \ninfrastructure from similar attacks. Packt Publishing and the authors of this book \ntake no responsibility for actions resulting from the inappropriate usage of learning \nmaterials contained within this book.\n" }
{ "page_number": 11, "text": "" }
{ "page_number": 12, "text": "[ FM-11 ]\nI would like to dedicate this book to my loving family for their kind support \nthroughout the years, especially to my niece, Jennifer, and nephews, Adan and \nJason, whose smiles are an inspiration and encouragement in my life; to my \nbrilliant teachers, the ones who turned an ordinary child into this superior, \nexcellent, and extraordinary individual; and to all my friends and colleagues, \nAmreeta Poran, Li Xiang, Fazza3, Sheikha Maitha, Touraj, Armin, Mada, Rafael, \nKhaldoun, Niel, Oscar, Serhat, Kenan, Michael, Ursina, Nic, Nicole, Andreina, \nAmin, Pedro, Juzer, Ronak, Cornel, Marco, Selin, Jenna, Yvonne, Cynthia, May, \nCorinne, Stefanie, Rio, Jannik, Carmen, Gul Naz, Stella, Patricia, Mikka, Julian, \nSnow, Matt, Sukhi, Tristan, Srajna, Padmanabhan, Radhika, Gaurav, Eljean \nDesamparado, Akeela, Naveed, Asif, Salman, and all those whom I have forgotten \nto mention here.\n - Shakeel Ali\nI would like to dedicate this book to God for the amazing gifts that have been given \nto me; to my beloved family for their support; to my wonderful teachers for being so \npatient in teaching me; to my best friends and colleagues for helping me out during \nthe years; to my excellent clients for trusting in me and giving me the chance to \nwork with you; to you, the reader, for buying this book and e-book.\n - Tedi Heriyanto\nI would like to dedicate this book to those of you that have provided the security \nindustry with the tools that empower us, the research that enlightens us, and the \nfriendships that sustain us.\n - Lee Allen\n" }
{ "page_number": 13, "text": "" }
{ "page_number": 14, "text": "Table of Contents\nPreface\t\n1\nPART I: Lab Preparation and Testing Procedures\nChapter 1: Beginning with Kali Linux\t\n9\nA brief history of Kali Linux\t\n9\nKali Linux tool categories\t\n10\nDownloading Kali Linux\t\n12\nUsing Kali Linux\t\n14\nRunning Kali using Live DVD\t\n14\nInstalling Kali on a hard disk\t\n15\nInstalling Kali on a physical machine\t\n15\nInstalling Kali on a virtual machine\t\n19\nInstalling Kali on a USB disk\t\n26\nConfiguring the virtual machine\t\n28\nVirtualBox guest additions\t\n28\nSetting up networking \t\n30\nSetting up a wired connection\t\n31\nSetting up a wireless connection\t\n32\nStarting the network service\t\n33\nConfiguring shared folders\t\n34\nSaving the guest machine state\t\n35\nExporting a virtual machine\t\n36\nUpdating Kali Linux\t\n37\nNetwork services in Kali Linux\t\n39\nHTTP\t\n39\nMySQL\t\n40\nSSH\t\n42\nInstalling a vulnerable server\t\n43\n" }
{ "page_number": 15, "text": "Table of Contents\n[ ii ]\nInstalling additional weapons\t\n45\nInstalling the Nessus vulnerability scanner\t\n47\nInstalling the Cisco password cracker\t\n49\nSummary\t\n49\nChapter 2: Penetration Testing Methodology\t\n51\nTypes of penetration testing\t\n52\nBlack box testing\t\n52\nWhite box testing\t\n53\nVulnerability assessment versus penetration testing\t\n53\nSecurity testing methodologies\t\n54\nOpen Source Security Testing Methodology Manual (OSSTMM)\t\n56\nKey features and benefits\t\n57\nInformation Systems Security Assessment Framework (ISSAF)\t\n58\nKey features and benefits\t\n59\nOpen Web Application Security Project (OWASP) \t\n60\nKey features and benefits\t\n60\nWeb Application Security Consortium Threat Classification (WASC-TC)\t\n61\nKey features and benefits\t\n62\nPenetration Testing Execution Standard (PTES)\t\n63\nKey features and benefits\t\n64\nGeneral penetration testing framework\t\n64\nTarget scoping\t\n65\nInformation gathering\t\n65\nTarget discovery\t\n66\nEnumerating target\t\n66\nVulnerability mapping\t\n67\nSocial engineering\t\n67\nTarget exploitation\t\n67\nPrivilege escalation\t\n68\nMaintaining access\t\n68\nDocumentation and reporting\t\n68\nThe ethics\t\n69\nSummary\t\n70\nPART II: Penetration Testers Armory\nChapter 3: Target Scoping\t\n73\nGathering client requirements\t\n74\nCreating the customer requirements form\t\n75\nThe deliverables assessment form\t\n76\nPreparing the test plan\t\n76\nThe test plan checklist\t\n78\n" }
{ "page_number": 16, "text": "Table of Contents\n[ iii ]\nProfiling test boundaries\t\n79\nDefining business objectives\t\n80\nProject management and scheduling\t\n81\nSummary\t\n82\nChapter 4: Information Gathering\t\n85\nUsing public resources\t\n86\nQuerying the domain registration information\t\n87\nAnalyzing the DNS records\t\n89\nhost\t\n90\ndig\t\n92\ndnsenum\t\n94\ndnsdict6\t\n97\nfierce\t\n98\nDMitry\t\n100\nMaltego\t\n102\nGetting network routing information\t\n110\ntcptraceroute\t\n110\ntctrace\t\n112\nUtilizing the search engine\t\n112\ntheharvester\t\n113\nMetagoofil\t\n114\nSummary\t\n118\nChapter 5: Target Discovery\t\n119\nStarting off with target discovery\t\n119\nIdentifying the target machine\t\n120\nping\t\n120\narping\t\n123\nfping\t\n124\nhping3\t\n127\nnping\t\n130\nalive6\t\n132\ndetect-new-ip6\t\n133\npassive_discovery6\t\n134\nnbtscan\t\n134\nOS fingerprinting\t\n136\np0f\t\n137\nNmap\t\n140\nSummary\t\n141\n" }
{ "page_number": 17, "text": "Table of Contents\n[ iv ]\nChapter 6: Enumerating Target\t\n143\nIntroducing port scanning\t\n143\nUnderstanding the TCP/IP protocol\t\n144\nUnderstanding the TCP and UDP message format\t\n146\nThe network scanner\t\n149\nNmap\t\n150\nNmap target specification\t\n153\nNmap TCP scan options\t\n155\nNmap UDP scan options\t\n156\nNmap port specification\t\n157\nNmap output options\t\n159\nNmap timing options\t\n161\nNmap useful options\t\n162\nNmap for scanning the IPv6 target\t\n165\nThe Nmap scripting engine\t\n166\nNmap options for Firewall/IDS evasion\t\n172\nUnicornscan\t\n173\nZenmap\t\n175\nAmap\t\n179\nSMB enumeration\t\n180\nSNMP enumeration\t\n181\nonesixtyone\t\n182\nsnmpcheck\t\n183\nVPN enumeration\t\n184\nike-scan\t\n184\nSummary\t\n188\nChapter 7: Vulnerability Mapping\t\n189\nTypes of vulnerabilities\t\n190\nLocal vulnerability\t\n191\nRemote vulnerability\t\n191\nVulnerability taxonomy\t\n192\nOpen Vulnerability Assessment System (OpenVAS)\t\n193\nTools used by OpenVAS\t\n194\nCisco analysis\t\n197\nCisco auditing tool\t\n198\nCisco global exploiter\t\n199\nFuzz analysis\t\n201\nBED\t\n201\nJBroFuzz\t\n203\nSMB analysis\t\n205\nImpacket Samrdump\t\n206\n" }
{ "page_number": 18, "text": "Table of Contents\n[ v ]\nSNMP analysis\t\n207\nSNMP Walk\t\n208\nWeb application analysis\t\n210\nDatabase assessment tools\t\n211\nDBPwAudit\t\n211\nSQLMap\t\n213\nSQL Ninja\t\n217\nWeb application assessment \t\n220\nBurp Suite\t\n220\nNikto2\t\n223\nParos proxy\t\n225\nW3AF\t\n226\nWafW00f\t\n228\nWebScarab\t\n229\nSummary\t\n231\nChapter 8: Social Engineering\t\n233\nModeling the human psychology\t\n234\nAttack process\t\n234\nAttack methods\t\n235\nImpersonation\t\n236\nReciprocation\t\n236\nInfluential authority\t\n237\nScarcity\t\n237\nSocial relationship\t\n238\nSocial Engineering Toolkit (SET)\t\n238\nTargeted phishing attack\t\n240\nSummary\t\n244\nChapter 9: Target Exploitation\t\n245\nVulnerability research\t\n246\nVulnerability and exploit repositories\t\n247\nAdvanced exploitation toolkit\t\n249\nMSFConsole\t\n250\nMSFCLI\t\n252\nNinja 101 drills\t\n253\nScenario 1\t\n254\nScenario 2\t\n255\nScenario 3\t\n261\nScenario 4\t\n270\nWriting exploit modules\t\n275\nSummary\t\n281\n" }
{ "page_number": 19, "text": "Table of Contents\n[ vi ]\nChapter 10: Privilege Escalation\t\n283\nPrivilege escalation using a local exploit\t\n284\nPassword attack tools\t\n287\nOffline attack tools\t\n289\nhash-identifier\t\n289\nHashcat\t\n290\nRainbowCrack\t\n293\nsamdump2\t\n298\nJohn\t\n299\nJohnny\t\n303\nOphcrack\t\n304\nCrunch\t\n305\nOnline attack tools\t\n307\nCeWL\t\n308\nHydra\t\n309\nMedusa\t\n312\nNetwork spoofing tools\t\n313\nDNSChef\t\n313\nSetting up a DNS proxy\t\n313\nFaking a domain\t\n314\narpspoof\t\n315\nEttercap\t\n318\nNetwork sniffers\t\n321\ndsniff\t\n322\ntcpdump\t\n323\nWireshark\t\n323\nSummary\t\n326\nChapter 11: Maintaining Access\t\n329\nUsing operating system backdoors\t\n329\nCymothoa\t\n330\nIntersect\t\n332\nThe Meterpreter backdoor\t\n336\nWorking with tunneling tools\t\n339\ndns2tcp\t\n339\niodine\t\n341\nConfiguring the DNS server \t\n341\nRunning the iodine server\t\n342\nRunning the iodine client\t\n342\nncat\t\n342\nproxychains\t\n344\nptunnel\t\n345\nsocat\t\n346\nGetting HTTP header information\t\n349\n" }
{ "page_number": 20, "text": "Table of Contents\n[ vii ]\nTransferring files\t\n349\nsslh\t\n350\nstunnel4\t\n352\nCreating web backdoors\t\n356\nWeBaCoo\t\n356\nweevely\t\n359\nPHP Meterpreter\t\n362\nSummary\t\n364\nChapter 12: Documentation and Reporting\t\n365\nDocumentation and results verification\t\n366\nTypes of reports\t\n367\nThe executive report\t\n368\nThe management report\t\n368\nThe technical report\t\n370\nNetwork penetration testing report (sample contents)\t\n371\nPreparing your presentation\t\n372\nPost-testing procedures\t\n372\nSummary\t\n374\nPART III: Extra Ammunition\nAppendix A: Supplementary Tools\t\n377\nReconnaissance tool\t\n377\nVulnerability scanner\t\n381\nNeXpose Community Edition\t\n381\nInstalling NeXpose\t\n382\nStarting the NeXpose community\t\n383\nLogging in to the NeXpose community\t\n384\nUsing the NeXpose community\t\n386\nWeb application tools\t\n389\nGolismero\t\n389\nArachni\t\n391\nBlindElephant\t\n393\nNetwork tool\t\n395\nNetcat\t\n395\nOpen connection\t\n395\nService banner grabbing\t\n396\nSimple chat server\t\n396\nFile transfer\t\n397\nPortscanning\t\n397\nBackdoor shell\t\n398\nReverse shell\t\n399\nSummary\t\n400\n" }
{ "page_number": 21, "text": "Table of Contents\n[ viii ]\nAppendix B: Key Resources\t\n401\nVulnerability disclosure and tracking\t\n401\nPaid incentive programs\t\n404\nReverse engineering resources\t\n404\nPenetration testing learning resources\t\n405\nExploit development learning resources\t\n407\nPenetration testing on a vulnerable environment\t\n407\nOnline web application challenges\t\n407\nVirtual machines and ISO images\t\n408\nNetwork ports\t\n410\nIndex\t\n413\n" }
{ "page_number": 22, "text": "Preface\nKali Linux is a penetration testing and security auditing platform with advanced \ntools to identify, detect, and exploit any vulnerabilities uncovered in the target \nnetwork environment. Applying an appropriate testing methodology equipped with \nwell-defined business objectives and a scheduled test plan will result in the robust \npenetration testing of your network.\nKali Linux – Assuring Security by Penetration Testing is a fully focused, structured \nbook that provides guidance on developing practical penetration testing skills by \ndemonstrating the cutting-edge hacker tools and techniques in a coherent step-by-step \nstrategy. It offers all the essential lab preparation and testing procedures to reflect real-\nworld attack scenarios from your business perspective in today's digital age.\nThis book reveals the industry's best approach for logical and systematic \npenetration testing process.\nThis book starts with lab preparation and testing procedures, explaining the basic \ninstallation and configuration setup, discussing different types of penetration \ntesting, uncovering open security testing methodologies, and proposing the Kali \nLinux specific testing process. We shall discuss a number of security assessment \ntools necessary to conduct penetration testing in their respective categories (target \nscoping, information gathering, discovery, enumeration, vulnerability mapping, \nsocial engineering, exploitation, privilege escalation, maintaining access, and \nreporting), following the formal testing methodology. Each of these tools is \nillustrated with real-world examples to highlight their practical usage and proven \nconfiguration techniques. We have also provided extra weaponry treasures and key \nresources that may be crucial to any professional penetration testers.\nThis book will serve as a single professional, practical, and expert guide to develop \nnecessary penetration testing skills from scratch. You will be trained to make the best \nuse of Kali Linux either in a real-world environment or in an experimental test bed.\n" }
{ "page_number": 23, "text": "Preface\n[ 2 ]\nWhat this book covers\nChapter 1, Beginning with Kali Linux, introduces you to Kali Linux, a Live DVD Linux \ndistribution specially developed to help in the penetration testing process. You will \nlearn a brief history of Kali Linux and several categories of tools that Kali Linux has. \nNext, you will also learn how to get, use, configure, and update Kali Linux as well \nas how to configure several important network services (HTTP, MySQL, and SSH) \nin Kali Linux. You will also learn how to install and configure a vulnerable virtual \nmachine image for your testing environment and several ways that can be used to \ninstall additional tools in Kali Linux.\nChapter 2, Penetration Testing Methodology, discusses the basic concepts, rules, \npractices, methods, and procedures that constitute a defined process for a \npenetration testing program. You will learn about making a clear distinction \nbetween two well-known types of penetration testing, black box and white box. \nThe differences between vulnerability assessment and penetration testing will also \nbe analyzed. You will also learn about several security testing methodologies and \ntheir core business functions, features, and benefits. These include OSSTMM, ISSAF, \nOWASP, and WASC-TC. Thereafter, you will learn about a general penetration \nKali Linux testing process incorporated with 10 consecutive steps to conduct a \npenetration testing assignment from an ethical standpoint.\nChapter 3, Target Scoping, covers a scope process to provide necessary guidelines on \nnormalizing the test requirements. A scope process will introduce and describe each \nfactor that builds a practical roadmap towards test execution. This process integrates \nseveral key elements, such as gathering client requirements, preparing a test plan, \nprofiling test boundaries, defining business objectives, and project management and \nscheduling. You will learn to acquire and manage the information about the target's \ntest environment.\nChapter 4, Information Gathering, introduces you to the information gathering phase. \nYou will learn how to use public resources to collect information about the target \nenvironment. Next, you learn how to analyze DNS information and collect network \nrouting information. Finally, you will learn how to utilize search engines to get \ninformation of the target domain, e-mail addresses, and document metadata from \nthe target environment.\nChapter 5, Target Discovery, introduces you to the target discovery process. You will \nlearn the purpose of target discovery and the tools that can be used to identify target \nmachines. At the end of this chapter, you will also learn about the tools that can be \nused to perform OS fingerprinting on the target machines.\n" }
{ "page_number": 24, "text": "Preface\n[ 3 ]\nChapter 6, Enumerating Target, introduces you to target enumeration and its purpose. \nYou will learn a brief theory on port scanning and several tools that can be used to \ndo port scanning. You will also learn about various options available to be used by \nthe Nmap port scanner tool. Also, you will learn about how to find SMB, SNMP, and \nVPN available in the target machine in the last part of the chapter.\nChapter 7, Vulnerability Mapping, discusses two generic types of vulnerabilities: local \nand remote. You will get insights on vulnerability taxonomy, pointing to industry \nstandards that can be used to classify any vulnerability according to its unifying \ncommonality pattern. Additionally, you will learn a number of security tools that \ncan assist you in finding and analyzing the security vulnerabilities present in a \ntarget environment. These include OpenVAS, Cisco, Fuzzing, SMB, SNMP, and web \napplication analysis tools.\nChapter 8, Social Engineering, covers some core principles and practices adopted \nby professional social engineers to manipulate humans into divulging information \nor performing an act. You will learn some of the basic psychological principles that \nformulate the goals and vision of a social engineer. You will also learn about the \nattack process and methods of social engineering followed by real-world examples. \nIn the end, you will be given hands-on exercise using the social engineering tools \nthat can assist you in evaluating the target's human infrastructure.\nChapter 9, Target Exploitation, highlights the practices and tools that can be used \nto conduct a real-world exploitation. The chapter will explain what areas of \nvulnerability research are crucial in order to understand, examine, and test the \nvulnerability. Additionally, it will also point out several exploit repositories that \nshould keep you informed about the publicly available exploits and when to use \nthem. You will also learn to use one of the infamous exploitation toolkits from a \ntarget evaluation perspective. Moreover, you will discover the steps for writing a \nsimple exploit module for the Metasploit framework.\nChapter 10, Privilege Escalation, introduces you to privilege escalation as well as \nnetwork sniffing and spoofing. You will learn how to escalate your gained privilege \nusing a local exploit. You will also learn the tools required to attack a password via \nthe offline or online technique. You will also learn about several tools that can be \nused to spoof the network traffic. In the last part of this chapter, you will discover \nseveral tools that can be used to do a network sniffing attack.\nChapter 11, Maintaining Access, introduces you to the operating system and web \nbackdoors. You will learn about several backdoors that are available and how to use \nthem. You will also learn about several network tunneling tools that can be used to \ncreate covert communication between the attacker and the victim machine.\n" }
{ "page_number": 25, "text": "Preface\n[ 4 ]\nChapter 12, Documentation and Reporting, covers the penetration testing directives \nfor documentation, report preparation, and presentation. These directives draw a \nsystematic, structured, and consistent way to develop the test report. Furthermore, \nyou will learn about the process of results verification, types of reports, presentation \nguidelines, and the post-testing procedures.\nAppendix A, Supplementary Tools, describes several additional tools that can be used \nfor the penetration testing job.\nAppendix B, Key Resources, explains various key resources to help you become more \nskillful in the penetration testing field..\nWhat you need for this book\nAll the necessary requirements for the installation, configuration, and use of Kali \nLinux have been discussed in Chapter 1, Beginning with Kali Linux.\nWho this book is for\nIf you are an IT security professional or a network administrator who has a basic \nknowledge of Unix/Linux operating systems, including an awareness of information \nsecurity factors, and you want to use Kali Linux for penetration testing, this book is \nfor you.\nConventions\nIn this book, you will find a number of styles of text that distinguish between \ndifferent kinds of information. The following are some examples of these styles and \nan explanation of their meaning.\nCode words in text, database table names, folder names, filenames, file extensions, \npathnames, dummy URLs, user input, and Twitter handles are shown as follows: \n\"For the second example, we will use a simple program called cisco_crack.\"\nA block of code is set as follows:\n[-] Searching in Google:\n Searching 0 results...\n[+] Emails found:\n------------------\ninfo@example.com\nuser1@example.com\nuser2@example.com\nuser3@example.com\n" }
{ "page_number": 26, "text": "Preface\n[ 5 ]\nWhen we wish to draw your attention to a particular part of a code block, the \nrelevant lines or items are set in bold:\n# SET TO ON IF YOU WANT TO USE EMAIL IN CONJUNCTION WITH WEB ATTACK\nWEBATTACK_EMAIL=ON\nAny command-line input or output is written as follows:\n# metagoofil -d example.com -l 20 -t doc,pdf –n 5 -f test.html -o test\nNew terms and important words are shown in bold. Words that you see on the \nscreen, in menus, or dialog boxes, for example, appear in the text as follows: \"To \naccess Maltego from the Kali Linux menu, navigate to Kali Linux | Information \nGathering | OSINT Analysis | maltego.\"\nWarnings or important notes appear in a box like this.\nTips and tricks appear like this.\nReader feedback\nFeedback from our readers is always welcome. Let us know what you think about \nthis book—what you liked or may have disliked. Reader feedback is important for us \nto develop titles that you really get the most out of.\nTo send us general feedback, simply send an e-mail to feedback@packtpub.com, \nand mention the book title via the subject of your message.\nIf there is a topic that you have expertise in and you are interested in either writing \nor contributing to a book, see our author guide on www.packtpub.com/authors.\nCustomer support\nNow that you are the proud owner of a Packt book, we have a number of things to \nhelp you to get the most from your purchase.\n" }
{ "page_number": 27, "text": "Preface\n[ 6 ]\nErrata\nAlthough we have taken every care to ensure the accuracy of our content, mistakes \ndo happen. If you find a mistake in one of our books—maybe a mistake in the text or \nthe code—we would be grateful if you would report this to us. By doing so, you can \nsave other readers from frustration and help us improve subsequent versions of this \nbook. If you find any errata, please report them by visiting http://www.packtpub.\ncom/submit-errata, selecting your book, clicking on the errata submission form link, \nand entering the details of your errata. Once your errata are verified, your submission \nwill be accepted and the errata will be uploaded on our website, or added to any list of \nexisting errata, under the Errata section of that title. Any existing errata can be viewed \nby selecting your title from http://www.packtpub.com/support.\nPiracy\nPiracy of copyright material on the Internet is an ongoing problem across all media. \nAt Packt, we take the protection of our copyright and licenses very seriously. If you \ncome across any illegal copies of our works, in any form, on the Internet, please \nprovide us with the location address or website name immediately so that we can \npursue a remedy.\nPlease contact us at copyright@packtpub.com with a link to the suspected \npirated material.\nWe appreciate your help in protecting our authors, and our ability to bring you \nvaluable content.\nQuestions\nYou can contact us at questions@packtpub.com if you are having a problem with \nany aspect of the book, and we will do our best to address it.\n" }
{ "page_number": 28, "text": "PART I\nLab Preparation \nand Testing \nProcedures\nBeginning with Kali Linux\nPenetration Testing Methodology \n" }
{ "page_number": 29, "text": "" }
{ "page_number": 30, "text": "Beginning with Kali Linux\nThis chapter will guide you through the wonderful world of Kali Linux—a \nspecialized Linux distribution for the purpose of penetration testing. In this chapter, \nwe will cover the following topics:\n•\t\nA brief history of Kali\n•\t\nSeveral common usages of Kali\n•\t\nDownloading and installing Kali\n•\t\nConfiguring and updating Kali\nAt the end of this chapter, we will describe how to install additional weapons and \nhow to configure Kali Linux.\nA brief history of Kali Linux\nKali Linux (Kali) is a Linux distribution system that was developed with a focus on \nthe penetration testing task. Previously, Kali Linux was known as BackTrack, which \nitself is a merger between three different live Linux penetration testing distributions: \nIWHAX, WHOPPIX, and Auditor. \nBackTrack is one of the most famous Linux distribution systems, as can be proven by \nthe number of downloads that reached more than four million as of BackTrack Linux \n4.0 pre final.\nKali Linux Version 1.0 was released on March 12, 2013. Five days later, Version 1.0.1 \nwas released, which fixed the USB keyboard issue. In those five days, Kali has been \ndownloaded more than 90,000 times.\n" }
{ "page_number": 31, "text": "Beginning with Kali Linux\n[ 10 ]\nThe following are the major features of Kali Linux (http://docs.kali.org/\nintroduction/what-is-kali-linux):\n•\t\nIt is based on the Debian Linux distribution\n•\t\nIt has more than 300 penetration testing applications\n•\t\nIt has vast wireless card support\n•\t\nIt has a custom kernel patched for packet injection\n•\t\nAll Kali software packages are GPG signed by each developer\n•\t\nUsers can customize Kali Linux to suit their needs\n•\t\nIt supports ARM-based systems\nKali Linux tool categories\nKali Linux contains a number of tools that can be used during the penetration testing \nprocess. The penetration testing tools included in Kali Linux can be categorized into \nthe following categories:\n•\t\nInformation gathering: This category contains several tools that can be \nused to gather information about DNS, IDS/IPS, network scanning, \noperating systems, routing, SSL, SMB, VPN, voice over IP, SNMP, e-mail \naddresses, and VPN. \n•\t\nVulnerability assessment: In this category, you can find tools to scan \nvulnerabilities in general. It also contains tools to assess the Cisco network, \nand tools to assess vulnerability in several database servers. This category \nalso includes several fuzzing tools.\n•\t\nWeb applications: This category contains tools related to web applications \nsuch as the content management system scanner, database exploitation, \nweb application fuzzers, web application proxies, web crawlers, and web \nvulnerability scanners.\n•\t\nPassword attacks: In this category, you will find several tools that can be \nused to perform password attacks, online or offline. \n•\t\nExploitation tools: This category contains tools that can be used to exploit \nthe vulnerabilities found in the target environment. You can find exploitation \ntools for the network, Web, and database. There are also tools to perform \nsocial engineering attacks and find out about the exploit information.\n•\t\nSniffing and spoofing: Tools in this category can be used to sniff the network \nand web traffic. This category also includes network spoofing tools such as \nEttercap and Yersinia.\n" }
{ "page_number": 32, "text": "Chapter 1\n[ 11 ]\n•\t\nMaintaining access: Tools in this category will be able to help you maintain \naccess to the target machine. You might need to get the highest privilege \nlevel in the machine before you can install tools in this category. Here, you \ncan find tools for backdooring the operating system and web application. \nYou can also find tools for tunneling.\n•\t\nReporting tools: In this category, you will find tools that help you document \nthe penetration-testing process and results.\n•\t\nSystem services: This category contains several services that can be useful \nduring the penetration testing task, such as the Apache service, MySQL \nservice, SSH service, and Metasploit service.\nTo ease the life of a penetration tester, Kali Linux has provided us with a category \ncalled Top 10 Security Tools. Based on its name, these are the top 10 security \ntools commonly used by penetration testers. The tools included in this category \nare aircrack-ng, burp-suite, hydra, john, maltego, metasploit, nmap, sqlmap, \nwireshark, and zaproxy.\nBesides containing tools that can be used for the penetration testing task, Kali Linux \nalso comes with several tools that you can use for the following:\n•\t\nWireless attacks: This category includes tools to attack Bluetooth, RFID/\nNFC, and wireless devices.\n•\t\nReverse engineering: This category contains tools that can be used to debug \na program or disassemble an executable file.\n•\t\nStress testing: This category contains tools that can be used to help you in \nstress testing your network, wireless, Web, and VOIP environment.\n•\t\nHardware hacking: Tools in this category can be used if you want to work \nwith Android and Arduino applications.\n•\t\nForensics: In this category, you will find several tools that can be used for \ndigital forensics, such as acquiring a hard disk image, carving files, and \nanalyzing the hard disk image. To use the forensics capabilities in Kali Linux \nproperly, you need to navigate to Kali Linux Forensics | No Drives or Swap \nMount in the booting menu. With this option, Kali Linux will not mount the \ndrives automatically, so it will preserve the drives' integrity. \nIn this book, we are focusing only on Kali Linux's penetration testing tools.\n" }
{ "page_number": 33, "text": "Beginning with Kali Linux\n[ 12 ]\nDownloading Kali Linux\nThe first thing to do before installing and using Kali Linux is to download it. You can \nget Kali Linux from the Kali Linux website (http://www.kali.org/downloads/).\nOn the download page, you can select the official Kali Linux image based on the \nfollowing items, which is also shown in the next screenshot:\n•\t\nMachine architecture: i386, amd64, armel, and armhf\n•\t\nImage type: ISO image or VMware image\nIf you want to burn the image to a DVD or install Kali Linux to your machine, you \nmight want to download the ISO image version. However, if you want to use Kali \nLinux for VMWare, you can use the VMWare image file to speed up the installation \nand configuration for a virtual environment.\nAfter you have downloaded the image file successfully, you need to compare the \nSHA1 hash value from the downloaded image with the SHA1 hash value provided \non the download page. The purpose of checking the SHA1 value is to ensure the \nintegrity of the downloaded image is preserved. This prevents the user from either \ninstalling a corrupt image or an image file that has been maliciously tampered with.\n" }
{ "page_number": 34, "text": "Chapter 1\n[ 13 ]\nIn the UNIX/Linux/BSD operating system, you can use the sha1sum command to \ncheck the SHA1 hash value of the downloaded image file. Remember that it might \ntake some time to compute the hash value of the Kali Linux image file due to its size. \nFor example, to generate the hash value of the kali-linux-1.0.1-i386.iso file, the \nfollowing command is used:\nsha1sum kali-linux-1.0.1-i386.iso\n41e5050f8709e6cd6a7d1baaa3ee2e89f8dfae83 kali-linux-1.0.1-i386.iso\nIn the Windows world, there are many tools that can be used to generate the SHA1 \nhash value; one of them is sha1sum. It is available from http://www.ring.gr.jp/\npub/net/gnupg/binary/sha1sum.exe. \nWe like it because of its small size and it just works. If you want an alternative tool \ninstead of sha1sum, there is HashMyFiles (http://www.nirsoft.net/utils/hash_\nmy_files.html). HashMyFiles supports MD5, SHA1, CRC32, SHA-256, SHA-384, \nand SHA-512 hash algorithms.\nAfter you have downloaded HashMyFiles, just run the HashMyFiles and select the \nfile by navigating to File | Add Files to find out the SHA1 hash value of a file. Or, \nyou can press F2 to perform the same function. Then, choose the image file you want.\nThe following screenshot resembles the SHA1 hash value generated by HashMyFiles \nfor the Kali Linux i386 ISO image file:\n" }
{ "page_number": 35, "text": "Beginning with Kali Linux\n[ 14 ]\nYou need to compare the SHA1 hash value generated by sha1sum, HashMyFiles \nor other similar tools with the SHA1 hash value displayed on the Kali Linux \ndownload page.\nIf both the values match, you can go straight to the Using Kali Linux section. But \nif they do not match, it means that your image file is broken; you may want to \ndownload the file again from an official download mirror. For this case, we can see \nthat the SHA1 hash values match.\nUsing Kali Linux\nYou can use Kali Linux in one of the following ways:\n•\t\nYou can run Kali Linux directly from the Live DVD\n•\t\nYou can install Kali Linux on the hard disk and then run it\n•\t\nYou can install Kali Linux on the USB disk (as a portable Kali Linux)\nIn the following sections, we will briefly describe each of those methods.\nRunning Kali using Live DVD\nIf you want to use Kali Linux without installing it first, you can do so by burning the \nISO image file to a DVD. After the burn process finishes successfully, boot up your \nmachine with that DVD. You need to make sure that you have set the machine to \nboot from the DVD. \nThe advantage of using Kali Linux as a Live DVD is that it is very fast to set up and \nis very easy to use.\nUnfortunately, the Live DVD has several drawbacks; for example, any files or \nconfiguration changes will not be saved after the reboot. Additionally, running Kali \nLinux from the DVD is slow as compared to running Kali Linux from the hard disk \nbecause the DVD's reading speed is slower than the hard disk's reading speed.\nThis method of running Kali is recommended only if you just want to test Kali. \nHowever, if you want to work with Kali Linux extensively, we suggest that you \ninstall Kali Linux.\n" }
{ "page_number": 36, "text": "Chapter 1\n[ 15 ]\nInstalling on a hard disk\nTo install Kali Linux on your hard disk, you can choose one of the following methods:\n•\t\nInstallation on a physical/real machine (regular installation)\n•\t\nInstallation on a virtual machine\nYou can choose whichever method is suitable for you, but we personally prefer to \ninstall Kali Linux on a virtual machine.\nInstalling Kali on a physical machine\nBefore you install Kali Linux on a physical/real machine, make sure that you install \nit on an empty hard drive. If your hard drive already has some data on it, that data \nwill be lost during the installation process because the installer will format the hard \ndrive. For easy installation, we suggest that you use all of the available space in the \nhard disk. If your machine contains another operating system, you need to create a \nseparate disk partition for Kali Linux. Be careful while doing this or you could end \nup corrupting your operating system.\nThe official Kali Linux documentation that describes how to \ninstall Kali Linux with the Windows operating system can be \nfound at http://docs.kali.org/installation/dual-\nboot-kali-with-windows.\nThere are several tools that can be used to help you perform disk partitioning. In the \nopen source area, the following Linux Live CDs are available:\n•\t\nSystemRescueCD (http://www.sysresccd.org/) \n•\t\nGParted Live (http://gparted.sourceforge.net/livecd.php) \n•\t\nKali Linux (http://www.kali.org)\nTo use the Linux Live CD, you just need to boot it up and you are ready for disk \npartitioning. Make sure that you back up your data before you use the Linux Live \nCD disk partitioning tool. Even though they are safe for use in our experience, there \nis nothing wrong with being cautious, especially if you have important data on the \nhard disk.\n" }
{ "page_number": 37, "text": "Beginning with Kali Linux\n[ 16 ]\nAfter you are done with the disk partitioning or you just want to use all the hard \ndisk space, you can boot your machine using the Kali Linux Live DVD and select \nthe Install or Graphical install option when you are prompted with the Kali Linux \nLive CD menu:\nAfter that, you will see an installation window. You need to set up several things \nduring the installation process:\n1.\t First, you need to set the installation language. The default language used \nis English.\n2.\t Select the country you live in using the drop-down box.\n3.\t Next, set the locale setting. The default value is United States – en_\nUS.UTF-8.\n4.\t The keymap value comes next. You can use the suggested keymap value \n(American English) if don't have a specific keyboard layout.\n5.\t Next, you will be asked to configure the network, starting with setting the \nhostname. Then, you are asked to fill in the domain name.\n6.\t Later on, you will need to set the root password.\n7.\t The installer then asks you to select your time zone.\n" }
{ "page_number": 38, "text": "Chapter 1\n[ 17 ]\n8.\t In the disk partitioning segment, the installer will guide you through the disk \npartitioning process. If you use an empty hard disk, just select the default \nGuided - use entire disk option for better ease. If you have some other \noperating system installed on your machine, you might first want to create a \nseparate partition for Kali Linux and then select Manual in this menu. After \nyou have selected the suitable menu, the installer will create the partition.\n9.\t The installer will ask you about the partitioning scheme; the default scheme \nis All files in one partition. Remember that if you want to store files in the \nhome directory, you should select Separate /home partition so that those \nfiles won't be deleted if you reinstall the system. The /home partition's \nsize really depends on your needs. If you want to put all your data in that \ndirectory, you may want a big partition size (more than 50 GB). For average \nusage, you can go ahead with 10 to 20 GB.\n10.\t The installer will display an overview of your currently configured \npartitions, as shown in the following screenshot:\n11.\t Next, the installer will install the Kali Linux system. The installation will \nbe completed in several minutes and you will have Kali Linux installed on \nyour hard disk afterwards. In our test machine, the installation took around \n20 minutes.\n12.\t After the installation is finished, the installer will ask you to configure the \npackage manager. Next, it will ask you to install GRUB to the Master Boot \nRecord. You can just choose the default values for these two questions. \nBeware if you have some other operating system on the same machine, you \nshould not choose to install GRUB to the Master Boot Record.\n" }
{ "page_number": 39, "text": "Beginning with Kali Linux\n[ 18 ]\n13.\t If you see the following message, it means that your Kali installation \nis complete:\n14.\t You can restart the machine to test your new Kali installation by \nselecting the Continue button. After restarting, you will see the \nfollowing Kali login screen:\n15.\t You can log in using the credentials that you configured in the \ninstallation process.\n" }
{ "page_number": 40, "text": "Chapter 1\n[ 19 ]\nInstalling Kali on a virtual machine\nYou can also install Kali Linux to a virtual machine environment as a guest operating \nsystem. The advantages of this type of installation are that you do not need to \nprepare a separate physical hard disk partition for the Kali Linux image and can use \nyour existing operating system as is. \nWe will use VirtualBox (http://www.virtualbox.org) \nas the virtual machine software. VirtualBox is an open source \nvirtualization software that is available for Windows, Linux, OS \nX, and Solaris operating systems.\nUnfortunately, there is also a disadvantage of running Kali Linux on a virtual \nmachine; it is slower as compared to running Kali Linux on a physical machine. \nThere are two options that can be utilized for installing Kali Linux on a virtual \nmachine. The first option is to install the Kali Linux ISO image into a virtual machine. \nThis option will take more time compared to the VMware image installation. The \nadvantage of this method is that you can customize your Kali installation.\nInstalling Kali on a virtual machine from the ISO image\nTo install a Kali Linux ISO image on a virtual machine, the following steps can \nbe used:\n1.\t Create a new virtual machine by selecting New from the VirtualBox \ntoolbar menu.\n2.\t After that, you need to define the virtual machine's name and the operating \nsystem's type. Here, we set the VM's name to Kali Linux and we choose \nLinux for the OS type and Debian for the version:\n" }
{ "page_number": 41, "text": "Beginning with Kali Linux\n[ 20 ]\n3.\t Then, you need to define the VM's base memory size. The more memory you \nprovide, the better the virtual machine will be. Here, we allocated 2048 MB \nof memory to the Kali Linux virtual machine. Remember that you can't give \nall of your physical memory to the VM because you still need the memory to \nrun your host operating system:\n4.\t Next, you will be asked to create a virtual hard disk. You can just select the \nVDI as the hard disk type along with a dynamically allocated virtual disk file. \nWe suggest creating at least a 32 GB virtual hard disk. If you want to install \nsome software packages later on, you may want to create a larger virtual \nhard disk:\n" }
{ "page_number": 42, "text": "Chapter 1\n[ 21 ]\n5.\t After this, your newly created VM will be listed on the VirtualBox menu. \n6.\t To use the Kali Linux ISO image, select the VM from the VirtualBox menu \nand then click on the Storage menu to configure it:\n7.\t From Storage Tree, select IDE Controller and in the Attributes, select Kali \nLinux ISO image file; in this case the filename for the CD/DVD drive is \nkali-linux-1.0.1-i386.iso. If successful, you will see the ISO image \nname in the Controller: IDE field:\n8.\t To install the Kali Linux ISO image, just run your new virtual machine. You \ncan refer to the Installing Kali on a physical machine section for guidance on \nhow to install Kali Linux.\n" }
{ "page_number": 43, "text": "Beginning with Kali Linux\n[ 22 ]\nInstalling Kali in a virtual machine using the provided Kali \nVM image\nThe second option is using the VMWare image provided by Kali Linux. \nThe Kali Linux team only provides Kali Linux GNOME \nVMware image for an i386 machine.\nWith this option, you can install Kali Linux on a virtual machine with ease. \nAfter downloading the Kali Linux VMware image (kali-linux-1.0-i386-gnome-\nvm.tar.gz), you need to verify the SHA1 hash of the downloaded file with the hash \nvalue provided in the download page. If the hash value is the same, you can extract \nthe image file to the appropriate folder. \nAs the VMware image is compressed in the GZ format, you can use any software \nthat can extract a .gz file such as gzip or 7-Zip if you use a Windows operating \nsystem. If you have extracted it successfully, you will find 21 files in the directory:\nTo create the new virtual machine using this VM image file, select New from the \nVirtualBox icon toolbar. Next, you will need to answer the following questions:\n1.\t We use kali-gnome-vm-32 as the VM name and choose Linux as the \noperating system and Debian as the version.\n2.\t We configure the Kali Linux virtual machine to use 2048 MB as its \nmemory size.\n" }
{ "page_number": 44, "text": "Chapter 1\n[ 23 ]\n3.\t Next, we define the virtual hard disk to Use an existing virtual hard drive \nfile. Then, we select the kali-linux-i386-gnome-vm.vmdk file for the hard \ndisk. After that, we choose Create to create the virtual machine, as shown in \nthe following screenshot:\nThe following is the default configuration of the Kali Linux \nVMware image:\n•\t\nHard disk size: 30 GB\n•\t\nNetwork type: NAT\n•\t\nUsername: root\n•\t\nPassword: toor\nFor penetration purposes, we should avoid using NAT as the network \ntype. The recommended network type is bridged.\nChange the default password for Kali when you configure the \nKali VM. \n" }
{ "page_number": 45, "text": "Beginning with Kali Linux\n[ 24 ]\nIf successful, you will see the new virtual machine in the virtual manager list:\nTo run the Kali Linux virtual machine, click on the Start icon at the top of the \nVirtualBox menu bar. After the boot process, Kali Linux will display its login prompt.\nIf you got the following error message, you need to install the VirtualBox Extension \nPack. You can get it from http://www.virtualbox.org/wiki/Downloads.\nRemember to download the VirtualBox Extension Pack with \nthe same version as the VirtualBox. For example, if you use \nVirtualBox Version 4.3.0, you should use the Extension Pack \nVersion 4.3.0 too.\n" }
{ "page_number": 46, "text": "Chapter 1\n[ 25 ]\nTo install the extension pack from the VirtualBox Manager, perform the \nfollowing steps:\n1.\t Navigate to File | Preferences; it will then display the Settings window. \nNext, select the Extensions menu:\n2.\t Click on the Add package button to select the VirtualBox Extension Pack. \nVirtualBox will then display a pop-up window that will ask you to review \nthe description and then proceed:\n" }
{ "page_number": 47, "text": "Beginning with Kali Linux\n[ 26 ]\n3.\t Select Install to install the extension pack and follow the given instructions. \nIf the installation is successful, you will see the extension pack in the list:\n4.\t You can then log in to Kali Linux using the default username and password.\nInstalling Kali on a USB disk\nThe third option to use Kali Linux is by installing it to a USB flash disk; we call this \nmethod Portable Kali Linux. According to the official Kali documentation, this \nis the Kali developers' favorite and fastest method of booting and installing Kali. \nCompared to the hard disk installation, you can run Kali Linux using any computer \nthat supports booting from the USB flash disk with this method.\nThe installation procedure for the USB flash disk is also applicable to \nthe installation of memory cards (SSD, SDHC, SDXC, and so on).\nThere are several tools available to create portable Kali Linux. One of them is \nRufus (http://rufus.akeo.ie/). This tool can be run only from a Windows \noperating system.\nYou can use other tools to create a bootable disk from the ISO image, such as:\n•\t\nWin32DiskImager (https://launchpad.net/win32-image-writer) \n•\t\nUniversal USB Installer (http://www.pendrivelinux.com/universal-\nusb-installer-easy-as-1-2-3/)\n•\t\nLinux Live USB Creator (http://www.linuxliveusb.com)\nBefore creating portable Kali Linux, you need to prepare a couple of things:\n•\t\nKali Linux ISO image: Even though you can use the portable creator tool to \ndownload the image directly while making the Kali Linux portable, we think \nit's much better to download the ISO first and then configure Rufus to use the \nimage file.\n" }
{ "page_number": 48, "text": "Chapter 1\n[ 27 ]\n•\t\nUSB flash disk: You need an empty USB flash disk with enough space on it. \nWe suggest using a USB flash disk with a minimum size of 16 GB.\nAfter downloading Rufus, you can run it on your Windows computer by double-\nclicking on the rufus.exe file. You will then see the Rufus window.\nIf you use a UNIX-based operating system, you can create the image \nusing the dd command. The following is an example of imaging:\ndd if=kali-linux-1.0.1-i386.iso of=/dev/sdb bs=512k\nHere, /dev/sdb is your USB flash disk.\nTo create a bootable Kali USB flash disk, we need to fill in the following options:\n•\t\nFor Device, we choose the location of the USB flash disk. In my case, it is the \nE drive in my Windows system.\n•\t\nFor Partition scheme and target system type, set it to MBR partition scheme \nfor BIOS or UEFI computers.\n•\t\nIn the Create a bootable disk using option, set the value to ISO image and \nselect the ISO image using the disk icon:\n" }
{ "page_number": 49, "text": "Beginning with Kali Linux\n[ 28 ]\nClick on Start to create the bootable image:\nAfter the process is complete, save all your work first and then reboot your system \nif you want to try the USB flash disk right away. You may want to configure your \nBasic Input Output System (BIOS) to boot it from the USB disk. If there is no error, \nyou can boot up the Kali Linux from the USB flash disk.\nIf you want to add persistence capabilities to the USB flash disk, you \ncan follow the steps described in the documentation section Adding \nPersistence to Your Kali Live USB located at http://docs.kali.\norg/installation/kali-linux-live-usb-install.\nConfiguring the virtual machine\nAfter logging in to the Kali Linux virtual machine, we are going to configure several \nthings. These are important steps if we want to perform penetration testing.\nVirtualBox guest additions\nWe recommend that after you have successfully created the Kali Linux Virtual \nMachine using VirtualBox, you install VirtualBox guest additions. This add-on will \nprovide you with the following additional features:\n•\t\nIt will enable the virtual machine to be viewed in full screen\n•\t\nIt will make the mouse move faster in the virtual machine\n•\t\nIt will enable you to copy and paste the text between the host and \nguest machine\n•\t\nIt will enable the guest and host machine to share folders\n" }
{ "page_number": 50, "text": "Chapter 1\n[ 29 ]\nTo install the guest additions, you can perform the following steps:\n1.\t From the VirtualBox menu, navigate to Devices | Install Guest Additions. \nYou will then see that the VirtualBox guest addition file is mounted as \na disk:\n2.\t Then, VirtualBox will display the following message. Click on Cancel to close \nthe window:\n3.\t Open the terminal console and change the VirtualBox guest additions \nCDROM mount point (/media/cdrom0):\n" }
{ "page_number": 51, "text": "Beginning with Kali Linux\n[ 30 ]\n4.\t Execute VBoxLinuxAdditions.run to run the VirtualBox guest \nadditions installer:\nsh ./VBoxLinuxAdditions.run\n5.\t You may need to wait for several minutes until all of the required modules \nare successfully built and installed:\n6.\t Change to the root home directory.\n7.\t Eject the VBoxAdditions CD Image by right-clicking on the icon and selecting \nEject from the menu. If successful, the VBoxAdditions icon will disappear \nfrom the desktop.\n8.\t Reboot the virtual machine by typing the reboot command in the \nterminal console.\n9.\t After the reboot, you can switch to full screen (View | Switch to fullscreen) \nfrom the VirtualBox menu.\nSetting up networking \nIn the following section, we will discuss how to set up the networking in Kali Linux \nfor the wired and wireless network.\n" }
{ "page_number": 52, "text": "Chapter 1\n[ 31 ]\nSetting up a wired connection\nIn the default Kali Linux VMware image or ISO configuration, Kali Linux uses NAT \n(Network Address Translation) as the network's connection type. In this connection \nmode, the Kali Linux machine will be able to connect to the outside world through \nthe host operating system whereas the outside world, including the host operating \nsystem, will not be able to connect to the Kali Linux virtual machine.\nFor the penetration testing task, you might need to change this networking method \nto Bridged Adapter. The following are the steps to change it:\n1.\t First, make sure you have already powered off the virtual machine. \n2.\t Then, open up the VirtualBox Manager, select the appropriate virtual \nmachine—in this case we are using the Kali Linux virtual machine—and then \nclick on the Network icon on the right-hand side and change the Attached \nto drop-down box from NAT to Bridged Adapter in Adapter 1. In the Name \nfield, you can select the network interface that is connected to the network \nyou want to test, as shown in the following screenshot:\nTo be able to use the bridge network connection, the host machine needs to \nconnect to a network device that can give you an IP address via DHCP, such as \na router or a switch.\nAs you may be aware, a DHCP IP address is not a permanent IP address; it's just a \nlease IP address. After several times (as defined in the DHCP lease time), the Kali \nLinux virtual machine will need to get a lease IP address again. This IP address \nmight be the same as the previous one or might be a different one.\nIf you want to make the IP address permanent, you can do so by saving the IP \naddress in the /etc/network/interfaces file.\nThe following is the default content of this file in Kali Linux:\nauto lo\niface lo inet loopback\n" }
{ "page_number": 53, "text": "Beginning with Kali Linux\n[ 32 ]\nIn the default configuration, all of the network cards are set to use DHCP to get the \nIP address. To make a network card bind to an IP address permanently, we have to \nedit that file and change the content to the following:\nauto eth0\niface eth0 inet static\naddress 10.0.2.15\nnetmask 255.255.255.0\nnetwork 10.0.2.0\nbroadcast 10.0.2.255\ngateway 10.0.2.2\nHere, we set the first network card (eth0) to bind to the IP address of 10.0.2.15. \nYou may need to adjust this configuration according to the network environment \nyou want to test.\nSetting up a wireless connection\nBy running Kali Linux as a virtual machine, you cannot use the wireless card that \nis embedded in your laptop. Fortunately, you can use an external USB-based \nwireless card. \nTo activate your USB-based wireless card in the Kali virtual machine, plug in the \nwireless card to a USB port, navigate to Devices | USB Devices, and select your \nwireless card from the VirtualBox menu:\nIn this screenshot, we select the wireless card that uses the Realtek chipset.\nIf your USB wireless card has been successfully recognized by Kali, you can use the \ndmesg program to see the wireless card's information.\nIn the top-right section of the Kali menu, you will see the Network Connections icon. \nYou can click on it to display your network information.\n" }
{ "page_number": 54, "text": "Chapter 1\n[ 33 ]\nYou will see several networks' names, wired or wireless, available for your machine:\nTo connect to the wireless network, just select the particular SSID you want by \ndouble-clicking on its name. If the wireless network requires authentication, you will \nbe prompted to enter the password. Only after you give the correct password are \nyou allowed to connect to that wireless network.\nStarting the network service\nTo control the networking process' startup or shutdown process, you can use a \nhelper script called service.\nTo start a networking service, just give the following command:\nservice networking start\nTo stop a networking service, type the following command:\nservice networking stop\nTo issue these commands, you need the root privilege.\n" }
{ "page_number": 55, "text": "Beginning with Kali Linux\n[ 34 ]\nYou can test whether your network is working correctly by sending an ARP ping \nrequest to a host in the same network segment using the arping command. \nYou may find that after you reboot your Kali Linux machine, the networking service \nneeds to be started again. To make the networking service start automatically after \nthe reboot, you need to give the following command:\nupdate-rc.d networking defaults\nThis command will insert the necessary links to the /etc/rc*.d directories to start \nthe networking script automatically after Kali has been rebooted.\nConfiguring shared folders\nDuring a penetration testing process, we may find that we need to share files \nbetween the host OS and the guest OS, such as to store penetration testing results on \nthe host machine. One of the mechanisms that can be used for this requirement is to \nuse VirtualBox's Shared Folders.\nTo configure the shared folder from the VirtualBox menu, you need to power off \nthe virtual machine that you want to configure. After that, you need to select the \nappropriate guest machine's name and click on the Shared Folders menu in the \nwindow on the left. You will then see the following screen:\n" }
{ "page_number": 56, "text": "Chapter 1\n[ 35 ]\nTo add the folder from the host OS, click on the + icon on the right-hand side. After \nthat, select the appropriate folder that you want to share in the host OS. The selected \nfolder path will be displayed in the Folder Path field.\nFor the Folder Name field, you can choose a name that is suitable for the folder. This \nname will be used by the guest OS to identify the host OS' shared folder.\nIf you do not want the guest OS to write to the specified shared folder, you can \ncheck the option to Read-only. If the Auto-mount option is checked, the guest OS \nwill try to mount the folder automatically after its startup, as shown in the \nfollowing screenshot:\nIn the preceding screenshot, we shared a D:\\software folder to the guest OS as a \nread-only folder. \nThe shared folder can be accessed from the virtual machine as a /media/sf_\nsoftware directory.\nSaving the guest machine state\nIf you have correctly configured your guest OS, we suggest that you save your OS \nstate. The purpose of this action is that in case you mess up your virtual machine \nbadly, you can still restore it to the previous good state.\n" }
{ "page_number": 57, "text": "Beginning with Kali Linux\n[ 36 ]\nTo save the virtual machine's state, VirtualBox has provided you with this capability \nunder the menu of Machine – Take Snapshot. You need to start the virtual machine \nbefore you can take its snapshot:\nFor the Snapshot Name, you can use any name but we suggest that you put in the \ninformation about the date. You can give detailed information in the Snapshot \nDescription field. After you fill in all the information, VirtualBox will store the \nvirtual machine state; this process will take some time depending on how much \ninformation is available to be saved. \nExporting a virtual machine\nThere are times when you need to back up your virtual machine to a file or share \nyour virtual machine with other people. VirtualBox allows you to do that easily. For \nthis action, you need to turn off the virtual machine that you want to export, and \nthen navigate to File | Export Appliance.\nThe following steps will help you export an appliance:\n1.\t Select the Export Appliance menu; VirtualBox will display an Appliance \nExport Wizard screen. \n2.\t Next, choose the virtual machine that you want to export.\n3.\t Later on, you will be asked for the output file's location. By default, the \nlocation will be your directory and the file format will be ova (Open \nVirtualization Format Archive). We suggest that you use the default file \nformat if you don't know which file format to choose.\n" }
{ "page_number": 58, "text": "Chapter 1\n[ 37 ]\n4.\t Next, you are prompted for the appliance export's configuration values. You \ncan configure the properties here. However, you can usually just leave them \nempty unless you need to set specific values:\nAfter this, the exporting process will take place. The time required to finish the \nexport depends on the size of the virtual machine. The bigger the virtual machine \nsize, the longer the exporting time. On my system, it took around 20 minutes to \nexport the Kali Linux virtual machine.\nUpdating Kali Linux\nKali Linux consists of hundreds of pieces of application software and an operating \nsystem kernel. You may need to update the software if you want to get the \nlatest features.\nWe suggest that you only update the software and kernel from the Kali Linux \nsoftware package repository.\nThe first thing to do after you have successfully installed and configured Kali Linux \nis to update it. As Kali is based on Debian, you can use the Debian command (apt-\nget) for the updating process.\nThe apt-get command will consult the /etc/apt/sources.list file to get \nthe update servers. You need to make sure that you have put the correct servers \nin that file.\n" }
{ "page_number": 59, "text": "Beginning with Kali Linux\n[ 38 ]\nThe default sources.list file included in Kali Linux contains the following entries:\n# deb cdrom:[Debian GNU/Linux 7.0 _Kali_ - Official Snapshot i386 \nLIVE/INSTALL Binary 20130315-11:39]/ kali contrib main non-free\n#deb cdrom:[Debian GNU/Linux 7.0 _Kali_ - Official Snapshot i386 LIVE/\nINSTALL Binary 20130315-11:39]/ kali contrib main non-free\ndeb http://http.kali.org/kali kali main non-free contrib\ndeb-src http://http.kali.org/kali kali main non-free contrib\n## Security updates\ndeb http://security.kali.org/kali-security kali/updates main contrib \nnon-free\nYou need to synchronize the package's index files from the repository specified in \nthe /etc/apt/sources.list file before you can perform the update process. The \nfollowing is the command for this synchronization:\napt-get update\nMake sure that you always run apt-get update before performing a software \nupdate or installation in Kali.\nAfter the package index has been synchronized, you can perform software updates. \nThere are two command options that are available to perform an upgrade:\n•\t\napt-get upgrade: This command will upgrade all of the packages that are \ncurrently installed on the machine to the latest version. If there is a problem \nin upgrading a package, that package will be left intact in the current version.\n•\t\napt-get dist-upgrade: This command will upgrade the entire Kali Linux \ndistribution; for example, if you want to upgrade from Kali Linux 1.0.1 to \nKali Linux 1.0.2, you can use this command. This command will upgrade all \nof the packages that are currently installed and will also handle any conflicts \nduring the upgrade process; however, some specific action may be required \nto perform the upgrade.\nAfter you choose the appropriate command option to update Kali Linux, the apt-\nget program will list all of the packages that will be installed, upgraded, or removed. \nThe apt-get command will then wait for your confirmation.\nIf you have given the confirmation, the upgrade process will start. Beware, the \nupgrade process might take a long time to finish depending on your Internet \nconnection speed.\n" }
{ "page_number": 60, "text": "Chapter 1\n[ 39 ]\nNetwork services in Kali Linux\nThere are several network services available in Kali Linux; in this section, we will \ndescribe only some of them: the HTTP, MySQL, and SSH service. You can find the \nother services by navigating to Kali Linux | System Services.\nHTTP\nIn your penetration testing works, you may want to have a web server for various \nreasons, such as to serve malicious web application scripts. In Kali Linux, there is \nalready an Apache web server installed; you just need to start the service.\nThe following are the steps that are required to activate your HTTP server in \nKali Linux:\n1.\t To start the Apache HTTP service from the graphical menu, navigate to Kali \nLinux | System Services | HTTPD | apache2 start; or, from the command \nline, type the following command to start the Apache server:\nservice apache2 start\n2.\t If there are no errors, the system will reply with the following message:\n[....] Starting web server: apache2 ok\n3.\t After this, you can browse to the web page; it will display the It works! page \nby default:\nTo stop the Apache HTTP service, perform the following steps:\n1.\t From the menu, navigate to Kali Linux | System Services | HTTPD | \napache2 stop; or, from the command line, type the following command to \nstart the Apache server:\nservice apache2 stop\n" }
{ "page_number": 61, "text": "Beginning with Kali Linux\n[ 40 ]\n2.\t If there are no errors, the system will reply with the following message:\n[....] Stopping web server: apache2 [ ok waiting .\n3.\t Remember that the previous command will not survive the boot up. After the \nboot up, you need to give the command again. Fortunately, there is a way to \nstart the Apache HTTP service automatically after the Kali Linux boots up by \ngiving the following command:\nupdate-rc.d apache2 defaults\nThe command will add the apache2 service to be started on boot up.\nMySQL\nThe second service that we will discuss is MySQL. It is one of the relational database \nsystems. MySQL is often used with the PHP programming language and Apache \nweb server to create a dynamic, web-based application. For the penetration testing \nprocess, you can use MySQL to store your penetration testing results; for example, \nthe vulnerability information and network mapping result. Of course, you need to \nuse the application to store those results.\nTo start the MySQL service in Kali Linux, you can perform the following steps:\n1.\t In the graphical menu, navigate to Kali Linux | System Services | MySQL \n| mysql start; or, from the command line, type the following:\nservice mysql start\n2.\t Then, the system will respond with the following message:\n[ ok ] Starting MySQL database server: mysqld . . ..\n[info] Checking for tables which need an upgrade, are corrupt or \nwere not closed cleanly..\n3.\t To test whether your MySQL has already started, you can use the MySQL \nclient to connect to the server. We define the username (root) and the \npassword to log in to the MySQL server:\nmysql -u root –p\n4.\t The system will respond with the following:\nEnter password: \nWelcome to the MySQL monitor. Commands end with ; or \\g.\nYour MySQL connection id is 42\nServer version: 5.5.30-1 (Debian)\n" }
{ "page_number": 62, "text": "Chapter 1\n[ 41 ]\nCopyright (c) 2000, 2013, Oracle and/or its affiliates. All rights \nreserved.\nOracle is a registered trademark of Oracle Corporation and/or its\naffiliates. Other names may be trademarks of their respective\nowners.\nType ''help;'' or ''\\h'' for help. Type ''\\c'' to clear the \ncurrent input statement.\nmysql>\n5.\t After this MySQL prompt, you can give any SQL commands. To exit from \nMySQL, just type quit.\nBy default, for security reasons, the MySQL service in Kali Linux \ncan be accessed only from a local machine. You can change this \nconfiguration by editing the bind-address stanza in the MySQL \nconfiguration file located in /etc/mysql/my.cnf. We don't \nrecommend that you change this behavior unless you want your \nMySQL to be accessed from other machines.\nTo stop the MySQL service, you can perform the following steps:\n1.\t In the graphical menu, navigate to Kali Linux | System Services | MySQL \n| mysql stop; or, from the command line, type the following:\nservice mysql stop\n2.\t Then, the system will respond with the following message:\n[ ok ] Stopping MySQL database server: mysqld.\nTo start the MySQL service automatically after Kali Linux's boots up, you can give \nthe following command:\nupdate-rc.d mysql defaults\nThis command will make the MySQL service start after the boot up.\n" }
{ "page_number": 63, "text": "Beginning with Kali Linux\n[ 42 ]\nSSH\nFor the next service, we will look into the Secure Shell (SSH). SSH can be used to \nlog in to a remote machine securely; apart from that, there are several other usages of \nSSH, such as securely transferring a file between machines, executing a command in \na remote machine, and X11 session forwarding.\nTo manage your SSH service in Kali Linux, you can perform the following steps:\n1.\t To start the SSHD service from the graphical menu, navigate to Kali Linux \n| System Services | SSH | sshd start; or, from the command line, type the \nfollowing:\nservice ssh start\n2.\t The system will then respond with the following message:\n[ ok ] Starting OpenBSD Secure Shell server: sshd.\n3.\t To test your SSH, you can log in to the Kali Linux server from another server \nusing a SSH client such as putty (http://www.chiark.greenend.org.\nuk/~sgtatham/putty/) if you are using the Microsoft Windows operating \nsystem.\n4.\t To stop the SSHD service from the graphical menu, navigate to Kali Linux \n| System Services | SSH | sshd stop; or, from the command line, type the \nfollowing:\nservice ssh stop\n5.\t The system will then respond with the following message:\n[ ok ] Stopping OpenBSD Secure Shell server: sshd.\n6.\t To start the SSH service automatically after Kali Linux boots up, you can give \nthe following command:\nupdate-rc.d ssh defaults\nThis command will add the SSH service to be started on boot up.\n" }
{ "page_number": 64, "text": "Chapter 1\n[ 43 ]\nInstalling a vulnerable server\nIn this section, we will install a vulnerable virtual machine as a target virtual \nmachine. This target will be used in several chapters of the book when we explain \nparticular topics. The reason we chose to set up a vulnerable server in our machine \ninstead of using vulnerable servers available on the Internet is because we don't want \nyou to break any laws. We should emphasize that you should never pen test other \nservers without written permission. Another purpose of installing another virtual \nmachine would be to improve your skills in a controlled manner. This way, it is easy \nto fix issues and understand what is going on in the target machine when attacks do \nnot work.\nIn several countries, even port scanning a machine that you don't own can be \nconsidered a criminal act. Also, if something happens to the operating system using \na virtual machine, we can repair it easily.\nThe vulnerable virtual machine that we are going to use is Metasploitable 2. This \nvulnerable system is created by the famous HD Moore of Rapid7. \nThere are other deliberately vulnerable systems besides Metasploitable \n2 that you can use for your penetration testing learning process, as \ncan be seen on the following site: http://www.felipemartins.\ninfo/2011/05/pentesting-vulnerable-study-frameworks-\ncomplete-list/.\nMetasploitable 2 has many vulnerabilities in the operating system, network, and web \napplication layers. \nInformation about the vulnerabilities contained in Metasploitable 2 can \nbe found on the Rapid7 site at https://community.rapid7.com/\ndocs/DOC-1875.\nTo install Metasploitable 2 in VirtualBox, you can perform the following steps:\n1.\t Download the Metasploitable 2 file from http://sourceforge.net/\nprojects/metasploitable/files/Metasploitable2/.\n2.\t Extract the Metasploitable 2 ZIP file. After the extraction process is completed \nsuccessfully, you will find five files:\n°°\nMetasploitable.nvram\n°°\nMetasploitable.vmdk\n°°\nMetasploitable.vmsd\n°°\nMetasploitable.vmx\n°°\nMetasploitable.vmxf\n" }
{ "page_number": 65, "text": "Beginning with Kali Linux\n[ 44 ]\n3.\t Create a new virtual machine in VirtualBox. Set Name to Metasploitable2, \nOperating System to Linux, and Version to Ubuntu.\n4.\t Set the memory to 1024MB.\n5.\t In the Virtual Hard Disk setting, select Use existing hard disk. Choose the \nMetasploitable files that we have already extracted in the previous step:\n6.\t Change the network setting to Host-only adapter to make sure that this \nserver is accessible only from the host machine and the Kali Linux virtual \nmachine. The Kali Linux virtual machine's network setting should also be set \nto Host-only adapter for pen-testing local VMs.\n7.\t Start the Metasploitable 2 virtual machine. After the boot process is finished, \nyou can log in to the Metasploitable 2 console using the following credentials:\n°°\nUsername: msfadmin\n°°\nPassword: msfadmin\n8.\t The following is the Metasploitable 2 console after you have logged \nin successfully:\n" }
{ "page_number": 66, "text": "Chapter 1\n[ 45 ]\nInstalling additional weapons\nAlthough the latest version of Kali Linux always comes with many security tools, \nsometimes you need to add additional software tools due to the following reasons:\n•\t\nThe latest version of the tool has not been included in Kali Linux yet\n•\t\nYou want to have the latest version of the software that is not available in the \nKali Linux repository\nOur suggestion is to try to search for the software package in the repository first. If \nyou can find the package in the repository, just use that package. However, if you \ncan't find it in the repository, you may want to get the software package from the \nauthor's website and install it yourself. \nBased on our experience, we suggest that you use the software in the repository as \nmuch as you can to ease the package management process.\nThere are several package management tools that can be used to help you manage \nthe software package in your system, such as dpkg, apt, and aptitude. Kali Linux \ncomes with dpkg and apt installed by default.\nIf you want to find out more about the apt and dpkg command, you \ncan go through the following references: https://help.ubuntu.\ncom/community/AptGet/Howto/ and http://www.debian.org/\ndoc/manuals/debian-reference/ch02.en.html.\n" }
{ "page_number": 67, "text": "Beginning with Kali Linux\n[ 46 ]\nIn this section, we will briefly discuss the apt command in a practical way that is \nrelated to the software package installation process.\nTo search for a package name in the repository, you can use the following command:\napt-cache search <package_name>\nThis command will display the entire software package that has the name package_\nname. For example, let's search for a software package called nessus; the following is \nthe command to do that:\napt-cache search nessus\nTo display more detailed information about a software package such as its \ndescription, size, and version, you can use the following command:\napt-cache show <package_name>\nIf you want install the package or upgrade an individual software package, you can \nuse the apt-get command to install the package. The following is the basic syntax \nfor apt-get to do that:\napt-get install <package_name>\nIf you can't find the package in the Kali Linux repository and are sure that the package \nwill not cause any problems in the future, you can install the package manually.\nDownload the software package only from trusted sources such as the software \ndeveloper's site. If the developer provides the .deb (the Debian package format) \npackages, you can use the dpkg command to install the additional software. If the \n.deb package is not provided, you can install the software from the source code. The \nactual process may vary but the general steps are usually similar to the following:\n1.\t Extract the software package using archiver programs such as Tar and 7-Zip.\n2.\t Change to the extracted directory.\n3.\t Run the following commands:\n ./configure\nmake\nmake installh\n" }
{ "page_number": 68, "text": "Chapter 1\n[ 47 ]\nIn this section, we will provide you with examples on how to install several \nadditional security tools that are not available from the Kali Linux repository. We \nwill give various mechanisms that can be used to install the software:\n•\t\nDownloading the Debian package and installing it\n•\t\nDownloading from the source package and installing it\nInstalling the Nessus vulnerability scanner\nAs an example, we want to install the latest Nessus vulnerability scanner (Version 5) \nfor the first installation mechanism. We have searched the Kali Linux repository but \nare unable to find Nessus. \nNessus Version 5 has many new features as compared to Nessus Version 4, such as \nmore flexible results filtering and report creation and simplified policy creation; we \nchose to use this version instead of Nessus Version 4. \nYou can find more information about the features and enhancement \nin Nessus Version 5 from http://www.tenable.com/products/\nnessus/nessus-product-overview/why-upgrade-to-nessus-5.\nWe can download the latest Nessus package generated for Debian 6 Linux distribution \nfrom the Nessus website (http://www.nessus.org/products/nessus/nessus-\ndownload-agreement). To install this package, we issue the following command:\ndpkg -i Nessus-x.y.z-debian6_i386.deb\nWe used x.y.z in the previous command to denote the Nessus \nversion number. You need to change those numbers to the Nessus \nversion that you just downloaded successfully.\nYou can then follow the instructions given on the screen to configure your \nNessus server:\n1.\t Start the Nessus server by typing the following if it has not started yet:\n/etc/init.d/nessusd start\n" }
{ "page_number": 69, "text": "Beginning with Kali Linux\n[ 48 ]\n2.\t Open your browser and connect to https://localhost:8834. You will then \nbe prompted with a warning about an invalid SSL certificate used by Nessus. \nYou need to check the SSL certificate and then store the exception for that \nSSL certificate. The following is the Nessus page that will be shown after you \nhave stored the SSL certificate exception:\n3.\t After that, you will be guided to create a Nessus admin credential. Next, you \nwill be asked to enter your activation code to register the Nessus scanner to \nTenable. You need to register at http://www.nessus.org/register/ to \nobtain the activation code: \n" }
{ "page_number": 70, "text": "Chapter 1\n[ 49 ]\n4.\t After you have registered successfully, you will be able to download the \nnewest Nessus plugins. The plugins download process will take some time to \ncomplete; you can do something else while waiting for the download process \nto finish.\nInstalling the Cisco password cracker\nFor the second example, we will use a simple program called cisco_crack (http://\ninsecure.org/sploits/cisco.passwords.html). This tool is used to crack the \nCisco type 7 password.\nCisco type 7 password is a very weak password, so it should not be \nused anymore. However, for penetration testing, we see that it is still \nbeing used, although it's not widespread anymore. This tool will be a \nhelp for this occasion.\nAfter downloading the source code, the next step is to compile it. Before you can \ncompile the source code cleanly, you need to add the following include statements:\n#include <string.h>\n#include <stdlib.h>\nNow, you have four include statements in the source code.\nTo compile the code, you can just give the following command:\ngcc cisco_crack.c –o cisco_crack\nIf there is no error, an executable file with the name of cisco_crack will be created. \nThe following is the help screen of cisco_crack:\n# ./cisco_crack -h\nUsage: ./cisco_crack -p <encrypted password>\n ./cisco_crack <router config file> <output file>\nSummary\nThis chapter introduced you to the amazing world of Kali Linux, which is a Live \nDVD Linux distribution that has been specially developed to help you in the \npenetration testing process. Kali is the successor of BackTrack, a famous Linux \ndistribution focused on the purpose of penetration testing.\n" }
{ "page_number": 71, "text": "Beginning with Kali Linux\n[ 50 ]\nThe chapter started with a brief description of Kali Linux's history. Next, it moved \non to see what functionalities Kali Linux has to offer. The latest version of Kali Linux \nhas many tools to help in penetration testing. Additionally, it also has tools for \ndigital forensics, wireless, reverse engineering, and hardware hacking tasks.\nThe discussion continues on how to get Kali Linux and the several ways to install it. \nKali Linux can be used as a Live DVD without installing it to the hard disk. It can be \ninstalled to the hard disk and can also be used as a portable distribution by installing \nit to a USB flash disk.\nBefore Kali Linux can be used properly in penetration testing, it needs to be \nconfigured for the network connection, using either a wired or wireless connection. \nWe also discussed how to use several features in the VirtualBox machine to make \nit easier to work with the virtual machine; for example, installing additional tools, \nconfiguring shared folders, exporting the virtual machine for a backup purpose or \nto share it with other people, and taking a snapshot to back up the virtual machine \ntemporarily.\nAs with any other software, Kali Linux also needs to be updated, whether we only \nupdate the software applications or the Linux kernel included in the distribution. \nYou may need to test your penetration testing skills; unfortunately, you don't have \npermission to do this to other servers as it is considered illegal in several countries. \nTo help you with this, there are several intentionally vulnerable systems that \ncan be installed and used on your own machine. In this chapter, we looked into \nMetasploitable 2 from Rapid7.\nWe also discussed several network services included with the latest Kali Linux, such \nas HTTP, MySQL, and SSH. We started by giving you a brief introduction to each \nservice and then we continue with how to manage the service; for example, how to \nstart or stop the service.\nAt the end of the chapter, we looked at installing additional information security \ntools that are not included in the latest Kali Linux version by default, such as the \nNessus network scanner and Cisco password cracker.\nIn the next chapter, we will introduce you to several penetration testing \nmethodologies.\n" }
{ "page_number": 72, "text": "Penetration Testing \nMethodology\nPenetration testing, often abbreviated as pentest, is a process that is followed \nto conduct an in-depth security assessment or audit. A methodology defines a \nset of rules, practices, and procedures that are pursued and implemented during \nthe course of any information security audit program. A penetration testing \nmethodology defines a roadmap with practical ideas and proven practices that can \nbe followed to assess the true security posture of a network, application, system, or \nany combination thereof. This chapter offers summaries of several key penetration \ntesting methodologies. Key topics covered in this chapter include:\n•\t\nA discussion on two well-known types of penetration testing—black box and \nwhite box\n•\t\nDescribing the differences between the vulnerability assessment and \npenetration testing\n•\t\nExplaining several industry-acceptable security testing methodologies and \ntheir core functions, features, and benefits\n•\t\nA general penetration testing methodology that incorporates the 10 \nconsecutive steps of a typical penetration testing process \n•\t\nThe ethical dimension of how the security testing projects should be handled\nPenetration testing can be carried out independently or as a part of an IT security \nrisk management process that may be incorporated into a regular development life \ncycle (for example, Microsoft SDLC). It is vital to notice that the security of a product \nnot only depends on the factors that are related to the IT environment but also relies \non product-specific security best practices. This involves the implementation of \nappropriate security requirements, performing risk analysis, threat modeling, code \nreviews, and operational security measurement. \n" }
{ "page_number": 73, "text": "Penetration Testing Methodology\n[ 52 ]\nPenetration testing is considered to be the last and most aggressive form of security \nassessment. It must be handled by qualified professionals and can be conducted with \nor without prior knowledge of the targeted network or application. A pentest may \nbe used to assess all IT infrastructure components including applications, network \ndevices, operating systems, communication medium, physical security, and human \npsychology. The output of penetration testing usually consists of a report divided \ninto several sections that address the weaknesses found in the current state of the \ntarget environment, followed by potential countermeasures and other remediation \nrecommendations. The use of a methodological process provides extensive benefits \nto the pentester to understand and critically analyze the integrity of current defenses \nduring each stage of the testing process.\nTypes of penetration testing\nAlthough there are different types of penetration testing, the two most general \napproaches that are widely accepted by the industry are the black box and white box. \nThese approaches will be discussed in the following sections.\nBlack box testing\nWhile applying this approach, the security auditor will be assessing the network \ninfrastructure and will not be aware of any internal technologies deployed by the \ntargeted organization. By employing a number of real-world hacker techniques and \ngoing through organized test phases, vulnerabilities may be revealed and potentially \nexploited. It is important for a pentester to understand, classify, and prioritize these \nvulnerabilities according to their level of risk (low, medium, or high). The risk can be \nmeasured according to the threat imposed by the vulnerability in general. An ideal \npenetration tester would determine all attack vectors that could cause the target to \nbe compromised. Once the testing process has been completed, a report that contains \nall the necessary information regarding the targets' real-world security posture, \ncategorizing, and translating the identified risks into a business context, is generated. \nBlack box testing can be a more expensive service than white box testing.\n" }
{ "page_number": 74, "text": "Chapter 2\n[ 53 ]\nWhite box testing\nAn auditor involved in this kind of penetration testing process should be aware of all \nthe internal and underlying technologies used by the target environment. Hence, it \nopens a wide gate for a penetration tester to view and critically evaluate the security \nvulnerabilities with minimum possible efforts and utmost accuracy. It does bring \nmore value to the organization in comparison to the black box approach in the sense \nthat it will eliminate any internal security issues lying at the target infrastructure's \nenvironment, thus making it more difficult for a malicious adversary to infiltrate \nfrom the outside. The number of steps involved in white box testing is similar to \nthat of black box testing. Moreover, the white box approach can easily be integrated \ninto a regular development life cycle to eradicate any possible security issues at \nan early stage before they get disclosed and exploited by intruders. The time, cost, \nand knowledge level required to find and resolve the security vulnerabilities is \ncomparably less than with the black box approach.\nVulnerability assessment versus \npenetration testing\nThere is always a need to understand and practice the correct terminology for \nsecurity assessment. Throughout your career, you may run into commercial grade \ncompanies and non-commercial organizations that are likely to misinterpret the term \npenetration testing when trying to select an assessment type. It is important that you \nunderstand the differences between these types of tests. \nVulnerability assessment is a process to assess the internal and external security \ncontrols by identifying the threats that pose serious exposure to the organizations' \nassets. This technical infrastructure evaluation not only points to the risks in the \nexisting defenses, but also recommends and prioritizes the remediation strategies. \nThe internal vulnerability assessment provides you with an assurance to secure \nthe internal systems, while the external vulnerability assessment demonstrates the \nsecurity of the perimeter defenses. In both testing criteria, each asset on the network \nis rigorously tested against multiple attack vectors to identify unattended threats \nand quantify the reactive measures. Depending on the type of assessment being \ncarried out, a unique set of testing processes, tools, and techniques are followed to \ndetect and identify vulnerabilities in the information assets in an automated fashion. \nThis can be achieved using an integrated vulnerability management platform that \nmanages an up-to-date vulnerabilities database and is capable of testing different \ntypes of network devices while maintaining the integrity of configuration and \nchange management.\n" }
{ "page_number": 75, "text": "Penetration Testing Methodology\n[ 54 ]\nA key difference between the vulnerability assessment and penetration testing is \nthat the penetration testing goes beyond the level of identifying vulnerabilities and \nhooks into the process of exploitation, privilege escalation, and maintaining access \nto the target system(s). On the other hand, vulnerability assessment provides you \nwith a broad view of any existing flaws in the system without measuring the impact \nof these flaws to the system under consideration. Another major difference between \nboth of these terms is that the penetration testing is considerably more intrusive than \nthe vulnerability assessment and aggressively applies all of the technical methods \nto exploit the live production environment. However, the vulnerability assessment \nprocess carefully identifies and quantifies all the known vulnerabilities in a \nnon-invasive manner.\nWhy penetration testing?\nWhen there is doubt that mitigating controls such as firewalls, intrusion \ndetection systems, file integrity monitoring, and so on are effective, a full \npenetration test is ideal. Vulnerability scanning will locate individual \nvulnerabilities; however, penetration testing will actually attempt to verify \nthat these vulnerabilities are exploitable within the target environment.\nThis perception, while dealing with both of these assessment types, might confuse \nand overlap the terms interchangeably, which is absolutely wrong. A qualified \nconsultant always attempts to work out the best type of assessment based on the \nclient's business requirement rather than misleading them from one over the other. \nIt is also the duty of the contracting party to look into the core details of the selected \nsecurity assessment program before taking any final decision.\nPenetration testing is an expensive service in comparison to \nvulnerability assessment.\nSecurity testing methodologies\nVarious open source methodologies have been created to address the security \nassessment's needs. Using these assessment methodologies, one can strategically \naccomplish the time-critical and challenging task of assessing the system's security \nregardless of its size and complexity. Some methodologies focus on the technical \naspect of security testing, while others focus on managerial criteria, and very few \naddress both sides. The basic idea behind formalizing these methodologies with your \nassessment is to execute different types of tests step-by-step in order to accurately \njudge the security posture of a system. \n" }
{ "page_number": 76, "text": "Chapter 2\n[ 55 ]\nTherefore, you will be introduced to several well-known security assessment \nmethodologies that provide you with an extended view of the assessing network \nand application security by highlighting their key features and benefits. These \ninclude the following: \n•\t\nOpen Source Security Testing Methodology Manual\n•\t\nInformation Systems Security Assessment Framework\n•\t\nOpen Web Application Security Project Testing Guide\n•\t\nWeb Application Security Consortium Threat Classification \n•\t\nPenetration Testing Execution Standard\nAll of these testing frameworks and methodologies will assist security professionals \nchoose the best strategy that adheres to their client's requirements. The first two \nprovide you with general guidelines and methods of security testing for almost \nany type of information asset. The testing frameworks provided by Open Web \nApplication Security Project (OWASP) and Web Application Security Consortium \n(WASC) primarily deal with the assessment of application security. Penetration \nTesting Execution Standard (PTES) will provide you with guidance on all types of \npenetration testing efforts. It is, however, important to note that security is an on-\ngoing process in itself and a penetration test is a snapshot that details the security \nposture at the time of the test. Any minor change in the target environment may \naffect the entire process of security testing and could introduce errors in the final \nresults. Additionally, adapting any single methodology does not necessarily provide \nyou with a complete picture of the risk assessment process. It is left to the security \nauditor to select the best strategy that could address the target testing criteria.\nThere are many security testing methodologies; choosing the best one requires a \ncareful selection process through which one can determine the cost and effectiveness \nof the assessment. Thus, determining the right assessment strategy depends on \nseveral factors, including the technical details provided about the target environment \nand resource availability, pentester's knowledge, business objectives, and regulatory \nconcerns. From a business standpoint, efficiency and cost control is of extreme \nimportance. Each of the following testing methodologies have very detailed and \nwell-written documentation at their respective sites. We provide a brief summary \nof each, but to truly understand how they work in detail, you need to go to their \nrespective websites and carefully study the documentation and implementation \ndetails provided by their creators. \n" }
{ "page_number": 77, "text": "Penetration Testing Methodology\n[ 56 ]\nOpen Source Security Testing Methodology \nManual (OSSTMM)\nOpen Source Security Testing Methodology Manual (OSSTMM) (http://www.\nisecom.org/research/osstmm.html) is a recognized international standard \ncreated by Pete Herzog and developed by ISECOM for security testing and analysis. \nIt's being used by many organizations in their day-to-day assessment cycle. From \na technical perspective, its methodology is divided into four key groups—scope, \nchannel, index, and vector. The scope defines a process of collecting information on \nall assets that operate in the target environment. A channel determines the type of \ncommunication and interaction with these assets, which can be physical, spectrum, \nand communication. All of these channels depict a unique set of security components \nthat must be tested and verified during the assessment period. These components \nare comprised of physical security, human psychology, data networks, wireless \ncommunication medium, and telecommunication. The index is a method that is used \nto classify target assets that correspond to their particular identifications, such as \nMAC Address and IP Address. At the end, a vector concludes the direction through \nwhich an auditor can assess and analyze each functional asset. The whole process \ninitiates a technical roadmap that evaluates the target environment thoroughly and is \nknown as audit scope.\nThere are different forms of security testing that have been classified under the \nOSSTMM methodology, and their organization is presented within six standard \nsecurity test types:\n•\t\nBlind: Blind testing does not require any prior knowledge about the target \nsystem. However, the target is informed before the execution of an audit \nscope. Ethical hacking and war gaming are examples of blind type testing. \nThis kind of testing is also widely accepted because of its ethical vision of \ninforming a target in advance.\n•\t\nDouble blind: In double blind testing, an auditor neither requires any \nknowledge about the target system, nor is the target informed before the test \nexecution. Black box auditing and penetration testing are examples of double \nblind testing. Most of the security assessments today are carried out using \nthis strategy, thus putting a real challenge for the auditors to select the best of \nbreed tools and techniques in order to achieve their required goal. \n•\t\nGray box: In gray box testing, an auditor holds limited knowledge about \nthe target system and the target is also informed before the test is executed. \nVulnerability assessment is one of the basic examples of gray box testing. \n" }
{ "page_number": 78, "text": "Chapter 2\n[ 57 ]\n•\t\nDouble gray box: Double gray box testing works in a way that is similar to \ngray box testing, except that the time frame for an audit is defined and there \nare no channels and vectors being tested. White box audit is an example of \ndouble gray box testing.\n•\t\nTandem: In tandem testing, the auditor holds minimum knowledge to assess \nthe target system and the target is also notified in advance, before the test is \nexecuted. Note that tandem testing is conducted thoroughly. Crystal box and \nin-house audit are examples of tandem testing.\n•\t\nReversal: In reversal testing, an auditor holds full knowledge of the target \nsystem and the target will never be informed of how and when the test will \nbe conducted. \nThe technical assessment framework provided by OSSTMM is flexible and capable \nof deriving certain test cases that are logically divided into five security components \nof three consecutive channels, as mentioned previously. These test cases generally \nexamine the target by assessing its access control security, process security, data \ncontrols, physical location, perimeter protection, security awareness level, trust level, \nfraud control protection, and many other procedures. The overall testing procedures \nfocus on what is to be tested, how it should be tested, what tactics should be applied \nbefore, during, and after the test, and how to interpret and correlate the final results. \nCapturing the current state of the protection of a target system is considerably useful \nand invaluable. Thus, the OSSTMM methodology has introduced this terminology in \nthe form of RAV (Risk Assessment Values). The basic function of RAV is to analyze \nthe test results and compute the actual security value based on three factors, which \nare operational security, loss controls, and limitations. This final security value is \nknown as RAV score. By using RAV score, an auditor can easily extract and define \nthe milestones based on the current security posture to accomplish better protection. \nFrom a business perspective, RAV can optimize the amount of investment required \non security and might help you with the justification of investing in more effective \nsecurity solutions.\nKey features and benefits\nThe following are the key features and benefits of OSSTMM:\n•\t\nPracticing the OSSTMM methodology substantially reduces the occurrence \nof false negatives and false positives and provides reproducible security \nmeasurements. \n•\t\nThe framework is adaptable to many types of security tests, such as \npenetration testing, white box audit, vulnerability assessment, and so forth.\n•\t\nIt ensures that the assessment should be carried out thoroughly and the \nresults are collected in a consistent, quantifiable, and reliable manner.\n" }
{ "page_number": 79, "text": "Penetration Testing Methodology\n[ 58 ]\n•\t\nThe methodology itself follows a process of four individually connected \nphases, namely, definition phase, information phase, regulatory phase, \nand controls test phase. Each of these obtains, assesses, and verifies the \ninformation regarding the target environment.\n•\t\nRAV calculates the actual security value based on operational security, \nloss controls, and limitations. The given output, known as the RAV score, \nrepresents the current state of target security.\n•\t\nFormalizing an assessment report using the Security Test Audit Report \n(STAR) template can be advantageous to management as well as the \ntechnical team when reviewing the testing objectives, risk assessment values, \nand the output of each test phase.\n•\t\nThe methodology is regularly updated with new trends of security testing, \nregulations, and ethical concerns.\n•\t\nThe OSSTMM process can be coordinated with industry regulations, business \npolicy, and government legislations. Additionally, a certified audit can also \nbe eligible for accreditation from ISECOM (Institute for Security and Open \nMethodologies) directly.\nInformation Systems Security Assessment \nFramework (ISSAF)\nInformation Systems Security Assessment Framework (ISSAF) (www.oissg.\norg/issaf) is another open source security testing and analysis framework. Its \nframework has been categorized into several domains to address the security \nassessment in a logical order. Each of these domains assesses different parts of a \ntarget system and provides field inputs for the successful security engagement. \nBy integrating its framework into a regular business life cycle, it may provide the \naccuracy, completeness, and efficiency required to fulfill an organization's security \ntesting requirements. ISSAF was developed to focus on two areas of security \ntesting—technical and managerial. The technical side establishes the core set of \nrules and procedures to follow and create an adequate security assessment process, \nwhile the managerial side accomplishes engagement with the management and \nthe best practices that should be followed throughout the testing process. It should \nbe remembered that ISSAF defines the assessment as a process instead of an audit. \nAs auditing requires a more established body to proclaim the necessary standards, \nits assessment framework does include the planning, assessment, treatment, \naccreditation, and maintenance phases. Each of these phases holds generic guidelines \nthat are effective and flexible for any organizational structure. \n" }
{ "page_number": 80, "text": "Chapter 2\n[ 59 ]\nThe output is a combination of operational activities, security initiatives, and a \ncomplete listing of vulnerabilities that might exist in the target environment. The \nassessment process chooses the shortest path to reach the test deadline by analyzing \nits target against critical vulnerabilities that can be exploited with minimum effort.\nISSAF contains a rich set of technical assessment baselines to test the number of \ndifferent technologies and processes. However, this has introduced another problem \nof maintenance to keep updating the framework in order to reflect new or updated \ntechnology assessment criteria. When compared to the OSSTMM methodology, these \nobsolescence issues affect the OSSTMM less, because the auditor is able to use the \nsame methodology over the number of security engagements using a different set of \ntools and techniques. On the other hand, ISSAF also claims to be a broad framework \nwith up-to-date information on security tools, best practices, and administrative \nconcerns to complement the security assessment program. It can also be aligned with \nOSSTMM or any other similar testing methodology, thus combining the strengths of \neach other. \nKey features and benefits\nThe following are the key features and benefits of ISSAF:\n•\t\nISSAF provides you with a high value proposition to secure the infrastructure \nby assessing the existing security controls against critical vulnerabilities.\n•\t\nIt addresses different key areas of information security. These include risk \nassessment, business structure and management, controls assessment, \nengagement management, security policies development, and general \nbest practices.\n•\t\nISSAF penetration testing methodology examines the security of a network, \nsystem, or application. The framework can transparently focus on target-\nspecific technology that may involve routers, switches, firewalls, intrusion \ndetection and prevention systems, storage area networks, virtual private \nnetworks, various operation systems, web application servers, databases, and \nso forth.\n•\t\nIt bridges the gap between the technical and managerial view of security \ntesting by implementing the necessary controls to handle both areas.\n•\t\nIt enables the management to understand the existing risks that float over \nan organization's perimeter defenses and reduces them proactively by \nidentifying the vulnerabilities that may affect the business integrity.\nOSSTMM and ISSAF can be used in combination with each other to \nassess the security of an enterprise environment.\n" }
{ "page_number": 81, "text": "Penetration Testing Methodology\n[ 60 ]\nOpen Web Application Security Project \n(OWASP) \nThe Open Web Application Security Project (OWASP) open community brings its \ntop 10 project forward to increase the awareness of application security. The project \nprovides you with a necessary foundation to integrate security through secure \ncoding principles and practices. OWASP also provides you with a wonderful testing \nguide as part of the OWASP Testing Project (https://www.owasp.org/index.php/\nOWASP_Testing_Project) that should be carefully reviewed to determine if this \nframework can assist you in your efforts.\nThe OWASP top 10 project categorizes the application security risks by evaluating \nthe top attack vectors and security weaknesses in relation to their technical and \nbusiness impact. While assessing the application, each of these risks demonstrates a \ngeneric attack method that is independent of the technology or platform being used. \nIt also provides you with specific instructions on how to test, verify, and remediate \neach vulnerable part of an application. The OWASP top 10 mainly focuses on the \nhigh risk problem areas rather than addressing all the issues that surround the \nweb application's security. However, some essential guidelines are available in the \nOWASP community for developers and security auditors to effectively manage the \nsecurity of web applications:\n•\t\nThe Testing Guide: https://www.owasp.org/index.php/OWASP_Testing_\nGuide_v3_Table_of_Content\n•\t\nThe Developer's Guide: www.owasp.org/index.php/Guide\n•\t\nThe Code Review Guide: www.owasp.org/index.php/Category:OWASP_\nCode_Review_Project\nThe OWASP top 10 changes on a year-to-year basis. For detailed information, visit \nthe project's website at https://www.owasp.org/index.php/Category:OWASP_\nTop_Ten_Project.\nKey features and benefits\nThe following are the key features and benefits of OWASP:\n•\t\nTesting web applications against OWASP top ten security risks ensures \nthat the most common attacks and weaknesses are avoided and the \nconfidentiality, integrity, and availability of an application is maintained.\n•\t\nThe OWASP community has developed a number of security tools that focus \non the automated and manual web application tests. A few of these tools are \nWebScarab, Wapiti, JBroFuzz, and SQLiX, which are also available under the \nKali Linux operating system.\n" }
{ "page_number": 82, "text": "Chapter 2\n[ 61 ]\n•\t\nWhen considering the security assessment of web infrastructure, the \nOWASP Testing Guide provides you with technology-specific assessment \ndetails; for instance, the testing of Oracle is approached differently than \nMySQL. Such a guide provides you with a wider and more collaborative \nlook at multiple technologies, which helps an auditor choose the best-suited \nprocedure for testing.\n•\t\nIt encourages the secure coding practices for developers by integrating \nsecurity tests at each stage of development. This will ensure that the \nproduction application is robust, error-free, and secure.\n•\t\nIt provides industry-wide acceptance and visibility. The top ten security \nrisks can also be aligned with other web application security assessment \nstandards, thus helping you achieve more than one standard at a time with a \nlittle more effort.\nWeb Application Security Consortium Threat \nClassification (WASC-TC)\nIdentifying the application's security risks requires a thorough and rigorous testing \nprocedure, which can be followed throughout the development's life cycle. WASC \nthreat classification is another such open standard to assess the security of web \napplications. Similar to the OWASP standard, it is also classified into a number of \nattacks and weaknesses but addresses them in a much deeper fashion. Practicing this \nblack art for identification and verification of threats that are hanging over the web \napplication requires standard terminology to be followed, which can quickly adapt \nto the technology environment. This is where the WASC-TC comes in very handy. \nThe overall standard is presented in three different views to help developers and \nsecurity auditors understand the vision of web application security threats:\n•\t\nEnumeration view: This view is dedicated to providing the basis for web \napplication attacks and weaknesses. Each of these attacks and weaknesses \nhave been discussed individually with its concise definition, type, and \nexamples of multiple programming platforms. Additionally, it is in line with \nits unique identifier, which can be useful for referencing. A total of 49 attacks \nand weaknesses are collated with a static WASC-ID number (1 to 49). Note \nthat this numeric representation does not focus on the risk severity but serves \nthe purpose of referencing instead.\n" }
{ "page_number": 83, "text": "Penetration Testing Methodology\n[ 62 ]\n•\t\nDevelopment view: The development view takes the developer's \npanorama forward by combining the set of attacks and weaknesses into \nvulnerabilities, which are likely to occur at any of three consecutive \ndevelopment phases. This could be a design, implementation, or deployment \nphase. The design vulnerabilities are introduced when the application's \nrequirements do not fulfill the security at the initial stage of requirement \ngathering. The implementation vulnerabilities occur due to insecure coding \nprinciples and practices. The deployment vulnerabilities are the result of \nthe misconfiguration of the application, web server, and other external \nsystems. Thus, the view broadens the scope for its integration into a regular \ndevelopment life cycle as a part of best practices.\n•\t\nTaxonomy cross-reference view: Referring to a cross-reference view \nof multiple web application security standards can help auditors and \ndevelopers map the terminology presented in one standard with another. \nWith a little more effort, the same facility can also assist you in achieving \nmultiple standard compliances at the same time. However, each application's \nsecurity standard defines it own criteria to assess the applications from \ndifferent angles and measures their associated risks in general. Thus, each \nstandard requires different efforts to be made to scale up the calculation \nfor risks and their severity levels. The WASC-TC attacks and weaknesses \npresented in this category are mapped with OWASP top 10, Mitre's \nCommon Weakness Enumeration (CWE), Mitre's Common Attack Pattern \nEnumeration and Classification (CAPEC), and SANS-CWE top 25 list.\nMore details regarding Mitre's CWE can be found at https://cwe.\nmitre.org/.\nMore information regarding Mitre's CAPEC can be found at http://\ncapec.mitre.org/.\nSANS-CWE top 25 list can be found at http://www.sans.org/top25-\nsoftware-errors/.\nMore details regarding WASC-TC and its views can be found at http://\nprojects.webappsec.org/Threat-Classification.\nKey features and benefits\nThe following are the key features and benefits of the WASC-TC:\n•\t\nWASC-TC provides you with in-depth knowledge to assess the web \napplication environment against the most common attacks and weaknesses.\n•\t\nThe attacks and weaknesses presented by WASC-TC can be used to test and \nverify any web application platform using a combination of tools from the \nKali Linux operating system.\n" }
{ "page_number": 84, "text": "Chapter 2\n[ 63 ]\n•\t\nThe standard provides you with three different views, namely, enumeration, \ndevelopment, and cross-reference. Enumeration serves as a base for all the \nattacks and weaknesses found in the web applications. The development \nview merges these attacks and weaknesses into vulnerabilities and \ncategorizes them according to their occurrence in the relative development \nphase. This could be a design, implementation, or deployment phase. The \ncross-reference view serves the purpose of referencing other application \nsecurity standards with WASC-TC. \n•\t\nWASC-TC has already acquired industry-level acceptance and its integration \ncan be found in many open source and commercial solutions, mostly in \nvulnerability assessment and managerial products.\n•\t\nIt can also be aligned with other well-known application security standards, \nsuch as OWASP and SANS-CWE.\nPenetration Testing Execution Standard \n(PTES)\nThe Penetration Testing Execution Standard (PTES) was created by some of the \nbrightest minds and definitive experts in the penetration testing industry. It consists \nof seven phases of penetration testing and can be used to perform an effective \npenetration test on any environment. The details of the methodology can be found at \nhttp://www.pentest-standard.org/index.php/Main_Page.\nThe seven stages of penetration testing that are detailed by this standard are as \nfollows (source: www.pentest-standard.org):\n•\t\nPre-engagement interactions\n•\t\nIntelligence gathering\n•\t\nThreat modeling\n•\t\nVulnerability analysis\n•\t\nExploitation\n•\t\nPost-exploitation\n•\t\nReporting\nEach of these stages is provided in detail on the PTES site along with specific mind \nmaps that detail the steps required for each phase. This allows for the customization \nof the PTES standard to match the testing requirements of the environments that are \nbeing tested. More details about each step can be accessed by simply clicking on the \nitem in the mind map. \n" }
{ "page_number": 85, "text": "Penetration Testing Methodology\n[ 64 ]\nKey features and benefits\nThe following are the key features and benefits of the PTES:\n•\t\nIt is a very thorough penetration testing framework that covers the technical \nas well as other important aspects of a penetration test, such as scope creep, \nreporting, and protecting you as a penetration tester\n•\t\nIt has detailed instructions on how to perform many of the tasks that are \nrequired to accurately test the security posture of an environment\n•\t\nIt is put together for penetration testers by experienced penetration testing \nexperts who perform these tasks on a daily basis\n•\t\nIt is inclusive of the most commonly found technologies as well as ones that \nare not so common\n•\t\nIt is easy to understand and you can adapt it to your own testing needs\nGeneral penetration testing framework\nKali Linux is a versatile operating system that comes with a number of security \nassessment and penetration testing tools. Deriving and practicing these tools without \na proper framework can lead to unsuccessful testing and might produce unsatisfied \nresults. Thus, formalizing the security testing with a structured framework is \nextremely important from a technical and managerial perspective. \nThe general testing framework presented in this section will constitute both the \nblack box and white box approaches. It offers you a basic overview of the typical \nphases through which an auditor or penetration tester should progress. Either of \nthese approaches can be adjusted according to the given target of assessment. The \nframework is composed of a number of steps that should be followed in a process \nat the initial, medial, and final stages of testing in order to accomplish a successful \nassessment. These include the following:\n•\t\nTarget scoping \n•\t\nInformation gathering\n•\t\nTarget discovery\n•\t\nEnumerating target\n•\t\nVulnerability mapping \n•\t\nSocial engineering\n•\t\nTarget exploitation\n•\t\nPrivilege escalation\n" }
{ "page_number": 86, "text": "Chapter 2\n[ 65 ]\n•\t\nMaintaining access\n•\t\nDocumentation and reporting\nWhether applying any combination of these steps with the black box or white box \napproaches, it is left to the penetration tester to decide and choose the most strategic \npath according to the given target environment and its prior knowledge before the \ntest begins. We will explain each stage of testing with a brief description, definition, \nand its possible applications. This general approach may be combined with any \nof the existing methodologies and should be used as a guideline rather than a \npenetration testing catch-all solution. \nTarget scoping\nBefore starting the technical security assessment, it is important to observe and \nunderstand the given scope of the target network environment. It is also necessary to \nknow that the scope can be defined for a single entity or set of entities that are given \nto the auditor. The following list provides you with typical decisions that need to be \nmade during the target scoping phase:\n•\t\nWhat should be tested?\n•\t\nHow should it be tested?\n•\t\nWhat conditions should be applied during the test process?\n•\t\nWhat will limit the execution of the test process?\n•\t\nHow long will it take to complete the test?\n•\t\nWhat business objectives will be achieved?\nTo lead a successful penetration testing, an auditor must be aware of the \ntechnology under assessment, its basic functionality, and its interaction with the \nnetwork environment. Thus, the knowledge of an auditor does make a significant \ncontribution towards any kind of security assessment.\nInformation gathering\nOnce the scope is finalized, it is time to move into the reconnaissance phase. During \nthis phase, a pentester uses a number of publicly available resources to learn more \nabout his or her target. This information can be retrieved from Internet sources such as:\n•\t\nForums\n•\t\nBulletin boards\n•\t\nNewsgroups\n" }
{ "page_number": 87, "text": "Penetration Testing Methodology\n[ 66 ]\n•\t\nArticles\n•\t\nBlogs \n•\t\nSocial networks \n•\t\nCommercial or non-commercial websites \nAdditionally, the data can also be gathered through various search engines, such \nas Google, Yahoo!, MSN Bing, Baidu, and others. Moreover, an auditor can use the \ntools provided in Kali Linux to extract the network information about a target. These \ntools perform valuable data mining techniques to collect information through DNS \nservers, trace routes, Whois database, e-mail addresses, phone numbers, personal \ninformation, and user accounts. As more information is gathered, the probability of \nconducting a successful penetration test is increased.\nTarget discovery\nThis phase mainly deals with identifying the target's network status, operating \nsystem, and its relative network architecture. This provides you with a complete \nimage of the interconnected current technologies or devices and may further help \nyou in enumerating various services that are running over the network. By using \nthe advanced network tools from Kali Linux, one can determine the live network \nhosts, operating systems running on these host machines, and characterize each \ndevice according to its role in the network system. These tools generally implement \nactive and passive detection techniques on the top of network protocols, which can \nbe manipulated in different forms to acquire useful information such as operating \nsystem fingerprinting.\nEnumerating target\nThis phase takes all the previous efforts forward and finds the open ports on the \ntarget systems. Once the open ports have been identified, they can be enumerated \nfor the running services. Using a number of port scanning techniques such as full-\nopen, half-open, and stealth scan can help determine the port's visibility even if the \nhost is behind a firewall or Intrusion Detection System (IDS). The services mapped \nto the open ports help in further investigating the vulnerabilities that might exist \nin the target network's infrastructure. Hence, this phase serves as a base for finding \nvulnerabilities in various network devices, which can lead to a serious penetration. \nAn auditor can use some automated tools given in Kali Linux to achieve the goal of \nthis phase.\n" }
{ "page_number": 88, "text": "Chapter 2\n[ 67 ]\nVulnerability mapping\nUp until the previous phase, we have gathered sufficient information about the \ntarget network. It is now time to identify and analyze the vulnerabilities based \non the disclosed ports and services. This process can be achieved via a number of \nautomated network and application vulnerability assessment tools that are present \nunder the Kali Linux OS. It can also be done manually but takes an enormous \namount of time and requires expert knowledge. However, combining both \napproaches should provide an auditor with a clear vision to carefully examine any \nknown or unknown vulnerability that may otherwise exist on the network systems. \nSocial engineering\nPracticing the art of deception is considerably important when there is no open \ngate available for an auditor to enter the target network. Thus, using a human \nattack vector, it is still possible to penetrate the target system by tricking a user into \nexecuting malicious code that should give backdoor access to the auditor. Social \nengineering comes in different forms. This can be anybody pretending to be a network \nadministrator over the phone forcing you to reveal your account information or an \ne-mail phishing scam that can hijack your bank account details. Someone imitating \npersonnel to get into a physical location is also considered social engineering. There is \nan immense set of possibilities that could be applied to achieve the required goal. Note \nthat for a successful penetration, additional time to understand human psychology \nmay be required before applying any suitable deception against the target. It is also \nimportant to fully understand the associated laws of your country with regards to \nsocial engineering prior to attempting this phase.\nTarget exploitation\nAfter carefully examining the discovered vulnerabilities, it is possible to penetrate \nthe target system based on the types of exploits that are available. Sometimes, it may \nrequire additional research or modifications to the existing exploit in order to make \nit work properly. This sounds a bit difficult but might get easier when considering \na work under advanced exploitation tools, which are already provided with Kali \nLinux. Moreover, an auditor can also apply client-side exploitation methods mixed \nwith a little social engineering to take control of a target system. Thus, this phase \nmainly focuses on the target acquisition process. The process coordinates three core \nareas, which involve pre-exploitation, exploitation, and post-exploitation activities.\n" }
{ "page_number": 89, "text": "Penetration Testing Methodology\n[ 68 ]\nPrivilege escalation\nOnce the target is acquired, the penetration is successful. An auditor can now move \nfreely into the system, depending on his or her access privileges. These privileges \ncan also be escalated using any local exploits that match the system's environment, \nwhich, once executed, should help you attain super-user or system-level privileges. \nFrom this point of entry, an auditor might also be able to launch further attacks \nagainst the local network systems. This process can be restricted or non-restricted \ndepending on the given target's scope. There is also a possibility of learning more \nabout the compromised target by sniffing the network traffic, cracking passwords of \nvarious services, and applying local network spoofing tactics. Hence, the purpose of \nprivilege escalation is to gain the highest-level access to the system that is possible.\nMaintaining access\nSometimes, an auditor might be asked to retain access to the system for a specified \ntime period. Such activity can be used to demonstrate illegitimate access to the \nsystem without performing the penetration testing process again. This saves time, \ncost, and resources that are being served to gain access to the system for security \npurposes. Employing some secret tunneling methods, which make a use of protocol, \nproxy, or end-to-end connection strategy that can lead to establishing a backdoor \naccess, can help an auditor maintain his or her footsteps into the target system as \nlong as required. This kind of system access provides you with a clear view on how \nan attacker can maintain his or her presence in the system without noisy behavior.\nDocumentation and reporting\nDocumenting, reporting, and presenting the vulnerabilities found, verified, \nand exploited will conclude your penetration testing activities. From an ethical \nperspective, this is extremely important because the concerned managerial and \ntechnical team can inspect the method of penetration and try to close any security \nloopholes that may exist. The types of reports that are created for each relevant \nauthority in the contracting organization may have different outlooks to assist the \nbusiness and technical staff understand and analyze the weak points that exist in \ntheir IT infrastructure. Additionally, these reports can serve the purpose of capturing \nand comparing the target system's integrity before and after the penetration process.\n" }
{ "page_number": 90, "text": "Chapter 2\n[ 69 ]\nThe ethics\nThe ethical vision of security testing constitutes rules of engagement that have to \nbe followed by an auditor to present professional, ethical, and authorized practices. \nThese rules define how the testing services should be offered, how the testing should \nbe performed, determine the legal contracts and negotiations, define the scope \nof testing, prepare the test plan, follow the test process, and manage a consistent \nreporting structure. Addressing each of these areas requires careful examination and \nthe design of formal practices and procedures must be followed throughout the test \nengagement. Some examples of these rules are discussed as follows:\n•\t\nOffering testing services after breaking into the target system before \nmaking any formal agreement between the client and auditor is completely \nforbidden. This act of unethical marketing can result in the failure of a \nbusiness and might have severe legal implications depending on the \njurisdictions of a country.\n•\t\nPerforming a test beyond the scope of testing and crossing the identified \nboundaries without explicit permissions from a client is prohibited.\n•\t\nBinding a legal contract that should limit the liability of a job unless any \nillegal activity is detected. The contract should clearly state the terms and \nconditions of testing, the emergency contact information, the statement of \nwork, and any obvious conflicts of interest.\n•\t\nThe test plan concerns the amount of time that is required to assess the \nsecurity of a target system. It is highly advisable to draw up a schedule that \ndoes not interrupt the production of business hours.\n•\t\nThe test process defines the set of steps that are required to be followed \nduring the test engagement. These rules combine technical and managerial \nviews to restrict the testing process with its environment and people.\n•\t\nScope definition should clearly define all the contractual entities and the \nlimits imposed on them during the security assessment.\n•\t\nTest results and reporting must be presented in a clear and consistent order. \nThe report must mark all the known and unknown vulnerabilities and \nshould be delivered confidentially to the authorized individual only.\n" }
{ "page_number": 91, "text": "Penetration Testing Methodology\n[ 70 ]\nSummary\nIn this chapter, we have discussed several penetration testing methodologies. We \nhave also described the basic terminology of penetration testing, its associated types, \nand the industry contradiction with other similar terms. The summary of these key \npoints is highlighted as follows:\n•\t\nPenetration testing can be broken into different types such as black box and \nwhite box. The black box approach is also known as external testing, where \nthe auditor has no prior knowledge of the target system. The white box \napproach refers to an internal testing, where the auditor is fully aware of \ntarget environment. The combination of both types is known as a gray box.\n•\t\nThe basic difference between vulnerability assessment and penetration \ntesting is that the vulnerability assessments identify the flaws that exist in \nthe system without measuring their impact, while the penetration testing \ntakes a step forward and exploits these vulnerabilities in order to evaluate \ntheir consequences.\n•\t\nThere are a number of security testing methodologies but very few provide \nstepwise, consistent instructions on measuring the security of a system or \napplication. We have discussed five such well-known open source security \nassessment methodologies, highlighting their technical capabilities, key \nfeatures, and benefits. These include OSSTMM, ISSAF, OWASP, PTES, and \nWASC-TC.\n•\t\nWe also presented a simplified and structured testing framework for \npenetration testing. This process involves a number of steps, which have \nbeen organized according to the industry approach towards security testing. \nThese include target scoping, information gathering, target discovery, \nenumerating target, vulnerability mapping, social engineering, target \nexploitation, privilege escalation, maintaining access, and documentation \nand reporting.\n•\t\nFinally, we discussed the ethical view of penetration testing that should be \njustified and followed throughout the assessment process. Considering ethics \nduring every single step of assessment engagements leads to a successful \narrangement between auditor and business entity.\nThe next chapter will guide you through the strategic engagement of acquiring and \nmanaging information taken from the client for the penetration testing assignment.\n" }
{ "page_number": 92, "text": "PART II\nPenetration \nTesters Armory\nTarget Scoping \nInformation Gathering\nTarget Discovery\nEnumerating Target\nVulnerability Mapping\nSocial Engineering\nTarget Exploitation\nPrivilege Escalation\nMaintaining Access\nDocumentation and Reporting\n" }
{ "page_number": 93, "text": "" }
{ "page_number": 94, "text": "Target Scoping\nTarget Scoping is defined as an empirical process to gather target assessment \nrequirements and characterize each of its parameters in order to generate a test \nplan, its limitations, business objectives, and time schedule. This process plays an \nimportant role in defining clear objectives towards any kind of security assessment. \nBy determining these key objectives, one can easily draw a practical road map of \nwhat will be tested, how it will be tested, what resources will be allocated, what \nlimitations will be applied, what business objectives will be achieved, and how the \ntest project will be planned and scheduled. Thus, we have combined all of these \nelements and presented them in a formalized scope process to achieve the required \ngoal. The following are the key concepts that will be discussed in this chapter:\n•\t\nGathering client requirements: This deals with accumulating information \nabout the target environment through verbal or written communication.\n•\t\nPreparing the test plan: This depends on different sets of variables. These \nvariables may include shaping the actual requirements into a structured \ntesting process, legal agreements, cost analysis, and resource allocation.\n•\t\nProfiling test boundaries: This determines the limitations associated with \nthe penetration testing assignment. These can be a limitation of technology, \nknowledge, or a formal restriction on the client's IT environment.\n•\t\nDefining business objectives: This is a process of aligning business views \nwith the technical objectives of the penetration testing program.\n•\t\nProject management and scheduling: This directs every other step of the \npenetration testing process with a proper timeline for test execution. This can \nbe achieved using a number of advanced project management tools.\n" }
{ "page_number": 95, "text": "Target Scoping\n[ 74 ]\nIt is highly recommended that you follow the scope process in order to ensure \ntest consistency and a greater probability of success. Additionally, this process \ncan also be adjusted according to the given situation and test factors. Without any \nsuch process, there will be a greater chance of failure as the requirements gathered \nwill have no proper definitions and procedures to follow. This can lead the entire \npenetration testing project into danger and may result in an unexpected business \ninterruption. At this stage, paying special attention to the penetration testing process \nwould make an excellent contribution towards the rest of the test phases and clear \nthe perspectives of both technical and management areas. The key is to acquire as \nmuch information beforehand as possible from the client to formulate a strategic \npath that reflects the multiple aspects of penetration testing. These may include \nnegotiable legal terms, contractual agreement, resource allocation, test limitations, \ncore competencies, infrastructure information, timescales, and rules of engagement. \nAs a part of best practices, the scope process addresses each of the attributes that are \nnecessary to initiate our penetration testing project in a professional manner.\nEach step constitutes unique information that is aligned in a logical order to pursue \nthe test execution successfully. This also governs any legal matters to be resolved \nat an early stage. Hence, we will explain each of these steps in more detail in \nthe following section. Keep in mind that it will be easier for both the client and \npenetration testing consultant to further understand the process of testing if all the \ninformation gathered is managed in an organized manner.\nGathering client requirements\nThis step provides a generic guideline that can be drawn in the form of a \nquestionnaire to devise all the information about target infrastructure from a client. \nA client can be any subject who is legally and commercially bound to the target \norganization. Thus, for the success of the penetration testing project, it is critical \nto identify all internal and external stakeholders at an early stage of a project and \nanalyze their levels of interest, expectations, importance, and influence. A strategy \ncan then be developed to approach each stakeholder with their requirements \nand involvement in the penetration testing project in order to maximize positive \ninfluences and mitigate potential negative impacts. \nIt is solely the duty of the penetration tester to verify the identity of \nthe contracting party before taking any further steps. \n" }
{ "page_number": 96, "text": "Chapter 3\n[ 75 ]\nThe basic purpose of gathering client requirements is to open a true and authentic \nchannel by which the pentester can obtain any information that may be necessary for \nthe testing process. Once the test requirements have been identified, the client should \nvalidate them in order to remove any misleading information. This will ensure that \nthe developed test plan is consistent and complete.\nCreating the customer requirements form\nWe have listed some of the commonly asked questions and considerations that \nmay be used as a basis to create a conventional customer requirements form. It is \nimportant to note that this list can be extended or shortened according to the goal \nof a client.\n•\t\nCollect basic information such as company name, address, website, contact \nperson(s) details, e-mail address, and telephone number(s).\n•\t\nDetermine the key objectives behind the penetration testing project.\n•\t\nDetermine the penetration test type (with or without specific criteria):\n°°\nBlack box testing\n°°\nWhite box testing\n°°\nExternal testing\n°°\nInternal testing\n°°\nSocial engineering included\n°°\nSocial engineering excluded\n°°\nInvestigate employee background information\n°°\nAdopt employee's fake identity (legal council may be required)\n°°\nDenial of service included\n°°\nDenial of service excluded\n°°\nPenetrate business partner systems\n•\t\nHow many servers, workstations, and network devices need to be tested?\n•\t\nWhich operating system technologies are supported by your infrastructure?\n•\t\nWhich network devices need to be tested? Firewalls, routers, switches, load \nbalancers, IDS, IPS, or any other appliances?\n•\t\nAre disaster recovery plans in place? If yes, whom should we contact?\n•\t\nAre there any administrators currently managing your network?\n•\t\nIs there any specific requirement to comply with industry standards? If yes, \nlist them.\n" }
{ "page_number": 97, "text": "Target Scoping\n[ 76 ]\n•\t\nWho will be the point of contact for this project?\n•\t\nWhat is the timeline allocated for this project? \n•\t\nWhat is your budget for this project?\n•\t\nList any miscellaneous requirements, if necessary.\nThe deliverables assessment form\nThe following is an example of the type of items expected from a deliverables \nassessment form. This list is not holistic and items should be added or removed \nbased on customer expectations and needs:\n•\t\nWhat types of reports are expected?\n°°\nExecutive reports\n°°\nTechnical assessment reports\n°°\nDeveloper reports\n•\t\nIn which format do you prefer the report to be delivered? PDF, HTML, \nor DOC.\n•\t\nHow should the report be submitted? Encrypted e-mail or printed?\n•\t\nWho is responsible for receiving these reports?\n°°\nEmployee\n°°\nShareholder\n°°\nStakeholder\nBy using such a concise and comprehensive inquiry form, you can easily extract the \ncustomer requirements and fulfill the test plan accordingly.\nPreparing the test plan\nAs the requirements have been gathered and verified by a client, it is time to draw \na formal test plan that should reflect all of these requirements, in addition to other \nnecessary information on the legal and commercial grounds of the testing process. \nThe key variables involved in preparing a test plan are structured testing process, \nresource allocation, cost analysis, non-disclosure agreement, penetration testing \ncontract, and rules of engagement. Each of these areas is addressed with their short \ndescriptions as follows:\n" }
{ "page_number": 98, "text": "Chapter 3\n[ 77 ]\n•\t\nStructured testing process: After analyzing the details provided by your \ncustomer, it may be important to restructure your testing methodology. \nFor instance, if the social engineering service is about to be excluded, you \nwould have to remove it from the formal testing process. Sometimes, this \npractice is known as test process validation. It is a repetitive task that has \nto be revisited whenever there is a change in client requirements. If there \nare any unnecessary steps involved during the test execution, it may result \nin a violation of the organization's policies and incur serious penalties. \nAdditionally, based on the test type, there would be a number of changes \nto the test process. As an example, white box testing may not require the \ninformation gathering and target discovery phases, because the tester is \nalready aware of the internal infrastructure. \nThe validation of the network and environment data may \nbe useful regardless of the test type. After all, the client \nmay not know what their network really looks like!\n•\t\nResource allocation: Determining the expertise knowledge required to \nachieve the completeness of a test is one of the substantial areas. Thus, \nassigning an appropriately skilled penetration tester to a certain task may \nresult in better security assessment. For instance, an application penetration \ntesting requires a knowledgeable application security tester. This activity \nplays a significant role in the success of the penetration testing assignment.\n•\t\nCost analysis: The cost for penetration testing depends on several factors. \nThis may involve the number of days allocated to fulfill the scope of a \nproject, additional service requirements such as social engineering and \nphysical security assessment, and the expertise knowledge required to assess \nthe specific technology. From an industry viewpoint, this should combine a \nqualitative and quantitative value.\n•\t\nNon-disclosure Agreement (NDA): Before starting the test process, it is \nnecessary to sign an NDA agreement that will reflect the interests of both \nparties: the client and penetration tester. Using such a mutual non-disclosure \nagreement should clear the terms and conditions under which the test \nshould be aligned. The penetration tester should comply with these terms \nthroughout the test process. Violating any single term of agreement can \nresult in serious penalties or permanent exemption from the job.\n" }
{ "page_number": 99, "text": "Target Scoping\n[ 78 ]\n•\t\nPenetration testing contract: There is always the need for a legal contract \nthat will address the technical and business matters between the client and \npenetration tester. This is where the penetration testing contract comes in. \nThe basic information in such contracts focuses on what testing services are \nbeing offered, their main objectives, how they will be conducted, payment \ndeclaration, and maintaining the confidentiality of the whole project. It is \nhighly recommended that you have this document created by an attorney or \nlegal counsel, as it will be used for most of your penetration testing activities.\n•\t\nRules of engagement (ROE): The process of penetration testing can be \ninvasive and requires a clear understanding of the assessment's demands, \nsupport provided by the client, and type of potential impact or effect each \nassessment technique may have. Moreover, the tools used in the penetration \ntesting processes should clearly state their purpose so that the tester can use \nthem accordingly. The rules of engagement define all of these statements in \na more detailed fashion to address the necessity of the technical criteria that \nshould be followed during the test execution. You should never cross the \nboundaries set within the pre-agreed upon ROE. \nBy preparing each of these subparts of the test plan, you can ensure that you have \na consistent view of the penetration testing process. This will provide a penetration \ntester with more specific assessment details that have been processed from the client \nrequirements. It is always recommended that you prepare a test plan checklist, \nwhich can be used to verify the assessment criteria and its underlying terms with \nthe contracting party. One of such exemplary types of checklist is discussed in the \nfollowing section.\nThe test plan checklist\nThe following is an example of a set of questions that should be answered correctly \nbefore taking any further steps in the scope process:\n•\t\nAre all the requirements promised during the RFP being met?\n•\t\nIs the test scope defined clearly?\n•\t\nHave all the testing entities been identified?\n•\t\nHave all the non-testing entities been separately listed?\n•\t\nIs there any specific testing process that will be followed?\n•\t\nIs the testing process documented correctly?\n•\t\nWill the deliverables be produced upon the completion of a test process?\n•\t\nHas the entire target environment been researched and documented before?\n•\t\nHave all the roles and responsibilities been assigned for the testing activities?\n" }
{ "page_number": 100, "text": "Chapter 3\n[ 79 ]\n•\t\nIs there any third-party contractor to accomplish technology-specific \nassessment?\n•\t\nHave any steps been taken to bring the project to a graceful closure?\n•\t\nHas the disaster recovery plan been identified?\n•\t\nHas the cost of the test project been finalized?\n•\t\nHave the people who will approve the test plan been identified?\n•\t\nHave the people who will accept the test results been identified?\nProfiling test boundaries\nUnderstanding the limitations and boundaries of the test environment goes hand \nin hand with the client requirements, which can be justified as intentional or \nunintentional interests. These can be in the form of technology, knowledge, or any \nother formal restrictions imposed by the client on the infrastructure. Each limitation \nimposed may cause a serious interruption to the testing process and can be resolved \nusing alternative methods. However, note that certain restrictions cannot be \nmodified as they are administered by the client to control the process of penetration \ntesting. We will discuss each of these generic types of limitations with their relevant \nexamples as follows:\n•\t\nTechnology limitations: This type of limitation occurs when the scope of \na project is properly defined but the presence of a new technology in the \nnetwork infrastructure does not let the auditor test it. This happens only \nwhen the auditor does not have any pen-testing tool that can assist in \nthe assessment of this new technology. For instance, a company XYZ has \nintroduced a robust GZ network firewall device that sits at the perimeter and \nworks to protect the entire internal network. However, its implementation of \nproprietary methods inside the firewall does not let any firewall assessment \ntool work. Thus, there is always a need for an up-to-date solution that can \nhandle the assessment of such a new technology.\n•\t\nKnowledge limitations: The knowledge limitations of a pentester can \nhave a negative impact if their skill level is narrow and he or she is not \ncapable of testing certain technologies. For example, a dedicated database \npenetration tester would not be able to assess the physical security \nof a network infrastructure. Hence, it is good to divide the roles and \nresponsibilities according to the skills and knowledge of the pentester to \nachieve the required goal.\n" }
End of preview.

No dataset card yet

New: Create and edit this dataset card directly on the website!

Contribute a Dataset Card
Downloads last month
20