@echo off echo ======================================== echo fscan SSH Plugin Test Script echo ======================================== echo. REM 检查Docker是否运行 docker version >nul 2>&1 if %errorlevel% neq 0 ( echo Error: Docker is not running or not installed echo Please start Docker Desktop and try again exit /b 1 ) echo Step 1: Starting SSH test environment... docker-compose up -d REM 等待容器启动 echo Waiting for SSH service to start... timeout /t 10 /nobreak >nul echo. echo Step 2: Checking container status... docker-compose ps echo. echo Step 3: Testing SSH connectivity... echo Testing basic SSH connection (you may need to type 'yes' to accept host key) echo Password for root user is: password timeout /t 3 /nobreak >nul ssh -o ConnectTimeout=5 -o StrictHostKeyChecking=no root@localhost -p 2222 "echo 'SSH connection successful'; exit" if %errorlevel% equ 0 ( echo SSH connection test passed! ) else ( echo SSH connection test failed. Checking logs... docker-compose logs ssh-test-server ) echo. echo Step 4: fscan SSH plugin tests echo. REM 检查fscan是否存在 if not exist "..\..\fscan.exe" ( echo Warning: fscan.exe not found in project root echo Please build fscan first: go build -o fscan.exe echo. echo Manual test commands: echo fscan -h 127.0.0.1:2222 -m ssh echo fscan -h 127.0.0.1:2222 -m ssh -user root -pwd password echo fscan -h 127.0.0.1:2222 -m ssh -user admin -pwd 123456 goto :cleanup ) echo Testing fscan SSH plugin... echo. echo Test 1: Basic SSH service detection ..\..\fscan.exe -h 127.0.0.1:2222 -m ssh -np echo. echo Test 2: SSH with specific credentials ..\..\fscan.exe -h 127.0.0.1:2222 -m ssh -user root -pwd password echo. echo Test 3: SSH with weak password detection ..\..\fscan.exe -h 127.0.0.1:2222 -m ssh -user admin -pwd 123456 echo. echo Test 4: SSH brute force simulation (limited users) ..\..\fscan.exe -h 127.0.0.1:2222 -m ssh -userfile test-users.txt -pwdfile test-passwords.txt :cleanup echo. echo ======================================== echo Test completed! echo ======================================== echo. echo Container is still running for manual testing. echo. echo Manual test commands: echo ssh root@localhost -p 2222 ^(password: password^) echo ssh admin@localhost -p 2222 ^(password: 123456^) echo ssh test@localhost -p 2222 ^(password: test123^) echo. echo To stop the test environment: echo docker-compose down echo. echo To view SSH server logs: echo docker-compose logs -f ssh-test-server echo. pause