Skip to content

Commit

Permalink
webfinder插件入口新增示例
Browse files Browse the repository at this point in the history
  • Loading branch information
houdoudou committed Sep 10, 2020
1 parent 2bec9af commit f565a57
Show file tree
Hide file tree
Showing 121 changed files with 792 additions and 0 deletions.
66 changes: 66 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ goby提供了一些方法,供插件扩展goby本身的能力。但是有的时
- ip详情页 - ipDetail
- banner列表的标题栏 - bannerTop
- 漏洞列表页 - vulList
- Webfinder页 - webfinder

## 扫描弹窗页 - **scanDia**
在插件清单中配置contributes.views.scanDia,就可以给扫描弹窗顶部添加自定义的组件。具体位置如图:
Expand Down Expand Up @@ -339,6 +340,13 @@ banner列表的标题栏 - bannerTop

同时关于vulList的具体使用,也有一个简单的例子可供学习,具体见漏洞列表页。

## Webfinder页 - **webfinder**
在插件清单中配置contributes.views.webfinder,就可以给webfinder页面添加自定义的组件。具体位置如图:

![](./img/webfinder.png)

同时关于webfinder的具体使用,也有一个简单的例子可供学习,具体见webfinder页。

# 插件示例
## 概述
在插件功能章节,从更宽泛的层面上介绍了插件能做些什么,本章则细化了各个功能点,并提供了详细的代码例子。
Expand Down Expand Up @@ -698,6 +706,64 @@ ip详情页的配置,使得用户可以对ip详情页进行自定义的处理

![](./img/ex-msf.gif)

## Webfinder页 - webfinder
webfinder页,使得用户可以对扫描出的web列表,进行自定义的处理和操作,下面我们看一个简单的例子。这个例子主要是在webfinder的页面,点击按钮显示对应的hostinfo。

### 下载链接
[Webfinder](http://gobies.org/Webfinder.zip)

### 使用的**goby API**

- goby.registerCommand
- goby.showIframeDia
- goby.closeIframeDia


### 示例
第一步,你需要注册自定义组件要触发的命令。


``` javascript
function activate(content) {
goby.registerCommand('webfinder', function (content) {
let path = __dirname + "/index.html?hostinfo=" + content.hostinfo;
goby.showIframeDia(path, "webfinder", "441", "188");
});
}

exports.activate = activate;
```
第二步,你需要在package.json里配置对应视图入口点,即contributes.views.webfinder,填写想要的标题、对应的命令。


``` xquery
"contributes": {
"views": {
"webfinder": [
{
"command": "webfinder",
"title": "webfinder",
"icon": "src/assets/img/logo.png"
}
]
}
}
```

至于具体的代码内容,可以[下载代码](http://gobies.org/Webfinder.zip)查看详细。

最终效果如下:

![](./img/ex-webfinder.gif)

# 参考
## goby API
### 命令相关
Expand Down
Binary file added img/ex-webfinder.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/webfinder.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions samples/Webfinder/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
.vscode-test/
*.vsix
2 changes: 2 additions & 0 deletions samples/Webfinder/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## 0.1.0 - 10th Sept,2020
webfinder页入口配置的简单示例
2 changes: 2 additions & 0 deletions samples/Webfinder/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## 快速开始
webfinder页入口配置的简单示例
24 changes: 24 additions & 0 deletions samples/Webfinder/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "Webfinder",
"publisher": "GobySec",
"description": "webfinder页入口配置的示例",
"version": "0.1.0",
"engines": "1.7.199",
"icon": "src/assets/img/logo.png",
"initEvents": "",
"main": "./src/extension.js",
"contributes": {
"views": {
"webfinder": [
{
"command": "webfinder",
"title": "webfinder",
"icon": "src/assets/img/logo.png"
}
]
}
},
"scripts": {},
"devDependencies": {},
"dependencies": {}
}
103 changes: 103 additions & 0 deletions samples/Webfinder/src/assets/css/base.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
/* 滚动条轨道的样式 */
::-webkit-scrollbar {
width: 5px;
/*竖向滚动条的宽度*/
height: 5px;
/*横向滚动条的高度*/
}

::-webkit-scrollbar-track {
background-color: transparent;
-webkit-border-radius: 0;
border-radius: 0;
}

/* 滚动条轨道内滑块的样式 */
::-webkit-scrollbar-thumb {
border-radius: 0;
background-color: #A0B0CD;
}

/* 当焦点不在当前区域滑块的状态 */
::-webkit-scrollbar-thumb:window-inactive {
background-color: #FFFFFF;
-webkit-border-radius: 0;
border-radius: 0;
}

.clearfix:before,
.clearfix:after {
/*清除浮动*/
content: "";
display: table;
}

.clearfix:after {
clear: both;
}

.clearfix {
*zoom: 1;
/*IE/7/6*/
}

.fl {
float: left;
}

.fr {
float: right;
}

.layui-input {
width: 303px;
height: 30px;
font-size: 12px;
color: #163366;
background:rgba(33, 43, 66, 0);
border: 1px solid rgba(207, 217, 229, 1);
border-radius: 2px;
}

.layui-btn {
width: 87px;
height: 30px;
line-height: 30px;
font-size: 12px;
color: #fff;
margin-top: 0;
padding: 0;
background:rgba(71, 120, 199, 1);
border-radius: 4px;
}

.res-wrap {
background:rgba(255, 255, 255, 1);
border: 1px solid rgba(229, 235, 247, 1);
border-radius: 4px;
margin-top: 20px;
}

.res-wrap>p {
color: #7586A6;
height: 21px;
line-height: 21px;
font-size: 12px;
padding: 0 10px;
background:rgba(235, 240, 248, 1);
border: 1px solid rgba(229, 235, 247, 1);
border-radius: 4px 4px 0 0;
}

#res {
font-size: 12px;
color: #7586A6;
line-height: 18px;
padding: 10px;
height: 53px;
overflow: auto;
}




Binary file added samples/Webfinder/src/assets/img/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions samples/Webfinder/src/assets/js/jquery-3.3.1.min.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions samples/Webfinder/src/assets/lib/layui/css/layui.css

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions samples/Webfinder/src/assets/lib/layui/css/layui.mobile.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions samples/Webfinder/src/assets/lib/layui/css/modules/code.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f565a57

Please sign in to comment.