Reader small image

You're reading from  Burp Suite Cookbook - Second Edition

Product typeBook
Published inOct 2023
PublisherPackt
ISBN-139781835081075
Edition2nd Edition
Right arrow
Author (1)
Dr. Sunny Wear
Dr. Sunny Wear
author image
Dr. Sunny Wear

Dr. Sunny Wear is a web security architect and penetration tester. She provides secure coding classes, creates software, and performs penetration testing on web/API and mobile applications. Sunny has more than 25 years of hands-on software programming, architecture, and security experience and holds a Doctor of Science in Cybersecurity. She is a content creator on Pluralsight, with three courses on Burp Suite. She is a published author, a developer of mobile apps such as Burp Tool Buddy, and a content creator on courses related to web security and penetration testing. She regularly speaks and holds classes at security conferences such as Defcon, Hackfest, and BSides.
Read more about Dr. Sunny Wear

Right arrow

Assessing Business Logic

This chapter covers the basics of business logic testing, including an explanation of some of the more common tests performed in this area. Web penetration testing involves key assessments of business logic to determine how well the design of an application performs integrity checks, especially within sequential application function steps, and we will be learning how to use Burp Suite to perform such tests.

In this chapter, we will cover the following recipes:

  • Testing business logic data validation
  • Unrestricted file upload—bypassing weak validation
  • Performing process-timing attacks
  • Testing for the circumvention of workflows
  • Uploading malicious files—polyglots

Technical requirements

To complete the recipes in this chapter, you will need the following:

  • OWASP Broken Web Applications (BWA)
  • OWASP Mutillidae link
  • OWASP WebGoat link
  • OWASP Damn Vulnerable Web Application (DVWA) link
  • Burp Proxy Community or Professional (https://portswigger.net/burp/)
  • Firefox browser using FoxyProxy add-on or Burp Suite browser

Testing business logic data validation

Business logic data validation errors occur due to a lack of server-side checks, especially in a sequence of events such as shopping cart checkouts. If design flaws such as thread issues are present, those flaws may allow an attacker to modify or change their shopping cart contents or prices prior to purchasing them, to lower the price paid.

Getting ready

Using the OWASP WebGoat application and Burp, we will exploit a business logic design flaw to purchase many large ticket items for a very cheap price.

How to do it...

  1. Ensure the owaspbwa VM is running. Select the OWASP WebGoat application from the initial landing page of the VM. The landing page will be configured to an IP address specific to your machine:
Figure 7.1 – VM landing page

Figure 7.1 – VM landing page

  1. After you’ve clicked the OWASP WebGoat link, you will be prompted for some login credentials. Use these credentials—username: guest; password...

Unrestricted file upload – bypassing weak validation

Many applications allow for files to be uploaded for various reasons. Business logic on the server side must include checking for acceptable files; this is known as whitelisting. If such checks are weak or only address one aspect of file attributes (for example, file extensions only), attackers can exploit these weaknesses and upload unexpected file types that may be executable on the server.

Getting ready

Using the DVWA application and Burp, we will exploit a business logic design flaw in the file upload page.

How to do it...

  1. Ensure the owaspbwa VM is running. Select DVWA from the initial landing page of the VM. The landing page will be configured to an IP address specific to your machine.
  2. On the login page, use these credentials—username: user; password: user.
  3. Select the DVWA Security option from the menu on the left. Change the default setting of low to medium and then click Submit:
...

Performing process-timing attacks

By monitoring the time an application takes to complete a task, it is possible for attackers to gather or infer information about how an application is coded. For example, a login process using a valid username receives a response quicker than the same login process given an invalid username. This delay in response time leaks information related to system processes. An attacker could use a response time to perform account enumeration and determine valid usernames based on the timing of the response.

Getting ready

For this recipe, you will need the common_pass.txt wordlist from wfuzz, available here:

https://github.com/xmendez/wfuzz

Here’s the path to this:

wordlist | others | common_pass.txt

Using OWASP Mutillidae II, we will determine whether the application provides information leakage based on the response time from forced logins.

Ensure Burp Suite is running, and also ensure that the owaspbwa VM is running and that Burp...

Testing for the circumvention of workflows

Shopping cart to payment gateway interactions must be tested by web application penetration testers to ensure the workflow cannot be performed out of sequence. A payment should never be made unless verification of the cart contents is checked on the server side first. In the event this check is missing, an attacker can change the price, quantity, or both, prior to the actual purchase.

Getting ready

Using the OWASP WebGoat application and Burp, we will exploit a business logic design flaw in which there is no server-side validation prior to a purchase.

How to do it...

  1. Ensure the owaspbwa VM is running. Select the OWASP WebGoat application from the initial landing page of the VM. The landing page will be configured to an IP address specific to your machine.
  2. After you’ve clicked the OWASP WebGoat link, you will be prompted for login credentials. Use these credentials—username: guest; password: guest.
  3. After...

Uploading malicious files – polyglots

Polyglot is a term defined as something that uses several languages. If we carry this concept into hacking, it means the creation of an attack vector by using different languages as execution points. For example, attackers can construct valid images and embed JavaScript. The placement of the JavaScript payload is usually in the comments section of an image. Once the image is loaded in a browser, the XSS content may execute, depending upon the strictness of the content type declared by the web server and the interpretation of the content type by the browser. In this recipe, we will use a polyglot to upload a webshell disguised as an image.

Getting ready

Using the OWASP WebGoat file upload functionality, we will write a small Java Server Pages (JSP) webshell and upload it to the application, disguised as an image.

We will use some popular source code for the JSP webshell and save it in a file called poly.jsp.

Ensure the owaspbwa...

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Burp Suite Cookbook - Second Edition
Published in: Oct 2023Publisher: PacktISBN-13: 9781835081075
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime

Author (1)

author image
Dr. Sunny Wear

Dr. Sunny Wear is a web security architect and penetration tester. She provides secure coding classes, creates software, and performs penetration testing on web/API and mobile applications. Sunny has more than 25 years of hands-on software programming, architecture, and security experience and holds a Doctor of Science in Cybersecurity. She is a content creator on Pluralsight, with three courses on Burp Suite. She is a published author, a developer of mobile apps such as Burp Tool Buddy, and a content creator on courses related to web security and penetration testing. She regularly speaks and holds classes at security conferences such as Defcon, Hackfest, and BSides.
Read more about Dr. Sunny Wear