"use strict";(self.webpackChunkvt_ui_main=self.webpackChunkvt_ui_main||[]).push([[60996],{77569:(t,e,r)=>{r.d(e,{f:()=>l});var i=r(22894),n=r(42246);function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function s(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}class l extends((0,n.t1)(((t,e)=>i.h4.collections.listRelationship(t,"subscription_preferences",function(t){for(var e=1;et.data))){constructor(t,e){super(t,e),this.id=t}unsubscribeTo(t){return i.h4.collections.unsubscribe(t)}}},60996:(t,e,r)=>{r.d(e,{n:()=>A});var i=r(53967),n=r(92815),o=r(33917),s=r(22894),l=r(60233),a=r(47123),c=r(70051),u=r(39807),d=r(96987),h=r(55966),p=r(42246),f=r(36809);class g extends((0,p.t1)((t=>s.h4.collections.get(t,[],void 0,{attributes:["subscribers_count"]})),(t=>t.data.attributes.subscribers_count))){}var v=r(77569);function b(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function m(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}class y extends((0,p.tV)((function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return s.h4.collections.listRelationship(t,"related_collections",function(t){for(var e=1;e(0,n.h)(t)))){constructor(){super(...arguments),this.title="Collections with IoCs in common",this.description="Other collections where the IOCs belong to",this.relationshipType="related_collections"}}var w=r(1770);function O(t,e,r,i,n,o,s){try{var l=t[o](s),a=l.value}catch(t){return void r(t)}l.done?e(a):Promise.resolve(a).then(i,n)}function _(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function j(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}class P extends((0,p.tV)(((t,e)=>s.h4.collections.listRelationship(t,"threat_actors",function(t){for(var e=1;ew.$.threatActor.process((0,n.h)(t))),1)){constructor(t,e){super(t,e),this.collectionId=t}update(t){var e,r=this;return(e=function*(){const e=new Set(t),i=new Set(r.data.map((t=>t.id))),n=r.data.filter((t=>{let r=t.id;return!e.has(r)})).map((t=>({id:t.id,type:"threat_actor"}))),o=t.filter((t=>!i.has(t))).map((t=>({id:t,type:"threat_actor"})));n.length&&(yield s.h4.collections.deleteBatchedRelationship(r.collectionId,"threat_actors",n)),o.length&&(yield s.h4.collections.createBatchedRelationship(r.collectionId,"threat_actors",o)),yield r.reload(!0)},function(){var t=this,r=arguments;return new Promise((function(i,n){var o=e.apply(t,r);function s(t){O(o,i,n,s,l,"next",t)}function l(t){O(o,i,n,s,l,"throw",t)}s(void 0)}))})()}}function I(t,e,r,i,n,o,s){try{var l=t[o](s),a=l.value}catch(t){return void r(t)}l.done?e(a):Promise.resolve(a).then(i,n)}function C(t){return function(){var e=this,r=arguments;return new Promise((function(i,n){var o=t.apply(e,r);function s(t){I(o,i,n,s,l,"next",t)}function l(t){I(o,i,n,s,l,"throw",t)}s(void 0)}))}}function S(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function E(t){for(var e=1;e1&&void 0!==arguments[1]&&arguments[1];super((e=>c.Nm.getCollection(t,e)),(t=>(0,n.h)(t.data))),e=this,this.collectionId=t,this._content="",this.isLoadingContent=!1,this.contentError="",this.stoppedPolling=!1,this.timeoutAggregationsError=!1,this.maxAggregationsCalculationTime=12e4,this.subscribersCount=()=>new g(this.collectionId),this.aggregations=()=>this.isEphemeral()?(0,p.hH)((()=>s.h4.collections.get(`${this.collectionId}/aggregations`,[],void 0)),(t=>{var e;return(null===(e=t.data.attributes)||void 0===e?void 0:e.aggregations)||{}})):(0,p.hH)((t=>s.h4.collections.get(this.collectionId,[],t?(0,l.pv)({}):{},{attributes:["aggregations"]})),(t=>{var e;return(null===(e=t.data.attributes)||void 0===e?void 0:e.aggregations)||{}})),this.files=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.updatableSC("files",(r=>t.order||t.filter?s.h4.collections.search(e.collectionId,"files",t.filter||"",E({limit:10,attributes:u.xl},t),(0,l.pv)({})):s.h4.collections.listRelationship(e.collectionId,"files",E({limit:10,attributes:u.xl},t),r?(0,l.pv)({}):{})),(t=>"error"in t?{data:t}:new f.Sw(t)))},this.urls=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.updatableSC("urls",(r=>t.order||t.filter?s.h4.collections.search(e.collectionId,"urls",t.filter||"",E({limit:10,relationships:["last_serving_ip_address","network_location"],attributes:u.yU},t),(0,l.pv)({})):s.h4.collections.listRelationship(e.collectionId,"urls",E({limit:10,relationships:["last_serving_ip_address","network_location"],attributes:u.yU},t),r?(0,l.pv)({}):{})),(t=>"error"in t?"context_attributes"in t&&"url"in t.context_attributes?{data:t}:null:new f.pC(t)))},this.domains=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.updatableSC("domains",(r=>t.order||t.filter?s.h4.collections.search(e.collectionId,"domains",t.filter||"",E({limit:10,relationships:["parent","resolutions"],attributes:u.TR},t),(0,l.pv)({})):s.h4.collections.listRelationship(e.collectionId,"domains",E({limit:10,relationships:["parent","resolutions"],attributes:u.TR},t),r?(0,l.pv)({}):{})),(t=>"error"in t?{data:t}:new f.aX(t)))},this.ips=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.updatableSC("ip_addresses",(r=>t.order||t.filter?s.h4.collections.search(e.collectionId,"ip_addresses",t.filter||"",E({limit:10,attributes:u.UQ},t),(0,l.pv)({})):s.h4.collections.listRelationship(e.collectionId,"ip_addresses",E({limit:10,attributes:u.UQ},t),r?(0,l.pv)({}):{})),(t=>"error"in t?{data:t}:new f.tw(t)))},this.getAssociations=C((function*(){const t=new a.Y(e.collectionId);return yield t.relationshipsCreated,t.relationships.associations})),this.getExploits=C((function*(){const t=new a.Y(e.collectionId);return yield t.relationshipsCreated,t.relationships.files})),this.getOverlapping=C((function*(){const t=new a.Y(e.collectionId);return yield t.relationshipsCreated,t.relationships.overlapping})),this.getReports=C((function*(){const t=new a.Y(e.collectionId);return yield t.relationshipsCreated,t.relationships.reports})),this.getCuratedYaraRulesets=C((function*(){const t=new a.Y(e.collectionId);return yield t.relationshipsCreated,t.relationships.hunting_rulesets})),this.getSuspectedGroups=C((function*(){const t=new a.Y(e.collectionId);return yield t.relationshipsCreated,t.relationships.suspected_threat_actors})),this.getAssociatedThreatActors=C((function*(){const t=new a.Y(e.collectionId);return yield t.relationshipsCreated,t.relationships.threat_actors})),this.getReferenceScreenshotUrl=C((function*(){return s.h4.amendLinkHost(`https://www.virustotal.com/ui/collections/${e.collectionId}/screenshot`)})),this.getMalware=C((function*(){const t=new a.Y(e.collectionId);return yield t.relationshipsCreated,t.relationships.malware_families})),this.getComments=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,p.hN)((r=>s.h4.collections.listRelationship(e.collectionId,"comments",E({relationships:["author"],limit:10},t),r?(0,l.pv)({}):{})),(t=>d.w9.commentFormatter((0,n.h)(t))))},this.getReferences=C((function*(){const t=new a.Y(e.collectionId);return yield t.relationshipsCreated,t.relationships.related_references})),this.updateReferences=function(){var t=C((function*(t,r){const i=new Set(t),n=new Set(r.dataObjects.map((t=>t.id))),o=r.dataObjects.filter((t=>{let e=t.id;return!i.has(e)})).map((t=>({id:t.id,type:"reference"}))),l=t.filter((t=>!n.has(t))).map((t=>({id:t,type:"reference"})));return o.length&&(yield s.h4.collections.deleteBatchedRelationship(e.collectionId,"references",o)),l.length&&(yield s.h4.collections.createBatchedRelationship(e.collectionId,"references",l)),yield r.reload(!0),r}));return function(e,r){return t.apply(this,arguments)}}(),this.subscriptionPreferences=()=>new v.f(this.collectionId,{}),this.threatActors=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new P(e.collectionId,t)},this.stats=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,p.hH)((()=>s.h4.collections.listRelationship(e.collectionId,"stats",E({},t))),(t=>{let e=t.data;return null==e?void 0:e.attributes}))},this.getAutogeneratedGraphs=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,p.hN)((()=>s.h4.collections.listRelationship(e.collectionId,"autogenerated_graphs",E(E({},t),{},{attributes:["graph_data"]}))),(t=>{var e;return{id:t.id,description:null===(e=t.attributes.graph_data)||void 0===e?void 0:e.description}}))},this.relatedRelationships=r?[]:[new y(this.collectionId)]}get content(){return this._content}set content(t){this._content=t}get isComputingAggregations(){var t;return!this.isError&&!this.isLoading&&(null===(t=this.data)||void 0===t?void 0:t.status)===i.Collection_CollectionStatus.PENDING_RECOMPUTE}get isError(){var t,e;return!(!this.timeoutAggregationsError&&(this.isLoading||(null===(t=this.data)||void 0===t?void 0:t.status)!==i.Collection_CollectionStatus.STATUS_UNKNOWN)&&(null===(e=this.data)||void 0===e?void 0:e.status)!==i.Collection_CollectionStatus.UNRECOGNIZED)}remove(){return s.h4.collections.delete(this.collectionId).then((()=>{this._data=void 0,this.notify()}))}isEphemeral(){return!!c.Nm.matchEphemeral(this.collectionId)}update(t){var e=this;return C((function*(){yield s.h4.collections.patch(e.collectionId,t,T),yield e.nonLoadingStateUpdate()}))()}exportSection(t,e){if(!this.data)throw new Error("The collection is not loaded");return c.Nm.exportSection(this.data,t,e)}getAllIocsIds(t){var e=this;return C((function*(){const r=[],i=yield Promise.all([...t].map(function(){var t=C((function*(t){return(yield s.h4.collections.exportRelationshipOrAggregations(e.collectionId,t,"json"))[t]}));return function(e){return t.apply(this,arguments)}}()));return i.forEach((t=>t&&r.push(...t))),r}))()}nonLoadingStateUpdate(){return this.loadFactory(!0).then((t=>this.processResponse(t))).then((()=>{this.computingAggregations(performance.now()).then((()=>this.notify()))}))}preloadIocs(){var t=this;return C((function*(){yield Promise.all([t.files().load(),t.urls().load(),t.domains().load(),t.ips().load()])}))()}getContent(){var t=this;return C((function*(){if(!t.content){t.isLoadingContent=!0;try{t.content=(yield s.h4.collections.getContent(t.collectionId)).data}catch(e){throw t.contentError=h.T.getMessageError(e),e.status}finally{t.isLoadingContent=!1,t.notify()}}}))()}loadUntilComputed(t){var e=()=>super.load,r=this;return C((function*(){return e().call(r,t).then((()=>{r.computingAggregations(performance.now()).then((()=>r.notify()))}))}))()}computingAggregations(t){var e=this;return C((function*(){var r;if((null===(r=e.data)||void 0===r?void 0:r.status)===i.Collection_CollectionStatus.COMPUTED||!e.data||e.stoppedPolling)return;let n;try{n=yield s.h4.collections.get(e.data.id,void 0,(0,l.pv)({}),{attributes:["status","top_icon_md5","autogenerated_tags","tags"]})}catch(t){throw t}if(e.data.status=n.data.attributes.status,e.data.top_icon_md5=n.data.attributes.top_icon_md5||[],e.data.tags=n.data.attributes.tags,e.data.autogenerated_tags=n.data.attributes.autogenerated_tags,performance.now()-t>e.maxAggregationsCalculationTime)throw e.timeoutAggregationsError=!0,e.notify(),new Error("Something went wrong processing commonalities");e.data.status===i.Collection_CollectionStatus.PENDING_RECOMPUTE&&setTimeout(C((function*(){e.computingAggregations(t)})),1e3)}))()}stopPollingAggregations(){this.stoppedPolling=!0}updatableSC(t,e,r){const i=this;return new class extends((0,p.jC)((()=>e),r,2)){get data(){return super.data.filter((t=>null!==t))}delete(e){var r=this;return C((function*(){yield s.h4.collections.deleteBatchedRelationship(i.collectionId,t,e),i.nonLoadingStateUpdate(),r.reset(),yield r.load(!0)}))()}add(e){var r=this;return C((function*(){yield s.h4.collections.createBatchedRelationship(i.collectionId,t,e),i.nonLoadingStateUpdate(),r.reset(),yield r.load(!0)}))()}}}exportRules(t){return s.h4.crowdSourcedRules.exportRules(t)}mitreTree(t){return s.h4.collections.getMitreTree(this.collectionId,t)}mitreFormat(){return s.h4.collections.getMitreFormat(this.collectionId)}eventsTimeline(){const t=t=>{const e=[...t.related_collections||[]].sort(((t,e)=>(t.first_seen||0)-(e.first_seen||0)))[0];return null==e?void 0:e.first_seen};return new o.F((()=>s.h4.collections.eventsTimeline(this.collectionId)),(e=>e.data.map((e=>E(E({},e),{},{event_at:e.event_at||t(e)}))).sort(((t,e)=>(t.event_at||Number.MAX_VALUE)-(e.event_at||Number.MAX_VALUE)))))}associationsTimeline(){return(0,p.hH)((()=>s.h4.collections.associationsTimeline(this.collectionId)),(t=>t))}}}}]); //# sourceMappingURL=60996.983526759ca0347814a6.js.map