mirror of
https://github.com/0dayCTF/reverse-shell-generator.git
synced 2024-12-18 10:56:10 +00:00
added filename prompt for payload download
This commit is contained in:
parent
49070b52f5
commit
69bbfffb34
3
assets/axios.min.js
vendored
Normal file
3
assets/axios.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -10,6 +10,7 @@
|
|||||||
<script src="assets/jquery-3.5.1.slim.min.js"></script>
|
<script src="assets/jquery-3.5.1.slim.min.js"></script>
|
||||||
<script src="assets/popper-1.16.1.min.js"></script>
|
<script src="assets/popper-1.16.1.min.js"></script>
|
||||||
<script src="assets/bootstrap-4.5.2.min.js"></script>
|
<script src="assets/bootstrap-4.5.2.min.js"></script>
|
||||||
|
<script src="assets/axios.min.js"></script>
|
||||||
<link rel="stylesheet" href="css/dark-mode.css">
|
<link rel="stylesheet" href="css/dark-mode.css">
|
||||||
<link rel="stylesheet" href="css/light-mode.css">
|
<link rel="stylesheet" href="css/light-mode.css">
|
||||||
<link rel="stylesheet" href="css/meme-mode.css">
|
<link rel="stylesheet" href="css/meme-mode.css">
|
||||||
|
22
js/script.js
22
js/script.js
@ -459,13 +459,23 @@ document.querySelector('#copy-msfvenom-command').addEventListener('click', () =>
|
|||||||
var downloadButton = document.querySelectorAll(".download-svg");
|
var downloadButton = document.querySelectorAll(".download-svg");
|
||||||
for (const Dbutton of downloadButton) {
|
for (const Dbutton of downloadButton) {
|
||||||
Dbutton.addEventListener("click", () => {
|
Dbutton.addEventListener("click", () => {
|
||||||
var element = document.createElement('a');
|
const filename = prompt('Enter a filename', 'payload.sh')
|
||||||
|
if(filename===null)return;
|
||||||
const rawLink = RawLink.generate(rsg);
|
const rawLink = RawLink.generate(rsg);
|
||||||
element.setAttribute('href', rawLink);
|
axios({
|
||||||
element.setAttribute('download', rsg.getSelectedCommandName());
|
url: rawLink,
|
||||||
document.body.appendChild(element);
|
method: 'GET',
|
||||||
element.click();
|
responseType: 'arraybuffer',
|
||||||
document.body.removeChild(element);
|
})
|
||||||
|
.then((response)=>{
|
||||||
|
const url = window.URL.createObjectURL(new File([response.data], filename ));
|
||||||
|
const downloadElement = document.createElement("a");
|
||||||
|
downloadElement.href = url;
|
||||||
|
downloadElement.setAttribute('download', filename);
|
||||||
|
document.body.appendChild(downloadElement);
|
||||||
|
downloadElement.click();
|
||||||
|
document.body.removeChild(downloadElement);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user