Skip to content

Commit

Permalink
(Enhance:Terminal) 新增 options exec
Browse files Browse the repository at this point in the history
  • Loading branch information
Medicean committed Jul 15, 2019
1 parent dcf752c commit a49a97f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 则不需要。
* `shellshock` 利用 bash 破壳(CVE-2014-6271)执行命令, 需要目标的 `/bin/sh` 链接为 `/bin/bash` 且存在破壳漏洞

* 新增全局变量 antSword['module'] 用于存放所有核心模块, 方便在插件中引入

### 文件管理

* 修复标签页编辑文件时,路径过长导致右侧按钮不显示的 bug (#192)
* 新建文件时, 默认内容前面加了 `#` 号(防止在shell当前目录下, 新建 `.htaccess` 语法错误导致整个目录无法解析)

### 虚拟终端

* 新增 `options['exec']` 用于替换当前 Terminal 中生成 payload 函数

## 2019/06/11 `v(2.1.3)`

### 核心模块
Expand Down
9 changes: 9 additions & 0 deletions source/app.entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ const antSword = window.antSword = {
* @type {Object}
*/
modules: {},
/**
* 模块
*/
module: {},
/**
* localStorage存储API
* ? 如果只有一个key参数,则返回内容,否则进行设置
Expand Down Expand Up @@ -281,6 +285,11 @@ antSword['tabbar'] = new dhtmlXTabBar(document.body);
let _module = require(`./modules/${_}/`);
antSword['modules'][_] = new _module();
});

['shellmanager', 'settings', 'plugin', 'database', 'terminal', 'viewsite', 'filemanager'].map((_) => {
antSword['module'][_] = require(`./modules/${_}/`);
})

// 移除加载界面&&设置标题
$('#loading').remove();
document.title = antSword['language']['title'] || 'AntSword';
Expand Down
3 changes: 3 additions & 0 deletions source/modules/terminal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ class Terminal {
.term
.exec(`cd ${this.options.path}`);
}
if (this.options.hasOwnProperty("exec")) {
this.core.command.exec = this.options.exec;
}
})
.catch((err) => {
toastr.error((typeof (err) === 'object') ?
Expand Down

0 comments on commit a49a97f

Please sign in to comment.