From bc6e3962f8d35b6b99b8ec49d6caa3e4e20d9791 Mon Sep 17 00:00:00 2001 From: Li4n0 <34324462+Li4n0@users.noreply.github.com> Date: Tue, 18 May 2021 22:45:18 +0800 Subject: [PATCH] fix: fix some bugs (#17) --- .github/workflows/release.yml | 1 + frontend/dist/css/app.css | 2 +- frontend/dist/css/chunk-012c9c90.css | 1 - frontend/dist/css/chunk-5840ae94.css | 1 + frontend/dist/index.html | 2 +- frontend/dist/js/app.js | 2 +- frontend/dist/js/chunk-012c9c90.js | 1 - frontend/dist/js/chunk-08f9fbe8.js | 2 +- frontend/dist/js/chunk-5840ae94.js | 1 + frontend/dist/js/chunk-vendors.js | 2 +- frontend/src/App.vue | 20 +++++--- frontend/src/components/BasicRule.vue | 8 ++-- frontend/src/views/rules/Mysql.vue | 16 +++++-- internal/cli/banner.go | 3 +- internal/qqwry/wry.go | 2 +- pkg/dns/dns.go | 43 +++++++++-------- pkg/dns/rule.go | 2 +- pkg/ftp/record.go | 42 +++++++++-------- pkg/mysql/mysql.go | 67 +++++++++++++-------------- pkg/mysql/vmysql/conn.go | 4 ++ pkg/rhttp/http.go | 44 ++++++++++-------- pkg/server/controller.go | 2 +- pkg/server/server.go | 4 +- 23 files changed, 151 insertions(+), 121 deletions(-) delete mode 100644 frontend/dist/css/chunk-012c9c90.css create mode 100644 frontend/dist/css/chunk-5840ae94.css delete mode 100644 frontend/dist/js/chunk-012c9c90.js create mode 100644 frontend/dist/js/chunk-5840ae94.js diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 22ad90e..0b7b5d8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,6 +41,7 @@ jobs: CGO_ENABLE: 1 run: | GOARCH="amd64" go build -v -ldflags="-s -w" -trimpath -o "bin/revsuit_darwin_amd64" ./cmd/revsuit/revsuit.go + GOARCH="arm64" go build -v -ldflags="-s -w" -trimpath -o "bin/revsuit_darwin_arm64" ./cmd/revsuit/revsuit.go - name: Upload the artifacts uses: li4n0/upload-release-action@v2 with: diff --git a/frontend/dist/css/app.css b/frontend/dist/css/app.css index cd916d0..73c8db5 100644 --- a/frontend/dist/css/app.css +++ b/frontend/dist/css/app.css @@ -1 +1 @@ -.custom-icons-list[data-v-05a908c2] .anticon{margin-right:6px}body[data-v-6db702b8],html[data-v-6db702b8]{height:100%;margin:0}.fade-transform-enter-active[data-v-6db702b8],.fade-transform-leave-active[data-v-6db702b8]{transition:all .3s;opacity:0}.fade-transform-enter[data-v-6db702b8],.fade-transform-leave[data-v-6db702b8]{opacity:0}.fade-transform-enter-to[data-v-6db702b8]{opacity:0}.ant-menu-item>span>a[data-v-6db702b8]{color:hsla(0,0%,100%,.65)}.ant-menu-item-selected>span>a[data-v-6db702b8]{color:#fff}#nav[data-v-6db702b8]{height:100%}#nav .trigger[data-v-6db702b8]{font-size:18px;line-height:64px;padding:0 24px;cursor:pointer;transition:color .3s}#nav .trigger[data-v-6db702b8]:hover{color:#1890ff}#nav .logo[data-v-6db702b8]{height:32px;background:#0a1d2d;margin:16px;text-align:center;font-size:1.2rem;color:#fff;padding-bottom:5px;border-bottom:2px solid #b6befa}.copyright[data-v-6db702b8]{color:#888;text-align:right;margin-right:1rem} \ No newline at end of file +.custom-icons-list[data-v-05a908c2] .anticon{margin-right:6px}body[data-v-171364ce],html[data-v-171364ce]{height:100%;margin:0}.fade-transform-enter-active[data-v-171364ce],.fade-transform-leave-active[data-v-171364ce]{transition:all .3s;opacity:0}.fade-transform-enter[data-v-171364ce],.fade-transform-leave[data-v-171364ce]{opacity:0}.fade-transform-enter-to[data-v-171364ce]{opacity:0}.ant-menu-item>span>a[data-v-171364ce]{color:hsla(0,0%,100%,.65)}.ant-menu-item-selected>span>a[data-v-171364ce]{color:#fff}#nav[data-v-171364ce]{height:100%}#nav .trigger[data-v-171364ce]{font-size:18px;line-height:64px;padding:0 24px;cursor:pointer;transition:color .3s}#nav .trigger[data-v-171364ce]:hover{color:#1890ff}#nav .logo[data-v-171364ce]{height:32px;background:#0a1d2d;margin:16px;text-align:center;font-size:1.2rem;color:#fff;padding-bottom:5px;border-bottom:2px solid #b6befa}.copyright[data-v-171364ce]{color:#888;text-align:right;margin-right:1rem} \ No newline at end of file diff --git a/frontend/dist/css/chunk-012c9c90.css b/frontend/dist/css/chunk-012c9c90.css deleted file mode 100644 index 33f5596..0000000 --- a/frontend/dist/css/chunk-012c9c90.css +++ /dev/null @@ -1 +0,0 @@ -#add-rule[data-v-e8e0136c]{margin-bottom:10px} \ No newline at end of file diff --git a/frontend/dist/css/chunk-5840ae94.css b/frontend/dist/css/chunk-5840ae94.css new file mode 100644 index 0000000..63e9440 --- /dev/null +++ b/frontend/dist/css/chunk-5840ae94.css @@ -0,0 +1 @@ +#add-rule[data-v-f1cd719a]{margin-bottom:10px} \ No newline at end of file diff --git a/frontend/dist/index.html b/frontend/dist/index.html index f79c912..db8b1ff 100644 --- a/frontend/dist/index.html +++ b/frontend/dist/index.html @@ -1 +1 @@ -RevSuit Control Panel
\ No newline at end of file +RevSuit Control Panel
\ No newline at end of file diff --git a/frontend/dist/js/app.js b/frontend/dist/js/app.js index dd18c2c..39cde03 100644 --- a/frontend/dist/js/app.js +++ b/frontend/dist/js/app.js @@ -1 +1 @@ -(function(e){function t(t){for(var s,a,i=t[0],c=t[1],l=t[2],u=0,f=[];u=200&&e<300}});t["a"]=r},4678:function(e,t,n){var s={"./af":"2bfb","./af.js":"2bfb","./ar":"8e73","./ar-dz":"a356","./ar-dz.js":"a356","./ar-kw":"423e","./ar-kw.js":"423e","./ar-ly":"1cfd","./ar-ly.js":"1cfd","./ar-ma":"0a84","./ar-ma.js":"0a84","./ar-sa":"8230","./ar-sa.js":"8230","./ar-tn":"6d83","./ar-tn.js":"6d83","./ar.js":"8e73","./az":"485c","./az.js":"485c","./be":"1fc1","./be.js":"1fc1","./bg":"84aa","./bg.js":"84aa","./bm":"a7fa","./bm.js":"a7fa","./bn":"9043","./bn-bd":"9686","./bn-bd.js":"9686","./bn.js":"9043","./bo":"d26a","./bo.js":"d26a","./br":"6887","./br.js":"6887","./bs":"2554","./bs.js":"2554","./ca":"d716","./ca.js":"d716","./cs":"3c0d","./cs.js":"3c0d","./cv":"03ec","./cv.js":"03ec","./cy":"9797","./cy.js":"9797","./da":"0f14","./da.js":"0f14","./de":"b469","./de-at":"b3eb","./de-at.js":"b3eb","./de-ch":"bb71","./de-ch.js":"bb71","./de.js":"b469","./dv":"598a","./dv.js":"598a","./el":"8d47","./el.js":"8d47","./en-au":"0e6b","./en-au.js":"0e6b","./en-ca":"3886","./en-ca.js":"3886","./en-gb":"39a6","./en-gb.js":"39a6","./en-ie":"e1d3","./en-ie.js":"e1d3","./en-il":"7333","./en-il.js":"7333","./en-in":"ec2e","./en-in.js":"ec2e","./en-nz":"6f50","./en-nz.js":"6f50","./en-sg":"b7e9","./en-sg.js":"b7e9","./eo":"65db","./eo.js":"65db","./es":"898b","./es-do":"0a3c","./es-do.js":"0a3c","./es-mx":"b5b7","./es-mx.js":"b5b7","./es-us":"55c9","./es-us.js":"55c9","./es.js":"898b","./et":"ec18","./et.js":"ec18","./eu":"0ff2","./eu.js":"0ff2","./fa":"8df4","./fa.js":"8df4","./fi":"81e9","./fi.js":"81e9","./fil":"d69a","./fil.js":"d69a","./fo":"0721","./fo.js":"0721","./fr":"9f26","./fr-ca":"d9f8","./fr-ca.js":"d9f8","./fr-ch":"0e49","./fr-ch.js":"0e49","./fr.js":"9f26","./fy":"7118","./fy.js":"7118","./ga":"5120","./ga.js":"5120","./gd":"f6b4","./gd.js":"f6b4","./gl":"8840","./gl.js":"8840","./gom-deva":"aaf2","./gom-deva.js":"aaf2","./gom-latn":"0caa","./gom-latn.js":"0caa","./gu":"e0c5","./gu.js":"e0c5","./he":"c7aa","./he.js":"c7aa","./hi":"dc4d","./hi.js":"dc4d","./hr":"4ba9","./hr.js":"4ba9","./hu":"5b14","./hu.js":"5b14","./hy-am":"d6b6","./hy-am.js":"d6b6","./id":"5038","./id.js":"5038","./is":"0558","./is.js":"0558","./it":"6e98","./it-ch":"6f12","./it-ch.js":"6f12","./it.js":"6e98","./ja":"079e","./ja.js":"079e","./jv":"b540","./jv.js":"b540","./ka":"201b","./ka.js":"201b","./kk":"6d79","./kk.js":"6d79","./km":"e81d","./km.js":"e81d","./kn":"3e92","./kn.js":"3e92","./ko":"22f8","./ko.js":"22f8","./ku":"2421","./ku.js":"2421","./ky":"9609","./ky.js":"9609","./lb":"440c","./lb.js":"440c","./lo":"b29d","./lo.js":"b29d","./lt":"26f9","./lt.js":"26f9","./lv":"b97c","./lv.js":"b97c","./me":"293c","./me.js":"293c","./mi":"688b","./mi.js":"688b","./mk":"6909","./mk.js":"6909","./ml":"02fb","./ml.js":"02fb","./mn":"958b","./mn.js":"958b","./mr":"39bd","./mr.js":"39bd","./ms":"ebe4","./ms-my":"6403","./ms-my.js":"6403","./ms.js":"ebe4","./mt":"1b45","./mt.js":"1b45","./my":"8689","./my.js":"8689","./nb":"6ce3","./nb.js":"6ce3","./ne":"3a39","./ne.js":"3a39","./nl":"facd","./nl-be":"db29","./nl-be.js":"db29","./nl.js":"facd","./nn":"b84c","./nn.js":"b84c","./oc-lnc":"167b","./oc-lnc.js":"167b","./pa-in":"f3ff","./pa-in.js":"f3ff","./pl":"8d57","./pl.js":"8d57","./pt":"f260","./pt-br":"d2d4","./pt-br.js":"d2d4","./pt.js":"f260","./ro":"972c","./ro.js":"972c","./ru":"957c","./ru.js":"957c","./sd":"6784","./sd.js":"6784","./se":"ffff","./se.js":"ffff","./si":"eda5","./si.js":"eda5","./sk":"7be6","./sk.js":"7be6","./sl":"8155","./sl.js":"8155","./sq":"c8f3","./sq.js":"c8f3","./sr":"cf1e","./sr-cyrl":"13e9","./sr-cyrl.js":"13e9","./sr.js":"cf1e","./ss":"52bd","./ss.js":"52bd","./sv":"5fbd","./sv.js":"5fbd","./sw":"74dc","./sw.js":"74dc","./ta":"3de5","./ta.js":"3de5","./te":"5cbb","./te.js":"5cbb","./tet":"576c","./tet.js":"576c","./tg":"3b1b","./tg.js":"3b1b","./th":"10e8","./th.js":"10e8","./tk":"5aff","./tk.js":"5aff","./tl-ph":"0f38","./tl-ph.js":"0f38","./tlh":"cf75","./tlh.js":"cf75","./tr":"0e81","./tr.js":"0e81","./tzl":"cf51","./tzl.js":"cf51","./tzm":"c109","./tzm-latn":"b53d","./tzm-latn.js":"b53d","./tzm.js":"c109","./ug-cn":"6117","./ug-cn.js":"6117","./uk":"ada2","./uk.js":"ada2","./ur":"5294","./ur.js":"5294","./uz":"2e8c","./uz-latn":"010e","./uz-latn.js":"010e","./uz.js":"2e8c","./vi":"2921","./vi.js":"2921","./x-pseudo":"fd7e","./x-pseudo.js":"fd7e","./yo":"7f33","./yo.js":"7f33","./zh-cn":"5c3a","./zh-cn.js":"5c3a","./zh-hk":"49ab","./zh-hk.js":"49ab","./zh-mo":"3a6c","./zh-mo.js":"3a6c","./zh-tw":"90ea","./zh-tw.js":"90ea"};function a(e){var t=r(e);return n(t)}function r(e){if(!n.o(s,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return s[e]}a.keys=function(){return Object.keys(s)},a.resolve=r,e.exports=a,a.id="4678"},"56d7":function(e,t,n){"use strict";n.r(t),n.d(t,"store",(function(){return E}));n("e260"),n("e6cf"),n("cca6"),n("a79d");var s=n("a026"),a=n("f23d"),r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("a-layout",{attrs:{id:"nav"}},[n("a-layout-sider",{attrs:{trigger:null,collapsible:""},model:{value:e.collapsed,callback:function(t){e.collapsed=t},expression:"collapsed"}},[n("div",{staticClass:"logo"},[n("b",[e._v("R")]),e.collapsed?e._e():n("span",[n("b",[e._v("ev")]),e._v("Suit")])]),n("a-menu",{attrs:{theme:"dark",mode:"inline",selectedKeys:[this.$route.path],"open-keys":e.openKeys},on:{"update:openKeys":function(t){e.openKeys=t},"update:open-keys":function(t){e.openKeys=t}}},[n("a-sub-menu",{key:"logs"},[n("span",{attrs:{slot:"title"},slot:"title"},[n("a-icon",{attrs:{type:"bar-chart"}}),n("span",[e._v("Logs")])],1),n("a-menu-item",{key:"/logs/http"},[n("router-link",{attrs:{to:"/logs/http"}},[e._v("HTTP Logs")])],1),n("a-menu-item",{key:"/logs/dns"},[n("router-link",{attrs:{to:"/logs/dns"}},[e._v("DNS Logs")])],1),n("a-menu-item",{key:"/logs/rmi"},[n("router-link",{attrs:{to:"/logs/rmi"}},[e._v("RMI Logs")])],1),n("a-menu-item",{key:"/logs/mysql"},[n("router-link",{attrs:{to:"/logs/mysql"}},[e._v("MySQL Logs")])],1),n("a-menu-item",{key:"/logs/ftp"},[n("router-link",{attrs:{to:"/logs/ftp"}},[e._v("FTP Logs")])],1)],1),n("a-sub-menu",{key:"rules"},[n("span",{attrs:{slot:"title"},slot:"title"},[n("rule-icon"),n("span",[e._v("Rules")])],1),n("a-menu-item",{key:"/rules/http"},[n("router-link",{attrs:{to:"/rules/http"}},[e._v("HTTP Rules")])],1),n("a-menu-item",{key:"/rules/dns"},[n("router-link",{attrs:{to:"/rules/dns"}},[e._v("DNS Rules")])],1),n("a-menu-item",{key:"/rules/rmi"},[n("router-link",{attrs:{to:"/rules/rmi"}},[e._v("RMI Rules")])],1),n("a-menu-item",{key:"/rules/mysql"},[n("router-link",{attrs:{to:"/rules/mysql"}},[e._v("MySQL Rules")])],1),n("a-menu-item",{key:"/rules/ftp"},[n("router-link",{attrs:{to:"/rules/ftp"}},[e._v("FTP Rules")])],1)],1),n("a-menu-item",{key:"/settings"},[n("router-link",{attrs:{to:"/settings"}},[n("a-icon",{attrs:{type:"setting"}}),e._v(" Settings ")],1)],1)],1)],1),n("a-layout",[n("a-layout-header",{staticStyle:{background:"#fff",padding:"0"}},[n("a-icon",{staticClass:"trigger",attrs:{type:e.collapsed?"menu-unfold":"menu-fold"},on:{click:function(){return e.collapsed=!e.collapsed}}}),e.isLogMode?n("div",{staticStyle:{float:"right","min-width":"50%",padding:"12px 0","line-height":"24px"}},[n("a-row",{attrs:{gutter:24,type:"flex"}},[n("a-col",{attrs:{span:21}},[n("a-form-model",{directives:[{name:"show",rawName:"v-show",value:e.showSettings,expression:"showSettings"}],ref:"settings",attrs:{layout:"inline"}},[n("a-row",{attrs:{gutter:24,type:"flex"}},[n("a-col",{attrs:{span:9,offset:2}},[n("a-form-model-item",{attrs:{label:"Auto Refresh"}},[n("a-switch",{attrs:{id:"auto-refresh"},model:{value:e.autoRefresh,callback:function(t){e.autoRefresh=t},expression:"autoRefresh"}})],1)],1),n("a-col",{attrs:{span:13}},[n("a-form-model-item",{attrs:{label:"Refresh Interval"}},[n("a-input-number",{staticStyle:{"margin-right":"-3rem"},attrs:{id:"refresh-interval",disabled:!e.autoRefresh},model:{value:e.refreshInterval,callback:function(t){e.refreshInterval=t},expression:"refreshInterval"}})],1)],1)],1)],1)],1),n("a-col",{attrs:{span:3}},[n("a-icon",{style:"font-size: 18px;padding: 12px 0;"+(e.showSettings?"color: #1b90ff;":""),attrs:{type:"setting"},on:{click:function(t){e.showSettings=!e.showSettings}}})],1)],1)],1):e._e()],1),n("a-layout-content",{style:{margin:"24px 16px",padding:"24px",borderRadius:"20px",background:"#fff",minHeight:"initial"}},[n("transition",{attrs:{name:"fade-transform"}},[n("router-view",{ref:"content"})],1)],1),n("div",{staticClass:"copyright"},[n("p",{},[e._v(" RevSuit Current Version: "+e._s(this.version)+" ©2021 "),n("a",{attrs:{href:"https://github.com/Li4n0"}},[e._v("Li4n0")]),e._v(". "),n("a",{attrs:{href:"https://github.com/Li4n0/revsuit"}},[e._v("GitHub")])])])],1),n("Auth")],1)},o=[],i=(n("caad"),n("2532"),n("d3b7"),n("25f0"),function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("a-modal",{attrs:{title:"Auth with token",visible:e.visible,"confirm-loading":e.confirmLoading},on:{cancel:e.cancel,ok:e.auth}},[n("a-input",{attrs:{placeholder:"Your token"},on:{pressEnter:e.auth},model:{value:e.token,callback:function(t){e.token=t},expression:"token"}})],1)],1)}),c=[],l=n("365c");function u(e){return Object(l["a"])({url:"/auth",method:"get",headers:{Token:e},validateStatus:function(e){return e>=200&&e<300}})}function f(){return Object(l["a"])({url:"/version",method:"get",validateStatus:function(e){return e>=200&&e<300}})}var d={data:function(){return{confirmLoading:!1,token:""}},computed:{visible:function(){return!E.authed}},methods:{auth:function(){var e=this;this.confirmLoading=!0,u(this.token).then((function(){E.authed=!0,e.confirmLoading=!1,e.token=""})).catch((function(t){403===t.response.status&&e.$notification.error({message:"Wrong token",description:"Your token is wrong, please check your server config file.",style:{width:"600px",marginLeft:"".concat(-265,"px")},duration:2.5}),e.confirmLoading=!1}))},cancel:function(){E.authed=!0}}},h=d,m=n("2877"),p=Object(m["a"])(h,i,c,!1,null,null,null),g=p.exports,b=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("a-icon",{attrs:{component:e.RuleSvg}})},j=[],v={template:'\n \n'},k={name:"RuleIcon",data:function(){return{RuleSvg:v}}},y=k,S=(n("912e"),Object(m["a"])(y,b,j,!1,null,"05a908c2",null)),w=S.exports,z={data:function(){return{store:E,autoRefresh:"true"===localStorage.getItem("autoRefresh"),refreshInterval:localStorage.getItem("refreshInterval")?localStorage.getItem("refreshInterval"):5,pageSize:E.pageSize,collapsed:!1,showSettings:!1,openKeys:["logs"],version:""}},computed:{isLogMode:function(){return this.$route.path.includes("logs")}},methods:{timing:function(){var e=this;null!==this.timer&&clearInterval(this.timer),this.timer=setInterval((function(){e.$refs.content.fetch()}),1e3*this.refreshInterval)},GetVersion:function(){var e=this;f().then((function(t){e.version=t.data.result}))}},mounted:function(){this.autoRefresh&&this.isLogMode&&this.timing(),this.GetVersion()},destroyed:function(){clearInterval(this.timer)},watch:{autoRefresh:function(e){e?this.timing():clearInterval(this.timer),localStorage.setItem("autoRefresh",e)},isLogMode:function(e){e?this.timing():clearInterval(this.timer),localStorage.setItem("autoRefresh",e)},refreshInterval:function(e){clearInterval(this.timer),this.timing(),localStorage.setItem("refreshInterval",e)},pageSize:function(e){(e<=0||e>100)&&(e=10),E.pageSize=e,localStorage.setItem("pageSize",e)},"store.authed":function(){this.$refs.content.fetch()},"store.pageSize":function(){this.$refs.content.pagination.pageSize=E.pageSize,localStorage.setItem("pageSize",E.pageSize.toString()),this.$refs.content.fetch()}},components:{RuleIcon:w,Auth:g}},R=z,_=(n("ced3"),Object(m["a"])(R,r,o,!1,null,"6db702b8",null)),x=_.exports,L=(n("3ca3"),n("ddb0"),n("8c4f"));s["a"].use(L["a"]);var I=[{path:"/",name:"Home",redirect:"/logs/http"},{path:"/logs/http",name:"HttpLogs",component:function(){return n.e("chunk-1da7f23b").then(n.bind(null,"f889"))}},{path:"/logs/dns",name:"DnsLogs",component:function(){return n.e("chunk-e039e75a").then(n.bind(null,"5ea0"))}},{path:"/logs/mysql",name:"MysqlLogs",component:function(){return n.e("chunk-fef965c2").then(n.bind(null,"2e9f"))}},{path:"/logs/rmi",name:"RmiLogs",component:function(){return n.e("chunk-330a7e95").then(n.bind(null,"975e"))}},{path:"/logs/ftp",name:"FtpLogs",component:function(){return n.e("chunk-3d13e56e").then(n.bind(null,"c5bf"))}},{path:"/rules/http",name:"HttpRules",component:function(){return Promise.all([n.e("chunk-08f9fbe8"),n.e("chunk-d4730ae2")]).then(n.bind(null,"9520c"))}},{path:"/rules/dns",name:"DnsRules",component:function(){return Promise.all([n.e("chunk-08f9fbe8"),n.e("chunk-0155152b")]).then(n.bind(null,"2e08"))}},{path:"/rules/mysql",name:"MysqlRules",component:function(){return Promise.all([n.e("chunk-08f9fbe8"),n.e("chunk-012c9c90")]).then(n.bind(null,"05cd"))}},{path:"/rules/rmi",name:"RmiRules",component:function(){return Promise.all([n.e("chunk-08f9fbe8"),n.e("chunk-e00d17cc")]).then(n.bind(null,"ac60"))}},{path:"/rules/ftp",name:"FtpRules",component:function(){return Promise.all([n.e("chunk-08f9fbe8"),n.e("chunk-2e835d68")]).then(n.bind(null,"f832"))}},{path:"/settings",name:"Settings",component:function(){return n.e("chunk-b241c712").then(n.bind(null,"ee09"))}}],M=new L["a"]({routes:I}),O=M;n("202f"),n("ed08");s["a"].config.productionTip=!1,s["a"].use(a["a"]);var E=s["a"].observable({authed:!0,pageSize:localStorage.getItem("pageSize")?parseInt(localStorage.getItem("pageSize")):10});new s["a"]({router:O,render:function(e){return e(x)}}).$mount("#app")},"87fd":function(e,t,n){},"912e":function(e,t,n){"use strict";n("e805")},ced3:function(e,t,n){"use strict";n("87fd")},e805:function(e,t,n){},ed08:function(e,t,n){n("5319"),n("ac1f"),n("4d63"),n("25f0"),Date.prototype.format=function(e){var t={"M+":this.getMonth()+1,"d+":this.getDate(),"h+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),S:this.getMilliseconds()};for(var n in/(y+)/.test(e)&&(e=e.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length))),t)new RegExp("("+n+")").test(e)&&(e=e.replace(RegExp.$1,1==RegExp.$1.length?t[n]:("00"+t[n]).substr((""+t[n]).length)));return e}}}); \ No newline at end of file +(function(e){function t(t){for(var s,a,i=t[0],c=t[1],u=t[2],l=0,f=[];l=200&&e<300}});t["a"]=r},4678:function(e,t,n){var s={"./af":"2bfb","./af.js":"2bfb","./ar":"8e73","./ar-dz":"a356","./ar-dz.js":"a356","./ar-kw":"423e","./ar-kw.js":"423e","./ar-ly":"1cfd","./ar-ly.js":"1cfd","./ar-ma":"0a84","./ar-ma.js":"0a84","./ar-sa":"8230","./ar-sa.js":"8230","./ar-tn":"6d83","./ar-tn.js":"6d83","./ar.js":"8e73","./az":"485c","./az.js":"485c","./be":"1fc1","./be.js":"1fc1","./bg":"84aa","./bg.js":"84aa","./bm":"a7fa","./bm.js":"a7fa","./bn":"9043","./bn-bd":"9686","./bn-bd.js":"9686","./bn.js":"9043","./bo":"d26a","./bo.js":"d26a","./br":"6887","./br.js":"6887","./bs":"2554","./bs.js":"2554","./ca":"d716","./ca.js":"d716","./cs":"3c0d","./cs.js":"3c0d","./cv":"03ec","./cv.js":"03ec","./cy":"9797","./cy.js":"9797","./da":"0f14","./da.js":"0f14","./de":"b469","./de-at":"b3eb","./de-at.js":"b3eb","./de-ch":"bb71","./de-ch.js":"bb71","./de.js":"b469","./dv":"598a","./dv.js":"598a","./el":"8d47","./el.js":"8d47","./en-au":"0e6b","./en-au.js":"0e6b","./en-ca":"3886","./en-ca.js":"3886","./en-gb":"39a6","./en-gb.js":"39a6","./en-ie":"e1d3","./en-ie.js":"e1d3","./en-il":"7333","./en-il.js":"7333","./en-in":"ec2e","./en-in.js":"ec2e","./en-nz":"6f50","./en-nz.js":"6f50","./en-sg":"b7e9","./en-sg.js":"b7e9","./eo":"65db","./eo.js":"65db","./es":"898b","./es-do":"0a3c","./es-do.js":"0a3c","./es-mx":"b5b7","./es-mx.js":"b5b7","./es-us":"55c9","./es-us.js":"55c9","./es.js":"898b","./et":"ec18","./et.js":"ec18","./eu":"0ff2","./eu.js":"0ff2","./fa":"8df4","./fa.js":"8df4","./fi":"81e9","./fi.js":"81e9","./fil":"d69a","./fil.js":"d69a","./fo":"0721","./fo.js":"0721","./fr":"9f26","./fr-ca":"d9f8","./fr-ca.js":"d9f8","./fr-ch":"0e49","./fr-ch.js":"0e49","./fr.js":"9f26","./fy":"7118","./fy.js":"7118","./ga":"5120","./ga.js":"5120","./gd":"f6b4","./gd.js":"f6b4","./gl":"8840","./gl.js":"8840","./gom-deva":"aaf2","./gom-deva.js":"aaf2","./gom-latn":"0caa","./gom-latn.js":"0caa","./gu":"e0c5","./gu.js":"e0c5","./he":"c7aa","./he.js":"c7aa","./hi":"dc4d","./hi.js":"dc4d","./hr":"4ba9","./hr.js":"4ba9","./hu":"5b14","./hu.js":"5b14","./hy-am":"d6b6","./hy-am.js":"d6b6","./id":"5038","./id.js":"5038","./is":"0558","./is.js":"0558","./it":"6e98","./it-ch":"6f12","./it-ch.js":"6f12","./it.js":"6e98","./ja":"079e","./ja.js":"079e","./jv":"b540","./jv.js":"b540","./ka":"201b","./ka.js":"201b","./kk":"6d79","./kk.js":"6d79","./km":"e81d","./km.js":"e81d","./kn":"3e92","./kn.js":"3e92","./ko":"22f8","./ko.js":"22f8","./ku":"2421","./ku.js":"2421","./ky":"9609","./ky.js":"9609","./lb":"440c","./lb.js":"440c","./lo":"b29d","./lo.js":"b29d","./lt":"26f9","./lt.js":"26f9","./lv":"b97c","./lv.js":"b97c","./me":"293c","./me.js":"293c","./mi":"688b","./mi.js":"688b","./mk":"6909","./mk.js":"6909","./ml":"02fb","./ml.js":"02fb","./mn":"958b","./mn.js":"958b","./mr":"39bd","./mr.js":"39bd","./ms":"ebe4","./ms-my":"6403","./ms-my.js":"6403","./ms.js":"ebe4","./mt":"1b45","./mt.js":"1b45","./my":"8689","./my.js":"8689","./nb":"6ce3","./nb.js":"6ce3","./ne":"3a39","./ne.js":"3a39","./nl":"facd","./nl-be":"db29","./nl-be.js":"db29","./nl.js":"facd","./nn":"b84c","./nn.js":"b84c","./oc-lnc":"167b","./oc-lnc.js":"167b","./pa-in":"f3ff","./pa-in.js":"f3ff","./pl":"8d57","./pl.js":"8d57","./pt":"f260","./pt-br":"d2d4","./pt-br.js":"d2d4","./pt.js":"f260","./ro":"972c","./ro.js":"972c","./ru":"957c","./ru.js":"957c","./sd":"6784","./sd.js":"6784","./se":"ffff","./se.js":"ffff","./si":"eda5","./si.js":"eda5","./sk":"7be6","./sk.js":"7be6","./sl":"8155","./sl.js":"8155","./sq":"c8f3","./sq.js":"c8f3","./sr":"cf1e","./sr-cyrl":"13e9","./sr-cyrl.js":"13e9","./sr.js":"cf1e","./ss":"52bd","./ss.js":"52bd","./sv":"5fbd","./sv.js":"5fbd","./sw":"74dc","./sw.js":"74dc","./ta":"3de5","./ta.js":"3de5","./te":"5cbb","./te.js":"5cbb","./tet":"576c","./tet.js":"576c","./tg":"3b1b","./tg.js":"3b1b","./th":"10e8","./th.js":"10e8","./tk":"5aff","./tk.js":"5aff","./tl-ph":"0f38","./tl-ph.js":"0f38","./tlh":"cf75","./tlh.js":"cf75","./tr":"0e81","./tr.js":"0e81","./tzl":"cf51","./tzl.js":"cf51","./tzm":"c109","./tzm-latn":"b53d","./tzm-latn.js":"b53d","./tzm.js":"c109","./ug-cn":"6117","./ug-cn.js":"6117","./uk":"ada2","./uk.js":"ada2","./ur":"5294","./ur.js":"5294","./uz":"2e8c","./uz-latn":"010e","./uz-latn.js":"010e","./uz.js":"2e8c","./vi":"2921","./vi.js":"2921","./x-pseudo":"fd7e","./x-pseudo.js":"fd7e","./yo":"7f33","./yo.js":"7f33","./zh-cn":"5c3a","./zh-cn.js":"5c3a","./zh-hk":"49ab","./zh-hk.js":"49ab","./zh-mo":"3a6c","./zh-mo.js":"3a6c","./zh-tw":"90ea","./zh-tw.js":"90ea"};function a(e){var t=r(e);return n(t)}function r(e){if(!n.o(s,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return s[e]}a.keys=function(){return Object.keys(s)},a.resolve=r,e.exports=a,a.id="4678"},"56d7":function(e,t,n){"use strict";n.r(t),n.d(t,"store",(function(){return E}));n("e260"),n("e6cf"),n("cca6"),n("a79d");var s=n("a026"),a=n("f23d"),r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("a-layout",{attrs:{id:"nav"}},[n("a-layout-sider",{attrs:{trigger:null,collapsible:""},model:{value:e.collapsed,callback:function(t){e.collapsed=t},expression:"collapsed"}},[n("div",{staticClass:"logo"},[n("b",[e._v("R")]),e.collapsed?e._e():n("span",[n("b",[e._v("ev")]),e._v("Suit")])]),n("a-menu",{attrs:{theme:"dark",mode:"inline",selectedKeys:[this.$route.path],openKeys:e.openKeys},on:{"update:openKeys":function(t){e.openKeys=t},"update:open-keys":function(t){e.openKeys=t}}},[n("a-sub-menu",{key:"logs"},[n("span",{attrs:{slot:"title"},slot:"title"},[n("a-icon",{attrs:{type:"bar-chart"}}),n("span",[e._v("Logs")])],1),n("a-menu-item",{key:"/logs/http"},[n("router-link",{attrs:{to:"/logs/http"}},[e._v("HTTP Logs")])],1),n("a-menu-item",{key:"/logs/dns"},[n("router-link",{attrs:{to:"/logs/dns"}},[e._v("DNS Logs")])],1),n("a-menu-item",{key:"/logs/rmi"},[n("router-link",{attrs:{to:"/logs/rmi"}},[e._v("RMI Logs")])],1),n("a-menu-item",{key:"/logs/mysql"},[n("router-link",{attrs:{to:"/logs/mysql"}},[e._v("MySQL Logs")])],1),n("a-menu-item",{key:"/logs/ftp"},[n("router-link",{attrs:{to:"/logs/ftp"}},[e._v("FTP Logs")])],1)],1),n("a-sub-menu",{key:"rules"},[n("span",{attrs:{slot:"title"},slot:"title"},[n("rule-icon"),n("span",[e._v("Rules")])],1),n("a-menu-item",{key:"/rules/http"},[n("router-link",{attrs:{to:"/rules/http"}},[e._v("HTTP Rules")])],1),n("a-menu-item",{key:"/rules/dns"},[n("router-link",{attrs:{to:"/rules/dns"}},[e._v("DNS Rules")])],1),n("a-menu-item",{key:"/rules/rmi"},[n("router-link",{attrs:{to:"/rules/rmi"}},[e._v("RMI Rules")])],1),n("a-menu-item",{key:"/rules/mysql"},[n("router-link",{attrs:{to:"/rules/mysql"}},[e._v("MySQL Rules")])],1),n("a-menu-item",{key:"/rules/ftp"},[n("router-link",{attrs:{to:"/rules/ftp"}},[e._v("FTP Rules")])],1)],1),n("a-menu-item",{key:"/settings"},[n("router-link",{attrs:{to:"/settings"}},[n("a-icon",{attrs:{type:"setting"}}),n("span",[e._v("Settings")])],1)],1)],1)],1),n("a-layout",[n("a-layout-header",{staticStyle:{background:"#fff",padding:"0"}},[n("a-icon",{staticClass:"trigger",attrs:{type:e.collapsed?"menu-unfold":"menu-fold"},on:{click:function(){return e.collapsed=!e.collapsed}}}),e.isLogMode?n("div",{staticStyle:{float:"right","min-width":"60%",padding:"12px 0","line-height":"24px"}},[n("a-row",{attrs:{gutter:24,type:"flex"}},[n("a-col",{attrs:{span:21}},[n("a-form-model",{directives:[{name:"show",rawName:"v-show",value:e.showSettings,expression:"showSettings"}],ref:"settings",attrs:{layout:"inline"}},[n("a-row",{attrs:{gutter:24,type:"flex"}},[n("a-col",{attrs:{span:9,offset:2}},[n("a-form-model-item",{attrs:{label:"Auto Refresh"}},[n("a-switch",{attrs:{id:"auto-refresh"},model:{value:e.autoRefresh,callback:function(t){e.autoRefresh=t},expression:"autoRefresh"}})],1)],1),n("a-col",{attrs:{span:13}},[n("a-form-model-item",{attrs:{label:"Refresh Interval"}},[n("a-input-number",{staticStyle:{"margin-right":"-3rem"},attrs:{id:"refresh-interval",disabled:!e.autoRefresh},model:{value:e.refreshInterval,callback:function(t){e.refreshInterval=t},expression:"refreshInterval"}})],1)],1)],1)],1)],1),n("a-col",{attrs:{span:3}},[n("a-icon",{style:"font-size: 18px;padding: 12px 0;"+(e.showSettings?"color: #1b90ff;":""),attrs:{type:"setting"},on:{click:function(t){e.showSettings=!e.showSettings}}})],1)],1)],1):e._e()],1),n("a-layout-content",{style:{margin:"24px 16px",padding:"24px",borderRadius:"20px",background:"#fff",minHeight:"initial"}},[n("transition",{attrs:{name:"fade-transform"}},[n("router-view",{ref:"content"})],1)],1),n("div",{staticClass:"copyright"},[n("p",{},[e._v(" RevSuit Current Version: "+e._s(this.version)+" ©2021 "),n("a",{attrs:{href:"https://github.com/Li4n0"}},[e._v("Li4n0")]),e._v(". "),n("a",{attrs:{href:"https://github.com/Li4n0/revsuit"}},[e._v("GitHub")])])])],1),n("Auth")],1)},o=[],i=(n("caad"),n("2532"),n("1276"),n("ac1f"),n("d3b7"),n("25f0"),function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("a-modal",{attrs:{title:"Auth with token",visible:e.visible,"confirm-loading":e.confirmLoading},on:{cancel:e.cancel,ok:e.auth}},[n("a-input",{attrs:{placeholder:"Your token"},on:{pressEnter:e.auth},model:{value:e.token,callback:function(t){e.token=t},expression:"token"}})],1)],1)}),c=[],u=n("365c");function l(e){return Object(u["a"])({url:"/auth",method:"get",headers:{Token:e},validateStatus:function(e){return e>=200&&e<300}})}function f(){return Object(u["a"])({url:"/version",method:"get",validateStatus:function(e){return e>=200&&e<300}})}var d={data:function(){return{confirmLoading:!1,token:""}},computed:{visible:function(){return!E.authed}},methods:{auth:function(){var e=this;this.confirmLoading=!0,l(this.token).then((function(){E.authed=!0,e.confirmLoading=!1,e.token=""})).catch((function(t){403===t.response.status&&e.$notification.error({message:"Wrong token",description:"Your token is wrong, please check your server config file.",style:{width:"600px",marginLeft:"".concat(-265,"px")},duration:2.5}),e.confirmLoading=!1}))},cancel:function(){E.authed=!0}}},h=d,p=n("2877"),m=Object(p["a"])(h,i,c,!1,null,null,null),g=m.exports,b=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("a-icon",{attrs:{component:e.RuleSvg}})},j=[],v={template:'\n \n'},k={name:"RuleIcon",data:function(){return{RuleSvg:v}}},y=k,S=(n("912e"),Object(p["a"])(y,b,j,!1,null,"05a908c2",null)),w=S.exports,z={data:function(){return{store:E,autoRefresh:"true"===localStorage.getItem("autoRefresh"),refreshInterval:localStorage.getItem("refreshInterval")?localStorage.getItem("refreshInterval"):5,pageSize:E.pageSize,collapsed:!1,showSettings:!1,openKeys:[],version:""}},computed:{isLogMode:function(){return this.$route.path.includes("logs")}},methods:{timing:function(){var e=this;null!==this.timer&&clearInterval(this.timer),this.timer=setInterval((function(){e.$refs.content.fetch()}),1e3*this.refreshInterval)},GetVersion:function(){var e=this;f().then((function(t){e.version=t.data.result}))}},mounted:function(){this.autoRefresh&&this.isLogMode&&this.timing(),this.GetVersion()},created:function(){var e=this.$watch("$route",(function(t,n){"/"===n.path&&0===this.openKeys.length&&(this.openKeys.push(t.path.split("/")[1]),e())}))},destroyed:function(){clearInterval(this.timer)},watch:{autoRefresh:function(e){e?this.timing():clearInterval(this.timer),localStorage.setItem("autoRefresh",e)},isLogMode:function(e){e?this.timing():clearInterval(this.timer),localStorage.setItem("autoRefresh",e)},refreshInterval:function(e){clearInterval(this.timer),this.timing(),localStorage.setItem("refreshInterval",e)},pageSize:function(e){(e<=0||e>100)&&(e=10),E.pageSize=e,localStorage.setItem("pageSize",e)},"store.authed":function(){this.$refs.content.fetch()},"store.pageSize":function(){this.$refs.content.pagination.pageSize=E.pageSize,localStorage.setItem("pageSize",E.pageSize.toString()),this.$refs.content.fetch()}},components:{RuleIcon:w,Auth:g}},R=z,_=(n("1ad3"),Object(p["a"])(R,r,o,!1,null,"171364ce",null)),x=_.exports,L=(n("3ca3"),n("ddb0"),n("8c4f"));s["a"].use(L["a"]);var I=[{path:"/",name:"Home",redirect:"/logs/http"},{path:"/logs/http",name:"HttpLogs",component:function(){return n.e("chunk-1da7f23b").then(n.bind(null,"f889"))}},{path:"/logs/dns",name:"DnsLogs",component:function(){return n.e("chunk-e039e75a").then(n.bind(null,"5ea0"))}},{path:"/logs/mysql",name:"MysqlLogs",component:function(){return n.e("chunk-fef965c2").then(n.bind(null,"2e9f"))}},{path:"/logs/rmi",name:"RmiLogs",component:function(){return n.e("chunk-330a7e95").then(n.bind(null,"975e"))}},{path:"/logs/ftp",name:"FtpLogs",component:function(){return n.e("chunk-3d13e56e").then(n.bind(null,"c5bf"))}},{path:"/rules/http",name:"HttpRules",component:function(){return Promise.all([n.e("chunk-08f9fbe8"),n.e("chunk-d4730ae2")]).then(n.bind(null,"9520c"))}},{path:"/rules/dns",name:"DnsRules",component:function(){return Promise.all([n.e("chunk-08f9fbe8"),n.e("chunk-0155152b")]).then(n.bind(null,"2e08"))}},{path:"/rules/mysql",name:"MysqlRules",component:function(){return Promise.all([n.e("chunk-08f9fbe8"),n.e("chunk-5840ae94")]).then(n.bind(null,"05cd"))}},{path:"/rules/rmi",name:"RmiRules",component:function(){return Promise.all([n.e("chunk-08f9fbe8"),n.e("chunk-e00d17cc")]).then(n.bind(null,"ac60"))}},{path:"/rules/ftp",name:"FtpRules",component:function(){return Promise.all([n.e("chunk-08f9fbe8"),n.e("chunk-2e835d68")]).then(n.bind(null,"f832"))}},{path:"/settings",name:"Settings",component:function(){return n.e("chunk-b241c712").then(n.bind(null,"ee09"))}}],M=new L["a"]({routes:I}),O=M;n("202f"),n("ed08");s["a"].config.productionTip=!1,s["a"].use(a["a"]);var E=s["a"].observable({authed:!0,pageSize:localStorage.getItem("pageSize")?parseInt(localStorage.getItem("pageSize")):10});new s["a"]({router:O,render:function(e){return e(x)}}).$mount("#app")},7674:function(e,t,n){},"912e":function(e,t,n){"use strict";n("e805")},e805:function(e,t,n){},ed08:function(e,t,n){n("5319"),n("ac1f"),n("4d63"),n("25f0"),Date.prototype.format=function(e){var t={"M+":this.getMonth()+1,"d+":this.getDate(),"h+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),S:this.getMilliseconds()};for(var n in/(y+)/.test(e)&&(e=e.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length))),t)new RegExp("("+n+")").test(e)&&(e=e.replace(RegExp.$1,1==RegExp.$1.length?t[n]:("00"+t[n]).substr((""+t[n]).length)));return e}}}); \ No newline at end of file diff --git a/frontend/dist/js/chunk-012c9c90.js b/frontend/dist/js/chunk-012c9c90.js deleted file mode 100644 index f092b75..0000000 --- a/frontend/dist/js/chunk-012c9c90.js +++ /dev/null @@ -1 +0,0 @@ -(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-012c9c90"],{"05cd":function(e,t,a){"use strict";a.r(t);var o=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("a-button",{attrs:{id:"add-rule",type:"primary"},on:{click:e.addRule}},[a("a-icon",{attrs:{type:"plus"}}),e._v(" New Rule ")],1),a("a-drawer",{attrs:{title:e.formAction+" MySQL rule",width:490,visible:e.formVisible,"body-style":{paddingBottom:"80px"}},on:{close:e.closeDrawer}},[a("a-form-model",{ref:"form",attrs:{model:e.form,layout:"vertical"},on:{submit:e.handleSubmit}},[a("BasicRule",{attrs:{form:e.form,readOnly:e.formReadOnly}}),a("a-row",{attrs:{gutter:24}},[a("a-col",{attrs:{span:24}},[a("a-form-model-item",{attrs:{label:"Files",rules:e.rules.files}},[a("a-input",{staticStyle:{width:"100%"},attrs:{placeholder:"please enter file name,use ';' to split multiple file names",readOnly:e.formReadOnly,disabled:e.form.exploit_jdbc_client},model:{value:e.form.files,callback:function(t){e.$set(e.form,"files",t)},expression:"form.files"}})],1)],1)],1),a("a-row",[a("a-form-model-item",[a("div",{staticClass:"ant-form-item-label"},[a("label",{attrs:{for:"exploit-jdbc-client"}},[e._v("Exploit Jdbc Client "),a("a-tooltip",{attrs:{placement:"topLeft",title:"Whether test to exploit jdbc client."}},[a("a-icon",{attrs:{type:"question-circle"}})],1)],1)]),a("a-switch",{attrs:{id:"exploit-jdbc-client",disabled:e.formReadOnly},model:{value:e.form.exploit_jdbc_client,callback:function(t){e.$set(e.form,"exploit_jdbc_client",t)},expression:"form.exploit_jdbc_client"}})],1)],1),a("a-row",{attrs:{gutter:24}},[a("a-col",{attrs:{span:24}},[a("a-form-model-item",{attrs:{label:"Payload"}},e._l(e.payloadKeys,(function(t){return a("a-input-group",{key:t,attrs:{compact:""}},[a("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["Key-"+t],expression:"['Key-'+payloadKey,]"}],staticStyle:{width:"47%","margin-bottom":"5px"},attrs:{defaultOpen:!1,placeholder:"Key",disabled:!e.form.exploit_jdbc_client,readOnly:e.formReadOnly},model:{value:e.form["Key-"+t],callback:function(a){e.$set(e.form,"Key-"+t,a)},expression:"form['Key-'+payloadKey]"}}),a("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["Value-"+t],expression:"['Value-'+payloadKey,]"}],staticStyle:{width:"53%"},attrs:{placeholder:"Base64 encoded payload Value",disabled:!e.form.exploit_jdbc_client,readOnly:e.formReadOnly},on:{focus:function(){!e.formReadOnly&&t===e.payloadKeys[e.payloadKeys.length-1]&&e.form["Key-"+t]&&e.addPayload()}},model:{value:e.form["Value-"+t],callback:function(a){e.$set(e.form,"Value-"+t,a)},expression:"form['Value-'+payloadKey]"}},[a("a-icon",{staticClass:"dynamic-delete-button",attrs:{slot:"addonAfter",type:"minus-circle-o"},on:{click:function(){return e.form.exploit_jdbc_client?e.removePayload(t):null}},slot:"addonAfter"})],1)],1)})),1)],1)],1)],1),a("div",{style:{position:"absolute",right:0,bottom:0,width:"100%",borderTop:"1px solid #e9e9e9",padding:"10px 16px",background:"#fff",textAlign:"right",zIndex:1}},[a("a-button",{style:{marginRight:"8px"},on:{click:e.handleCancel}},[e._v(" Cancel ")]),a("a-button",{attrs:{type:"primary",disabled:e.formReadOnly},on:{click:e.handleSubmit}},[e._v(" Submit ")])],1)],1),a("a-table",{attrs:{columns:e.columns,"data-source":e.data,loading:e.loading,pagination:e.pagination},on:{change:e.handleTableChange},scopedSlots:e._u([{key:"filterDropdown",fn:function(t){var o=t.setSelectedKeys,n=t.selectedKeys,i=(t.clearFilters,t.column);return a("div",{staticStyle:{padding:"8px"}},[a("a-input",{staticStyle:{width:"188px","margin-bottom":"8px",display:"block"},attrs:{placeholder:"Search "+i.dataIndex,value:n[0]},on:{change:function(e){return o(e.target.value?[e.target.value]:[])},pressEnter:function(){e.filters[i.dataIndex]=n[0],e.fetch()}}}),a("a-button",{staticStyle:{width:"90px","margin-right":"8px"},attrs:{type:"primary",icon:"search",size:"small"},on:{click:function(){e.filters[i.dataIndex]=n[0],e.fetch()}}},[e._v(" Search ")])],1)}},{key:"filterIcon",fn:function(e){return a("a-icon",{style:{color:e?"#108ee9":void 0},attrs:{type:"search"}})}},{key:"rank",fn:function(t){return a("span",{},[a("a-tag",{attrs:{color:"#"+(2996213+80*t).toString(16)}},[e._v(" "+e._s(t)+" ")])],1)}},{key:"switchRender",fn:function(t,o,n,i){return a("span",{},[a("a-switch",{attrs:{checked:t},on:{click:function(t){return e.clickSwitch(o,i.dataIndex)}}})],1)}},{key:"action",fn:function(t,o,n){return a("span",{},[a("a-button",{staticStyle:{color:"#67C23A","background-color":"transparent","border-color":"#67C23A","text-shadow":"none",margin:"0 10px 3px 0"},attrs:{size:"small",ghost:""},on:{click:function(t){return e.viewRule(o)}}},[e._v("View")]),a("a-button",{staticStyle:{color:"#909399","background-color":"transparent","border-color":"#909399","text-shadow":"none",margin:"0 10px 3px 0"},attrs:{size:"small",ghost:""},on:{click:function(t){return e.editRule(o,n)}}},[e._v("Edit")]),a("a-popconfirm",{attrs:{title:"Are you sure delete this task?","ok-text":"Yes","cancel-text":"No"},on:{confirm:function(t){return e.deleteRule(o,n)}}},[a("a-button",{attrs:{type:"danger",size:"small",ghost:""}},[e._v("Delete")])],1)],1)}}])})],1)},n=[],i=a("5530"),r=(a("a434"),a("34c6")),s=a("56d7"),l=a("2084"),c="View",d="Edit",f="Create",u=[{title:"ID",dataIndex:"id",key:"id",sorter:!0,sortDirections:["descend","ascend"]},{title:"NAME",dataIndex:"name",key:"name",scopedSlots:{filterDropdown:"filterDropdown",filterIcon:"filterIcon"}},{title:"FLAG FORMAT",dataIndex:"flag_format",key:"flag_format",ellipsis:!0},{title:"RANK",dataIndex:"rank",key:"rank",scopedSlots:{customRender:"rank"}},{title:"FILES",dataIndex:"files",key:"files",ellipsis:!0},{title:"PUSH TO CLIENT",dataIndex:"push_to_client",key:"push_to_client",scopedSlots:{customRender:"switchRender"}},{title:"NOTICE",dataIndex:"notice",key:"notice",scopedSlots:{customRender:"switchRender"}},{title:"Action",key:"action",scopedSlots:{customRender:"action"}}],p={files:[{required:!1,message:"please enter file name"}]},m={name:"MysqlRules",data:function(){return{store:s["store"],data:[],formVisible:!1,pagination:{current:1,showSizeChanger:!0,pageSize:s["store"].pageSize,onShowSizeChange:function(e,t){s["store"].pageSize=t}},filters:{},loading:!1,columns:u,form:{},rules:p,payloadKeys:[1],formReadOnly:!1,formAction:""}},methods:{handleTableChange:function(e,t,a){var o=Object(i["a"])({},this.pagination);o.current=e.current,this.pagination=o,this.order="ascend"===a.order?"asc":"desc",this.fetch()},fetch:function(){var e=this,t=Object(i["a"])(Object(i["a"])({},this.filters),{},{page:this.pagination.current,pageSize:this.pagination.pageSize,order:this.order});this.loading=!0,Object(r["i"])(t).then((function(t){var a=t.data.result;e.data=a.data;var o=Object(i["a"])({},e.pagination);o.total=a.count,e.pagination=o,e.loading=!1})).catch((function(t){if(403===t.response.status)return s["store"].authed=!1,[];e.$notification.error({message:"Unknown error: "+t.response.status,style:{width:"100px",marginLeft:"".concat(-265,"px")},duration:4})}))},clickSwitch:function(e,t){var a=this;e[t]=!e[t],Object(r["n"])(e).then().catch((function(e){a.$notification.error({message:"Edit failed",description:e.response.data.error,style:{width:"600px",marginLeft:"".concat(-265,"px")},duration:4})}))},addRule:function(){this.form={},this.showForm(f)},viewRule:function(e){this.form=e,this.showForm(c)},editRule:function(e){this.form=JSON.parse(JSON.stringify(e)),this.showForm(d)},deleteRule:function(e,t){var a=this;Object(r["d"])(e).then((function(){a.data.splice(t,1)})).catch((function(e){a.$notification.error({message:"Error",description:e.response.data.error,style:{width:"600px",marginLeft:"".concat(-265,"px")},duration:4})}))},showForm:function(e){for(var t in this.formAction=e,this.formReadOnly=e===c,this.formVisible=!0,this.form.payloads)this.form["Key-"+this.payloadKeys.length]=t,this.form["Value-"+this.payloadKeys.length]=this.form.payloads[t],this.addPayload();this.formReadOnly&&this.removePayload(this.payloadKeys.length)},closeDrawer:function(){this.formVisible=!1,this.payloadKeys=[1]},addPayload:function(){this.payloadKeys.push(this.payloadKeys[this.payloadKeys.length-1]+1)},removePayload:function(e){this.payloadKeys.length>1&&this.payloadKeys.splice(this.payloadKeys.indexOf(e),1)},handleSubmit:function(){var e=this;this.$refs.form.validate((function(t){if(t){var a={},o={};for(var n in e.form)if(0===n.indexOf("Key-")){var i=n.substr("Key-".length);e.form["Value-"+i]&&(a[e.form[n]]=e.form["Value-"+i])}else-1===n.indexOf("Value-")&&(o[n]=e.form[n]);o.payloads=a,Object(r["n"])(o).then((function(){e.closeDrawer(),e.fetch({page:e.pagination.current}),e.$notification.info({message:"Success",style:{width:"600px",marginLeft:"".concat(-265,"px")},duration:2.5})})).catch((function(t){e.$notification.error({message:e.formAction+" failed",description:t.response.data.error,style:{width:"600px",marginLeft:"".concat(-265,"px")},duration:4})}))}}))},handleCancel:function(){this.form={},this.closeDrawer()}},mounted:function(){this.fetch({page:"1"})},components:{BasicRule:l["a"]}},h=m,y=(a("dd68"),a("2877")),g=Object(y["a"])(h,o,n,!1,null,"e8e0136c",null);t["default"]=g.exports},"446e":function(e,t,a){},dd68:function(e,t,a){"use strict";a("446e")}}]); \ No newline at end of file diff --git a/frontend/dist/js/chunk-08f9fbe8.js b/frontend/dist/js/chunk-08f9fbe8.js index 6f20d6a..2944748 100644 --- a/frontend/dist/js/chunk-08f9fbe8.js +++ b/frontend/dist/js/chunk-08f9fbe8.js @@ -1 +1 @@ -(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-08f9fbe8"],{"057f":function(t,e,r){var n=r("fc6a"),o=r("241c").f,a={}.toString,i="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],u=function(t){try{return o(t)}catch(e){return i.slice()}};t.exports.f=function(t){return i&&"[object Window]"==a.call(t)?u(t):o(n(t))}},"159b":function(t,e,r){var n=r("da84"),o=r("fdbc"),a=r("17c2"),i=r("9112");for(var u in o){var c=n[u],f=c&&c.prototype;if(f&&f.forEach!==a)try{i(f,"forEach",a)}catch(s){f.forEach=a}}},"17c2":function(t,e,r){"use strict";var n=r("b727").forEach,o=r("a640"),a=o("forEach");t.exports=a?[].forEach:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}},"1dde":function(t,e,r){var n=r("d039"),o=r("b622"),a=r("2d00"),i=o("species");t.exports=function(t){return a>=51||!n((function(){var e=[],r=e.constructor={};return r[i]=function(){return{foo:1}},1!==e[t](Boolean).foo}))}},2084:function(t,e,r){"use strict";var n=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",[r("a-row",{attrs:{gutter:24}},[r("a-col",{attrs:{span:24}},[r("a-form-model-item",{attrs:{label:"Name",rules:t.rules.name,prop:"name"}},[r("a-input",{attrs:{placeholder:"Please enter rule name",readOnly:t.readOnly},model:{value:t.form.name,callback:function(e){t.$set(t.form,"name",e)},expression:"form.name"}})],1)],1)],1),r("a-row",{attrs:{gutter:24}},[r("a-col",{attrs:{span:24}},[r("a-form-model-item",{attrs:{rules:t.rules.flagFormat,prop:"flag_format"}},[r("span",{attrs:{slot:"label"},slot:"label"},[t._v(" Flag Format "),r("a-tooltip",{attrs:{title:"Basic usage:\n 1. Only when the request contains content that satisfies the flag format, the request will be captured.\n 2. Use regular expression syntax.\n 3. The character '*' means to capture all requests.\n Advanced usage:\n 1. When the regex uses grouping without group name, the platform will only notify the user or push to the client when the first group appears for the first time.\n 2. When the regex uses grouping with group name, you can get these submatches through template variables and use them in other fields of the rule."}},[r("a-icon",{attrs:{type:"question-circle-o"}})],1)],1),r("a-input",{staticStyle:{width:"100%"},attrs:{placeholder:"please enter flag format",readOnly:t.readOnly},model:{value:t.form.flag_format,callback:function(e){t.$set(t.form,"flag_format",e)},expression:"form.flag_format"}})],1)],1)],1),r("a-row",{attrs:{gutter:24}},[r("a-col",{attrs:{span:24}},[r("a-form-model-item",{attrs:{prop:"rank"}},[r("span",{attrs:{slot:"label"},slot:"label"},[t._v(" Rank "),r("a-tooltip",{attrs:{title:"When request match multiple rules, high-rank rules will be matched first"}},[r("a-icon",{attrs:{type:"question-circle-o"}})],1)],1),r("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["rank"],expression:"['rank']"}],staticStyle:{width:"100%"},attrs:{disabled:t.readOnly,placeholder:"0"},model:{value:t.form.rank,callback:function(e){t.$set(t.form,"rank",e)},expression:"form.rank"}})],1)],1)],1),r("a-row",{attrs:{gutter:16}},[r("a-col",{attrs:{span:12}},[r("a-form-model-item",[r("div",{staticClass:"ant-form-item-label"},[r("label",{attrs:{for:"push-to-client"}},[t._v("Push to Client "),r("a-tooltip",{attrs:{placement:"topLeft",title:"Whether push to client when capture flag with this rule."}},[r("a-icon",{attrs:{type:"question-circle"}})],1)],1)]),r("a-switch",{attrs:{id:"push-to-client",disabled:t.readOnly},model:{value:t.form.push_to_client,callback:function(e){t.$set(t.form,"push_to_client",e)},expression:"form.push_to_client"}})],1)],1),r("a-col",{attrs:{span:12}},[r("a-form-model-item",[r("div",{staticClass:"ant-form-item-label"},[r("label",{attrs:{for:"notice"}},[t._v("Notice "),r("a-tooltip",{attrs:{placement:"topLeft",title:"Whether notice with bot when capture flag with this rule."}},[r("a-icon",{attrs:{type:"question-circle"}})],1)],1)]),r("a-switch",{attrs:{id:"notice",disabled:t.readOnly},model:{value:t.form.notice,callback:function(e){t.$set(t.form,"notice",e)},expression:"form.notice"}})],1)],1)],1)],1)},o=[],a={name:"BasicRule",data:function(){return{rules:{name:[{required:!0,message:"Please input rule name",trigger:"blur"}],flagFormat:[{required:!0,message:"Please input flag format",trigger:"blur"}]}}},props:["form","readOnly"]},i=a,u=r("2877"),c=Object(u["a"])(i,n,o,!1,null,"2c1e0389",null);e["a"]=c.exports},"34c6":function(t,e,r){"use strict";r.d(e,"h",(function(){return o})),r.d(e,"m",(function(){return a})),r.d(e,"c",(function(){return i})),r.d(e,"f",(function(){return u})),r.d(e,"k",(function(){return c})),r.d(e,"a",(function(){return f})),r.d(e,"i",(function(){return s})),r.d(e,"n",(function(){return l})),r.d(e,"d",(function(){return d})),r.d(e,"j",(function(){return p})),r.d(e,"o",(function(){return h})),r.d(e,"e",(function(){return m})),r.d(e,"g",(function(){return b})),r.d(e,"l",(function(){return g})),r.d(e,"b",(function(){return y}));var n=r("365c");function o(t){return Object(n["a"])({url:"/rule/http",params:t,method:"get"})}function a(t){return Object(n["a"])({url:"/rule/http",data:t,method:"post"})}function i(t){return Object(n["a"])({url:"/rule/http",data:t,method:"delete"})}function u(t){return Object(n["a"])({url:"/rule/dns",params:t,method:"get"})}function c(t){return Object(n["a"])({url:"/rule/dns",data:t,method:"post"})}function f(t){return Object(n["a"])({url:"/rule/dns",data:t,method:"delete"})}function s(t){return Object(n["a"])({url:"/rule/mysql",params:t,method:"get"})}function l(t){return Object(n["a"])({url:"/rule/mysql",data:t,method:"post"})}function d(t){return Object(n["a"])({url:"/rule/mysql",data:t,method:"delete"})}function p(t){return Object(n["a"])({url:"/rule/rmi",params:t,method:"get"})}function h(t){return Object(n["a"])({url:"/rule/rmi",data:t,method:"post"})}function m(t){return Object(n["a"])({url:"/rule/rmi",data:t,method:"delete"})}function b(t){return Object(n["a"])({url:"/rule/ftp",params:t,method:"get"})}function g(t){return Object(n["a"])({url:"/rule/ftp",data:t,method:"post"})}function y(t){return Object(n["a"])({url:"/rule/ftp",data:t,method:"delete"})}},"4de4":function(t,e,r){"use strict";var n=r("23e7"),o=r("b727").filter,a=r("1dde"),i=a("filter");n({target:"Array",proto:!0,forced:!i},{filter:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}})},5530:function(t,e,r){"use strict";r.d(e,"a",(function(){return a}));r("b64b"),r("a4d3"),r("4de4"),r("e439"),r("159b"),r("dbb4");function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function a(t){for(var e=1;eh)throw TypeError(m);for(s=c(y,n),l=0;lv-n+r;l--)delete y[l-1]}else if(r>n)for(l=v-n;l>O;l--)b=l+n-1,g=l+r-1,b in y?y[g]=y[b]:delete y[g];for(l=0;la)o.push(arguments[a++]);if(n=e,(p(e)||void 0!==t)&&!ut(t))return d(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!ut(e))return e}),o[1]=e,G.apply(null,o)}})}z[I][L]||_(z[I],L,z[I].valueOf),C(z,M),N[B]=!0},a640:function(t,e,r){"use strict";var n=r("d039");t.exports=function(t,e){var r=[][t];return!!r&&n((function(){r.call(null,e||function(){throw 1},1)}))}},b64b:function(t,e,r){var n=r("23e7"),o=r("7b0b"),a=r("df75"),i=r("d039"),u=i((function(){a(1)}));n({target:"Object",stat:!0,forced:u},{keys:function(t){return a(o(t))}})},b727:function(t,e,r){var n=r("0366"),o=r("44ad"),a=r("7b0b"),i=r("50c4"),u=r("65f0"),c=[].push,f=function(t){var e=1==t,r=2==t,f=3==t,s=4==t,l=6==t,d=7==t,p=5==t||l;return function(h,m,b,g){for(var y,v,O=a(h),w=o(O),j=n(m,b,3),x=i(w.length),P=0,k=g||u,S=e?k(h,x):r||d?k(h,0):void 0;x>P;P++)if((p||P in w)&&(y=w[P],v=j(y,P,O),t))if(e)S[P]=v;else if(v)switch(t){case 3:return!0;case 5:return y;case 6:return P;case 2:c.call(S,y)}else switch(t){case 4:return!1;case 7:c.call(S,y)}return l?-1:f||s?s:S}};t.exports={forEach:f(0),map:f(1),filter:f(2),some:f(3),every:f(4),find:f(5),findIndex:f(6),filterOut:f(7)}},dbb4:function(t,e,r){var n=r("23e7"),o=r("83ab"),a=r("56ef"),i=r("fc6a"),u=r("06cf"),c=r("8418");n({target:"Object",stat:!0,sham:!o},{getOwnPropertyDescriptors:function(t){var e,r,n=i(t),o=u.f,f=a(n),s={},l=0;while(f.length>l)r=o(n,e=f[l++]),void 0!==r&&c(s,e,r);return s}})},e439:function(t,e,r){var n=r("23e7"),o=r("d039"),a=r("fc6a"),i=r("06cf").f,u=r("83ab"),c=o((function(){i(1)})),f=!u||c;n({target:"Object",stat:!0,forced:f,sham:!u},{getOwnPropertyDescriptor:function(t,e){return i(a(t),e)}})},e5383:function(t,e,r){var n=r("b622");e.f=n},e8b5:function(t,e,r){var n=r("c6b6");t.exports=Array.isArray||function(t){return"Array"==n(t)}}}]); \ No newline at end of file +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-08f9fbe8"],{"057f":function(t,e,r){var n=r("fc6a"),o=r("241c").f,a={}.toString,i="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],u=function(t){try{return o(t)}catch(e){return i.slice()}};t.exports.f=function(t){return i&&"[object Window]"==a.call(t)?u(t):o(n(t))}},"159b":function(t,e,r){var n=r("da84"),o=r("fdbc"),a=r("17c2"),i=r("9112");for(var u in o){var c=n[u],f=c&&c.prototype;if(f&&f.forEach!==a)try{i(f,"forEach",a)}catch(s){f.forEach=a}}},"17c2":function(t,e,r){"use strict";var n=r("b727").forEach,o=r("a640"),a=o("forEach");t.exports=a?[].forEach:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}},"1dde":function(t,e,r){var n=r("d039"),o=r("b622"),a=r("2d00"),i=o("species");t.exports=function(t){return a>=51||!n((function(){var e=[],r=e.constructor={};return r[i]=function(){return{foo:1}},1!==e[t](Boolean).foo}))}},2084:function(t,e,r){"use strict";var n=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",[r("a-row",{attrs:{gutter:24}},[r("a-col",{attrs:{span:24}},[r("a-form-model-item",{attrs:{label:"Name",rules:t.rules.name,prop:"name"}},[r("a-input",{attrs:{placeholder:"Please enter rule name",readOnly:t.readOnly},model:{value:t.form.name,callback:function(e){t.$set(t.form,"name",e)},expression:"form.name"}})],1)],1)],1),r("a-row",{attrs:{gutter:24}},[r("a-col",{attrs:{span:24}},[r("a-form-model-item",{attrs:{rules:t.rules.flagFormat,prop:"flag_format"}},[r("span",{attrs:{slot:"label"},slot:"label"},[t._v(" Flag Format "),r("a-tooltip",{attrs:{title:"Basic usage:\n 1. Only when the request's "+t.flagField+" contains content that satisfies the flag format, the request will be captured.\n 2. Use regular expression syntax.\n 3. The character '*' means to capture all requests.\n Advanced usage:\n 1. When the regex uses grouping without group name, the platform will only notify the user or push to the client when the first group appears for the first time.\n 2. When the regex uses grouping with group name, you can get these submatches through template variables and use them in other fields of the rule."}},[r("a-icon",{attrs:{type:"question-circle-o"}})],1)],1),r("a-input",{staticStyle:{width:"100%"},attrs:{placeholder:"please enter flag format",readOnly:t.readOnly},model:{value:t.form.flag_format,callback:function(e){t.$set(t.form,"flag_format",e)},expression:"form.flag_format"}})],1)],1)],1),r("a-row",{attrs:{gutter:24}},[r("a-col",{attrs:{span:24}},[r("a-form-model-item",{attrs:{prop:"rank"}},[r("span",{attrs:{slot:"label"},slot:"label"},[t._v(" Rank "),r("a-tooltip",{attrs:{title:"When request match multiple rules, high-rank rules will be matched first"}},[r("a-icon",{attrs:{type:"question-circle-o"}})],1)],1),r("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["rank"],expression:"['rank']"}],staticStyle:{width:"100%"},attrs:{disabled:t.readOnly,placeholder:"0"},model:{value:t.form.rank,callback:function(e){t.$set(t.form,"rank",e)},expression:"form.rank"}})],1)],1)],1),r("a-row",{attrs:{gutter:16}},[r("a-col",{attrs:{span:12}},[r("a-form-model-item",[r("div",{staticClass:"ant-form-item-label"},[r("label",{attrs:{for:"push-to-client"}},[t._v("Push to Client "),r("a-tooltip",{attrs:{placement:"topLeft",title:"Whether push to client when capture flag with this rule."}},[r("a-icon",{attrs:{type:"question-circle"}})],1)],1)]),r("a-switch",{attrs:{id:"push-to-client",disabled:t.readOnly},model:{value:t.form.push_to_client,callback:function(e){t.$set(t.form,"push_to_client",e)},expression:"form.push_to_client"}})],1)],1),r("a-col",{attrs:{span:12}},[r("a-form-model-item",[r("div",{staticClass:"ant-form-item-label"},[r("label",{attrs:{for:"notice"}},[t._v("Notice "),r("a-tooltip",{attrs:{placement:"topLeft",title:"Whether notice with bot when capture flag with this rule."}},[r("a-icon",{attrs:{type:"question-circle"}})],1)],1)]),r("a-switch",{attrs:{id:"notice",disabled:t.readOnly},model:{value:t.form.notice,callback:function(e){t.$set(t.form,"notice",e)},expression:"form.notice"}})],1)],1)],1)],1)},o=[],a={name:"BasicRule",data:function(){return{rules:{name:[{required:!0,message:"Please input rule name",trigger:"blur"}],flagFormat:[{required:!0,message:"Please input flag format",trigger:"blur"}]}}},props:["form","readOnly","flagField"]},i=a,u=r("2877"),c=Object(u["a"])(i,n,o,!1,null,"78ea39b6",null);e["a"]=c.exports},"34c6":function(t,e,r){"use strict";r.d(e,"h",(function(){return o})),r.d(e,"m",(function(){return a})),r.d(e,"c",(function(){return i})),r.d(e,"f",(function(){return u})),r.d(e,"k",(function(){return c})),r.d(e,"a",(function(){return f})),r.d(e,"i",(function(){return s})),r.d(e,"n",(function(){return l})),r.d(e,"d",(function(){return d})),r.d(e,"j",(function(){return p})),r.d(e,"o",(function(){return h})),r.d(e,"e",(function(){return m})),r.d(e,"g",(function(){return b})),r.d(e,"l",(function(){return g})),r.d(e,"b",(function(){return y}));var n=r("365c");function o(t){return Object(n["a"])({url:"/rule/http",params:t,method:"get"})}function a(t){return Object(n["a"])({url:"/rule/http",data:t,method:"post"})}function i(t){return Object(n["a"])({url:"/rule/http",data:t,method:"delete"})}function u(t){return Object(n["a"])({url:"/rule/dns",params:t,method:"get"})}function c(t){return Object(n["a"])({url:"/rule/dns",data:t,method:"post"})}function f(t){return Object(n["a"])({url:"/rule/dns",data:t,method:"delete"})}function s(t){return Object(n["a"])({url:"/rule/mysql",params:t,method:"get"})}function l(t){return Object(n["a"])({url:"/rule/mysql",data:t,method:"post"})}function d(t){return Object(n["a"])({url:"/rule/mysql",data:t,method:"delete"})}function p(t){return Object(n["a"])({url:"/rule/rmi",params:t,method:"get"})}function h(t){return Object(n["a"])({url:"/rule/rmi",data:t,method:"post"})}function m(t){return Object(n["a"])({url:"/rule/rmi",data:t,method:"delete"})}function b(t){return Object(n["a"])({url:"/rule/ftp",params:t,method:"get"})}function g(t){return Object(n["a"])({url:"/rule/ftp",data:t,method:"post"})}function y(t){return Object(n["a"])({url:"/rule/ftp",data:t,method:"delete"})}},"4de4":function(t,e,r){"use strict";var n=r("23e7"),o=r("b727").filter,a=r("1dde"),i=a("filter");n({target:"Array",proto:!0,forced:!i},{filter:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}})},5530:function(t,e,r){"use strict";r.d(e,"a",(function(){return a}));r("b64b"),r("a4d3"),r("4de4"),r("e439"),r("159b"),r("dbb4");function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function a(t){for(var e=1;eh)throw TypeError(m);for(s=c(y,n),l=0;lv-n+r;l--)delete y[l-1]}else if(r>n)for(l=v-n;l>O;l--)b=l+n-1,g=l+r-1,b in y?y[g]=y[b]:delete y[g];for(l=0;la)o.push(arguments[a++]);if(n=e,(p(e)||void 0!==t)&&!ut(t))return d(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!ut(e))return e}),o[1]=e,G.apply(null,o)}})}z[I][L]||_(z[I],L,z[I].valueOf),C(z,M),F[B]=!0},a640:function(t,e,r){"use strict";var n=r("d039");t.exports=function(t,e){var r=[][t];return!!r&&n((function(){r.call(null,e||function(){throw 1},1)}))}},b64b:function(t,e,r){var n=r("23e7"),o=r("7b0b"),a=r("df75"),i=r("d039"),u=i((function(){a(1)}));n({target:"Object",stat:!0,forced:u},{keys:function(t){return a(o(t))}})},b727:function(t,e,r){var n=r("0366"),o=r("44ad"),a=r("7b0b"),i=r("50c4"),u=r("65f0"),c=[].push,f=function(t){var e=1==t,r=2==t,f=3==t,s=4==t,l=6==t,d=7==t,p=5==t||l;return function(h,m,b,g){for(var y,v,O=a(h),w=o(O),j=n(m,b,3),x=i(w.length),P=0,k=g||u,S=e?k(h,x):r||d?k(h,0):void 0;x>P;P++)if((p||P in w)&&(y=w[P],v=j(y,P,O),t))if(e)S[P]=v;else if(v)switch(t){case 3:return!0;case 5:return y;case 6:return P;case 2:c.call(S,y)}else switch(t){case 4:return!1;case 7:c.call(S,y)}return l?-1:f||s?s:S}};t.exports={forEach:f(0),map:f(1),filter:f(2),some:f(3),every:f(4),find:f(5),findIndex:f(6),filterOut:f(7)}},dbb4:function(t,e,r){var n=r("23e7"),o=r("83ab"),a=r("56ef"),i=r("fc6a"),u=r("06cf"),c=r("8418");n({target:"Object",stat:!0,sham:!o},{getOwnPropertyDescriptors:function(t){var e,r,n=i(t),o=u.f,f=a(n),s={},l=0;while(f.length>l)r=o(n,e=f[l++]),void 0!==r&&c(s,e,r);return s}})},e439:function(t,e,r){var n=r("23e7"),o=r("d039"),a=r("fc6a"),i=r("06cf").f,u=r("83ab"),c=o((function(){i(1)})),f=!u||c;n({target:"Object",stat:!0,forced:f,sham:!u},{getOwnPropertyDescriptor:function(t,e){return i(a(t),e)}})},e5383:function(t,e,r){var n=r("b622");e.f=n},e8b5:function(t,e,r){var n=r("c6b6");t.exports=Array.isArray||function(t){return"Array"==n(t)}}}]); \ No newline at end of file diff --git a/frontend/dist/js/chunk-5840ae94.js b/frontend/dist/js/chunk-5840ae94.js new file mode 100644 index 0000000..399fcf3 --- /dev/null +++ b/frontend/dist/js/chunk-5840ae94.js @@ -0,0 +1 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5840ae94"],{"05cd":function(e,t,a){"use strict";a.r(t);var o=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("a-button",{attrs:{id:"add-rule",type:"primary"},on:{click:e.addRule}},[a("a-icon",{attrs:{type:"plus"}}),e._v(" New Rule ")],1),a("a-drawer",{attrs:{title:e.formAction+" MySQL rule",width:490,visible:e.formVisible,"body-style":{paddingBottom:"80px"}},on:{close:e.closeDrawer}},[a("a-form-model",{ref:"form",attrs:{model:e.form,layout:"vertical"},on:{submit:e.handleSubmit}},[a("BasicRule",{attrs:{form:e.form,readOnly:e.formReadOnly,flagField:"user or schema"}}),a("a-row",{attrs:{gutter:24}},[a("a-col",{attrs:{span:24}},[a("a-form-model-item",{attrs:{label:"Files",rules:e.rules.files}},[a("a-input",{staticStyle:{width:"100%"},attrs:{placeholder:"please enter file name,use ';' to split multiple file names",readOnly:e.formReadOnly,disabled:e.form.exploit_jdbc_client},model:{value:e.form.files,callback:function(t){e.$set(e.form,"files",t)},expression:"form.files"}})],1)],1)],1),a("a-row",[a("a-form-model-item",[a("div",{staticClass:"ant-form-item-label"},[a("label",{attrs:{for:"exploit-jdbc-client"}},[e._v("Exploit Jdbc Client "),a("a-tooltip",{attrs:{placement:"topLeft",title:"Whether test to exploit jdbc client."}},[a("a-icon",{attrs:{type:"question-circle"}})],1)],1)]),a("a-switch",{attrs:{id:"exploit-jdbc-client",disabled:e.formReadOnly},model:{value:e.form.exploit_jdbc_client,callback:function(t){e.$set(e.form,"exploit_jdbc_client",t)},expression:"form.exploit_jdbc_client"}})],1)],1),a("a-row",{attrs:{gutter:24}},[a("a-col",{attrs:{span:24}},[a("a-form-model-item",[a("label",{attrs:{for:"payload"}},[e._v("Payload "),a("a-tooltip",{attrs:{placement:"topLeft",title:"Need to set ${payload} variable by flag format first. Payload which key is same as ${payload} will be used."}},[a("a-icon",{attrs:{type:"question-circle"}})],1)],1),e._l(e.payloadKeys,(function(t){return a("a-input-group",{key:t,attrs:{id:"payload",compact:""}},[a("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["Key-"+t],expression:"['Key-'+payloadKey,]"}],staticStyle:{width:"47%","margin-bottom":"5px"},attrs:{defaultOpen:!1,placeholder:"Key",disabled:!e.form.exploit_jdbc_client,readOnly:e.formReadOnly},model:{value:e.form["Key-"+t],callback:function(a){e.$set(e.form,"Key-"+t,a)},expression:"form['Key-'+payloadKey]"}}),a("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["Value-"+t],expression:"['Value-'+payloadKey,]"}],staticStyle:{width:"53%"},attrs:{placeholder:"Base64 encoded payload Value",disabled:!e.form.exploit_jdbc_client,readOnly:e.formReadOnly},on:{focus:function(){!e.formReadOnly&&t===e.payloadKeys[e.payloadKeys.length-1]&&e.form["Key-"+t]&&e.addPayload()}},model:{value:e.form["Value-"+t],callback:function(a){e.$set(e.form,"Value-"+t,a)},expression:"form['Value-'+payloadKey]"}},[a("a-icon",{staticClass:"dynamic-delete-button",attrs:{slot:"addonAfter",type:"minus-circle-o"},on:{click:function(){return e.form.exploit_jdbc_client?e.removePayload(t):null}},slot:"addonAfter"})],1)],1)}))],2)],1)],1)],1),a("div",{style:{position:"absolute",right:0,bottom:0,width:"100%",borderTop:"1px solid #e9e9e9",padding:"10px 16px",background:"#fff",textAlign:"right",zIndex:1}},[a("a-button",{style:{marginRight:"8px"},on:{click:e.handleCancel}},[e._v(" Cancel ")]),a("a-button",{attrs:{type:"primary",disabled:e.formReadOnly},on:{click:e.handleSubmit}},[e._v(" Submit ")])],1)],1),a("a-table",{attrs:{columns:e.columns,"data-source":e.data,loading:e.loading,pagination:e.pagination},on:{change:e.handleTableChange},scopedSlots:e._u([{key:"filterDropdown",fn:function(t){var o=t.setSelectedKeys,i=t.selectedKeys,n=(t.clearFilters,t.column);return a("div",{staticStyle:{padding:"8px"}},[a("a-input",{staticStyle:{width:"188px","margin-bottom":"8px",display:"block"},attrs:{placeholder:"Search "+n.dataIndex,value:i[0]},on:{change:function(e){return o(e.target.value?[e.target.value]:[])},pressEnter:function(){e.filters[n.dataIndex]=i[0],e.fetch()}}}),a("a-button",{staticStyle:{width:"90px","margin-right":"8px"},attrs:{type:"primary",icon:"search",size:"small"},on:{click:function(){e.filters[n.dataIndex]=i[0],e.fetch()}}},[e._v(" Search ")])],1)}},{key:"filterIcon",fn:function(e){return a("a-icon",{style:{color:e?"#108ee9":void 0},attrs:{type:"search"}})}},{key:"rank",fn:function(t){return a("span",{},[a("a-tag",{attrs:{color:"#"+(2996213+80*t).toString(16)}},[e._v(" "+e._s(t)+" ")])],1)}},{key:"switchRender",fn:function(t,o,i,n){return a("span",{},[a("a-switch",{attrs:{checked:t},on:{click:function(t){return e.clickSwitch(o,n.dataIndex)}}})],1)}},{key:"action",fn:function(t,o,i){return a("span",{},[a("a-button",{staticStyle:{color:"#67C23A","background-color":"transparent","border-color":"#67C23A","text-shadow":"none",margin:"0 10px 3px 0"},attrs:{size:"small",ghost:""},on:{click:function(t){return e.viewRule(o)}}},[e._v("View")]),a("a-button",{staticStyle:{color:"#909399","background-color":"transparent","border-color":"#909399","text-shadow":"none",margin:"0 10px 3px 0"},attrs:{size:"small",ghost:""},on:{click:function(t){return e.editRule(o,i)}}},[e._v("Edit")]),a("a-popconfirm",{attrs:{title:"Are you sure delete this task?","ok-text":"Yes","cancel-text":"No"},on:{confirm:function(t){return e.deleteRule(o,i)}}},[a("a-button",{attrs:{type:"danger",size:"small",ghost:""}},[e._v("Delete")])],1)],1)}}])})],1)},i=[],n=a("5530"),r=(a("a434"),a("34c6")),l=a("56d7"),s=a("2084"),c="View",d="Edit",f="Create",u=[{title:"ID",dataIndex:"id",key:"id",sorter:!0,sortDirections:["descend","ascend"]},{title:"NAME",dataIndex:"name",key:"name",scopedSlots:{filterDropdown:"filterDropdown",filterIcon:"filterIcon"}},{title:"FLAG FORMAT",dataIndex:"flag_format",key:"flag_format",ellipsis:!0},{title:"RANK",dataIndex:"rank",key:"rank",scopedSlots:{customRender:"rank"}},{title:"FILES",dataIndex:"files",key:"files",ellipsis:!0},{title:"PUSH TO CLIENT",dataIndex:"push_to_client",key:"push_to_client",scopedSlots:{customRender:"switchRender"}},{title:"NOTICE",dataIndex:"notice",key:"notice",scopedSlots:{customRender:"switchRender"}},{title:"Action",key:"action",scopedSlots:{customRender:"action"}}],p={files:[{required:!1,message:"please enter file name"}]},m={name:"MysqlRules",data:function(){return{store:l["store"],data:[],formVisible:!1,pagination:{current:1,showSizeChanger:!0,pageSize:l["store"].pageSize,onShowSizeChange:function(e,t){l["store"].pageSize=t}},filters:{},loading:!1,columns:u,form:{},rules:p,payloadKeys:[1],formReadOnly:!1,formAction:""}},methods:{handleTableChange:function(e,t,a){var o=Object(n["a"])({},this.pagination);o.current=e.current,this.pagination=o,this.order="ascend"===a.order?"asc":"desc",this.fetch()},fetch:function(){var e=this,t=Object(n["a"])(Object(n["a"])({},this.filters),{},{page:this.pagination.current,pageSize:this.pagination.pageSize,order:this.order});this.loading=!0,Object(r["i"])(t).then((function(t){var a=t.data.result;e.data=a.data;var o=Object(n["a"])({},e.pagination);o.total=a.count,e.pagination=o,e.loading=!1})).catch((function(t){if(403===t.response.status)return l["store"].authed=!1,[];e.$notification.error({message:"Unknown error: "+t.response.status,style:{width:"100px",marginLeft:"".concat(-265,"px")},duration:4})}))},clickSwitch:function(e,t){var a=this;e[t]=!e[t],Object(r["n"])(e).then().catch((function(e){a.$notification.error({message:"Edit failed",description:e.response.data.error,style:{width:"600px",marginLeft:"".concat(-265,"px")},duration:4})}))},addRule:function(){this.form={},this.showForm(f)},viewRule:function(e){this.form=e,this.showForm(c)},editRule:function(e){this.form=JSON.parse(JSON.stringify(e)),this.showForm(d)},deleteRule:function(e,t){var a=this;Object(r["d"])(e).then((function(){a.data.splice(t,1)})).catch((function(e){a.$notification.error({message:"Error",description:e.response.data.error,style:{width:"600px",marginLeft:"".concat(-265,"px")},duration:4})}))},showForm:function(e){for(var t in this.formAction=e,this.formReadOnly=e===c,this.formVisible=!0,this.form.payloads)this.form["Key-"+this.payloadKeys.length]=t,this.form["Value-"+this.payloadKeys.length]=this.form.payloads[t],this.addPayload();this.formReadOnly&&this.removePayload(this.payloadKeys.length)},closeDrawer:function(){this.formVisible=!1,this.payloadKeys=[1]},addPayload:function(){this.payloadKeys.push(this.payloadKeys[this.payloadKeys.length-1]+1)},removePayload:function(e){this.payloadKeys.length>1&&this.payloadKeys.splice(this.payloadKeys.indexOf(e),1)},handleSubmit:function(){var e=this;this.$refs.form.validate((function(t){if(t){var a={},o={};for(var i in e.form)if(0===i.indexOf("Key-")){var n=i.substr("Key-".length);e.form["Value-"+n]&&(a[e.form[i]]=e.form["Value-"+n])}else-1===i.indexOf("Value-")&&(o[i]=e.form[i]);o.payloads=a,Object(r["n"])(o).then((function(){e.closeDrawer(),e.fetch({page:e.pagination.current}),e.$notification.info({message:"Success",style:{width:"600px",marginLeft:"".concat(-265,"px")},duration:2.5})})).catch((function(t){e.$notification.error({message:e.formAction+" failed",description:t.response.data.error,style:{width:"600px",marginLeft:"".concat(-265,"px")},duration:4})}))}}))},handleCancel:function(){this.form={},this.closeDrawer()}},mounted:function(){this.fetch({page:"1"})},components:{BasicRule:s["a"]}},h=m,y=(a("3e20"),a("2877")),g=Object(y["a"])(h,o,i,!1,null,"f1cd719a",null);t["default"]=g.exports},2322:function(e,t,a){},"3e20":function(e,t,a){"use strict";a("2322")}}]); \ No newline at end of file diff --git a/frontend/dist/js/chunk-vendors.js b/frontend/dist/js/chunk-vendors.js index 05df9a1..befa9b8 100644 --- a/frontend/dist/js/chunk-vendors.js +++ b/frontend/dist/js/chunk-vendors.js @@ -30,7 +30,7 @@ var t=e.defineLocale("tl-ph",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo //! moment.js locale configuration var t=e.defineLocale("eu",{months:"urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),monthsShort:"urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),monthsParseExact:!0,weekdays:"igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),weekdaysShort:"ig._al._ar._az._og._ol._lr.".split("_"),weekdaysMin:"ig_al_ar_az_og_ol_lr".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY[ko] MMMM[ren] D[a]",LLL:"YYYY[ko] MMMM[ren] D[a] HH:mm",LLLL:"dddd, YYYY[ko] MMMM[ren] D[a] HH:mm",l:"YYYY-M-D",ll:"YYYY[ko] MMM D[a]",lll:"YYYY[ko] MMM D[a] HH:mm",llll:"ddd, YYYY[ko] MMM D[a] HH:mm"},calendar:{sameDay:"[gaur] LT[etan]",nextDay:"[bihar] LT[etan]",nextWeek:"dddd LT[etan]",lastDay:"[atzo] LT[etan]",lastWeek:"[aurreko] dddd LT[etan]",sameElse:"L"},relativeTime:{future:"%s barru",past:"duela %s",s:"segundo batzuk",ss:"%d segundo",m:"minutu bat",mm:"%d minutu",h:"ordu bat",hh:"%d ordu",d:"egun bat",dd:"%d egun",M:"hilabete bat",MM:"%d hilabete",y:"urte bat",yy:"%d urte"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}});return t}))},"100e":function(e,t,n){var r=n("cd9d"),i=n("2286"),a=n("c1c9");function o(e,t){return a(i(e,t,r),e+"")}e.exports=o},1041:function(e,t,n){var r=n("8eeb"),i=n("a029");function a(e,t){return r(e,i(e),t)}e.exports=a},1098:function(e,t,n){"use strict";t.__esModule=!0;var r=n("17ed"),i=c(r),a=n("f893"),o=c(a),s="function"===typeof o.default&&"symbol"===typeof i.default?function(e){return typeof e}:function(e){return e&&"function"===typeof o.default&&e.constructor===o.default&&e!==o.default.prototype?"symbol":typeof e};function c(e){return e&&e.__esModule?e:{default:e}}t.default="function"===typeof o.default&&"symbol"===s(i.default)?function(e){return"undefined"===typeof e?"undefined":s(e)}:function(e){return e&&"function"===typeof o.default&&e.constructor===o.default&&e!==o.default.prototype?"symbol":"undefined"===typeof e?"undefined":s(e)}},"10db":function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},"10e8":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict"; //! moment.js locale configuration -var t=e.defineLocale("th",{months:"มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม".split("_"),monthsShort:"ม.ค._ก.พ._มี.ค._เม.ย._พ.ค._มิ.ย._ก.ค._ส.ค._ก.ย._ต.ค._พ.ย._ธ.ค.".split("_"),monthsParseExact:!0,weekdays:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์".split("_"),weekdaysShort:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์".split("_"),weekdaysMin:"อา._จ._อ._พ._พฤ._ศ._ส.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY เวลา H:mm",LLLL:"วันddddที่ D MMMM YYYY เวลา H:mm"},meridiemParse:/ก่อนเที่ยง|หลังเที่ยง/,isPM:function(e){return"หลังเที่ยง"===e},meridiem:function(e,t,n){return e<12?"ก่อนเที่ยง":"หลังเที่ยง"},calendar:{sameDay:"[วันนี้ เวลา] LT",nextDay:"[พรุ่งนี้ เวลา] LT",nextWeek:"dddd[หน้า เวลา] LT",lastDay:"[เมื่อวานนี้ เวลา] LT",lastWeek:"[วัน]dddd[ที่แล้ว เวลา] LT",sameElse:"L"},relativeTime:{future:"อีก %s",past:"%sที่แล้ว",s:"ไม่กี่วินาที",ss:"%d วินาที",m:"1 นาที",mm:"%d นาที",h:"1 ชั่วโมง",hh:"%d ชั่วโมง",d:"1 วัน",dd:"%d วัน",w:"1 สัปดาห์",ww:"%d สัปดาห์",M:"1 เดือน",MM:"%d เดือน",y:"1 ปี",yy:"%d ปี"}});return t}))},"126d":function(e,t,n){var r=n("6da8"),i=n("aaec"),a=n("d094");function o(e){return i(e)?a(e):r(e)}e.exports=o},1290:function(e,t){function n(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}e.exports=n},1310:function(e,t){function n(e){return null!=e&&"object"==typeof e}e.exports=n},"134b":function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n("4039"),a=r(i),o=n("320c"),s=r(o),c=!0,l=!1,u=["altKey","bubbles","cancelable","ctrlKey","currentTarget","eventPhase","metaKey","shiftKey","target","timeStamp","view","type"];function d(e){return null===e||void 0===e}var h=[{reg:/^key/,props:["char","charCode","key","keyCode","which"],fix:function(e,t){d(e.which)&&(e.which=d(t.charCode)?t.keyCode:t.charCode),void 0===e.metaKey&&(e.metaKey=e.ctrlKey)}},{reg:/^touch/,props:["touches","changedTouches","targetTouches"]},{reg:/^hashchange$/,props:["newURL","oldURL"]},{reg:/^gesturechange$/i,props:["rotation","scale"]},{reg:/^(mousewheel|DOMMouseScroll)$/,props:[],fix:function(e,t){var n=void 0,r=void 0,i=void 0,a=t.wheelDelta,o=t.axis,s=t.wheelDeltaY,c=t.wheelDeltaX,l=t.detail;a&&(i=a/120),l&&(i=0-(l%3===0?l/3:l)),void 0!==o&&(o===e.HORIZONTAL_AXIS?(r=0,n=0-i):o===e.VERTICAL_AXIS&&(n=0,r=i)),void 0!==s&&(r=s/120),void 0!==c&&(n=-1*c/120),n||r||(r=i),void 0!==n&&(e.deltaX=n),void 0!==r&&(e.deltaY=r),void 0!==i&&(e.delta=i)}},{reg:/^mouse|contextmenu|click|mspointer|(^DOMMouseScroll$)/i,props:["buttons","clientX","clientY","button","offsetX","relatedTarget","which","fromElement","toElement","offsetY","pageX","pageY","screenX","screenY"],fix:function(e,t){var n=void 0,r=void 0,i=void 0,a=e.target,o=t.button;return a&&d(e.pageX)&&!d(t.clientX)&&(n=a.ownerDocument||document,r=n.documentElement,i=n.body,e.pageX=t.clientX+(r&&r.scrollLeft||i&&i.scrollLeft||0)-(r&&r.clientLeft||i&&i.clientLeft||0),e.pageY=t.clientY+(r&&r.scrollTop||i&&i.scrollTop||0)-(r&&r.clientTop||i&&i.clientTop||0)),e.which||void 0===o||(e.which=1&o?1:2&o?3:4&o?2:0),!e.relatedTarget&&e.fromElement&&(e.relatedTarget=e.fromElement===a?e.toElement:e.fromElement),e}}];function f(){return c}function p(){return l}function m(e){var t=e.type,n="function"===typeof e.stopPropagation||"boolean"===typeof e.cancelBubble;a["default"].call(this),this.nativeEvent=e;var r=p;"defaultPrevented"in e?r=e.defaultPrevented?f:p:"getPreventDefault"in e?r=e.getPreventDefault()?f:p:"returnValue"in e&&(r=e.returnValue===l?f:p),this.isDefaultPrevented=r;var i=[],o=void 0,s=void 0,c=void 0,d=u.concat();h.forEach((function(e){t.match(e.reg)&&(d=d.concat(e.props),e.fix&&i.push(e.fix))})),s=d.length;while(s)c=d[--s],this[c]=e[c];!this.target&&n&&(this.target=e.srcElement||document),this.target&&3===this.target.nodeType&&(this.target=this.target.parentNode),s=i.length;while(s)o=i[--s],o(this,e);this.timeStamp=e.timeStamp||Date.now()}var v=a["default"].prototype;(0,s["default"])(m.prototype,v,{constructor:m,preventDefault:function(){var e=this.nativeEvent;e.preventDefault?e.preventDefault():e.returnValue=l,v.preventDefault.call(this)},stopPropagation:function(){var e=this.nativeEvent;e.stopPropagation?e.stopPropagation():e.cancelBubble=c,v.stopPropagation.call(this)}}),t["default"]=m,e.exports=t["default"]},1368:function(e,t,n){var r=n("da03"),i=function(){var e=/[^.]+$/.exec(r&&r.keys&&r.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function a(e){return!!i&&i in e}e.exports=a},"13e9":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict"; +var t=e.defineLocale("th",{months:"มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม".split("_"),monthsShort:"ม.ค._ก.พ._มี.ค._เม.ย._พ.ค._มิ.ย._ก.ค._ส.ค._ก.ย._ต.ค._พ.ย._ธ.ค.".split("_"),monthsParseExact:!0,weekdays:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์".split("_"),weekdaysShort:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์".split("_"),weekdaysMin:"อา._จ._อ._พ._พฤ._ศ._ส.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY เวลา H:mm",LLLL:"วันddddที่ D MMMM YYYY เวลา H:mm"},meridiemParse:/ก่อนเที่ยง|หลังเที่ยง/,isPM:function(e){return"หลังเที่ยง"===e},meridiem:function(e,t,n){return e<12?"ก่อนเที่ยง":"หลังเที่ยง"},calendar:{sameDay:"[วันนี้ เวลา] LT",nextDay:"[พรุ่งนี้ เวลา] LT",nextWeek:"dddd[หน้า เวลา] LT",lastDay:"[เมื่อวานนี้ เวลา] LT",lastWeek:"[วัน]dddd[ที่แล้ว เวลา] LT",sameElse:"L"},relativeTime:{future:"อีก %s",past:"%sที่แล้ว",s:"ไม่กี่วินาที",ss:"%d วินาที",m:"1 นาที",mm:"%d นาที",h:"1 ชั่วโมง",hh:"%d ชั่วโมง",d:"1 วัน",dd:"%d วัน",w:"1 สัปดาห์",ww:"%d สัปดาห์",M:"1 เดือน",MM:"%d เดือน",y:"1 ปี",yy:"%d ปี"}});return t}))},"126d":function(e,t,n){var r=n("6da8"),i=n("aaec"),a=n("d094");function o(e){return i(e)?a(e):r(e)}e.exports=o},1276:function(e,t,n){"use strict";var r=n("d784"),i=n("44e7"),a=n("825a"),o=n("1d80"),s=n("4840"),c=n("8aa5"),l=n("50c4"),u=n("14c3"),d=n("9263"),h=n("d039"),f=[].push,p=Math.min,m=4294967295,v=!h((function(){return!RegExp(m,"y")}));r("split",2,(function(e,t,n){var r;return r="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,n){var r=String(o(this)),a=void 0===n?m:n>>>0;if(0===a)return[];if(void 0===e)return[r];if(!i(e))return t.call(r,e,a);var s,c,l,u=[],h=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),p=0,v=new RegExp(e.source,h+"g");while(s=d.call(v,r)){if(c=v.lastIndex,c>p&&(u.push(r.slice(p,s.index)),s.length>1&&s.index=a))break;v.lastIndex===s.index&&v.lastIndex++}return p===r.length?!l&&v.test("")||u.push(""):u.push(r.slice(p)),u.length>a?u.slice(0,a):u}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:t.call(this,e,n)}:t,[function(t,n){var i=o(this),a=void 0==t?void 0:t[e];return void 0!==a?a.call(t,i,n):r.call(String(i),t,n)},function(e,i){var o=n(r,e,this,i,r!==t);if(o.done)return o.value;var d=a(e),h=String(this),f=s(d,RegExp),g=d.unicode,y=(d.ignoreCase?"i":"")+(d.multiline?"m":"")+(d.unicode?"u":"")+(v?"y":"g"),b=new f(v?d:"^(?:"+d.source+")",y),_=void 0===i?m:i>>>0;if(0===_)return[];if(0===h.length)return null===u(b,h)?[h]:[];var M=0,w=0,k=[];while(w=2&&e<=4?t[1]:t[2]},translate:function(e,n,r){var i=t.words[r];return 1===r.length?n?i[0]:i[1]:e+" "+t.correctGrammaticalCase(e,i)}},n=e.defineLocale("sr-cyrl",{months:"јануар_фебруар_март_април_мај_јун_јул_август_септембар_октобар_новембар_децембар".split("_"),monthsShort:"јан._феб._мар._апр._мај_јун_јул_авг._сеп._окт._нов._дец.".split("_"),monthsParseExact:!0,weekdays:"недеља_понедељак_уторак_среда_четвртак_петак_субота".split("_"),weekdaysShort:"нед._пон._уто._сре._чет._пет._суб.".split("_"),weekdaysMin:"не_по_ут_ср_че_пе_су".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D. M. YYYY.",LL:"D. MMMM YYYY.",LLL:"D. MMMM YYYY. H:mm",LLLL:"dddd, D. MMMM YYYY. H:mm"},calendar:{sameDay:"[данас у] LT",nextDay:"[сутра у] LT",nextWeek:function(){switch(this.day()){case 0:return"[у] [недељу] [у] LT";case 3:return"[у] [среду] [у] LT";case 6:return"[у] [суботу] [у] LT";case 1:case 2:case 4:case 5:return"[у] dddd [у] LT"}},lastDay:"[јуче у] LT",lastWeek:function(){var e=["[прошле] [недеље] [у] LT","[прошлог] [понедељка] [у] LT","[прошлог] [уторка] [у] LT","[прошле] [среде] [у] LT","[прошлог] [четвртка] [у] LT","[прошлог] [петка] [у] LT","[прошле] [суботе] [у] LT"];return e[this.day()]},sameElse:"L"},relativeTime:{future:"за %s",past:"пре %s",s:"неколико секунди",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"дан",dd:t.translate,M:"месец",MM:t.translate,y:"годину",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}});return n}))},"14c3":function(e,t,n){var r=n("c6b6"),i=n("9263");e.exports=function(e,t){var n=e.exec;if("function"===typeof n){var a=n.call(e,t);if("object"!==typeof a)throw TypeError("RegExp exec method returned something other than an Object or null");return a}if("RegExp"!==r(e))throw TypeError("RegExp#exec called on incompatible receiver");return i.call(e,t)}},1552:function(e){e.exports=JSON.parse('{"name":"ant-design-vue","version":"1.7.4","title":"Ant Design Vue","description":"An enterprise-class UI design language and Vue-based implementation","keywords":["ant","design","antd","vue","vueComponent","component","components","ui","framework","frontend"],"main":"lib/index.js","module":"es/index.js","typings":"types/index.d.ts","files":["dist","lib","es","types","scripts"],"scripts":{"dev":"webpack-dev-server","start":"cross-env NODE_ENV=development webpack-dev-server --config webpack.config.js","test":"cross-env NODE_ENV=test jest --config .jest.js","compile":"node antd-tools/cli/run.js compile","pub":"node antd-tools/cli/run.js pub","pub-with-ci":"node antd-tools/cli/run.js pub-with-ci","prepublish":"node antd-tools/cli/run.js guard","pre-publish":"node ./scripts/prepub","prettier":"prettier -c --write \'**/*\'","pretty-quick":"pretty-quick","dist":"node antd-tools/cli/run.js dist","lint":"eslint -c ./.eslintrc --fix --ext .jsx,.js,.vue ./components","lint:site":"eslint -c ./.eslintrc --fix --ext .jsx,.js,.vue ./antdv-demo","lint:docs":"eslint -c ./.eslintrc --fix --ext .jsx,.js,.vue,.md ./antdv-demo/docs/**/demo/**","lint:style":"stylelint \\"{site,components}/**/*.less\\" --syntax less","codecov":"codecov","postinstall":"node scripts/postinstall || echo \\"ignore\\""},"repository":{"type":"git","url":"git+https://github.com/vueComponent/ant-design-vue.git"},"license":"MIT","bugs":{"url":"https://github.com/vueComponent/ant-design-vue/issues"},"homepage":"https://www.antdv.com/","peerDependencies":{"vue":"^2.6.0","vue-template-compiler":"^2.6.0"},"devDependencies":{"@commitlint/cli":"^8.0.0","@commitlint/config-conventional":"^8.0.0","@octokit/rest":"^16.0.0","@vue/cli-plugin-eslint":"^4.0.0","@vue/server-test-utils":"1.0.0-beta.16","@vue/test-utils":"1.0.0-beta.16","acorn":"^7.0.0","autoprefixer":"^9.6.0","axios":"^0.19.0","babel-cli":"^6.26.0","babel-core":"^6.26.0","babel-eslint":"^10.0.1","babel-helper-vue-jsx-merge-props":"^2.0.3","babel-jest":"^23.6.0","babel-loader":"^7.1.2","babel-plugin-import":"^1.1.1","babel-plugin-inline-import-data-uri":"^1.0.1","babel-plugin-istanbul":"^6.0.0","babel-plugin-syntax-dynamic-import":"^6.18.0","babel-plugin-syntax-jsx":"^6.18.0","babel-plugin-transform-class-properties":"^6.24.1","babel-plugin-transform-decorators":"^6.24.1","babel-plugin-transform-decorators-legacy":"^1.3.4","babel-plugin-transform-es3-member-expression-literals":"^6.22.0","babel-plugin-transform-es3-property-literals":"^6.22.0","babel-plugin-transform-object-assign":"^6.22.0","babel-plugin-transform-object-rest-spread":"^6.26.0","babel-plugin-transform-runtime":"~6.23.0","babel-plugin-transform-vue-jsx":"^3.7.0","babel-polyfill":"^6.26.0","babel-preset-env":"^1.6.1","case-sensitive-paths-webpack-plugin":"^2.1.2","chalk":"^3.0.0","cheerio":"^1.0.0-rc.2","codecov":"^3.0.0","colorful":"^2.1.0","commander":"^4.0.0","compare-versions":"^3.3.0","cross-env":"^7.0.0","css-loader":"^3.0.0","deep-assign":"^2.0.0","enquire-js":"^0.2.1","eslint":"^6.8.0","eslint-config-prettier":"^6.10.1","eslint-plugin-html":"^6.0.0","eslint-plugin-markdown":"^2.0.0-alpha.0","eslint-plugin-vue":"^6.2.2","fetch-jsonp":"^1.1.3","fs-extra":"^8.0.0","glob":"^7.1.2","gulp":"^4.0.1","gulp-babel":"^7.0.0","gulp-strip-code":"^0.1.4","html-webpack-plugin":"^3.2.0","husky":"^4.0.0","istanbul-instrumenter-loader":"^3.0.0","jest":"^24.0.0","jest-serializer-vue":"^2.0.0","jest-transform-stub":"^2.0.0","js-base64":"^3.0.0","json-templater":"^1.2.0","jsonp":"^0.2.1","less":"^3.9.0","less-loader":"^6.0.0","less-plugin-npm-import":"^2.1.0","lint-staged":"^10.0.0","marked":"0.3.18","merge2":"^1.2.1","mini-css-extract-plugin":"^0.10.0","minimist":"^1.2.0","mkdirp":"^0.5.1","mockdate":"^2.0.2","nprogress":"^0.2.0","optimize-css-assets-webpack-plugin":"^5.0.1","postcss":"^7.0.6","postcss-loader":"^3.0.0","prettier":"^1.18.2","pretty-quick":"^2.0.0","querystring":"^0.2.0","raw-loader":"^4.0.0","reqwest":"^2.0.5","rimraf":"^3.0.0","rucksack-css":"^1.0.2","selenium-server":"^3.0.1","semver":"^7.0.0","style-loader":"^1.0.0","stylelint":"^13.0.0","stylelint-config-prettier":"^8.0.0","stylelint-config-standard":"^19.0.0","terser-webpack-plugin":"^3.0.3","through2":"^3.0.0","url-loader":"^3.0.0","vue":"^2.6.11","vue-antd-md-loader":"^1.1.0","vue-clipboard2":"0.3.1","vue-draggable-resizable":"^2.1.0","vue-eslint-parser":"^7.0.0","vue-i18n":"^8.3.2","vue-infinite-scroll":"^2.0.2","vue-jest":"^2.5.0","vue-loader":"^15.6.2","vue-router":"^3.0.1","vue-server-renderer":"^2.6.11","vue-template-compiler":"^2.6.11","vue-virtual-scroller":"^1.0.0","vuex":"^3.1.0","webpack":"^4.28.4","webpack-cli":"^3.2.1","webpack-dev-server":"^3.1.14","webpack-merge":"^4.1.1","webpackbar":"^4.0.0","xhr-mock":"^2.5.1"},"dependencies":{"@ant-design/icons":"^2.1.1","@ant-design/icons-vue":"^2.0.0","@simonwep/pickr":"~1.7.0","add-dom-event-listener":"^1.0.2","array-tree-filter":"^2.1.0","async-validator":"^3.0.3","babel-helper-vue-jsx-merge-props":"^2.0.3","babel-runtime":"6.x","classnames":"^2.2.5","component-classes":"^1.2.6","dom-align":"^1.10.4","dom-closest":"^0.2.0","dom-scroll-into-view":"^2.0.0","enquire.js":"^2.1.6","intersperse":"^1.0.0","is-mobile":"^2.2.1","is-negative-zero":"^2.0.0","ismobilejs":"^1.0.0","json2mq":"^0.2.0","lodash":"^4.17.5","moment":"^2.21.0","mutationobserver-shim":"^0.3.2","node-emoji":"^1.10.0","omit.js":"^1.0.0","raf":"^3.4.0","resize-observer-polyfill":"^1.5.1","shallow-equal":"^1.0.0","shallowequal":"^1.0.2","vue-ref":"^2.0.0","warning":"^4.0.0"},"sideEffects":["site/*","components/style.js","components/**/style/*","*.vue","*.md","dist/*","es/**/style/*","lib/**/style/*","*.less"]}')},"159a":function(e,t,n){var r=n("32b3"),i=n("e2e4"),a=n("c098"),o=n("1a8c"),s=n("f4d6");function c(e,t,n,c){if(!o(e))return e;t=i(t,e);var l=-1,u=t.length,d=u-1,h=e;while(null!=h&&++l - - + + @@ -48,8 +49,7 @@ - Settings - + Settings @@ -60,7 +60,7 @@ :type="collapsed ? 'menu-unfold' : 'menu-fold'" @click="() => (collapsed = !collapsed)" /> -
+
@@ -123,7 +123,7 @@ export default { pageSize: store.pageSize, collapsed: false, showSettings: false, - openKeys: ['logs'], + openKeys: [], version: "", }; }, @@ -153,6 +153,14 @@ export default { } this.GetVersion() }, + created() { + let unwatch = this.$watch('$route', function (to, from) { + if (from.path === "/" && this.openKeys.length === 0) { + this.openKeys.push(to.path.split("/")[1]) + unwatch() + } + }) + }, destroyed() { clearInterval(this.timer) }, diff --git a/frontend/src/components/BasicRule.vue b/frontend/src/components/BasicRule.vue index 7180933..460afa6 100644 --- a/frontend/src/components/BasicRule.vue +++ b/frontend/src/components/BasicRule.vue @@ -15,13 +15,13 @@ Flag Format  - + 2. When the regex uses grouping with group name, you can get these submatches through template variables and use them in other fields of the rule.`"> @@ -97,7 +97,7 @@ export default { }, } }, - props: ['form', 'readOnly'] + props: ['form', 'readOnly', 'flagField'] } diff --git a/frontend/src/views/rules/Mysql.vue b/frontend/src/views/rules/Mysql.vue index fa57af8..1f14926 100644 --- a/frontend/src/views/rules/Mysql.vue +++ b/frontend/src/views/rules/Mysql.vue @@ -13,7 +13,7 @@ @close="closeDrawer" > - + @@ -31,7 +31,8 @@
@@ -41,8 +42,13 @@ - - + + + { store.pageSize = size } - }, filters: {}, + }, filters: {}, loading: false, columns, form: {}, diff --git a/internal/cli/banner.go b/internal/cli/banner.go index ebed6e0..96bb903 100644 --- a/internal/cli/banner.go +++ b/internal/cli/banner.go @@ -7,4 +7,5 @@ const banner = ` / _, _/ __/ |/ /___/ / /_/ / / /_ /_/ |_|\___/|___//____/\__,_/_/\__/ v%s - https://revsuit.pro` + https://revsuit.pro +` diff --git a/internal/qqwry/wry.go b/internal/qqwry/wry.go index cd32632..cdcd887 100644 --- a/internal/qqwry/wry.go +++ b/internal/qqwry/wry.go @@ -25,7 +25,7 @@ func init() { log.Warn("Download qqwry.dat failed, caused by:%v, recommend to download it by yourself otherwise the `IpArea` will be null", err) } } - } else if time.Until(info.ModTime()) > 5*24*time.Hour { + } else if -time.Until(info.ModTime()) > 5*24*time.Hour { log.Info("Updating qqwry.dat...") err := download() if err != nil { diff --git a/pkg/dns/dns.go b/pkg/dns/dns.go index a01b085..f022ba9 100644 --- a/pkg/dns/dns.go +++ b/pkg/dns/dns.go @@ -126,29 +126,32 @@ func (s *Server) newZone(name string) *newdns.Zone { } log.Info("DNS record[id:%d rule:%s remote_ip:%s] has been created", r.ID, _rule.Name, ip) - //only send to client when this connection recorded first time. - if _rule.PushToClient { - if flagGroup != "" { - var count int64 - database.DB.Where("rule_name=? and domain like ?", _rule.Name, "%"+flagGroup+"%").Model(&Record{}).Count(&count) - if count <= 1 { - r.PushToClient() - log.Trace("DNS record[id:%d, flagGroup:%s] has been put to client message queue", r.ID, flagGroup) - } - } else { + //only send to client or notify user when this connection recorded first time. + var count int64 + if flagGroup != "" { + database.DB.Where("rule_name=? and domain like ?", _rule.Name, "%"+flagGroup+"%").Model(&Record{}).Count(&count) + } + if count <= 1 { + if _rule.PushToClient { r.PushToClient() - log.Trace("DNS record[id:%d, flag:%s] has been put to client message queue", r.ID, flag) + if flagGroup != "" { + log.Trace("DNS record[id:%d, flagGroup:%s] has been put to client message queue", r.ID, flagGroup) + } else { + log.Trace("DNS record[id:%d] has been put to client message queue", r.ID) + } + } + //send notice + if _rule.Notice { + go func() { + r.Notice() + if flagGroup != "" { + log.Trace("DNS record[id:%d, flagGroup:%s] notice has been sent", r.ID, flagGroup) + } else { + log.Trace("DNS record[id:%d] notice has been sent", r.ID) + } + }() } } - - //send notice - if _rule.Notice { - go func() { - r.Notice() - log.Trace("DNS record[id:%d] notice has been sent", r.ID) - }() - } - if _rule.Value != "" { value := rule.CompileTpl(_rule.Value, vars) _type := _rule.Type diff --git a/pkg/dns/rule.go b/pkg/dns/rule.go index f62af73..aac6e2c 100644 --- a/pkg/dns/rule.go +++ b/pkg/dns/rule.go @@ -13,7 +13,7 @@ import ( ) type Rule struct { - rule.BaseRule `yaml:""` + rule.BaseRule `yaml:",inline"` Type newdns.Type `gorm:"default:1" form:"type" json:"type"` Value string `form:"value" json:"value"` TTL time.Duration `gorm:"ttl;default:10" form:"ttl" json:"ttl"` diff --git a/pkg/ftp/record.go b/pkg/ftp/record.go index cfe7234..dccc8dc 100644 --- a/pkg/ftp/record.go +++ b/pkg/ftp/record.go @@ -156,26 +156,30 @@ func createRecord(_rule *Rule, flag, flagGroup, user, password, method, path, fi } log.Info("FTP record[id:%d rule:%s remote_ip:%s] has been created", r.ID, _rule.Name, ip) - //only send to client when this connection recorded first time. - if _rule.PushToClient { - if flagGroup != "" { - var count int64 - database.DB.Where("rule_name=? and (user like ? or password like ?)", _rule.Name, "%"+flagGroup+"%", "%"+flagGroup+"%").Model(&Record{}).Count(&count) - if count <= 1 { - r.PushToClient() - log.Trace("FTP record[id:%d, flagGroup:%s] has been put to client message queue", r.ID, flagGroup) - } - } else { + //only send to client or notify user when this connection recorded first time. + var count int64 + if flagGroup != "" { + database.DB.Where("rule_name=? and (user like ? or password like ?)", _rule.Name, "%"+flagGroup+"%", "%"+flagGroup+"%").Model(&Record{}).Count(&count) + } + if count <= 1 { + if _rule.PushToClient { r.PushToClient() - log.Trace("FTP record[id:%d, flag:%s] has been put to client message queue", r.ID, flag) + if flagGroup != "" { + log.Trace("FTP record[id:%d, flagGroup:%s] has been put to client message queue", r.ID, flagGroup) + } else { + log.Trace("FTP record[id:%d] has been put to client message queue", r.ID) + } + } + //send notice + if _rule.Notice { + go func() { + r.Notice() + if flagGroup != "" { + log.Trace("FTP record[id:%d, flagGroup:%s] notice has been sent", r.ID, flagGroup) + } else { + log.Trace("FTP record[id:%d] notice has been sent", r.ID) + } + }() } } - - //send notice - if _rule.Notice { - go func() { - r.Notice() - log.Trace("FTP record[id:%d] notice has been sent", r.ID) - }() - } } diff --git a/pkg/mysql/mysql.go b/pkg/mysql/mysql.go index 92c9f76..b380b28 100644 --- a/pkg/mysql/mysql.go +++ b/pkg/mysql/mysql.go @@ -68,11 +68,10 @@ func (s *Server) NewConnection(c *vmysql.Conn) { user = c.User schema = c.SchemaName validated bool - flag string ) for _, _rule := range s.getRules() { - flag, _, _ = _rule.Match(user) + flag, flagGroup, vars := _rule.Match(user) if flag == "" { flag, _, _ = _rule.Match(schema) } @@ -82,6 +81,9 @@ func (s *Server) NewConnection(c *vmysql.Conn) { log.Trace("MySQL connection[id: %d] matched rule[rule_name: %s, flag: %s]", c.ConnectionID, _rule.Name, flag) s.connRulePool.Store(c.ConnectionID, _rule) validated = true + c.Flag = flag + c.FlagGroup = flagGroup + c.Vars = vars break } if !validated { @@ -103,7 +105,6 @@ func (s *Server) ConnectionClosed(c *vmysql.Conn) { var clientName, clientOS, flag, flagGroup string user := c.User - schema := c.SchemaName supportLoadLocalData := c.SupportLoadDataLocal cr, ok := s.connRulePool.Load(c.ConnectionID) @@ -113,13 +114,6 @@ func (s *Server) ConnectionClosed(c *vmysql.Conn) { } _rule := cr.(*Rule) - // flag must not be empty - for _, s := range []string{user, schema} { - flag, flagGroup, _ = _rule.Match(s) - if flag != "" { - break - } - } if c.ConnAttrs != nil { clientName = c.ConnAttrs["_client_name"] + " " + c.ConnAttrs["_client_version"] @@ -143,27 +137,31 @@ func (s *Server) ConnectionClosed(c *vmysql.Conn) { } log.Info("MySQL record[id:%d rule:%s remote_ip:%s] has been created", r.ID, _rule.Name, ip) - //only send to client when this connection recorded first time. - if _rule.PushToClient { - if flagGroup != "" { - var count int64 - database.DB.Where("rule_name=? and (user like ? or schema like ?)", _rule.Name, "%"+flagGroup+"%", "%"+flagGroup+"%").Model(&Record{}).Count(&count) - if count <= 1 { - r.PushToClient() - log.Trace("MySQL record[id:%d, flagGroup:%s] has been put to client message queue", r.ID, flagGroup) - } - } else { - r.PushToClient() - log.Trace("MySQL record[id:%d, flag:%s] has been put to client message queue", r.ID, flag) - } + //only send to client or notify user when this connection recorded first time. + var count int64 + if c.FlagGroup != "" { + database.DB.Where("rule_name=? and (user like ? or schema like ?)", _rule.Name, "%"+flagGroup+"%", "%"+flagGroup+"%").Model(&Record{}).Count(&count) } - - //send notice - if _rule.Notice { - go func() { - r.Notice() - log.Trace("MySQL record[id: %d] notice has been sent", r.ID) - }() + if count <= 1 { + if _rule.PushToClient { + r.PushToClient() + if flagGroup != "" { + log.Trace("MySQL record[id:%d, flagGroup:%s] has been put to client message queue", r.ID, flagGroup) + } else { + log.Trace("MySQL record[id:%d] has been put to client message queue", r.ID) + } + } + //send notice + if _rule.Notice { + go func() { + r.Notice() + if flagGroup != "" { + log.Trace("MySQL record[id:%d, flagGroup:%s] notice has been sent", r.ID, flagGroup) + } else { + log.Trace("MySQL record[id: %d] notice has been sent", r.ID) + } + }() + } } s.connRulePool.Delete(c.ConnectionID) @@ -203,12 +201,13 @@ func (s *Server) ComQuery(c *vmysql.Conn, query string, callback func(*sqltypes. })} //choose payload - //jdbc:mysql://127.0.0.1:3306/test?connectionAttributes=t:cc7&autoDeserialize=true - if c.ConnAttrs["t"] != "" && _rule.Payloads[c.ConnAttrs["t"]] != "" { - payload, _ = base64.StdEncoding.DecodeString(_rule.Payloads[c.ConnAttrs["t"]]) + if c.Vars["payload"] != "" && _rule.Payloads[c.Vars["payload"]] != "" { + payload, _ = base64.StdEncoding.DecodeString(_rule.Payloads[c.Vars["payload"]]) + log.Trace("MySQL exploit client [%d] with payload [%s]", c.ConnectionID, c.Vars["payload"]) } else { - for _, v := range _rule.Payloads { + for k, v := range _rule.Payloads { payload, _ = base64.StdEncoding.DecodeString(v) + log.Trace("MySQL not found payload variable, exploit client [%d] with payload [%s]", c.ConnectionID, k) break } } diff --git a/pkg/mysql/vmysql/conn.go b/pkg/mysql/vmysql/conn.go index 76445b6..0e626d3 100644 --- a/pkg/mysql/vmysql/conn.go +++ b/pkg/mysql/vmysql/conn.go @@ -152,6 +152,10 @@ type Conn struct { ConnAttrs map[string]string Files map[string][]byte + + Flag string + FlagGroup string + Vars map[string]string } // bufPool is used to allocate and free buffers in an efficient way. diff --git a/pkg/rhttp/http.go b/pkg/rhttp/http.go index c5ff5db..9bfd757 100644 --- a/pkg/rhttp/http.go +++ b/pkg/rhttp/http.go @@ -191,27 +191,31 @@ func (s *Server) Receive(c *gin.Context) { } log.Info("HTTP record[id:%d rule:%s remote_ip:%s] has been created", r.ID, _rule.Name, ip) - //only send to client when this connection recorded first time. - if _rule.PushToClient { - if flagGroup != "" { - var count int64 - database.DB.Where("rule_name=? and raw_request like ?", _rule.Name, "%"+flagGroup+"%").Model(&Record{}).Count(&count) - if count <= 1 { - r.PushToClient() - log.Trace("HTTP record[id:%d, flagGroup:%s] has been put to client message queue", r.ID, flagGroup) - } - } else { - r.PushToClient() - log.Trace("HTTP record[id:%d, flag:%s] has been put to client message queue", r.ID, r.Flag) - } + //only send to client or notify user when this connection recorded first time. + var count int64 + if flagGroup != "" { + database.DB.Where("rule_name=? and raw_request like ?", _rule.Name, "%"+flagGroup+"%").Model(&Record{}).Count(&count) } - - //send notice - if _rule.Notice { - go func() { - r.Notice() - log.Trace("HTTP record[id:%d] notice has been sent", r.ID) - }() + if count <= 1 { + if _rule.PushToClient { + r.PushToClient() + if flagGroup != "" { + log.Trace("HTTP record[id:%d, flagGroup:%s] has been put to client message queue", r.ID, flagGroup) + } else { + log.Trace("HTTP record[id:%d] has been put to client message queue", r.ID) + } + } + //send notice + if _rule.Notice { + go func() { + r.Notice() + if flagGroup != "" { + log.Trace("HTTP record[id:%d, flagGroup:%s] notice has been sent", r.ID, flagGroup) + } else { + log.Trace("HTTP record[id:%d] notice has been sent", r.ID) + } + }() + } } for header, value := range _rule.ResponseHeaders { diff --git a/pkg/server/controller.go b/pkg/server/controller.go index 1d8f030..a124024 100644 --- a/pkg/server/controller.go +++ b/pkg/server/controller.go @@ -18,7 +18,7 @@ import ( func auth(c *gin.Context) { c.SetSameSite(http.SameSiteLaxMode) - c.SetCookie("token", c.Request.Header["Token"][0], 0, "/revsuit/api/", c.Request.Host, true, true) + c.SetCookie("token", c.Request.Header["Token"][0], 0, "/revsuit/api/", "", false, true) c.String(200, "pong") } diff --git a/pkg/server/server.go b/pkg/server/server.go index 0006192..e6ac903 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -14,7 +14,7 @@ import ( log "unknwon.dev/clog/v2" ) -const VERSION = "Beta0.1" +const VERSION = "0.1.1-beta" type Revsuit struct { config *Config @@ -97,7 +97,7 @@ func initLog(level string) (logLevel log.Level) { database.DB.Logger.LogMode(logger.Info) logLevel = log.LevelTrace case "info": - gin.SetMode(gin.DebugMode) + gin.SetMode(gin.ReleaseMode) database.DB.Logger.LogMode(logger.Info) logLevel = log.LevelInfo case "warning", "warn":