tester book by

Exploring the World of Hacking & Penetration Testing

Understanding Unauthorized Access

Hacking is the act of gaining unauthorized access to a protected system. It has evolved with the growth of networks and the Internet. It's even been used to steal military reports from other countries.

Methodology Behind Security Testing

Penetration testing is a security testing methodology. It imitates the methods of malicious hackers and has emerged as a crucial tool against their tactics. An appealing aspect is the opportunity it provides for bug bounty hunters to earn money and secure websites and applications.

Penetration Testing: Three Varieties

Black box testing, white box testing, and gray box testing are the three methods of penetration testing. Each one of these methods comes with its own set of advantages and disadvantages, equipped to evaluate the target network infrastructure with varying degrees of internal information.

Key Stages of Penetration Testing

The penetration testing process can be broken down to five stages. From preliminary interaction and information collection, it moves onto vulnerability scanning and exploitation, and finally concludes with report writing.

Kali Linux: A Tester's Tool

When it comes to platforms suitable for penetration testing, Kali Linux is a prominent choice. Formerly known as BackTrack Linux, this distribution offers a wide range of pre-installed tools for penetration testing, catering to various needs that range from port scanning to password cracking.

The Importance of Legal Authorization

Despite the tempting prospect of uncovering vulnerabilities, it is absolutely essential to obtain legal authorization before initiating penetration testing. Failure to do so can lead to severe legal consequences.

Understanding and Installing Kali Linux on a Virtual Machine

Exploring Kali Linux

This chapter focuses on the installation of Kali Linux, a widely-used hacking distro, in a virtual machine. It explains how to download and choose the appropriate image file of Kali Linux, which includes both the stable released version and the weekly updated version. It also provides insights about different desktop environments, recommending GNOME primarily.

The Role of VMware

The next part of the chapter guides readers through the installation process of VMware software, a highly-regarded virtual machine software for Windows. It provides step-by-step instructions on how to obtain and install the software. This part is crucial to understand, as virtual machines like VMware are often recommended to avoid system crashes and data loss.

Creating a Kali Linux Virtual Machine

The final section of this chapter explains how to create a Kali Linux virtual machine using VMware and how to install the operating system in the virtual machine. This includes the choice of specific memory and disk space settings, as well as the requirements for modifying settings and loading the image file.

Kali Linux: Physical Machine Installation

Benefits of Physical Machine Installation

The text elucidates the significance of the physical machine installation of Kali Linux. Users can enjoy a more realistic penetration-testing experience with a physical machine than with a virtual one.

Preinstallation Key Steps

Preparing the installation medium and partitioning the hard drive are essential before putting Kali Linux onto a physical machine. An installation medium such as a USB card requires an ISO/img file, making the Win32Disk Imager tool crucial.

Using Win32Disk Imager Tool

We first need to install the Win32Disk Imager tool before it is used to write ISO/img files. The installation steps include downloading the software package and following the provided instructions.

Preparation of the Hard Disk

An important preparation step is partitioning the hard disk. A separate disk or partition is ideal for the Kali Linux installation to avert data loss. This partitioning can be done manually or automatically during installation.

Mastering Kali Linux Abilities for Penetration Testing

Unfolding Kali Linux Capacities

The chapter introduces Kali Linux as a potent operating system, particularly for its terminal and network capabilities designed for penetration testing. It emphasizes to have a Kali Linux operating system installed to better comprehend the tools and concepts detailed.

Key Features of Kali Linux

Kali Linux offers a multitude of penetration testing tools, found in sections like information collection, vulnerability analysis, and web programs. These tools can run on either a graphical interface or a command line, referring to the specific documentation for proper commands is crucial.

Unique File System Structure

The Linux file system is outlined differently than Windows, with one root directory where all files are stored. Plus, there are essential Linux directories, including the home directory, root directory, and directories like /bin, /sbin, /etc, /usr, and /var.

Introducing the Terminal: Kali Linux's Effective Tool

The terminal in Kali Linux is a command-line tool for file management and running commands not available in the graphical interface. It can be accessed by either clicking the terminal button in the favorites section or selecting the Open in Terminal command through right-clicking on the desktop.

Potent Text Editor: Vi

Common terminal operations require text editors like Vi. The Vi text editor works in three different modes: command mode, input mode, and last line mode. Acquainting with these modes is necessary for efficient file editing and saving.

Navigating Configurations in Kali Linux

Accessing the Settings Panel

The Settings Panel in Kali Linux allows users to set various system settings such as resolution, power supply, background color, and network connection. It's an essential feature for implementing operations in the system. The panel can be conveniently accessed by clicking on the display application button in the favorites folder, then selecting the settings button.

Simplifying Wired Network Setups

The networking features in this panel permit users to configure wired networks, wireless networks and VPNs. In particular, wired networks are stable and suggested for downloading large files or updating the system. Users can configure the wired network either through commands, or with the aid of a graphical interface.

Network Configuration via Interface Settings

For configuration of the wired network through the graphical interface, users need to select the Network setting item from the Settings panel. A network setting dialog box appears. The user can then specify the method for obtaining an IPv4 address, manually determine the IP address, subnet mask, and gateway, thereby completing configuration.

Command Line Configurations

Configurations can also be achieved via the command line with just a few commands. The network connection configuration file is located at /etc/network/interfaces. By using the VI editor, users can modify the file and incorporate the information of the Ethernet interface ethX.

Wireless Network Configurations

Configuring a wireless network requires determining whether the host has a wireless network card. Using the 'ifconfig' command, the user can check the activation of the wireless network interface. To connect to a Wi-Fi network, the user can select the Wi-Fi option and open the WiFi dialog box in the graphical interface of Kali Linux.

VPN Network Setup

Setting up a VPN network in Kali Linux involves installing requisite software packages and configuring the network. With the installation of the network-manager-openvpn-gnome package and restart of the network manager, a VPN network can be added in the Settings Panel. Users can set the name, server address, login username, and password for the VPN connection.

Conclusion

The Settings Panel in Kali Linux is a vital tool for setting system configurations and networking features like wired networks, wireless networks, and VPNs. It provides the user with both command-line and graphical interface configuration options, which cater to their distinct needs.

