Exemple #1
1
    die(file_get_contents('index.php'));
}
# Header
chdir('../../../');
define('GWF_PAGE_TITLE', 'Training: RegexMini');
require_once 'challenge/html_head.php';
if (false === ($chall = WC_Challenge::getByTitle(GWF_PAGE_TITLE))) {
    $chall = WC_Challenge::dummyChallenge(GWF_PAGE_TITLE, 2, 'challenge/training/regex2/index.php', false);
}
$chall->showHeader();
# Info box
echo GWF_Box::box($chall->lang('info', array('index.php?show=source', 'index.php?highlight=christmas')), $chall->lang('title'));
# Show highlighted src
if (isset($_GET['highlight'])) {
    $source = '[PHP title=regex2/index.php]' . file_get_contents('challenge/training/regex2/index.php') . '[/PHP]';
    echo GWF_Box::box(GWF_Message::display($source, true, false));
}
# Submitted?
if (isset($_POST['submit'])) {
    # Check it!
    $error = ludde_is_satisfied($chall);
    # Oooops!
    if ($error === true) {
        $chall->onChallengeSolved(GWF_Session::getUserID());
    } elseif ($error === false) {
        echo GWF_HTML::message(GWF_PAGE_TITLE, $chall->lang('msg_ok', array($_POST['username'])), false);
    } else {
        echo GWF_HTML::error(GWF_PAGE_TITLE, $error, false);
    }
}
# Check it!
Exemple #2
0
 public static function testSmiley(WC_Challenge $chall, $smiley, $path)
 {
     $back = true;
     # Test passed :S?
     # Generate test input :)
     $ues = str_replace('\\', '', $smiley);
     $ues = Common::regex('#/([^/]+)/#', $ues);
     $text = 'Test ' . $ues . '. Test ' . $ues;
     echo GWF_Box::box($text, $chall->lang('test_input'));
     # Generate test output :)
     if (NULL === ($out = self::replaceSmiley($smiley, $path, $text))) {
         $back = false;
         $out = $text;
     }
     # Output the test :)
     echo GWF_Box::box($out, $chall->lang('test_output'));
     return $back;
 }
Exemple #3
0
 public function execute()
 {
     if (Common::getGetString('list', '0') === '1') {
         return $this->module->template("tools/list.tpl");
     }
     $whitelist = array('jpk', 'yabfdbg', 'jcs', 'jdictac', 'wordpat', 'wordlists', 'startcpp', 'encodings');
     $file = Common::getGet('file');
     if (!in_array($file, $whitelist, true)) {
         return GWF_HTML::err('ERR_PARAMETER', array(__FILE__, __LINE__, 'file'));
     }
     # Counter Box
     $count = GWF_Counter::getAndCount($file, 1);
     $box = GWF_Box::box($this->module->lang('pi_viewcount', array($count)));
     # Translations
     $langpath = $this->module->getDir() . '/lang/' . $file;
     #.'/'.$file;
     $trans = new GWF_LangTrans($langpath);
     GWF_Website::setPageTitle($trans->lang('page_title'));
     GWF_Website::setMetaTags($trans->lang('meta_tags'));
     $tVars = array('lang2' => $trans);
     return $this->module->templatePHP("tools/{$file}/{$file}.php", $tVars) . $box;
 }
Exemple #4
0
function wordpat($pattern)
{
    if (false === ($pattern = wordpatValidatePattern($pattern))) {
        return htmlDisplayError("Invalid pattern");
    }
    if (false === ($matches = wordpatMatch($pattern))) {
        return htmlDisplayError("Internal error");
    }
    $numMatches = count($matches);
    $title = "{$numMatches} words matching '{$pattern}'";
    if ($numMatches == 0) {
        $text = "No Match";
    } else {
        $text = '<table><tr>';
        $i = 0;
        foreach ($matches as $match) {
            $text .= "<td style=\"margin: 1px 6px; padding: 1px 6px;\">{$match}</td>";
            $text .= ++$i % 5 == 0 ? "</tr><tr>" : "";
        }
        $text .= '</tr></table>';
    }
    echo GWF_Box::box($text, $title);
}
Exemple #5
0
<?php

