# Simple Web 0x13(Lab - SSRFrog) ###### tags: `NTUSTWS` `CTF` `Web` Challenge: http://h4ck3r.quest:8501/ ## Background [javascript Set()](https://pjchender.dev/javascript/js-set/) [Web Hacking | 續章【EDU-CTF 2021】](https://youtu.be/hWC-Evt-sBc?t=9867) [網站安全🔒 伺服器端請求偽造 SSRF 攻擊 — 「項莊舞劍,意在沛公」](https://medium.com/程式猿吃香蕉/網站安全-伺服器請求偽造-ssrf-攻擊-項莊舞劍-意在沛公-7a5524926362) ## Source code :::spoiler source code ```javascript= const express = require("express"); const http = require("http"); const app = express(); app.get("/source", (req, res) => { return res.sendFile(__filename); }) app.get('/', (req, res) => { const { url } = req.query; if (!url || typeof url !== 'string') return res.sendFile(__dirname + "/index.html"); // no duplicate characters in `url` if (url.length !== new Set(url).size) return res.sendFile(__dirname + "/frog.png"); try { http.get(url, resp => { resp.setEncoding("utf-8"); resp.statusCode === 200 ? resp.on('data', data => res.send(data)) : res.send(":("); }).on('error', () => res.send("WTF?")); } catch (error) { res.send("WTF?"); } }); app.listen(3000, '0.0.0.0'); ``` ::: * Simply speaking, it'll call a `Set()` object that will filter duplicate characters * We also can find the hint in page source  ## Exploit 1. The hint said flag is on `http://the.c0o0o0l-fl444g.server.internal:80`, so we need to meet the first requirement - every single character is unique. We can use [Domain Obfuscator](https://splitline.github.io/domain-obfuscator/) to replace the similar characters. 2. Payload `htTp:/\ⓉₕE.ℭ⓪ᴼ₀o0Ⅼ-Ⓕl₄44ⓖ。ₛⒺʳⓋₑⓇ.㏌ₜeᴿ㎁ˡ` `htTp:/\ⓉhE。Ⅽ⁰ₒ0O0ℓ-fᴸ④4⁴G.SERvⅇⓡ.ⁱNtₑrnAℒ` ## Reference [SSRFrog](https://ctftime.org/writeup/25763) [Punycode converter](https://www.punycoder.com/)
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up