-
(Português) Prova de conceito criada para mostrar como o Mini-WAF funciona e consegue contornar ataques diretos a vários servidores.
-
(English) Proof of Concept created to show how Mini-WAF works and can avoid directly attacks to many servers.
-
(Português) Manual para preparo do ambiente de testes
- Requisitos
- Ambiente de reprodução
- Resultados da pesquisa
- Licença do projeto e mantenedores
-
(English) Guide to prepare the test environment
- Requirements
- Reproduction environment
- Research results
- Project license and maintainers
O ambiente de testes requer um computador com:
[+] 2 GB de memória RAM (ou mais);
[+] Processador i3 ou superior com no mínimo 2.4 GHz de frequência;
[+] Disco rígido ou SSD com espaço suficiente para executar uma imagem linux de 16 GB (para melhor desempenho recomenda-se 24GB);
[+] Acesso à conexão cabeada com a internet;
[+] Monitor, mouse e teclado para operar o sistema.
[+] Sistema operacional Windows 7 ou superior / Linux kernel 3.2 ou superior;
[+] Navegador com acesso a internet (de preferência Chrome, Chromium, Mozilla ou Opera);
[+] Oracle VM VirtualBox (https://www.virtualbox.org/wiki/Downloads)
[+] Utilitário de descompressão de arquivos zipados (WinRAR, 7Zip, por exemplo).
Após certifica-se de que todos os requisitos de hardware e software foram atendidos, realize o download da imagem mais recente da máquina virtual contendo os aparatos para o experimento de segurança e importe-o em sua Oracle VM VirtualBox. O processo de importação da máquina Virtual pode ser feito da seguinte forma:
3 - Clique no botão imediatamente à direita da caixa de texto e selecione a imagem baixada anteriormente com a extensão ".ova".
OBS: A senha do sistema é: sbseg2020
Os testes são realizados na imagem pronta do ambiente de testes. Execute a máquina virtual e efetue o login no usuário sbseg2020 com a senha também sbseg2020. Após efetuar seu login, procure na área de trabalho pela pasta Proof Of Concept e siga as instruções do arquivo README (LEIA-ME) presente.
sudo su
chmod +x poc-setup.sh
./poc-setup.sh
Após o comando acima, aguarde até que o ambiente seja preparado. A linha de comando iniciará:
- Apache
- MySQL/MariaDB
- DVWA
- Minimalistic WAF
Além disso, o comando instalará na mesma pasta Proof Of Concept o SQLMAP na versão mais atual para fins de testes de injeção de SQL necessários em alguns módulos do DVWA.
Observe que o ambiente será acessível no localhost que é o proxy contendo o Mini-WAF para o verdadeiro DVWA que roda em localhost:8081.
A imagem acima ilustra o esquema de proteção implantado no DVWA onde o cliente acessa o localhost que é o proxy do Mini-WAF e o proxy redireciona e filtra conexões maliciosas para o servidor do DVWA na porta 8081.
1. Burlando a proteção da Cloudflare e obtendo o endereço de IP real do servidor (ferramenta CloudFail utilizada no processo).
2. Realizando uma conexão SSH com o servidor alvo de domínio particular e estabelecendo um túnel TCP entre as portas 5901 do servidor remoto e local para posterior uso do VNC.
3. De posse do endereço de IP real do servidor (191.240.183.32), iniciando uma simulação de injeção de SQL no parâmetro GET http://191.240.183.32?id= (ferramenta Sqlmap usada no processo).
4. Após o tunelamento SSH concluído nas portas 5901, conectando-se ao servidor VNC remoto e visualizando o Minimalistic WAF contendo mais de 90% dos ataques realizados e rejeitando as conexões de entrada com status HTTP 403.
Nessa etapa, foram usados payloads de level 1 e level 2, obtendo respectivamente os seguintes números de conexões bloqueadas:
Nível | Requisições | Não bloqueadas | Bloqueadas |
---|---|---|---|
1 | 78 | 5 | 73 |
2 | 372 | 22 | 350 |
O projeto está sendo mantido sob a licença MIT e pode ser encontrada aqui. Aceitamos contribuições de qualquer pessoa no projeto bem como sugestões e relatórios de bugs que também serão muito bem vindos.
Esse projeto é mantido por Muryllo Pimenta de Oliveira - GitHub Profile, atualmente orientado pelo professor da Universidade de Pernambuco Carlo Marcelo Revoredo - GitHub Profile.
The test environment requires a computer with:
[+] 2 GB of RAM (or more);
[+] Processor i3 or higher with a minimum frequency of 2.4 GHz;
[+] Hard disk or SSD with enough space to run a 16 GB linux image (24 GB is recommended for best performance);
[+] Access to the wired internet connection;
[+] Monitor, mouse and keyboard to operate the system.
[+] Operating system Windows 7 or higher / Linux kernel 3.2 or higher;
[+] Browser with internet access (preferably Chrome, Chromium, Mozilla or Opera);
[+] Oracle VM VirtualBox (https://www.virtualbox.org/wiki/Downloads)
[+] Zip file decompression utility (WinRAR, 7Zip, for example).
After making sure that all hardware and software requirements have been met, download the latest image of the virtual machine containing the devices for the security experiment and import it into your Oracle VM VirtualBox. The Virtual machine import process can be done as follows:
3 - Click the button immediately to the right of the text box and select the previously downloaded image with the extension ".ova".
OBS: The password of the system is: sbseg2020
The tests are performed on the ready image of the test environment. Run the virtual machine and log in to the user sbseg2020 with the password also sbseg2020. After logging in, look on the desktop for the Proof Of Concept folder and follow the instructions in the README (LEIA-ME.txt) file present.
sudo su
chmod +x poc-setup.sh
./poc-setup.sh
After the above command, wait until the environment is prepared. The command line will start:
- Apache
- MySQL/MariaDB
- DVWA
- Minimalistic WAF
In addition, the command will install SQLMAP in the most current version in the same Proof Of Concept folder for the purpose of SQL injection testing required in some DVWA modules.
Note that the environment will be accessible on localhost which is the proxy containing the Mini-WAF for the real DVWA that runs on localhost:8081.
The image above illustrates the protection scheme implemented in DVWA where the client accesses the localhost which is the Mini-WAF proxy and the proxy redirects and filters malicious connections to the DVWA server on port 8081.
1. Bypassing the protection of Cloudflare and obtaining the real IP address of the server (tool CloudFail used in the process).
2. Making an SSH connection with the target server of private domain and establishing a TCP tunnel between ports 5901 of the remote and local server for later use of VNC.
3. With the real IP address of the server (191.240.183.32), starting a SQL injection simulation in the GET parameter http://191.240.183.32?id= (tool Sqlmap used in the process).
4. After the SSH tunneling completed on ports 5901, connecting to the remote VNC server and viewing the Minimalistic WAF containing over 90% of the attacks carried out and rejecting incoming connections with HTTP 403 status.
In this step, level 1 and level 2 payloads were used, obtaining respectively the following numbers of blocked connections:
Level | Requests | Non-blocked | Blocked |
---|---|---|---|
1 | 78 | 5 | 73 |
2 | 372 | 22 | 350 |