-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
128 lines (95 loc) · 3.48 KB
/
README
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
This is the sourcecode for a website that lets people make CTF web challenges for others, and then lets others solve the challenges and points are atributed to the challenge based on how many people have solved the challenge.
List of dependencies (install with apt-get)
python-flask
postgresql
python-psycopg2
postgresql-plpython3
bind9
apparmor-utils
python-pip
python-tornado
python-passlib
python-bcrypt
php5-cgi
sudo apt-get install python-flask postgresql python-psycopg2 postgresql-plpython3 bind9 apparmor-utils python-pip python-tornado python-passlib python-bcrypt php5-cgi
List of dependencies (install with pip)
Flask-Mail
sudo pip install Flask-Mail
###### Setting up local instance for testing ########
inorder to start your server on your machine you must edit /etc/hosts file and add
127.0.0.1 testing.com
127.0.0.1 u1.testing.com
127.0.0.1 u2.testing.com
If you need any more subdomains you must say them in this file, wildcards do not exist :(
create config file located in base
start the server
###### Setting up a vm for testing ######
create a vm running ubuntu 64 bit.
set the serve to be host only, and get the ip.
add to /etc/hosts file
{ip of server} testing.test
setup the server the same as a normal only using testing.com as the host.
##### Setting up server ################################
/etc/bind/named.conf.local(indentation for reading)
//
// Do any local configuration here
//
// Consider adding the 1918 zones here, if they are not used in your
// organization
//include "/etc/bind/zones.rfc1918";
zone "want2hack.com" {
type master;
file "/etc/bind/db.want2hack.com";
};
zone "infsek.tk" {
type master;
file "/etc/bind/db.infsek.tk";
};
/etc/bind/db.want2hack.com (indentation for reading)
;
; BIND reverse data file for infsek.tk
;
$TTL 604800
@ IN SOA ns.want2hack.com. root.want2hack.com. (
7777 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS ns.want2hack.com.
ns IN A 50.112.109.159
want2hack.com. IN A 50.112.109.159
* IN A 50.112.109.159
add the following line to /etc/bind/named.conf.options within the options {}
recursion no;
do this in the install directory
do this to set up postgresql database
$ sudo passwd postgres
>> {choose a password for postgres}
$ su postgres
>> {postgres password}
postgres$ psql
psql> \i config.sql
psql> ALTER USER want2hack PASSWORD '{choose a want2hack password, different from postgres}';
psql> \q
postgres$ exit
The ALTER USER should not be needed but it was an easy quick fix for now to keep people from all using the same password
$ createlang plpython3u want2hack -U want2hack -h localhost -W
>> {want2hack password}
$ psql want2hack -U want2hack -h localhost -W
>> {want2hack password}
psql> \i install.sql
psql> \i add_analytics.sql
psql> \q
Run sudo server.py in the app directory, this will make your config.
create a user to run the server as.
edit /etc/want2hack.conf
change the permisions on /etc/want2hack.conf to 600
run sudo server.py again and it will setup the apparmor profile.
Once your config is set server.py will also start the server
to setup an initscript run the file install_init_script.py in install
then run "sudo update-rc.d -f want2hack defaults"
sudo service want2hack start
Backup
look in the install directory