Achando vulnerabilidades SQLi com NMAP

Bom, como a maioria sabe o nmap é muito mais que um simples script de scan. Ele permite usar outros scripts para bruteforce, exploit, dos, vuln, intrusive e mais.
Vou tentar fazer um tutorial por dia explicando alguns scripts e o modo de se usa-lo para amplificar seu scan. O de hoje será o mais popular, o SQLi.

Vamos começar instalando o nmap, caso você não tenha.

Código----------------------------------------------------------------------------------------------------------         ~ git clone https://github.com/nmap/nmap.git
~ cd nmap
~ ./configure && make
~ sudo make install


-----------------------------------------------------------------------------
 Com o nmap instalado e atualizado vamos ao scan.

Código--------------------------------------------------------------------------------------------------------------
 ~ ping -c 1 testphp.acunetix.com

---------------------------------------------------------------------------------

Vamos usar a página de teste do acunetix para começar a demonstração

codigo------------------------------------------------------------------------
~ sudo nmap -T4 -A -v --script=http-sql-injection  ip aqui
------------------------------------------------------------------------

Ativamos o modo de scan geral (T4), o modo de detectação de OS, versão e trace (A), o modo verbose (v) e o script NSE de SQLi.
Temos o seguinte resultado relacionado ao script:

codigo--------------------------------------------------------------------------------------------
 PORT     STATE SERVICE VERSION
21/tcp   open  ftp     ProFTPD 1.3.3e
22/tcp   open  ssh     OpenSSH 5.3p1 Debian 3ubuntu7.1 (Ubuntu Linux; protocol 2.0)
25/tcp   open  smtp    Postfix smtpd
53/tcp   open  domain  ISC BIND none
80/tcp   open  http    nginx 1.4.1
|_http-server-header: nginx/1.4.1
| http-sql-injection:
|   Possible sqli for queries:
|     http://testphp.acunetix.com/search.php?test=query%27%20OR%20sqlspider
|     http://testphp.acunetix.com/search.php?test=query%27%20OR%20sqlspider
|     http://testphp.acunetix.com/search.php?test=query%27%20OR%20sqlspider
|     http://testphp.acunetix.com/search.php?test=query%27%20OR%20sqlspider
|     http://testphp.acunetix.com/listproducts.php?cat=2%27%20OR%20sqlspider
|     http://testphp.acunetix.com/listproducts.php?cat=4%27%20OR%20sqlspider
|     http://testphp.acunetix.com/listproducts.php?cat=3%27%20OR%20sqlspider
|     http://testphp.acunetix.com/listproducts.php?cat=1%27%20OR%20sqlspider
|     http://testphp.acunetix.com/search.php?test=query%27%20OR%20sqlspider
|     http://testphp.acunetix.com/search.php?test=query%27%20OR%20sqlspider
|     http://testphp.acunetix.com/search.php?test=query%27%20OR%20sqlspider
|     http://testphp.acunetix.com/search.php?test=query%27%20OR%20sqlspider
|     http://testphp.acunetix.com/AJAX/../showimage.php?file=%27%20OR%20sqlspider
|     http://testphp.acunetix.com/search.php?test=query%27%20OR%20sqlspider
|     http://testphp.acunetix.com/artists.php?artist=2%27%20OR%20sqlspider
|     http://testphp.acunetix.com/artists.php?artist=1%27%20OR%20sqlspider
|     http://testphp.acunetix.com/artists.php?artist=3%27%20OR%20sqlspider
|     http://testphp.acunetix.com/search.php?test=query%27%20OR%20sqlspider
|     http://testphp.acunetix.com/search.php?test=query%27%20OR%20sqlspider
|     http://testphp.acunetix.com/showimage.php?file=%2e%2fpictures%2f6%2ejpg%27%20OR%20sqlspider
|     http://testphp.acunetix.com/product.php?pic=6%27%20OR%20sqlspider
|     http://testphp.acunetix.com/showimage.php?file=%2e%2fpictures%2f6%2ejpg%27%20OR%20sqlspider&size=160
|     http://testphp.acunetix.com/artists.php?artist=1%27%20OR%20sqlspider
|     http://testphp.acunetix.com/search.php?test=query%27%20OR%20sqlspider
|     http://testphp.acunetix.com/search.php?test=query%27%20OR%20sqlspider
|_    http://testphp.acunetix.com/search.php?test=query%27%20OR%20sqlspider



---------------------------------------------------------------------------

Feito isso achamos várias possíveis páginas para explorar. Farei um post posteriomente sobre como explorar essas falhas e os diferentes tipos de SQLi e suas funções.

Compartilhar :



sentiment_satisfied Emoticon




'; (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })();