api.www.root-me.org

This API allows you to access Root-Me portal's public data. Different "endpoints" are available

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.

/login

Parameters

  • login : Your login
  • password : Your password

/challenges

Parameters

  • titre : Title
  • soustitre : Subtitle
  • lang : Lang
  • score : Score

/challenges/id_challenge

Example : python

  1. #!/usr/bin/python
  2.  
  3. import requests,json
  4. cookies = {"api_key": "***"}
  5. resp = requests.get("https://api.www.root-me.org/challenges/5", cookies=cookies)
  6. if resp.status_code != 200:
  7.     raise Exception("GET /challenges/ {}".format(resp.status_code))
  8. data = resp.json()
  9. print(json.dumps(data, indent=4, sort_keys=True))

Download

Output

  1. titre:HTML
  2. descriptif:<p>N’allez pas chercher trop loin&nbsp;!</p>
  3. score:5
  4. id_rubrique:68

Download

/auteurs

Parameters

  • nom : Name
  • statut : Status
  • lang : Lang

Example : BASH

  1. #!/bin/bash
  2.  
  3. resp=$(curl -b "api_key=***" https://api.www.root-me.org/auteurs)
  4. echo "$resp" | sed -e "s/},/}}\n{/g" | grep id_auteur | head -3

Download

Output

  1. {"0":{"id_auteur":"1","nom":"g0uZ"}}
  2. {"1":{"id_auteur":"9","nom":"invit\u00e9"}}
  3. {"2":{"id_auteur":"61","nom":"1-vek"}}
  4. ...

Download

/auteurs/id_auteur

Example : PHP

  1. <?php
  2.  
  3. $opts = array(
  4.   "http"=>array("method"=>"GET", "header"=>"Cookie: spip_session=***\r\n")
  5. );
  6. $context = stream_context_create($opts);
  7. $resp = file_get_contents("https://api.www.root-me.org/auteurs/1", false, $context);
  8. $data = json_decode($resp);
  9. echo(print_r($data));

Download

Output

  1. Array
  2. (
  3.     [nom] => g0uZ
  4.     [score] => 3165
  5.     [position] => 849
  6.     [challenges] => Array
  7.         (
  8.             [0] => Array
  9.                 (
  10.                     [id_challenge] => 5
  11.                     [url_challenge] => http://dev.root-me.org/fr/Challenges/Web-Serveur/HTML
  12.     ...
  13. ?>

Download

/classement

Example : BASH

  1. #!/bin/bash
  2.  
  3. resp=$(curl -b "api_key=***" https://api.www.root-me.org/classement?debut_classement=2450)
  4. echo "$resp" | sed -e "s/},{/\n/g" | grep ":2500,"

Download

Output

  1. "place":2500,"nom":"pouete","score":"1620"
  2. "place":2500,"nom":"N@tC@rm!n","score":"1620"
  3. "place":2500,"nom":"Zarked","score":"1620"
  4. "place":2500,"nom":"Mayden","score":"1620"
  5. ...

Download

/environnements_virtuels

Parameters

  • nom : Name
  • os : Operating system

/environnements_virtuels/id_environnement_virtuel