$headers = array(array('Rank'), array(''), array('Points'), array('Username'), array('Solved'), array('Last Activity'));
$box = $tVars['box'];
$box instanceof WC_Warbox;
$site = $box->getSite();
echo $tVars['site_quickjump'];
echo $tVars['pagemenu'];
$vars = array($tVars['playercount'], $box->displayName(), $site->displayName());
echo GWF_Box::box($tLang->lang('info_warbox_players', $vars), $tLang->lang('title_warbox_players', $vars));
echo GWF_Table::start();
echo GWF_Table::displayHeaders1($headers);
$rank = $tVars['rank'];
foreach ($tVars['data'] as $row) {
    echo GWF_Table::rowStart();
    echo GWF_Table::column($rank++, 'gwf_num');
    echo GWF_Table::column(GWF_Country::displayFlagS($row['country']));
    echo GWF_Table::column($row['score'], 'gwf_num');
    echo GWF_Table::column(GWF_User::displayProfileLinkS($row['user_name']));
    echo GWF_Table::column(sprintf('%s (%.02f%%)', $row['solved'], $row['percent']), 'gwf_num');
    echo GWF_Table::column(GWF_Time::displayDate($row['solvedate']), 'gwf_date');
    echo GWF_Table::rowEnd();
}
echo GWF_Table::end();
echo $tVars['pagemenu'];
Exemple #6
0
// $href_api_3 = GWF_WEB_ROOT.'index.php?mo=WeChall&amp;me=JoinUs&amp;section=api#api_3';
echo '<a name="api_3"></a>' . PHP_EOL;
echo GWF_Box::box($l->lang('api_3b', array($usage_3_1, $usage_3_1, $usage_3_1, $event_types, $examples)), $l->lang('api_3t'));
# API 4)
$href_api_4 = GWF_WEB_ROOT . 'index.php?mo=WeChall&amp;me=JoinUs&amp;section=api#api_4';
$url = sprintf('%s://%s%sindex.php?mo=WeChall&me=API_User&no_session=1&', Common::getProtocol(), GWF_DOMAIN, GWF_WEB_ROOT);
$usage_4_1 = htmlspecialchars($url . 'username=<username>[&apikey=<your_api_key>]');
$example_4_1 = GWF_HTML::anchor($url . 'username='******'username='******'WC_NO_XSS_PASS'])) {
    $api_key = urlencode($udata['WC_NO_XSS_PASS']);
    $example_4_2 = GWF_HTML::anchor($url . "username={$uname}&apikey={$api_key}", $url . "username={$uname}&apikey={$api_key}");
} else {
    $example_4_2 = '';
}
echo '<a name="api_4"></a>' . PHP_EOL;
echo GWF_Box::box($l->lang('api_4b', array($usage_4_1, $usage_4_1, $example_4_1, $example_4_2)), $l->lang('api_4t'));
# API 5)
$href_api_5 = GWF_WEB_ROOT . 'index.php?mo=WeChall&amp;me=JoinUs&amp;section=api#api_5';
$url = sprintf('%s://%s%sindex.php?mo=WeChall&me=API_Site&no_session=1', Common::getProtocol(), GWF_DOMAIN, GWF_WEB_ROOT);
$usage_5_1 = htmlspecialchars($url . '[&sitename=<sitename>]');
$example_5_1 = GWF_HTML::anchor($url, $url);
$example_5_2 = GWF_HTML::anchor($url . '&sitename=WeChall', $url . '&sitename=WeChall');
echo '<a name="api_5"></a>' . PHP_EOL;
echo GWF_Box::box($l->lang('api_5b', array($usage_5_1, $usage_5_1, $example_5_1, $example_5_2)), $l->lang('api_5t'));
# Buttons
echo GWF_Button::wrapStart();
echo GWF_Button::generic($l->lang('btn_join'), GWF_WEB_ROOT . 'join_us');
echo GWF_Button::generic($l->lang('btn_join_war'), GWF_WEB_ROOT . 'index.php?mo=WeChall&me=JoinUs&section=warbox');
echo GWF_Button::generic($l->lang('btn_join_opt'), GWF_WEB_ROOT . 'index.php?mo=WeChall&me=JoinUs&section=optional');
echo GWF_Button::generic($l->lang('btn_api'), GWF_WEB_ROOT . 'index.php?mo=WeChall&me=JoinUs&section=wechall_api', 'generic', '', true);
echo GWF_Button::wrapEnd();
Exemple #7
0
<?php

