Advertisement
Guest User

Untitled

a guest
Mar 6th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.14 KB | None | 0 0
  1. #Update the baseline and install dependencies
  2. sudo yum -y update
  3. sudo yum -y upgrade
  4. sudo yum -y install gcc gcc-c++ boost cmake make wget vim git mysql-devel kernel-devel-$(uname -r) p7zip
  5. sudo yum -y install tar libpciaccess numactl-libs coreutils
  6. sudo yum -y groupinstall "Development Tools"
  7. sudo yum -y install ncurses-devel zlib-devel texinfo gtk+-devel gtk2-devel qt-devel tk-devel kernel-headers kernel-devel rpmdevtools openssl openssl-devel bc
  8.  
  9. mkdir ~/tmp
  10. cd ~/tmp
  11.  
  12. # Download Untar and Install Hashcat Dependencies
  13. # Need an internal repo to build script without calling hashcat server (blocked via policy)
  14. wget "https://hashcat_repo/files/hashcat.7z"
  15. 7za x hashcat.7z
  16. rm -rf hashcat.7z
  17. sudo chmod 777 /usr/local/bin
  18. cp -R hashcat/* /usr/local/bin
  19. sudo chmod 755 /usr/local/bin
  20. sudo mkdir /usr/local/share/hashcat/
  21. sudo mkdir /usr/local/share/hashcat/OpenCL
  22. sudo cp -r /usr/local/bin/OpenCL/ /usr/local/share/hashcat/OpenCL/
  23.  
  24. # Download, Untar, and Make Redis
  25.  
  26. cd ~/tmp
  27. wget -c http://download.redis.io/redis-stable.tar.gz
  28. tar -xvzf redis-stable.tar.gz
  29. cd redis-stable
  30. make
  31. sudo make install
  32.  
  33. # Create Directories and Copy Redis Files
  34. sudo mkdir /etc/redis
  35. sudo mkdir -p /var/redis/
  36. sudo cp redis.conf /etc/redis/
  37. sudo ln -s /var/run/redis_6379.pid /var/run/redis.pid
  38.  
  39. # Configure Redis.conf
  40.  
  41. sed -i "s/^daemonize no$/daemonize yes/" /etc/redis/redis.conf
  42. sed -i 's/^logfile\ \"\"$//' /etc/redis/redis.conf
  43. echo 'logfile "/var/redis/redis.log"' >> /etc/redis/redis.conf
  44.  
  45. # Install RVM and RUBY
  46. curl -sSL https://rvm.io/mpapis.asc | gpg2 --import -
  47. curl -sSL https://get.rvm.io | bash -s stable --ruby
  48. source /usr/local/rvm/scripts/rvm
  49.  
  50. # Install Hashview
  51. cd /var/www/
  52. sudo git clone https://github.com/hashview/hashview
  53. sudo chown -R centos:centos /var/www/hashview
  54. cd hashview
  55. rvm install ruby-2.2.2
  56. gem install bundler
  57. bundle install
  58.  
  59. # Configure Database
  60. rm -rf /var/www/hashview/config/database.yml
  61.  
  62. echo "Enter your MySQL server database name:"
  63. read database
  64.  
  65. echo "Enter your MySQL server hostname:"
  66. read hostname
  67.  
  68. echo "Enter your MySQL server user:"
  69. read user
  70.  
  71. echo "Enter your MySQL server password:"
  72. read password
  73.  
  74. cp /var/www/hashview/config/database.yml.example /var/www/hashview/config/database.yml
  75. sed -i "s|\hashview|${database}|g" /var/www/hashview/config/database.yml
  76. sed -i "s|\localhost|${hostname}:g" /var/www/hashview/config/database.yml
  77. sed -i "s|root|${user}|g" /var/www/hashview/config/database.yml
  78. sed -i "s|CHANGEME|${password}|g" /var/www/hashview/config/database.yml
  79.  
  80. # configure agent settings in agent_config.json
  81. # declare master or slave
  82. # placeholder
  83.  
  84. # build hashview startup scripts
  85.  
  86. cd /var/www/hashview/
  87. sudo chmod 777 /etc/systemd/system
  88. foreman export --app="hashview" --user="centos" systemd /etc/systemd/system
  89. sudo chmod 755 /etc/systemd/system
  90.  
  91. # configure startup scripts
  92. # Change environment variable from mentioning a port and instead auto-start production application.
  93. # RACK_ENV=production
  94. vim /etc/systemd/system/hashview-web@.service
  95. vim /etc/systemd/system/hashview-background-worker@.service
  96. vim /etc/systemd/system/hashview-hashcat-worker@.service
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement