目录
endlessh 是一个小巧的ssh蜜罐程序,它通过不断地发送随机生成的协议版本信息来达到让尝试登陆的ssh客户端卡死的目的。
安装
endlessh是一个简单的的 C语言 程序,整个源代码只有一个C文件.
git clone https://github.com/skeeto/endlessh cd endlessh make
这会生成一个可执行的 endlessh 程序. 我们可以把它移动到 /sbin 目录下
sudo mv endlessh /sbin
使用
通过 -h 选项可以输出 endlessh 的使用方法
[root@VM_0_8_centos endlessh]# endlessh -h Usage: endlessh [-vh] [-d MS] [-f CONFIG] [-l LEN] [-m LIMIT] [-p PORT] -d INT Message millisecond delay [10000] -f Set and load config file [/etc/endlessh/config] -h Print this help message and exit -l INT Maximum banner line length (3-255) [32] -m INT Maximum number of clients [4096] -p INT Listening port [2222] -v Print diagnostics to standard output (repeatable)
配置文件
从 endlessh -h 的帮助信息中可以看到它可以从配置文件中读取参数信息。 endlessh 的配置文件跟 OpenSSH 的配置信息是否类似:
# The port on which to listen for new SSH connections. Port 2222 # The endless banner is sent one line at a time. This is the delay # in milliseconds between individual lines. Delay 10000 # The length of each line is randomized. This controls the maximum # length of each line. Shorter lines may keep clients on for longer if # they give up after a certain number of bytes. MaxLineLength 32 # Maximum number of connections to accept at a time. Connections beyond # this are not immediately rejected, but will wait in the queue. MaxClients 4096 # Set the detail level for the log. # 0 = Quiet # 1 = Standard, useful log messages # 2 = Very noisy debugging information LogLevel 0
修改配置文件后,我们可以通过发送 SIGHUP 信号来让 endlessh 重新读取新的配置信息
kill -s SIGHUP $(pidof endlessh)
原理
SSH登陆分三个阶段:
- 协议协商阶段
- 密钥和算法协商阶段
-
认证阶段
而在 协议协商阶段 中,客户端向服务端建立链接后,服务端应该向客户端发送一个报文,该在报文中包括格式为“协议版本号 次协议版本号 软件版本号”的版本标识字符串。
而 endlessh 往客户端发送的是一段不断随机生成的字符串,相当于这个报文没有穷尽,也根本无法从这个字符串中解析出有意义的版本标识.
从而使ssh客户端卡在这一步,无法进行到下一步。
以上所述就是小编给大家介绍的《endlessh:一个小巧的ssh蜜罐》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
TCP/IP网络管理
亨特 / 电子工业 / 2006年3月1日 / 79.00元
本书是一本架设与维护TCP/IP网络的完整指南,无论你是在职的系统管理员,还是需要访问Internet的家用系统用户,都可从本书获得帮助。本书还讨论了高级路由协议(RIPv2、OSPF、BGP),以及实现这些协议的gated软件。对于各种重要的网络服务,如DNS,Apache,sendmail,Samba,PPP和DHCP,本书都提供了配置范例,以及相关的软件包与工具的语法参考。一起来看看 《TCP/IP网络管理》 这本书的介绍吧!