Files
revsuit/frontend/dist/js/chunk-0cb5e9e6.js
T
2021-05-25 20:41:37 +08:00

1 line
9.3 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-0cb5e9e6"],{"05cd":function(t,e,a){"use strict";a.r(e);var o=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("a-button",{attrs:{id:"add-rule",type:"primary"},on:{click:t.addRule}},[a("a-icon",{attrs:{type:"plus"}}),t._v(" New Rule ")],1),a("a-drawer",{attrs:{title:t.formAction+" MySQL rule",width:490,visible:t.formVisible,"body-style":{paddingBottom:"80px"}},on:{close:t.closeDrawer}},[a("a-form-model",{ref:"form",attrs:{model:t.form,layout:"vertical"},on:{submit:t.handleSubmit}},[a("BasicRule",{attrs:{form:t.form,readOnly:t.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:t.rules.files}},[a("a-input",{staticStyle:{width:"100%"},attrs:{placeholder:"please enter file name,use ';' to split multiple file names",readOnly:t.formReadOnly,disabled:t.form.exploit_jdbc_client},model:{value:t.form.files,callback:function(e){t.$set(t.form,"files",e)},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"}},[t._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:t.formReadOnly},model:{value:t.form.exploit_jdbc_client,callback:function(e){t.$set(t.form,"exploit_jdbc_client",e)},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"}},[t._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),t._l(t.payloadKeys,(function(e){return a("a-input-group",{key:e,attrs:{id:"payload",compact:""}},[a("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["Key-"+e],expression:"['Key-'+payloadKey,]"}],staticStyle:{width:"47%","margin-bottom":"5px"},attrs:{defaultOpen:!1,placeholder:"Key",disabled:!t.form.exploit_jdbc_client,readOnly:t.formReadOnly},model:{value:t.form["Key-"+e],callback:function(a){t.$set(t.form,"Key-"+e,a)},expression:"form['Key-'+payloadKey]"}}),a("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["Value-"+e],expression:"['Value-'+payloadKey,]"}],staticStyle:{width:"53%"},attrs:{placeholder:"Base64 encoded payload Value",disabled:!t.form.exploit_jdbc_client,readOnly:t.formReadOnly},on:{focus:function(){!t.formReadOnly&&e===t.payloadKeys[t.payloadKeys.length-1]&&t.form["Key-"+e]&&t.addPayload()}},model:{value:t.form["Value-"+e],callback:function(a){t.$set(t.form,"Value-"+e,a)},expression:"form['Value-'+payloadKey]"}},[a("a-icon",{staticClass:"dynamic-delete-button",attrs:{slot:"addonAfter",type:"minus-circle-o"},on:{click:function(){return t.form.exploit_jdbc_client?t.removePayload(e):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:t.handleCancel}},[t._v(" Cancel ")]),a("a-button",{attrs:{type:"primary",disabled:t.formReadOnly},on:{click:t.handleSubmit}},[t._v(" Submit ")])],1)],1),a("a-table",{staticStyle:{"overflow-x":"auto"},attrs:{columns:t.columns,"data-source":t.data,loading:t.loading,pagination:t.pagination},on:{change:t.handleTableChange},scopedSlots:t._u([{key:"filterDropdown",fn:function(e){var o=e.setSelectedKeys,i=e.selectedKeys,n=(e.clearFilters,e.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(t){return o(t.target.value?[t.target.value]:[])},pressEnter:function(){t.filters[n.dataIndex]=i[0],t.fetch()}}}),a("a-button",{staticStyle:{width:"90px","margin-right":"8px"},attrs:{type:"primary",icon:"search",size:"small"},on:{click:function(){t.filters[n.dataIndex]=i[0],t.fetch()}}},[t._v(" Search ")])],1)}},{key:"filterIcon",fn:function(t){return a("a-icon",{style:{color:t?"#108ee9":void 0},attrs:{type:"search"}})}},{key:"rank",fn:function(e){return a("span",{},[a("a-tag",{attrs:{color:"#"+(2996213+80*e).toString(16)}},[t._v(" "+t._s(e)+" ")])],1)}},{key:"switchRender",fn:function(e,o,i,n){return a("span",{},[a("a-switch",{attrs:{checked:e},on:{click:function(e){return t.clickSwitch(o,n.dataIndex)}}})],1)}},{key:"action",fn:function(e,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(e){return t.viewRule(o)}}},[t._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(e){return t.editRule(o,i)}}},[t._v("Edit")]),a("a-popconfirm",{attrs:{title:"Are you sure delete this task?","ok-text":"Yes","cancel-text":"No"},on:{confirm:function(e){return t.deleteRule(o,i)}}},[a("a-button",{attrs:{type:"danger",size:"small",ghost:""}},[t._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(t,e){l["store"].pageSize=e}},filters:{},loading:!1,columns:u,form:{},rules:p,payloadKeys:[1],formReadOnly:!1,formAction:""}},methods:{handleTableChange:function(t,e,a){var o=Object(n["a"])({},this.pagination);o.current=t.current,this.pagination=o,this.order="ascend"===a.order?"asc":"desc",this.fetch()},fetch:function(){var t=this,e=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"])(e).then((function(e){var a=e.data.result;t.data=a.data;var o=Object(n["a"])({},t.pagination);o.total=a.count,t.pagination=o,t.loading=!1})).catch((function(e){t.$notification.error({message:"Unknown error: "+e.response.status,style:{width:"400px",marginLeft:"".concat(-265,"px")},duration:4})}))},clickSwitch:function(t,e){var a=this;t[e]=!t[e],Object(r["n"])(t).then().catch((function(t){a.$notification.error({message:"Edit failed",description:t.response.data.error,style:{width:"600px",marginLeft:"".concat(-265,"px")},duration:4})}))},addRule:function(){this.form={},this.showForm(f)},viewRule:function(t){this.form=t,this.showForm(c)},editRule:function(t){this.form=JSON.parse(JSON.stringify(t)),this.showForm(d)},deleteRule:function(t,e){var a=this;Object(r["d"])(t).then((function(){a.data.splice(e,1)})).catch((function(t){a.$notification.error({message:"Error",description:t.response.data.error,style:{width:"600px",marginLeft:"".concat(-265,"px")},duration:4})}))},showForm:function(t){for(var e in this.formAction=t,this.formReadOnly=t===c,this.formVisible=!0,this.form.payloads)this.form["Key-"+this.payloadKeys.length]=e,this.form["Value-"+this.payloadKeys.length]=this.form.payloads[e],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(t){this.payloadKeys.length>1&&this.payloadKeys.splice(this.payloadKeys.indexOf(t),1)},handleSubmit:function(){var t=this;this.$refs.form.validate((function(e){if(e){var a={},o={};for(var i in t.form)if(0===i.indexOf("Key-")){var n=i.substr("Key-".length);t.form["Value-"+n]&&(a[t.form[i]]=t.form["Value-"+n])}else-1===i.indexOf("Value-")&&(o[i]=t.form[i]);o.payloads=a,Object(r["n"])(o).then((function(){t.closeDrawer(),t.fetch({page:t.pagination.current}),t.$notification.info({message:"Success",style:{width:"600px",marginLeft:"".concat(-265,"px")},duration:2.5})})).catch((function(e){t.$notification.error({message:t.formAction+" failed",description:e.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("6a0a"),a("2877")),g=Object(y["a"])(h,o,i,!1,null,"4fed8448",null);e["default"]=g.exports},"10bb":function(t,e,a){},"6a0a":function(t,e,a){"use strict";a("10bb")}}]);