chdir('../../');
define('GWF_PAGE_TITLE', 'Pimitive Encryption');
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, 4, 'challenge/pimitive_encryption/index.php');
}
$chall->showHeader();
$href_zip = 'pimitive.zip';
if (false === ($jander = GWF_User::getByName('Jander'))) {
    $jander = '<b>Jander</b>';
} else {
    $jander = $jander->displayProfileLink();
}
$chall->onCheckSolution();
echo GWF_Box::box($chall->lang('info', array($jander, $href_zip)), $chall->lang('title'));
echo formSolutionbox($chall);
# Your footer
echo $chall->copyrightFooter();
require_once 'challenge/html_foot.php';
Exemple #8
0
<?php

$data = (require 'data.php');
$solution = (require 'solution.php');
require 'expdb.php';
chdir('../../../../');
define('GWF_PAGE_TITLE', 'Experience');
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, 3, 'challenge/training/php/experience/index.php', $solution);
}
$chall->showHeader();
$chall->onCheckSolution();
$user = GWF_User::getStaticOrGuest();
$username = $user->isGuest() ? $chall->lang('guest') : $user->displayUsername();
$hint = '<span style="color:#fff;">' . $chall->lang('hint') . '</span>' . PHP_EOL;
echo GWF_Box::box($chall->lang('descr', array($username, $hint)));
if (!($db = gdo_db_instance(EXP_DB_HOST, EXP_DB_USER, EXP_DB_PASS, EXP_DB_NAME))) {
    echo GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
} else {
    require 'blackbox.php';
    formSolutionbox($chall);
}
echo $chall->copyrightFooter();
require_once 'challenge/html_foot.php';
Exemple #9
0
<?php

