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