Permalink
Browse files

Adding level 7.

Base box needs an update, which I haven't done yet. See the comment in puppet/modules/stripectf2/manifests/level07.pp
  • Loading branch information...
1 parent ca5b30f commit 3456c1d4e30459f7339683e868c855b610cdb8c9 @e28eta committed Feb 15, 2013
Showing with 87 additions and 0 deletions.
  1. +3 −0 Vagrantfile
  2. +3 −0 building-stripe-ctf-base.txt
  3. +12 −0 hosts.txt
  4. +62 −0 puppet/modules/stripectf2/manifests/level07.pp
  5. +7 −0 puppet/nodes/level07.pp
View
@@ -26,6 +26,9 @@ Vagrant::Config.run do |config|
config.vm.define :level6 do |box_config|
configure(box_config, "6")
end
+ config.vm.define :level7 do |box_config|
+ configure(box_config, "7")
+ end
config.vm.define :level8 do |box_config|
configure(box_config, "8")
end
@@ -26,3 +26,6 @@ sudo ln -s /home/vagrant/n1k0-casperjs-bc0da16/bin/casperjs /usr/local/bin
# Level 8
sudo apt-get install -y python2.6-dev
sudo pip install -U Twisted==11.1.0 argparse==1.2.1 distribute==0.6.24 wsgiref==0.1.2 zope.interface==4.0.1
+
+# Level 7
+sudo pip install requests py-bcrypt
View
@@ -0,0 +1,12 @@
+# Stripe CTF Vagrant boxes
+# Copy/paste into your hosts file
+192.168.33.100 level00-1.stripe-ctf.com
+192.168.33.101 level01-1.stripe-ctf.com
+192.168.33.102 level02-1.stripe-ctf.com
+192.168.33.103 level03-1.stripe-ctf.com
+192.168.33.104 level04-1.stripe-ctf.com
+192.168.33.105 level05-1.stripe-ctf.com
+192.168.33.106 level06-1.stripe-ctf.com
+192.168.33.107 level07-1.stripe-ctf.com
+192.168.33.108 level08-1.stripe-ctf.com
+
@@ -0,0 +1,62 @@
+# Needs:
+# sudo pip install requests py-bcrypt
+# I haven't yet added this to the base box, so you'll need to start level7, manually run the command, and re-provision
+class stripectf2::level07 (
+ $destination,
+ $source,
+) {
+ file {$destination:
+ ensure => 'directory',
+ recurse => true,
+ mode => '0755',
+ owner => 'vagrant',
+ group => 'vagrant',
+ source => $source,
+ }
+
+ stripectf2::random_password {"${destination}/password.txt":
+ require => File[$destination],
+ }
+
+ exec {'initialize_db.py':
+ creates => ["${destination}/wafflecopter.db", "${destination}/entropy.dat"],
+ command => "${destination}/initialize_db.py `cat ${destination}/password.txt`",
+ require => Stripectf2::Random_password["${destination}/password.txt"],
+ subscribe => Stripectf2::Random_password["${destination}/password.txt"],
+ }
+
+ service {'wafflecopter.py':
+ ensure => 'running',
+ start => "cd ${destination} && ./wafflecopter.py &",
+ provider => 'base',
+ require => [File[$destination],
+ Exec["initialize_db.py"]],
+ subscribe => Exec["initialize_db.py"],
+ }
+
+ service {'apache2':
+ ensure => 'running',
+ enable => true,
+ hasrestart => true,
+ }
+
+ # Disable the default apache2 site
+ stripectf2::apache2_site {'000-default':
+ ensure => 'absent',
+ }
+
+ stripectf2::apache2_module {['proxy', 'proxy_http']:
+ ensure => 'present',
+ }
+
+ $proxy_url = "http://127.0.0.1:9233/"
+ file {'/etc/apache2/sites-available/level07':
+ content => template('stripectf2/apache2_site_config.erb'),
+ notify => Service['apache2'],
+ }
+
+ stripectf2::apache2_site {'level07':
+ ensure => 'present',
+ require => File['/etc/apache2/sites-available/level07'],
+ }
+}
View
@@ -0,0 +1,7 @@
+node 'level07-1.stripe-ctf.com' {
+ class {'stripectf2::level07':
+ destination => '/levels/07',
+ source => '/vagrant/levels/7',
+ require => File['/levels'],
+ }
+}

0 comments on commit 3456c1d

Please sign in to comment.