$headers = array(array('Pos', 'wf_order', 'ASC'), array('Score', 'wf_score', 'ASC'), array('Title', 'wf_title', 'ASC'), array('Solvers', 'wf_solvers', 'ASC'), array('LastSolvedBy', 'user_name', 'ASC'), array('LastSolved', 'wf_last_solved_at', 'ASC'));
$logged_in = GWF_User::isLoggedIn();
if ($logged_in) {
    $headers[] = array('Unlock');
}
$box = $tVars['box'];
$box instanceof WC_Warbox;
$site = $tVars['site'];
$site instanceof WC_Site;
$user = GWF_Session::getUser();
$href_flags = $box->hrefFlags();
echo $tVars['site_quickjump'];
echo GWF_Box::box($tLang->lang('info_warbox_details', array($site->displayName(), $box->displayName(), count($tVars['data']))), $tLang->lang('title_warbox_details', array($site->displayName(), $box->displayName())));
echo GWF_Table::start();
echo GWF_Table::displayHeaders1($headers, $tVars['sort_url']);
function solving_form($tVars, WC_Warflag $flag)
{
    $form = '';
    $form .= GWF_Form::start(true, GWF_Form::ENC_DEFAULT, 'post', false);
    $form .= sprintf('<input type="hidden" name="wfid" value="%s" />', $flag->getID());
    $form .= sprintf('<input type="text" name="password_solution" value="" />');
    $form .= sprintf('<input type="submit" name="igotitnow" value="!" />');
    $form .= GWF_Form::end();
    // 	$data = array(
    // 		'flagid' => array(GWF_Form::HIDDEN, $flag->getID()),
    // 		'solution' => array(GWF_Form::STRING, ''),
    // 	);
    // 	$form = new GWF_Form($tVars['method'], $data);
    // 	return $form->templateX();
Exemple #10
0
<?php

$box_c = '';
if (!isset($tVars['no_info'])) {
    $box_c .= sprintf('<p>%s</p>', $tLang->lang('payment_info'));
}
if (isset($tVars['paymodule_info']) && $tVars['paymodule_info'] !== '') {
    $box_c .= sprintf('<p>%s</p>', $tVars['paymodule_info']);
}
echo GWF_Box::box($box_c);
echo sprintf('<p>%s</p>', $tVars['order']);
?>
<table>
<?php 
echo sprintf('%s<td colspan="2">%s</td><td>%s</td>%s', GWF_Table::rowStart(), $tLang->lang('th_price'), $tVars['price'], GWF_Table::rowEnd());
if ($tVars['has_fee']) {
    echo sprintf('%s<td>%s</td><td>%s</td><td>%s</td>%s', GWF_Table::rowStart(), $tLang->lang('th_fee_per'), $tVars['fee_percent'], $tVars['fee'], GWF_Table::rowEnd());
    echo sprintf('%s<td colspan="2">%s</td><td>%s</td>%s', GWF_Table::rowStart(), $tLang->lang('th_price_total'), $tVars['price_total'], GWF_Table::rowEnd());
}
echo sprintf('<tr><td colspan="3">%s</td></tr>', $tVars['buttons']);
?>
</table>
Exemple #11
0
<?php

# WeChall things
chdir('../../../');
define('GWF_PAGE_TITLE', 'PHP 0819');
require_once 'challenge/html_head.php';
if (false === ($chall = WC_Challenge::getByTitle(GWF_PAGE_TITLE))) {
    $chall = WC_Challenge::dummyChallenge(GWF_PAGE_TITLE, 2, 'challenge/space/php0819/index.php', false);
}
$chall->showHeader();
###############
## Challenge ##
###############
GWF_Debug::setDieOnError(false);
GWF_Debug::setMailOnError(false);
require_once 'challenge/space/php0819/php0819.php';
echo GWF_Box::box($chall->lang('info', array(GWF_WEB_ROOT . 'profile/space')), $chall->lang('title'));
if (isset($_GET['eval'])) {
    if (true === $challenge()) {
        $chall->onChallengeSolved(GWF_Session::getUserID());
    }
}
GWF_Debug::setDieOnError(true);
GWF_Debug::setMailOnError(true);
$filename = 'challenge/space/php0819/php0819.php';
$message = '[PHP]' . file_get_contents($filename) . '[/PHP]';
echo GWF_Message::display($message);
# TODO: GET form input box? (gizmore)
echo $chall->copyrightFooter();
require_once 'challenge/html_foot.php';
Exemple #12
0
<?php

require_once 'warconfig.php';
chdir('../../../');
define('GWF_PAGE_TITLE', 'Training: Warchall - The Beginning');
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/warchall/begins/index.php', 'bitwarrior,LameStartup,HiddenIsConfig,RepeatingHistory,AndIknowchown,OhRightThePerms');
}
$chall->showHeader();
$score = 0;
$chall->onCheckSolution();
echo GWF_Box::box($chall->lang('info'), $chall->lang('title'));
if (false === ($user = GWF_Session::getUser())) {
    echo GWF_HTML::error('Warchall', $chall->lang('err_login'));
} elseif ($score > ($scre = $user->getLevel())) {
    echo GWF_HTML::error('Warchall', $chall->lang('err_score', $scre, $score));
} else {
    echo warchall1createAccount($chall);
}
formSolutionbox($chall);
echo $chall->copyrightFooter();
require 'challenge/warchall/ads.php';
require_once 'challenge/html_foot.php';
final class WCA_FormCreate
{
    public function form(WC_Challenge $chall)
    {
        $data = array('password1' => array(GWF_Form::PASSWORD, '', $chall->lang('th_password')), 'password2' => array(GWF_Form::PASSWORD, '', $chall->lang('th_password2')), 'create' => array(GWF_Form::SUBMIT, $chall->lang('btn_submit')));
        return new GWF_Form($this, $data);
Exemple #13
0
chdir('../../../');
define('GWF_PAGE_TITLE', 'Stop us');
require_once 'challenge/html_head.php';
if (false === ($chall = WC_Challenge::getByTitle(GWF_PAGE_TITLE))) {
    $chall = WC_Challenge::dummyChallenge(GWF_PAGE_TITLE, 3, 'challenge/noother/stop_us/index.php', false);
}
$chall->showHeader();
# -------------------------- #
$href1 = 'index.php?show=source';
$href2 = 'index.php?highlight=christmas';
$href3 = 'index.php?show=noothtable';
$href4 = 'index.php?highlight=noothtable';
$jjk = 'jjk';
$dloser = 'dloser';
echo GWF_Box::box($chall->lang('info', array('nootherdomain.php', $href1, $href2, $href3, $href4, $jjk, $dloser)), $chall->lang('title'));
# -------------------------- #
if (false !== ($file = Common::getGetString('highlight', false))) {
    if ($file === 'noothtable') {
        $file = 'noothtable.php';
    } else {
        $file = 'nootherdomain.php';
    }
    $message = '[PHP title=' . $file . ']' . file_get_contents('challenge/noother/stop_us/' . $file) . '[/PHP]';
    echo GWF_Box::box(GWF_Message::display($message));
}
# -------------------------- #
echo $chall->copyrightFooter();
require_once 'challenge/html_foot.php';
?>

Exemple #14
0
# -------------------------- #
if (false !== ($answer = Common::getPostString('answer', false))) {
    require_once 'challenge/livinskull/smile/LIVIN_Smile.php';
    $solution = LIVIN_Smile::getSolution();
    if ($answer === $solution) {
        $chall->onChallengeSolved(GWF_Session::getUserID());
    } else {
        echo WC_HTML::error('err_wrong');
    }
}
# -------------------------- #
$url1 = 'index.php?show=smile';
$url2 = 'index.php?highlight=smile';
$url3 = 'index.php?show=livin_smile';
$url4 = 'index.php?highlight=livin_smile';
$url5 = 'smile.php';
echo GWF_Box::box($chall->lang('info', array($url1, $url2, $url3, $url4, $url5)), $chall->lang('title'));
# -------------------------- #
if (false !== ($file = Common::getGetString('highlight', false))) {
    $files = array('smile' => 'smile.php', 'livin_smile' => 'LIVIN_Smile.php');
    if (isset($files[$file])) {
        $content = file_get_contents("challenge/livinskull/smile/" . $files[$file]);
        $message = '[PHP]' . $content . '[/PHP]';
        echo GWF_Box::box(GWF_Message::display($message), $files[$file]);
    }
}
# -------------------------- #
echo formSolutionbox($chall);
# -------------------------- #
echo $chall->copyrightFooter();
require_once 'challenge/html_foot.php';
Exemple #15
0
<?php

chdir('../../../../');
define('GWF_PAGE_TITLE', 'Training: Caterpillar');
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, 2, 'challenge/training/stegano/caterpillar/index.php');
}
$chall->showHeader();
$chall->onCheckSolution();
echo GWF_Box::box($chall->lang('info', array('caterpillar.png')), $chall->lang('title'));
formSolutionbox($chall);
echo $chall->copyrightFooter();
require_once 'challenge/html_foot.php';
Exemple #16
0
<?php

