Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const xssMenu = document.createElement('div');
- xssMenu.id = 'xss-menu';
- xssMenu.style.position = 'fixed';
- xssMenu.style.bottom = '20px';
- xssMenu.style.left = '20px';
- xssMenu.style.zIndex = '9999';
- xssMenu.style.backgroundColor = '#222';
- xssMenu.style.color = '#fff';
- xssMenu.style.padding = '15px';
- xssMenu.style.borderRadius = '10px';
- xssMenu.style.width = '320px';
- xssMenu.style.fontFamily = 'Arial, sans-serif';
- xssMenu.style.boxShadow = '0 5px 15px rgba(0, 0, 0, 0.3)';
- xssMenu.style.display = 'none';
- xssMenu.style.transition = 'transform 0.3s ease, opacity 0.3s ease';
- const xssMenuButton = document.createElement('button');
- xssMenuButton.textContent = '☰ XSS Menu';
- xssMenuButton.style.position = 'fixed';
- xssMenuButton.style.bottom = '15px';
- xssMenuButton.style.left = '20px';
- xssMenuButton.style.zIndex = '10000';
- xssMenuButton.style.padding = '10px 15px';
- xssMenuButton.style.backgroundColor = '#444';
- xssMenuButton.style.color = '#fff';
- xssMenuButton.style.border = 'none';
- xssMenuButton.style.borderRadius = '5px';
- xssMenuButton.style.cursor = 'pointer';
- xssMenuButton.style.transition = 'background 0.2s ease, transform 0.1s ease';
- xssMenuButton.onmouseover = () => xssMenuButton.style.backgroundColor = '#555';
- xssMenuButton.onmouseout = () => xssMenuButton.style.backgroundColor = '#444';
- xssMenuButton.onmousedown = () => xssMenuButton.style.transform = 'scale(0.95)';
- xssMenuButton.onmouseup = () => xssMenuButton.style.transform = 'scale(1)';
- xssMenuButton.onclick = () => {
- xssMenu.style.display = xssMenu.style.display === 'none' ? 'block' : 'none';
- };
- document.body.appendChild(xssMenuButton);
- document.body.appendChild(xssMenu);
- let xssPayloads = JSON.parse(localStorage.getItem('xssPayloads')) || [];
- const xssPayloadsList = document.createElement('ul');
- xssPayloadsList.style.maxHeight = '150px';
- xssPayloadsList.style.overflowY = 'auto';
- xssPayloadsList.style.border = '1px solid #555';
- xssPayloadsList.style.padding = '5px';
- xssPayloadsList.style.marginBottom = '10px';
- xssPayloadsList.style.listStyle = 'none';
- xssPayloadsList.style.fontSize = '14px';
- xssMenu.appendChild(xssPayloadsList);
- const notification = document.createElement('div');
- notification.style.position = 'fixed';
- notification.style.bottom = '60px';
- notification.style.left = '50%';
- notification.style.transform = 'translateX(-50%)';
- notification.style.backgroundColor = '#4CAF50';
- notification.style.color = 'white';
- notification.style.padding = '10px 20px';
- notification.style.borderRadius = '5px';
- notification.style.fontSize = '14px';
- notification.style.boxShadow = '0 2px 10px rgba(0,0,0,0.2)';
- notification.style.display = 'none';
- document.body.appendChild(notification);
- function showNotification(message, color = '#4CAF50') {
- notification.textContent = message;
- notification.style.backgroundColor = color;
- notification.style.display = 'block';
- setTimeout(() => { notification.style.display = 'none'; }, 2000);
- }
- const loadingBar = document.createElement('div');
- loadingBar.style.width = '100%';
- loadingBar.style.height = '5px';
- loadingBar.style.backgroundColor = '#4CAF50';
- loadingBar.style.position = 'absolute';
- loadingBar.style.bottom = '0';
- loadingBar.style.left = '0';
- loadingBar.style.transition = 'width 2s ease';
- loadingBar.style.display = 'none';
- xssMenu.appendChild(loadingBar);
- function startLoading() {
- loadingBar.style.width = '0%';
- loadingBar.style.display = 'block';
- setTimeout(() => { loadingBar.style.width = '100%'; }, 100);
- setTimeout(() => { loadingBar.style.display = 'none'; }, 2000);
- }
- function refreshPayloadList() {
- xssPayloadsList.innerHTML = ''; // Clear list
- xssPayloads.forEach(payload => {
- const listItem = document.createElement('li');
- listItem.textContent = payload;
- listItem.style.cursor = 'pointer';
- listItem.style.padding = '3px';
- listItem.onclick = () => injectPayload(payload);
- xssPayloadsList.appendChild(listItem);
- });
- }
- refreshPayloadList();
- const payloadInput = document.createElement('textarea');
- payloadInput.placeholder = 'Enter XSS payloads (one per line)';
- payloadInput.style.width = '100%';
- payloadInput.style.height = '80px';
- payloadInput.style.marginBottom = '10px';
- xssMenu.appendChild(payloadInput);
- const applyButton = document.createElement('button');
- applyButton.textContent = 'Apply Payloads';
- applyButton.style.width = '100%';
- applyButton.onclick = () => {
- const inputPayloads = payloadInput.value.split('\n').map(p => p.trim()).filter(p => p);
- xssPayloads = [...new Set([...xssPayloads, ...inputPayloads])]; // Avoid duplicates
- localStorage.setItem('xssPayloads', JSON.stringify(xssPayloads));
- refreshPayloadList();
- payloadInput.value = ''; // Clear input
- startLoading();
- showNotification('Payloads Applied!');
- };
- xssMenu.appendChild(applyButton);
- const injectAllButton = document.createElement('button');
- injectAllButton.textContent = 'Inject All Payloads';
- injectAllButton.style.width = '100%';
- injectAllButton.onclick = () => {
- startLoading();
- setTimeout(() => {
- injectIntoAllFields();
- showNotification('Payloads Injected!');
- }, 2000);
- };
- xssMenu.appendChild(injectAllButton);
- const resetButton = document.createElement('button');
- resetButton.textContent = 'Reset Payloads';
- resetButton.style.width = '100%';
- resetButton.style.backgroundColor = 'red';
- resetButton.style.color = 'white';
- resetButton.onclick = () => {
- localStorage.removeItem('xssPayloads');
- xssPayloads = [];
- refreshPayloadList();
- showNotification('Payloads Reset!', 'red');
- };
- xssMenu.appendChild(resetButton);
- // Add "Check All Reflections" button
- const checkReflectionsButton = document.createElement('button');
- checkReflectionsButton.textContent = 'Check All Reflections';
- checkReflectionsButton.style.width = '100%';
- checkReflectionsButton.style.marginTop = '5px';
- checkReflectionsButton.onclick = () => {
- checkAllReflections();
- };
- xssMenu.appendChild(checkReflectionsButton);
- function checkAllReflections() {
- let foundReflections = [];
- xssPayloads.forEach(payload => {
- if (document.body.innerHTML.includes(payload)) {
- foundReflections.push(payload);
- }
- });
- if (foundReflections.length > 0) {
- showNotification(`Potential XSS found! Payloads: ${foundReflections.join(", ")}`, "orange");
- console.log("Reflected Payloads:", foundReflections);
- } else {
- showNotification("No reflections detected!", "#FFD700");
- }
- }
- function injectPayload(payload) {
- document.querySelectorAll("input[type='text'], input[type='search'], textarea, [contenteditable='true']")
- .forEach(input => { input.value = payload; });
- document.querySelectorAll("form").forEach(form => {
- let submitButton = form.querySelector("[type=submit]");
- if (submitButton) submitButton.click();
- else form.submit();
- });
- }
- function injectIntoAllFields() {
- xssPayloads.forEach(payload => injectPayload(payload));
- }
Advertisement
Advertisement