telnet.php
<?php error_reporting(-1); class Telnet { 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); $DONT = chr(254); $DO = chr(253); $WONT = chr(252); $WILL = chr(251); $theNULL = chr(0); $c = $this->getc(); if ($c === false) return $buf; if ($c == $theNULL) { continue; } if ($c == "1") { continue; } if ($c != $IAC) { $buf .= $c; if ($what == (substr($buf,strlen($buf)-strlen($what)))) { return $buf; } else { continue; } } $c = $this->getc(); if ($c == $IAC) { $buf .= $c; } else if (($c == $DO) || ($c == $DONT)) { $opt = $this->getc(); // echo "we wont ".ord($opt)."\n"; fwrite($this->sock,$IAC.$WONT.$opt); } elseif (($c == $WILL) || ($c == $WONT)) { $opt = $this->getc(); // echo "we dont ".ord($opt)."\n"; fwrite($this->sock,$IAC.$DONT.$opt); } else { // echo "where are we? c=".ord($c)."\n"; } } } } /* 使用方法 示例 $telnet = new telnet("192.168.0.1",23); echo $telnet->read_till("login: "); $telnet->write("kongxx\r\n"); echo $telnet->read_till("password: "); $telnet->write("KONGXX\r\n"); echo $telnet->read_till(":> "); $telnet->write("ls\r\n"); echo $telnet->read_till(":> "); echo $telnet->close(); */
陳述
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn

熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

AI Hentai Generator
免費產生 AI 無盡。

熱門文章
R.E.P.O.能量晶體解釋及其做什麼(黃色晶體)
3 週前By尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.最佳圖形設置
3 週前By尊渡假赌尊渡假赌尊渡假赌
刺客信條陰影:貝殼謎語解決方案
2 週前ByDDD
R.E.P.O.如果您聽不到任何人,如何修復音頻
3 週前By尊渡假赌尊渡假赌尊渡假赌
WWE 2K25:如何解鎖Myrise中的所有內容
4 週前By尊渡假赌尊渡假赌尊渡假赌

熱工具

DVWA
Damn Vulnerable Web App (DVWA) 是一個PHP/MySQL的Web應用程序,非常容易受到攻擊。它的主要目標是成為安全專業人員在合法環境中測試自己的技能和工具的輔助工具,幫助Web開發人員更好地理解保護網路應用程式的過程,並幫助教師/學生在課堂環境中教授/學習Web應用程式安全性。 DVWA的目標是透過簡單直接的介面練習一些最常見的Web漏洞,難度各不相同。請注意,該軟體中

Atom編輯器mac版下載
最受歡迎的的開源編輯器

SublimeText3 Mac版
神級程式碼編輯軟體(SublimeText3)

SublimeText3 英文版
推薦:為Win版本,支援程式碼提示!

ZendStudio 13.5.1 Mac
強大的PHP整合開發環境