Understanding Software Source Configuration in Kali Linux

Role of Software Source and Its Efficiency-Enhancing Functions

The text defines software source as an application installation library, housing a large amount of application software. Managing and organizing this software source improves the efficacy of software installation, making it a more straightforward process.

Nuts and Bolts of Software Source Format

Software sources aren't uniformly constructed. Their structure can include various elements, such as location, download address, version, and catalogs that users need to familiarize themselves with.

Kali Linux's Official & Third-Party Software Sources

Kali Linux provides its users with an official software source. However, users are also given the flexibility of integrating third-party software sources they frequently employ.

Updating Software Source and System

Updating the software source/system is mandatory to execute successful source configuration. Users must regularly update this source/system to ensure efficiency.

Installation Requires Package Name Confirmation

One can't proceed with software installation from a software source without verifying the package's name. This step is critical to successful installation.

Keyword-Based Package Searches

The users can search the software packages using either commands or keywords. This utility makes the software source increasingly user-friendly and approachable.

APT-File Command and Package Structure

The apt-file command is handy to study the package structure and confirm the package's included files. This command offers an unparalleled understanding of package components.

APT-Get Commands for Software Installation and Updation

Users can install or update software using unique commands known as apt-get install or apt-get upgrade. These commands are required tools in any software source.

AP-Get Commands for Software Removal

Unwanted software can be removed using commands named apt-get remove or apt-get purge. These utilities provide users with clean and efficient system management tools.

Software Source Examples

As an example, Kali Linux's official software source is provided as 'deb http://http.kali.org/kali kali-rolling main non-free contrib.' Users can achieve enhanced network stability and download speed by integrating third-party software sources. For instance, one needs to install the open-vm-tools tool in Kali Linux to unlock file sharing and the drag-and-drop feature between the host and a virtual machine.

Navigating Through Kali Linux

Understanding Kali Linux

Kali Linux is a penetration testing operating system that comes pre-installed with various security tools. However, some tools, like Nessus, need to be downloaded and installed from third-party sources. The installation methods for different software formats (such as .deb, tar.gz, tar.bz2, zip, and rar) are explained.

Navigating Binary Software Packages

Binary software packages such as .deb or .rpm can be easily installed by downloading and unpacking them. Examples include Nessus, a binary package, where the recommended steps include downloading and using the dpkg command to install it.

Working with Source Code Packages

Source code packages usually come in .tar.gz or .tar.bz2 formats and require the user to compile them. Packages like Subterfuge or Firefox can be installed by using the tar command to decompress before configuring, compiling, and installing them.

Various Syntax for Decompression

Different syntax formats for decompressing tar.gz and tar.bz2 packages are available. An example is demonstrating the decompression of Subterfuge using tar zxvf command and the installation of Firefox from a tar.bz2 package is also explained.

Starting Software

There are different methods for starting software which include graphical interface mode, command line mode, and command line prompt. Users can start software like Wireshark, Metasploit framework, and DirBuster using any of these methods.

Executing Scripts in Kali Linux

Execution methods for scripts written in Ruby, Python, Perl, and Shell are described. This part of the tutorial provides insights into installing dependencies and running the scripts within the context of Kali Linux.

Understanding Drivers in Kali Linux

Device Interaction in Kali Linux

Drivers are special software that facilitate the communication between a computer and its hardware devices. Kali Linux has a unique kernel that supports almost all device drivers. However, some devices, such as graphics cards, may need manual installation due to their specific requirements.

Detailing Device Information

Running specific commands on Kali Linux provides a detailed breakdown of device information. The 'lsusb' command reveals USB device list data, while the 'lspci' command displays PCI device details. Both commands elaborate on the attributes like bus number, device number, and manufacturer ID of each respective device.

Virtual Machine and Device Connection

For virtual machines, users have to manually connect their USB devices and initiate the USB service of the virtual machine. This process is instrumental, especially when a wireless network card with a USB interface is utilized in wireless penetration testing.

Installing Drivers and Backups

When it comes to driver installation in Kali Linux, it is essential to safely back up crucial data first. Then the kernel header files need to be installed to enable the installation of driver packages. The open source Nouveau driver drives Nvidia graphics cards in Kali Linux, while for 3D acceleration, the official Nvidia driver can be installed.

Essentials of Networking and Penetration Testing

Discovery Host

The chapter shares information on identifying a host, which includes finding active hosts and getting details about them. Methods for this process are active scanning, where probes are sent to hosts to verify their activity, and passive monitoring, which involves watching network traffic for active hosts.

IP Address Rules

Much-needed guidance on IP address rules and notation is discussed. It is revealed that an IP address is a 32-bit binary number divided into 4 8-bit binary numbers utilizing dot notation. The chapter also elaborates on the different classes of IP addresses (A to E) and their ranges and specifies the purpose and characteristics of each class.

Determine Network Topology

Stressing heavily on the significance of determining a network's topology during penetration testing, the chapter gives insights on how this information aids the tester in deciding if the target is a local or external network. Furthermore, the significance of the Trace-route tool in obtaining routing entries and network topology is highlighted, coupled with a useful scenario of how to trace a target host using the same tool.

Active Scanning in Network Security

Understanding Active Scanning

Chapter 10's key focus is active scanning, which can identify if a host is currently active. A probe request packet is dispatched and a response is anticipated from the host. Two essential tools for active scanning, Nmap and Netdiscover, are introduced.

Nmap: A Peerless Scanning Tool

Nmap is an exceptional scanning and sniffing tool. It can assess whether numerous hosts are online, scrutinize host ports, and predict the operating system in operation. The usage syntax is 'nmap -sP [target]', where [-sP] is used for Ping scan and [target] denotes the target location.

Exemplifying Nmap's Functionality

An application scenario validates if the host with IP address 72.132.234.64 is online. Notably, many hosts can be simultaneously examined by specifying an array of IP addresses in the command.

Netdiscover: Master of ARP Investigations

Netdiscover shines as a tool for ARP investigations. It provides support for both active and passive modes. The syntax for using it is 'netdiscover -r [range]', where [-r range] stipulates the network scope to be scanned.

Practical Use of Netdiscover

