Skip to content

Commit

Permalink
Beta 2 (#7)
Browse files Browse the repository at this point in the history
* Create the basic outline of a web app without any challenges (#1)

* Start a readme file

* Fix headers because how do I header?

* Add a simple application that runs

* Add a session

* Add a public folder

* Basic template

* Add a header / footer

* Add a blank level 1

* Add some basic level templates

* Add bootstrap.js

* Add a navbar

* Lots of cleanups to the web code

* Add header/footer I forgot

* Basic challenges written and styled (#2)

* Implement level 1

* Add level 2

* Formatting fix

* Add level 3

* Add level 4

* Add skeleton files for 5/6/7

* Started to develop Level 5

* Add A challenge/solution for level 5

* Extracted level 5's code into a module to make it re-useable for level 6 and 7

* Add level 6, start workign on level 7

* Finish level 7 walkthrough

* Lots of refactoring and cleanup

* Add a dockerfile + rackup configuration (#3)

* Add solution files I missed earlier (#4)

* Add persistent sessions

* Remove old Rakefile

* Update and fix the makefile

* Updated the links to point to the new presentation

* Add a Makefile for docker
  • Loading branch information
iagox86 authored Jan 14, 2019
1 parent 6c1eab6 commit 66503f5
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 24 deletions.
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
all:
docker build -t cryptorama .

run:
docker run --rm -p 3000:3000 -ti cryptorama

clean:
docker rm cryptorama
15 changes: 6 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,24 @@
Cryptorama!

This is a fun series of crypto challenges that I designed to go along with
[a crypto workshop](https://drive.google.com/drive/u/0/folders/1rF_Wn1t31lK-EXofOAT58nDc7ZUDSGSt)
[a crypto workshop](https://drive.google.com/open?id=1nJB-PbDxTDDZFniFW1N3-N7stVavPe9bP7MMZgGbCvc)
I created.

# Running

The easiest way to run this is to use docker. Then just run...
The easiest way to run this is to use docker. With docker installed and running,
run...


```
make install
make run
make && make run
```

...as any user in the local `docker` group.

# Challenges

See the [src/](src/) folder for the application source code.
See the [src/](src/) folder for the application source code and
[solution/](solution/] for solutions.

TODO: Outline the challenges here

# Solutions

See the [solutions/](solutions/) folder for solutions and walkthroughs.
7 changes: 7 additions & 0 deletions solution/level1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,10 @@ Solution: `dr.z`
# Walkthrough

This is just layers and layers of encoding. The bottom string is what matters!

Here's Jeff's:

```
echo '...' | ' | tr -d ' ' | base64 -d | tr ' ' '\n' | while read line || [ -n "$line" ]; do echo "$line" | xxd -r -p; done | tr ' ' '\n' | while read line || [ -n "$line" ]; do printf \\$(printf "%o" $line); done | while read -n 2 hex; do echo "$hex" | xxd -r -p; done | base32 -d
From the desk of Dr.Z (unlicensed)<Paste>
```
10 changes: 0 additions & 10 deletions src/Rakefile

This file was deleted.

10 changes: 8 additions & 2 deletions src/lib/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
require 'sinatra'
require 'sinatra/base'
require 'singlogger'
require 'securerandom'

require 'level1'
require 'level2'
Expand All @@ -18,21 +19,26 @@
require 'level6'
require 'level7'

LOGGER = ::SingLogger.instance()

module Cryptorama
class Server < Sinatra::Base
enable :sessions

def initialize(*args)
super(*args)

@logger = ::SingLogger.instance()
end

configure do
if(defined?(PARAMS))
set :port, PARAMS[:port]
set :bind, PARAMS[:host]
end

set :session_secret, ENV.fetch('SESSION_SECRET') {
LOGGER.warn("No SESSION_SECRET found in ENV, using a random one")
SecureRandom.hex(64)
}
end

not_found do
Expand Down
2 changes: 1 addition & 1 deletion src/lib/level1.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class Server < Sinatra::Base
end

post '/level1' do
if params[:answer].downcase == LEVEL1[:answer].downcase
if params[:answer].downcase.index(LEVEL1[:answer].downcase)
session[:level2][:open] = true
session[:level1][:completed] = true

Expand Down
2 changes: 1 addition & 1 deletion src/lib/views/level1.erb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
</div>

<div class='answer'>
<p>Who stole the package? (please enter the name exactly as shown on the note)</p>
<p>Who stole the package? (please enter the name <strong>exactly as shown on the note</strong>)</p>

<%= erb :answer %>
</div>
2 changes: 1 addition & 1 deletion src/lib/views/navbar.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</li>

<li class="nav-item">
<a class="nav-link" href="https://drive.google.com/open?id=1rQ0toD54prlNi84tVXe9xh1b1a6fTeXewwUe8NI6p9g">Slides</a>
<a class="nav-link" href="https://drive.google.com/open?id=1nJB-PbDxTDDZFniFW1N3-N7stVavPe9bP7MMZgGbCvc">Slides</a>
</li>
</ul>
</div>
Expand Down

0 comments on commit 66503f5

Please sign in to comment.