Welcome to the documentation for interacting with RESTful web services. This guide explains how to use various tools to make requests and includes a section on handling authentication if security is enabled.
curl and Burp Suite. These examples will help you learn how to send requests and handle authentication when required.
This system has multiple security levels that affect access to the web services:
ws-login. You must obtain a JWT token by logging in through the ws-login endpoint using your client_id and client_secret.Authorization header for each request. Without a valid token, you will receive a 401 Unauthorized error.
client_id and client_secret to authenticate. If successful, the response will include a JWT token.
Example (curl):
curl -X POST http://mutillidae.localhost/webservices/rest/ws-login.php \
-d "client_id=your-client-id&client_secret=your-client-secret"
The response will include a token in the format:
{"token": "your-jwt-token-here"}
Bearer <your-token>.
Below is an example of an authenticated request using curl:
curl -X GET http://mutillidae.localhost/webservices/rest/ws-dns-lookup.php?hostname=google.com \
-H "Authorization: Bearer <your-token>"
To send an authenticated request in Burp Suite:
GET /webservices/rest/ws-dns-lookup.php?hostname=google.com HTTP/1.1
Host: mutillidae.localhost
Authorization: Bearer your-jwt-token-here
Each service page provides:
curl.mutillidae.localhost.401 Unauthorized error, ensure your token is included in the Authorization header and has not expired.If you have any further questions or need assistance, feel free to reach out to your instructor or class support team.