In an exemplary situation, Netdiscover scans online hosts in the 72.132.234.64/94 network segment. Analyzing the retrieved packets can reveal active host IP addresses, MAC addresses, as well as MAC address manufacturers.

Tackling Network Monitoring Techniques

ARP monitoring is a technique that helps discover active hosts on the network by observing ARP broadcast packets. Another such technique, DHCP snooping, involves analyzing DHCP discover broadcast packets to identify online hosts.

Importance and Techniques of Domain Analysis

Essence of Domain Analysis in Penetration Testing

Domain analysis is an important step in penetration testing as it provides detailed information about a target's domain name. This refers to a string of names separated by dots that represents a computer group's name on the internet. Key details such as domain name owner information, subdomain name, and server address can be derived from a careful analysis of the domain name.

Diverse Tools for Domain Analysis

Various tools and techniques are applicable in carrying out domain analysis. The WHOIS tool and the DMitry are popularly used. They are instrumental in obtaining a domain's basic information including revealing sensitive parameters and subdomains, which are treated as separate domains.

Challenges of Domain Analysis

The process of domain analysis may not always yield complete information. This is primarily due to the restrictions placed on access to domain information by administrators and developers to maintain privacy and protect against unauthorized users. Hence, other sources of information are essential for effective penetration testing.

WHOIS as a Tool for Domain Analysis

WHOIS is a significant tool used in acquiring user-related information attached to a specific account or domain name. Such data include the registration status of the domain, the domain name registrar, and the owner of the domain name.

The DMitry Tool in Domain Analysis

The DMitry tool is a versatile integrated information gathering tool used by pentesters. It collects diverse WHOIS information including host IP, domain name, subdomains, and email addresses associated with domain names.

Finding Subdomains Using DMitry and Online Queries

The DMitry tool is beneficial in discovering subdomains. Although using the Google search engine, it may have limitations if the website under scrutiny is blacklisted by Google. An alternative includes online query techniques such as searching for subdomains on specific websites.

Decoding Domain Server Discovery

Understanding Human and Computer Communication

Chapter 12 digs into the procedure of pinpointing servers through their domain names. The book explains that humans access websites using domain names, but computers within a network can only recognize each other with IP addresses.

DNS: The Bridge Between Humans and Computers

Domain name servers (DNS) come into play when querying hosts based on domain names. Varied domain name records including A, MX, and NS records are used in this process.

Deciphering IP Addresses

The chapter proposes three techniques to identify servers and obtain their IP addresses. These are through the Dnsenum tool, the Nslookup tool, and the Ping command.

Probing into Dnsenum Tool

Dnsenum is a valuable tool that helps collect domain name information, perform reverse lookups, and retrieve host address information, DNS server details, and mail exchange records.

The Role of Nslookup Tool

Nslookup is a noteworthy tool used to rectify issues in DNS servers and gain the IP address of a corresponding server via domain name resolution.

Ping Command: A Quick Check

The Ping command is utilized to test network connectivity and establish the IP address currently in use by a server. It stands effective for inspecting network connectivity and identifying IP addresses of servers in operation.

Exploring the Fundamentals of Port Scanning

Understanding Network Technology & Ports

Ports play a significant role in network technology as they separate various services on a single IP address. The two crucial protocols leveraging ports are TCP and UDP, with their port numbers functioning independently of each other.

Classification of Ports

Ports fall into two primary categories - reserved and registered. The registered variant permits users to write servers and is frequently the preferred choice.

Nmap and DMitry: Essential Port Scanning Tools

Tools such as Nmap and DMitry are readily used for port scanning. Nmap, particularly, can decode six different port states, such as open, closed, filtered, unfiltered, open/filtered, and closed/filtered.

An Overview of Port States

Different port states identified by Nmap include open, closed, filtered, unfiltered, open/filtered, and closed/filtered. Understanding these states aids in effective port scanning.

Hands-on Port Scanning With Nmap

A practical application of Nmap involves scanning a host's default 1000 ports to discern which are open. The command 'nmap 192.243.176.84' executes this task efficiently. Specific port ranges, such as 'nmap -p 1-50 192.243.176.84', can also be scanned.

Utilizing DMitry for Port Scanning

Like Nmap, the DMitry tool is also a viable option for port scanning. With the 'dmitry -p 192.243.176.84' command, one can survey the target host's open ports, providing useful results about the ports' status.

Identifying Operating Systems: A Guide

Penetration Testing and OS Identification

This section introduces the method of identifying the operating system of a target host in penetration testing. Understanding the operating system allows technicians to strategically locate vulnerabilities in the target system.

The Role of TTL Values

Identification can be carried out based on the Time To Live (TTL) value of the IP packet response. Each operating system has unique TTL values thus, utilizing the Ping command can aid in determining the target system type.

The Efficiency of NMAP Tool

NMAP tool stands out as another option for identifying operating systems. It’s reputed for more accurate results compared to TTL-based identification.

Unveiling Service Vulnerability Identification Tools

Service Identification for Vulnerabilities

The process of service identification helps in revealing the versions of services, thus disclosing any probable weaknesses in outdated versions. Various tools are utilized for this purpose, helping in the identification of possible exploits.

Importance of service identification Tools

A commonly utilized tool for service version identification is Nmap, and it is routinely used with the –sV option. The data it produces comprises of service and version besides the state and port

Advantages of the Amap Tools

The Amap tools, namely amap and amapcrap, are another set of useful resources for service identification. They are especially known for their proficiency in recognizing services relying on non-ASCII encoding or uncommon ports.

Usage of the smbclient Tool

The smbclient tool is another significant asset for service identification purposes. It aids in accessing files shared via the SMB service and garnering essential data about the file system's structure.

Features of the snmpcheck Tool

The snmpcheck tool is particularly beneficial for enumerating SNMP devices and acquiring host data. Its capabilities extend to providing a diverse range of information, including network, interface, and routing data, to system and user account information.

Harnessing Maltego for Effective Penetration Testing

Understanding Maltego's Role

The text delves into the utilisation of the Maltego tool in carrying out efficient information analysis and sorting during penetration testing. It guides users on how to set up the tool, which includes registering an account and choosing an appropriate startup mode.

Getting Started with Maltego

