mirror of
https://github.com/0dayCTF/reverse-shell-generator.git
synced 2025-02-07 07:22:09 +00:00
commit
9f8b7a93e9
32
index.html
32
index.html
@ -342,7 +342,8 @@
|
|||||||
rsgData.shells.forEach(function (shell, i) {
|
rsgData.shells.forEach(function (shell, i) {
|
||||||
$('#shell').append($('<option>', {
|
$('#shell').append($('<option>', {
|
||||||
text: shell,
|
text: shell,
|
||||||
selected: i === 0
|
selected: i === 0,
|
||||||
|
class: 'shell-option',
|
||||||
}))
|
}))
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@ -460,7 +461,11 @@
|
|||||||
/*
|
/*
|
||||||
* Event handlers
|
* Event handlers
|
||||||
*/
|
*/
|
||||||
$('#shell, #encoding').on('change', rsg.updateReverseShellCommand);
|
$('#shell, #encoding').on('change', function()
|
||||||
|
{
|
||||||
|
rsg.updateReverseShellCommand();
|
||||||
|
setLocalStorage(shellSelect, "shell", "value");
|
||||||
|
})
|
||||||
|
|
||||||
$('#inc-port').on('click', function () {
|
$('#inc-port').on('click', function () {
|
||||||
$('#port').val(rsg.getPort() + 1);
|
$('#port').val(rsg.getPort() + 1);
|
||||||
@ -485,6 +490,7 @@
|
|||||||
const listenerSelect = document.querySelector("#listener-selection");
|
const listenerSelect = document.querySelector("#listener-selection");
|
||||||
const ipInput = document.querySelector("#ip");
|
const ipInput = document.querySelector("#ip");
|
||||||
const portInput = document.querySelector("#port");
|
const portInput = document.querySelector("#port");
|
||||||
|
const shellSelect = document.querySelector("#shell");
|
||||||
const autoCopySwitch = document.querySelector("#auto-copy-switch");
|
const autoCopySwitch = document.querySelector("#auto-copy-switch");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -516,7 +522,12 @@
|
|||||||
element[attribute] = isChecked;
|
element[attribute] = isChecked;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (element.nodeName === "SELECT") {
|
if (element.class === "SELECT") {
|
||||||
|
const selectedItem = options.find(option => option[attribute] === localStorage.getItem(key));
|
||||||
|
selectedItem.selected = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (element.id === "shell") {
|
||||||
const selectedItem = options.find(option => option[attribute] === localStorage.getItem(key));
|
const selectedItem = options.find(option => option[attribute] === localStorage.getItem(key));
|
||||||
selectedItem.selected = true;
|
selectedItem.selected = true;
|
||||||
}
|
}
|
||||||
@ -534,6 +545,13 @@
|
|||||||
rsg.updateListenerCommand();
|
rsg.updateListenerCommand();
|
||||||
}, 500);
|
}, 500);
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
const shellOptions = shellSelect.querySelectorAll(".shell-option");
|
||||||
|
prepopulateElement("shell", shellSelect, "value", [...shellOptions]);
|
||||||
|
|
||||||
|
rsg.updateReverseShellCommand();
|
||||||
|
}, 500);
|
||||||
|
|
||||||
prepopulateElement("ip", ipInput, "value");
|
prepopulateElement("ip", ipInput, "value");
|
||||||
prepopulateElement("port", portInput, "value");
|
prepopulateElement("port", portInput, "value");
|
||||||
prepopulateElement("auto-copy", autoCopySwitch, "checked");
|
prepopulateElement("auto-copy", autoCopySwitch, "checked");
|
||||||
@ -559,6 +577,14 @@
|
|||||||
setLocalStorage(selectedItem, "listener", "value");
|
setLocalStorage(selectedItem, "listener", "value");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
shellSelect.addEventListener("change", () => {
|
||||||
|
rsg.updateReverseShellSelection();
|
||||||
|
|
||||||
|
const shellOptions = shellSelect.querySelectorAll(".shell-option");
|
||||||
|
const selectedItem = [...shellOptions].find(option => option.selected);
|
||||||
|
setLocalStorage(selectedItem, "shell", "value");
|
||||||
|
});
|
||||||
|
|
||||||
autoCopySwitch.addEventListener("change", () => {
|
autoCopySwitch.addEventListener("change", () => {
|
||||||
setLocalStorage(autoCopySwitch, "auto-copy", "checked");
|
setLocalStorage(autoCopySwitch, "auto-copy", "checked");
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user