Advertisement
Guest User

Untitled

a guest
Dec 9th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. adduser --disabled-password cowrie
  2.  
  3. [install dependency)
  4. apt-get install git acl apt-utils python-dev python-virtualenv libssl-dev libffi-dev python3-dev (default-)libmysqlclient-dev build-essential libpython3-dev python3-minimal authbind virtualenv apache2 php libapache2-mod-php php-mysql php-gd php-curl -y
  5.  
  6. [install kippo-graph]
  7. git clone https://github.com/ikoniaris/kippo-graph.git /var/www/html/kippo-graph
  8. chmod 777 /var/www/html/kippo-graph/generated-graphs
  9. cp /var/www/html/kippo-graph/config.php.dist /var/www/html/kippo-graph/config.php
  10. nano /var/www/html/kippo-graph/config.php
  11. setfacl -Rm g:www-data:rx /home/cowrie/cowrie/var/lib/cowrie/tty/
  12. nano /var/www/html/kippo-graph/config.php
  13.  
  14. [install cowrie]
  15.  
  16. su cowrie
  17. cd && git clone http://github.com/cowrie/cowrie
  18. cd cowrie
  19. pwd
  20. virtualenv cowrie-env
  21. source cowrie-env/bin/activate
  22. pip install --upgrade pip
  23. pip install --upgrade -r requirements.txt
  24. pip install mysql-python
  25. pip install mysqlclient
  26. exit
  27.  
  28. [install mysql]
  29. cd /home/cowrie/cowrie/
  30. mysql -u root -p
  31.  
  32. CREATE DATABASE cowrie;
  33. GRANT ALL ON cowrie.* TO 'cowrie'@'localhost' IDENTIFIED BY 'admin';
  34. FLUSH PRIVILEGES;
  35. USE cowrie;
  36. source ./docs/sql/mysql.sql;
  37. exit
  38.  
  39.  
  40. nano /etc/mysql/conf.d/disable_strict_mode.cnf
  41. [mysqld]
  42. sql_mode=IGNORE_SPACE,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
  43.  
  44.  
  45. [install webserver]
  46. (kalau apache2)
  47. cd /etc/apache2/
  48. htpasswd -c /etc/apache2/cowrie.passwd cowrie
  49. nano /etc/apache2/sites-enabled/000-default.conf
  50.  
  51. (kalau nginx)
  52. cd /etc/nginx/
  53. htpasswd -c /etc/nginx/cowrie.passwd cowrie
  54. nano /etc/nginx/sites-enabled/default.conf
  55. systemctl restart nginx
  56.  
  57. su cowrie
  58. nano /home/cowrie/cowrie/etc/cowrie.cfg.dist #(update cowrie config port and mysql output)
  59. cd /home/cowrie/cowrie/bin/
  60. ./cowrie start
  61.  
  62. iptables -t nat -A PREROUTING -p tcp --dport 22 -j REDIRECT --to-port 2222
  63. iptables -t nat -A PREROUTING -p tcp --dport 23 -j REDIRECT --to-port 2223
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement