Download the PHP package salvatorecervone/laravel-pentest without Composer

On this page you can find all versions of the php package salvatorecervone/laravel-pentest. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-pentest

Laravel Penetration Tester (laravel-pentest)

Latest Version on Packagist Total Downloads Laravel Support PHP Support License Build Status

Automated In-App Penetration Testing and DAST Security Audit Suite for Laravel.

laravel-pentest turns your Laravel CLI and test environment into an automated, in-app offensive security tester. It scans and simulates real-world attack vectors against your routes, Eloquent models, controllers, database connections, and configurations to detect critical security gaps before bad actors do:


Table of Contents


Requirements


Installation

Install the package via Composer as a development dependency:

Publish the package configuration file (optional):


Usage

Run All Penetration Tests

Output preview:

Run a Specific Audit Suite

Filter which audit suite to execute using the --suite option:

Baseline & False-Positive Suppression

When introducing laravel-pentest to an existing codebase with legacy debt, avoid breaking the CI build by generating a baseline file:

Subsequent runs will automatically suppress known baseline issues, ensuring only new security regressions trigger alerts and fail the CI pipeline:

Fail CI Pipeline on Vulnerabilities

Exit with status code 1 if any Critical or High vulnerability is identified:

Or exit with status code 1 on any finding (including low or medium):

Generate Standalone HTML / JSON Reports

Export a beautifully formatted, responsive standalone HTML security report or JSON export. All generated reports automatically include the current date and time (YYYY-MM-DD_HH-mm-ss) in their filename to preserve historical audit logs:

Interactive Web Security Dashboard

Launch live security scans directly in your browser with real-time feedback and an interactive vulnerability explorer:

Security Baseline & False Positive Suppressions

Prevent legacy findings from blocking ongoing CI workflows while ensuring zero new regressions:

You can also suppress specific false positives permanently in config/pentest.php:

Safe Database Probing (DatabaseSandbox)

When performing active security probes or simulating input mutation against models and database connections, laravel-pentest provides transactional rollback isolation:

Route Access Matrix & Safe Non-GET Auditing (--access-map)

Audits all application routes and maps exactly which endpoints and Controller@action methods are reachable (200 OK or redirects) by the tested identity (Guest or authenticated user, e.g. Pippo).

If the tested persona accesses any forbidden endpoint with success, an automatic CRITICAL vulnerability (UNAUTHORIZED_ROUTE_ACCESS / CWE-285) is generated!


Audit Suites & Vulnerabilities Detected

