Files
revsuit/frontend/dist/js/chunk-012c9c90.js
T
2021-05-16 12:11:35 +08:00

1 line
9.1 KiB
JavaScript

(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")}}]);