chdir('../../../');
define('GWF_PAGE_TITLE', 'Shadowlamb - Chapter I');
require_once 'challenge/html_head.php';
if (false === ($chall = WC_Challenge::getByTitle(GWF_PAGE_TITLE))) {
    $chall = WC_Challenge::dummyChallenge(GWF_PAGE_TITLE, 1, 'challenge/lamb/shadowlamb1/index.php');
}
$chall->showHeader();
echo GWF_Box::box(base64_encode($chall->lang('client_info')), $chall->lang('client_it'));
echo $chall->copyrightFooter();
require_once 'challenge/html_foot.php';
Exemple #17
0
<?php

chdir('../../');
define('GWF_PAGE_TITLE', 'Inka');
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, 4, 'challenge/inka/index.php', false);
}
$chall->showHeader();
$href = 'inka.php';
$href2 = 'inka.php?answer=1234';
$rage = 'http://www.youtube.com/watch?v=GSNeonapnT8#t=0m23';
$easteregg = sprintf('<a style="color: #fee;" href="%s">Eastereggs For The Winner!</a>', $rage);
echo GWF_Box::box($chall->lang('info', array($href, $href2, $easteregg)), $chall->lang('title'));
echo $chall->copyrightFooter();
require_once 'challenge/html_foot.php';
Exemple #18
0
<?php

$path = GWF_WEB_ROOT . 'applet/JDicTac.jar';
echo GWF_Box::box($tVars['lang2']->lang('page_info', array($path)));
?>
<applet code="org.gizmore.jdictac.JDicTac" archive="<?php 
echo $path;
?>
" width="800" height="600" align="middle">
</applet>
Exemple #19
0
<?php