Once registered, users are guided on how to operate the Maltego tool in a Normal Privacy Mode from the step-by-step instructions provided. The benefits of this mode and its suitability for internet data gathering are highlighted.

Organizing and Analyzing Data

Users are provided guidance on how to leverage the Maltego tool to categorize and examine host information using IP address entities. This offers a systematic and intuitive approach in information representation.

Organizing Domain Name Information

Asides using IP address entities, Domain entities are also used by Maltego to help systematically organise and dissect domain name information. This provides users with greater flexibility and control over the information they gather.

Unleashing Maltego's Transforms

The text ends by exploring the use of Transforms in Maltego to gather more information. Using wikipedia.com as an example, the power of Transforms for domain names is touched upon, providing valuable insights to users.

Exploring System Vulnerabilities

Unmasking Vulnerabilities

Vulnerabilities are defects in a target system that can be exploited by attackers. Scanning for such vulnerabilities constitutes an imperative phase of penetration testing. Tools like Nessus and OpenVAS are typically employed for systematic vulnerability scanning.

Tackling Weak Passwords

Weak passwords and improper permission settings emerge as common types of vulnerabilities. Through brute force attacks, penetration testers can infringe systems that are armed with weak passwords. Such breaches can often lead to unauthorized access.

Navigating Software Vulnerabilities

Software vulnerabilities frequently stem from developer negligence or limitations of the programming language. These can have serious implications, as they can lead to unauthorized actions such as the deletion of important files or alteration of passwords.

Understanding Hardware Vulnerabilities

Hardware vulnerabilities are housed within hardware devices or chips. Thorough comprehension of these vulnerabilities is crucial for the next phase in ethical hacking: Learning to use Nessus, a robust vulnerability scanning tool.

Understanding and Installing Nessus on Kali Linux

Introduction to Nessus

Nessus is a widely used system vulnerability scanning and analysis software that provides a complete vulnerability scanning service and constantly updates its vulnerability database. It can be operated locally or remotely and is popular among penetration testers.

Installing Nessus on Kali Linux

To install Nessus on Kali Linux, users need to download the installation package from the official website and select the appropriate version for their operating system. The Nessus service must be activated using an activation code before it can be used.

Activating Nessus

To activate Nessus, users need to obtain the activation code from the provided website by registering and providing their information. Trust and security exceptions need to be added before creating an account and entering the activation code.

Utilizing Nessus for Scanning

Once Nessus is installed and activated, users can start the Nessus service and use it to scan for vulnerabilities. In the next chapter, the configuration and usage of Nessus for scanning vulnerabilities will be discussed.

Mastering Nessus for Effective Vulnerability Scanning

Strategizing with Nessus

The text initiates a discourse on constructing and initiating an attack using Nessus, a renowned vulnerability scanning tool.

It explicates a systematic module on creating new scanning strategies and tasks, which can significantly streamline the setup operation.

Nessus' Myriad Templates

Nessus offers users an ample variety of strategy templates, leaving enough room for customization, specificity, and precision.

Building a Unique Strategy

To construct a unique strategy, users will need to log in to the Nessus service and select the 'New Policy' option prominently displayed on the left column.

User can enable or disable vulnerability plug-ins curated for specific targets and scanning needs.

The Importance of Scan Tasks

Once a scanning strategy is in place, the users then need to formulate a new scan task which will actively perform the vulnerability scanning.

Scan Execution and Monitoring

When the process of vulnerability scanning commences, users can launch the scan task, oversee its progress, and view all scanned results.

These results offer comprehensive information about the scanned hosts and their respective vulnerability statistics.

Scan Results Across Formats

Nessus offers the feature of exporting scan results in a range of diverse formats like Nessus, PDF, HTML, CSV, and Nessus DB.

Analyzing and Reporting Vulnerabilities

Users can dive deep into the vulnerabilities brought about by the scanning software to generate detailed reports which can be presented to system administrators or developers, further aiding in ensuring system security.

Unfolding The OpenVAS System

Understanding OpenVAS

OpenVAS is an open vulnerability assessment system. Comprising of a server and network vulnerability testing tools, it can identify potential security risks in remote systems and applications.

Installation process

Not included by default in Kali Linux 2019, OpenVAS requires a Linux command for its installation. Necessary files and dependent software packages are automatically detected and downloaded during this process.

Initialization and Set-Up

Following its installation, OpenVAS requires an initialization process. This involves downloading files as per the latest availability. OpenVAS also automatically generates a default account and password during initialization.

User Control

Users have the ability to change the automatically generated password post initialization with the help of a command. For troubleshooting installation errors, users can utilize the openvas-check-setup command. Lastly, OpenVAS service status can be tracked using the netstat command.

Executing OpenVAS Configuration and Scanning

Accessing OpenVAS

For OpenVAS login, users require addressing into the browser and granting exceptions for the HTTPS link. This can be done with simple credentials like username and password.

Establishing New Scan Configuration

When creating a new scan configuration, users have the opportunity to specify the plugins required for scanning the designated target. The Configuration|Scan Configs command facilitates this process.

Formulating a Scan Target

Via the Configuration|Targets command, users can effectively create a scan target, an action that involves recording target name, host address, and a list of ports.

Setting Up a Scan Task

Using the Scans|Tasks command, a scan task can be initiated. This requires setting the task name, scan configuration, and the scan target.

Launching Vulnerability Scans

Post-configuration, vulnerability scanning can start. An actionable start button on the scan task interface enables this feature. The scanning process though might be slow, yet refreshing the page often or setting it for automatic refresh can help.

Analyzing Scan Results

Scanning results can be reviewed with severity level of vulnerabilities taken into perspective. Results can also be filtered differently to facilitate easy comprehensibility.

Exporting Scan Reports

Users have the liberty to export vulnerability scan reports in various formats, which includes PDF, XML, CSV, HTML, and TXT to name a few.

Downloading Scan Reports

Selecting the desired format and saving it in a preferred location enables users to download the report file effectively.

Security Implications of OpenVAS Configuration

Configuring OpenVAS forms a crucial step in effectively carrying out vulnerability scanning, which is paramount in ensuring system security.

Understanding Network Sniffing and Man-in-the-Middle Attacks

Importance of Sniffing

