Mitigações e Desvios Modernos de Exploits
Entenda as defesas que se interpõem entre uma vulnerabilidade e um exploit funcional: ASLR, DEP/NX, canários de pilha, CFG e as ideias gerais por trás de como contorná-las.
Mitigações e Desvios Modernos de Exploits é uma aula grátis de Reverse Engineering & Binary Analysis Basics no CoddyKit. Esta é a aula 4 de 4. Você pode ler a aula completa abaixo gratuitamente — depois pratica ao vivo no navegador com um editor de código integrado e um tutor de IA 24/7. Faz parte do caminho de aprendizado de Reverse Engineering & Binary Analysis Basics, e seu progresso é sincronizado entre a web e o app CoddyKit. O curso de Reverse Engineering & Binary Analysis Basics inclui 4 aulas no total.
Partes desta aula ainda não foram traduzidas e aparecem em inglês.
Why Exploits Got Harder
You can identify binary vulnerabilities, fuzz for bugs, and understand exploit primitives. Modern systems add mitigations that turn an easy bug into a hard one.
Knowing these defenses tells you what a working exploit must overcome.
Data Execution Prevention (DEP/NX)
DEP (a.k.a. the NX bit) marks memory as non-executable. Code injected onto the stack will not run.
This killed classic 'shellcode on the stack' attacks and pushed exploiters toward code reuse.
Return-Oriented Programming
To bypass DEP, attackers reuse existing executable code. ROP chains together short instruction sequences (gadgets) ending in ret to perform arbitrary actions without injecting code.
; a gadget
pop rdi
ret
; chained: set rdi, then call a real functionAddress Space Layout Randomization
ASLR randomizes where modules, stack, and heap load each run, so attackers cannot hardcode addresses.
Without a known address, both shellcode and ROP gadgets are hard to target.
Defeating ASLR with Leaks
ASLR is bypassed with an information leak: a bug that discloses a real runtime address. From one leaked pointer you compute the module base and locate your gadgets.
Many modern exploits are really 'leak then exploit' two-stage attacks.
Stack Canaries
A stack canary is a random value placed before the saved return address. A linear stack overflow overwrites it, and the function aborts on mismatch.
; epilogue check
mov rax, [rbp-8]
xor rax, fs:[0x28]
jne __stack_chk_failBypassing Canaries
Canaries are defeated by:
- Leaking the canary value, then writing it back unchanged
- Overwriting structures that skip the check (e.g. a non-linear write)
This is why info leaks are so valuable.
Control-Flow Integrity
CFI and Windows' CFG validate indirect calls and returns against a set of legitimate targets, breaking many ROP chains.
Hardware features like Intel CET add a shadow stack to protect return addresses.
RELRO and Fortify
Other hardening you will encounter:
- Full RELRO makes the GOT read-only, blocking GOT-overwrite tricks
- FORTIFY_SOURCE adds bounds checks to common functions
Check which are enabled before planning an approach.
checksec --file=./target
# RELRO: Full Canary: Yes NX: Yes PIE: YesThe Mitigation Mindset
Exploit development is an enumerate-then-bypass process: list active mitigations, then find the bug or leak that neutralizes each. Strong defenses do not make exploitation impossible, only more demanding.
PIE and Position Independence
PIE (Position Independent Executable) lets ASLR randomize the main binary itself, not just libraries. Without PIE, the executable loads at a fixed base, giving attackers reliable gadget addresses.
checksec reporting 'PIE: No' is a meaningful weakness worth noting.
Quick Check
Which technique is specifically designed to bypass DEP/NX by reusing existing executable code instead of injecting new code?
Recap
You now map the modern defensive landscape:
- DEP/NX blocks injected code; ROP reuses existing code
- ASLR randomizes addresses; info leaks defeat it
- Canaries, CFI/CFG, RELRO add further hurdles
Real exploitation means enumerating these and chaining bugs to bypass each.
Perguntas Frequentes
A aula “Mitigações e Desvios Modernos de Exploits” é grátis?
Sim — o texto completo de “Mitigações e Desvios Modernos de Exploits” é grátis para ler aqui na web. Para praticá-la interativamente (um editor de código integrado e um tutor de IA 24/7) e desbloquear o restante do curso de Reverse Engineering & Binary Analysis Basics, atualize para CoddyKit PRO. O curso de Reverse Engineering & Binary Analysis Basics inclui 4 aulas no total.
O que vou aprender em “Mitigações e Desvios Modernos de Exploits”?
Entenda as defesas que se interpõem entre uma vulnerabilidade e um exploit funcional: ASLR, DEP/NX, canários de pilha, CFG e as ideias gerais por trás de como contorná-las. Você pratica Reverse Engineering & Binary Analysis Basics com código prático que executa diretamente no navegador, e um tutor de IA 24/7 responde suas dúvidas enquanto trabalha na aula.
Preciso ter experiência prévia para começar Reverse Engineering & Binary Analysis Basics?
Nenhuma experiência prévia é necessária. Reverse Engineering & Binary Analysis Basics no CoddyKit é estruturado para alunos iniciantes até avançados, então você pode começar aqui ou desde o início e aprender no seu ritmo. Esta é a aula 4 de 4.
Quanto tempo leva a aula “Mitigações e Desvios Modernos de Exploits”?
A maioria das aulas CoddyKit leva cerca de 5–10 minutos. Cada uma é compacta e interativa, então você faz progresso constante e retoma exatamente de onde parou entre web e app.
Posso escrever e executar código nesta aula de Reverse Engineering & Binary Analysis Basics?
Sim. Cada aula de Reverse Engineering & Binary Analysis Basics inclui um editor de código integrado, então você escreve e executa código real direto no navegador e recebe feedback de IA instantaneamente — nenhuma configuração local necessária.
Todas as aulas deste curso
- Identificação de Vulnerabilidades em Binários
- Introdução ao Fuzzing
- Visão Geral das Primitivas de Exploração
- Mitigações e Desvios Modernos de Exploits