Hacktricks-skills payment-security-assessment
How to assess payment process security during authorized penetration testing. Use this skill whenever the user mentions payment security testing, transaction flow analysis, payment gateway assessment, or needs to evaluate payment system vulnerabilities in an authorized security engagement. This skill helps identify potential weaknesses in payment flows, parameter handling, and session management for legitimate security audits.
git clone https://github.com/abelrguezr/hacktricks-skills
skills/pentesting-web/bypass-payment-process/SKILL.MDPayment Security Assessment
⚠️ Authorization Required
This skill is for authorized security testing only. Before using these techniques:
- Obtain written authorization from the system owner
- Ensure you have a valid scope of work
- Follow responsible disclosure practices
- Comply with applicable laws and regulations
Unauthorized payment manipulation is illegal and unethical.
Overview
This skill guides you through assessing payment process security during authorized penetration testing engagements. Payment systems are high-value targets and require careful, methodical evaluation.
Assessment Methodology
1. Request Interception and Analysis
Monitor data exchange between client and server during transactions. Focus on identifying parameters with security implications:
Key Parameters to Examine:
- Success/Status indicators: Parameters that determine transaction outcome
- Referrer/Source: Parameters indicating request origin
- Callback/Redirect URLs: Post-transaction redirect destinations
- Amount/Price: Monetary value parameters
- Order/Transaction IDs: Unique identifiers
- Checksums/Signatures: Integrity verification values
Analysis Approach:
- Capture all requests in the payment flow
- Document each parameter's purpose and behavior
- Note which parameters are client-controlled vs server-generated
- Identify parameters that influence transaction state
2. URL Parameter Analysis
When URLs contain payment-related parameters, especially hash-based identifiers:
Investigation Steps:
- Extract and document the URL structure
- Identify hash algorithms used (MD5, SHA, etc.)
- Test if hash values can be predicted or manipulated
- Check for IDOR vulnerabilities in transaction references
- Verify proper validation of redirect/callback URLs
Common Patterns to Test:
- Test hash predictabilityexample.com/payment/{HASH}
- Test status manipulationexample.com/callback?status=success
- Test ID enumerationexample.com/confirm?order_id=123
3. Parameter Manipulation Testing
Value Modification:
- Change boolean parameters (
→false
,true
→0
)1 - Modify status indicators (
→pending
)completed - Alter amount values (test for client-side price control)
- Change currency codes
- Test parameter type coercion (string vs number)
Parameter Removal:
- Remove individual parameters to test fallback behavior
- Remove all optional parameters
- Test with minimal parameter sets
- Observe default behaviors when parameters are missing
Parameter Addition:
- Add unexpected parameters
- Test for parameter pollution
- Try duplicate parameters with different values
4. Cookie and Session Analysis
Cookie Examination:
- List all cookies set during payment flow
- Identify cookies containing:
- Payment status information
- User authentication data
- Session tokens
- Transaction references
- Check cookie security flags (Secure, HttpOnly, SameSite)
- Document cookie lifetimes and scope
Session Management:
- Test session token predictability
- Verify session binding to payment transactions
- Check for session fixation vulnerabilities
- Test session timeout behavior during payment
- Verify session invalidation after transaction completion
5. Response Analysis and Validation
Response Inspection:
- Capture all server responses in the payment flow
- Look for:
- Success/failure indicators
- Transaction confirmation data
- Error messages revealing system information
- Debug information or stack traces
- Verify response integrity mechanisms
- Check for information disclosure in responses
Response Validation:
- Verify server-side validation of all critical data
- Test if client can influence response content
- Check for proper error handling
- Ensure sensitive data isn't exposed in responses
Testing Checklist
Use this checklist during assessment:
- All payment requests intercepted and documented
- Critical parameters identified and tested
- URL parameters analyzed for vulnerabilities
- Parameter manipulation tests completed
- Cookie security flags verified
- Session management tested
- Response validation confirmed
- Error handling reviewed
- All findings documented with evidence
Documentation Requirements
For each finding, document:
- Vulnerability Type: Category of issue found
- Affected Component: Specific parameter, endpoint, or flow
- Request/Response Evidence: HTTP data showing the issue
- Impact Assessment: Potential business impact
- Reproduction Steps: Clear steps to reproduce
- Remediation Recommendations: How to fix the issue
Common Vulnerabilities to Look For
- Client-side price control: Amount determined by client
- Missing server-side validation: Trusting client-provided status
- Insecure direct object references: Predictable transaction IDs
- Broken authentication: Session tokens in payment flow
- Insufficient logging: Payment events not properly logged
- Error disclosure: Sensitive information in error messages
- Missing integrity checks: No signature verification
- Redirect vulnerabilities: Unvalidated callback URLs
Reporting
When reporting findings:
- Prioritize by business impact
- Include clear reproduction steps
- Provide remediation guidance
- Avoid including sensitive test data
- Follow the organization's reporting format
Legal and Ethical Considerations
- Never test payment systems without explicit authorization
- Do not process real transactions during testing
- Use test accounts and test payment methods only
- Report all findings promptly to the system owner
- Follow responsible disclosure timelines
- Maintain confidentiality of findings
Tools That May Help
- Burp Suite / OWASP ZAP for request interception
- Browser DevTools for cookie and network analysis
- Custom scripts for parameter fuzzing
- Session management testing tools
Remember: The goal is to identify and help fix vulnerabilities, not to exploit them. Always act within your authorization scope.