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