removed unnecessary blank space

This commit is contained in:
rohitkumarankam 2022-02-25 23:11:16 +05:30
parent 9a92be06a0
commit 9fe49aa96c

View File

@ -1,68 +1,68 @@
// Element selectors // Element selectors
const ipInput = document.querySelector("#ip"); const ipInput = document.querySelector("#ip");
const portInput = document.querySelector("#port"); const portInput = document.querySelector("#port");
const listenerSelect = document.querySelector("#listener-selection"); const listenerSelect = document.querySelector("#listener-selection");
const shellSelect = document.querySelector("#shell"); const shellSelect = document.querySelector("#shell");
// const autoCopySwitch = document.querySelector("#auto-copy-switch"); // const autoCopySwitch = document.querySelector("#auto-copy-switch");
const encodingSelect = document.querySelector('#encoding'); const encodingSelect = document.querySelector('#encoding');
const listenerCommand = document.querySelector("#listener-command"); const listenerCommand = document.querySelector("#listener-command");
const reverseShellCommand = document.querySelector("#reverse-shell-command"); const reverseShellCommand = document.querySelector("#reverse-shell-command");
const bindShellCommand = document.querySelector("#bind-shell-command"); const bindShellCommand = document.querySelector("#bind-shell-command");
const msfVenomCommand = document.querySelector("#msfvenom-command"); const msfVenomCommand = document.querySelector("#msfvenom-command");
const FilterType = { const FilterType = {
'All': 'all', 'All': 'all',
'Windows': 'windows', 'Windows': 'windows',
'Linux': 'linux', 'Linux': 'linux',
'Mac': 'mac' 'Mac': 'mac'
}; };
document.querySelector("#os-options").addEventListener("change", (event) => { document.querySelector("#os-options").addEventListener("change", (event) => {
const selectedOS = event.target.value; const selectedOS = event.target.value;
rsg.setState({ rsg.setState({
filter: selectedOS, filter: selectedOS,
}); });
}); });
document.querySelector("#reverse-tab").addEventListener("click", () => { document.querySelector("#reverse-tab").addEventListener("click", () => {
rsg.setState({ rsg.setState({
commandType: CommandType.ReverseShell, commandType: CommandType.ReverseShell,
}); });
}) })
document.querySelector("#bind-tab").addEventListener("click", () => { document.querySelector("#bind-tab").addEventListener("click", () => {
rsg.setState({ rsg.setState({
commandType: CommandType.BindShell, commandType: CommandType.BindShell,
encoding: "None" encoding: "None"
}); });
}) })
document.querySelector("#bind-tab").addEventListener("click", () => { document.querySelector("#bind-tab").addEventListener("click", () => {
document.querySelector("#bind-shell-selection").innerHTML = ""; document.querySelector("#bind-shell-selection").innerHTML = "";
rsg.setState({ rsg.setState({
commandType: CommandType.BindShell commandType: CommandType.BindShell
}); });
}) })
document.querySelector("#msfvenom-tab").addEventListener("click", () => { document.querySelector("#msfvenom-tab").addEventListener("click", () => {
document.querySelector("#msfvenom-selection").innerHTML = ""; document.querySelector("#msfvenom-selection").innerHTML = "";
rsg.setState({ rsg.setState({
commandType: CommandType.MSFVenom, commandType: CommandType.MSFVenom,
encoding: "None" encoding: "None"
});
}); });
});
var rawLinkButtons = document.querySelectorAll('.raw-listener'); var rawLinkButtons = document.querySelectorAll('.raw-listener');
for (const button of rawLinkButtons) { for (const button of rawLinkButtons) {
button.addEventListener("click", () => { button.addEventListener("click", () => {
const rawLink = RawLink.generate(rsg); const rawLink = RawLink.generate(rsg);
window.location = rawLink; window.location = rawLink;
}); });
} }
document.querySelector(".download-listener").addEventListener("click", () => { document.querySelector(".download-listener").addEventListener("click", () => {
var element = document.createElement('a'); var element = document.createElement('a');
const rawLink = RawLink.generate(rsg); const rawLink = RawLink.generate(rsg);
element.setAttribute('href', rawLink); element.setAttribute('href', rawLink);
@ -70,9 +70,9 @@
document.body.appendChild(element); document.body.appendChild(element);
element.click(); element.click();
document.body.removeChild(element); document.body.removeChild(element);
}) })
const filterCommandData = function (data, { commandType, filter }) { const filterCommandData = function (data, { commandType, filter }) {
return data.filter(item => { return data.filter(item => {
if (!item.meta.includes(commandType)) { if (!item.meta.includes(commandType)) {
return false; return false;
@ -88,11 +88,11 @@
return item.meta.includes(filter); return item.meta.includes(filter);
}); });
} }
const query = new URLSearchParams(location.hash.substring(1)); const query = new URLSearchParams(location.hash.substring(1));
const rsg = { const rsg = {
ip: query.get('ip') || localStorage.getItem('ip') || '10.10.10.10', ip: query.get('ip') || localStorage.getItem('ip') || '10.10.10.10',
port: query.get('port') || localStorage.getItem('port') || 9001, port: query.get('port') || localStorage.getItem('port') || 9001,
payload: query.get('payload') || localStorage.getItem('payload') || 'windows/x64/meterpreter/reverse_tcp', payload: query.get('payload') || localStorage.getItem('payload') || 'windows/x64/meterpreter/reverse_tcp',
@ -383,82 +383,82 @@
$('#revshell-advanced').collapse($('#revshell-advanced-switch').prop('checked') ? 'show' : $('#revshell-advanced').collapse($('#revshell-advanced-switch').prop('checked') ? 'show' :
'hide') 'hide')
} }
} }
/* /*
* Init * Init
*/ */
rsg.init(); rsg.init();
rsg.update(); rsg.update();
/* /*
* Event handlers/functions * Event handlers/functions
*/ */
ipInput.addEventListener("input", (e) => { ipInput.addEventListener("input", (e) => {
rsg.setState({ rsg.setState({
ip: e.target.value ip: e.target.value
}) })
}); });
portInput.addEventListener("input", (e) => { portInput.addEventListener("input", (e) => {
rsg.setState({ rsg.setState({
port: Number(e.target.value) port: Number(e.target.value)
}) })
}); });
listenerSelect.addEventListener("change", (e) => { listenerSelect.addEventListener("change", (e) => {
rsg.setState({ rsg.setState({
listener: e.target.value listener: e.target.value
}) })
}); });
shellSelect.addEventListener("change", (e) => { shellSelect.addEventListener("change", (e) => {
rsg.setState({ rsg.setState({
shell: e.target.value shell: e.target.value
}) })
}); });
encodingSelect.addEventListener("change", (e) => { encodingSelect.addEventListener("change", (e) => {
rsg.setState({ rsg.setState({
encoding: e.target.value encoding: e.target.value
}) })
}); });
document.querySelector('#inc-port').addEventListener('click', () => { document.querySelector('#inc-port').addEventListener('click', () => {
rsg.setState({ rsg.setState({
port: rsg.getPort() + 1 port: rsg.getPort() + 1
}) })
}) })
document.querySelector('#listener-advanced-switch').addEventListener('change', rsg.updateSwitchStates); document.querySelector('#listener-advanced-switch').addEventListener('change', rsg.updateSwitchStates);
document.querySelector('#revshell-advanced-switch').addEventListener('change', rsg.updateSwitchStates); document.querySelector('#revshell-advanced-switch').addEventListener('change', rsg.updateSwitchStates);
setInterval(rsg.updateSwitchStates, 500) // fix switch changes in rapid succession setInterval(rsg.updateSwitchStates, 500) // fix switch changes in rapid succession
document.querySelector('#copy-listener').addEventListener('click', () => { document.querySelector('#copy-listener').addEventListener('click', () => {
rsg.copyToClipboard(listenerCommand.innerText) rsg.copyToClipboard(listenerCommand.innerText)
}) })
document.querySelector('#copy-reverse-shell-command').addEventListener('click', () => { document.querySelector('#copy-reverse-shell-command').addEventListener('click', () => {
rsg.copyToClipboard(reverseShellCommand.innerText) rsg.copyToClipboard(reverseShellCommand.innerText)
}) })
document.querySelector('#copy-bind-shell-command').addEventListener('click', () => { document.querySelector('#copy-bind-shell-command').addEventListener('click', () => {
rsg.copyToClipboard(bindShellCommand.innerText) rsg.copyToClipboard(bindShellCommand.innerText)
}) })
document.querySelector('#copy-msfvenom-command').addEventListener('click', () => { document.querySelector('#copy-msfvenom-command').addEventListener('click', () => {
rsg.copyToClipboard(msfVenomCommand.innerText) rsg.copyToClipboard(msfVenomCommand.innerText)
}) })
// autoCopySwitch.addEventListener("change", () => { // autoCopySwitch.addEventListener("change", () => {
// setLocalStorage(autoCopySwitch, "auto-copy", "checked"); // setLocalStorage(autoCopySwitch, "auto-copy", "checked");
// }); // });
// Popper tooltips // Popper tooltips
$(function () { $(function () {
$('[data-toggle="tooltip"]').tooltip() $('[data-toggle="tooltip"]').tooltip()
}); });
// TODO: add a random fifo for netcat mkfifo // TODO: add a random fifo for netcat mkfifo
//let randomId = Math.random().toString(36).substring(2, 4); //let randomId = Math.random().toString(36).substring(2, 4);