Advertisement
opexxx

honeypot_install.sh

Apr 29th, 2014
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.72 KB | None | 0 0
  1. #!/bin/sh
  2. # Honeypot Install script
  3. # Installs Dionaea, Glastopf and Kippo
  4. # Works only on Ubuntu-Server 10.0.4.1
  5. #
  6. # Greg Martin - gregcmartin@gmail.com
  7. # http://infosec20.blogspot.com
  8. #
  9. #
  10. ####### Install Dionaea Honeypot #########
  11. sudo add-apt-repository ppa:honeynet/nightly
  12. sudo apt-get update
  13. sudo apt-get -y upgrade
  14. sleep 5
  15. sudo apt-get -y install dionaea p0f
  16. sleep 5
  17. sudo mkdir -p /var/dionaea/wwwroot
  18. sudo mkdir -p /var/dionaea/binaries
  19. sudo mkdir -p /var/dionaea/log
  20. sudo chown -R nobody:nogroup /var/dionaea/
  21. sudo mv /etc/dionaea/dionaea.conf.dist /etc/dionaea/dionaea.conf
  22. sudo sed -i 's/var\/dionaea\///g' /etc/dionaea/dionaea.conf
  23. sudo sed -i 's/log\//\/var\/dionaea\/log\//g' /etc/dionaea/dionaea.conf
  24. sudo sed -i 's/"uniquedownload",/"uniquedownload","submit_http",/g' /etc/dionaea/dionaea.conf
  25. sudo sed -i 's/url = "" /url = "http:\/\/martincyber.com:8080\/submit"/' /etc/dionaea/dionaea.conf
  26. sudo sed -i 's/"http",//g' /etc/dionaea/dionaea.conf
  27. sudo sed -i 's/levels = "all"/levels = "warning,error"/g' /etc/dionaea/dionaea.conf
  28. #sudo echo "killall dionaea; rm -rf /var/dionaea/log/*;sudo /usr/bin/dionaea -c /etc/dionaea/dionaea.conf -w /var/dionaea -u nobody -g nogroup -D" >> /etc/cron.daily/logrotate
  29. sudo dionaea -c /etc/dionaea/dionaea.conf -w /var/dionaea -u nobody -g nogroup -D
  30.  
  31. ######## Move SSH to port 2222 ############
  32. sudo sed -i 's/Port 22/Port 2222/g' /etc/ssh/sshd_config
  33. sudo service ssh reload
  34.  
  35. ######## Install glastopf honeypot ##############
  36. sudo apt-get -y install git-core subversion python-openssl build-essential make python-chardet
  37. cd /opt && sudo git clone git://github.com/rep/evnet.git
  38. cd /opt/evnet
  39. sudo python setup.py install
  40. cd /opt && sudo svn co svn://glastopf.org:9090/glaspot glaspot
  41. cd /opt/glaspot/trunk/sandbox && sudo make
  42. cd /opt/glaspot/trunk
  43. sudo sed -i 's/8080/80/' glastopf.cfg
  44. sudo python /opt/glaspot/trunk/webserver.py &
  45.  
  46.  
  47. ######## Install kippo ssh honeypot #############
  48. sudo apt-get -y install python-dev openssl python-openssl python-pyasn1 python-twisted subversion authbind
  49. sleep 5
  50. sudo useradd -s /bin/false -d /home/kippo -m kippo
  51. cd /home/kippo
  52. sudo svn checkout http://kippo.googlecode.com/svn/trunk/ .
  53. sudo touch /etc/authbind/byport/22
  54. sudo chown kippo:kippo /etc/authbind/byport/22
  55. sudo chmod 777 /etc/authbind/byport/22
  56. sudo mv kippo.cfg.dist kippo.cfg
  57. sudo sed -i 's/twistd -y kippo.tac -l log\/kippo.log --pidfile kippo.pid/authbind --deep twistd -y kippo.tac -l log\/kippo.log --pidfile kippo.pid/g' start.sh
  58. sudo chmod 0440 /etc/sudoers
  59. sudo chmod g+r /etc/sudoers
  60. sudo echo 'kippo ALL=(ALL:ALL) ALL' >> /etc/sudoers
  61. sudo chown -R kippo:kippo /home/kippo/
  62. sudo sed -i 's/ssh_port = 2222/ssh_port = 22/g' kippo.cfg
  63. sudo -u kippo ./start.sh
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement