Commit a49a97f9 authored by Medicean's avatar Medicean

(Enhance:Terminal) 新增 options exec

parent dcf752c2
...@@ -11,11 +11,17 @@ ...@@ -11,11 +11,17 @@
* `COM` 组件执行命令, 该模块为 Windows 专属, 需要目标在 php.ini 中打开 COM 选项: `com.allow_dcom = true`, 注意, PHP 5.4.5 后,com/dotnet模块已经成了单独的扩展, 所以还需要在 php.ini 中配置 `extension=php_com_dotnet.dll`, 如果 PHP < 5.4.5 则不需要。 * `COM` 组件执行命令, 该模块为 Windows 专属, 需要目标在 php.ini 中打开 COM 选项: `com.allow_dcom = true`, 注意, PHP 5.4.5 后,com/dotnet模块已经成了单独的扩展, 所以还需要在 php.ini 中配置 `extension=php_com_dotnet.dll`, 如果 PHP < 5.4.5 则不需要。
* `shellshock` 利用 bash 破壳(CVE-2014-6271)执行命令, 需要目标的 `/bin/sh` 链接为 `/bin/bash` 且存在破壳漏洞 * `shellshock` 利用 bash 破壳(CVE-2014-6271)执行命令, 需要目标的 `/bin/sh` 链接为 `/bin/bash` 且存在破壳漏洞
* 新增全局变量 antSword['module'] 用于存放所有核心模块, 方便在插件中引入
### 文件管理 ### 文件管理
* 修复标签页编辑文件时,路径过长导致右侧按钮不显示的 bug (#192) * 修复标签页编辑文件时,路径过长导致右侧按钮不显示的 bug (#192)
* 新建文件时, 默认内容前面加了 `#` 号(防止在shell当前目录下, 新建 `.htaccess` 语法错误导致整个目录无法解析) * 新建文件时, 默认内容前面加了 `#` 号(防止在shell当前目录下, 新建 `.htaccess` 语法错误导致整个目录无法解析)
### 虚拟终端
* 新增 `options['exec']` 用于替换当前 Terminal 中生成 payload 函数
## 2019/06/11 `v(2.1.3)` ## 2019/06/11 `v(2.1.3)`
### 核心模块 ### 核心模块
......
...@@ -67,6 +67,10 @@ const antSword = window.antSword = { ...@@ -67,6 +67,10 @@ const antSword = window.antSword = {
* @type {Object} * @type {Object}
*/ */
modules: {}, modules: {},
/**
* 模块
*/
module: {},
/** /**
* localStorage存储API * localStorage存储API
* ? 如果只有一个key参数,则返回内容,否则进行设置 * ? 如果只有一个key参数,则返回内容,否则进行设置
...@@ -281,6 +285,11 @@ antSword['tabbar'] = new dhtmlXTabBar(document.body); ...@@ -281,6 +285,11 @@ antSword['tabbar'] = new dhtmlXTabBar(document.body);
let _module = require(`./modules/${_}/`); let _module = require(`./modules/${_}/`);
antSword['modules'][_] = new _module(); antSword['modules'][_] = new _module();
}); });
['shellmanager', 'settings', 'plugin', 'database', 'terminal', 'viewsite', 'filemanager'].map((_) => {
antSword['module'][_] = require(`./modules/${_}/`);
})
// 移除加载界面&&设置标题 // 移除加载界面&&设置标题
$('#loading').remove(); $('#loading').remove();
document.title = antSword['language']['title'] || 'AntSword'; document.title = antSword['language']['title'] || 'AntSword';
......
...@@ -61,6 +61,9 @@ class Terminal { ...@@ -61,6 +61,9 @@ class Terminal {
.term .term
.exec(`cd ${this.options.path}`); .exec(`cd ${this.options.path}`);
} }
if (this.options.hasOwnProperty("exec")) {
this.core.command.exec = this.options.exec;
}
}) })
.catch((err) => { .catch((err) => {
toastr.error((typeof (err) === 'object') ? toastr.error((typeof (err) === 'object') ?
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment