diff --git a/index.html b/index.html index 9f94b85..bf6a971 100644 --- a/index.html +++ b/index.html @@ -343,6 +343,8 @@
Listener
title="Copy to clipboard" type="button" class="btn btn-primary float-right"> Copy + + diff --git a/js/script.js b/js/script.js index 561f4bd..91ed3e2 100644 --- a/js/script.js +++ b/js/script.js @@ -1,4 +1,3 @@ - // Element selectors const ipInput = document.querySelector("#ip"); const portInput = document.querySelector("#port"); @@ -443,7 +442,35 @@ const rsg = { 'hide') $('#revshell-advanced').collapse($('#revshell-advanced-switch').prop('checked') ? 'show' : 'hide') - } + }, + + exportPayloadsToTxt: () => { + // Generate reverse shell payloads in .txt + // Can be used with Burp Intrudeer + const payloads = []; + const reverseShellItems = document.querySelectorAll("#reverse-shell-selection .list-group-item"); + + reverseShellItems.forEach(item => { + const commandName = item.innerText; + const commandData = rsgData.reverseShellCommands.find(cmd => cmd.name === commandName); + if (commandData && commandData.command) { + const command = rsg.insertParameters(commandData.command, (text) => text); + // skip multi-row commands or scripts + if (!command.includes('\n')) { + payloads.push(command); + } + } + }); + + const fileContent = payloads.join('\n'); + const blob = new Blob([fileContent], { type: 'text/plain' }); + + const link = document.createElement('a'); + link.href = URL.createObjectURL(blob); + link.download = 'reverse_shell_payloads.txt'; + link.click(); + URL.revokeObjectURL(link.href); + }, } /* @@ -523,6 +550,8 @@ document.querySelector('#copy-hoaxshell-command').addEventListener('click', () = rsg.copyToClipboard(hoaxShellCommand.innerText) }) +document.querySelector('#download-reverse-shell-btn').addEventListener('click', rsg.exportPayloadsToTxt); + var downloadButton = document.querySelectorAll(".download-svg"); for (const Dbutton of downloadButton) { Dbutton.addEventListener("click", () => {