omarboutkhoum
Messages postés11Date d'inscriptionjeudi 10 avril 2008StatutMembreDernière intervention15 avril 2010
-
8 mai 2008 à 13:47
cs_gnarkk
Messages postés1Date d'inscriptionmercredi 12 juillet 2006StatutMembreDernière intervention21 juillet 2008
-
21 juil. 2008 à 10:22
bonjour à tous,j'ai essayer la classe telnet suivant que j'ai trouve sur internet pour me connecter par telnet a un serveur unix,mais le probleme c'est que la commande emis ne s'execute pas,ce qui veut dire que le login et le mot de passe ne passent pas.
<?
error_reporting(-1);
class Telnet {
/* (c) thies */
var $sock = NULL;
function telnet($host,$port) {
$this->sock = fsockopen($host,$port);
socket_set_timeout($this->sock,2,0);
}
function close() {
if ($this->sock)
fclose($this->sock);
$this->sock = NULL;
}
function write($buffer) {
$buffer = str_replace(chr(255),chr(255).chr(255),$buffer);
fwrite($this->sock,$buffer);
}
function getc() {
return fgetc($this->sock);
}
function read_till($what) {
$buf = '';
while (1) {
$IAC = chr(255);