• TLS/SSL Certificate Brands
    • RapidSSL - simple site security for less. It provides basic level customer confidence with the https, closed padlock and a static trust mark.
    • A range of digital certificate and trust products enable organizations of all sizes to maximize the security of their digital transactions cost-effectively.
    • The ideal solution for enterprises and large organizations. The Internet most recognized and trusted SSL brand.
    • A quick, cost-efficient, and effective solution to build secure connection. PositiveSSL certificates show your customers you’re employing serious security measures to keep their transactions and data safe.
    • SECTIGO, formerly COMODO CA, Creating trust online for individuals, e-merchants, enterprise, with its robust SSL security.
    • i
      How organizations best manage their certificate lifecycle?


      Download E-book
  • Certificate Products
    • Single Domain SSL
      One for main domain with free 'www' coverage.
    • Wildcard SSL
      Protect unlimited sub domains under main website.
    • Multi-Domain SSL
      One certificate for multiple domain names.
    • Domain Validation SSL
      It is quick and cost-efficient, really. Basic protection.
    • Organization Validation SSL
      It gives your website an online idenity. For SMBs to strengthen web trust.
    • Extended Validation SSL
      Stand out your buiness entity, protect brand and transactions.
    • Email (Client) Certificate
      Encrypt and signed email, enable two-factor authentication, and implement strong digital trust practices throughout your organization.
    • Code Signing Certificate
      Boost Software Adoption and improve customer's trust with Code Signing. Digitally sign Code across popular platforms.
  • Domain & Email
    • Domain Name Registration
      Get your perfect domain name
    • Domain Reseller
      Reseller Pricing & TLDs
    • Transfer Domain
      Transfer domain into BestCert
    • Business Email
      Business Email builds customer trust
  • Site Builder
  • PKI Solutions
  • Partner
  • About Us
利用SSL/TLS绕过Web应用防火墙(实用技巧)

近年来,Web安全已经成为信息安全领域的一个重要话题。由于Web所具有的优点,越来越多的关键服务都被开发成Web应用程序。但由此,对Web应用程序安全性的需求也逐渐增加,除了要拥有一套良好的开发标准之外,开发人员还应该充分考虑其安全性。Web应用程序防火墙是一个7级的防火墙,用于检查Web流量并尝试防范攻击。在本文中,我将主要描述一个有趣的Web应用防火墙绕过方式,我是在最近对WAF的代码审计工作中发现了这一问题。



SSL连接的工作原理

1、ClientHello/ServerHello阶段

握手过程开始于发送ClientHello消息的客户端。在该消息中,会包含服务器所需的全部信息。例如各种密码套件和支持的SSL/TLS版本。收到连接后,服务器将使用ServerHello消息进行响应,该消息中包含客户端所需的类似信息。服务器还将返回所使用的密码套件和SSL版本。

2、证书交换

在初始化连接之后,服务器需要向客户端证明其身份。服务器会将SSL证书发送到客户端,客户端会检查该证书,确认它可以信任后再继续连接。

3、密钥交换

在建立了安全隧道之后,服务器和客户端交换密钥,该密钥将用于加密和解密数据。

利用SSL/TLS绕过Web应用防火墙方法

基于以上原理,如果使用“不受支持的”SSL加密方式来初始化与支持该密码的Web服务器的连接,那么WAF就无法识别攻击行为,因为它这时无法监测到数据。

因此,通过查阅了WAF厂商的文档,从中找到了所有受支持的SSL加密方式,如下所示。


SSLv3

   SSL_RSA_WITH_NULL_MD5          SSL_RSA_WITH_NULL_SHA          SSL_RSA_WITH_RC4_128_MD5          SSL_RSA_WITH_RC4_128_SHA          SSL_RSA_WITH_DES_CBC_SHA          SSL_RSA_WITH_3DES_EDE_CBC_SHA          SSL_RSA_EXPORT_WITH_RC4_40_MD5          SSL_RSA_EXPORT_WITH_DES40_CBC_SHA

       

TLS/1.0-1.2

         TLS_RSA_WITH_NULL_SHA256          TLS_RSA_WITH_AES_128_CBC_SHA          TLS_RSA_WITH_AES_256_CBC_SHA          TLS_RSA_EXPORT1024_WITH_RC4_56_MD5          TLS_RSA_EXPORT1024_WITH_RC4_56_SHA          TLS_RSA_WITH_AES_128_CBC_SHA256          TLS_RSA_WITH_AES_256_CBC_SHA256          TLS_RSA_WITH_RC4_128_MD5 = { 0x000x04 }          TLS_RSA_WITH_RC4_128_SHA = { 0x000x05 }          TLS_RSA_WITH_DES_CBC_SHA = { 0x000x09 }

       

下一步就是确定Web服务器支持的SSL加密方式。

实际上,有很多方法可以检测服务器支持的加密方式,但我们在这里选用了sslscan,因为该工具易于安装,并且能够提供大量详细信息。

      pwn@thinkpad:~$ sudo apt install sslscan           Reading package lists... Done          Building dependency tree          Reading state information... Done          The following NEW packages will be installed:          sslscan0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.          Need to get 26,7 kB of archives.          After this operation, 81,9 kB of additional disk space will be used.          Get:1 http://al.archive.ubuntu.com/ubuntu bionic/universe amd64 sslscan amd64 1.11.5-rbsec-1.1 [26,7 kB]          Fetched 26,7 kB in 0s (73,8 kB/s)           Selecting previously unselected package sslscan.          (Reading database ... 177002 files and directories currently installed.)          Preparing to unpack .../sslscan_1.11.5-rbsec-1.1_amd64.deb ...          Unpacking sslscan (1.11.5-rbsec-1.1) ...          Processing triggers for man-db (2.8.3-2) ...          Setting up sslscan (1.11.5-rbsec-1.1) ...          pwn@thinkpad:~$ sslscan http://target/ | grep Accept

       

输入上面的命令后,将会列出Web服务器支持的SSL/TLS版本和加密方式。

我们将sslscan的结果和产品文档中的内容进行比较,就能够发现Web应用程序防火墙中不支持但Web服务器支持的一些加密方式。

Accepted TLSv1 256 bits ECDHE-RSA-AES256-SHA

       

Web服务器支持该加密方式,但WAF并不支持。

为了验证我的理论,我创建了一个WAF规则,如果请求的路径是“/ssl-cipher-test”,则会阻止请求。

理论上,我们访问这一路径,WAF将会阻止这一行为,如下图所示。



而我们的绕过方式是,指定客户端的加密方式,只使用能绕过防火墙的特定方式。

我们可以在curl上使用—ciphers指定加密方式,在示例中我选用了ECDHE-RSA-AES256-SHA。

    pwn@thinkpad:~$ curl --ciphers ECDHE-RSA-AES256-SHA https://waf-test.lab.local/ssl-cipher-test        <html>   <title>HELLO </title>   <p>Bypass worked</p>          pwn@thinkpad:~$

       

正如我们在响应中所看到的那样,Web应用程序防火墙被成功绕过。


文章来源:转载自Freebuf,如涉及文章版权等问题,请联系本站处理。”


厦门聚力诚信科技有限公司(BestCert.net)是网络安全领域的专业服务提供商,专注提供SSL证书,邮件安全证书,代码签名证书等国际、国密双算法的数字证书管理服务, 涵盖所有市场主流的SSL证书类型和品牌,从证书的申请,验证,安装,证书专家全程在线支持!公司同时为各行业客户提供电子签章,身份认证等电子认证服务解决方案。






Chat Now

Email Us

Email Address:

sales@bestcert.net

Top