|
| 1 | + |
| 2 | + |
| 3 | +<!DOCTYPE html> |
| 4 | +<html lang="en"> |
| 5 | +<head> |
| 6 | + <meta charset="UTF-8"> |
| 7 | + <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 8 | + <title>SOAP WS Login Service Documentation</title> |
| 9 | + <style> |
| 10 | + body { |
| 11 | + font-family: Arial, sans-serif; |
| 12 | + background-color: #f5f5f5; |
| 13 | + padding: 2rem; |
| 14 | + } |
| 15 | + h1, h2 { |
| 16 | + color: #2c3e50; |
| 17 | + } |
| 18 | + pre { |
| 19 | + background-color: #ecf0f1; |
| 20 | + padding: 1rem; |
| 21 | + border-radius: 5px; |
| 22 | + overflow-x: auto; |
| 23 | + } |
| 24 | + code { |
| 25 | + font-family: Consolas, "Courier New", monospace; |
| 26 | + } |
| 27 | + ul { |
| 28 | + line-height: 1.8; |
| 29 | + } |
| 30 | + .note { |
| 31 | + background-color: #e7f3fe; |
| 32 | + border-left: 6px solid #2196F3; |
| 33 | + margin: 1rem 0; |
| 34 | + padding: 1rem; |
| 35 | + } |
| 36 | + </style> |
| 37 | +</head> |
| 38 | +<body> |
| 39 | + <h1>SOAP WS Login Service Documentation</h1> |
| 40 | + <p>The <strong>SOAP WS Login Service</strong> allows clients to authenticate using their <code>client_id</code> and <code>client_secret</code>, receiving a JSON Web Token (JWT) for further interaction with secured services.</p> |
| 41 | + |
| 42 | + <h2>Endpoint</h2> |
| 43 | + <pre><code>POST /webservices/soap/ws-login.php</code></pre> |
| 44 | + |
| 45 | + <h2>Request Parameters</h2> |
| 46 | + <ul> |
| 47 | + <li><b>client_id</b> (string, required): A 32-character unique identifier for the client.</li> |
| 48 | + <li><b>client_secret</b> (string, required): A 64-character secret associated with the client ID.</li> |
| 49 | + <li><b>audience</b> (string, required): The intended audience for the token, typically the endpoint you want to access.</li> |
| 50 | + </ul> |
| 51 | + |
| 52 | + <h2>Example Request Using Burp Repeater</h2> |
| 53 | + <p>Here’s how to send a SOAP request to the login service using Burp Repeater:</p> |
| 54 | + <pre><code>POST /webservices/soap/ws-login.php HTTP/1.1 |
| 55 | +Host: mutillidae.localhost |
| 56 | +Content-Type: text/xml; charset=utf-8 |
| 57 | +SOAPAction: "urn:ws-login#login" |
| 58 | +Content-Length: [length] |
| 59 | +Connection: close |
| 60 | + |
| 61 | +<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" |
| 62 | + xmlns:urn="urn:ws-login"> |
| 63 | + <soapenv:Header/> |
| 64 | + <soapenv:Body> |
| 65 | + <urn:login> |
| 66 | + <client_id>fb975a0e0248994221b3a6e87ba92fe9</client_id> |
| 67 | + <client_secret>f1d10934f1525ebfdf0b08a2413a3a3f683eaae3913489c786e496e403ab7bff</client_secret> |
| 68 | + <audience>http://mutillidae.localhost/webservices/soap/ws-user-account.php</audience> |
| 69 | + </urn:login> |
| 70 | + </soapenv:Body> |
| 71 | +</soapenv:Envelope></code></pre> |
| 72 | + |
| 73 | + <p><strong>Instructions:</strong></p> |
| 74 | + <ol> |
| 75 | + <li>Open Burp Suite and navigate to the Repeater tab.</li> |
| 76 | + <li>Copy the above request and paste it into the Repeater window.</li> |
| 77 | + <li>Update the <code>Content-Length</code> header to match the byte size of the body.</li> |
| 78 | + <li>Click <strong>Send</strong> to see the response.</li> |
| 79 | + </ol> |
| 80 | + |
| 81 | + <h2>Example Request Using <code>curl</code></h2> |
| 82 | + <p>If you prefer using the command line, here’s how to send the same request with <code>curl</code>:</p> |
| 83 | + <pre><code> |
| 84 | + curl -X POST "http://mutillidae.localhost/webservices/soap/ws-login.php" \ |
| 85 | + -H "Content-Type: text/xml; charset=utf-8" \ |
| 86 | + -H "SOAPAction: "urn:ws-login#login"" \ |
| 87 | + --data '<?xml version="1.0" encoding="UTF-8"?> |
| 88 | + <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:ws-login"> |
| 89 | + <soapenv:Header/> |
| 90 | + <soapenv:Body> |
| 91 | + <urn:login> |
| 92 | + <client_id>fb975a0e0248994221b3a6e87ba92fe9</client_id> |
| 93 | + <client_secret>f1d10934f1525ebfdf0b08a2413a3a3f683eaae3913489c786e496e403ab7bff</client_secret> |
| 94 | + <audience>http://mutillidae.localhost/webservices/soap/ws-user-account.php</audience> |
| 95 | + </urn:login> |
| 96 | + </soapenv:Body> |
| 97 | + </soapenv:Envelope>'</code></pre> |
| 98 | + |
| 99 | + <p><strong>Instructions:</strong></p> |
| 100 | + <ol> |
| 101 | + <li>Open a terminal or command prompt.</li> |
| 102 | + <li>Copy and paste the above <code>curl</code> command.</li> |
| 103 | + <li>Replace <code>fb975a0e0248994221b3a6e87ba92fe9</code> and <code>f1d10934f1525ebfdf0b08a2413a3a3f683eaae3913489c786e496e403ab7bff</code> with valid values.</li> |
| 104 | + <li>Press <strong>Enter</strong> to send the request and view the response.</li> |
| 105 | + </ol> |
| 106 | + |
| 107 | + <h2>Expected Response</h2> |
| 108 | + <p>Upon successful authentication, the server will respond with a JWT token:</p> |
| 109 | + <pre><code><?xml version="1.0"?> |
| 110 | +<response> |
| 111 | + <access_token>your-jwt-token</access_token> |
| 112 | + <token_type>bearer</token_type> |
| 113 | + <expires_in>3600</expires_in> |
| 114 | + <timestamp>2024-11-18T12:00:00Z</timestamp> |
| 115 | +</response></code></pre> |
| 116 | + |
| 117 | + <h2>Using the JWT Token in Subsequent Requests</h2> |
| 118 | + <p>After obtaining the token, include it in the <code>Authorization</code> header for future SOAP or REST requests. For example:</p> |
| 119 | + |
| 120 | + <h3>Example Using curl</h3> |
| 121 | + <p>To call an authenticated endpoint, such as <code>ws-user-account</code>:</p> |
| 122 | + <pre><code> |
| 123 | + curl -X POST "http://mutillidae.localhost/webservices/soap/ws-user-account.php" \ |
| 124 | + -H "Content-Type: text/xml; charset=utf-8" \ |
| 125 | + -H "SOAPAction: "urn:ws-user-account#getUser"" \ |
| 126 | + -H "Authorization: Bearer your-jwt-token" \ |
| 127 | + --data '<?xml version="1.0" encoding="UTF-8"?> |
| 128 | + <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:ws-user-account"> |
| 129 | + <soapenv:Header/> |
| 130 | + <soapenv:Body> |
| 131 | + <urn:getUser> |
| 132 | + <username>some-user</username> |
| 133 | + </urn:getUser> |
| 134 | + </soapenv:Body> |
| 135 | + </soapenv:Envelope>'</code></pre> |
| 136 | + |
| 137 | + <h3>Example Using Burp Repeater</h3> |
| 138 | + <p>To include the token in Burp Suite:</p> |
| 139 | + <ol> |
| 140 | + <li>Paste the token in the <code>Authorization</code> header of your request:</li> |
| 141 | + <pre><code>Authorization: Bearer your-jwt-token</code></pre> |
| 142 | + <li>Send the request to a secured endpoint.</li> |
| 143 | + </ol> |
| 144 | + |
| 145 | + <div class="note"> |
| 146 | + <strong>Troubleshooting Tips:</strong> |
| 147 | + <ul> |
| 148 | + <li>Ensure the <code>SOAPAction</code> header matches the registered action for the service.</li> |
| 149 | + <li>Check for proper XML formatting and valid <code>client_id</code> and <code>client_secret</code> values.</li> |
| 150 | + <li>If authentication fails, verify the <code>audience</code> matches a valid endpoint.</li> |
| 151 | + </ul> |
| 152 | + </div> |
| 153 | +</body> |
| 154 | +</html> |
0 commit comments