本文整理汇总了PHP中WC_Challenge::getByTitle方法的典型用法代码示例。如果您正苦于以下问题:PHP WC_Challenge::getByTitle方法的具体用法?PHP WC_Challenge::getByTitle怎么用?PHP WC_Challenge::getByTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WC_Challenge
的用法示例。
在下文中一共展示了WC_Challenge::getByTitle方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __wakeup
public function __wakeup()
{
if (false === ($chall = WC_Challenge::getByTitle(GWF_PAGE_TITLE))) {
$chall = WC_Challenge::dummyChallenge(GWF_PAGE_TITLE, 2, 'challenge/are_you_serial/index.php');
}
$chall->onChallengeSolved(GWF_Session::getUserID());
}
示例2: chdir
<?php
chdir('../../../');
define('GWF_PAGE_TITLE', 'Z - Reloaded');
require_once 'challenge/html_head.php';
$title = 'Z - Reloaded';
if (false === ($chall = WC_Challenge::getByTitle($title))) {
$chall = WC_Challenge::dummyChallenge($title, 6, '/challenge/Z/reloaded', false);
}
$chall->showHeader();
htmlTitleBox($chall->lang('title'), $chall->lang('info', array('zshellz.php')));
echo $chall->copyrightFooter();
require_once 'challenge/html_foot.php';
示例3: chdir
<?php
chdir('../../');
define('GWF_PAGE_TITLE', 'Addslashes');
require_once 'challenge/html_head.php';
if (false === ($chall = WC_Challenge::getByTitle('Addslashes'))) {
$chall = WC_Challenge::dummyChallenge('Addslashes', 5, false, false);
}
$chall->showHeader();
# Mission
echo GWF_Box::box($chall->lang('info', array('addslashes.include', 'index.php?highlight=christmas')));
define('ADDSLASH_USERNAME', 'gizmore_addslash');
define('ADDSLASH_DATABASE', 'gizmore_addslash');
define('ADDSLASH_PASSWORD', 'addslash');
require_once 'addslashes.include';
if (false !== Common::getGet('login')) {
if (true === asvsmysql_login(Common::getGet('username'), Common::getGet('password'))) {
$chall->onChallengeSolved(GWF_Session::getUserID());
}
}
if (false !== Common::getGet('highlight')) {
$msg = file_get_contents('challenge/addslashes/addslashes.include');
$msg = '[code=php title=addslashes.include]' . $msg . '[/code]';
echo GWF_Box::box(GWF_Message::display($msg));
}
?>
<div class="box box_c">
<h2>欢迎登录页面</h2>
<h3>请登录</h3>
示例4: die
require_once "challenge/html_head.php";
//html_head("Install Addslashes");
if (!GWF_User::isAdminS()) {
echo GWF_HTML::err('ERR_NO_PERMISSION');
return;
}
// $title = GWF_PAGE_TITLE;
$solution = $solution;
$score = 4;
$url = "challenge/training/php/experience/index.php";
$creators = "Gizmore";
$tags = 'MySQL,PHP,Exploit';
WC_Challenge::installChallenge(GWF_PAGE_TITLE, $solution, $score, $url, $creators, $tags);
if (!($db = gdo_db_instance(EXP_DB_HOST, EXP_DB_USER, EXP_DB_PASS, EXP_DB_NAME))) {
die(GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__)));
}
$db->truncateTable('items');
$db->truncateTable('flags');
foreach ($data as $title) {
$title = $db->escape($title);
$db->queryWrite("INSERT INTO items VALUES(0, '{$title}', NOW())");
}
$challenges = GDO::table('WC_Challenge')->selectObjects('*');
foreach ($challenges as $challenge) {
$challenge instanceof WC_Challenge;
$random_solution = GWF_Random::randomKey(32);
$db->queryWrite("INSERT INTO flags VALUES({$challenge->getID()}, '{$random_solution}')");
}
$challenge = WC_Challenge::getByTitle(GWF_PAGE_TITLE, false);
$db->queryWrite("REPLACE INTO flags VALUES({$challenge->getID()}, '{$solution}')");
require_once "challenge/html_foot.php";
示例5: define
<?php
define('NO_ESCAPE_USER', 'gizmore_noesc');
define('NO_ESCAPE_DB', 'gizmore_noesc');
define('NO_ESCAPE_PW', 'gizmore_noesc');
require_once 'code.include';
chdir('../../');
define('GWF_PAGE_TITLE', 'No Escape');
require_once 'challenge/html_head.php';
if (!($chall = WC_Challenge::getByTitle('No Escape'))) {
$chall = WC_Challenge::dummyChallenge('No Escape', 2, '/challenge/no_escape/index.php', false);
}
$chall->showHeader();
if ($who = Common::getGetString('vote_for', false)) {
noesc_voteup($who);
}
htmlTitleBox($chall->lang('title'), $chall->lang('info', array('code.include', 'index.php?highlight=christmas')));
if (Common::getGetString('highlight') === 'christmas') {
$msg = file_get_contents('challenge/no_escape/code.include');
$msg = '[code=php title=code.include]' . $msg . '[/code]';
echo GWF_Box::box(GWF_Message::display($msg, true, false, false));
}
echo noesc_DisplayVotes($chall);
echo $chall->copyrightFooter();
require_once 'challenge/html_foot.php';
示例6: chdir
<?php
chdir("../../../");
define('GWF_PAGE_TITLE', 'Training: Encodings I');
require_once "challenge/html_head.php";
require GWF_CORE_PATH . 'module/WeChall/solutionbox.php';
if (false === ($chall = WC_Challenge::getByTitle("Training: Encodings I"))) {
$chall = WC_Challenge::dummyChallenge('Training: Encodings I');
}
$chall->showHeader();
$chall->onCheckSolution();
?>
<div class="box box_c">
<?php
echo $chall->lang('info', array(GWF_WEB_ROOT . 'tools/JPK'));
?>
<br/>
<br/>
<pre>
10101001101000110100111100110100
00011101001100101111100011101000
10000011010011110011010000001101
11010110111000101101001111010001
00000110010111011101100011110111
11100100110010111001000100000110
00011110011110001111010011101001
01011100100000101100111011111110
10111100100100000111000011000011
11001111100111110111110111111100
10110010001000001101001111001101
示例7: chdir
<?php
chdir('../../');
define('GWF_PAGE_TITLE', 'Screwed Signup - Login');
require_once 'challenge/html_head.php';
if (false === ($chall = WC_Challenge::getByTitle('Screwed Signup'))) {
$chall = WC_Challenge::dummyChallenge('Screwed Signup', 7, 'challenge/screwed_signup/index.php', false);
}
$chall->showHeader();
require_once 'screwed_signup.include';
if (isset($_POST['login'])) {
screwed_signupLogin($chall);
}
?>
<div class="box box_c"><a href="register.php"><?php
echo $chall->lang('btn_register');
?>
</a></div>
<?php
htmlTitleBox($chall->lang('login_title'), $chall->lang('login_info'));
?>
<form action="" method="post">
<?php
#Session::CSRF();
?>
<table>
<tr>
示例8: chdir
<?php
include 'stalking_solution.php';
chdir('../../../');
define('GWF_PAGE_TITLE', 'Stalking');
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, 10, 'challenge/identity/stalking/index.php', false);
}
$chall->showHeader();
# That would be you!
$user = GWF_User::getStaticOrGuest();
# Get prerequisite challenge
if (false === ($identity = WC_Challenge::getByTitle('Identity'))) {
echo GWF_HTML::err('ERR_GENERAL', array(__FILE__, __LINE__));
} else {
if (!WC_ChallSolved::hasSolved($user->getID(), $identity->getID())) {
$ida = sprintf('<a href="%s">%s</a>', htmlspecialchars($identity->hrefChallenge()), htmlspecialchars($identity->getName()));
echo GWF_HTML::error($chall->lang('title'), $chall->lang('err_identity', $ida));
} else {
# Did we get an anwer at all?
if ('' !== ($answer = Common::getPostString('answer', ''))) {
# Bruteforcing answers?
if (false !== ($error = $chall->isAnswerBlocked($user))) {
echo $error;
} elseif (false !== ($error = stalking_check_answer($chall, $answer))) {
echo GWF_HTML::error($chall->lang('title'), $error);
} else {
echo GWF_HTML::message($chall->lang('title'), $chall->lang('msg_correct'));
$chall->onChallengeSolved($user->getID());
示例9: zreload_func_help
function zreload_func_help($shellid, $args)
{
if (false === ($chall = WC_Challenge::getByTitle('Z - Reloaded'))) {
$chall = WC_Challenge::dummyChallenge('Z - Reloaded', 6, '/challenge/Z/reloaded', false);
}
return $chall->lang('cmd_help');
}
示例10: chdir
<?php
chdir('../../../../');
define('GWF_PAGE_TITLE', 'AUTH me');
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/auth_me/index.php', false);
}
$chall->showHeader();
$chall->onChallengeSolved();
# THE GAME! ;)
echo $chall->copyrightFooter();
require_once 'challenge/html_foot.php';
示例11: header
<?php
# Higlighter Plain
if (isset($_GET['show']) && $_GET['show'] === 'source') {
header('Content-Type: text/plain; charset=utf8;');
echo file_get_contents('index.php');
die;
}
# Change dir to web root
chdir('../../../../../');
# Print the website header
define('GWF_PAGE_TITLE', 'Local File Inclusion');
require_once 'challenge/html_head.php';
if (false === ($chall = WC_Challenge::getByTitle('Training: PHP LFI'))) {
$chall = WC_Challenge::dummyChallenge('Training: PHP LFI', 2, 'challenge/training/php/lfi/up/index.php', false);
}
$chall->showHeader();
# Highlighter BBCode
if (isset($_GET['highlight']) && $_GET['highlight'] === 'christmas') {
echo GWF_Message::display('[PHP]' . file_get_contents($_SERVER['SCRIPT_FILENAME']) . '[/PHP]');
require_once 'challenge/html_foot.php';
return;
}
###############################
### Here is your exploit :) ###
###############################
$code = '$filename = \'pages/\'.(isset($_GET["file"])?$_GET["file"]:"welcome").\'.html\';';
$code_emulate_pnb = '$filename = Common::substrUntil($filename, "\\0");';
# Emulate Poison Null Byte for PHP>=5.3.4
$code2 = 'include $filename;';
### End of exploit ###