Brain-Score 90/100 TECH KodeKloud · 2:57

How a Buffer Overflow Attack Actually Works

3-Second Blueprint (English)

  1. Copying 40 bytes into a 16-byte C stack buffer via unchecked strcpy overflows memory and overwrites the function's return address.
  2. Pointing that overwritten return address to attacker machine code injected inside the buffer hijacks CPU execution.
  3. Modern systems defend against this with random compiler stack canaries and OS non-executable stack protection (NX / Windows DEP).
C stack frame & return addressstrcpy bounds checkingStack canaryNX bit / Windows DEP

3-Sekunden-Fazit (Deutsch)

  1. Kopiert strcpy ungeprüft 40 Bytes in einen 16-Byte-Stack-Puffer in C, überschreibt der Überlauf die Rücksprungadresse.
  2. Verweist die manipulierte Rücksprungadresse auf eingeschleusten Maschinencode im Puffer, führt die CPU Angreifercode aus.
  3. Moderne Systeme schützen dagegen mit zufälligen Compiler-Stack-Canaries und nicht ausführbarem Stack-Speicher (NX / Windows DEP).
C-Stackframe & Rücksprungadressestrcpy-LängenprüfungStack CanaryNX-Bit / Windows DEP

Note / Hinweis: Blueprints are AI-generated educational summaries (0% Politics · 0% Religion · 0% Brainrot) and do not constitute medical, legal, or financial advice. / KI-generierte Zusammenfassung zu Bildungszwecken – ersetzt keine medizinische, rechtliche oder finanzielle Fachberatung.