修改SSH的banner

来源:互联网 发布:h5网页小游戏源码 编辑:程序博客网 时间:2024/04/29 07:40

看过包子的改OpenSSH的banner的文章后,也想把自己的ssh改了,由于OpenSSH漏洞相对来说比较多,我习惯用www.ssh.com的SSH,比较安全也比较正宗,呵呵他的免费版本都n年没更新了。比如我的benner是这样的:

[root@securitycn ssh-3.2.9.1]# telnet xxx.com 22
Trying xxx.xxx.xxx.24...
Connected to xxx.com (xxx.xxx.xxx.24).
Escape character is '^]'.
SSH-2.0-3.2.9.1 SSH Secure Shell (non-commercial)

如果想伪装的话改这2个文件

版本号
[root@securitycn ssh-3.2.9.1]# vi apps/ssh/ssh2version.h

#define SSH2_VERSION "3.2.9.1"

banner名
[root@securitycn ssh-3.2.9.1]# vi apps/ssh/ssh2includes.h


#define SSH2_VERSION_STRING "SSH Secure Shell " SSH2_VERSION /
" (non-commercial version)"
#define SSH2_PROTOCOL_VERSION_STRING SSH2_VERSION /
" SSH Secure Shell (non-commercial)"

至于SSH-2.0这个头建议保留,因为可能在握手的时候需要靠这个来确认版本的,如果改了可能会有问题。
如果想去掉的话在:
apps/ssh/sshd2.c
apps/ssh/lib/sshproto/trcommon.h
apps/ssh/sshstdiofilter.c

改完后编译:
configure
make
make install