Jmeter 需要转换&;";及;lt至“t”&&书信电报;英寸

Jmeter 需要转换&;";及;lt至“t”&&书信电报;英寸,jmeter,blazemeter,Jmeter,Blazemeter,我试图绕过ADFS身份验证,当我登录到应用程序时,服务器会做出以下响应: name="wresult" value="<t:RequestSecurityTokenResponse xmlns:t="http://schemas.xmlsoap.org/ws/2005/02/trust"><t:Lifetime><wsu:Created xmlns:wsu="http://docs.oas

我试图绕过ADFS身份验证,当我登录到应用程序时,服务器会做出以下响应:

name="wresult" value="<t:RequestSecurityTokenResponse
xmlns:t="http://schemas.xmlsoap.org/ws/2005/02/trust"><t:Lifetime><wsu:Created
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2017-02-10T09:28:07.059Z</wsu:Created><wsu:Expires xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2017-02-10T10:28:07.059Z</wsu:Expires></t:Lifetime><wsp:AppliesTo xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"><wsa:EndpointReference
xmlns:wsa="http://www.w3.org/2005/08/addressing"><wsa:Address>https://gh-prem.accesscontrol.windows.net/</wsa:Address></wsa:EndpointReference></wsp:AppliesTo><t:RequestedSecurityToken><saml:Assertion
MajorVersion="1" MinorVersion="1"> AssertionID="_cb580c90-d0ac-49a8-a9c4-3ecb8b0a54d1"
Issuer="http://abc.abc.dev.comt/adfs/services/trust"
IssueInstant="2017-02-10T09:28:07.075Z"
 xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion"><saml:Conditions NotBefore="2017-02-10T09:28:07.059Z"
NotOnOrAfter="2017-02-10T10:28:07.059Z"><saml:AudienceRestrictionCondition><saml:Audience>https://gh-prem.accesscontrol.windows.net/</saml:Audience></saml:AudienceRestrictionCondition></saml:Conditions><saml:AttributeStatement><saml:Subject><saml:SubjectConfirmation><saml:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:bearer</saml:ConfirmationMethod></saml:SubjectConfirmation></saml:Subject><saml:Attribute
AttributeName="name"
如何转换jmeter中的"和<。由于下一个采样器的帖子主体采用以下属性:

<t:RequestSecurityTokenResponse
xmlns:t="http://schemas.xmlsoap.org/ws/2005/02/trust"><t:Lifetime><wsu:Created
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2017-02-06T10:06:14.384Z</wsu:Created><wsu:Expires
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2017-02-06T11:06:14.384Z</wsu:Expires></t:Lifetime><wsp:AppliesTo
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"><wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing"><wsa:Address>https://gh-prem.accesscontrol.windows.net/</wsa:Address></wsa:EndpointReference></wsp:AppliesTo><t:RequestedSecurityToken><saml:Assertion
MajorVersion="1" MinorVersion="1"
AssertionID="_99273d06-e73c-4ce5-acf5-6ba43c8c7990"
Issuer="http://xxx.xxx-dev.comt/adfs/services/trust"
IssueInstant="2017-02-06T10:06:14.400Z"
xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion"><saml:Conditions
NotBefore="2017-02-06T10:06:14.384Z"
NotOnOrAfter="2017-02-06T11:06:14.384Z"><saml:AudienceRestrictionCondition><saml:Audience>https://gh-prem.accesscontrol.windows.net/</saml:Audience></saml:AudienceRestrictionCondition></saml:Conditions><saml:AttributeStatement><saml:Subject><saml:SubjectConfirmation><saml:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:bearer</saml:ConfirmationMethod></saml:SubjectConfirmation></saml:Subject><saml:Attribute
AttributeName="name"
AttributeNamespace="http://schemas.xmlsoap.org/ws/2005/05/identity/claims"><saml:AttributeValue>
2017-02-06T10:06:14.384Z2017-02-06T11:06:14.384Zhttps://gh-prem.accesscontrol.windows.net/https://gh-prem.accesscontrol.windows.net/urn:oasis:names:tc:SAML:1.0:cm:bearer
你能帮我用一些截图来解决这个问题吗 我得到了一些关于如何使用Beanshell预处理器的提示,但这对我没有帮助,或者我不知道如何实现Beanshell来缓解这个问题

注意:我使用的内容编码是utf-8,请看,它可以动态解码HTML编码的字符串

您可以直接在采样器主体中或其他任何地方使用此功能

有关JMeter函数、如何使用它们、限制等的更多信息,请参阅posts系列。

看看,它可以动态解码HTML编码的字符串

您可以直接在采样器主体中或其他任何地方使用此功能


有关JMeter函数、如何使用它们、限制等的更多信息,请参阅posts系列。

这就是我为缓解此问题所做的工作。希望这对新人有帮助(非常感谢迪米特里·蒂坎斯基)

上面的令牌是SAML1.1令牌,作为对GET方法的响应生成。如果您使用ADFS身份验证,您将得到一个大HTML,其中包含-WA、Wresult、Wctx。(对于我来说,仅wresult(SAML 1.1令牌)是一个关联候选)

使用RegularExpression提取器按如下方式提取wresult

以及要在/v2/wsfederation中用函数_uunescapehtml替换的捕获Wresult

注:1)在我的情况下,Wa结果不是动态的 2) wctx字符串是一个静态字符串


希望这有帮助。谢谢。

这就是我为缓解这个问题所做的。希望这对新人有帮助(非常感谢迪米特里·蒂坎斯基)

上面的令牌是SAML1.1令牌,作为对GET方法的响应生成。如果您使用ADFS身份验证,您将得到一个大HTML,其中包含-WA、Wresult、Wctx。(对于我来说,仅wresult(SAML 1.1令牌)是一个关联候选)

使用RegularExpression提取器按如下方式提取wresult

以及要在/v2/wsfederation中用函数_uunescapehtml替换的捕获Wresult

注:1)在我的情况下,Wa结果不是动态的 2) wctx字符串是一个静态字符串


希望这有帮助。谢谢。

Dmitri T:谢谢这次更新,我可以在函数中使用参数化值吗?(我试过了,但jmeter抛出了异常)。编码的HTML在前一个采样器中作为一个请求传入-我正在尝试使用正则表达式提取编码的HTML,并在下一个示例中将其作为POST请求传递${{{unescapethtml(${HTML}}'Hi Dmitri,{unescapethtml函数确实帮助我提取了wresult SAML标记。非常感谢您在这方面的帮助。Dmitri T:谢谢您的更新,我可以在函数中使用参数化值吗?(我试过了,但jmeter抛出了异常)。编码的HTML在前一个采样器中作为一个请求传入-我正在尝试使用正则表达式提取编码的HTML,并在下一个示例中将其作为POST请求传递${{{unescapethtml(${HTML}}'Hi Dmitri,{unescapethtml函数确实帮助我提取了wresult SAML标记。非常感谢你在这方面的帮助。