Sniffing is a crucial skill for hackers and network administrators to comprehend and master. It facilitates the interception and theft of confidential information from a network. This is significantly worrisome in public spaces and hotspots where individuals access networks with no encryption, simplifying the process for attackers to obtain passwords and credit card details.

Functioning of Man-in-the-Middle Attacks

Man-in-The-Middle attacks entail placing a hacker-controlled computer between two communicating computers in a network. This setup enables the attacker to intercept and manipulate network communication data. ARP spoofing and DNS spoofing are standard methods for managing a Man-in-the-Middle attack, tricking the correspondents into unknowingly routing their data through the attacker's system.

Implementation Tools for Attacks

Professional tools such as arpspoof and Ettercap assist in executing Man-in-the-Middle attacks. Arpspoof is a specialized ARP spoofing gadget capable of directly spoofing the gateway and enabling data packet interception and capture by the attacker. Ettercap is a sniffing tool rooted in ARP address spoofing, suitably designed for local area networks. Both of these tools offer a graphical interface and a command-line mode for the implementation of attacks.

Understanding Social Engineering Techniques

Exploiting Human Vulnerabilities

In this segment, the focus is on social engineering attacks and how they leverage people's weaknesses. The text introduces the idea of using the Social Engineering Toolkit (SET) in Kali Linux, a Python-based tool for social engineering penetration testing.

Toolkit for Social Engineering

The chapter dives into how to get started with SET and select various forms of social engineering attacks. There's also a discussion on implementing web attack vectors with SET and duplicating websites to obtain user data.

Web and PowerShell Attack Vectors

Another area of focus is the PowerShell attack vector, which necessitates creating a PowerShell file to establish a remote connection. Attention is also given to how SET supplies different templates and methods for implementing these web attack vectors.

DNS Spoofing and User Login Capture

Additional concepts include using DNS spoofing for web attack vectors to deceive users into visiting cloned sites. Notably, the text also discusses how web attack vectors can be used for capturing user login information.

Penetration Attack Code Files

The closing stage of the chapter sheds light on how PowerShell attack vectors create penetration attack code files. Furthermore, it illustrates how PowerShell attack vectors allow for remote sessions with the attacker's host.

Real-Life Applications of SET

Some practical examples from the text show us how to get started with SET and selecting a social engineering attack. Tips are given on how to implement both web attack vectors and PowerShell attack vectors using SET. These examples illustrate practical methods to use these concepts in real-life scenarios.

Exploring Network Data with Wireshark and Driftnet

Understanding Packet Capture with Wireshark

Packet capture is a critical aspect of network data analysis, realised by using tools like Wireshark. This tool enables users to scrutinise data packets involved in a man-in-the-middle attack. The process includes initiating the attack, running Wireshark, choosing the listening interface, capturing the data packets, and ultimately saving the gathered package to a file.

Delving into Image Capture using Driftnet

Driftnet provides a unique perspective on network data analysis with its keen focus on image capture. It works well with Ettercap to diligently capture all images viewed by the targeted host. The method for utilising driftnet includes performing the man-in-the-middle attack, activating driftnet, and storing the observed images.

Monitoring Techniques for HTTP and HTTPS Data

Unraveling HTTP Data

The text dives into monitoring HTTP data using a technique known as man-in-the-middle attacks with a particularly useful tool called Ettercap.

Deciphering HTTPS Data

HTTPS data, on the other hand, can be decrypted and kept track of through the SSLStrip tool.

Introduction to Xplico

This highlights Xplico, a tool that enables swift analysis of network data procured with Wireshark.

ARP Spoofing with Ettercap

Ettercap is not just for HTTP data but can also be wielded for ARP spoofing attacks to keep an eye on target hosts.

SSLStrip’s Capabilities

SSLStrip is quite versatile, with the ability to capture sensitive information transmitted on HTTPS encrypted websites.

Using Xplico

To fully employ Xplico, it needs to be installed and the service initiated to dig into network data.

Extracting Data with Xplico

Xplico is valuable for extracting various elements from captured data packets, like webpage content, images, and videos.

Understanding Xplico's Process

However, before you can launch into analyzing capture files with Xplico, cases and sessions must be set up.

Details from Xplico

The Xplico interface provides comprehensive information about the capture file, encompassing a variety of packet types like HTTP, MMS, Emails and so on.

Types of Data Packets

Users using Xplico can access different types of data packets such as images, videos, visited sites and complete web pages.

Exploring the Metasploit Framework

Metasploit: A Multifunctional Tool

Metasploit is an open source security vulnerability detection tool that helps identify security issues and complete security assessments. It offers functions such as intelligent development, code auditing, web application scanning, and social engineering.

Framework's Array of Modules and Plugins

The Metasploit framework provides a large number of penetration testing modules and plug-ins. These include exploits, auxiliary modules, post-infiltration attack modules, attack payload modules, encoder modules, empty instruction modules, and evasion modules.

From Discovery to Successful Attack

Metasploit is a free and downloadable framework for network security professionals that enables discovery, exploitation and submission of vulnerabilities. For instance, exploits are used to attack and gain access control rights of the target system.

Achieving Remote Control

After a successful penetration attack, the framework unlocks remote control connections via attack payload modules. These are embedded codes designed to run on the target system.

Understanding the Metasploit Framework

Modes of Metasploit Framework

The Metasploit framework has two means of operation: Armitage, a graphical interface, and Msfconsole, a terminal mode. These interfaces allow for both automated and manual configurations of vulnerability attacks.

Launching Armitage

Users initiate Armitage by navigating to the 'Applications' and 'Vulnerability Exploitation Tool Set' options. Once connected, Armitage displays available modules, targeted system information, and assigned Metasploit tags.

Starting Terminal Mode

The terminal mode, or Msfconsole, is prompted with the 'msfconsole' command. This terminal hosts a variety of attack modules for functions like initiating infiltration attacks and setting up listeners.

Preparation for Kali Linux

Before employing Metasploit on Kali Linux, the PostgreSQL database must be activated and initialized. This process forms the required databases and configurations.

Workspace Utilization

Metasploit has a feature to create multiple workspaces for organizing tasks and data. This prevents confusion by keeping tasks separate and organized.

