Underc0de

Foros Generales => Dudas y pedidos generales => Mensaje iniciado por: deletethisaccount en Diciembre 05, 2016, 12:21:49 PM

Título: Problema script php
Publicado por: deletethisaccount en Diciembre 05, 2016, 12:21:49 PM
Hola,estoy haciendo un panel web para una botnet,pero tengo un problema,como puedo desconectar el script del chat irc,porque si no se queda cargando,este es el codigo:
Código (php) [Seleccionar]
<?php
set_time_limit
(0);
 
$nick   'BotPHP';
$canal  '##adios';
$isLogged false;
 
$conen fsockopen('irc.freenode.net'8000);
 
$buffer '';
function 
IRC($nick,$canal,$isLogged,$conen,$buffer)
 {
 
while (!feof($conen)){
        
$buffer trim((string)fgets($conen2048));
 
        if((!
$isLogged) and (substr($buffer01) === ':')){
                
$isLogged true;
                
fwrite($conen'USER '.$nick.' '.$nick.' '.$nick.' '.$nick."\n");
                
fwrite($conen'NICK '.$nick."\n");
                
fwrite($conen'JOIN '.$canal."\n");
 
                
fwrite($conen'PRIVMSG '.$canal.' :Dolphin,estoy vivoo'."\n");
fwrite($conen'PRIVMSG '.$canal.':/kick BotPHP'."\n");

        }
        unset(
$f);
        
        
// echo $buffer."\n";
        
        /* PING */
        
if(strtolower(substr($buffer06)) === 'PING :'){
                
$host explode(':'$buffer);
                
$host trim($host[1]);
                
fwrite($conen'PONG :'.$host."\n");
                unset(
$host);
        }
 
}
fclose($conen);

 } 
function 
IRC2($nick,$canal,$isLogged,$conen,$buffer)
 {
 
while (!feof($conen)){
        
$buffer trim((string)fgets($conen2048));
 
        if((!
$isLogged) and (substr($buffer01) === ':')){
                
$isLogged true;
                
fwrite($conen'USER '.$nick.' '.$nick.' '.$nick.' '.$nick."\n");
                
fwrite($conen'NICK '.$nick."\n");
                
fwrite($conen'JOIN '.$canal."\n");
 
                
fwrite($conen'PRIVMSG '.$canal.' :Dolphin,esto funciona'."\n");
fwrite($conen'PRIVMSG '.$canal.' :/kick BotPHP'."\n");

        }
        unset(
$f);
        
        
// echo $buffer."\n";
        
        /* PING */
        
if(strtolower(substr($buffer06)) === 'PING :'){
                
$host explode(':'$buffer);
                
$host trim($host[1]);
                
fwrite($conen'PONG :'.$host."\n");
                unset(
$host);
        }
 
}
fclose($conen);

 } 
if (
$_REQUEST[name] == "dolphin"){
IRC($nick,$canal,$isLogged,$conen,$buffer);
}elseif (
$_REQUEST[name] == "lil") {
IRC2($nick,$canal,$isLogged,$conen,$buffer);
}

?>


y el html/css por si os hiciese falta:
Código (html5) [Seleccionar]
<!DOCTYPE html>
<html>
<head>
<title>Login</title>
<style type="text/css">
*{
background: #0D0E13;

}
p{
                        color: #C11212;

}
form{
width: 200px;
margin: 0 auto;
}
value{
color: red;
}
</style>
</head>
<body>
<form action="index.php">
  <p>Name: <input type="text" id="name" name="name" /></p>
<p><input type="submit" value="Enviar" /></p>
</form>
<body>
<html>

ayudadaa :( :(
Título: Re:Problema script php
Publicado por: ANTRAX en Diciembre 05, 2016, 12:44:29 PM
Tenes captura o mas información del error que estas teniendo para entender mejor lo que hace?

Saludos,
ANTRAX
Título: Re:Problema script php
Publicado por: kid_goth en Diciembre 05, 2016, 03:09:18 PM
Pos te quedaría mejor el bot en modo cli (command line), ya que en este caso te tocaría trabajar con hilos https://secure.php.net/manual/es/class.thread.php o en el peor de los casos, que lo llames por ajax, y ahí sí se quede a la escucha...

Título: Re:Problema script php
Publicado por: seth en Diciembre 06, 2016, 06:15:10 PM
Por que queres una web y a la vez que se conecte a un irc? normalmente alcanza con una de las dos opciones