Path: blob/master/fake_vhost_domain/debelhui.sh
1301 views
#!/usr/bin/bash1# Author V.Varbanovski @nu11secur1ty2#3#4# Prepare apache5cd /etc/apache2/sites-available6mv 000-default.conf 000-default.conf.backup78echo "Type your fake domain, for example: 'kurec.com'"9read fuck1011mkdir -p /var/www/$fuck/public_html12cd /var/www/$fuck/public_html/13cat > index.html << EOF14<!DOCTYPE html>15<html>16<head>17<meta charset="utf-8">18<title>Welcome to your fucking production</title>19</head>20<body>21<h1>Success! Welcome to your fucking production $fck set up completed!</h1>22</body>23</html>24EOF25# Creating vhost26chown -R www-data: /var/www/$fuck27cd /etc/apache2/sites-available/28cat > $fuck.conf << EOF29<VirtualHost *:80>30ServerName $fuck.com31ServerAlias www.$fuck32DocumentRoot /var/www/$fuck/public_html3334<Directory /var/www/$fuck/public_html>35Options -Indexes +FollowSymLinks36AllowOverride All37</Directory>3839ErrorLog ${APACHE_LOG_DIR}/$fuck-error.log40CustomLog ${APACHE_LOG_DIR}/$fuck-access.log combined41</VirtualHost>42EOF43# Enabling vhost44a2ensite $fuck45systemctl restart apache24647cd /etc/48echo "Type you IP"49read IP50cat >> hosts << EOF51$IP $fuck52EOF53systemctl restart apache254exit 0;555657