Third-Party Reports Import

Metasploit supports the incorporation of scan reports from third-party sources. This provides a comprehensive view of hosts and their services after report importation, simplifying the analysis of host information.

Frameworks Versatility

The Metasploit framework exhibits its adaptability through the graphical interface of Armitage and the flexible operations of Msfconsole terminal mode. This allows workspaces for streamlined tasks and enables the importation of third-party scan reports for efficient host analysis.

Unlocking the Power of Metasploit

Understanding the Metasploit Module

The text enlightens on the penetration testing module in Metasploit- designed for vulnerability scanning. It enables the discovery and importation of said modules into Metasploit, for the intent of exploiting potential weak points in systems.

Stepping Through Metasploit

The material further provides detailed and simple steps on how to pre-analyze scan reports, search manually for attack payloads, and find external modules on websites such as CVE Details and exploitDB.

Importation of External Modules

The process of how to import these third-party modules into Metasploit for penetration testing is also carefully explained.

Mastering Metasploit: Step by Step

Understanding Metasploit Attacks

The text begins by equipping its readers with knowledge on how to perform an attack using the popular penetration testing tool, Metasploit. This is accomplished by finding an appropriate vulnerability exploiting module to load the attack payload.

Configuring the Payload

Upon loading the attack payload, the following step includes configuring the payload. This important phase includes using the 'show options' command to see and set parameters, preparing for the subsequent attack.

Implementing the Attack

Once the payload is loaded and configured, the actual attack can be implemented by executing the 'exploit' command, as the penetration testing modules support multiple system architectures.

Manually Setting Architecture

Users can manually set the architecture or target ID so as to make the attack more effective. The supported syntax for this operation is 'set target [id]'.

Successful Encoding for Payload

To avoid detecting or intercepting the attack, users need to set up the encoding of the payload effectively. The encoding module is usually operated by the msfvenom tool—an attack payload generator.

Practical Examples: Payload Loading, Setting Architecture, and Encoding

Step-by-step examples on loading the attack payload for a specific module, setting up the architecture for a vulnerability module, and setting the encoding for the attack payload are provided, offering a hands-on approach to using Metasploit effectively.

Advanced Attacking with Metasploit

PostgreSQL Database Penetration

The text explores the process of executing penetration attacks on PostgreSQL database services. An integral tool utilized for this purpose is the postgrs_login module. The module is specifically configured and deployed to detect valid usernames and passwords.

PDF Virus File Creation

Merits of creating PDF virus files for passive penetration testing attacks are detailed. The Adobe PDF Embedded EXE module, properly configured, facilitates the creation of these files. The actualization of this exploit results in the generation of the PDF virus file.

Exploiting the MS17_010 Vulnerability

The more complex use of the MS17_010 vulnerability forms another key subject. Its application in attacks on Windows Server 2008 R2 (x64) is made possible using the smb_ms17_010 module. This process includes configuring the module, executing the exploit, and the subsequent implementation of the penetration test and Meterpreter session establishment.

Mastering Meterpreter Session Control

Commanding Meterpreter Sessions

Chapter 32 focuses on commanding a Meterpreter session after successful penetration testing. It details various commands that let us control the session and extract data from the target host.

Neutralizing Antivirus Software

The chapter speaks about turning off antivirus software with the 'run killav' command. This enables the penetration tester to work covertly.

Detailed Information Acquisition

We also learn how detailed target host information is gathered. Commands like 'sysinfo', 'run scraper', and 'run post/windows/gather/checkvm' are introduced for this purpose.

Navigating the Target Host's File System

Another theme of the chapter is file system command usage. It teaches how to navigate and manipulate files using commands like pwd, ls, and rm.

File Transfer Techniques

We learn about the 'upload' and 'download' commands for file transfers. These are critical for moving in and retrieving required files.

Capturing Keystrokes

The chapter instructs on how to capture keystrokes using 'keyscan_start' and 'keyscan_dump' commands. This is a way to log target host activities.

Screenshot Tool Usage

The 'screenshot' command for capturing target host screens is explained. This can provide a live view of a target user's actions.

User Details and Privilege Escalation

Lastly, there's a discussion on user enumeration, privilege escalation, and fetching user passwords. We learn all these through the use of Meterpreter commands.

Mastering Metasploit and Meterpreter Techniques

Binding Metasploit for Persistence

The chapter elaborates on binding an exploit using Metasploit for persistence. Meterpreter when run alone can easily be detected. However, binding it with another ongoing process can bolster its persistence.

Executions via Meterpreter

The chapter further dwells on running programs using Meterpreter's execute command. This essentially facilitates penetration testers to execute applications on the targeted system.

Enabling Remote Access

The process of enabling remote desktop and subsequently logging in remotely is discussed. Upon enabling the remote desktop using a particular command, the idle time of the remote user can be verified. The chapter concludes by detailing the steps to link to the desktop remotely using the rdesktop command.

Understanding System Penetration: Commands and Techniques

Creating a Persistent Backdoor

The text explains how a persistent backdoor can be established in a target system. This ensures automatic reconnection upon the system's startup, providing continuous access. This is achieved using the 'run persistence' command.

Establishing a Local Listener

The process of initiating a listener locally is outlined as well. This is done by using the 'exploit/multi/handler' module for automatic connection with the attacking host upon the restart of the target host.

Eradicating Traces of Penetration

The 'clearev' command is introduced as an effective way to remove any evidence of the penetration testing activity. This ensures that the attacker remains undetected by the target system.

The Concept of Building a Springboard

The text presents the idea of constructing a springboard, in which a vulnerable host is used as a platform to infiltrate other hosts within the network. Furthermore, routing entries must be added to ensure successful penetration of other hosts in a different network.

Putting the Attack Session in Background

The 'background' command can be employed to place the attack session in the background. Alongside, the 'route add' command aids in adding routing entries for effective penetration of different hosts.

Automating Addition of Routing Entries

The 'load auto_add_route' command facilitates automatic addition of routing entries. This speeds up the process and enhances the efficiency of the penetration testing activity.

Exploiting Different Hosts

The 'exploit' command can be used to perform penetration testing on other hosts. This extends the scope of the penetration testing, ensuring a thorough evaluation of system vulnerabilities.