chdir('../../');
define('GWF_PAGE_TITLE', 'Fremes');
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, 4, 'challenge/FREMES/index.php', false);
}
$chall->showHeader();
if (false !== ($answer = Common::getPostString('answer', false))) {
    if (false === ($key = GWF_Session::get('FREMEN_KEY', false))) {
        echo GWF_HTML::error('Fremes', $chall->lang('err_try'));
    } else {
        $solution = GWF_Numeric::baseConvert($key, 2, 16);
        $slen = strlen($solution);
        $wlen = 128 / 4;
        $nlen = $wlen - $slen;
        $solution = str_repeat('0', $nlen) . $solution;
        $answer = strtoupper($answer);
        $solution = strtoupper($solution);
        if ($answer === $solution || substr($answer, 2) === $solution) {
            $chall->onChallengeSolved(GWF_Session::getUserID());
        } else {
            echo WC_HTML::error('err_wrong');
        }
    }
}
echo GWF_Box::box($chall->lang('info', array(128, 'fremes.php')), $chall->lang('title'));
echo formSolutionbox($chall);
require_once 'challenge/html_foot.php';
Exemple #20
0
}
# And display the header
$chall->showHeader();
# Show mission box (translated)
echo GWF_Box::box($chall->lang('mission_i', array('index.php?highlight=christmas')), $chall->lang('mission_t'));
# Check your injection and fix the hole by silently applying htmlsepcialchars to the vuln input.
if (phpself_checkit()) {
    $chall->onChallengeSolved(GWF_Session::getUserID());
}
# Show this file as highlighted sourcecode, if desired
if ('christmas' === Common::getGetString('highlight')) {
    $msg = file_get_contents('challenge/yourself_php/index.php');
    $msg = '[' . 'code=php title=index.php]' . $msg . '[' . '/code]';
    echo GWF_Box::box(GWF_Message::display($msg));
}
# __This is the challenge:
if (isset($_POST['username'])) {
    echo GWF_Box::box(sprintf("Well done %s, you entered your username. But this is <b>not</b> what you need to do.", htmlspecialchars(Common::getPostString('username'))));
}
echo '<div class="box box_c">' . PHP_EOL;
echo sprintf('<form action="%s" method="post">', $_SERVER['PHP_SELF']) . PHP_EOL;
echo sprintf('<div>%s</div>', GWF_CSRF::hiddenForm('phpself')) . PHP_EOL;
echo sprintf('<div>Username:<input type="text" name="username" value="" /></div>') . PHP_EOL;
echo sprintf('<div><input type="submit" name="deadcode" value="Submit" /></div>') . PHP_EOL;
echo sprintf('</form>') . PHP_EOL;
echo '</div>' . PHP_EOL;
# __End of challenge
# Print Challenge Footer
echo $chall->copyrightFooter();
# Print end of website
require_once 'challenge/html_foot.php';
Exemple #21
0
<h1><?php 
echo $tVars['tag_title'] . GWF_Button::search($tVars['href_search'], $tLang->lang('btn_search'));
?>
</h1>
<?php 
if ($tVars['new_link_count'] > 0) {
    echo '<div class="gwf_buttons_outer">' . PHP_EOL;
    echo '<div class="gwf_buttons">' . PHP_EOL;
    if (GWF_Session::isLoggedIn()) {
        echo GWF_Button::checkmark(true, $tLang->lang('btn_mark_read'), $tVars['href_mark_read']);
    }
    echo GWF_Button::bell($tVars['href_new_links'], $tLang->lang('btn_new_links'));
    echo $tLang->lang('info_newlinks', array($tVars['new_link_count']));
    echo '</div></div>' . PHP_EOL;
}
echo $tVars['cloud'];
echo $tVars['page_menu'];
echo $tVars['links'];
echo $tVars['search'];
echo $tVars['page_menu'];
if ($tVars['may_add_link']) {
    echo GWF_Button::wrapStart();
    echo GWF_Button::add($tLang->lang('btn_add'), $tVars['href_add']);
    echo GWF_Button::wrapEnd();
} else {
    echo GWF_Box::box($tVars['text_add']);
}
Exemple #22
0
<?php

chdir('../../');
define('GWF_PAGE_TITLE', 'Crackcha');
require_once 'challenge/crackcha/crackcha.php';
require_once 'challenge/html_head.php';
if (false === ($chall = WC_Challenge::getByTitle(GWF_PAGE_TITLE))) {
    $chall = WC_Challenge::dummyChallenge(GWF_PAGE_TITLE, 8, 'challenge/crackcha/index.php', false);
}
$chall->showHeader();
echo GWF_Box::box($chall->lang('info', array('reset.php', 'problem.php', 'answer.php', 'highscore.php', GWF_Time::humanDuration(WCC_CRACKCHA_TIME), WCC_CRACKCHA_NEED)), $chall->lang('title'));
echo $chall->copyrightFooter();
require_once 'challenge/html_foot.php';
Exemple #23
0
 /**
  * We succesfully logged in and add your last location as link.
  * @param $user
  * @param $args
  * @return unknown_type
  */
 public function hookLoginAfter(GWF_User $user, array $args)
 {
     # Show last location
     $url = htmlspecialchars($args[0]);
     GWF_Website::addDefaultOutput(GWF_Box::box($this->lang('pi_login_link', array($url, $url))));
     return '';
 }
Exemple #24
0
<?php

