petrevsky / amasty-captcha-bypass
A Magento 2 captcha bypass module for testing purposes - Compatible with Amasty InvisibleCaptcha
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 2
Type:magento2-module
Requires
- amasty/module-invisible-captcha: *
- magento/framework: >=102.0
This package is auto-updated.
Last update: 2025-10-05 18:10:53 UTC
README
Bypass Google reCAPTCHA for defined IP addresses or User-Agent strings. Useful for automated testing with Selenium, Cypress, or other testing tools.
Compatible with Amasty InvisibleCaptcha extension.
Requirements
- Magento 2.4+
- Amasty InvisibleCaptcha extension must be installed and enabled
Installation
Via Composer (Recommended)
composer require petrevsky/amasty-captcha-bypass bin/magento module:enable Magenable_CaptchaBypass bin/magento setup:upgrade bin/magento cache:clean
Manual Installation
- Copy the module to
app/code/Magenable/CaptchaBypass
- Run the following commands:
bin/magento module:enable Magenable_CaptchaBypass bin/magento setup:upgrade bin/magento cache:clean
Upgrade
composer update petrevsky/amasty-captcha-bypass bin/magento setup:upgrade bin/magento cache:clean
Configuration
- Go to Stores → Configuration → Advanced → Captcha Bypass
- Set Enabled to Yes
- Configure bypass rules:
- Whitelisted IP addresses: Comma-separated IPs (e.g.,
127.0.0.1,192.168.1.100
) - Whitelisted User-Agent: Exact User-Agent string (e.g.,
Selenium WebDriver
orCypress/12.0
)
- Whitelisted IP addresses: Comma-separated IPs (e.g.,
- Save configuration and clear cache
If one of the conditions is met, the reCAPTCHA will be bypassed.
How It Works
This module intercepts Amasty InvisibleCaptcha's isNeedToShowCaptcha()
method. When enabled:
- If the visitor's IP address matches any in the whitelist, captcha will be bypassed
- If the visitor's User-Agent matches the configured value, captcha will be bypassed
- The module respects Amasty's native IP whitelist and adds additional bypass capabilities
Testing Examples
Selenium WebDriver
from selenium import webdriver options = webdriver.ChromeOptions() options.add_argument("user-agent=Selenium WebDriver") driver = webdriver.Chrome(options=options)
Cypress
cy.visit(url, { headers: { "User-Agent": "Cypress/12.0", }, });
cURL
curl -X POST https://your-store.com/customer/account/loginPost \ -H "User-Agent: TestBot/1.0" \ -d "login[username]=test@example.com&login[password]=Test123!"
Compatibility
- ✅ Amasty InvisibleCaptcha v2.5.1+
- ✅ Magento 2.4.5, 2.4.6, 2.4.7
- ✅ reCAPTCHA v2 and v3
Security Notes
⚠️ Important: This module bypasses security controls.
Recommended use cases:
- Development environments
- Testing/QA environments
- Automated testing (CI/CD pipelines)
NOT recommended for:
- Production environments
- Public-facing stores
If using in production, ensure:
- Only trusted IPs/User-Agents are whitelisted
- Alternative security measures are in place
- Regular security audits are performed
Troubleshooting
Module not working?
-
Verify module is enabled:
bin/magento module:status Magenable_CaptchaBypass
-
Check Amasty is installed:
bin/magento module:status Amasty_InvisibleCaptcha
-
Clear all caches:
bin/magento cache:flush
-
Recompile (if in production mode):
bin/magento setup:di:compile
Still showing captcha?
- Verify IP format is correct (no spaces after commas)
- Check User-Agent matches exactly (case-sensitive)
- Ensure module is enabled in Stores → Configuration → Advanced → Captcha Bypass
- Check Magento logs:
var/log/system.log
Documentation
- Integration Guide - Technical details and testing
- Changes Summary - What was modified for Amasty compatibility
- Changelog - Version history
Support
For issues or questions:
- Check AMASTY_INTEGRATION.md troubleshooting section
- Review Magento logs
- Open an issue on GitHub
License
MIT License - see LICENSE file for details
Credits
Original module by Magenable
Amasty compatibility by Petrevsky