Data Formats


Web API Practice.

Learn different data formats used in APIs (JSON, form data, XML)



Challenges

JSON Body

JSON is the most common format for API data.

Objective

Send a POST request to /api/login with JSON body containing username and password fields:

  • username: "admin"
  • password: "secret123"

Example

curl -X POST -H "Content-Type: application/json" \
  -d '{"username": "admin", "password": "secret123"}' \
  http://challenge/api/login

Good luck!

Connect with SSH

Link your SSH key, then connect with: ssh hacker@dojo.idg.ctf

Form URL Encoded

Traditional HTML forms send data as URL-encoded key-value pairs.

Objective

Send a POST request to /api/register with form data:

Example

curl -X POST -d "email=user@example.com&plan=premium" http://challenge/api/register

Good luck!

Connect with SSH

Link your SSH key, then connect with: ssh hacker@dojo.idg.ctf

XML Data

Some APIs still use XML for data exchange.

Objective

Send a POST request to /api/order with XML body:

<order><item>flag</item><quantity>1</quantity></order>

Example

curl -X POST -H "Content-Type: application/xml" \
  -d '<order><item>flag</item><quantity>1</quantity></order>' \
  http://challenge/api/order

Good luck!

Connect with SSH

Link your SSH key, then connect with: ssh hacker@dojo.idg.ctf

30-Day Scoreboard:

This scoreboard reflects solves for challenges in this module after the module launched in this dojo.

Rank Hacker Badges Score