Module_WeChall::includeForums();
$chall = $tVars['chall'];
$chall instanceof WC_Challenge;
$headers = array(array($tLang->lang('th_length'), 'wmc_length'), array($tLang->lang('th_csolve_date'), 'wmc_date'), array($tLang->lang('th_user_name'), 'user_name'), array($tLang->lang('th_solution'), 'wmc_solution'));
$chall->showHeader(true);
echo GWF_Box::box($tVars['table_title']);
echo $tVars['page_menu'];
echo GWF_Table::start();
//echo GWF_Table::displayHeaders1($headers, $tVars['sort_url'], 'wmc_date', 'ASC', 'by', 'dir', $tVars['table_title']);
echo GWF_Table::displayHeaders1($headers, $tVars['sort_url']);
$guest = GWF_Guest::getGuest();
$userr = new GWF_User(false);
foreach ($tVars['data'] as $row) {
    if ($row['user_name'] === NULL) {
        $username = GWF_HTML::lang('guest');
    } else {
        $userr->setGDOData($row);
        $username = $userr->displayProfileLink();
    }
    echo GWF_Table::rowStart();
    echo GWF_Table::column($row['wmc_length'], 'gwf_num');
    echo GWF_Table::column(GWF_Time::displayDate($row['wmc_date']), 'gwf_date');
    echo GWF_Table::column($username);
    echo GWF_Table::column($row['wmc_solution']);
    echo GWF_Table::rowEnd();
}
echo GWF_Table::end();
echo $tVars['page_menu'];
Exemple #25
0
    $chall = WC_Challenge::dummyChallenge(GWF_PAGE_TITLE, 4, 'challenge/identity/index.php', false);
}
$chall->showHeader();
$score_needed = 500;
$title = $chall->lang('title');
if (false !== ($user = GWF_Session::getUser())) {
    if ($user->getLevel() >= $score_needed) {
        if (isset($_POST['answer'])) {
            $pre = $_POST['answer'];
            identity_filter($chall);
            $chall->onCheckSolution();
            $_POST['answer'] = $pre;
        }
        $gizmore = GWF_User::getByName('gizmore');
        $profile = $gizmore->displayProfileLink();
        echo GWF_Box::box($chall->lang('info', array($profile)), $title);
        require_once GWF_CORE_PATH . 'module/WeChall/solutionbox.php';
        echo formSolutionbox($chall);
    } else {
        $score = $user->getLevel();
        echo GWF_HTML::error($title, $chall->lang('err_score', array($score, $score_needed)));
    }
} else {
    echo GWF_HTML::error($title, $chall->lang('err_login'));
}
echo $chall->copyrightFooter();
require_once 'challenge/html_foot.php';
?>

<?php 
function identity_filter(WC_Challenge $chall)
Exemple #26
0
<?php

