如何在CentOS 5.5上安装Kippo蜜罐

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

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/261248.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

LSTM和GRU vs 循环神经网络RNN

1、考虑下列三种情况下,对比一下普通RNN的表现和LSTM和GRU表现: (1)早期观测值对预测未来观测者具有非常重要的意义。 考虑一个极端情况,其中第一个观测值包含一个校验和, 目标是在序列的末尾辨别校验和是…

uva10617 - Again Palindrome(dp)

再次回文 输入:标准输入 输出:标准输出 时间限制: 2秒 是palindorme的读取相同的从左边,因为它从右侧的一个或多个字符的序列。例如,Ž,TOT和女士的 回文,但是,ADAM是不是。 给定一个…

java ora-12505_Oracle SQL Developer连接报错(ORA-12505)的解决方案(两种)

用oracle数据库新建连接时遇到ora-12505,此问题解决后又出现ora-12519错误,郁闷的半天,经过一番折腾问题解决,下面小编把我的两种解决方案分享给大家,仅供参考。解决方案一:今天工作时在新建连接的时候遇到…

例题9-6 UVa11400 Lighting System Design(DP)

题意: 看白书 要点: 其他的白书上讲的比较清楚了,状态转移方程为:d[i] min(d[i], d[j] (s[i] - s[j])*bulb[i].c bulb[i].k),有点难以理解的是如果i到j之中有的不进行换比较合理怎么办?但其实这种情况是…

【Silverlight】解决DataTemplate绑定附加属性

本文 Silverlight 版本:4.0。 首先定义数据类型,此文始终使用此定义类型。public class SimpleData : ViewModelBase{private string _text;private int _column, _row;public string Text { get { return _text; } set { _text value; OnPropertyChang…

青春无悔

青春像是一座城,放纵的思想、禁锢的世界总让自己感到如履薄冰,只能踽踽独行在阡陌的途中,我喜欢世界是自由的,我喜欢生活是淡然的,淡然的境界早已挣脱时空的枷锁,穿行在历朝历代,如莲花般盛开在…

java中udi_Java读取.properties配置文件的方法

java中的properties文件是一种配置文件,主要用于表达配置信息,文件类型为*.properties,格式为文本文件,文件的内容是格式是 "键值"的格式,在properties文件中,可以用"#"来作注释&#…

android 中文 api (72) —— BluetoothSocket[蓝牙]

前言 本章内容是 android.bluetooth.BluetoothSocket,为Android蓝牙部分的章节翻译。蓝牙通讯套接字,代表了与远端设备的连接点,使用socket本地程序可以通过inputstream和outputstream与远端程序进行通讯。版本为 Android 2.3 r1,…

Linux常用命令(二)

19. 文件压缩命令 (1)。gzip [文件名]  压缩后的文件格式是.gz   只能压缩文件不能压缩目录 不保留源文件 (2)。gunzip [文件名]  解压缩命令 (3)。tar 选项[cvf] [目录]  打包目录  压缩后的文件…

五行代码终极完美解决从IE6到Chrome所有浏览器的position:fixed;以及闪动问题

这个方法其实已经使用很久了,之前主要在嵌入式WebQQ等产品中用过,现在拿出来分享一下吧,是目前最简洁的方式来实现ie6的position:fixed; 失效bug,以及的其他方法的闪动问题,CSS代码如下,很简单,…

致年轻开发人员的一封信

我收到了很多年轻开发人员写给我的邮件,希望可以提升自己的编程能力。我肯定不是第一个讨论这个话题的人,所以我不确定还可以说出什么新意。然而,这里我认为还是非常值得列出我认为很重要的几点吧。 要跟其他开发者一起工作。我们正处在科技史…

笔记整理之 SHELL 变量

变量的类型:1.自定义变量定义变量: 变量名变量值 变量名必须以字母或下划线开头,区分大小写 url1test.3glong.com 引用变量: $变量名 或 ${变量名} 查看变量: echo $变量名 set(所有变量:包括自定…

Node的异步与java的异步_node.js和异步编程回文

以下代码不是异步的&#xff0c;为什么以及如何制作呢&#xff1f;function compute(callback){for(var i 0; i < 1000 ; i){}callback(i);}我将假设你的代码试图说&#xff0c;“我需要做1000次&#xff0c;然后在一切都完成时使用我的回调” .即使你的for循环也不会在这里…

N个三角形分割平面个数(数学)

一个三角形的时候&#xff0c;再加一个三角形&#xff0c;每一条变会与第一个三角形的两条边相交&#xff0c;这样增加2个小三角形&#xff0c;即两个面。f(2)3*2f(1)&#xff0c;再加一个三角形&#xff0c;每一条边会与前两个三角形的四条边相交&#xff0c;形成四个小三角形…

2011年9月19日 面试重点:asp.net运行原理和生命周期

面试重点&#xff1a;asp.net运行原理和生命周期1、ispostback回调机制isPostBackfalse !IsPostBackture 当前页面是第一次加载IsPostBack 由于用户交互(page.submit())提交页面而产生的加载,二次加载html客户端代码将ispostback值存放在viewstate隐藏字段中<input type&quo…

redis——集群

2019独角兽企业重金招聘Python工程师标准>>> 现实中redis需要若干台redis服务器的支持&#xff1a; &#xff08;1&#xff09;从结构上&#xff0c;单个Redis服务器会产生单点故障&#xff0c;同时一台服务器需要承受所有的请求负载。这就需要为数据生成多个副本并…

queue java 用法_Java队列(Queue)用法

Java 实例 - 队列(Queue)用法队列是一种特殊的线性表&#xff0c;它只允许在表的前端进行删除操作&#xff0c;而在表的后端进行插入操作。LinkedList类实现了Queue接口&#xff0c;因此我们可以把LinkedList当成Queue来用。以下实例演示了队列(Queue)的用法&#xff1a;Main.j…

POJ 2409 Let it Bead (Polya定理)

题意 用k种颜色对n个珠子构成的环上色&#xff0c;旋转翻转后相同的只算一种&#xff0c;求不等价的着色方案数。 思路 Polya定理 X是对象集合{1, 2, ……, n}&#xff0c; 设G是X上的置换群&#xff0c;用M种颜色染N种对象&#xff0c;则不同的染色方案数为&#xff1a; λ(g)…

seo

SEO&#xff08;Search Engine Optimization&#xff09;&#xff0c;汉译为搜索引擎优化&#xff0c;是较为流行的网络营销方式&#xff0c;主要目的是增加特定关键字的曝光率以增加网站的能见度&#xff0c;进而增加销售的机会。分为站外SEO和站内SEO两种。SEO的主要工作是通…

Ubuntu Server 之Apache2 虚拟主机配置指南(个人实践解读)

原创作品&#xff0c;允许转载&#xff0c;转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。http://dgd2010.blog.51cto.com/1539422/468531 这是完成在ubuntu Server的apache服务器上安装一个虚拟主机的具体配置。希望对用到的朋友有所帮…