Kippo是一个可交互的SSH蜜罐,旨在记录暴力攻击行为,最重要的是可以记录攻击者的shell交互行为,如果你需要了解有关Kippo更多信息,请访问它的官方网站http://code.google.com/p/kippo/,本教程只教你如何在CentOS 5.5服务器上编译和安装Kippo,但我不保证你照做也能成功。

安装Python 2.6

你可能已经知道,CentOS自带的是Python 2.4,因此你需要安装Python 2.6,具体的安装教程请访问下面这个链接:

http://www.geekymedia.com/tech-articles/rhel5-centos5-rpms-for-python-2-5-and-2-6/.

重要提示:

1)安装你需要的RPM包,包括Python基础包和libs包。

2)在命令行输入python26启动Python 2.6,注意不是输入python(系统自带的Python 2.4仍然保留在系统中)。

3)如果你使用setuptolls安装软件包,确保使用正确的python版本(如python26 setup.py安装)

Twisted,Zope和Pycrypto安装

Twisted是一个事件驱动的网络引擎,使用Python编写,基于MIT许可协议发布,Twisted项目支持TCP,UDP,SSL/TLS,多播,Unix套接字和其它许多协议(包括HTTP,NNTP,IMAP,SSH,IRC和FTP等)。

  1. cd /tmp
  2. wget http://twistedmatrix.com/Releases/Twisted/10.2/Twisted-10.2.0.tar.bz2
  3. tar -xvf Twisted-10.2.0.tar.bz2
  4. cd Twisted-10.2.0
  5. python26 setup.py build
  6. python26 setup.py install

Zope是一个开源的Web应用程序服务器,主要用Python写成。

  1. cd /tmp
  2. wget http://www.zope.org/Products/ZopeInterface/3.3.0/zope.interface-3.3.0.tar.gz
  3. tar -xvf zope.interface-3.3.0.tar.gz
  4. cd zope.interface-3.3.0
  5. python26 setup.py build
  6. python26 setup.py install

Pycrypto是一套使用Python实现的加密算法和协议集合。

  1. cd /tmp
  2. wget wget http://www.amk.ca/files/python/crypto/pycrypto-2.0.1.tar.gz
  3. tar -xvf pycrypto-2.0.1.tar.gz
  4. cd pycrypto-2.0.1
  5. python26 setup.py build
  6. python26 setup.py install

ASN.1类型和编码(BER,CER,DER)也是使用Python编程语言实现的。

  1. cd /tmp
  2. wget http://sourceforge.net/projects/pyasn1/files/pyasn1-devel/0.0.12a/pyasn1-0.0.12a.tar.gz/download
  3. tar -xvf pyasn1-0.0.12a.tar.gz
  4. cd pyasn1-0.0.12a
  5. python26 setup.py build
  6. python26 setup.py install

创建用户

Kippo不能以root用户运行,因此我们必须创建一个正规的用户。

useradd kippouser

你需要从http://kippo.googlecode.com下载最新的Kippo源代码包。

  1. su - kippouser
  2. wget http://kippo.googlecode.com/files/kippo-0.5.tar.gz
  3. tar -xvf kippo-0.5.tar.gz
  4. cd kippo-0.5