# Change dir to web root
chdir('../../../../');
define('GWF_PAGE_TITLE', 'Training: MySQL I');
require_once 'challenge/html_head.php';
if (false === ($chall = WC_Challenge::getByTitle(GWF_PAGE_TITLE))) {
    $chall = WC_Challenge::dummyChallenge(GWF_PAGE_TITLE, 2, 'challenge/training/mysql/auth_bypass1/index.php', false);
}
$chall->showHeader();
echo GWF_Box::box($chall->lang('info', array('index.php?show=source', 'index.php?highlight=christmas')), $chall->lang('title'));
$filename = 'challenge/training/mysql/auth_bypass1/login.php';
if (Common::getGetString('show') === 'source') {
    echo GWF_Box::box('<pre>' . htmlspecialchars(file_get_contents($filename)) . '</pre>');
} elseif (Common::getGetString('highlight') === 'christmas') {
    $message = '[PHP]' . file_get_contents($filename) . '[/PHP]';
    echo GWF_Message::display($message);
}
define('WCC_AUTH_BYPASS1_DB', 'gizmore_auth1');
define('WCC_AUTH_BYPASS1_USER', 'gizmore_auth1');
define('WCC_AUTH_BYPASS1_PASS', 'AuthIsBypass');
include 'login.php';
echo $chall->copyrightFooter();
require_once 'challenge/html_foot.php';
Exemple #27
0
        $content .= GWF_Table::rowStart();
        $content .= sprintf('<td style="font-family:monospace;">%s</td>', hashgame_wc3($plaintext));
        $content .= GWF_Table::rowEnd();
    }
    $content .= GWF_Table::end();
    echo GWF_Box::box($content, $chall->lang('tt_list_wc3', array('index.php?algo=wc3&list=wc3')));
} elseif (Common::getGetString('list') === 'wc4') {
    $content = '';
    $content .= GWF_Table::start();
    foreach ($list2 as $plaintext) {
        $content .= GWF_Table::rowStart();
        $content .= sprintf('<td style="font-family:monospace;">%s</td>', hashgame_wc4($plaintext));
        $content .= GWF_Table::rowEnd();
    }
    $content .= GWF_Table::end();
    echo GWF_Box::box($content, $chall->lang('tt_list_wc4', array('index.php?algo=wc4&list=wc4')));
}
formSolutionbox($chall);
echo $chall->copyrightFooter();
require_once 'challenge/html_foot.php';
####################
### Check answer ###
####################
function sort_strlen($a, $b)
{
    return strlen($b) - strlen($a);
}
function hashgame_longest_two(array $list)
{
    usort($list, 'sort_strlen');
    return array(array_shift($list), array_shift($list));
Exemple #28
0
<?php

echo GWF_Box::box($tLang->lang('pi_csrank'), $tLang->lang('pt_csrank'));
WC_HTML::rankingPageButtons();
$headers = array(array('#', null, null, 2), array('', null, null, 1), array($tLang->lang('th_user_countryid'), 'countryname', 'ASC', 3), array($tLang->lang('th_players'), 'users', 'DESC', 6), array($tLang->lang('th_score'), 'totalscore', 'DESC', 4), array($tLang->lang('th_spc'), 'spc', 'DESC', 7), array($tLang->lang('th_avg'), 'avg', 'DESC', 8), array($tLang->lang('th_sumtop3'), 'top3', 'DESC', 9), array($tLang->lang('th_top_player'), 'topuser', 'ASC', 5));
$rank = 1;
$hlc = $tVars['highlight_country'];
echo GWF_Table::start();
echo GWF_Table::displayHeaders1($headers, $tVars['sort_url']);
$sl = WC_HTML::styleSelected();
foreach ($tVars['data'] as $row) {
    $cid = $row['country_id'];
    $topuser = $row['topuser'];
    $style = $hlc == $cid ? $sl : '';
    $href = GWF_WEB_ROOT . 'country_ranking/for/' . $cid . '/' . Common::urlencodeSEO($row['countryname']);
    echo GWF_Table::rowStart(true, '', '', $style);
    echo sprintf('<td class="gwf_num">%d</td>', $rank++);
    echo sprintf('<td>%s</td>', GWF_Country::displayFlagS2($cid, $row['countryname']));
    echo sprintf('<td><a href="%s">%s</a></td>', $href, GWF_HTML::display($row['countryname']));
    echo sprintf('<td class="gwf_num">%d</td>', $row['users']);
    echo sprintf('<td class="gwf_num">%d</td>', $row['totalscore']);
    echo sprintf('<td class="gwf_num">%s</td>', $row['spc']);
    echo sprintf('<td class="gwf_num">%d</td>', $row['avg']);
    echo sprintf('<td class="gwf_num">%d</td>', $row['top3']);
    echo sprintf('<td><a href="%s" title="%s">%s</a></td>', GWF_WEB_ROOT . 'profile/' . urlencode($topuser), $tLang->lang('a_title', array($row['topscore'])), GWF_HTML::display($topuser));
    echo GWF_Table::rowEnd();
}
echo GWF_Table::end();
echo GWF_Box::box($tLang->lang('scorefaq_box', GWF_WEB_ROOT . 'scoring_faq'));
Exemple #29
0
<?php

chdir('../../../');
define('GWF_PAGE_TITLE', 'Babbage and Coldplay');
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, 3, 'challenge/ludde/babbage_and_coldplay/index.php', 'fe91bf59f3a2476d45f78ef00701a24b');
}
$chall->showHeader();
# -------------------------- #
if (false !== ($answer = Common::getPostString('answer', false))) {
    $chall->onCheckSolution(md5(preg_replace('/[^a-z]/', '', strtolower($answer))));
}
# -------------------------- #
$href = 'babbage_and_coldplay.mp3';
echo GWF_Box::box($chall->lang('info', array($href)), $chall->lang('title'));
# -------------------------- #
echo formSolutionbox($chall);
# -------------------------- #
echo $chall->copyrightFooter();
require_once 'challenge/html_foot.php';
Exemple #30
-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';