Introduction to Anti-Virus Attack Payloads on Kali Linux

Veil Evasion: An Overview

Present within Kali Linux is a tool known as Veil Evasion that designs attack payload files allowing them to slip past anti-virus programs. Users need to execute the command "apt-get install veil-evasion -y" for Veil Evasion to be installed on Kali Linux. Once it has been installed, initiating the tool is as simple as typing "veil".

Required Dependencies

However, there are certain dependencies that need to be fulfilled for the Veil tool to be operable. These include Python 3.4.4, pywin32-220, pycrypto-2.6.1, Ruby 1.8.7-p371, and Autolt v3.3.14.2. After this necessary software is put in place, the Veil tool can be activated.

Creating an Attack Payload

The process for forming an anti-virus attack payload using Veil Evasion is fairly straightforward. First, the Veil Evasion tool has to be flagged up ("use Evasion") before arranging the attack payloads ("list"). Finally, an attack payload is chosen and the LHOST is set. The attack payload is then generated using the command "generate".

Command Line Payload Generation

Alternatively, attack payloads can also be conceived in command line mode. This process involves running the command "veil -t Evasion -p cs/meterpreter/rev_tcp.py --ip 192.168.195.150 --port 4444 payload.rc".

Utilizing the Attack Payload

After successfully creating the attack payload, it's time to put it to use. This involves creating a remote listener through Metasploit's exploit/multi/handler module. After doing this, a listener will be created on the chosen IP address and port. As soon as the target host executes the attack payload file, a remote session can be attained.

Examples from the Text

Three concrete examples featured in the text relate to installing Veil Evasion in Kali Linux, producing an anti-virus attack payload via Veil Evasion, and setting up a remote listener using Metasploit's exploit/multi/handler module to obtain a remote session.

Understanding Wireless Networks

Building Wireless Networks

Wireless networks are simple to build with a wireless router and client. It is a less complex process compared to setting up wired networks.

Key Components of Wireless Networks

The composition of such a network generally includes a router (AP) and one or more clients (STA).

Workflow in Wireless Networks

Common steps in the functioning of a wireless network include SSID broadcasting, probe requests, and subsequent authentication and association negotiation.

The Role of the 802.11 Protocol

Popularly employed as a WLAN standard, the 802.11 protocol facilitates wireless access within local and campus networks.

Variations of the 802.11 Protocol

There exist different standards within the 802.11 protocol framework, including the likes of 802.11b, 802.11a, and its successor, 802.11ac.

Different Frequency Bands for Different Protocols

These varying versions of the 802.11 standard typically use different frequency bands, such as the 2.4GHz and 5GHz bands.

The 2.4GHz Band

This band comprises 13 channels, with some degree of overlapping observed.

The 5GHz Band

In contrast, the 5GHz band has five channels, and is often selected when there are few surrounding signals.

Understanding Bandwidth

In the context of these protocols, 'bandwidth' pertains to channel bandwidth and can range from 20MHz to 40MHz in 802.11n.

Bandwidth Selection Criteria

The bandwidth chosen depends on the number of APS operating in the vicinity and is often influenced by the need for optimal transmission speed.

Ensuring Security through Wireless Encryption

Essential Wireless Network Security

Wireless network security is necessary to protect wireless networks. There are three common encryption methods used: WEP, WPS, and WPA/WPA2. Users may choose to connect to a wireless network without encryption, but this provides no security.

Demerits of Password-Free Mode

Password-free mode is not recommended for security reasons. It allows for quick networking but has no protective measures.

Deprecated WEP Encryption

WEP (Wired Equivalent Privacy) is an encryption method but is not widely used anymore due to its vulnerabilities. While it can protect transmitted data, it possesses inherent flaws.

Secure yet Crackable WPA/WPA2

WPA/WPA2 (Wi-Fi Protected Access) is a more secure encryption method, but it is still possible to crack the password. Despite its shortcomings, it's widely utilized for its enhanced security properties.

Convenience of WPS

WPS (Wi-Fi Protected Setup) is an option for simplifying wireless network setup. It offers an optional authentication method, aiding in streamlined networking.

Securing Networks to Prevent Unauthorized Access

It is important to secure wireless networks to prevent unauthorized access. This encapsulates the essential goal of Wi-Fi security measures, to safeguard sensitive data.

Understanding Wireless Network Monitoring

Understanding Wireless Network Modes

Wireless network monitoring allows users to capture and monitor data packets in a wireless network. To do this, the wireless network card needs to be set to monitor mode. Among the various working modes for wireless network cards, the four primary ones are Managed mode, Ad hoc mode, Master mode, and Monitor mode.

Significance of Choosing the Right Network Card

The right choice of a wireless network card is crucial for monitoring purposes. Certain specific chips are recommended for different WiFi networks. These network cards need to support monitor mode for an effective wireless network monitoring.

Setting the Monitor Mode

The airmon-ng command is used to set the wireless network card to monitor mode. Syntax for setting up the monitor mode is 'airmon-ng start [interface]'. However, for 5GHz WiFi network cards, different steps are involved for chips RT3572 and RTL8812AU. The RTL8812AU chip, in particular, requires driver installation and manual setting of the monitor mode.

Importance of Scanning Wireless Networks

Scanning wireless networks is a vital part of penetration testing which requires basic information such as AP name, MAC address, and working channel. The scanning results are subsequently analyzed to select the suitable tools for penetration testing.

Wireless network scanning made easy

Understanding Airodump-ng tool

The Airodump-ng tool is a part of the Aircrack-ng toolset that can be used to scan for wireless network signals around you. This tool provides you with detailed information about open access points (APs) such as their names, MAC addresses, channels and encryption methods.

The syntax that the tool uses for scanning wireless networks is 'airodump scan' followed by the wireless network card interface. It displays the output information in a structured manner with columns for BSSID, PWR, Beacons, Data and so on.

Sniffing With Kismet

Kismet is another tool you can use for wirelessly sniffing the networks and monitoring the signals in your environment. To scan the wireless networks using Kismet, you would need to start the tool with the 'kismet start' command.

