# Challenges

## SQLi

In this challenge, you need to get all transactions from the database.

The most common and used test case for SQLi is to try the ' sign in the input field. If we receive an error or weird result, there is a strong possibility that the app has SQLi. For SQLi cheatsheet, you can see on [GitHub](https://github.com/payloadbox/sql-injection-payload-list).

You can also test your application with various tools like [SQLmap](http://sqlmap.org/), which is one of the best tools available for testing your application against SQLi.

### Solution

1. Go to /Transaction/Index
2. In the search field, if you will try with `'` , you will notice that you receive an exception as seen on the image below (*The exception inside the browser*)
3. We can continue looking for this issue inside the dev tool window to see the response. From it, we can notice that an error occurs on the server.
4. For the final result, we need to modify the search string appropriately to create a proper SQL injection.

![The exception inside the browser](https://2460584164-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M2m74sb-YSZ_UxP3c94%2F-M76uCdKnVaGxYju-raf%2F-M76vEql9IMMlaiyeW8v%2Fimage.png?alt=media\&token=04c28921-6ef9-4304-9570-37b0e186e772)

![Response inside DevTools](https://2460584164-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M2m74sb-YSZ_UxP3c94%2F-MOWUlIl01fXFIUDIgZ6%2F-MOWUzUXeZs3N9jp3I8Q%2FMicrosoftTeams-image.png?alt=media\&token=44573305-a093-4817-8527-ab0b92cef042)

![](https://2460584164-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M2m74sb-YSZ_UxP3c94%2F-M76eJLOrjHldoDPmyDk%2F-M76u6jR3PAZ4tSktCVS%2Fimage.png?alt=media\&token=2f8ac873-1d20-4607-9e42-336a8b801b95)

If you are using CTF mode, you will find the flag in the response header.
