Skip to content

Add: export payloads to .txt based on current IP, port, and OS values #187

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,8 @@ <h5 class="card-title"><b>Listener</b></h5>
title="Copy to clipboard" type="button" class="btn btn-primary float-right">
Copy
</button>

<button id="download-reverse-shell-btn" class="btn btn-primary float-right ml-3">Export to .txt</button>
</div>

</div>
Expand Down
33 changes: 31 additions & 2 deletions js/script.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

// Element selectors
const ipInput = document.querySelector("#ip");
const portInput = document.querySelector("#port");
Expand Down Expand Up @@ -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);
},
}

/*
Expand Down Expand Up @@ -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", () => {
Expand Down