Skip to content

Commit

Permalink
case sensitive again
Browse files Browse the repository at this point in the history
  • Loading branch information
Last-Order committed Nov 11, 2017
1 parent 18e68fb commit 39a1c93
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/Http/Controllers/ChallengeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ public function submitFlag(Request $request)
$flagPrefix = $config["flag_prefix"];
$flagSuffix = $config["flag_suffix"];

if (!$flag || $flag->flag !== $request->input('flag')) {
if (!$flag) {
// Flag 不正确
if (strlen($request->input('flag')) === 64 + strlen($flagPrefix) + strlen($flagSuffix)) {
// SHA256 长度为 64 位 / 可能是动态 Flag
Expand All @@ -463,6 +463,11 @@ public function submitFlag(Request $request)
}
}

if ($flag->flag !== $request->input('flag')){
\Logger::notice("队伍 " . $team->team_name . ' 提交 Flag: ' . $request->input('flag') . ' (错误)');
return APIReturn::error("wrong_flag", __("Flag 不正确"), 403);
}

$level = Level::find($flag->challenge->level_id);

if (Log::where([
Expand Down

0 comments on commit 39a1c93

Please sign in to comment.