import{d as e,af as l,dv as t,C as a,A as i,W as r,O as s,bd as o,s as n,a7 as u,a as p,o as d,c,f as m,Q as h,a4 as v,i as g,e as f,L as y,aM as b,aS as _,bl as x,ae as j,B as w,n as S,J as k,H as R,t as z,j as E,cZ as L,M as U,al as D,r as H,N as C,a1 as N,X as W,Y as I,U as $,w as M,$ as q,a0 as A,l as P,_ as V}from"./index-DDHcjopZ.js";import{u as T}from"./useTable-DLJVogQf.js";import{E as O}from"./el-card-CuVKwz2M.js";import{E as B}from"./el-select-C2ZuyQeW.js";import"./el-tag-CAhOIzri.js";import"./el-popper-CKFwqsZp.js";import{E as F,a as J}from"./el-col-DqH3JWc6.js";import{E as K}from"./el-text-BURUbWKR.js";import{_ as X}from"./Dialog.vue_vue_type_style_index_0_lang-C3UWm73z.js";import{_ as Z}from"./Table.vue_vue_type_script_lang-DQcq6jzp.js";import{u as G}from"./useCrudSchemas-DrHRLhW2.js";import{r as Q}from"./index-DXl3uH5Z.js";import{_ as Y}from"./Csearch.vue_vue_type_script_setup_true_lang-CAF73pws.js";import"./useInput-B8ihujou.js";import"./debounce-mfTra9hX.js";import"./refs-JNELT3Rn.js";import"./el-checkbox-BJlhBIiO.js";import"./el-tooltip-l0sNRNKZ.js";import"./el-image-viewer-ELp78_NH.js";import"./tsxHelper-Cq5JD9lB.js";import"./el-dropdown-item-BKXq8FsE.js";import"./castArray-BkLeP3z1.js";import"./index-CG0kw4Dk.js";import"./raf-efFBxEsV.js";import"./tree-BfZhwLPs.js";import"./ContentWrap.vue_vue_type_script_setup_true_lang-eEWBoMS4.js";import"./el-divider-BW_dLdwQ.js";import"./el-form-item-D0ZdsA3F.js";import"./useIcon-Cvbbg4H7.js";import"./exportData.vue_vue_type_script_setup_true_lang-BsaDxt1M.js";import"./el-tab-pane-BhIgdPAB.js";import"./el-radio-group-BTwue__K.js";const ee=Symbol("elDescriptions");var le=e({name:"ElDescriptionsCell",props:{cell:{type:Object},tag:{type:String,default:"td"},type:{type:String}},setup:()=>({descriptions:l(ee,{})}),render(){var e,l,n,u,p,d,c;const m=t(this.cell),h=((null==(e=this.cell)?void 0:e.dirs)||[]).map((e=>{const{dir:l,arg:t,modifiers:a,value:i}=e;return[l,i,t,a]})),{border:v,direction:g}=this.descriptions,f="vertical"===g,y=(null==(u=null==(n=null==(l=this.cell)?void 0:l.children)?void 0:n.label)?void 0:u.call(n))||m.label,b=null==(c=null==(d=null==(p=this.cell)?void 0:p.children)?void 0:d.default)?void 0:c.call(d),_=m.span,x=m.align?`is-${m.align}`:"",j=m.labelAlign?`is-${m.labelAlign}`:x,w=m.className,S=m.labelClassName,k={width:a(m.width),minWidth:a(m.minWidth)},R=i("descriptions");switch(this.type){case"label":return r(s(this.tag,{style:k,class:[R.e("cell"),R.e("label"),R.is("bordered-label",v),R.is("vertical-label",f),j,S],colSpan:f?_:1},y),h);case"content":return r(s(this.tag,{style:k,class:[R.e("cell"),R.e("content"),R.is("bordered-content",v),R.is("vertical-content",f),x,w],colSpan:f?_:2*_-1},b),h);default:return r(s("td",{style:k,class:[R.e("cell"),x],colSpan:_},[o(y)?void 0:s("span",{class:[R.e("label"),S]},y),s("span",{class:[R.e("content"),w]},b)]),h)}}});const te=n({row:{type:u(Array),default:()=>[]}}),ae={key:1},ie=e({name:"ElDescriptionsRow"});var re=y(e({...ie,props:te,setup(e){const t=l(ee,{});return(e,l)=>"vertical"===p(t).direction?(d(),c(h,{key:0},[m("tr",null,[(d(!0),c(h,null,v(e.row,((e,l)=>(d(),g(p(le),{key:`tr1-${l}`,cell:e,tag:"th",type:"label"},null,8,["cell"])))),128))]),m("tr",null,[(d(!0),c(h,null,v(e.row,((e,l)=>(d(),g(p(le),{key:`tr2-${l}`,cell:e,tag:"td",type:"content"},null,8,["cell"])))),128))])],64)):(d(),c("tr",ae,[(d(!0),c(h,null,v(e.row,((e,l)=>(d(),c(h,{key:`tr3-${l}`},[p(t).border?(d(),c(h,{key:0},[f(p(le),{cell:e,tag:"td",type:"label"},null,8,["cell"]),f(p(le),{cell:e,tag:"td",type:"content"},null,8,["cell"])],64)):(d(),g(p(le),{key:1,cell:e,tag:"td",type:"both"},null,8,["cell"]))],64)))),128))]))}}),[["__file","descriptions-row.vue"]]);const se=n({border:{type:Boolean,default:!1},column:{type:Number,default:3},direction:{type:String,values:["horizontal","vertical"],default:"horizontal"},size:b,title:{type:String,default:""},extra:{type:String,default:""}}),oe=e({name:"ElDescriptions"});var ne=y(e({...oe,props:se,setup(e){const l=e,t=i("descriptions"),a=_(),r=x();j(ee,l);const s=w((()=>[t.b(),t.m(a.value)])),o=(e,l,t,a=!1)=>(e.props||(e.props={}),l>t&&(e.props.span=t),a&&(e.props.span=l),e),n=()=>{if(!r.default)return[];const e=L(r.default()).filter((e=>{var l;return"ElDescriptionsItem"===(null==(l=null==e?void 0:e.type)?void 0:l.name)})),t=[];let a=[],i=l.column,s=0;return e.forEach(((r,n)=>{var u;const p=(null==(u=r.props)?void 0:u.span)||1;if(ni?i:p),n===e.length-1){const e=l.column-s%l.column;return a.push(o(r,e,i,!0)),void t.push(a)}p(d(),c("div",{class:S(p(s))},[e.title||e.extra||e.$slots.title||e.$slots.extra?(d(),c("div",{key:0,class:S(p(t).e("header"))},[m("div",{class:S(p(t).e("title"))},[k(e.$slots,"title",{},(()=>[R(z(e.title),1)]))],2),m("div",{class:S(p(t).e("extra"))},[k(e.$slots,"extra",{},(()=>[R(z(e.extra),1)]))],2)],2)):E("v-if",!0),m("div",{class:S(p(t).e("body"))},[m("table",{class:S([p(t).e("table"),p(t).is("bordered",e.border)])},[m("tbody",null,[(d(!0),c(h,null,v(n(),((e,l)=>(d(),g(re,{key:l,row:e},null,8,["row"])))),128))])],2)],2)],2))}}),[["__file","description.vue"]]);const ue=e({name:"ElDescriptionsItem",props:n({label:{type:String,default:""},span:{type:Number,default:1},width:{type:[String,Number],default:""},minWidth:{type:[String,Number],default:""},align:{type:String,default:"left"},labelAlign:{type:String,default:""},className:{type:String,default:""},labelClassName:{type:String,default:""}})}),pe=U(ne,{DescriptionsItem:ue}),de=D(ue),ce={style:{whiteSpace:"pre-line",width:"500px"}},me={style:{whiteSpace:"pre-line"}};function he(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!A(e)}const ve=V(e({__name:"vul",setup(e){const{t:l}=P(),t=[{keyword:"url",example:'url="http://example.com"',explain:l("searchHelp.url")},{keyword:"vulname",example:'vulname="nginxwebui-runcmd-rce"',explain:l("searchHelp.vulname")},{keyword:"level",example:'level="info',explain:l("searchHelp.level")},{keyword:"matched",example:'matched="https://example.com"',explain:l("searchHelp.matched")},{keyword:"request",example:'request="cmd=whoami"',explain:l("searchHelp.vulRequest")},{keyword:"response",example:'response="root"',explain:l("searchHelp.response")},{keyword:"project",example:'project="Hackerone"',explain:l("searchHelp.project")}],a=H(""),i=e=>{a.value=e,x()},r=C([{field:"index",label:l("tableDemo.index"),type:"index",minWidth:10},{field:"url",label:"URL",minWidth:30},{field:"vulnerability",label:"Vulnerability",minWidth:20},{field:"level",label:"Level",minWidth:10,formatter:(e,t,a)=>{if(null==a)return f("div",null,null);let i="",r="";return 6===a?(i="red",r=l("poc.critical")):5===a?(i="orange",r=l("poc.high")):4===a?(i="yellow",r=l("poc.medium")):3===a?(i="blue",r=l("poc.low")):2===a?(i="green",r=l("poc.info")):1===a&&(i="gray",r=l("poc.unknown")),f(J,{gutter:20,style:"width: 80%"},{default:()=>[f(F,{span:1},{default:()=>[f(N,{icon:"clarity:circle-solid",color:i},null)]}),f(F,{span:5},{default:()=>[f(K,{type:"info"},he(r)?r:{default:()=>[r]})]})]})}},{field:"matched",label:"Matched",minWidth:30},{field:"time",label:l("asset.time"),minWidth:20},{field:"action",label:l("tableDemo.action"),formatter:(e,t,a)=>{let i;return f(h,null,[f(W,{type:"primary",onClick:()=>U(e)},he(i=l("asset.detail"))?i:{default:()=>[i]})])},minWidth:10}]),{allSchemas:s}=G(r),{tableRegister:o,tableState:n,tableMethods:u}=T({fetchDataApi:async()=>{const{currentPage:e,pageSize:l}=n,t=await((e,l,t)=>Q.post({url:"/api/vul/data",data:{search:e,pageIndex:l,pageSize:t}}))(a.value,e.value,l.value);return{list:t.data.list,total:t.data.total}},immediate:!1}),{loading:v,dataList:g,total:y,currentPage:b,pageSize:_}=n,{getList:x}=u;function j(){return{background:"var(--el-fill-color-light)"}}_.value=20,I((()=>{S(),window.addEventListener("resize",S)}));const w=H(0),S=()=>{const e=window.innerHeight||document.documentElement.clientHeight;w.value=.7*e},k=C({URL:"",Vulnerability:"",Level:"",Matched:"",Time:"",Request:"",Response:""}),E=H(""),L=H(!1),U=e=>{const t=e.level;E.value="";let a="";6===t?(E.value="red",a=l("poc.critical")):5===t?(E.value="orange",a=l("poc.high")):4===t?(E.value="yellow",a=l("poc.medium")):3===t?(E.value="blue",a=l("poc.low")):2===t?(E.value="green",a=l("poc.info")):1===t&&(E.value="gray",a=l("poc.unknown")),k.Level=a,k.Vulnerability=e.vulnerability,k.Matched=e.matched,k.Time=e.time,k.URL=e.url,k.Request=e.request,k.Response=e.response,L.value=!0};return(e,a)=>{const r=$("ElScrollbar");return d(),c(h,null,[f(Y,{getList:p(x),handleSearch:i,searchKeywordsData:t,index:"vulnerability"},null,8,["getList"]),f(p(J),null,{default:M((()=>[f(p(F),null,{default:M((()=>[f(p(O),null,{default:M((()=>[f(p(Z),{pageSize:p(_),"onUpdate:pageSize":a[0]||(a[0]=e=>q(_)?_.value=e:null),currentPage:p(b),"onUpdate:currentPage":a[1]||(a[1]=e=>q(b)?b.value=e:null),columns:p(s).tableColumns,data:p(g),stripe:"",border:!0,"max-height":w.value,loading:p(v),resizable:!0,onRegister:p(o),headerCellStyle:j,style:{fontFamily:"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji"}},null,8,["pageSize","currentPage","columns","data","max-height","loading","onRegister"])])),_:1})])),_:1}),f(p(F),{":span":24},{default:M((()=>[f(p(O),null,{default:M((()=>[f(p(B),{pageSize:p(_),"onUpdate:pageSize":a[2]||(a[2]=e=>q(_)?_.value=e:null),currentPage:p(b),"onUpdate:currentPage":a[3]||(a[3]=e=>q(b)?b.value=e:null),"page-sizes":[20,50,100,200,500,1e3],layout:"total, sizes, prev, pager, next, jumper",total:p(y)},null,8,["pageSize","currentPage","total"])])),_:1})])),_:1})])),_:1}),f(p(X),{modelValue:L.value,"onUpdate:modelValue":a[4]||(a[4]=e=>L.value=e),title:p(l)("asset.detail"),center:"",style:{"border-radius":"15px","box-shadow":"5px 5px 10px rgba(0, 0, 0, 0.3)"},width:"70%","max-height":w.value},{default:M((()=>[f(p(pe),{border:!0,column:2},{default:M((()=>[f(p(de),{label:"URL"},{default:M((()=>[R(z(k.URL),1)])),_:1}),f(p(de),{label:"Level"},{default:M((()=>[f(p(J),{gutter:20,style:{width:"80%"}},{default:M((()=>[f(p(F),{span:1},{default:M((()=>[f(p(N),{icon:"clarity:circle-solid",color:E.value},null,8,["color"])])),_:1}),f(p(F),{span:5},{default:M((()=>[f(p(K),{type:"info"},{default:M((()=>[R(z(k.Level),1)])),_:1})])),_:1})])),_:1})])),_:1}),f(p(de),{label:"Vulnerability"},{default:M((()=>[R(z(k.Vulnerability),1)])),_:1}),f(p(de),{label:"Matched"},{default:M((()=>[R(z(k.Matched),1)])),_:1}),f(p(de),{label:"Time",span:2},{default:M((()=>[R(z(k.Time),1)])),_:1}),f(p(de),{label:"Request"},{default:M((()=>[f(r,{"max-height":w.value,"max-width":"maxHeight"},{default:M((()=>[m("div",ce,z(k.Request),1)])),_:1},8,["max-height"])])),_:1}),f(p(de),{label:"Response"},{default:M((()=>[f(r,{"max-height":w.value},{default:M((()=>[m("div",me,z(k.Response),1)])),_:1},8,["max-height"])])),_:1})])),_:1})])),_:1},8,["modelValue","title","max-height"])],64)}}}),[["__scopeId","data-v-468ed8ab"]]);export{ve as default};