Repository: RhinoSecurityLabs/Swagger-EZ Branch: master Commit: de5cfa6b722f Files: 6 Total size: 1.5 MB Directory structure: gitextract_06y61mnm/ ├── LICENSE ├── README.md ├── css/ │ └── layout.css ├── index.html └── js/ ├── swagger-client.js └── ui.js ================================================ FILE CONTENTS ================================================ ================================================ FILE: LICENSE ================================================ BSD 3-Clause License Copyright (c) 2018, Rhino Security Labs All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================ FILE: README.md ================================================ # Swagger-EZ A tool geared towards pentesting APIs using OpenAPI definitions. We have a version hosted here: https://rhinosecuritylabs.github.io/Swagger-EZ/ Blog post: https://rhinosecuritylabs.com/application-security/simplifying-api-pentesting-swagger-files/ ## Setup `git clone https://github.com/RhinoSecurityLabs/Swagger-EZ.git` Open `index.html` in your browser. ## Usage Once the UI is loaded into the browser, we suggest pressing F12 to have the browser console open to watch for potential errors. Configure your browser to use the proxy tool you would like i.e. Burp Suite. Now you can insert the URL containing the Swagger 2.0 JSON or simply copy and paste an entire JSON Swagger 2.0 blob into the input field. Pressing load will parse the JSON and load the input fields for the parameters that need to be filled out. Fill out each parameters with some data and when ready press send. You should see the site tree of your proxy filling up.  ================================================ FILE: css/layout.css ================================================ * {box-sizing: border-box;} body { margin: 0; font-family: Arial, Helvetica, sans-serif; } .topnav { overflow: hidden; background-color: #b30000; height: 48px; } .topnav a { float: left; display: block; color: black; text-align: center; padding: 14px 16px; text-decoration: none; font-size: 17px; } .topnav a:hover { background-color: #ddd; color: black; } .topnav a.active { background-color: #2196F3; color: white; } .topnav .search-container { float: right; color: white; } .topnav input[type=text] { padding: 6px; margin-top: 8px; font-size: 17px; border: none; } .topnav .search-container button { float: right; padding: 6px; margin-top: 8px; margin-right: 16px; background: #ddd; font-size: 17px; border: none; cursor: pointer; } .topnav .search-container button:hover { background: #ccc; } @media screen and (max-width: 600px) { .topnav .search-container { float: none; } .topnav a, .topnav input[type=text], .topnav .search-container button { float: none; display: block; text-align: left; width: 100%; margin: 0; padding: 14px; } .topnav input[type=text] { border: 1px solid #ccc; } } label { width:210px; clear:left; text-align:right; padding-right:10px; } .inputbody, label, select { float:left; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; font-size: 16px; } .inputbody { border: 2px solid #dadada; height: 30px; } .inputbody:focus{ outline: none; border-color: #b30000; box-shadow: 0 0 10px #b30000; } ================================================ FILE: index.html ================================================
Regex for CORS response headers Burp Suite
Match: Access-Control-Allow-Origin:(.*?)$
Replace: Access-Control-Allow-Origin: *
Match: Access-Control-Allow-Methods:(.*?)$
Replace: Access-Control-Allow-Methods: DELETE, GET, HEAD, OPTIONS, PATCH, POST, PUT
Match: Access-Control-Allow-Headers:(.*?)$
| ' + type + ' |
|---|