If you don't have Poetry installed, run:
curl -sSL https://install.python-poetry.org | python3 -Or using pip:
pip install poetry-
Install dependencies:
poetry install
-
Activate the virtual environment:
poetry shell
-
Run tests:
# Using poetry (from project root) poetry run python test/test_lambda.py # Or inside poetry shell python test/test_lambda.py
-
Try the utilities:
# Test credential combinations (educational/testing only) poetry run python src/utils/cred.py https://example.com/login # Test rate limiting poetry run python src/utils/ddos.py https://api.example.com 1.0
Add a new dependency:
poetry add package-nameAdd a development dependency:
poetry add --group dev package-nameUpdate dependencies:
poetry updateShow installed packages:
poetry showThe project includes these dev tools:
- pytest: Test framework
- pytest-cov: Coverage reporting
- black: Code formatter
- flake8: Linter
- mypy: Type checker
Format code:
poetry run black src/ test/Lint code:
poetry run flake8 src/ test/Type check:
poetry run mypy src/ test/Run all tests:
poetry run pytest test/ -vRun tests with coverage:
poetry run pytest test/ --cov=src --cov-report=htmlblue-yellow/
├── pyproject.toml # Poetry configuration
├── poetry.toml # Local Poetry settings
├── poetry.lock # Locked dependencies (generated)
├── README.md # Main project README
├── SETUP.md # This file
├── LICENSE # License information
├── .env # Environment variables (not tracked)
├── .env.sample # Environment variable template
├── .gitignore # Git ignore rules
├── src/
│ ├── lambda/
│ │ ├── entrypoint.py # AWS Lambda function
│ │ └── README.md # Lambda documentation
│ └── utils/
│ ├── ping.py # URL ping utility
│ ├── cred.py # Credential testing utility
│ ├── ddos.py # Rate limit testing utility
│ └── clone.py # Clone utility (placeholder)
└── test/
└── test_lambda.py # Lambda function tests
# Install Poetry if needed
curl -sSL https://install.python-poetry.org | python3 -
# Install project dependencies
cd /home/kali/labs/blue-yellow
poetry install --no-root
# Run Lambda tests
poetry run python test/test_lambda.py
# Test security utilities
poetry run python src/utils/cred.py https://example.com/login
poetry run python src/utils/ddos.py https://example.com 1.0See src/lambda/README.md for Lambda-specific deployment instructions.
# Create deployment package
mkdir -p lambda-package/utils
cp src/lambda/entrypoint.py lambda-package/
cp src/utils/ping.py lambda-package/utils/
cd lambda-package
zip -r ../lambda-function.zip .
cd ..
rm -rf lambda-package
# Now upload lambda-function.zip to AWS LambdaTests login forms for rate limiting and security mechanisms:
poetry run python src/utils/cred.py <login_url>
# Example with verbose output
poetry run python src/utils/cred.py https://example.com/loginImportant: Only use on systems you own or have permission to test.
Tests API endpoints for rate limiting:
poetry run python src/utils/ddos.py <url> [period_seconds]
# Example: Test with 0.5 second intervals
poetry run python src/utils/ddos.py https://api.example.com 0.5Copy .env.sample to .env and configure as needed:
cp .env.sample .env
# Edit .env with your settingsIf Poetry installation fails:
# Try pip installation
pip install --user poetry
# Or use pipx (recommended)
python3 -m pip install --user pipx
python3 -m pipx ensurepath
pipx install poetryIf you get import errors when running scripts:
# Make sure you're in the project root
cd /home/kali/labs/blue-yellow
# Activate the virtual environment
poetry shell
# Or use poetry run
poetry run python test/test_lambda.pyIf dependencies are out of sync:
# Remove lock file and reinstall
rm poetry.lock
poetry install
# Or update all dependencies
poetry update