send
Grupo de Telegram
play_arrow
Este sitio utiliza cookies propias y de terceros. Si continúa navegando consideramos que acepta el uso de cookies. OK Más Información.

[Perl] DH Sniffer 0.3

  • 0 Respuestas
  • 1670 Vistas

0 Usuarios y 1 Visitante están viendo este tema.

Desconectado BigBear

  • *
  • Underc0der
  • Mensajes: 543
  • Actividad:
    0%
  • Reputación 3
    • Ver Perfil
« en: Enero 18, 2014, 07:56:33 pm »
Un simple sniffer en perl para capturar todo lo que pasa en los metodos GET y POST

El codigo :

Código: Perl
  1. #!usr/bin/perl
  2. #DH Sniffer 0.3
  3. #(C) Doddy Hackman 2014
  4. #Credits :
  5. #Based on :
  6. #http://stackoverflow.com/questions/4777042/can-i-use-tcpdump-to-get-http-requests-response-header-and-response-body
  7. #http://www.perlmonks.org/?node_id=656590
  8. #http://stein.cshl.org/~lstein/talks/WWW6/sniffer/
  9. #http://perlenespanol.com/foro/post36051.html
  10. #Thanks to : Lincoln D. Stein , paulz and Explorer
  11.  
  12. use CGI;
  13. use threads;
  14. use URI::Escape;
  15.  
  16. $| = 1;
  17.  
  18. my $control = You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login;
  19.  
  20. head();
  21.  
  22. if ( $control eq "" ) {
  23.     You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login "\n[+] Sintax : $0 <option>\n";
  24.     You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login "\n[++] Options :\n";
  25.     You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login "\n[+] -g : Capture method GET\n";
  26.     You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login "[+] -p : Capture method POST\n";
  27.     You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login "\n[+] Example : sudo perl $0 -pg\n";
  28.     copyright();
  29. }
  30.  
  31. You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login "\n";
  32.  
  33. my $hilo_get  = threads->new( \&sniffer_get );
  34. my $hilo_post = threads->new( \&sniffer_post );
  35.  
  36. $hilo_get->You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login;
  37. $hilo_post->You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login;
  38.  
  39. sub sniffer_get {
  40.  
  41.     if ( $control =~ /g/ ) {
  42.  
  43.         You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login( GET, "/usr/sbin/tcpdump -lnx -s 1024 dst port 80 |" );
  44.  
  45.         while (<GET>) {
  46.  
  47.             if (/^\S/) {
  48.  
  49.                 while ( $contenido =~
  50.                     /(GET|POST|WWW-Authenticate|Authorization).+/g )
  51.                 {
  52.                     You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login "\n[+] $ip = $name " . uri_unescape($&);
  53.                     savefile( "logs", "\n[+] $ip = $name " . uri_unescape($&) );
  54.                 }
  55.  
  56.                 You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login $ip;
  57.                 You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login $name;
  58.                 You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login $contenido;
  59.  
  60.                 ( $ip, $name ) =
  61.                   /IP (\d+\.\d+\.\d+\.\d+).+ > (\d+\.\d+\.\d+\.\d+)/;
  62.  
  63.             }
  64.  
  65.             s/\s+//g;
  66.             s/0x[abcdef\d]+://i;
  67.             s/([0-9a-f]{2})/chr(hex($1))/eg;
  68.             tr/\x1F-\x7E\r\n//cd;
  69.  
  70.             $contenido .= $_;
  71.  
  72.         }
  73.     }
  74. }
  75.  
  76. sub sniffer_post {
  77.  
  78.     if ( $control =~ /p/ ) {
  79.  
  80.         You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login( POST,
  81. "tcpdump -A -s 0 'tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)' |"
  82.         );
  83.         while (<POST>) {
  84.  
  85.             if (/^\S/) {
  86.  
  87.                 my $code = $_;
  88.  
  89.                 $buscando = CGI->new($code);
  90.  
  91.                 my @params = $buscando->param;
  92.  
  93.                 foreach $par (@params) {
  94.  
  95.                     if ( $par =~ /\./ ) {
  96.                         next;
  97.                     }
  98.                     else {
  99.                         my $dataf = $buscando->param($par);
  100.                         You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login "\n[+] $par " . " : " . $dataf;
  101.                         savefile( "logs", "\n[+] $par " . " : " . $dataf );
  102.                     }
  103.                 }
  104.             }
  105.         }
  106.     }
  107. }
  108.  
  109. sub savefile {
  110.     You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login( SAVE, ">>" . $_[0] );
  111.     You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login SAVE $_[1];
  112.     You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login SAVE;
  113. }
  114.  
  115. sub head {
  116.     You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login "\n-- == DH Sniffer 0.3 == --\n";
  117. }
  118.  
  119. sub copyright {
  120.     You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login "\n-- == (C) Doddy Hackman 2014 == --\n\n";
  121.     You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login(1);
  122. }
  123.  
  124. # The End ?
  125.  

Eso es todo.

 

¿Te gustó el post? COMPARTILO!



Tutorial perl desde cero By: Black Poision & Painboy

Iniciado por ProcessKill

Respuestas: 2
Vistas: 2951
Último mensaje Septiembre 02, 2011, 09:43:36 pm
por blozzter
[Perl] Verificando si es root para correr un script

Iniciado por c1st

Respuestas: 1
Vistas: 1379
Último mensaje Octubre 07, 2012, 06:01:39 pm
por ANTRAX
[Uniscan] Scanner de vulnerabilidades WEB hecho en Perl

Iniciado por tar3kw0rm3d

Respuestas: 0
Vistas: 1514
Último mensaje Junio 02, 2013, 08:01:28 pm
por tar3kw0rm3d
[Perl] Iframe DDos Attack Tool

Iniciado por BigBear

Respuestas: 0
Vistas: 1217
Último mensaje Julio 03, 2011, 10:06:45 pm
por BigBear
[Perl] Counter Strike 1.6 Servers List

Iniciado por BigBear

Respuestas: 0
Vistas: 1074
Último mensaje Noviembre 12, 2012, 07:32:11 pm
por BigBear