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

 

 


Tema destacado: AIO elhacker.NET 2021 Compilación herramientas análisis y desinfección malware


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


Desconectado Desconectado

Mensajes: 545



Ver Perfil
[Perl] Funcion conectar()
« en: 13 Octubre 2011, 17:12 pm »

Hola a todos.

Aca les dejo una funcion para conectarse mediante sockets al servidor que quieran

Código
  1. use IO::Socket;
  2.  
  3. sub conectar {
  4.  
  5. my $sockex = new IO::Socket::INET(PeerAddr => $_[0],PeerPort => $_[1],
  6. Proto => "tcp",Timeout  => 5);
  7.  
  8. print $sockex $_[2]."\r\n";
  9. $sockex->read($re,5000);
  10. $sockex->close;
  11. return $re."\r\n";
  12. }
  13.  

Sintasis

Código:
conectar(host,puerto,parametro a enviar)

Ejemplo de uso

Código
  1. $re = conectar("127.0.0.1","80","GET /sql.php HTTP/1.0\r\n");
  2. print $re;
  3.  


En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Funcion Ip Publica [Perl]
Scripting
isseu 2 2,981 Último mensaje 8 Mayo 2010, 00:17 am
por leogtz
[Perl] Funcion Speak()
Scripting
BigBear 0 1,549 Último mensaje 10 Octubre 2011, 16:51 pm
por BigBear
[Perl] Funcion wormer()
Scripting
BigBear 0 1,383 Último mensaje 10 Octubre 2011, 16:51 pm
por BigBear
[Perl] Funcion writeword()
Scripting
BigBear 0 1,431 Último mensaje 10 Octubre 2011, 16:52 pm
por BigBear
[Perl] Funcion cmd()
Scripting
BigBear 0 1,685 Último mensaje 13 Octubre 2011, 17:12 pm
por BigBear
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines