rlogin - 512/513/514 - without password

rlogin简介

远程登录(rlogin)是一个UNIX命令,它允许授权用户进入网络中的其它UNIX机器并且就像用户在现场操作一样。一旦进入主机,用户可以操作主机允许的任何事情,比如:读文件、编辑文件或删除文件等。Rlogin:远程登录命令rloginRemoteLogin in Unix systems


实验环境

root@linux:~# uname -a
Linux linux 3.2.0-4-amd64 #1 SMP Debian 3.2.60-1+deb7u3 x86_64 GNU/Linux


安装rlogin程序前,请自行安装xinetd

root@linux:~# apt-get install rsh-server rsh-client
Reading package lists... Done
Building dependency tree        
Reading state information... Done
The following NEW packages will be installed:
  rsh-client rsh-server
0 upgraded, 2 newly installed, 0 to remove and 16 not upgraded.
Need to get 73.0 kB of archives.
After this operation, 319 kB of additional disk space will be used.
Get:1 http://http.debian.net/debian/ wheezy/main rsh-client amd64 0.17-15 [33.9 kB]
Get:2 http://http.debian.net/debian/ wheezy/main rsh-server amd64 0.17-15 [39.1 kB]
Fetched 73.0 kB in 4s (17.9 kB/s)      
Selecting previously unselected package rsh-client.
(Reading database ... 115854 files and directories currently installed.)
Unpacking rsh-client (from .../rsh-client_0.17-15_amd64.deb) ...
Selecting previously unselected package rsh-server.
Unpacking rsh-server (from .../rsh-server_0.17-15_amd64.deb) ...
Processing triggers for man-db ...
Setting up rsh-client (0.17-15) ...
update-alternatives: using /usr/bin/netkit-rcp to provide /usr/bin/rcp (rcp) in auto mode
update-alternatives: using /usr/bin/netkit-rsh to provide /usr/bin/rsh (rsh) in auto mode
update-alternatives: using /usr/bin/netkit-rlogin to provide /usr/bin/rlogin (rlogin) in auto mode
Setting up rsh-server (0.17-15) ...
Installing new version of config file /etc/pam.d/rlogin ...
Installing new version of config file /etc/pam.d/rsh ...
Note: xinetd currently is not fully supported by update-inetd.
      Please consult /usr/share/doc/xinetd/README.Debian and itox(8).
Note: xinetd currently is not fully supported by update-inetd.
      Please consult /usr/share/doc/xinetd/README.Debian and itox(8).
Note: xinetd currently is not fully supported by update-inetd.
      Please consult /usr/share/doc/xinetd/README.Debian and itox(8).

配置rshrlogin,允许远程登录,无需密码验证.

vim /etc/xinetd.d/rsh

# default: on
# description: The rshd server is the server for the rcmd(3) routine and, \
#       consequently, for the rsh(1) program.  The server provides \
#       remote execution facilities with authentication based on \
#       privileged port numbers from trusted hosts.
service shell
{
        socket_type          = stream
        wait                 = no
        user                 = root
        # log_on_success       += USERID
        # log_on_failure       += USERID
        server                = /usr/sbin/in.rshd
        disable               = no
}
 
service login
{
        socket_type          = stream
        wait                 = no
        user                 = root
        # log_on_success       += USERID
        # log_on_failure       += USERID
        server                = /usr/sbin/in.rlogind
        disable               = no
}

修改配置文件/etc/pam.d/rlogin,将pam_rhosts.so放在pam.securetty.so前面

#%PAM-1.0
#auth           required        pam_securetty.so
auth            sufficient      pam_rhosts.so
auth            required        pam_securetty.so
@include common-auth
@include common-account
@include common-session
@include common-password

添加允许登录的主机,修改文件/root/.rhosts/etc/hosts,/etc/hosts.equiv

root@linux:~# cat /root/.rhosts  
+ +
root@linux:~# cat /etc/hosts
127.0.0.1       localhost
127.0.1.1       linux
192.168.1.109   gnu
 
 
# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
root@linux:~# cat /etc/hosts.equiv  
# /etc/hosts.equiv: list  of  hosts  and  users  that are granted "trusted" r
#                   command access to your system .
+ +

登录rlogin

root@gnu:~# rlogin -l root 192.168.1.112
Last login: Sat Sep  6 14:05:44 EDT 2014 from gnu on pts/2
Linux linux 3.2.0-4-amd64 #1 SMP Debian 3.2.60-1+deb7u3 x86_64
 
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
 
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
root@linux:~# uname -a
Linux linux 3.2.0-4-amd64 #1 SMP Debian 3.2.60-1+deb7u3 x86_64 GNU/Linux


注:
如果rlogin -l root 登录,出现rlogind: Host address mismatch. 错误
请将客户机IP和计算机名,加入/etc/hosts.

测试环境,请下载metasploitable2.
  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值