Webshell
“web”的含义是显然需要服务器开放web服务,“shell”的含义是取得对服务器某种程度上操作权限。webshell常常被称为通过网站端口对网站服务器的某种程度上操作的权限。
一方面,webshell被站长常常用于网站管理、服务器管理等等,根据FSO权限的不同,作用有在线编辑网页脚本、上传下载文件、查看数据库、执行任意程序命令等。
另一方面,被入侵者利用,从而达到控制网站服务器的目的。这些网页脚本常称为WEB脚本木马,比较流行的asp或php木马,也有基于.NET的脚本木马与JSP脚本木马。国内常用的WebShell有海阳ASP木马,Phpspy,c99shell等。
web
端使用Xterm.js
或者其他的WebShell
组件和websocket
后端只需要支持WebSocket
和SSH
协议的远程登录模块即可
web端实现
1.安装
npm install xterm@3.1.0 --save
指定版本安装,最新版的xterm文件的改动很大,使用下面的方法会报错
2.导包
import 'xterm/dist/xterm.css';
import {
Terminal } from 'xterm';
// 布局组件 可以不用
import * as fit from 'xterm/lib/addons/fit/fit';
Terminal.applyAddon(fit);
3.在页面中的显示
<template>
<div>
<div id="terminal" style="width: 500px;height:300px;"></div>
</div>
</template>
4.数据操作
mounted () {
//实例化一个websocket,用于和django江湖
this.terminalSocket = new WebSocket("ws://127.0.0.1:8000/web/");
//获取到后端传回的信息
this.terminalSocket.onmessage = (res) => {
console.log(res.data);
// var message = JSON.parse(res.data);
//将传回来的数据显示在xterm里
this.term.writeln("\r\n"+res.data);
//重置要发送的信息
this.order = ""
//换行,显示下一个开头
this.term.write("\r\n$ ");
}
//ws连接的时候
// this.terminalSocket.onopen = function(){
// console.log('websocket is Connected...')
// }
//ws关闭的时候
// this.terminalSocket.onclose = function(){
// console.log('websocket is Closed...')
// }
//ws错误的时候