配置Kippo

  1. vi kippo.cfg
  2. #
  3. # Kippo configuration file (kippo.cfg)
  4. #
  5. [honeypot]
  6. # IP addresses to listen for incoming SSH connections.
  7. #
  8. # (default: 0.0.0.0) = any address
  9. #ssh_addr = 0.0.0.0
  10. # Port to listen for incoming SSH connections.
  11. #
  12. # (default: 2222)
  13. ssh_port = 2222
  14. # Hostname for the honeypot. Displayed by the shell prompt of the virtual
  15. # environment.
  16. #
  17. # (default: sales)
  18. hostname = sales
  19. # Directory where to save log files in.
  20. #
  21. # (default: log)
  22. log_path = log
  23. # Directory where to save downloaded (malware) files in.
  24. #
  25. # (default: dl)
  26. download_path = dl
  27. # Directory where virtual file contents are kept in.
  28. #
  29. # This is only used by commands like 'cat' to display the contents of files.
  30. # Adding files here is not enough for them to appear in the honeypot - the
  31. # actual virtual filesystem is kept in filesystem_file (see below)
  32. #
  33. # (default: honeyfs)
  34. contents_path = honeyfs
  35. # File in the python pickle format containing the virtual filesystem.
  36. #
  37. # This includes the filenames, paths, permissions for the whole filesystem,
  38. # but not the file contents. This is created by the createfs.py utility from
  39. # a real template linux installation.
  40. #
  41. # (default: fs.pickle)
  42. filesystem_file = fs.pickle
  43. # Directory for miscellaneous data files, such as the password database.
  44. #
  45. # (default: data_path)
  46. data_path = data
  47. # Directory for creating simple commands that only output text.
  48. #
  49. # The command must be placed under this directory with the proper path, such
  50. # as:
  51. #   txtcmds/usr/bin/vi
  52. # The contents of the file will be the output of the command when run inside
  53. # the honeypot.
  54. #
  55. # In addition to this, the file must exist in the virtual
  56. # filesystem {filesystem_file}
  57. #
  58. # (default: txtcmds)
  59. txtcmds_path = txtcmds
  60. # Public and private SSH key files. If these don't exist, they are created
  61. # automatically.
  62. #
  63. # (defaults: public.key and private.key)
  64. public_key = public.key
  65. private_key = private.key
  66. # Initial root password. Future passwords will be stored in
  67. # {data_path}/pass.db
  68. #
  69. # (default: 123456)
  70. password = 123456
  71. # IP address to bind to when opening outgoing connections. Used exclusively by
  72. # the wget command.
  73. #
  74. # (default: not specified)
  75. #out_addr = 0.0.0.0
  76. # Sensor name use to identify this honeypot instance. Used by the database
  77. # logging modules such as mysql.
  78. #
  79. # If not specified, the logging modules will instead use the IP address of the
  80. # connection as the sensor name.
  81. #
  82. # (default: not specified)
  83. #sensor_name=myhostname
  84. # Fake address displayed as the address of the incoming connection.
  85. # This doesn't affect logging, and is only used by honeypot commands such as
  86. # 'w' and 'last'
  87. #
  88. # If not specified, the actual IP address is displayed instead (default
  89. # behaviour).
  90. #
  91. # (default: not specified)
  92. #fake_addr = 192.168.66.254
  93. # MySQL logging module
  94. #
  95. # Database structure for this module is supplied in doc/sql/mysql.sql
  96. #
  97. # To enable this module, remove the comments below, including the
  98. # [database_mysql] line.
  99. #[database_mysql]
  100. #host = localhost
  101. #database = kippo
  102. #username = kippo
  103. #password = secret

启动Kippo

  1. ./start.sh

日志文件

默认情况下,kippo的输出将会被重定向到日志文件log/kippo.log,使用下面的命令查看Kippo的日志:

  1. tail -f log/kippo.log

提示:如何访问Kippo

默认情况下,Kippo运行在2222端口上,如果运行在Windows上,端口22通常是空闲的,可以将Kippo运行在这个端口上,在Linux上,端口22有所限制,只能由root使用,但可以使用下面的命令进行端口映射:

  1. iptables -t nat -A PREROUTING -i IN_IFACE -p tcp --dport 22 -j REDIRECT --to-port 2222

使用你真实的接口名如eth0替换这里的IN_IFACE。

测试

使用root用户连接到Kippo服务器的2222端口:

  1. ssh 127.0.0.1 -p 2222 -l root

如果成功登录,你一定会看到下面的banner:

  1. sales:~#

原文出处:http://www.howtoforge.com/how-to-set-up-kippo-ssh-honeypot-on-centos-5.5

原文名:How To Set Up Kippo SSH Honeypot On CentOS 5.5

转载于:https://www.cnblogs.com/baogg/articles/2172317.html

