Webhead Check is a Python script for analyzing HTTP security headers. It processes a single URL or a list of URLs and generates a report highlighting the presence or absence of critical security headers. Designed for security professionals, it helps assess the security posture of web applications.
- Checks for the following security headers:
X-Frame-OptionsX-Content-Type-OptionsStrict-Transport-SecurityContent-Security-PolicyReferrer-PolicyPermissions-PolicyCross-Origin-Embedder-PolicyCross-Origin-Resource-PolicyCross-Origin-Opener-Policy
- Single URL Mode: Displays results directly in the terminal.
- List Mode: Processes multiple URLs from a file and generates a color-coded Excel report:
- Green for headers implemented.
- Red for headers missing.
- Real-time progress updates with a user-friendly progress bar.
- Python 3.6 or later.
- Clone this repository or copy the script to your local machine.
- Install the required dependencies:
pip install -r requirements.txt
Run the script with one of the following options:
Use the -u or --url option to analyze a single URL and display the results in the terminal.
python webhead_check.py -u <url>Example:
python webhead_check.py -u https://example.comUse the -l or --list option to analyze a list of URLs from a file and generate an Excel report.
python webhead_check.py -l <list_file> [-o <output_file>]Example:
python webhead_check.py -l urls.txt -o headers_reportThis command will process the URLs in urls.txt and create an Excel report named headers_report.xlsx.
-u,--url: Analyze a single URL.-l,--list: Path to the file containing the list of URLs (one URL per line).-o,--output: Name of the output Excel file. Defaults tosecurity_headers_report.xlsx. If only a name is provided, the.xlsxextension will be added automatically.
For single URL analysis:
- Results are displayed in the terminal.
For multiple URL analysis:
- The script generates an Excel file with the following structure:
- Column 1: URL
- Columns 2+: Security headers
- Each cell indicates whether the header is implemented (
Header Implemented) or missing (Header Not Implemented).
requestspandasopenpyxltqdm
This script is open-source and available under the MIT License. Feel free to modify and use it as per your requirements.