Methodology v1.0
Last updated
Last updated
Active recon ⇒ Port scan/valu scan/web scan/nmap/masscan
Passive recon ⇒ whios/whatweb/osint/DNS/>Dorks
My principle is from start to finish ..
1-IPs
2-Subdomains
3-Js Files
4-Directories
5-Parameters
6-Emails
======================================================================
======================================================================
======================================================================
========================================================================
xargs ⇒ build and execute command lines from standard input
======================================================================
======================================================================
=======================================================================
=======================================================================
========================================================================
Guessable CSRF Token
Clickjacking to strong CSRF token bypass
Type Juggling
Array: newmail=victim@gmail.com&csrftoken[]=lol
set the CSRF token to "null
" or add null bytes.
check wether CSRF token is sent over http or sent to 3rd party.
Generate multiple CSRF token, observe the static part, Keep it as it is and play with thr dyamic part
Remove X-CSRF-TOKEN from Header
Find and Replace IDs
in URLs, header and body: /users/01 -> /users/02
Try Parameter Pollution: users=01
-> users=01&users=02
Special Characters: /users/01* or /users/*
-> Disclosure of every single user
Try Older version of api endpoint: /api/v3/users/01 -> /api/v1/users/02 , etc.....
add extension: /users/01 -> /users/02.json/XML
Change Request Methods POST /users/01
-> GET, PUT, PATCH, DELETE
etc...
Check if the Referrer or some other Headers are used to validate the IDs
GET /users/02
-> 403 Forbidden
Referer: example.com/usser/01
-----------------------------
GET /users/02
-> 200 OK!
Referer: example.com/usser/02
Encrypted IDs if application using encrypted IDs , try to decrypt using hashes.com or other tools
Swap GUID
With Numeric
ID
or
email:
/users/1b04c123-89f2-241s-b15b-e15641384h25
-> /users/02 or /users/a@b.com
Try GUIDs sush as:
00000000-0000-0000-0000-000000000000 and 11111111-1111-1111-1111-1111111111111111
GUID Enumeration: try to disclose GUIDs using Google Dorks,Github,wayback,Burp,History
if none of the GUID Enumeration methods work then try: SignUp, Reset Password,Other endpoints
within the application and analyze the response
403/401
Bypass:
if server responds back with a 403/401
then try ti use burp intruder and send 50-100 requests having different IDs: Ex: from /users/01 to /users/100
Bild IDORsL Sometimes information is not directly discloed, Lookout for endpoint and features that may disclose information such as export files, emails or message alerts.
Chain IDOR with XSS for Account Tackeovers
OTP BYPASS
Response Manipulation: if "success":false
change to "success":true
Status Code
Manipulation: if status is 4xx change to 200 ok
By repeating the form submission multiple times using a repeater
js file: Rare but some js files may contain some information about 2FA code
Brute Forcing any length MFA Code
[[JSON Tests Cheat Sheet]] -> Array of codes.....
Check for default OTP - 111111, 123456, 000000,4242 or null
leaked in response
CSRF on 2fa Disabling
Password reset Disable 2fa Email/Password
old OTP is still valid
Integrity Issues -> Use someone else OTP to open your account
Always check the response!
The response is
intead of 127.0.0.1 , try 127.0.0.2,127.0.0.3,....
Even you can try using double X-Forwarded-For
try changing user-agent,cookies
Append null bytes (%00,%0d,%0a,%0d,%0d%0a,%09,%0C,%20
) to the original endpoint (Ex: POST /forgot-password%20 HTTP/1.1
). Also try adding the bytes after the value of parameter (Like email=h3ckt0r@gmail.com%20)
Login to a vaild account and the invaild one, Repeat this process to foll the server that blocks our IP if ypu sunmit 3 incorrect logins in a row
Race condition
add any random parameter in the request
Change the request body (From to JSON/XML
or vice-versa).
Change request methods (POST to PUT to GET to PATCH to DELETE to HEAD to OPTIONS to TRACE To CONNECT
)
if developer implemented captcha-based protection then try captcha Bypass Techniques
Gmail + and trick
change api version (EX: api/v2/1729/confirm-email to api/v1/1729/confirm-email )
Reference:https://brutelogic.com.br/blog/file-upload-xss/
Quick Analysis
Test for IDOR By changing the object references [filename, IDs,.....]
EXIF Geo-location Data Not Stripped From Uploaded Images > Manual User Enumeration
XSS in filename "><img src=x onerror=confirm(88)>.png
XSS metadata exiftool -Artist=’ “><img src=1 onerror=alert(document.domain)>’ 88.jpeg
XSS in SVG <svg xmlns="http://www.w3.org/2000/svg" onload="alert(document.domain)"/>
GIF to XSS GIF89a/*<svg/onload=alert(1)>*/=alert(document.domain)//;
Here are 5 payloads that could be used for bypassing defenses when it comes to SSRF (Server-Side Request Forgery):
Bypass SSRF with CIDR:
Bypass using rare address:
Bypass using tricks combination:
Bypass against a weak parser:
Bypass localhost with @:
Let’s remind ourselves what SSRF vulnerabilities are and what can we do with them. In general, SSRF allows us to:
Access services on the loopback interface running on the remote server
Scan internal network and potentially interact with the discovered services
Read local files on the server using file:// protocol handler
Move laterally / pivoting into the internal environment
How to find SSRF? When the target web application allows us to access external resources, e.g., a profile image loaded from external URL (running on a 3rd party website), we can try to load internal resources accessible by the vulnerable web application. For example:
We discover that the following URL works:
We can then run Intruder attack (Burp Suite) trying different ports, effectively doing a port scan of the host.
We can also try to scan private IPs such as 192.168.x.x and discover alive IPs in the internal network
PHP
eval()
, assert()
, system()
, exec()
, shell_exec()
, passthru()
, popen()
, backticks (`), include()
, require()
RCE if used on unsanitized user input. eval()
and assert()
execute PHP code in its input, while system()
, exec()
, shell_exec()
, passthru()
, popen()
, and backticks execute system commands. include()
and require()
can be used to execute PHP code by feeding the function a URL to a remote PHP script.
PHP
unserialize()
Insecure deserialization if used on unsanitized user input
Python
eval()
, exec()
, os.system()
RCE if used on unsanitized user input
Python
pickle.loads()
, yaml.load()
Insecure deserialization if used on unsanitized user input
JavaScript
document.write()
, document.writeln
XSS if used on unsanitized user input. These functions write to the HTML document. So if attackers can control the value passed into it on a victim's page, the attacker can write JavaScript onto a victim's page.
JavaScript
document.location.href
Open redirect when used on unsanitized user input. document.location.href
changes the location of the user's page.
Ruby
System()
, exec()
, %x()
, backticks (`code`)
RCE if used on unsanitized user input
Ruby
Marshal.load()
, yaml.load()
Insecure deserialization if used on unsanitized user input
Bypass-403 | Go script for bypassing 403 forbidden
Using "X-Original-URL" header
Try this to bypass
Appending %2e after the first slash
Try this to bypass
Try add dot (.) slash (/) and semicolon (;) in the URL
Try this to bypass
Add "..;/" after the directory name
Try this to bypass
Try to uppercase the alphabet in the url
Try this to bypass
Via Web Cache Poisoning
Try changing the request method, for example POST to GET
Change the method to GET
Try remove the value of the captcha parameter
Try reuse old captcha token
Convert JSON data to normal request parameter
Convert to normal request
Try custom header to bypass captcha
Change some specific characters of the captcha parameter and see if it is possible to bypass the restriction.
Try this to bypass
Review Functionality
Some applications have an option where verified reviews are marked with some tick or it's mentioned. Try to see if you can post a review as a Verified Reviewer without purchasing that product.
Some app provides you with an option to provide a rating on a scale of 1 to 5, try to go beyond/below the scale-like provide 0 or 6 or -ve.
Try to see if the same user can post multiple ratings for a product. This is an interesting endpoint to check for Race Conditions.
Try to see if the file upload field is allowing any exts, it's often observed that the devs miss out on implementing protections on such endpoints.
Try to post reviews like some other users.
Try performing CSRF on this functionality, often is not protected by tokens
Coupon Code Functionality
Apply the same code more than once to see if the coupon code is reusable.
If the coupon code is uniquely usable, try testing for Race Condition on this function by using the same code for two accounts at a parallel time.
Try Mass Assignment or HTTP Parameter Pollution to see if you can add multiple coupon codes while the application only accepts one code from the Client Side.
Try performing attacks that are caused by missing input sanitization such as XSS, SQLi, etc. on this field
Try adding discount codes on the products which are not covered under discounted items by tampering with the request on the server-side.
Delivery Charges Abuse
Try tampering with the delivery charge rates to -ve values to see if the final amount can be reduced.
Try checking for the free delivery by tampering with the params.
Currency Arbitrage
Pay in 1 currency say USD and try to get a refund in EUR. Due to the diff in conversion rates, it might be possible to gain more amount.
Premium Feature Abuse
Try forcefully browsing the areas or some particular endpoints which come under premium accounts.
Pay for a premium feature and cancel your subscription. If you get a refund but the feature is still usable, it's a monetary impact issue.
Some applications use true-false request/response values to validate if a user is having access to premium features or not.
Try using Burp's Match & Replace to see if you can replace these values whenever you browse the app & access the premium features.
Always check cookies or local storage to see if any variable is checking if the user should have access to premium features or not.
Refund Feature Abuse
Purchase a product (usually some subscription) and ask for a refund to see if the feature is still accessible.
Try for currency arbitrage explained yesterday.
Try making multiple requests for subscription cancellation (race conditions) to see if you can get multiple refunds.
Cart/Wishlist Abuse
Add a product in negative quantity with other products in positive quantity to balance the amount.
Add a product in more than the available quantity.
Try to see when you add a product to your wishlist and move it to a cart if it is possible to move it to some other user's cart or delete it from there.
Thread Comment Functionality
Unlimited Comments on a thread
Suppose a user can comment only once, try race conditions here to see if multiple comments are possible.
Suppose there is an option: comment by the verified user (or some privileged user) try to tamper with various parameters in order to see if you can do this activity.
Try posting comments impersonating some other users.
Parameter Tampering
Tamper Payment or Critical Fields to manipulate their values
Add multiple fields or unexpected fields by abusing HTTP Parameter Pollution & Mass Assignment
Response Manipulation to bypass certain restrictions such as 2FA Bypass
phpinfo()
FPM/FastCGI
disable_functions
: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,system,exec,shell_exec,popen,proc_open,passthru,symlink,link,syslog,imap_open,ld,mail
IF Found disable_functions & open_basedir
in PHP try using
Open basedir
to bypass open_basedir use glob://
Note1: In the path you can also use /e??/*
to list /etc/*
and any other folder.
Note3: This example is only useful to list folders not to read files
Payload:
Output:
To change Dir using this
CSRF Checklist
Remove Anti-CSRF Token
No check for the user's Token
Weak Token
Reusable token
Change request method
Guessable Token
Bypass referer
Modifying Parameter Names => POST To GET
Modifying Parameter Names
https://example.com/my/dear/api/val/num?_method=PUT
X-HTTP-Method
X-HTTP-Method-Override
X-Method-Override
Test the request without the Customized Token and also header.
Test the request with exact same length but different token.
CSRF token is verified by a cookie
Note that if the csrf token is related with the session cookie this attack won't work because you will need to set the victim your session, and therefore you will be attacking yourself.
Example (from here) of sending JSON data as text/plain:
To set the domain name of the server in the URL that the Referrer is going to send inside the parameters you can do:
try use h3ckt00r'"><
basics pyload '><script>alert(1)</script>
or <img src="X" onerror="alert('1')">
to bypass spaces use / ex <svg/onload=confirm(1)> or '><marguee onstart="[cookie ].find(confirm)">
Blind XSS
Contact forms
Ticket support
Referer Header
Custom Site Analytics
Administrative Panel logs
User Agent
Custom Site Analytics
Administrative Panel logs
Comment Box
Administrative Panel
You can use a Data grabber for XSS and a one-line HTTP server to confirm the existence of a blind XSS before deploying a heavy blind XSS testing tool.
Eg. payload
Eg. one-line HTTP server: