Zum Hauptinhalt springen
Echtzeit-Radar & Feeds
Alle RSS Feeds ➔
👥 Community & Social
Windows Tipps & SecurityGrafikkarte vor Überhitzung schützen: So geht’s(25.09.2026 um 08:00 Uhr)
••••••••••
Windows Tipps & SecurityGrafikkarte vor Überhitzung schützen: So geht’s(25.09.2026 um 08:00 Uhr)
••••••••••
Intelligence View
⚡ tsecurity.de Intelligence

A slightly better "Map" can get you there faster...

In JavaScript, the Map is a very useful built-in class that creates an O(1) lookup between a key and a value. const myMap = new Map() for(const file of files) { const [,extension] = file.name.split(".") …

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

In JavaScript, the Map is a very useful built-in class that creates an O(1) lookup between a key and a value.




const myMap = new Map()

for(const file of files) {
const [,extension] = file.name.split(".")
if(!myMap.has(extension)) {
myMap.set(extension, [])
}
myMap.get(extension).push(file)
}







You can use Maps for all sorts of things you are likely to do regularly:




  • Creating grouped lists of data, like the above example grouping by file extension


  • Aggregating data, like counting or summing values across a range of keys





const items = ['apple','apple','orange','banana','apple'];
const counts = new Map();
for (const item of items) {
counts.set(item, (counts.get(item) || 0) + 1);
}







  • Creating rapid lookups to be used in subsequent steps




const users = [
{id:1,name:'A',role:'admin'},
{id:2,name:'B',role:'user'},
{id:3,name:'C',role:'user'}
];
const userMap = new Map();
for (const u of users) {
userMap.set(u.id, u);
}






Map is preferred to using a simple object ({}) for a couple of reasons, so long as you don't have to store the result using a stringify:




  • It can take keys which are not strings

  • It's slightly faster than an Object even if you are using string keys



There can be a lot of boilerplate and mixed concerns though, if the object you are storing in the map needs construction, which is anything from a simple array to a complex object, this needs to be interspersed with the code that uses it.





const map = new Map()

for(const item of items) {
if(!map.has(item.type)) {
const newType = new Type(item.type, getInfoForType(item.type))
map.set(item.type, newType)
}
map.get(item.type).doSomething(item)

}







This "can" be ok, but it becomes harder to keep DRY if you need to update or initialise the value in multiple places.



For this reason I use a MapPlus class, which is an extension to Map that provides a missing key initialiser function that can be supplied to the constructor or as a second parameter to the get if the initialiser does need in context information beyond just the key.




class MapPlus extends Map {
constructor(missingFunction) {
super()
this.missingFunction = missingFunction
}

get(key, createIfMissing = this.missingFunction) {
let result = super.get(key)
if (!result && createIfMissing) {
result = createIfMissing(key)
if (result && result.then) {
const promise = result.then((value) => {
super.set(key, value)
return value
})
super.set(key, promise)
} else {
super.set(key, result)
}
}
return result
}
}






With this you can just do things like:




const map = new MapPlus(()=>[])

for(const item of items) {
map.get(item.type).push(item)
}







If the key is missing it will just make an empty array, but the loop itself is kept simple and clean, concerned only with making the list.



I often need two levels of this so I'll have maps defined like this:




const map = new MapPlus(()=>new MapPlus(()=>[]))
for(const item of items) {
map.get(item.type).get(item.subType).push(item)
}






The constructor function does get the key being used so we can also do:




const map = new MapPlus((type)=>new Type(type, getInfoForType(type))

for(const item of items) {
map.get(item.type).doSomething(item)
}








1. Sofort-Triage & Abwehrmaßnahmen

SOC Incident Playbook: Vulnerability Remediation & Verification
Syntax validiert (0 Fehler)
title: Detect Exploitation - A slightly better "Map" can get you there faster...
id: a3a957d7-e2ca-499c-8881-3358e3c05dde
status: experimental
description: Automatisch generierte SIEM-Erkennungsregel basierend auf CTI Intelligence
references:
  - https://tsecurity.de/
author: iShareStuff CTI Automated Detection Engine
date: 2026-09-26
logsource:
  category: network_connection
  product: any
detection:
  selection:
      CommandLine|contains:
        - 'exploit'
  condition: selection
falsepositives:
  - Legitime administrative Zugriffe oder Penetrationstests
level: high
tags:
  - attack.initial_access
Syntax validiert (0 Fehler)
rule CTI_Threat_Indicator {
    meta:
        author = "iShareStuff CTI Automated Detection Engine"
        date = "2026-09-26"
        description = "YARA Signature for "
    strings:
        $str = "A slightly better \"Map\" can ge" ascii wide
    condition:
        any of them
}
Syntax validiert (0 Fehler)
index=security sourcetype IN ("cisco:asa", "pan:traffic", "zeek_conn", "suricata", "WinEventLog:Security")
("A slightly better Map can get you there ")
| stats count earliest(_time) as first_seen latest(_time) as last_seen by src_ip, dest_ip, dest_host, signature
| eval first_seen=strftime(first_seen, "%Y-%m-%d %H:%M:%S"), last_seen=strftime(last_seen, "%Y-%m-%d %H:%M:%S")
| sort - count
Syntax validiert (0 Fehler)
message: "*A slightly better Map can get you there *"
Syntax validiert (0 Fehler)
CommonSecurityLog
| where Message has "A slightly better Map can get you there "
| summarize EventCount = count(), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated) by SourceIP, DestinationIP, DestinationPort, Activity
| extend DetectionRule = "iShareStuff-CTI-Compiled"
| sort by EventCount desc

2. Cyber Threat Intelligence & Forensik

CTI Threat Relationship Graph2 Knoten / 1 Relationen
CVE / Incident Software MITRE ATT&CK CWE Weakness IoC
🎯
MITRE ATT&CK Matrix Navigator 14 Taktiken
Reconnaissance
-
Resource Development
-
Initial Access
Execution
Persistence
-
Privilege Escalation
Defense Evasion
Credential Access
-
Discovery
-
Lateral Movement
-
Collection
-
Command and Control
Exfiltration
-
Impact
tsecurity.de Cognitive Threat RAG
Fokus-Vektor:

Kognitive Analyse für identifizierte Bedrohung: Erhöhte Bedrohungslage im Bereich A slightly better "Map" can get you ther.... Basierend auf 368k Vektor-Korrelationen werden sofortige Isolationsmaßnahmen für betroffene Endpunkte empfohlen.

🛡️ Angriffsfläche & Exposure

Netzwerk/Remote-Zugriff ohne Vorauthentifizierung möglich.

⚡ Empfohlene Sofortmaßnahmen
  • 1. Perimeter-Inspektion: Relevante Portfreigaben und exponierte Endpunkte unverzüglich scannen.
  • 2. Patch-Applikation: Hersteller-Hotfix einspielen oder betroffene Daemons in isolierte DMZ-Segmente überführen.
  • 3. Telemetrie & EDR-Alerts: Prozessaufrufe und Child-Processes auf anomale Shell-Spawns überwachen.
🔗 Semantisch verwandte Zero-Days MariaDB 11.7 VEC
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten A slightly better "Map" can get you there faster...

Thematisch verwandte Begriffe: slightly, better, there, faster · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-88003 | InvoicePlane is a self-hosted open source application for managing invoi…
Advisory →
tsecurity.de Icon
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag