Exemple #1
0
<?php

chdir("../../../../");
define('GWF_PAGE_TITLE', 'Training: Crypto - Caesar I');
require_once "challenge/html_head.php";
require_once GWF_CORE_PATH . 'module/WeChall/solutionbox.php';
require_once GWF_CORE_PATH . 'module/WeChall/WC_CryptoChall.php';
if (false === ($chall = WC_Challenge::getByTitle(GWF_PAGE_TITLE))) {
    $chall = WC_Challenge::dummyChallenge(GWF_PAGE_TITLE, 1, 'challenge/training/crypto/caesar/index.php');
}
$chall->showHeader();
WC_CryptoChall::checkSolution($chall, 'The Foo The Bar The Lee', true, true);
echo GWF_Box::box($chall->lang('info'), $chall->lang('title'));
echo GWF_Box::box(crypto_caesar_1_ciphertext($chall));
formSolutionbox($chall);
echo $chall->copyrightFooter();
require_once "challenge/html_foot.php";
function crypto_caesar_1_ciphertext(WC_Challenge $chall)
{
    WC_CryptoChall::checkPlaintext(strtoupper($chall->lang('plaintext')));
    $solution = WC_CryptoChall::generateSolution('The Foo The Bar The Lee', true, true);
    $pt = $chall->lang('plaintext', array($solution));
    $pt = strtoupper($pt);
    $pt = preg_replace('/[^A-Z ]/', '', $pt);
    $ct = crypto_caesar_1_encrypt($pt);
    return $ct;
}
function crypto_caesar_1_encrypt($pt)
{
    $a = ord('A');
    $ct = '';
Exemple #2
0
<?php

chdir("../../../../");
define('GWF_PAGE_TITLE', 'Training: GPG');
require_once 'challenge/html_head.php';
require_once GWF_CORE_PATH . 'module/WeChall/WC_CryptoChall.php';
require_once GWF_CORE_PATH . 'module/WeChall/solutionbox.php';
if (false === ($chall = WC_Challenge::getByTitle(GWF_PAGE_TITLE))) {
    $chall = WC_Challenge::dummyChallenge(GWF_PAGE_TITLE, 2, '/challenge/training/crypto/gpg/index.php', false);
}
$chall->showHeader();
WC_CryptoChall::checkSolution($chall, 'OHOYOUGOTGPG!', true, false);
if (false !== Common::getPost('send')) {
    wccgpg_doit($chall, GWF_Session::getUser());
}
$url = GWF_WEB_ROOT . 'account';
echo GWF_Box::box($chall->lang('info', array($url)), $chall->lang('title'));
$form = '<form action="index.php" method="post">' . PHP_EOL;
$form .= '<input type="submit" name="send" value="' . $chall->lang('btn_send') . '" />' . PHP_EOL;
$form .= '</form>' . PHP_EOL;
echo GWF_Box::box($form);
formSolutionbox($chall);
echo $chall->copyrightFooter();
require_once 'challenge/html_foot.php';
function wccgpg_doit(WC_Challenge $chall, $user)
{
    if ($user === false) {
        echo GWF_HTML::error('GPG', $chall->lang('err_login'), false);
        return;
    }
    if (!$user->hasValidMail()) {
Exemple #3
0
<?php

chdir("../../../../");
define('GWF_PAGE_TITLE', 'Training: Crypto - Substitution II');
require_once "challenge/html_head.php";
require_once GWF_CORE_PATH . 'module/WeChall/solutionbox.php';
require_once GWF_CORE_PATH . 'module/WeChall/WC_CryptoChall.php';
if (false === ($chall = WC_Challenge::getByTitle(GWF_PAGE_TITLE))) {
    $chall = WC_Challenge::dummyChallenge(GWF_PAGE_TITLE, 2, 'challenge/training/crypto/simplesub2/index.php');
}
$chall->showHeader();
WC_CryptoChall::checkSolution($chall, 'The_GHttttttEEEEZZ', true, true);
echo GWF_Box::box($chall->lang('info'), $chall->lang('title'));
echo GWF_Box::box(crypto_sub2_ciphertext($chall));
formSolutionbox($chall);
$chall->copyrightFooter();
require_once "challenge/html_foot.php";
function crypto_sub2_ciphertext(WC_Challenge $chall)
{
    WC_CryptoChall::checkPlaintext($chall->lang('plaintext'), true);
    $solution = WC_CryptoChall::generateSolution('The_GHttttttEEEEZZ', true, true);
    $chars1 = array();
    for ($i = 0; $i < 256; $i++) {
        $chars1[] = chr($i);
    }
    $chars2 = array();
    for ($i = 0; $i < 256; $i++) {
        $chars2[] = chr($i);
    }
    shuffle($chars1);
    shuffle($chars2);
Exemple #4
0
<?php

chdir('../../../../');
define('GWF_PAGE_TITLE', 'Training: Baconian');
require_once 'challenge/html_head.php';
require_once GWF_CORE_PATH . 'module/WeChall/WC_CryptoChall.php';
require_once GWF_CORE_PATH . 'module/WeChall/solutionbox.php';
if (false === ($chall = WC_Challenge::getByTitle(GWF_PAGE_TITLE))) {
    $chall = WC_Challenge::dummyChallenge(GWF_PAGE_TITLE, 2, 'challenge/training/encodings/bacon/index.php', false);
}
$chall->showHeader();
if (isset($_POST['answer']) && is_string($_POST['answer'])) {
    $_POST['answer'] = strtoupper($_POST['answer']);
}
WC_CryptoChall::checkSolution($chall, 'HamAndEggsAndBaconAndBeer!', true, false);
echo GWF_Box::box($chall->lang('info'), $chall->lang('title'));
$hidden = bacon_prepare_hidden($chall);
if (true === bacon_check_messages($chall, $hidden)) {
    echo GWF_Box::box(bacon_encode($chall, $hidden), $chall->lang('msg_title'));
}
formSolutionbox($chall);
echo $chall->copyrightFooter();
require_once 'challenge/html_foot.php';
function bacon_prepare_hidden(WC_Challenge $chall)
{
    $solution = WC_CryptoChall::generateSolution('HamAndEggsAndBaconAndBeer!', true, false);
    $hidden = $chall->lang('hidden', array($solution));
    $hidden = str_replace(' ', 'X', $hidden);
    $hidden = strtoupper($hidden) . 'XX';
    return $hidden;
}
Exemple #5
0
<?php

chdir("../../../../");
define('GWF_PAGE_TITLE', 'Training: Crypto - Digraphs');
require_once "challenge/html_head.php";
require_once GWF_CORE_PATH . 'module/WeChall/solutionbox.php';
require_once GWF_CORE_PATH . 'module/WeChall/WC_CryptoChall.php';
if (false === ($chall = WC_Challenge::getByTitle(GWF_PAGE_TITLE))) {
    $chall = WC_Challenge::dummyChallenge(GWF_PAGE_TITLE, 1, 'challenge/training/crypto/digraph/index.php');
}
$chall->showHeader();
WC_CryptoChall::checkSolution($chall, 'The22_GHDIdiiiiEEEEZZ', true, true);
echo GWF_Box::box($chall->lang('info'), $chall->lang('title'));
echo GWF_Box::box(crypto_dig1_ciphertext($chall));
formSolutionbox($chall);
echo $chall->copyrightFooter();
require_once "challenge/html_foot.php";
function crypto_dig1_ciphertext(WC_Challenge $chall)
{
    WC_CryptoChall::checkPlaintext($chall->lang('plaintext'), true);
    $solution = WC_CryptoChall::generateSolution('The22_GHDIdiiiiEEEEZZ', true, true);
    $pt = $chall->lang('plaintext', array($solution));
    $ct = crypto_dig1_encrypt($pt);
    return $ct;
}
function crypto_dig1_encrypt($pt)
{
    $map = array();
    $ct = '';
    $len = strlen($pt);
    for ($i = 0; $i < $len; $i++) {
Exemple #6
0
<?php

chdir("../../../../");
define('GWF_PAGE_TITLE', 'Training: Crypto - Caesar II');
require_once "challenge/html_head.php";
require_once GWF_CORE_PATH . 'module/WeChall/solutionbox.php';
require_once GWF_CORE_PATH . 'module/WeChall/WC_CryptoChall.php';
if (false === ($chall = WC_Challenge::getByTitle(GWF_PAGE_TITLE))) {
    $chall = WC_Challenge::dummyChallenge(GWF_PAGE_TITLE, 1, 'challenge/training/crypto/caesar2/index.php');
}
$chall->showHeader();
WC_CryptoChall::checkSolution($chall, 'The_Foo!The!Bar_The!Lee', true, true);
echo GWF_Box::box($chall->lang('info'), $chall->lang('title'));
echo GWF_Box::box(crypto_caesar_2_ciphertext($chall));
formSolutionbox($chall);
$chall->copyrightFooter();
require_once "challenge/html_foot.php";
function crypto_caesar_2_ciphertext(WC_Challenge $chall)
{
    WC_CryptoChall::checkPlaintext($chall->lang('plaintext'), true);
    $solution = WC_CryptoChall::generateSolution('The_Foo!The!Bar_The!Lee', true, true);
    $pt = $chall->lang('plaintext', array($solution));
    //	$pt = strtoupper($pt);
    //	$pt = preg_replace('/[^A-Z]/', '', $pt);
    $ct = crypto_caesar_2_encrypt($pt);
    return WC_CryptoChall::hexdump($ct);
}
function crypto_caesar_2_encrypt($pt)
{
    $a = 0;
    $ct = '';
Exemple #7
0
<?php

chdir('../../../../');
define('GWF_PAGE_TITLE', 'Training: ASCII');
require_once 'challenge/html_head.php';
require_once GWF_CORE_PATH . 'module/WeChall/solutionbox.php';
if (false === ($chall = WC_Challenge::getByTitle(GWF_PAGE_TITLE))) {
    $chall = WC_Challenge::dummyChallenge(GWF_PAGE_TITLE, 1, 'challenge/training/encodings/ascii/index.php', false);
}
$chall->showHeader();
require_once GWF_CORE_PATH . 'module/WeChall/WC_CryptoChall.php';
WC_CryptoChall::checkSolution($chall, 'OHNOASCII', true, true);
$solution = WC_CryptoChall::generateSolution('OHNOASCII', true, true);
$msg = $chall->lang('message', array($solution));
$message = '';
$len = strlen($msg);
for ($i = 0; $i < $len; $i++) {
    $message .= ', ' . ord($msg[$i]);
}
$message = substr($message, 2);
echo GWF_Box::box($chall->lang('info', array($message)), $chall->lang('title'));
formSolutionbox($chall);
echo $chall->copyrightFooter();
require_once 'challenge/html_foot.php';
Exemple #8
0
<?php

define('LSB_IMAGE_PATH', 'challenge/training/stegano/LSB/gizmore2.png');
chdir('../../../../');
define('GWF_PAGE_TITLE', 'Training: LSB');
require_once 'challenge/html_head.php';
require_once GWF_CORE_PATH . 'module/WeChall/WC_CryptoChall.php';
require_once GWF_CORE_PATH . 'module/WeChall/solutionbox.php';
if (false === ($chall = WC_Challenge::getByTitle(GWF_PAGE_TITLE))) {
    $chall = WC_Challenge::dummyChallenge(GWF_PAGE_TITLE, 2, '/challenge/training/stegano/LSB/index.php', false);
}
$chall->showHeader();
if (isset($_POST['answer']) && is_string($_POST['answer'])) {
    $_POST['answer'] = strtoupper($_POST['answer']);
}
WC_CryptoChall::checkSolution($chall, 'YouAreNotLeanorado!', true, false);
$solution = WC_CryptoChall::generateSolution('YouAreNotLeanorado!', true, false);
$path = lsb_gen_image($solution);
$href = 'http://wechall.blogspot.com/2007/11/steganabara-explained.html';
$hidden_hint = sprintf('<p style="color: #eee;">Hidden Hint: %s</p>', $href);
$thx = 'buttmonkey';
if (false !== ($user = GWF_User::getByName($thx))) {
    $thx = $user->displayProfileLink();
}
echo GWF_Box::box($chall->lang('info', array($hidden_hint, $thx)), $chall->lang('title'));
$title = $chall->lang('img_title');
$htmlimg = sprintf('<img src="%s%s" alt="%s" title="%s" width="480" height="212" />', GWF_WEB_ROOT, $path, $title, $title);
echo GWF_Box::box($htmlimg, $title);
formSolutionbox($chall);
echo $chall->copyrightFooter();
require_once 'challenge/html_foot.php';
Exemple #9
0
<?php

chdir('../../../../');
define('GWF_PAGE_TITLE', 'Training: Bacon Returns');
require_once 'challenge/html_head.php';
require_once GWF_CORE_PATH . 'module/WeChall/WC_CryptoChall.php';
require_once GWF_CORE_PATH . 'module/WeChall/solutionbox.php';
if (false === ($chall = WC_Challenge::getByTitle(GWF_PAGE_TITLE))) {
    $chall = WC_Challenge::dummyChallenge(GWF_PAGE_TITLE, 3, 'challenge/training/encodings/bacon2/index.php', false);
}
$chall->showHeader();
if (isset($_POST['answer']) && is_string($_POST['answer'])) {
    $_POST['answer'] = strtoupper($_POST['answer']);
}
WC_CryptoChall::checkSolution($chall, 'HamAndEggsAndTheBaconAndThreeBeer', true, false);
$href1 = GWF_WEB_ROOT . 'challenge/training/encodings/bacon/index.php';
echo GWF_Box::box($chall->lang('info', array($href1)), $chall->lang('title'));
$hidden = bacon2_prepare_hidden($chall);
echo GWF_Box::box(bacon2_encode($chall, $hidden), $chall->lang('msg_title'));
formSolutionbox($chall);
echo $chall->copyrightFooter();
require_once 'challenge/html_foot.php';
function bacon2_prepare_hidden(WC_Challenge $chall)
{
    $solution = WC_CryptoChall::generateSolution('HamAndEggsAndTheBaconAndThreeBeer', true, false);
    $hidden = $chall->lang('hidden', array($solution));
    $hidden = str_replace(' ', 'X', $hidden);
    $hidden = strtoupper($hidden);
    #.'XX';
    return $hidden;
}
Exemple #10
-1
<?php

chdir('../../../../');
define('GWF_PAGE_TITLE', 'Stegano Attachment');
require_once 'challenge/html_head.php';
require_once GWF_CORE_PATH . 'module/WeChall/WC_CryptoChall.php';
require_once GWF_CORE_PATH . 'module/WeChall/solutionbox.php';
if (false === ($chall = WC_Challenge::getByTitle(GWF_PAGE_TITLE))) {
    $chall = WC_Challenge::dummyChallenge(GWF_PAGE_TITLE, 2, '/challenge/training/stegano/attachment/index.php', false);
}
$chall->showHeader();
WC_CryptoChall::checkSolution($chall, 'YouLikeAttachmentEh', true, false);
echo GWF_Box::box($chall->lang('info', array('attachment.php')), $chall->lang('title'));
formSolutionbox($chall);
echo $chall->copyrightFooter();
require_once 'challenge/html_foot.php';