如何在CentOS 5.5上安装Kippo蜜罐相关推荐

  1. 如何在CentOS 5/6上安装EPEL源

    如何在CentOS 5/6上安装EPEL源 2013-12-04 14:45 译者:NearTan Linux中国 字号:T | T 我们可以很容易地通过yum命令从EPEL源上获取上万个在CentO ...

  2. 如何在CentOS 6.4上安装并使用OpenVZ

    如何在CentOS 6.4上安装并使用OpenVZ? 2013-04-07 15:14 核子可乐译 51CTO.com 字号: T | T OpenVZ是Virtuozzo的开源分支,在OpenVZ的 ...

  3. 如何在 CentOS Stream 8上安装 LibreNMS

    LibreNMS是一个基于PHP,MySQL和SNMP的开源自动发现网络监控工具. LibreNMS包括对各种网络硬件和操作系统的支持,包括瞻博网络,思科,Linux,Foundry,FreeBSD, ...

  4. fedora mysql gui,在RHEL、CentOS及Fedora上安装Drupal 8——开源内容管理系统

    如何在RHEL.CentOS及Fedora上安装Drupal 8 Drupal 是一个开源,灵活,高度可拓展和安全的内容管理系统Content Management System(CMS),使用户轻松 ...

  5. 如何在Digital Ocean VPS上安装cpanel / whm

    by Michael Umanah 迈克尔·乌曼纳(Michael Umanah) 如何在Digital Ocean VPS上安装cpanel / whm (How to install cpanel ...

  6. 如何在Ubuntu 18.04上安装和配置NFS服务器

    网络文件系统(NFS)是一种分布式文件系统协议,使您可以通过网络共享远程目录.使用NFS,您可以在系统上挂载远程目录,并像对待本地文件一样使用远程计算机上的文件. NFS协议默认情况下未加密,并且与S ...

  7. exfat安装linux系统,在CentOS 7系统上安装exFAT驱动器/启用exFAT支持的方法

    本文介绍在CentOS 7操作系统上安装exFAT驱动器的方法.exFAT(扩展文件分配表)是一种专有的Microsoft文件系统,针对闪存设备(如SD卡和USB闪存驱动器)进行了优化,它旨在取代旧的 ...

  8. 如何在 CentOS 8 Stream 上安裝 PHP 8.1

    PHP 8.1是 PHP 语言的重要更新,于 2021 年 11 月 25 日"正式"发布.随着我们从现有的 PHP 8.0 版本前进,这是一个标准升级.新的 PHP 8.1 带来 ...

  9. Linux有问必答:如何在CentOS或者RHEL上启用Nux Dextop仓库

    Linux有问必答:如何在CentOS或者RHEL上启用Nux Dextop仓库 问题: 我想要安装一个在Nux Dextop仓库的RPM包.我该如何在CentOS或者RHEL上设置Nux Dexto ...

最新文章

  1. c 远程编辑linux文件,makefile - 在远程Linux机器上编译C ++ - “检测到时钟偏差”警告...
  2. SpringBoot笔记一
  3. 剑指offer之 调整奇数偶数数组位置
  4. 要活多久才能赚回你交的养老金
  5. 计算当前序列的字典序序号(洛谷P2524题题解,Java语言描述)
  6. java url 缩略图_java根据url生成网页截图,缩略图 | 学步园
  7. 解决Hadoop时no namenode to stop异常或则 是 jps中没有namenode
  8. 【转】离婚男人给女孩的恋爱忠告
  9. 如何用键盘快捷键打开 macOS 控制中心?
  10. yii2组件之多图上传插件FileInput的详细使用
  11. linux下测试权限,linux 文件权限
  12. #英语# 表示人的名词后缀论文文献
  13. word 2016 页码从任意页开始
  14. 一个故事,讲懂什么是区块链
  15. 2.2 Collections类 (Collections源码解析)
  16. 【题解】纪中篮球联赛
  17. 用KUSTO查询语句(KQL)在Azure Data Explorer Database上查询LOG实战
  18. HDMI硬件设计要求及CTS要求
  19. 淘宝图片搜索API / item_search_img-按图搜索淘宝商品(拍立淘)/图片搜索API调用值说明
  20. mongodb gridfs php,PHP操作MongoDB GridFS 存储文件的详解

热门文章

  1. 运放电路分析_运放参数的详细解释和分析part4运放噪声
  2. zookeeper集群介绍
  3. HTML DOM节点的属性获取
  4. 机器学习偏差方差_机器学习101 —偏差方差难题
  5. 夫妻两一个两年内3张卡9次逾期,一人4次,还能办理房贷吗?
  6. 如何查看mysql my.ini_MySQL学习笔记(一)
  7. 陕师大计算机专业,陕师大计算机系组合数学试题
  8. shell脚本发邮件内容html,[转]Shell脚本中发送html邮件的方法
  9. php传二维数组,JS用POST怎么传送二维数组给PHP
  10. win10兼容模式怎么设置_win10护眼模式关不掉怎么办