note 44427 deleted from function.fsockopen by tomsommer

From: Date: Thu, 05 Aug 2004 13:47:18 +0000
Subject: note 44427 deleted from function.fsockopen by tomsommer
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-74015@lists.php.net to get a copy of this message
Note Submitter: edgar.ayllon@telefonica.net ---- <?php $destino="192.60.30.1"; $fp=pfsockopen($destino,23,$errno,$errstr,30); sleep(1); fputs($fp,$DONT.$TOPT_AUTH. $WILL.$TOPT_TERM. $DO.$TOPT_SUPP. $WILL.$TOPT_SUPP. $DO.$TOPT_ECHO. $WILL.$TOPT_NAWS); fputs($fp,$WONT.$TOPT_AUTH); sleep(1); fputs($fp,$DONT.$TOPT_ENCR); fputs($fp,$WONT.$TOPT_ENCR. $WONT.$TOPT_TS. $WONT.$TOPT_XDL. $WONT.$TOPT_NENVIR. $WONT.$TOPT_ENVIR); sleep(1); fputs($fp,$SB.$TOPT_TERM.$VT100.$SE); fputs($fp,$WONT.$TOPT_ECHO. $DONT.$TOPT_STAT. $WONT.$TOPT_RFC); sleep(1); fputs($fp,"myuser\r"); // your user login sleep(1); fputs($fp,"mypassword\r"); // your password sleep(1); fputs($fp,"su -\r"); // to login as root sleep(1); fputs($fp,"rootpass\r"); // root password sleep(1); fputs($fp,"some.command.that.needs.root.permissions\r"); // self-explained fclose($fp); ?> Well, this part shows how to use it. You can find more info about Telnet and other transmission protocols in http://www.faqs.org/rfcs/ . Good Luck.

« previous php.notes (#74015) next »