mirror of
https://github.com/0dayCTF/reverse-shell-generator.git
synced 2024-12-19 19:36:10 +00:00
Merge pull request #14 from AlanFoster/fix-copy-paste-support
Fix copy paste support
This commit is contained in:
commit
70592423f3
52
index.html
52
index.html
@ -538,6 +538,21 @@
|
||||
});
|
||||
}
|
||||
|
||||
const uiElements = {
|
||||
[CommandType.ReverseShell]: {
|
||||
listSelection: '#reverse-shell-selection',
|
||||
command: '#reverse-shell-command'
|
||||
},
|
||||
[CommandType.BindShell]: {
|
||||
listSelection: '#bind-shell-selection',
|
||||
command: '#bind-shell-command',
|
||||
},
|
||||
[CommandType.MSFVenom]: {
|
||||
listSelection: '#msfvenom-selection',
|
||||
command: '#msfvenom-command'
|
||||
}
|
||||
};
|
||||
|
||||
const rsg = {
|
||||
selectedValues: {
|
||||
[CommandType.ReverseShell]: filterCommandData(rsgData.reverseShellCommands, { commandType: CommandType.ReverseShell })[0].name,
|
||||
@ -548,15 +563,15 @@
|
||||
filter: FilterType.All,
|
||||
|
||||
copyToClipboard: (text) => {
|
||||
// if (navigator ?.clipboard ?.writeText) {
|
||||
// navigator.clipboard.writeText(text)
|
||||
// $('#clipboard-toast').toast('show')
|
||||
// } else if (window ?.clipboardData ?.setData) {
|
||||
// window.clipboardData.setData('Text', text);
|
||||
// $('#clipboard-toast').toast('show')
|
||||
// } else {
|
||||
// $('#clipboard-failure-toast').toast('show')
|
||||
// }
|
||||
if (navigator ?.clipboard ?.writeText) {
|
||||
navigator.clipboard.writeText(text)
|
||||
$('#clipboard-toast').toast('show')
|
||||
} else if (window ?.clipboardData ?.setData) {
|
||||
window.clipboardData.setData('Text', text);
|
||||
$('#clipboard-toast').toast('show')
|
||||
} else {
|
||||
$('#clipboard-failure-toast').toast('show')
|
||||
}
|
||||
},
|
||||
|
||||
escapeHTML: (text) => String(text).replace(/</, '<').replace(/>/, '>'),
|
||||
@ -685,13 +700,8 @@
|
||||
documentFragment.appendChild(selectionButton);
|
||||
})
|
||||
|
||||
const listTargets = {
|
||||
[CommandType.ReverseShell]: '#reverse-shell-selection',
|
||||
[CommandType.BindShell]: '#bind-shell-selection',
|
||||
[CommandType.MSFVenom]: '#msfvenom-selection'
|
||||
};
|
||||
const listTarget = listTargets[rsg.commandType];
|
||||
document.querySelector(listTarget).replaceChildren(documentFragment)
|
||||
const listSelectionElement = uiElements[rsg.commandType].listSelection;
|
||||
document.querySelector(listSelectionElement).replaceChildren(documentFragment)
|
||||
},
|
||||
|
||||
updateListenerCommand: () => {
|
||||
@ -746,14 +756,8 @@
|
||||
)
|
||||
}
|
||||
|
||||
const commandTargets = {
|
||||
[CommandType.ReverseShell]: '#reverse-shell-command',
|
||||
[CommandType.BindShell]: '#bind-shell-command',
|
||||
[CommandType.MSFVenom]: '#msfvenom-command'
|
||||
};
|
||||
const commandTarget = commandTargets[rsg.commandType];
|
||||
|
||||
document.querySelector(commandTarget).innerHTML = command;
|
||||
const commandElement = uiElements[rsg.commandType].command;
|
||||
document.querySelector(commandElement).innerHTML = command;
|
||||
},
|
||||
|
||||
updateSwitchStates: () => {
|
||||
|
Loading…
Reference in New Issue
Block a user