Bá
Các vuln tìm được:
1. SQL Injection
1.1. addAssignment.php
Description:
Tham số id
của chức năng này bị dính SQLi
Reproduce:
Login -> Thêm bài tập -> Xem chi tiết.
Địa chỉ bây giờ sẽ có dạng /addAssignment.php?id=5
.
Khi dùng id
là 1 or 1=1
:

Khi dùng id
là 1 or 1=0
:

Lấy tài khoản admin bằng id
là 5 UNION ALL SELECT 40,41,42,43,44,(SELECT CONCAT(username, password) FROM users LIMIT 1 OFFSET 4)

1.2. message.php
Description:
Tham số JSON userId1
bị dính SQLi
Reproduce:
Login -> Tin nhắn
Request khi truy cập chức năng này như sau:

Truyền "1) AND GTID_SUBSET(CONCAT(0x20,(SELECT CONCAT(username,0x20,password) FROM users LIMIT 1 OFFSET 4),0x20),1) AND (1=1"
vào userId1

1.3. message.php
Description:
Tham số JSON userId2
bị dính SQLi
Reproduce:
Tương tự lỗi bên trên nhưng với userId2

1.4. userDetail.php
Description:
Tham số id
bị dính SQLi
Reproduce:
Login -> Xem người dùng -> Chi tiết
Được request như sau

Thay id thành 1' AND GTID_SUBSET(CONCAT(0x20,(SELECT CONCAT(username,0x20,password) FROM users LIMIT 1 OFFSET 4),0x20),1)--

1.5. userDetail.php
Description:
Tham số id
khi gửi tin nhắn cho người dùng khác bị dính SQLi
Reproduce:
Login -> Xem người dùng -> Chi tiết -> Gửi một tin nhắn
Request khi gửi tin

Thay id
thành 1' AND GTID_SUBSET(CONCAT(0x20,(SELECT CONCAT(username,0x20,password) FROM users LIMIT 1 OFFSET 4),0x20),1) AND '1=1

2. Cross-site scripting (XSS)
2.1. addAssignment.php
Description:
Tham số title
và description
bị dính Stored XSS, deadline
dính Reflected XSS
Reproduce:
Login -> Thêm bài tập -> Tạo thêm một assignment tùy ý
Request thu được

Sửa tham số title
thành <script>alert('TrungPQ-title')</script>


Tương tự:
Với description
:


Với deadline
:

2.2. message.php
Description:
Tất cả tham số JSON đều dính XSS (Reflected)
Reproduce:
Login -> Tin nhắn -> Chọn 1 người dùng
Request thu được

Với userId1

Với userId2

Với time

2.3 userDetail.php
Description:
Tham số id
bị dính Reflected XSS
Reproduce:
Login -> Xem người dùng -> Chi tiết -> Nhắn tin
Request như sau

Thử thay id
để trigger XSS

3. Insecure direct object references (IDOR)
3.1. message.php
Description:
Có thể thao túng tham số JSON userId1
và userId2
để xem tin nhắn tùy ý
Reproduce:
Login -> Tin nhắn -> Chọn 1 người bất kì
Request thu được như sau:

Sửa 2 tham số userId1
và userId2
để xem tin nhắn tùy ý

4. File upload
4.1. addAssignment.php
Description:
Không validate file được up lên
Reproduce:
Login -> Thêm bài tập -> Up shell lên

Quay lại trang Thêm bài tập, Xem chi tiết bài tập vừa đăng
Ấn nút Download để truy cập vào shell

Information gathering:
IP: 128.199.125.229, 172.19.0.4
OS:
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
User chạy dịch vụ web: www-data
Vị trí thư mục web của máy chủ web: /var/www/html/
Last updated