Smart contract security auditing platform with Pro features
Project description
Counterscarp™ Security Engine
Production-ready smart contract security platform — 21 integrated analyzers, configurable rules, and professional audit reports.
One command. Zero false positives. Client-ready deliverables.
Installation
pip install counterscarp-engine
For optional extras:
pip install "counterscarp-engine[web]" # Web interface
pip install "counterscarp-engine[pdf]" # PDF report export
pip install "counterscarp-engine[ai,advanced]" # RAG + LLM analysis
pip install "counterscarp-engine[web,pdf,ai,advanced]" # Full install
PDF Report Generation (Pro/Enterprise)
PDF export requires the optional pdf extra:
pip install "counterscarp-engine[pdf]"
This installs xhtml2pdf for converting HTML audit reports to branded, print-ready PDFs with custom logos.
See QUICKSTART.md for Docker setup, optional external tools (Slither, Aderyn, Medusa), and full installation details.
Quick Scan
# Scan a contracts directory and generate a report
counterscarp-engine --target ./contracts --report
# Use a pre-built execution profile
counterscarp-engine --target ./contracts --config counterscarp-pr.toml # fast PR check
counterscarp-engine --target ./contracts --config counterscarp-audit.toml # full audit
counterscarp-engine --target ./contracts --config counterscarp-bounty.toml # bug bounty
counterscarp --gui # Launch local web interface
Docker (report persistence)
docker run --rm \
-v /path/to/contracts:/scan \
-v /path/to/reports:/output \
counterscarp-engine:5.0.3 \
--target /scan --output-dir /output --report
Mount a host directory to /output and pass --output-dir /output so reports survive --rm container teardown. See QUICKSTART.md for full Docker setup.
Interface Modes
CLI (Headless)
counterscarp --target ./contracts
Headless mode designed for CI/CD pipelines and automation. Supports all scan profiles (PR, Audit, Bounty, Solana). Outputs JSON, Markdown, and SARIF for direct pipeline integration. No GUI dependencies required.
Desktop GUI
counterscarp --gui
Launches a local Tkinter desktop interface. Provides 12 analyzer toggles for granular scan configuration, a file browser for contract selection, and real-time result streaming. Fully offline — no network connection required.
Cloud App
app.counterscarp.io — multi-user web application with account system. Browser-based interface supporting scan upload, interactive results, and report downloads (HTML/PDF/SARIF/Markdown). Includes attack graph visualization and Stripe-integrated billing.
Solana/Anchor Security Analysis
Coverage (v5.0.3)
35 Rust/Anchor security patterns across 7 categories:
| Category | Rules | Examples |
|---|---|---|
| Account Validation | 8 | Missing signer/owner checks, unvalidated PDA seeds, missing discriminator checks |
| CPI Security | 4 | Arbitrary CPI, missing CPI authority, unverified program accounts |
| Arithmetic & Logic | 5 | Unchecked arithmetic, integer overflow, unsafe casting, precision loss |
| State Management | 6 | Uninitialized accounts, reinitialization, missing rent exemption, stale data |
| Access Control | 4 | Missing access control, hardcoded authority, weak authority checks |
| Token Security | 4 | Missing token account validation, unchecked balances, unvalidated token program |
| General Validation | 4 | Unconstrained system program, missing clock validation, duplicate mutable accounts |
Additional Capabilities
cargo-auditintegration for Cargo.toml dependency CVEs- Anchor IDL validation for security constraint verification
Approach
Static regex-based pattern matching against Rust source files. Scans all .rs files, excluding the /target directory.
Known Limitations
- Single-file analysis — no cross-contract taint tracking across Rust modules
- Regex-based — no data-flow or symbolic execution analysis
- Anchor-focused — raw Solana SDK (non-Anchor) coverage is lighter
- No CPI tracing — cross-program invocation paths are not traced across program boundaries
Roadmap (v5.x)
- Cross-file CPI tracing
- Expanded raw Solana SDK patterns
- Integration with Anchor's built-in verification tools
Key Features
- 21 Integrated Analyzers — Heuristic scanner, Slither, Aderyn, Mythril, Medusa, supply chain, threat intel, and more
- EVM + Solana — 34 EVM vulnerability patterns, 35 Solana/Anchor rules, IDL validation
- 3 Execution Profiles — PR check (< 2 min), full audit, bug bounty mode
- Professional Reports — HTML, Markdown, JSON, SARIF, PDF with risk scoring
- CI/CD Native — GitHub Actions, GitLab CI, Azure DevOps, Jenkins pipeline generator
- AI Audit Copilot — RAG + LLM enrichment with local (Ollama) or cloud (OpenAI) backends
- Time-Travel Scanner — Git history analysis to track vulnerability introduction
- Attack Graph Visualization — Interactive D3.js cross-contract attack path graphs
- Exploit PoC Generator — Foundry test exploits from detected findings
- Protocol Fingerprinting — Identifies forks of known protocols and inherited CVEs
- Offline / Air-Gapped — Bundled threat intel DB, local embeddings, Ollama LLM
Security & Privacy (Data Sovereignty)
Counterscarp Engine is built for environments where source-code confidentiality is non-negotiable — bank compliance teams, Web3 audit firms, and air-gapped infrastructure.
- Zero code exfiltration — No source code, bytecode, or contract artifacts ever leave the host machine during a scan. All analysis is performed locally.
- Local-first AI inference — The AI Copilot defaults to local inference via Ollama when configured (
counterscarp.toml → [ai] provider = "ollama"). If OpenAI is selected, only a one-paragraph natural-language summary of each finding is sent to the OpenAI API — never raw source code. - Bundled threat intelligence — Vulnerability databases and protocol signatures ship with the package and are queried locally. Network access only occurs if you explicitly run
counterscarp --update-signatures. For fully air-gapped environments, usecounterscarp --update-from-file <path>to import pre-downloaded signature packs. - No telemetry — The CLI contains zero usage telemetry, analytics callbacks, tracking pixels, or phone-home behavior. Period.
- API security hardening — The web API enforces rate limiting (10 req/min on license validation, 5 req/min on deactivation, 30 req/min on webhooks), Pydantic input validation on all request fields, mandatory Stripe webhook signature verification, admin endpoint authentication, CORS restricted to known origins, and a dedicated
counterscarp.securitylogger for all auth and validation events.
Pricing
| Feature | Community (Free) | Developer ($49/mo) | Professional ($199/mo) | Team ($399/mo) | Enterprise |
|---|---|---|---|---|---|
| Heuristic scanning + CLI | ✅ | ✅ | ✅ | ✅ | ✅ |
| Markdown / JSON reports | ✅ | ✅ | ✅ | ✅ | ✅ |
| HTML / SARIF / PDF reports | — | ✅ | ✅ | ✅ | ✅ |
| Slither + Solana analyzer | — | ✅ | ✅ | ✅ | ✅ |
| AI Copilot + Exploit Gen | — | — | ✅ | ✅ | ✅ |
| Time-travel + Attack graph | — | — | ✅ | ✅ | ✅ |
| Machine activations | — | 1 | 3 | 5 | Unlimited |
Enterprise (SE-ENT-xxx): Custom pricing — unlimited seats, unlimited activations, custom integrations, priority support, and a dedicated account manager. Contact contact@counterscarp.io.
Get your license: https://counterscarp.io/pricing
export COUNTERSCARP_PRO_LICENSE=your-key-here
counterscarp-engine --target ./contracts --report --format html
Account-Based Licensing
Create an account at app.counterscarp.io using Google or email to manage your license:
- Automatic linking — Purchase Pro and your license is automatically linked to your account
- Cross-device access — Log in on any device and your Pro features activate automatically
- Admin dashboard — View registered users and license status at
/admin/users
Documentation
| Document | Description |
|---|---|
| QUICKSTART.md | Full install, config reference, CI/CD, offline setup, troubleshooting |
| docs/CONFIGURATION.md | Complete counterscarp.toml reference |
| docs/CLI_REFERENCE.md | All CLI flags and examples |
| docs/WEB_APP_GUIDE.md | Self-hosted web interface |
| docs/DEPLOYMENT.md | Production server setup |
| CONTRIBUTING.md | Adding rules and integrations |
License
- Community features: MIT License — see LICENSE
- Pro features: Commercial License — see LICENSE-PRO
Credits
Built by CyberShield Austin · @counterscarpsec · @defiauditccie · counterscarp.io
Powered by Slither · Aderyn · Medusa · Mythril · Foundry · OSV.dev
Threat intelligence: Code4rena · Immunefi · Solodit · Neodyme · OtterSec · Sec3
Version: 5.0.3 | Chains: EVM + Solana | Analyzers: 21 | Patterns: 34 EVM + 35 Solana
⭐ If this helped you find bugs, please star the repo!
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
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 counterscarp_engine-5.0.6.tar.gz.
File metadata
- Download URL: counterscarp_engine-5.0.6.tar.gz
- Upload date:
- Size: 1.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e27c6df44e4f547aaf1f8aea59a83af54ef8605710fea603a07973a5059a634d
|
|
| MD5 |
fbcdd9e1c46463bf183377cab0f58cac
|
|
| BLAKE2b-256 |
82ba00ad5c30da6144a0f921edeb357a6e1ac0ab4d92449ef7da4c4af635958f
|
Provenance
The following attestation bundles were made for counterscarp_engine-5.0.6.tar.gz:
Publisher:
publish.yml on RunTimeAdmin/counterscarp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
counterscarp_engine-5.0.6.tar.gz -
Subject digest:
e27c6df44e4f547aaf1f8aea59a83af54ef8605710fea603a07973a5059a634d - Sigstore transparency entry: 1397791158
- Sigstore integration time:
-
Permalink:
RunTimeAdmin/counterscarp@197af86e65cb2d9f6262f333239dff52ab4f0065 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/RunTimeAdmin
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@197af86e65cb2d9f6262f333239dff52ab4f0065 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file counterscarp_engine-5.0.6-py3-none-any.whl.
File metadata
- Download URL: counterscarp_engine-5.0.6-py3-none-any.whl
- Upload date:
- Size: 790.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e8a29db9503d19c7e04e72ac01b0e32cf9d5567979f6d4fc55b4d24b8b799875
|
|
| MD5 |
28ea0c6c0e5c9addb2592e5b5ab760c9
|
|
| BLAKE2b-256 |
6c5f4798cbae8c52b0885879f3073755f0f8c66b1ad4b0548aea1b18e40c1c7f
|
Provenance
The following attestation bundles were made for counterscarp_engine-5.0.6-py3-none-any.whl:
Publisher:
publish.yml on RunTimeAdmin/counterscarp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
counterscarp_engine-5.0.6-py3-none-any.whl -
Subject digest:
e8a29db9503d19c7e04e72ac01b0e32cf9d5567979f6d4fc55b4d24b8b799875 - Sigstore transparency entry: 1397791167
- Sigstore integration time:
-
Permalink:
RunTimeAdmin/counterscarp@197af86e65cb2d9f6262f333239dff52ab4f0065 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/RunTimeAdmin
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@197af86e65cb2d9f6262f333239dff52ab4f0065 -
Trigger Event:
workflow_dispatch
-
Statement type: