api.www.root-me.org
This API allows you to access Root-Me portal's public data. Different "endpoints" are available
- /login : authentication with username and password
- /challenges : challenge's data
- /auteurs : user's data
- /environnements_virtuels : data related to CTF all the Day's virtual environments
For each of these methods, accepted parameters are detailed below.
This API needs to be authenticated, it is therefore necessary to transmit your "spip_session" cookie or your "API key" in each request sent.
/challenges
Parameters
- titre : Title
- soustitre : Subtitle
- lang : Lang
- score : Score
- id_auteur[] : Array of id_auteur
/challenges/id_challenge
Example : python
- #!/usr/bin/python
- import requests,json
- cookies = {"api_key": "***"}
- resp = requests.get("https://api.www.root-me.org/challenges/5", cookies=cookies)
- if resp.status_code != 200:
- raise Exception("GET /challenges/ {}".format(resp.status_code))
- data = resp.json()
- print(json.dumps(data, indent=4, sort_keys=True))
Output
- titre:HTML
- descriptif:<p>N’allez pas chercher trop loin !</p>
- score:5
- id_rubrique:68
/auteurs
Parameters
- nom : Name
- statut : Status
- lang : Lang
Example : BASH
- #!/bin/bash
- resp=$(curl -b "api_key=***" https://api.www.root-me.org/auteurs)
- echo "$resp" | sed -e "s/},/}}\n{/g" | grep id_auteur | head -3
Output
- {"0":{"id_auteur":"1","nom":"g0uZ"}}
- {"1":{"id_auteur":"9","nom":"invit\u00e9"}}
- {"2":{"id_auteur":"61","nom":"1-vek"}}
- ...
/auteurs/id_auteur
Example : PHP
- <?php
- );
Output
- Array
- (
- [nom] => g0uZ
- [score] => 3165
- [position] => 849
- [challenges] => Array
- (
- [0] => Array
- (
- [id_challenge] => 5
- [url_challenge] => http://dev.root-me.org/fr/Challenges/Web-Serveur/HTML
- ...
- ?>
/classement
Example : BASH
- #!/bin/bash
- resp=$(curl -b "api_key=***" https://api.www.root-me.org/classement?debut_classement=2450)
- echo "$resp" | sed -e "s/},{/\n/g" | grep ":2500,"
Output
- "place":2500,"nom":"pouete","score":"1620"
- "place":2500,"nom":"N@tC@rm!n","score":"1620"
- "place":2500,"nom":"Zarked","score":"1620"
- "place":2500,"nom":"Mayden","score":"1620"
- ...
/environnements_virtuels
Parameters
- nom : Name
- os : Operating system