Skip to main content

A tool for checking missing HTTP security headers

Project description

vulheader

A Python tool to check for missing HTTP security headers on websites. It can check for the presence of security headers like Strict-Transport-Security, Content-Security-Policy, X-Frame-Options, X-Content-Type-Options, Referrer-Policy, and Permissions-Policy.

Installation

To install the package, run:

pip install vulheader

Usage

You can use vulheader both as a Python package and as a command-line tool.

As a Python Package

You can use the check() function to check for specific headers or all headers.

Check for a specific header

To check if a specific header is present or missing, use the following code:

import vulheader

url = "https://example.com"

result = vulheader.check(url, "Strict-Transport-Security")
if result == "missing":
    print("Strict-Transport-Security: Missing")
else:
    print("Strict-Transport-Security: Present")

You can replace "Strict-Transport-Security" with any of the following headers to check for their presence:

  • Strict-Transport-Security
  • Content-Security-Policy
  • X-Frame-Options
  • X-Content-Type-Options
  • Referrer-Policy
  • Permissions-Policy

Check all headers at once

You can also check for all security headers at once:

import vulheader

url = "https://example.com"

header_status = vulheader.check(url)

for header, status in header_status.items():
    print(f"{header}: {'Present' if status == 'present' else 'Missing'}")

As a Command-Line Tool

Once installed, you can use vulheader directly from the command line to check the headers of a website.

Check for all headers

To check for all security headers:

vulheader --url https://example.com

Check for a specific header

To check for a specific header, use the -H option followed by the header name:

vulheader --url https://example.com -H "Strict-Transport-Security"

Replace "Strict-Transport-Security" with any of the following headers:

  • Strict-Transport-Security
  • Content-Security-Policy
  • X-Frame-Options
  • X-Content-Type-Options
  • Referrer-Policy
  • Permissions-Policy

Checking all headers:

Strict-Transport-Security: Missing
Content-Security-Policy: Present
X-Frame-Options: Missing
X-Content-Type-Options: Missing
Referrer-Policy: Missing
Permissions-Policy: Missing

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vulheader-1.0.0.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vulheader-1.0.0-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file vulheader-1.0.0.tar.gz.

File metadata

  • Download URL: vulheader-1.0.0.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.2

File hashes

Hashes for vulheader-1.0.0.tar.gz
Algorithm Hash digest
SHA256 072b2750e9dad123a6a39c4fb79dce61f5a829391900dcaa05d01228c0a20001
MD5 af4c2d81d857023a5f5e0461ec60de72
BLAKE2b-256 8103d19511ea938993ff795ef2b90eadc3b14ab6bd28c9fc2041862297dbd9d5

See more details on using hashes here.

File details

Details for the file vulheader-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: vulheader-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.2

File hashes

Hashes for vulheader-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9ac4ec4e7f7b6a8036f7daff3fcf56168150b5f350527e7fc7a1f8fa7cc308a6
MD5 eff92523e5bdda721da5c40e893b5b3f
BLAKE2b-256 eb036bf3b6866571bff5d251866681e66aaea4ff7b8af93cc9a6d531d28e4483

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page