Benign javascript Download

script.js

Fetch call text with JSON-serialized bodysetTimeout call with an arrow callback
SHA-25677c63c2d59d15b0ae0a694870804cd5d88ba2d0333d90ba1f3c81ff750aa90f3

Evidence

Three slice calls with fixed interior offsets line 1
1!function(){"use strict";function e(e,t=2e3){return e.slice(0,t).replace(/https?:\/\/[^\s)]+/g,e=>{try{const t=e.match(/:\d+:\d+$/)?.[0]||"",n=new URL(t?e.slice(0,-t.length):e);return`${n.origin}${n.pathname}${t}`}catch{return"[url]"}}).replace(/[\w.+-]+@[\w.-]+\.[a-z]{2,}/gi,"[email]").replace(/\beyJ[\w-]+\.[\w-]+\.[\w-]+\b/g,"[token]").replace(/\b(password|secret|token|authorization|api[_-]?key)\s*[:=]\s*[^\s,;]+/gi,"$1=[redacted]").slice(0,t)}function t(t){try{return e(new URL(t,"https://localhost").pathname,500)}catch{return"/"}}function n(t={}){return Object.fromEntries(Object.entries(t).slice(0,20).filter(([e])=>!/password|secret|token|authorization|cookie|email|api.?key/i.test(e)).map(([t,n])=>[e(t,50),e(String(n),200)]))}function a(){if("function"==typeof crypto.randomUUID)return crypto.randomUUID();const e=crypto.getRandomValues(new Uint8Array(16));e[6]=15&e[6]|64,e[8]=63&e[8]|128;const t=Array.from(e,e=>e.toString(16).padStart(2,"0")).join("");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}function r(r){const i=new WeakMap,o=[];let s=!1,c=!1,l=0,d=0,u=0;async function f(f,m={},p=!0){try{if(!r.enabled||c||r.disabled()||o.length>=20)return;cons …
Calls fetch line 1
1:1835… ironment||r.environment,50),tags:n(m.tags),...m.fingerprint?.length?{fingerprint:m.fingerprint.slice(0,5).map(t=>e(t,200))}:{}};let S;c=!0;try{S=r.beforeSend(T)}finally{c=!1}const k=await S;if(!k||r.disabled())return;o.push({payload:{...k,website:T.website,eventId:T.eventId,timestamp:h,version:1},cache:b}),async function(){if(!s){s=!0;try{for(;o.length;){const e=o.shift();if(!e||r.disabled())continue;const t=JSON.stringify({type:"error",payload:e.payload});if(!((new TextEncoder).encode(t).byteLength>48e3))for(let n=0;n<3&&!r.disabled();n++){try{const n=await fetch(r.endpoint,{method:"POST",keepalive:!0,credentials:"omit",body:t,headers:{"Content-Type":"application/json",...e.cache?{"x-umami-cache":e.cache}:{}}});if(n.ok){const t=await n.json();t.cache&&r.cache()===e.cache&&r.context().id===e.payload.id&&r.updateCache(t.cache);break}if(429===n.status){o.length=0;const e=Number(n.headers.get("Retry-After"))||60;l=Date.now()+1e3*Math.max(1,Math.min(e,300));break}if(n.status<500)break}catch{}n<2&&await new Promise(e=>setTimeout(e,1e3*2**n))}}}finally{s=!1}}}().catch(()=>{})}catch{}}return r.enabled&&(window.addEventListener("error",e=>{e.message&&f(e.error||{name:"Error",message:e.message,stack:e.fi …
Pageview analytics event token line 1
1:4127… k("fetch-credentials")||"omit",R=k("performance")===T,P=k("auto-pageview")!==w,z=C.split(",").map(e=>e.trim()),_=`${(E||"https://gateway.umami.is").replace(/\/$/,"")}/api/send`,J=`${t}x${n}`,K=/data-umami-event-([\w-_]+)/,W=`${v}umami-event`,B=300,V=e=>{if(!e)return e;try{const t=new URL(e,s.href);return A&&(t.search=""),D&&(t.hash=""),t.toString()}catch{return e}},q=()=>{if(I)return I;const e={hourly:13,daily:10,weekly:10,monthly:7}[U];if(!e)return;const t=new Date;return"weekly"===U&&t.setUTCDate(t.getUTCDate()-t.getUTCDay()),t.toISOString().slice(0,e)},F=()=>{return{website:x,screen:J,language:a,title:c.title,hostname:h,url:re,referrer:(e=ie,e===g||e?.startsWith(`${g}/`)?e.slice(g. …
Immediately invokes an async function line 1
1:4874… ,n)=>{n&&("function"==typeof ae&&ae(),ie=re,re=V(n),re!==ie&&P&&setTimeout(Z,B))},H=()=>{c.addEventListener("click",e=>{const t=e.target;if(!t||"function"!=typeof t.closest)return;const n=t.closest(`[${W}]`);if(!n)return;return(async(e,t)=>{const n=e.getAttribute(W);if(n){const a={};return e.getAttributeNames().forEach(t=>{const n=t.match(K);n&&(a[n[1]]=e.getAttribute(t))}),X({...F(),name:n,data:a},"event",t)}})(n,t=>{if("A"!==n.tagName||!n.href)return;co …
Calls fetch with a POST method option line 1
1:5394… ||e.metaKey||1===e.button)return;e.preventDefault();const i=()=>setTimeout(()=>{("_top"===r?d.location:s).href=a});t.then(i,i)})},!0)},Q=()=>se||!x||b?.getItem("umami.disabled")||"umami.disabled"===e.name&&d!==e||C&&!z.includes(h)||O&&(()=>{const e=u||i||o;return 1===e||"1"===e||"yes"===e})(),X=async(e,t="event",n)=>{if(Q())return;const a=$();if("function"==typeof a){const r=a(t,e);"function"==typeof r?.then&&n?.(Promise.resolve(r)),e=await r}if(e)try{const n=await fetch(_,{keepalive:!0,method:"POST",body:JSON.stringify({type:t,payload:e}),headers:{"Content-Type":"application/json","x-umami-website-id":x,"x-umami-hostname":h,...void 0!==ne&&{"x-umami-cache":ne}},credentials:N}),a=await n.json();a&&(se=!!a.disabled,ne=a.cache)}catch{}},Y=()=>{oe||(oe=!0,P&&Z(),(()=>{const e=(e,t,n)=>{const a=e[t];return(...t)=>{const r=a.apply(e,t);return n.apply(null,t),r}};l.pushState=e(l,"pushState",G),l …

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.