Skip to content

Instantly share code, notes, and snippets.

@rewanthtammana
Last active September 16, 2019 11:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rewanthtammana/da0816df9e5209880345120b9e6b7938 to your computer and use it in GitHub Desktop.
Save rewanthtammana/da0816df9e5209880345120b9e6b7938 to your computer and use it in GitHub Desktop.
const plugin_version = '2018-1000-1000'
const plugin_name = '888-block-all'
// 本插件用于测试拦截效果
//
// 这个插件的逻辑是,不管请求是否正常,一律拦截
// 若要开启这个插件,请先删除下面的 throw :-)
// throw new Error("本插件会拦截所有操作,为了防止误操作,请请删掉这一行")
'use strict'
var plugin = new RASP('block-all-test')
const default_action = {
action: 'block',
message: '- 插件全部拦截测试 -',
confidence: 90
}
// BEGIN ALGORITHM CONFIG //
var algorithmConfig = {}
// END ALGORITHM CONFIG //
plugin.register('sql', function (params, context) {
return default_action
})
plugin.register('ssrf', function (params, context) {
return default_action
})
plugin.register('directory', function (params, context) {
return default_action
})
plugin.register('readFile', function (params, context) {
return default_action
})
plugin.register('webdav', function (params, context) {
return default_action
})
plugin.register('include', function (params, context) {
return default_action
})
plugin.register('writeFile', function (params, context) {
return default_action
})
plugin.register('fileUpload', function (params, context) {
return default_action
})
plugin.register('command', function (params, context) {
return default_action
})
// 注意: PHP 不支持XXE检测
plugin.register('xxe', function (params, context) {
return default_action
})
// 默认情况下,当OGNL表达式长度超过30才会进入检测点,此长度可配置
plugin.register('ognl', function (params, context) {
return default_action
})
// [[ 近期调整~ ]]
plugin.register('deserialization', function (params, context) {
return default_action
})
plugin.log('全部拦截插件测试: 初始化成功')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment