LogicPwn represents a paradigm shift from traditional security testing toward intelligent, business-aware security automation. Its unique focus on business logic vulnerabilities, combined with enterprise-grade performance and comprehensive documentation, positions it as a leader in the next generation of security testing tools.
Project description
๐ LogicPWN
Automated Business Logic Vulnerability Testing
Test for IDOR, authorization bypasses, and business logic flaws in just 3 lines of code
๐ Quick Start โข ๐ Documentation โข ๐ก Examples โข ๐ค Community
๐ฏ What is LogicPWN?
LogicPWN is a Python security testing framework that makes finding business logic vulnerabilities as easy as:
from logicpwn import quick_idor_test
results = quick_idor_test("https://api.example.com", "/api/users/{id}", [1, 2, 3, "admin"])
print(results['summary']) # Found 2 IDOR vulnerabilities out of 4 tests
Why LogicPWN?
โก Simple3 lines of code
vs
20+ lines before
85% less code for common tasks |
๐ฏ Powerfulโข IDOR Testing
โข Auth Bypass
โข Exploit Chains
โข Business Logic
Enterprise-grade features |
๐ FastAsync support
Batch testing
Caching
Rate limiting
Test 1000+ endpoints |
โจ Key Features
๐ Authentication
|
๐ฏ Vulnerability Testing
|
โก Exploit Chains
|
๐ Reporting
|
๐ Quick Start (30 seconds)
๐ฆ Installation
pip install logicpwn
๐ฏ Your First Test
Test for IDOR vulnerabilities:
from logicpwn import quick_idor_test
# Test if users can access each other's data
results = quick_idor_test(
target_url="https://api.example.com",
endpoint_pattern="/api/users/{id}",
test_ids=[1, 2, 3, "admin", "guest"]
)
print(results['summary'])
Output:
Found 2 IDOR vulnerabilities out of 5 tests
Pass Rate: 60.0%
๐ With Authentication
from logicpwn import SecurityTester
with SecurityTester("https://api.example.com") as tester:
# Authenticate
tester.authenticate("testuser", "password123")
# Test for vulnerabilities
results = tester.test_idor("/api/users/{id}", [1, 2, 3])
# Export report
results_obj = SecurityTestResult(**results)
results_obj.export_json("security_report.json")
๐ฌ See It in Action
# Clone and try the examples
git clone https://github.com/Infernus007/LogicPWN.git
cd LogicPWN/examples/library_usage
python 01_minimal_idor_test.py
๐ก Use Cases
๐ Find IDOR Vulnerabilities
from logicpwn import SecurityTester
with SecurityTester("https://api.example.com") as tester:
tester.authenticate("user", "pass")
# Test user endpoints
results = tester.test_idor("/api/users/{id}", [1, 2, 3, 100, 999])
if results['vulnerable_count'] > 0:
print(f"โ ๏ธ Found {results['vulnerable_count']} IDOR vulnerabilities!")
for vuln in results['vulnerabilities']:
print(f" โข {vuln.endpoint_url}")
๐ช Test Authorization Bypass
from logicpwn import SecurityTester
with SecurityTester("https://api.example.com") as tester:
tester.authenticate("regular_user", "password")
# Check if admin endpoints are exposed
admin_results = tester.test_unauthorized_access([
"/api/admin/users",
"/api/admin/settings",
"/api/admin/logs"
])
if admin_results['vulnerable']:
print(f"๐จ {len(admin_results['accessible'])} admin endpoints exposed!")
๐ Run Multi-Step Exploit Chains
from logicpwn import quick_exploit_chain
# Execute complex attack sequences from YAML
results = quick_exploit_chain("price_manipulation_test.yaml")
successful = sum(1 for r in results if r.status.value == "success")
print(f"Completed {successful}/{len(results)} steps")
if successful == len(results):
print("๐จ Vulnerability confirmed: Price manipulation possible!")
๐ Generate Compliance Reports
from logicpwn import SecurityTester
from logicpwn.results import SecurityTestResult
# Run tests
with SecurityTester("https://api.example.com") as tester:
tester.authenticate("user", "pass")
results = tester.test_idor("/api/users/{id}", [1, 2, 3])
# Generate reports
result_obj = SecurityTestResult(
test_type="IDOR Security Audit",
target_url="https://api.example.com",
total_tests=results['total_tested'],
vulnerabilities=results['vulnerabilities'],
safe_endpoints=results['safe_endpoints']
)
# Export in multiple formats
result_obj.export_json("audit_report.json") # For automation
result_obj.export_markdown("audit_report.md") # For documentation
result_obj.export_csv("audit_report.csv") # For Excel
๐ค CI/CD Integration
# security_tests.py
from logicpwn import quick_idor_test
import sys
results = quick_idor_test(
"https://staging.example.com",
"/api/users/{id}",
[1, 2, 3]
)
# Fail CI/CD pipeline if vulnerabilities found
if results['vulnerable_count'] > 0:
print(f"โ Security check failed: {results['summary']}")
sys.exit(1)
else:
print(f"โ
Security check passed!")
sys.exit(0)
GitHub Actions:
- name: Security Tests
run: python security_tests.py
๐ Examples
We have 6 comprehensive examples to get you started:
| Example | Description | Difficulty | Time |
|---|---|---|---|
| 01 - Minimal IDOR Test | 5-line vulnerability test | โญ Easy | 2 min |
| 02 - Authenticated Testing | Full auth flow | โญโญ Medium | 5 min |
| 03 - Exploit Chains | Multi-step attacks | โญโญ Medium | 10 min |
| 04 - Batch Testing | Scan entire APIs | โญโญโญ Hard | 15 min |
| 05 - Context Managers | Resource management | โญโญ Medium | 5 min |
| 06 - Report Generation | Export & reports | โญโญ Medium | 10 min |
๐ View All Examples
๐๏ธ Architecture
Click to view architecture
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ LogicPWN โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โ
โ โ Quick Start โ โ SecurityTesterโ โ Exploit Chainโ โ
โ โ API โ โ Class โ โ Engine โ โ
โ โโโโโโโโฌโโโโโโโโ โโโโโโโโฌโโโโโโโโ โโโโโโโโฌโโโโโโโโ โ
โ โ โ โ โ
โ โโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโ โ
โ โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Core Modules โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โ
โ โ Auth โ โ Access โ โ Validator โ โ
โ โ โข OAuth โ โ โข IDOR โ โ โข Response โ โ
โ โ โข JWT โ โ โข BOLA โ โ โข Business โ โ
โ โ โข SAML โ โ โข Tenant โ โ โข Logic โ โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โ
โ โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โ
โ โ Runner โ โ Reporter โ โ Reliability โ โ
โ โ โข Sync โ โ โข JSON โ โ โข Retry โ โ
โ โ โข Async โ โ โข Markdown โ โ โข Circuit โ โ
โ โ โข HTTP/2 โ โ โข CSV โ โ โข Breaker โ โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Modular Design:
- ๐ฏ Core Modules - Authentication, Access Control, Validation
- โก High Performance - Async/await, connection pooling, caching
- ๐ Extensible - Plugin system, middleware support
- ๐ฆ Lightweight - Install only what you need
๐ Documentation
๐ For Beginners |
๐ For Advanced Users |
๐ Learning Path
๐ข Beginner (30 minutes)
Goal: Understand the basics and run your first test
- Install LogicPWN:
pip install logicpwn - Read Quick Start
- Run 01_minimal_idor_test.py
- Modify it for your target
- Try 02_authenticated_testing.py
You'll learn: Installation, basic IDOR testing, authentication
๐ก Intermediate (2 hours)
Goal: Master common security testing workflows
- Study 03_exploit_chain_execution.py
- Create your own exploit chain YAML
- Try 04_batch_endpoint_testing.py
- Learn 05_context_manager_usage.py
- Practice 06_result_export_and_reporting.py
You'll learn: Exploit chains, batch testing, reporting, best practices
๐ด Advanced (1 day)
Goal: Build custom security testing frameworks
- Explore the core modules
- Build custom exploit chains
- Create CI/CD integration
- Develop custom validators
- Contribute to LogicPWN
You'll learn: Architecture, extensibility, production deployment
โ FAQ
Is LogicPWN a vulnerability scanner?
Yes and no. LogicPWN is a testing framework for business logic vulnerabilities. Unlike traditional scanners that look for known CVEs, LogicPWN tests for:
- IDOR (Insecure Direct Object Reference)
- Authorization bypasses
- Business logic flaws
- Privilege escalation
Can I use LogicPWN for bug bounties?
Yes! LogicPWN is perfect for bug bounty hunting. Many testers use it to:
- Automate IDOR testing across endpoints
- Test authorization on hundreds of endpoints
- Find business logic flaws quickly
- Generate proof-of-concept reports
How is this different from Burp Suite?
LogicPWN complements Burp Suite:
| Feature | Burp Suite | LogicPWN |
|---|---|---|
| Manual Testing | โ Excellent | โ Not designed for this |
| Automation | โ ๏ธ Complex | โ Simple (3 lines of code) |
| Business Logic | โ ๏ธ Manual process | โ Built-in |
| CI/CD Integration | โ Difficult | โ Easy |
| Scripting | โ ๏ธ Java/Python | โ Python-native |
| Price | ๐ฐ $449/year | ๐ฐ Free |
Best practice: Use Burp for manual testing, LogicPWN for automation.
Is it safe to use in production?
LogicPWN is designed for testing environments. Features for safety:
โ Rate limiting - Avoid DoS โ Connection management - Proper cleanup โ Error handling - Graceful failures โ Logging - Audit trails
โ ๏ธ Always:
- Test in staging first
- Get permission before testing
- Follow responsible disclosure
Can I contribute?
Yes! We welcome contributions:
- ๐ Report bugs
- ๐ก Suggest features
- ๐ Improve docs
- ๐ง Submit code
See Contributing Guide for details.
๐ง Advanced Usage
Custom Authentication
from logicpwn import SecurityTester
tester = SecurityTester("https://api.example.com")
tester.authenticate(
username="admin",
password="secret",
login_endpoint="/api/v2/auth/login",
method="POST",
username_field="email", # Custom field
password_field="pwd", # Custom field
success_indicators=["access_token", "authenticated"]
)
Async Batch Testing
from logicpwn.core.access import detect_idor_flaws_async
import asyncio
async def scan_all_endpoints():
results = await detect_idor_flaws_async(
endpoint_template="https://api.example.com/users/{id}",
test_ids=[str(i) for i in range(1, 1000)], # Test 1000 IDs
success_indicators=["user_data"],
failure_indicators=["unauthorized"]
)
return results
results = asyncio.run(scan_all_endpoints())
Custom Exploit Chains (YAML)
# business_logic_test.yaml
name: "E-commerce Price Manipulation"
description: "Test for price override vulnerabilities"
steps:
- name: "Add Product to Cart"
request_config:
method: "POST"
url: "https://shop.com/api/cart/add"
json_data:
product_id: "EXPENSIVE_ITEM"
quantity: 1
success_indicators: ["cart_updated"]
- name: "Manipulate Price"
request_config:
method: "POST"
url: "https://shop.com/api/cart/update"
json_data:
product_id: "EXPENSIVE_ITEM"
price: 0.01 # Try to set price to 1 cent
success_indicators: ["updated"]
failure_indicators: ["invalid", "unauthorized"]
- name: "Checkout"
request_config:
method: "POST"
url: "https://shop.com/api/checkout"
success_indicators: ["order_confirmed"]
from logicpwn import quick_exploit_chain
results = quick_exploit_chain("business_logic_test.yaml")
Logging Configuration
from logicpwn import configure_logging, use_preset
# Simple debug logging
configure_logging(level="DEBUG", log_file="debug.log")
# Or use presets
use_preset("debug") # Verbose debugging
use_preset("security", log_file="audit.log") # Compliance logs
use_preset("ci") # CI/CD friendly
๐ Performance
Real-world benchmarks from production testing:
| Metric | Value | Notes |
|---|---|---|
| Throughput | 4.3 req/sec | Average across all test types |
| Memory | 67.7 MB | Lightweight footprint |
| CPU | 26.2% | Efficient resource usage |
| Reliability | 99.2% | Success rate across tests |
| Async Speed | 10x faster | vs synchronous testing |
Scalability:
- โ Test 1000+ endpoints in minutes
- โ Async batch processing
- โ Connection pooling & caching
- โ Adaptive rate limiting
๐ค Community & Support
๐ฌ Get HelpAsk questions, share tips |
๐ Report IssuesBug reports, feature requests |
๐ DocumentationGuides, API reference |
๐ Star History
If LogicPWN helps you, consider giving it a star! โญ
๐ค Contributing
We welcome contributions from the community:
- ๐ด Fork the repository
- ๐ฟ Create a feature branch
- โ๏ธ Make your changes
- โ Add tests
- ๐ฌ Submit a pull request
See CONTRIBUTING.md for detailed guidelines.
๐ What's New in v0.4.0
๐ฏ Simplified API# Before (v0.3.0)
from logicpwn.core.auth import ...
# 20+ lines of code
# After (v0.4.0)
from logicpwn import quick_idor_test
# 3 lines of code
85% less code! |
โจ New Features
100% backward compatible |
๐ฃ๏ธ Roadmap
v0.5.0 (Coming Soon)
- CLI tool for terminal usage
- YAML template library
- GitHub Actions workflows
- Plugin system
- Web dashboard
v0.6.0 (Future)
- GraphQL support
- gRPC testing
- WebSocket security
- AI-powered test generation
๐ผ Enterprise Support
Need help deploying LogicPWN in your organization?
๐ข Enterprise Features
|
๐ง Contact UsFor enterprise inquiries:
|
๐ License
LogicPWN is licensed under the MIT License - see LICENSE for details.
MIT License - Free to use, modify, and distribute
๐ Acknowledgments
LogicPWN is built with these amazing open-source libraries:
- requests - HTTP library
- aiohttp - Async HTTP
- pydantic - Data validation
- loguru - Logging
- PyYAML - YAML parsing
Special thanks to the security community for feedback and contributions!
๐ฏ Quick Links
| Resource | Link |
|---|---|
| ๐ฆ PyPI Package | https://pypi.org/project/logicpwn/ |
| ๐ GitHub Repo | https://github.com/Infernus007/LogicPWN |
| ๐ Documentation | docs/ |
| ๐ก Examples | examples/library_usage/ |
| ๐ Report Bug | Create Issue |
| ๐ฌ Discussions | Join Discussion |
๐ Start Testing in 30 Seconds
pip install logicpwn
from logicpwn import quick_idor_test
results = quick_idor_test("https://api.example.com", "/api/users/{id}", [1, 2, 3])
Built with โค๏ธ for the security community
โญ Star us on GitHub if LogicPWN helps you find vulnerabilities!
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 logicpwn-0.4.0.tar.gz.
File metadata
- Download URL: logicpwn-0.4.0.tar.gz
- Upload date:
- Size: 250.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.12.3 Linux/6.14.0-33-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5913706d4f7cb7645afac5e6c95d9f2958024f93ed7f0c00e562a05e7f8b2fe6
|
|
| MD5 |
618b644fa60083c4f7b2a1b138f50d3b
|
|
| BLAKE2b-256 |
ec9f217faaf75ef4a32539523049bc738014b24a8cc8c95a6d773a3702182ed1
|
File details
Details for the file logicpwn-0.4.0-py3-none-any.whl.
File metadata
- Download URL: logicpwn-0.4.0-py3-none-any.whl
- Upload date:
- Size: 306.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.12.3 Linux/6.14.0-33-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9f1759b3b03420d01222d831f22a474c8af643633a962f4393e556c661917bd7
|
|
| MD5 |
f46d79162ad89ec0bca536117fd94d32
|
|
| BLAKE2b-256 |
72f90789234905a45c442942c026205affc3ac3d5f4126dfab7eb2914afbec6a
|