SQLi - 無法解析 UNION 作業中 "Chinese_Taiwan_Stroke_CI_AI" 與"SQL_Latin1_General_CP1_CI_AS" 之間的定序衝突。


在嘗試SQLi for MSSQL的過程中,有時候會遇到無法解析定序衝突的問題:

無法解析 UNION 作業中 "Chinese_Taiwan_Stroke_CI_AI" 與"SQL_Latin1_General_CP1_CI_AS" 之間的定序衝突。


這是因為做UNION的兩個資料庫或資料表或欄位的定序不同,而使得SQL Query無從依循。
最簡單的解決方法便是在對應資料表的欄位上自行設定相同的定序!

UNION ALL
SELECT
Field1 collate Chinese_Taiwan_Stroke_CI_AI,
Field2 collate Chinese_Taiwan_Stroke_CI_AI,
FROM TABLE

Reference:
定序優先順序
https://docs.microsoft.com/zh-tw/sql/t-sql/statements/collation-precedence-transact-sql?view=sql-server-ver15

留言

The Hottest Articles

OWASP Security Shepherd Project - My Practice & Solutions

OSCP回顧 & 準備建議

OWASP Security Shepherd Project - SQL Injection 3 (Injection Challenge)