-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathendpointFinder.js
1 lines (1 loc) · 1.95 KB
/
endpointFinder.js
1
javascript:(function(){var scripts=document.getElementsByTagName("script"),regex=/(?<=(\"|\'|\`))\/[a-zA-Z0-9_?&=\/\-\#\.]*(?=(\"|\'|\`))/g,results=new%20Set;function%20fetchAndExtract(e){""!==e&&fetch(e).then(function(e){return%20e.text()}).then(function(e){for(var%20t=e.matchAll(regex),r=0;r<t.length;r++)results.add({endpoint:t[r][0],method:"(likely%20GET)"})}).catch(function(e){console.error("An%20error%20occurred:",e)})}for(var%20i=0;i<scripts.length;i++)fetchAndExtract(scripts[i].src);var%20pageContent=document.documentElement.outerHTML,matches=pageContent.matchAll(regex);for(const%20match%20of%20matches)results.add({endpoint:match[0],method:"(likely%20GET)"});function%20displayResults(){var%20e=document.createElement("div");e.style.position="fixed",e.style.top="0",e.style.left="0",e.style.width="100%",e.style.height="100%",e.style.padding="20px",e.style.backgroundColor="rgba(0,0,0,0.8)",e.style.color="#fff",e.style.overflowY="auto",e.style.zIndex="9999";var%20t=document.createElement("div");t.style.maxWidth="800px",t.style.margin="0%20auto",t.style.backgroundColor="#333",t.style.padding="20px",t.style.borderRadius="8px",t.style.textAlign="left";var%20closeBtn=document.createElement("button");closeBtn.textContent="Close",closeBtn.style.position="fixed",closeBtn.style.top="10px",closeBtn.style.right="10px",closeBtn.style.padding="10px",closeBtn.style.backgroundColor="#f44336",closeBtn.style.color="#fff",closeBtn.style.border="none",closeBtn.style.borderRadius="5px",closeBtn.style.cursor="pointer",closeBtn.addEventListener("click",function(){document.body.removeChild(e)}),e.appendChild(closeBtn),t.innerHTML+="<h2%20style='color:#f1c40f;text-align:left'>Found%20Endpoints</h2>",0===results.size?t.innerHTML+="<p>No%20endpoints%20found.</p>":results.forEach(function(e){var%20n=document.createElement("div");n.innerHTML="<strong>"+e.endpoint+"</strong>%20-%20"+e.method,t.appendChild(n)}),e.appendChild(t),document.body.appendChild(e)}setTimeout(displayResults,3e3)})();