# Kali Linux Eyewitness Tool Training

## Section 1: Introduction

In the realm of penetration testing, having the right tools at your disposal can significantly enhance your ability to gather information and present your findings effectively. One such indispensable tool is **Eyewitness**, a powerful utility that automates the process of taking screenshots of web applications and gathering relevant metadata. This section will guide you through the installation, configuration, and practical usage of Eyewitness in a Kali Linux environment, ensuring you master this tool for your penetration testing endeavors.

## 1.1 Installation and Configuration on Kali Linux

Eyewitness is included in the Kali Linux distribution, but it’s essential to ensure you have the latest version and dependencies installed for optimal performance. Follow these steps to install and configure Eyewitness:

### 1.1.1 Update Kali Linux

Before you begin the installation, it's a good practice to ensure your system is up to date. Open a terminal and run the following commands:

"`bash
sudo apt update && sudo apt upgrade -y
"`

### 1.1.2 Install Eyewitness

If Eyewitness is not already pre-installed, you can install it via the Kali repository with these commands:

"`bash
sudo apt install eyewitness
"`

### 1.1.3 Verifying Installation

Once the installation is complete, verify that Eyewitness is installed correctly by checking the version:

"`bash
eyewitness –version
"`

You should see output indicating the version of Eyewitness installed.

### 1.1.4 Configuration Settings

Eyewitness relies on certain dependencies to function correctly. Ensure the following are installed:

"`bash
sudo apt install git
sudo apt install python3 python3-pip
sudo pip3 install -r /usr/share/eyewitness/requirements.txt
"`

Also, Eyewitness can use the Chromium web browser for taking screenshots. If it is not installed, you can install it with:

"`bash
sudo apt install chromium
"`

### 1.1.5 Setting Up Dependencies

Eyewitness also requires a few additional tools and libraries. Install the following:

"`bash
sudo apt install libxslt1-dev
sudo apt install libjpeg-dev
"`

By ensuring these dependencies are in place, you will set yourself up for a seamless experience while using Eyewitness.

## 1.2 Step-by-Step Usage and Real-World Use Cases

Now that Eyewitness is installed and configured, let’s explore how to use it effectively. Eyewitness can operate in various modes: capturing screenshots, generating reports, and gathering site information. Here are detailed steps for general usage.

### 1.2.1 Basic Usage

To get started with Eyewitness, you need a list of URLs that you want to analyze. Here’s how you can run Eyewitness:

1. **Create a target list file**: Create a file called `targets.txt` and add the URLs you want Eyewitness to scan, one per line.

Example `targets.txt` content:
[/dm_code_snippet]
http://example1.com
http://example2.com
[/dm_code_snippet]

2. **Run Eyewitness**: Execute the following command in the terminal:


eyewitness –web –urls targets.txt –report-dir /path/to/report

Replace `/path/to/report` with the desired directory where you want to save the report.

### 1.2.2 Options and Parameters

Eyewitness comes with several options to customize its behavior:

– `–web`: Specify that you want to run the tool against web URLs.
– `–urls`: Path to the file containing target URLs.
– `–report-dir`: Directory to save the generated reports.
– `–timeout`: Set a timeout for how long Eyewitness will wait for a response from each target.
– `–all-protocols`: Use this flag if you want to scan both HTTP and HTTPS URLs.

#### Example Command

To utilize all available flags:

"`bash
eyewitness –web –urls targets.txt –report-dir ~/eyewitness_reports –timeout 10 –all-protocols
"`

### 1.2.3 Analyzing the Report

After the execution, Eyewitness generates an HTML report in the specified directory. Open it in your browser:

"`bash
xdg-open ~/eyewitness_reports/eyewitness.html
"`

This report will include screenshots of the websites, HTTP response headers, and other useful metadata that can be invaluable during a pentest.

### 1.2.4 Real-World Use Cases

1. **Web Application Assessment**: When conducting a security assessment on a web application, Eyewitness allows penetration testers to quickly visualize the web interface. This can help identify outdated frameworks, insecure configurations, or other visible vulnerabilities.

2. **Phishing Assessment**: In a phishing assessment, Eyewitness can be employed to capture screenshots of phishing sites created as part of the test, allowing the assessment team to analyze and report on the effectiveness of the phishing campaign.

3. **Network Reconnaissance**: During the reconnaissance phase, you can use Eyewitness to gather information about all web applications accessible from your target network. The screenshots and HTTP headers can give insights into the technologies used and potential weaknesses.

## 1.3 Detailed Technical Explanations and External Reference Links

Understanding the inner workings of Eyewitness enhances your effectiveness as a pentester. Here's a deeper look into some of its key functionalities.

### 1.3.1 Screenshot Capturing Mechanism

Eyewitness uses a headless browser (similar to how Selenium operates) to capture website screenshots. By utilizing Chromium in headless mode, Eyewitness is able to navigate websites without rendering a visible user interface, which speeds up the process.

### 1.3.2 Metadata Collection

Alongside screenshots, Eyewitness gathers HTTP response headers, page titles, and server information. This metadata is crucial for identifying misconfigurations and ensuring compliance with industry standards.

### 1.3.3 Error Handling and Reporting

Eyewitness includes error handling mechanisms to ensure you receive meaningful output even if some URLs fail to load. The report identifies problematic URLs and provides error messages, enabling you to troubleshoot issues efficiently.

### External Resources

– [Kali Linux Official Documentation](https://www.kali.org/docs/)
– [Eyewitness GitHub Repository](https://github.com/FortyNorthSecurity/EyeWitness)
– [Selenium Documentation](https://www.selenium.dev/documentation/en/)

By mastering the Eyewitness tool within your Kali Linux environment, you equip yourself with an essential resource that enhances your capabilities in penetration testing and cybersecurity assessments. Its ease of use combined with powerful reporting features makes it a valuable tool in your arsenal.

Made by pablo rotem / פבלו רותם

Pablo Guides