Suite Vulnerability ID CWE Default Severity What It Tests
route-exposure UNPROTECTED_SENSITIVE_ROUTE CWE-306 CRITICAL / HIGH Scans registered routes for sensitive paths (admin/*, users/*, billing/*, reports/*) that lack authentication middleware.
idor-bola POTENTIAL_IDOR_BOLA CWE-639 HIGH Analyzes Route-Model binding endpoints to verify that Policies, Gates, or FormRequests protect user resources against horizontal privilege escalation.
mass-assignment UNGUARDED_ELOQUENT_MODEL CWE-915 CRITICAL Detects models declaring $guarded = [] without $fillable, leaving database columns open to arbitrary modifications.
mass-assignment DANGEROUS_FILLABLE_ATTRIBUTES CWE-915 HIGH Identifies privileged fields (is_admin, role_id, balance, permissions, is_superadmin) dangerously declared inside $fillable.
mass-assignment UNFILTERED_REQUEST_MASS_ASSIGNMENT CWE-915 HIGH Flags controller methods passing unfiltered $request->all() directly into Model::create() or $model->update().
csrf-protection MISSING_CSRF_PROTECTION CWE-352 HIGH Verifies state-changing routes (POST, PUT, PATCH, DELETE) enforce CSRF token validation.
rate-limit MISSING_RATE_LIMITING CWE-307 HIGH Ensures that authentication, login, password recovery, and token endpoints enforce throttling (throttle:x,y) against brute force.
security-headers MISSING_X_FRAME_OPTIONS CWE-1021 MEDIUM Checks HTTP responses for clickjacking defenses (X-Frame-Options: SAMEORIGIN / DENY).
security-headers MISSING_CSP CWE-79 MEDIUM Checks for missing Content-Security-Policy (CSP) header.
security-headers MISSING_HSTS CWE-319 MEDIUM Asserts that Strict-Transport-Security (HSTS) is enabled in production.
security-headers MISSING_X_CONTENT_TYPE_OPTIONS CWE-79 LOW Verifies the X-Content-Type-Options: nosniff header to block MIME sniffing.
debug-exposure APP_DEBUG_ENABLED_IN_PRODUCTION CWE-489 CRITICAL Detects APP_DEBUG=true in production environments, exposing stack traces and database credentials.
debug-exposure EXPOSED_SENSITIVE_FILE CWE-552 CRITICAL / HIGH Checks whether sensitive files (.env, .git, storage/logs/laravel.log, .sql dumps) are placed in the public/ web root.
database-security EMPTY_DATABASE_PASSWORD CWE-521 CRITICAL Flags blank/missing passwords on network database connections.
database-security WEAK_DATABASE_PASSWORD CWE-521 CRITICAL Detects trivial/default passwords (root, admin, 123456, secret).
database-security HIGHLY_PRIVILEGED_DATABASE_USER CWE-250 HIGH Detects connecting as DBA/superuser (root, postgres, sa), violating Least Privilege.
database-security UNENCRYPTED_REMOTE_DATABASE_CONNECTION CWE-319 HIGH Verifies remote databases enforce TLS/SSL (sslmode=require / MYSQL_ATTR_SSL_CA).
database-security EXPOSED_SQLITE_DATABASE CWE-552 CRITICAL Flags SQLite databases stored inside the public/ web directory.
sensitive-data UNENCRYPTED_SENSITIVE_ATTRIBUTE CWE-311 HIGH Identifies PII columns (ssn, tax_number, credit_card, iban) missing casts = ['...' => 'encrypted'].
sensitive-data SENSITIVE_ATTRIBUTE_NOT_HIDDEN CWE-200 HIGH Detects secrets and auth tokens (password, two_factor_secret, api_token) missing from Eloquent $hidden.
crypto-security MISSING_APP_KEY / PLACEHOLDER_APP_KEY CWE-321 CRITICAL Asserts APP_KEY exists, is non-default, and matches cipher bit requirements.
crypto-security WEAK_BCRYPT_ROUNDS CWE-916 HIGH Validates password hashing work factors (bcrypt.rounds >= 10, recommended 12+).
dependency-security VULNERABLE_COMPOSER_DEPENDENCY CWE-1395 CRITICAL / HIGH Scans composer.lock for known advisories and CVEs in dependencies.
dependency-security ABANDONED_OR_DEPRECATED_PACKAGE CWE-1104 MEDIUM Warns about abandoned packages with known migration alternatives.
cors-security CORS_WILDCARD_WITH_CREDENTIALS CWE-942 CRITICAL Detects wildcard allowed origins (*) combined with supports_credentials => true.
cors-security CORS_PERMISSIVE_ORIGIN_REGEX CWE-942 HIGH Flags unanchored or overly permissive regular expressions in allowed_origins_patterns.
cors-security CORS_SENSITIVE_EXPOSED_HEADER CWE-200 MEDIUM Identifies authorization and session headers exposed to cross-origin callers.
session-security SESSION_COOKIE_NOT_SECURE CWE-614 HIGH Ensures session cookies enforce the secure flag in production/staging environments.
session-security SESSION_COOKIE_NOT_HTTPONLY CWE-1004 CRITICAL Asserts http_only => true to prevent session hijacking via JavaScript document.cookie.
session-security SESSION_COOKIE_SAMESITE_INSECURE CWE-1275 HIGH Validates same_site => 'lax' or 'strict' to prevent cross-site request leakage.
session-security EXCESSIVE_SESSION_LIFETIME CWE-613 LOW Warns if session expiration exceeds 30 days without re-authentication.
sqli-safety SQL_INJECTION_RAW_QUERY CWE-89 CRITICAL Scans controller methods for unparameterized string concatenations in whereRaw, havingRaw, orderByRaw, and DB::raw.
route-access UNAUTHORIZED_ROUTE_ACCESS CWE-285 CRITICAL Generates a complete Route Access Matrix for the tested persona (Guest vs User) mapping reachable endpoints and Controller@action, flagging forbidden routes with 100% safe non-GET execution.

Writing Tests with InteractsWithPentest

Integrate pentest assertions directly into your existing PHPUnit or Pest test suites:


CI/CD Integration (GitHub Actions)

Add this workflow to your repository (.github/workflows/security-pentest.yml) to automatically block pull requests containing new security regressions:


Configuration

You can customize the scan behavior in config/pentest.php:

Excluding Session-Altering & Profile Routes

During security audits (such as the Route Access and IDOR/BOLA audits), laravel-pentest executes dynamic runtime probes against application endpoints.

To avoid session lock contention, unintended credential modifications, or session termination during live scans, certain routes should be excluded via ignore_routes:

  1. Framework Profile & Auth Endpoints (Jetstream / Fortify / Breeze): Routes like user/profile-photo, user/other-browser-sessions, user/password, and user/two-factor-* alter avatar storage, terminate other browser sessions, or regenerate security tokens. The package ignores these by default, but you can customize or extend the patterns.

  2. Custom Session-Altering & Logout Routes: If your application defines custom endpoints that flush session tables, kill user tokens, or operate on native PHP session locks (e.g. /logout, /admin/terminate-sessions), add them to ignore_routes.

  3. Flexible Pattern Matching (URI & Controller Actions): Patterns support wildcard fnmatch matching against both the URI and the Controller Action name:
    • URI patterns: 'user/*', 'session/terminate-all', 'auth/logout'
    • Controller patterns: '*OtherBrowserSessionsController*', 'App\Http\Controllers\Auth\SessionController@*'

Sandbox Execution Safeguards

When evaluating mutating endpoints (POST, PUT, PATCH, DELETE):


Running Tests

Run the test suite with PHPUnit:


Security Vulnerabilities

If you discover a security vulnerability within laravel-pentest, please open an issue or submit a pull request on GitHub.


License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-pentest with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/support Version ^10.0|^11.0|^12.0
illuminate/console Version ^10.0|^11.0|^12.0
illuminate/routing Version ^10.0|^11.0|^12.0
illuminate/http Version ^10.0|^11.0|^12.0
illuminate/database Version ^10.0|^11.0|^12.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package salvatorecervone/laravel-pentest contains the following files

Loading the files please wait ...