An application is vulnerable to attack when:
- User-supplied data is not validated, filtered, or sanitized by the application.
- Dynamic queries or non-parameterized calls without context-aware escaping are used directly in the interpreter.
- Hostile data is used within object-relational mapping (ORM) search parameters to extract additional, sensitive records.
- Hostile data is directly used or concatenated. The SQL or command contains the structure and malicious data in dynamic queries, commands, or stored procedures.
Some of the more common injections are SQL, NoSQL, OS command, Object Relational Mapping (ORM), LDAP, and Expression Language (EL) or Object Graph Navigation Library (OGNL) injection. The concept is identical among all interpreters.
HINT: Make sure that you download OWASP ZAP and Postman.
SQL injection flaws are introduced when software developers create dynamic database queries constructed with string concatenation which includes user supplied input.
NoSQL injection attacks may execute in different areas of an application than traditional SQL injection. Where SQL injection would execute within the database engine, NoSQL variants may execute during within the application layer or the database layer, depending on the NoSQL API used and data model. Typically NoSQL injection attacks will execute where the attack string is parsed, evaluated, or concatenated into a NoSQL API call.
Get access to the account of the administrator.
-
Tip: His email is admin@juice-sh.op.
-
Tip: You don't need the matching password to solve the challenge.
-
Tip: Try to corrupt the underlying SQL Query by inserting invalid input. For example, an apostrophe
'might help. -
Tip: Have a look at the Web Development Tool.
Modify the product reviews of the product Apple Juice (1000 ml) without being logged in the administrator account.
Change the first review with the text One of my favorites! written by admin@juice-sh.op to Apple Juice has been hacked!.
-
Tip: Inspect the HTTP calls while opening a product review.
-
Tip: Find out, which parameters you have to manipulate. Postman will help you with modifying these parameters.
-
Tip: You have to slightly change the GET call that you have observed in your console.
Modify multiple product reviews at once by changing the text of all reviews to Juice Shop has been hacked!.
-
Tip: The process of Challenge 3.2 might help you.
-
Tip: Remember the architecture overview - Juiceshop uses MarsDB, a NodeJS MongoDB clone.
-
Tip: You need to use a query operator to solve this challenge.
Try to lead the server to sleep for 2 seconds.
-
Tip: Find a way to interact with the API. Challenge 3.2 and challenge 3.3 might reveal a possibility where you can exploit a parameter.
-
Tip: You need to inject a sleep function as a parameter.
Cross-Site scripting (XSS) is the injection of malicious code in web applications. It allows attackers to execute JavaScript in the browser of another user. This can lead to session stealing, account takeover or the download of malicious software, as the code of the attacker becomes a part of the HTML source of the application.
HINT: Install Postman if you haven't done yet.
Try to perform a persisted XSS attack by affecting the table of the Users with Postman. Every call of the administration section should alert a dialog with the content xss.
To perform XSS, use iframe: <iframe src="javascript:alert(`xss`)">.
-
Tip: Try to interact with the users API.
-
Tip: If you have solved Challenge 2.2, you will know how to interact with the users API.
-
Tip: You have to send a POST call.
-
Tip: Consider that there are several parameters that you must pass, although the content of these parameters doesn't matter for your result.
-
Tip: There might be characters you must escape.
Try to perform a persisted XSS attack by affecting the table of the Products with Postman. Every call containing the new product should alert a dialog with the content xss.
To perform XSS, use iframe: <iframe src="javascript:alert(`xss`)">
-
Tip: Try to interact with the products API.
-
Tip: The process is nearly similar to Challenge 5.1, so have a look at the tips for this challenge.
-
Tip: Consider that you need an authorization.
-
Tip: Look about the session token.
Try to perform a persisted XSS attack by affecting the list of the customer feedback. Every call containing customer feedback should alert a dialog with the content xss.
To perform XSS, use iframe: <iframe src="javascript:alert(`xss`)">
-
Tip: Customer feedback can be given here:
http://localhost:3000/#/contact. -
Tip: You have to modify the iframe element, as the common input won't be rendered as the similar output.
-
Tip: While visiting sites that contain customer feedback, check the sources (tab
Inspectorin Firefox or tabElementsin Chrome) to recognize how the iframe element is embedded in the HTML sources.
Try to perform a reflected XSS attack by finding a suitable input field.
To perform XSS, use iframe: <iframe src="javascript:alert(`xss`)">
-
Tip: To find the suitable area, you have to log in first with any account.
-
Tip: Have a look at the options of the account area.
Try to perform a DOM-based XSS attack by finding a suitable input field.
To perform XSS, use iframe: <iframe src="javascript:alert(`xss`)">
- Tip: The input field you need here is not hidden at all.