How a Buffer Overflow Attack Actually Works
3-Second Blueprint (English)
- Copying 40 bytes into a 16-byte C stack buffer via unchecked strcpy overflows memory and overwrites the function's return address.
- Pointing that overwritten return address to attacker machine code injected inside the buffer hijacks CPU execution.
- 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)
- Kopiert strcpy ungeprüft 40 Bytes in einen 16-Byte-Stack-Puffer in C, überschreibt der Überlauf die Rücksprungadresse.
- Verweist die manipulierte Rücksprungadresse auf eingeschleusten Maschinencode im Puffer, führt die CPU Angreifercode aus.
- 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.