Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
nu11secur1ty
GitHub Repository: nu11secur1ty/Kali-Linux
Path: blob/master/fake_vhost_domain/debelhui.sh
1301 views
1
#!/usr/bin/bash
2
# Author V.Varbanovski @nu11secur1ty
3
#
4
#
5
# Prepare apache
6
cd /etc/apache2/sites-available
7
mv 000-default.conf 000-default.conf.backup
8
9
echo "Type your fake domain, for example: 'kurec.com'"
10
read fuck
11
12
mkdir -p /var/www/$fuck/public_html
13
cd /var/www/$fuck/public_html/
14
cat > index.html << EOF
15
<!DOCTYPE html>
16
<html>
17
<head>
18
<meta charset="utf-8">
19
<title>Welcome to your fucking production</title>
20
</head>
21
<body>
22
<h1>Success! Welcome to your fucking production $fck set up completed!</h1>
23
</body>
24
</html>
25
EOF
26
# Creating vhost
27
chown -R www-data: /var/www/$fuck
28
cd /etc/apache2/sites-available/
29
cat > $fuck.conf << EOF
30
<VirtualHost *:80>
31
ServerName $fuck.com
32
ServerAlias www.$fuck
33
DocumentRoot /var/www/$fuck/public_html
34
35
<Directory /var/www/$fuck/public_html>
36
Options -Indexes +FollowSymLinks
37
AllowOverride All
38
</Directory>
39
40
ErrorLog ${APACHE_LOG_DIR}/$fuck-error.log
41
CustomLog ${APACHE_LOG_DIR}/$fuck-access.log combined
42
</VirtualHost>
43
EOF
44
# Enabling vhost
45
a2ensite $fuck
46
systemctl restart apache2
47
48
cd /etc/
49
echo "Type you IP"
50
read IP
51
cat >> hosts << EOF
52
$IP $fuck
53
EOF
54
systemctl restart apache2
55
exit 0;
56
57