Advanced JavaScript File Discovery and Security Analysis Tool
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pensity-1.0.0.tar.gz.
File metadata
- Download URL: pensity-1.0.0.tar.gz
- Upload date:
- Size: 20.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cf3ecce57f513bb9ba01c03942524aabce165cbf7e6f4d00100bec5ad5f39cf4
|
|
| MD5 |
2a9ea9b27261a069b756fc4e63a1f98d
|
|
| BLAKE2b-256 |
6e68a4fde5364ac2a4f785e0d18fb61dd423f863c47b214c3e9710b76c9803ae
|
File details
Details for the file pensity-1.0.0-py3-none-any.whl.
File metadata
- Download URL: pensity-1.0.0-py3-none-any.whl
- Upload date:
- Size: 19.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
454dcc9cd8c405996c9c356647de5af613069b65ab273a13964783f214ae8f55
|
|
| MD5 |
15f1eaac9b8e121132bf381978838b3a
|
|
| BLAKE2b-256 |
1e7931a104ca8b6d9a54406c33bdbe43e4fa47f15629c7450898f9cee3f259f0
|