telnet常见的错误
安装了xinetd
修改了配置文件
https://www.yuanmas.com/info/qKa13NNOgb.html
1. 23端口没开放/没有安装telnet服务器
[qjx@bogon ~]$ telnet 45.77.185.17
Trying 45.77.185.17...
telnet: connect to address 45.77.185.17: Connection refused
tes.out:(no 23 prot)
pexpect.exceptions.EOF: End Of File (EOF). Exception style platform.
<bjcaclient.bjcatelnet.bjcatelnet object at 0x7fd1625e6210>
command: /usr/bin/telnet
args: ['/usr/bin/telnet', '45.77.185.17', '23', '-l', 'root']
buffer (last 100 chars): ''
before (last 100 chars): 'Trying 45.77.185.17...
telnet: connect to address 45.77.185.17: Connection refused
'
after: <class 'pexpect.exceptions.EOF'>
match: None
match_index: None
exitstatus: 1
flag_eof: True
pid: 3632
child_fd: 5
closed: False
timeout: 30
delimiter: <class 'pexpect.exceptions.EOF'>
logfile: None
logfile_read: None
logfile_send: None
maxread: 2000
ignorecase: False
searchwindowsize: None
delaybeforesend: 0.05
delayafterclose: 0.1
delayafterterminate: 0.1
searcher: searcher_re:
0: re.compile("(?i)password")
1: re.compile("(?i)Connection timed out")
2: TIMEOUT
2. 错误的用户名(4097)/以root用户登陆(4097)/密码错误(4097)???
[qjx@bogon ~]$ telnet 192.168.80.128 23 -l qqq
Trying 192.168.80.128...
Connected to 192.168.80.128.
Escape character is '^]'.
Password:
Login incorrect
login: login: qqq
Password:
Connection closed by foreign host.
3. host不正确
[qjx@bogon ~]$ telnet 192.168.80.111
Trying 192.168.80.111...
telnet: connect to address 192.168.80.111: No route to host
test.out:
pexpect.exceptions.EOF: End Of File (EOF). Exception style platform.
<bjcaclient.bjcatelnet.bjcatelnet object at 0x7fa0ca58c210>
command: /usr/bin/telnet
args: ['/usr/bin/telnet', '192.168.80.111', '23', '-l', 'qjx']
buffer (last 100 chars): ''
before (last 100 chars): 'Trying 192.168.80.111...
telnet: connect to address 192.168.80.111: No route to host
'
after: <class 'pexpect.exceptions.EOF'>
match: None
match_index: None
exitstatus: 1
flag_eof: True
pid: 3826
child_fd: 5
closed: False
timeout: 30
delimiter: <class 'pexpect.exceptions.EOF'>
logfile: None
logfile_read: None
logfile_send: None
maxread: 2000
ignorecase: False
searchwindowsize: None
delaybeforesend: 0.05
delayafterclose: 0.1
delayafterterminate: 0.1
searcher: searcher_re:
0: re.compile("(?i)password")
1: re.compile("(?i)Connection timed out")
2: TIMEOUT
4. 输入密码超时.no test
[qjx@bogon ~]$ telnet 192.168.80.128 -l qjx
Trying 192.168.80.128...
Connected to 192.168.80.128.
Escape character is '^]'.
Password: ogin timed out after 180 seconds
Connection closed by foreign host.
5. 没网
telnet: Unable to connect to remote host: Network is unreachable
test.out:
pexpect.exceptions.EOF: End Of File (EOF). Exception style platform.
<bjcaclient.bjcatelnet.bjcatelnet object at 0x7f0f3a8c4210>
command: /usr/bin/telnet
args: ['/usr/bin/telnet', '192.168.80.128', '23', '-l', 'qjx']
buffer (last 100 chars): ''
before (last 100 chars): 'Trying 192.168.80.128...
telnet: connect to address 192.168.80.128: Network is unreachable
'
after: <class 'pexpect.exceptions.EOF'>
match: None
match_index: None
exitstatus: 1
flag_eof: True
pid: 3877
child_fd: 5
closed: False
timeout: 30
delimiter: <class 'pexpect.exceptions.EOF'>
logfile: None
logfile_read: None
logfile_send: None
maxread: 2000
ignorecase: False
searchwindowsize: None
delaybeforesend: 0.05
delayafterclose: 0.1
delayafterterminate: 0.1
searcher: searcher_re:
0: re.compile("(?i)password")
1: re.compile("(?i)Connection timed out")
2: TIMEOUT
6.提权错误(4100)
7. 被远程主机过滤掉(4097)
[qjx@bogon Downloads]$ telnet 192.168.151.71 445
Trying 192.168.151.71...
Connected to 192.168.151.71.
Escape character is '^]'.
Connection closed by foreign host.
发生4097的错误,可能是因为超时,因为执行需要很久,可能有点问题