Methodology v1.0

Reconnaissance

Active recon ⇒ Port scan/valu scan/web scan/nmap/masscan

Passive recon ⇒ whios/whatweb/osint/DNS/>Dorks

I am seeking to obtain the following:

My principle is from start to finish ..

1-IPs

2-Subdomains

3-Js Files

4-Directories

5-Parameters

6-Emails

Recon Guide for Pentesters

JSfinder to find a JS files

======================================================================

Enumerating subdomains

Sublist3r

======================================================================

assetfinder

======================================================================

httprob to make the domain to (HTTP/HTTPS)

========================================================================

xargs ⇒ build and execute command lines from standard input

======================================================================

Scanning open port

masscan

======================================================================

namp

=======================================================================

amass

=======================================================================

Merging subdomains into one file:- *-subs.txt

========================================================================

Nuclei

Directory and File Enumeration

Gobuster

Run FFUF

Hidden parameters

Arjun

Cors Misconfigration

Bypassing CSRF Protect

IDOR

2FA Bypass Techniques

Bypassing Rate Limit Protection

File Upload

Reference:https://brutelogic.com.br/blog/file-upload-xss/

Quick Analysis

SSRF

Here are 5 payloads that could be used for bypassing defenses when it comes to SSRF (Server-Side Request Forgery):

  1. Bypass SSRF with CIDR:

  2. Bypass using rare address:

  3. Bypass using tricks combination:

  4. Bypass against a weak parser:

  5. 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:

  1. We discover that the following URL works:

  2. We can then run Intruder attack (Burp Suite) trying different ports, effectively doing a port scan of the host.

  3. We can also try to scan private IPs such as 192.168.x.x and discover alive IPs in the internal network

Dangerous Functions

Language
Function
Possible Vulnerability

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 (Forbidden)

Bypass-403 | Go script for bypassing 403 forbiddenarrow-up-right

  1. Using "X-Original-URL" header

Try this to bypass

  1. Appending %2e after the first slash

Try this to bypass

  1. Try add dot (.) slash (/) and semicolon (;) in the URL

Try this to bypass

  1. Add "..;/" after the directory name

Try this to bypass

  1. Try to uppercase the alphabet in the url

Try this to bypass

  1. Via Web Cache Poisoning

Bypass Captcha

  1. Try changing the request method, for example POST to GET

Change the method to GET

  1. Try remove the value of the captcha parameter

  1. Try reuse old captcha token

  1. Convert JSON data to normal request parameter

Convert to normal request

  1. Try custom header to bypass captcha

  1. Change some specific characters of the captcha parameter and see if it is possible to bypass the restriction.

Try this to bypass

Business Logic Errors

  1. 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

  2. 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.

  3. 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.

  4. 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.

  5. 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.

  6. 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.

  7. 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.

  8. 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.

  9. 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

LFI & RFI 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

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:

Disable_Function bypass

CSRF Checklist

circle-info

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.

Referrer / Origin check bypass

To set the domain name of the server in the URL that the Referrer is going to send inside the parameters you can do:

XSS

Blind XSS

Blind XSS tools

Blind XSS endpoint

  • Contact forms

  • Ticket support

  • Referer Header

    • Custom Site Analytics

    • Administrative Panel logs

  • User Agent

    • Custom Site Analytics

    • Administrative Panel logs

  • Comment Box

    • Administrative Panel

Tips

You can use a Data grabber for XSSarrow-up-right 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:

Last updated