Kismet prompts the user to set up preferences and then displays a user interface where you can view the information about the scanned networks and packets. Once in the system, users can choose from the menu to view details of APs and connected clients. It even provides information on MAC addresses, working channels and the encryption methods used by the APs.

Practical Examples

The Airodump-ng tool captures wireless signal packets and shares detailed information about the surrounding open APs, including their MAC addresses, channels and encryption methods. For example, the PWR column in the output information of Airodump-ng shows the signal level reported by the network card, and higher values suggests closer proximity to the AP.

In contrast, you can use Kismet to scan wireless networks where you can set preferences and view information about scanned networks and packets. This includes crucial details about APs, connected clients and encryption methods.

Cracking Wireless Network Passwords and Protective Measures

Cracking WEP Encrypted Passwords

The article explains how to crack WEP encrypted wireless network passwords using the airplane-ng tool. It provides step-by-step instructions for starting monitoring mode, scanning for networks, capturing data packets, implementing ARP injection attacks, and finally cracking the password using a dictionary.

Breaking WPA/WPA2 Network Passwords

The article also describes the process of cracking WPA/WPA2 encrypted wireless network passwords through brute force using the aircraft-ng tool. It outlines the steps of monitoring mode, scanning for networks, capturing data packets, using a death attack to obtain a handshake packet, and finally conducting brute force cracking with a password dictionary.

Securing Wireless Networks

In addition to attacking wireless networks, the article emphasizes the importance of protective measures to secure wireless networks. It suggests changing default router settings, disabling SSID broadcasting, turning off WPS/QSS function, enabling MAC address filtering, and setting up complex passwords to enhance security. These measures help prevent unauthorized access and protect sensitive data.

Mastering the Art of Password Cracking

Understanding Password Cracking

This chapter delves into the art of creating dictionaries for brute-forcing passwords, a method widely applied by hackers to infiltrate protections. It emphasizes the significance of formulating a comprehensive password dictionary and describes the strategies to create one.

Information Collection for Dictionary

The discourse explores the collection of fodder for the password dictionary, which includes email addresses, website blog posts, and personal names. Pooling such data remarkably boosts the probability of cracking passwords, making the technique impactful.

Analysis of Password Policy

A detailed account is given on password policy analysis, which focuses on understanding the protocols integrated into various software and systems. Talk on devising reinforcement strategies to create an even more effective targeted password dictionary occupies insight.

Creating a Password Dictionary

When looking to stage a password attack, having a well-built password dictionary becomes indispensable. Using the valuable information obtained, such as email address and personal identities, one can construct a plausible and efficient dictionary.

Tools for Password Analysis

One can leverage the statsgen tool in Kali Linux to glean important data from existing password dictionaries. Metrics like password length, complexity, character sets, and masks can be analyzed using this tool, aiding in the design of a more commanding password dictionary.

Creating Effective Password Cracking Tools

The Basics of Password Dictionaries

Generating a password dictionary is an important step in password cracking. Different tools are available to aid in this process, including Crunch, rsmangler, and rtgen.

The Power of Crunch

Crunch is a password dictionary generator that facilitates user customization. With built-in options for password length and character sets, Crunch allows for the generation of vast dictionary files.

Unlocking Passwords with Rsmangler

Rsmangler is another essential tool, operating by generating a dictionary from an inputted word list. This input file would hold your collected password words, transforming them into an expansive dictionary file.

RTGen: The Rainbow Table Master

Rtgen, a tool that generates pre-calculated hash values known as rainbow tables, expedites the process of password cracking. It allows the specification of hash algorithm, character set, and password length for optimal results.

Importance in Password Cracking

Generating a password dictionary is understandably crucial in password cracking. Utilizing tools like Crunch, rsmangler, and rtgen can help produce custom dictionaries and rainbow tables for effective password cracking.

Breaking Down Hashed Password Cracking

Demystifying Hash Password Encryption

Hash encryption is used to secure passwords by converting them into fixed-length strings. Identifying the hash encryption method is crucial for cracking the password efficiently. The hashid tool can be used to identify the encryption method of a hash password value.

The Role of LM Hashes in Password Security

LM Hashes is one of the earlier password hashing algorithms used in Windows. The findmyhash tool can be used to crack LM Hashes passwords. The syntax format for using findmyhash includes specifying the algorithm and available options.

The Art of Exploiting Vulnerabilities

Exploiting vulnerabilities can allow the use of hashed passwords without cracking them. The exploit/windows/smb/psexec module in the Metasploit framework enables the use of hashed passwords in penetration testing. Steps for using the psexec module involve obtaining the hash password, configuring options, and executing the exploit.

A Systematic Approach to Password Cracking

Cracking hashed passwords requires a systematic approach and the use of specific tools and methods. This involves identifying the encryption method, using the appropriate tools, like hashid and findmyhash, and in some cases, exploiting system vulnerabilities.

Efficiency in Hash Password Cracking

The hashid tool can be used to identify the encryption method of a hash password value. This helps save time and improve the efficiency of cracking by using targeted tools and methods.

Unlocking Windows Systems

Using the findmyhash tool, one can crack LM Hashes passwords by specifying the algorithm as LM and providing the hash value. This allows penetration testers to gain unauthorized access to Windows systems.

Bypassing Password Verification

The exploit/windows/smb/psexec module in the Metasploit framework allows the direct use of hashed passwords by exploiting vulnerabilities. Penetration testers can bypass password verification by using the hashdump command and executing the exploit.

Mastering Advanced Password Cracking Techniques

Utilman: A Tool for Bypassing Windows Login

One intriguing method described is bypassing Windows login using Utilman. This unique process involves replacing the Utilman.exe file with cmd.exe. As a result, users can gain full access to the system without the hindrance of the login authentication mechanism.

Router Passwords: Easier to Crack Than You Think

Also discussed is the technique of cracking passwords on routers. Given that most routers come with preset usernames and passwords, they become ready targets for cracking. Tools such as Medusa turn out handy in brute-forcing router passwords.

How to Crack Linux User Passwords

There's a dedicated section that offers an understanding of how to crack Linux user passwords. This involves extracting the /etc/shadow and /etc/passwd files and deploying password cracking tools like John. One important note is that you should have read permissions for these files while cracking Linux passwords.

Share:

Similar Books