Skip to main content

Pensity - Advanced JavaScript File Discovery and Security Analysis

Pensity is a powerful OSINT and security analysis tool that discovers, analyzes, and reports on JavaScript files, HTML pages, and API endpoints. With optional AI-powered vulnerability analysis using LLMs, it helps security researchers and penetration testers identify potential security issues in web applications.

Features

🔍 JavaScript Discovery & Analysis

  • Discovers JS files through crawling and parsing
  • Pattern-based security analysis (API keys, JWT tokens, hardcoded credentials, endpoints)
  • Comprehensive reporting with findings categorization

🌐 HTML Page Discovery

  • Fuzzy search for common HTML pages (login, admin, register, etc.)
  • Index.html parsing for linked pages
  • Tests 30+ common HTML page variations

🎯 Endpoint Testing

  • Tests 164+ common endpoints from curated list
  • Reports interesting HTTP status codes
  • Tracks response times and headers
  • Color-coded output for quick analysis

🤖 AI-Powered Security Analysis (Optional)

  • LLM-based vulnerability analysis
  • JavaScript code security review
  • HTML form and XSS vulnerability detection
  • Endpoint response security analysis
  • Generates comprehensive markdown reports

Installation

Using pip (recommended)

pip install pensity

Using pipx (for isolated installation)

pipx install pensity

With LLM support

pip install pensity[llm]

Quick Start

# Basic JavaScript analysis
pensity -u https://example.com --js

# HTML discovery
pensity -u https://example.com --html

# Endpoint testing
pensity -u https://example.com --fetch

# Full analysis with LLM
pensity -u https://example.com --js --html --fetch --llm

# Combined with custom options
pensity -u https://example.com --js --html --llm -d 2 -t 10 --delay 0.5

Usage

Command Line Options

pensity -u URL [OPTIONS]

Required:
  -u, --url URL              Target website URL

Analysis Modes (at least one required):
  --js                       Discover and analyze JavaScript files
  --html                     Discover and analyze HTML files
  --fetch                    Test common endpoints

Optional:
  --llm                      Run LLM analysis on discovered items
  -o, --output FILE          Save text report to file
  --json FILE                Save JSON report to file
  -d, --depth DEPTH          Discovery depth (1-3, default: 1)
  -t, --threads NUM          Number of threads (default: 5)
  --timeout SECONDS          Request timeout (default: 10)
  --delay SECONDS            Delay between requests
  --verify-ssl               Enable SSL verification
  --proxy URL                HTTP/HTTPS proxy URL
  --allow-subdomains         Include subdomains in crawl scope

Examples

JavaScript Security Analysis

pensity -u https://example.com --js --llm

Discovers JS files and analyzes them for:

  • Hardcoded credentials and API keys
  • JWT tokens and authentication issues
  • Exposed endpoints and sensitive URLs
  • Cryptographic weaknesses
  • XSS and injection vulnerabilities

HTML Page Discovery

pensity -u https://example.com --html --llm

Finds and analyzes HTML pages for:

  • Forms without CSRF protection
  • Insecure authentication forms
  • Information disclosure in comments
  • Missing security headers
  • Client-side validation bypasses

Endpoint Testing

pensity -u https://example.com --fetch --llm

Tests 164+ common endpoints and analyzes:

  • Information disclosure via errors
  • Authentication/authorization weaknesses
  • Exposed sensitive data
  • Server misconfigurations
  • Debug information leaks

Full Security Audit

pensity -u https://example.com --js --html --fetch --llm -d 2 -t 10

LLM Analysis

When using --llm, Pensity generates a timestamped markdown report (llm-YYYYMMDD-HHMMSS.md) containing:

  • Executive summary with counts
  • Separate sections for JS, HTML, and endpoints
  • Detailed security analysis for each item
  • Severity assessments and recommendations

Requirements:

  • Install LLM library: pip install llm
  • Configure your LLM model (OpenAI, Anthropic, etc.)

Output

Console Output

  • Color-coded results (green for success, yellow for warnings, red for errors)
  • Real-time progress tracking
  • Summary statistics

Text Reports

  • Comprehensive findings in text format
  • Organized by category
  • Source URLs and context

JSON Reports

  • Structured data for automation
  • Easy integration with other tools
  • Full metadata preservation

LLM Markdown Reports

  • Professional security analysis
  • Table of contents with links
  • Detailed vulnerability descriptions
  • Recommended remediation steps

Common Endpoints

The tool tests 164+ endpoints including:

  • Authentication: /login, /auth, /oauth, /sso
  • Admin panels: /admin, /dashboard, /console
  • APIs: /api, /graphql, /rest
  • Config: /config, /setup, /.env, /.git
  • And many more...

See common-endpoints.txt for the full list.

Contributing

Contributions are welcome! Please feel free to submit issues and pull requests.

License

MIT License - see LICENSE file for details.

Author

iosec - @ynsmroztas

Disclaimer

This tool is for authorized security testing and research purposes only. Always obtain proper authorization before testing any systems you do not own.

Metadata

Release files for pensity 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pensity 1.0.0
File Size Uploaded
pensity-1.0.0.tar.gz 20.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pensity 1.0.0
File Interpreter ABI Platform
pensity-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 39.8 kB

Release files / pensity-1.0.0.tar.gz

Download URL pensity-1.0.0.tar.gz
Size 20.9 kB
Tags Source
SHA-256 checksum
How to use checksums
cf3ecce57f513bb9ba01c03942524aabce165cbf7e6f4d00100bec5ad5f39cf4
BLAKE2b-256 checksum
How to use checksums
6e68a4fde5364ac2a4f785e0d18fb61dd423f863c47b214c3e9710b76c9803ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.2

Release files / pensity-1.0.0-py3-none-any.whl

Download URL pensity-1.0.0-py3-none-any.whl
Size 19.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
454dcc9cd8c405996c9c356647de5af613069b65ab273a13964783f214ae8f55
BLAKE2b-256 checksum
How to use checksums
1e7931a104ca8b6d9a54406c33bdbe43e4fa47f15629c7450898f9cee3f259f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.2

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page